ketcher-react 2.9.0-rc.9 → 2.10.0-rc.2
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/constants.d.ts +4 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +926 -675
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +928 -678
- package/dist/index.modern.js.map +1 -1
- package/dist/script/editor/Editor.d.ts +2 -1
- package/dist/script/editor/shared/closest.d.ts +3 -1
- package/dist/script/editor/tool/helper/dropAndMerge.d.ts +2 -1
- package/dist/script/editor/tool/select.d.ts +3 -1
- package/dist/script/editor/tool/template.d.ts +8 -1
- package/dist/script/ui/data/schema/struct-schema.d.ts +115 -98
- package/dist/script/ui/dialog/template/template-attach.d.ts +5 -0
- package/dist/script/ui/state/editor/index.d.ts +1 -1
- package/dist/script/ui/state/editor/utils/generateCommonProperties.d.ts +6 -0
- package/dist/script/ui/state/editor/utils/index.d.ts +1 -0
- package/dist/script/ui/state/modal/atoms.d.ts +0 -6
- package/dist/script/ui/state/modal/bonds.d.ts +6 -0
- package/dist/script/ui/state/modal/utils/index.d.ts +1 -0
- package/dist/script/ui/state/modal/utils/updateOnlyChangedProperties.d.ts +1 -0
- package/dist/script/ui/state/shared.d.ts +4 -0
- package/dist/script/ui/views/components/ContextMenu/hooks/useFunctionalGroupEoc.d.ts +1 -1
- package/dist/script/ui/views/modal/components/ExtendedTable/components/GenericGroups/BoxWithLines.d.ts +1 -1
- package/dist/script/ui/views/modal/components/ExtendedTable/components/GenericGroups/GenGroup.d.ts +3 -2
- package/dist/script/ui/views/modal/components/ExtendedTable/components/GenericGroups/GenSet.d.ts +3 -2
- package/dist/script/ui/views/modal/components/ExtendedTable/components/GenericGroups/GenericGroups.d.ts +3 -2
- package/dist/script/ui/views/modal/components/ExtendedTable/components/GenericGroups/components/ButtonGenSet/ButtonGenSet.d.ts +25 -0
- package/dist/script/ui/views/modal/components/ExtendedTable/components/GenericGroups/components/ButtonGenSet/index.d.ts +16 -0
- package/dist/script/ui/views/modal/components/ExtendedTable/components/GenericGroups/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -24,7 +24,7 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
|
24
24
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
25
25
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
26
26
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
27
|
-
import { KetSerializer, MolSerializer, Ketcher, FormatterFactory, StereLabelStyleType, StereoColoringType, Bond as Bond$2, Elements, AtomList, StereoLabel, isAttachmentBond, findStereoAtoms, RxnArrowMode, SimpleObjectMode, SGroup as SGroup$1, Pile, getStereoAtomsMap, identifyStructFormat, SupportedFormat, ChemicalMimeType, SdfSerializer, Render,
|
|
27
|
+
import { KetSerializer, MolSerializer, Ketcher, FormatterFactory, StereLabelStyleType, StereoColoringType, ShowHydrogenLabels, Bond as Bond$2, Elements, AtomList, StereoLabel, isAttachmentBond, Atom as Atom$2, findStereoAtoms, RxnArrowMode, SimpleObjectMode, SGroup as SGroup$1, Pile, getStereoAtomsMap, identifyStructFormat, SupportedFormat, ChemicalMimeType, SdfSerializer, Render, Struct, FunctionalGroupsProvider, SaltsAndSolventsProvider, KetcherAsyncEvents, ElementColor, FunctionalGroup, fromAtomsAttrs, fracAngle, Vec2, Action, fromSgroupDeletion, fromFragmentDeletion, fromAtomAddition, fromBondAddition, fromOneBondDeletion, bondChangingAction, fromBondsAttrs, fromChain, getItemsToFuse, getHoverToFuse, fromItemsFuse, fromStereoFlagUpdate, Scale, checkOverlapping, fromSeveralSgroupAddition, SgContexts, fromSgroupAction, mergeMapOfItemsToSet, setExpandSGroup, fromSimpleObjectResizing, fromArrowResizing, fromMultipleMove, fromTextDeletion, fromTextUpdating, isCloseToEdgeOfCanvas, isCloseToEdgeOfScreen, getDirections, shiftAndExtendCanvasByVector, scrollByVector, fromOneAtomDeletion, fromArrowDeletion, fromPlusDeletion, fromSimpleObjectDeletion, fromPaste, fromTemplateOnAtom, RGroup as RGroup$2, fromRGroupFragment, fromUpdateIfThen, fromRGroupAttrs, fromArrowAddition, fromPlusAddition, fromRotate, fromFlip, fromBondAlign, fromSimpleObjectAddition, fromTemplateOnBondAction, fromTemplateOnCanvas, fromTextCreation, formatProperties, Fragment as Fragment$1, OperationType, fromHighlightCreate, fromHighlightClear, fromNewCanvas, fromDescriptorsAlign, getPropertiesByFormat, StereoFlag, getPropertiesByImgFormat, b64toBlob, Generics, TextCommand, DefaultStructServiceOptions } from 'ketcher-core';
|
|
28
28
|
import * as React from 'react';
|
|
29
29
|
import React__default, { createRef, Component, useState, useEffect, useRef, useMemo, createElement, forwardRef, useCallback, useLayoutEffect, Fragment as Fragment$2, PureComponent } from 'react';
|
|
30
30
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -36,12 +36,12 @@ import _typeof from '@babel/runtime/helpers/typeof';
|
|
|
36
36
|
import Ajv from 'ajv';
|
|
37
37
|
import { pick, range, capitalize, omit, without, findLastIndex, findIndex, pickBy, isEmpty, isEqual, escapeRegExp, flow, filter, reduce, throttle, xor, debounce, upperFirst } from 'lodash/fp';
|
|
38
38
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
39
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
40
39
|
import { isMacOs, isIE } from 'react-device-detect';
|
|
40
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
41
41
|
import ReactDOM from 'react-dom';
|
|
42
42
|
import { connect, useDispatch, Provider } from 'react-redux';
|
|
43
43
|
import { combineReducers, createStore as createStore$1, applyMiddleware } from 'redux';
|
|
44
|
-
import _, { throttle as throttle$1, inRange, difference, cloneDeep, isEqual as isEqual$1, range as range$1 } from 'lodash';
|
|
44
|
+
import _, { throttle as throttle$1, inRange, difference, cloneDeep, isEqual as isEqual$1, range as range$1, isEmpty as isEmpty$1 } from 'lodash';
|
|
45
45
|
import 'redux-logger';
|
|
46
46
|
import thunk from 'redux-thunk';
|
|
47
47
|
import useResizeObserver from 'use-resize-observer/polyfilled';
|
|
@@ -265,7 +265,7 @@ var debugObj = {
|
|
|
265
265
|
}
|
|
266
266
|
};
|
|
267
267
|
|
|
268
|
-
var classes$
|
|
268
|
+
var classes$O = {"cliparea":"cliparea-module_cliparea__GdPrN"};
|
|
269
269
|
|
|
270
270
|
function _createSuper$c(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
271
271
|
function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -339,7 +339,7 @@ var ClipArea = function (_Component) {
|
|
|
339
339
|
value: function render() {
|
|
340
340
|
return jsx("textarea", {
|
|
341
341
|
ref: this.textAreaRef,
|
|
342
|
-
className: clsx('cliparea', classes$
|
|
342
|
+
className: clsx('cliparea', classes$O.cliparea),
|
|
343
343
|
contentEditable: true,
|
|
344
344
|
autoFocus: true
|
|
345
345
|
,
|
|
@@ -533,8 +533,8 @@ var render = {
|
|
|
533
533
|
},
|
|
534
534
|
showHydrogenLabels: {
|
|
535
535
|
title: 'Show hydrogen labels',
|
|
536
|
-
"enum":
|
|
537
|
-
"default":
|
|
536
|
+
"enum": Object.values(ShowHydrogenLabels),
|
|
537
|
+
"default": ShowHydrogenLabels.TerminalAndHetero
|
|
538
538
|
},
|
|
539
539
|
aromaticCircle: {
|
|
540
540
|
title: 'Aromatic Bonds as circle',
|
|
@@ -1431,6 +1431,11 @@ var atom = {
|
|
|
1431
1431
|
enumNames: ['', 'Monoradical', 'Diradical (singlet)', 'Diradical (triplet)'],
|
|
1432
1432
|
"default": 0
|
|
1433
1433
|
},
|
|
1434
|
+
cip: {
|
|
1435
|
+
title: 'CIP',
|
|
1436
|
+
type: 'string',
|
|
1437
|
+
"enum": ['R', 'S', 'r', 's']
|
|
1438
|
+
},
|
|
1434
1439
|
ringBondCount: {
|
|
1435
1440
|
title: 'Ring bond count',
|
|
1436
1441
|
"enum": [0, -2, -1, 2, 3, 4],
|
|
@@ -1517,8 +1522,8 @@ var bond = {
|
|
|
1517
1522
|
properties: {
|
|
1518
1523
|
type: {
|
|
1519
1524
|
title: 'Type',
|
|
1520
|
-
"enum": ['single', 'up', 'down', 'updown', 'double', 'crossed', 'triple', 'aromatic', 'any', 'hydrogen', 'singledouble', 'singlearomatic', 'doublearomatic', 'dative'],
|
|
1521
|
-
enumNames: ['Single', 'Single Up', 'Single Down', 'Single Up/Down', 'Double', 'Double Cis/Trans', 'Triple', 'Aromatic', 'Any', 'Hydrogen', 'Single/Double', 'Single/Aromatic', 'Double/Aromatic', 'Dative'],
|
|
1525
|
+
"enum": ['', 'single', 'up', 'down', 'updown', 'double', 'crossed', 'triple', 'aromatic', 'any', 'hydrogen', 'singledouble', 'singlearomatic', 'doublearomatic', 'dative'],
|
|
1526
|
+
enumNames: ['', 'Single', 'Single Up', 'Single Down', 'Single Up/Down', 'Double', 'Double Cis/Trans', 'Triple', 'Aromatic', 'Any', 'Hydrogen', 'Single/Double', 'Single/Aromatic', 'Double/Aromatic', 'Dative'],
|
|
1522
1527
|
"default": 'single'
|
|
1523
1528
|
},
|
|
1524
1529
|
topology: {
|
|
@@ -1532,6 +1537,11 @@ var bond = {
|
|
|
1532
1537
|
"enum": [0, -1, 1, 2, 4, 8, 12],
|
|
1533
1538
|
enumNames: ['Unmarked', 'Not center', 'Center', 'No change', 'Made/broken', 'Order changes', 'Made/broken and changes'],
|
|
1534
1539
|
"default": 0
|
|
1540
|
+
},
|
|
1541
|
+
cip: {
|
|
1542
|
+
title: 'CIP',
|
|
1543
|
+
type: 'string',
|
|
1544
|
+
"enum": ['E', 'Z', 'M', 'P']
|
|
1535
1545
|
}
|
|
1536
1546
|
}
|
|
1537
1547
|
};
|
|
@@ -1812,7 +1822,7 @@ function fromBondType(type, stereo) {
|
|
|
1812
1822
|
for (var caption in bondCaptionMap) {
|
|
1813
1823
|
if (bondCaptionMap[caption].type === type && bondCaptionMap[caption].stereo === stereo) return caption;
|
|
1814
1824
|
}
|
|
1815
|
-
|
|
1825
|
+
return '';
|
|
1816
1826
|
}
|
|
1817
1827
|
var bondCaptionMap = {
|
|
1818
1828
|
single: {
|
|
@@ -1922,9 +1932,9 @@ function toSgroup(sgroup) {
|
|
|
1922
1932
|
};
|
|
1923
1933
|
}
|
|
1924
1934
|
|
|
1925
|
-
function _createForOfIteratorHelper$
|
|
1926
|
-
function _unsupportedIterableToArray$
|
|
1927
|
-
function _arrayLikeToArray$
|
|
1935
|
+
function _createForOfIteratorHelper$d(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$d(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
1936
|
+
function _unsupportedIterableToArray$d(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$d(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$d(o, minLen); }
|
|
1937
|
+
function _arrayLikeToArray$d(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
1928
1938
|
function isFlipDisabled(editor) {
|
|
1929
1939
|
var selection = editor.selection();
|
|
1930
1940
|
var restruct = editor.render.ctab;
|
|
@@ -1935,74 +1945,54 @@ function isFlipDisabled(editor) {
|
|
|
1935
1945
|
bonds = _selection$bonds === void 0 ? [] : _selection$bonds,
|
|
1936
1946
|
_selection$atoms = selection.atoms,
|
|
1937
1947
|
atoms = _selection$atoms === void 0 ? [] : _selection$atoms;
|
|
1938
|
-
var
|
|
1948
|
+
var getBondIdsForAttachmentAtoms = function getBondIdsForAttachmentAtoms() {
|
|
1939
1949
|
var result = [];
|
|
1940
|
-
var _iterator = _createForOfIteratorHelper$
|
|
1950
|
+
var _iterator = _createForOfIteratorHelper$d(atoms),
|
|
1941
1951
|
_step;
|
|
1942
1952
|
try {
|
|
1943
1953
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1944
|
-
var
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
result.push(bondId);
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
} catch (err) {
|
|
1952
|
-
_iterator.e(err);
|
|
1953
|
-
} finally {
|
|
1954
|
-
_iterator.f();
|
|
1955
|
-
}
|
|
1956
|
-
return result;
|
|
1957
|
-
};
|
|
1958
|
-
var getBondIdsForAttachmentAtoms = function getBondIdsForAttachmentAtoms() {
|
|
1959
|
-
var result = [];
|
|
1960
|
-
var _iterator2 = _createForOfIteratorHelper$e(atoms),
|
|
1961
|
-
_step2;
|
|
1962
|
-
try {
|
|
1963
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1964
|
-
var atomId = _step2.value;
|
|
1965
|
-
var atomBondIds = getBondIdsForAtom(atomId);
|
|
1966
|
-
var _iterator3 = _createForOfIteratorHelper$e(atomBondIds),
|
|
1967
|
-
_step3;
|
|
1954
|
+
var atomId = _step.value;
|
|
1955
|
+
var atomBondIds = Atom$2.getConnectedBondIds(restruct.molecule, atomId);
|
|
1956
|
+
var _iterator2 = _createForOfIteratorHelper$d(atomBondIds),
|
|
1957
|
+
_step2;
|
|
1968
1958
|
try {
|
|
1969
|
-
for (
|
|
1970
|
-
var atomBondId =
|
|
1959
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1960
|
+
var atomBondId = _step2.value;
|
|
1971
1961
|
var bond = restruct.bonds.get(atomBondId);
|
|
1972
1962
|
if (bond && isAttachmentBond(bond.b, selection)) {
|
|
1973
1963
|
result.push(atomBondId);
|
|
1974
1964
|
}
|
|
1975
1965
|
}
|
|
1976
1966
|
} catch (err) {
|
|
1977
|
-
|
|
1967
|
+
_iterator2.e(err);
|
|
1978
1968
|
} finally {
|
|
1979
|
-
|
|
1969
|
+
_iterator2.f();
|
|
1980
1970
|
}
|
|
1981
1971
|
}
|
|
1982
1972
|
} catch (err) {
|
|
1983
|
-
|
|
1973
|
+
_iterator.e(err);
|
|
1984
1974
|
} finally {
|
|
1985
|
-
|
|
1975
|
+
_iterator.f();
|
|
1986
1976
|
}
|
|
1987
1977
|
return result;
|
|
1988
1978
|
};
|
|
1989
1979
|
var getAmountOfAttachmentBonds = function getAmountOfAttachmentBonds() {
|
|
1990
1980
|
var amountOfAttachmentBonds = 0;
|
|
1991
1981
|
var totalBondIds = new Set([].concat(_toConsumableArray(bonds), _toConsumableArray(getBondIdsForAttachmentAtoms())));
|
|
1992
|
-
var
|
|
1993
|
-
|
|
1982
|
+
var _iterator3 = _createForOfIteratorHelper$d(totalBondIds),
|
|
1983
|
+
_step3;
|
|
1994
1984
|
try {
|
|
1995
|
-
for (
|
|
1996
|
-
var bondId =
|
|
1985
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1986
|
+
var bondId = _step3.value;
|
|
1997
1987
|
var bond = restruct.bonds.get(bondId);
|
|
1998
1988
|
if (bond && isAttachmentBond(bond.b, selection)) {
|
|
1999
1989
|
amountOfAttachmentBonds++;
|
|
2000
1990
|
}
|
|
2001
1991
|
}
|
|
2002
1992
|
} catch (err) {
|
|
2003
|
-
|
|
1993
|
+
_iterator3.e(err);
|
|
2004
1994
|
} finally {
|
|
2005
|
-
|
|
1995
|
+
_iterator3.f();
|
|
2006
1996
|
}
|
|
2007
1997
|
return amountOfAttachmentBonds;
|
|
2008
1998
|
};
|
|
@@ -2479,6 +2469,10 @@ var KETCHER_SAVED_SETTINGS_KEY = 'ketcher_editor_saved_settings';
|
|
|
2479
2469
|
var MODES = {
|
|
2480
2470
|
FG: 'fg'
|
|
2481
2471
|
};
|
|
2472
|
+
var STRUCT_TYPE = {
|
|
2473
|
+
atoms: 'atoms',
|
|
2474
|
+
bonds: 'bonds'
|
|
2475
|
+
};
|
|
2482
2476
|
|
|
2483
2477
|
function ownKeys$1a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2484
2478
|
function _objectSpread$1a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1a(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -2559,10 +2553,14 @@ function parseStruct(struct, server, options) {
|
|
|
2559
2553
|
return Promise.resolve(struct);
|
|
2560
2554
|
}
|
|
2561
2555
|
}
|
|
2556
|
+
function removeStructAction() {
|
|
2557
|
+
var savedSelectedTool = SettingsManager.selectionTool;
|
|
2558
|
+
return onAction(savedSelectedTool || tools$1['select-rectangle'].action);
|
|
2559
|
+
}
|
|
2562
2560
|
function load(struct, options) {
|
|
2563
2561
|
return function () {
|
|
2564
2562
|
var _ref = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(dispatch, getState) {
|
|
2565
|
-
var state, editor, server, errorHandler, parsedStruct, _options2, fragment, hasUnsupportedGroups, oldStruct, stereAtomsMap
|
|
2563
|
+
var state, editor, server, errorHandler, parsedStruct, _options2, fragment, hasUnsupportedGroups, oldStruct, stereAtomsMap;
|
|
2566
2564
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2567
2565
|
while (1) {
|
|
2568
2566
|
switch (_context.prev = _context.next) {
|
|
@@ -2627,11 +2625,7 @@ function load(struct, options) {
|
|
|
2627
2625
|
parsedStruct.markFragments();
|
|
2628
2626
|
if (fragment) {
|
|
2629
2627
|
if (parsedStruct.isBlank()) {
|
|
2630
|
-
|
|
2631
|
-
dispatch({
|
|
2632
|
-
type: 'ACTION',
|
|
2633
|
-
action: savedSelectedTool || tools$1['select-rectangle'].action
|
|
2634
|
-
});
|
|
2628
|
+
dispatch(removeStructAction());
|
|
2635
2629
|
} else {
|
|
2636
2630
|
dispatch(onAction({
|
|
2637
2631
|
tool: 'paste',
|
|
@@ -2959,7 +2953,7 @@ var templates = templates$1.reduce(function (res, struct, i) {
|
|
|
2959
2953
|
var zoomList = [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.7, 2, 2.5, 3, 3.5, 4];
|
|
2960
2954
|
var zoom = {
|
|
2961
2955
|
zoom: {
|
|
2962
|
-
shortcut: ['Mod+
|
|
2956
|
+
shortcut: ['Mod+0'],
|
|
2963
2957
|
selected: function selected(editor) {
|
|
2964
2958
|
return editor.zoom();
|
|
2965
2959
|
},
|
|
@@ -3013,7 +3007,7 @@ var zoom = {
|
|
|
3013
3007
|
|
|
3014
3008
|
var openHelpLink = function openHelpLink() {
|
|
3015
3009
|
var _window$open;
|
|
3016
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.
|
|
3010
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.10.0-rc.2\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
|
|
3017
3011
|
};
|
|
3018
3012
|
var help = {
|
|
3019
3013
|
help: {
|
|
@@ -6992,7 +6986,7 @@ function Icon(_ref) {
|
|
|
6992
6986
|
return jsx(Component, _objectSpread$17({}, props));
|
|
6993
6987
|
}
|
|
6994
6988
|
|
|
6995
|
-
var classes$
|
|
6989
|
+
var classes$N = {"button-common-styles":"ActionButton-module_button-common-styles__y-hng","scrollbar":"ActionButton-module_scrollbar__lD3MH","button":"ActionButton-module_button__nfoWQ","selected":"ActionButton-module_selected__kPCxA"};
|
|
6996
6990
|
|
|
6997
6991
|
var shortcutAliasMap = {
|
|
6998
6992
|
Escape: 'Esc',
|
|
@@ -7031,10 +7025,11 @@ var ActionButton = function ActionButton(props) {
|
|
|
7031
7025
|
}
|
|
7032
7026
|
};
|
|
7033
7027
|
return jsxs("button", {
|
|
7028
|
+
"data-testid": name,
|
|
7034
7029
|
disabled: disabled,
|
|
7035
7030
|
onClick: handleClick,
|
|
7036
7031
|
title: shortcut ? "".concat(action === null || action === void 0 ? void 0 : action.title, " (").concat(shortcut, ")") : action === null || action === void 0 ? void 0 : action.title,
|
|
7037
|
-
className: clsx(classes$
|
|
7032
|
+
className: clsx(classes$N.button, _defineProperty({}, classes$N.selected, selected), className),
|
|
7038
7033
|
children: [jsx(Icon, {
|
|
7039
7034
|
name: name
|
|
7040
7035
|
}), jsx("kbd", {
|
|
@@ -7190,7 +7185,7 @@ var DefaultMultiTool = function DefaultMultiTool(props) {
|
|
|
7190
7185
|
});
|
|
7191
7186
|
};
|
|
7192
7187
|
|
|
7193
|
-
var classes$
|
|
7188
|
+
var classes$M = {"group":"GroupedMultiTool-module_group__BJQAU"};
|
|
7194
7189
|
|
|
7195
7190
|
var GroupedMultiTool = function GroupedMultiTool(props) {
|
|
7196
7191
|
var groups = props.groups,
|
|
@@ -7205,7 +7200,7 @@ var GroupedMultiTool = function GroupedMultiTool(props) {
|
|
|
7205
7200
|
return jsx(Fragment, {
|
|
7206
7201
|
children: groups.map(function (descriptor) {
|
|
7207
7202
|
return jsx("div", {
|
|
7208
|
-
className: classes$
|
|
7203
|
+
className: classes$M.group,
|
|
7209
7204
|
children: options.slice(descriptor.start, descriptor.end).map(function (toolbarItem) {
|
|
7210
7205
|
var currentStatus = status[toolbarItem.id];
|
|
7211
7206
|
return jsx(ActionButton, {
|
|
@@ -7235,7 +7230,7 @@ function chooseMultiTool() {
|
|
|
7235
7230
|
}
|
|
7236
7231
|
}
|
|
7237
7232
|
|
|
7238
|
-
var classes$
|
|
7233
|
+
var classes$L = {"button-common-styles":"ToolbarMultiToolItem-module_button-common-styles__Fuxbo","scrollbar":"ToolbarMultiToolItem-module_scrollbar__XTmfz","icon":"ToolbarMultiToolItem-module_icon__-HQal","iconSelected":"ToolbarMultiToolItem-module_iconSelected__hlO0J","portal":"ToolbarMultiToolItem-module_portal__2XJgz","portal-vertical":"ToolbarMultiToolItem-module_portal-vertical__A0DVe"};
|
|
7239
7234
|
|
|
7240
7235
|
function usePortalOpening(_ref) {
|
|
7241
7236
|
var _ref2 = _slicedToArray(_ref, 3),
|
|
@@ -7354,7 +7349,7 @@ var ToolbarMultiToolItem = function ToolbarMultiToolItem(props) {
|
|
|
7354
7349
|
portalClassName = _chooseMultiTool2[1];
|
|
7355
7350
|
return displayMultiToolItem ? jsxs("div", {
|
|
7356
7351
|
ref: ref,
|
|
7357
|
-
className: classes$
|
|
7352
|
+
className: classes$L.root,
|
|
7358
7353
|
children: [jsx(ActionButton, _objectSpread$16(_objectSpread$16({}, actionButtonProps), {}, {
|
|
7359
7354
|
className: className,
|
|
7360
7355
|
name: currentId,
|
|
@@ -7362,12 +7357,12 @@ var ToolbarMultiToolItem = function ToolbarMultiToolItem(props) {
|
|
|
7362
7357
|
status: currentStatus,
|
|
7363
7358
|
selected: selected
|
|
7364
7359
|
})), !isOpen && jsx(Icon, {
|
|
7365
|
-
className: "".concat(classes$
|
|
7360
|
+
className: "".concat(classes$L.icon, " ").concat((currentStatus === null || currentStatus === void 0 ? void 0 : currentStatus.selected) && classes$L.iconSelected),
|
|
7366
7361
|
name: "dropdown",
|
|
7367
7362
|
onClick: onOpenOptions
|
|
7368
7363
|
}), isOpen ? jsx(Portal, {
|
|
7369
7364
|
isOpen: isOpen,
|
|
7370
|
-
className: clsx(classes$
|
|
7365
|
+
className: clsx(classes$L.portal, vertical && classes$L['portal-vertical'], portalClassName),
|
|
7371
7366
|
style: portalStyle,
|
|
7372
7367
|
children: jsx(Component, {
|
|
7373
7368
|
options: options,
|
|
@@ -7452,7 +7447,7 @@ var TemplatesList = function TemplatesList(props) {
|
|
|
7452
7447
|
});
|
|
7453
7448
|
};
|
|
7454
7449
|
|
|
7455
|
-
var classes$
|
|
7450
|
+
var classes$K = {"button-common-styles":"BottomToolbar-module_button-common-styles__PbtE9","scrollbar":"BottomToolbar-module_scrollbar__i1f8P","group":"BottomToolbar-module_group__b-pGt","root":"BottomToolbar-module_root__kjkSm"};
|
|
7456
7451
|
|
|
7457
7452
|
var _excluded$A = ["className"];
|
|
7458
7453
|
function ownKeys$15(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -7461,7 +7456,7 @@ var Group$1 = function Group(_ref) {
|
|
|
7461
7456
|
var children = _ref.children,
|
|
7462
7457
|
className = _ref.className;
|
|
7463
7458
|
return jsx("div", {
|
|
7464
|
-
className: clsx(classes$
|
|
7459
|
+
className: clsx(classes$K.group, className),
|
|
7465
7460
|
children: children
|
|
7466
7461
|
});
|
|
7467
7462
|
};
|
|
@@ -7473,7 +7468,7 @@ var BottomToolbar = function BottomToolbar(props) {
|
|
|
7473
7468
|
indigoVerification = rest.indigoVerification,
|
|
7474
7469
|
onAction = rest.onAction;
|
|
7475
7470
|
return jsxs("div", {
|
|
7476
|
-
className: clsx(classes$
|
|
7471
|
+
className: clsx(classes$K.root, className),
|
|
7477
7472
|
children: [jsx(Group$1, {
|
|
7478
7473
|
children: jsx(TemplatesList, {
|
|
7479
7474
|
active: active,
|
|
@@ -7889,9 +7884,11 @@ var RenderStruct = function () {
|
|
|
7889
7884
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
7890
7885
|
if (el && struct) {
|
|
7891
7886
|
var _options$cachePrefix = options.cachePrefix,
|
|
7892
|
-
cachePrefix = _options$cachePrefix === void 0 ? '' : _options$cachePrefix
|
|
7887
|
+
cachePrefix = _options$cachePrefix === void 0 ? '' : _options$cachePrefix,
|
|
7888
|
+
_options$needCache = options.needCache,
|
|
7889
|
+
needCache = _options$needCache === void 0 ? true : _options$needCache;
|
|
7893
7890
|
var cacheKey = "".concat(cachePrefix).concat(struct.name);
|
|
7894
|
-
if (renderCache.has(cacheKey)) {
|
|
7891
|
+
if (renderCache.has(cacheKey) && needCache) {
|
|
7895
7892
|
el.innerHTML = renderCache.get(cacheKey);
|
|
7896
7893
|
return;
|
|
7897
7894
|
}
|
|
@@ -7905,7 +7902,9 @@ var RenderStruct = function () {
|
|
|
7905
7902
|
}, options));
|
|
7906
7903
|
rnd.setMolecule(preparedStruct);
|
|
7907
7904
|
rnd.update(true, options.viewSz);
|
|
7908
|
-
|
|
7905
|
+
if (needCache) {
|
|
7906
|
+
renderCache.set(cacheKey, rnd.clientArea.innerHTML);
|
|
7907
|
+
}
|
|
7909
7908
|
}
|
|
7910
7909
|
}
|
|
7911
7910
|
}]);
|
|
@@ -8032,6 +8031,26 @@ function memoizedDebounce(func) {
|
|
|
8032
8031
|
|
|
8033
8032
|
var showTooltipTimer = null;
|
|
8034
8033
|
var TOOLTIP_DELAY = 300;
|
|
8034
|
+
function makeStruct(editor, sGroup) {
|
|
8035
|
+
var existingStruct = editor.struct();
|
|
8036
|
+
var struct = new Struct();
|
|
8037
|
+
var atomsIdMapping = new Map();
|
|
8038
|
+
sGroup.atoms.forEach(function (atomId) {
|
|
8039
|
+
var atomIdInTooltip = struct.atoms.add(existingStruct.atoms.get(atomId));
|
|
8040
|
+
atomsIdMapping.set(atomId, atomIdInTooltip);
|
|
8041
|
+
});
|
|
8042
|
+
Array.from(existingStruct.bonds).forEach(function (value) {
|
|
8043
|
+
var _value = _slicedToArray(value, 2);
|
|
8044
|
+
_value[0];
|
|
8045
|
+
var bond = _value[1];
|
|
8046
|
+
var clonedBond = bond.clone(atomsIdMapping);
|
|
8047
|
+
var isInsideSGroup = sGroup.atoms.includes(bond.begin) || sGroup.atoms.includes(bond.end);
|
|
8048
|
+
if (isInsideSGroup) {
|
|
8049
|
+
struct.bonds.add(clonedBond);
|
|
8050
|
+
}
|
|
8051
|
+
});
|
|
8052
|
+
return struct;
|
|
8053
|
+
}
|
|
8035
8054
|
function showTooltip(editor, infoPanelData) {
|
|
8036
8055
|
editor.event.showInfo.dispatch(null);
|
|
8037
8056
|
if (showTooltipTimer) {
|
|
@@ -8050,9 +8069,10 @@ function showFunctionalGroupsTooltip(editor) {
|
|
|
8050
8069
|
if (closestCollapsibleStructures) {
|
|
8051
8070
|
var _editor$struct;
|
|
8052
8071
|
var sGroup = (_editor$struct = editor.struct()) === null || _editor$struct === void 0 ? void 0 : _editor$struct.sgroups.get(closestCollapsibleStructures.id);
|
|
8053
|
-
if (sGroup && !sGroup.data.expanded) {
|
|
8072
|
+
if (sGroup && !sGroup.data.expanded && sGroup.hovering) {
|
|
8054
8073
|
var groupName = sGroup.data.name;
|
|
8055
|
-
var groupStruct =
|
|
8074
|
+
var groupStruct = makeStruct(editor, sGroup);
|
|
8075
|
+
groupStruct.name = groupName;
|
|
8056
8076
|
infoPanelData = {
|
|
8057
8077
|
groupStruct: groupStruct,
|
|
8058
8078
|
event: event,
|
|
@@ -8459,7 +8479,7 @@ var selectOptions$2 = makeItems(['select-rectangle', 'select-lasso', 'select-fra
|
|
|
8459
8479
|
var arrowsOptions = makeItems(['reaction-arrow-open-angle', 'reaction-arrow-filled-triangle', 'reaction-arrow-filled-bow', 'reaction-arrow-dashed-open-angle', 'reaction-arrow-failed', 'reaction-arrow-both-ends-filled-triangle', 'reaction-arrow-equilibrium-filled-half-bow', 'reaction-arrow-equilibrium-filled-triangle', 'reaction-arrow-equilibrium-open-angle', 'reaction-arrow-unbalanced-equilibrium-filled-half-bow', 'reaction-arrow-unbalanced-equilibrium-open-half-angle', 'reaction-arrow-unbalanced-equilibrium-large-filled-half-bow', 'reaction-arrow-unbalanced-equilibrium-filled-half-triangle', 'reaction-arrow-elliptical-arc-arrow-filled-bow', 'reaction-arrow-elliptical-arc-arrow-filled-triangle', 'reaction-arrow-elliptical-arc-arrow-open-angle', 'reaction-arrow-elliptical-arc-arrow-open-half-angle']);
|
|
8460
8480
|
var mappingOptions = makeItems(['reaction-map', 'reaction-unmap', 'reaction-automap']);
|
|
8461
8481
|
|
|
8462
|
-
var classes$
|
|
8482
|
+
var classes$J = {"scroll":"ArrowScroll-module_scroll__h9kCx","button":"ArrowScroll-module_button__ygMgL","down":"ArrowScroll-module_down__yDzZX","up":"ArrowScroll-module_up__Q1ubd"};
|
|
8463
8483
|
|
|
8464
8484
|
function useSettingsContext() {
|
|
8465
8485
|
return React__default.useContext(settingsContext);
|
|
@@ -8578,7 +8598,7 @@ var ArrowScroll = function ArrowScroll(_ref) {
|
|
|
8578
8598
|
};
|
|
8579
8599
|
}, [endInView]);
|
|
8580
8600
|
return jsxs("div", {
|
|
8581
|
-
className: classes$
|
|
8601
|
+
className: classes$J.scroll,
|
|
8582
8602
|
children: [endInView ? jsx(Fragment, {}) : jsx("button", {
|
|
8583
8603
|
onClick: function onClick() {
|
|
8584
8604
|
return scrollDown();
|
|
@@ -8589,7 +8609,7 @@ var ArrowScroll = function ArrowScroll(_ref) {
|
|
|
8589
8609
|
onMouseDown: function onMouseDown() {
|
|
8590
8610
|
return setScrollDown(true);
|
|
8591
8611
|
},
|
|
8592
|
-
className: clsx(classes$
|
|
8612
|
+
className: clsx(classes$J.button, classes$J.down),
|
|
8593
8613
|
children: "\u25BC"
|
|
8594
8614
|
}), startInView ? jsx(Fragment, {}) : jsx("button", {
|
|
8595
8615
|
onClick: function onClick() {
|
|
@@ -8601,7 +8621,7 @@ var ArrowScroll = function ArrowScroll(_ref) {
|
|
|
8601
8621
|
onMouseDown: function onMouseDown() {
|
|
8602
8622
|
return setScrollUp(true);
|
|
8603
8623
|
},
|
|
8604
|
-
className: clsx(classes$
|
|
8624
|
+
className: clsx(classes$J.button, classes$J.up),
|
|
8605
8625
|
children: "\u25B2"
|
|
8606
8626
|
})]
|
|
8607
8627
|
});
|
|
@@ -8687,7 +8707,7 @@ var Transform = function Transform(props) {
|
|
|
8687
8707
|
});
|
|
8688
8708
|
};
|
|
8689
8709
|
|
|
8690
|
-
var classes$
|
|
8710
|
+
var classes$I = {"button-common-styles":"LeftToolbar-module_button-common-styles__WgnON","scrollbar":"LeftToolbar-module_scrollbar__OBwid","group":"LeftToolbar-module_group__0s41t","root":"LeftToolbar-module_root__yhhZm","buttons":"LeftToolbar-module_buttons__lnIjn","borderOff":"LeftToolbar-module_borderOff__om425","groupItem":"LeftToolbar-module_groupItem__OqQu0"};
|
|
8691
8711
|
|
|
8692
8712
|
var _excluded$v = ["className"];
|
|
8693
8713
|
function ownKeys$T(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -8747,7 +8767,7 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8747
8767
|
});
|
|
8748
8768
|
}
|
|
8749
8769
|
return visibleItems.length ? jsx("div", {
|
|
8750
|
-
className: clsx(classes$
|
|
8770
|
+
className: clsx(classes$I.group, className),
|
|
8751
8771
|
children: visibleItems.map(function (item) {
|
|
8752
8772
|
switch (item.id) {
|
|
8753
8773
|
case 'bond-common':
|
|
@@ -8778,16 +8798,16 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8778
8798
|
}) : null;
|
|
8779
8799
|
};
|
|
8780
8800
|
return jsxs("div", {
|
|
8781
|
-
className: clsx(classes$
|
|
8801
|
+
className: clsx(classes$I.root, className),
|
|
8782
8802
|
ref: ref,
|
|
8783
8803
|
children: [jsxs("div", {
|
|
8784
|
-
className: classes$
|
|
8804
|
+
className: classes$I.buttons,
|
|
8785
8805
|
ref: scrollRef,
|
|
8786
8806
|
children: [jsx("div", {
|
|
8787
|
-
className: classes$
|
|
8807
|
+
className: classes$I.listener,
|
|
8788
8808
|
ref: startRef,
|
|
8789
8809
|
children: jsx(Group, {
|
|
8790
|
-
className: classes$
|
|
8810
|
+
className: classes$I.groupItem,
|
|
8791
8811
|
items: [{
|
|
8792
8812
|
id: 'hand'
|
|
8793
8813
|
}, {
|
|
@@ -8798,7 +8818,7 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8798
8818
|
}]
|
|
8799
8819
|
})
|
|
8800
8820
|
}), jsx(Group, {
|
|
8801
|
-
className: classes$
|
|
8821
|
+
className: classes$I.groupItem,
|
|
8802
8822
|
items: [{
|
|
8803
8823
|
id: 'bonds',
|
|
8804
8824
|
options: [].concat(_toConsumableArray(bondCommon), _toConsumableArray(bondQuery), _toConsumableArray(bondSpecial), _toConsumableArray(bondStereo))
|
|
@@ -8806,30 +8826,30 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8806
8826
|
id: 'chain'
|
|
8807
8827
|
}]
|
|
8808
8828
|
}), jsx(Group, {
|
|
8809
|
-
className: classes$
|
|
8829
|
+
className: classes$I.groupItem,
|
|
8810
8830
|
items: [{
|
|
8811
8831
|
id: 'enhanced-stereo'
|
|
8812
8832
|
}]
|
|
8813
8833
|
}), jsx(Group, {
|
|
8814
|
-
className: classes$
|
|
8834
|
+
className: classes$I.groupItem,
|
|
8815
8835
|
items: [{
|
|
8816
8836
|
id: 'charge-plus'
|
|
8817
8837
|
}, {
|
|
8818
8838
|
id: 'charge-minus'
|
|
8819
8839
|
}]
|
|
8820
8840
|
}), jsx(Group, {
|
|
8821
|
-
className: classes$
|
|
8841
|
+
className: classes$I.groupItem,
|
|
8822
8842
|
items: [{
|
|
8823
8843
|
id: 'transforms',
|
|
8824
8844
|
options: transformOptions
|
|
8825
8845
|
}]
|
|
8826
8846
|
}), jsx(Group, {
|
|
8827
|
-
className: classes$
|
|
8847
|
+
className: classes$I.groupItem,
|
|
8828
8848
|
items: [{
|
|
8829
8849
|
id: 'sgroup'
|
|
8830
8850
|
}]
|
|
8831
8851
|
}), jsx(Group, {
|
|
8832
|
-
className: classes$
|
|
8852
|
+
className: classes$I.groupItem,
|
|
8833
8853
|
items: [{
|
|
8834
8854
|
id: 'reaction-plus'
|
|
8835
8855
|
}, {
|
|
@@ -8840,17 +8860,17 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8840
8860
|
options: mappingOptions
|
|
8841
8861
|
}]
|
|
8842
8862
|
}), jsx("div", {
|
|
8843
|
-
className: classes$
|
|
8863
|
+
className: classes$I.listener,
|
|
8844
8864
|
ref: sizeRef,
|
|
8845
8865
|
children: jsx(Group, {
|
|
8846
|
-
className: classes$
|
|
8866
|
+
className: classes$I.groupItem,
|
|
8847
8867
|
items: [{
|
|
8848
8868
|
id: 'rgroup',
|
|
8849
8869
|
options: rGroupOptions
|
|
8850
8870
|
}]
|
|
8851
8871
|
})
|
|
8852
8872
|
}), jsx(Group, {
|
|
8853
|
-
className: classes$
|
|
8873
|
+
className: classes$I.groupItem,
|
|
8854
8874
|
items: [{
|
|
8855
8875
|
id: 'shapes',
|
|
8856
8876
|
options: shapeOptions
|
|
@@ -8858,7 +8878,7 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8858
8878
|
}), jsx("div", {
|
|
8859
8879
|
ref: endRef,
|
|
8860
8880
|
children: jsx(Group, {
|
|
8861
|
-
className: classes$
|
|
8881
|
+
className: classes$I.groupItem,
|
|
8862
8882
|
items: [{
|
|
8863
8883
|
id: 'text'
|
|
8864
8884
|
}]
|
|
@@ -8899,7 +8919,7 @@ var mapDispatchToProps$h = function mapDispatchToProps(dispatch) {
|
|
|
8899
8919
|
};
|
|
8900
8920
|
var LeftToolbarContainer = connect(mapStateToProps$i, mapDispatchToProps$h)(LeftToolbar);
|
|
8901
8921
|
|
|
8902
|
-
var classes$
|
|
8922
|
+
var classes$H = {"button-common-styles":"Atom-module_button-common-styles__j3EUJ","scrollbar":"Atom-module_scrollbar__iO-Ni","atom":"Atom-module_atom__g2RUu"};
|
|
8903
8923
|
|
|
8904
8924
|
var _excluded$u = ["el", "shortcut", "selected"];
|
|
8905
8925
|
function ownKeys$S(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -8911,7 +8931,7 @@ function Atom$1(_ref) {
|
|
|
8911
8931
|
props = _objectWithoutProperties(_ref, _excluded$u);
|
|
8912
8932
|
return jsx("button", _objectSpread$S(_objectSpread$S({
|
|
8913
8933
|
title: shortcut ? "".concat(el.title, " (").concat(shortcut, ")") : el.title,
|
|
8914
|
-
className: clsx(classes$
|
|
8934
|
+
className: clsx(classes$H.atom, {
|
|
8915
8935
|
selected: selected
|
|
8916
8936
|
}),
|
|
8917
8937
|
value: el.number
|
|
@@ -9290,7 +9310,7 @@ var AtomsList = forwardRef(function (props, ref) {
|
|
|
9290
9310
|
});
|
|
9291
9311
|
});
|
|
9292
9312
|
|
|
9293
|
-
var classes$
|
|
9313
|
+
var classes$G = {"button-common-styles":"RightToolbar-module_button-common-styles__fNlqY","scrollbar":"RightToolbar-module_scrollbar__2Q0UU","group":"RightToolbar-module_group__3mhUx","root":"RightToolbar-module_root__1D5hp","atomsList":"RightToolbar-module_atomsList__ar08-","buttons":"RightToolbar-module_buttons__YxRHI"};
|
|
9294
9314
|
|
|
9295
9315
|
var _excluded$t = ["className"];
|
|
9296
9316
|
function ownKeys$R(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -9299,7 +9319,7 @@ var Group = function Group(_ref) {
|
|
|
9299
9319
|
var children = _ref.children,
|
|
9300
9320
|
className = _ref.className;
|
|
9301
9321
|
return jsx("div", {
|
|
9302
|
-
className: clsx(classes$
|
|
9322
|
+
className: clsx(classes$G.group, className),
|
|
9303
9323
|
children: children
|
|
9304
9324
|
});
|
|
9305
9325
|
};
|
|
@@ -9330,12 +9350,12 @@ var RightToolbar = function RightToolbar(props) {
|
|
|
9330
9350
|
scrollRef.current.scrollTop += sizeRef.current.offsetHeight;
|
|
9331
9351
|
};
|
|
9332
9352
|
return jsxs("div", {
|
|
9333
|
-
className: clsx(classes$
|
|
9353
|
+
className: clsx(classes$G.root, className),
|
|
9334
9354
|
children: [jsxs("div", {
|
|
9335
|
-
className: classes$
|
|
9355
|
+
className: classes$G.buttons,
|
|
9336
9356
|
ref: scrollRef,
|
|
9337
9357
|
children: [jsxs(Group, {
|
|
9338
|
-
className: classes$
|
|
9358
|
+
className: classes$G.atomsList,
|
|
9339
9359
|
children: [jsx(AtomsList, {
|
|
9340
9360
|
ref: startRef,
|
|
9341
9361
|
atoms: basicAtoms,
|
|
@@ -10048,7 +10068,8 @@ var mapDispatchToProps$e = function mapDispatchToProps(dispatch) {
|
|
|
10048
10068
|
return dispatchAction('open');
|
|
10049
10069
|
},
|
|
10050
10070
|
onSave: function onSave() {
|
|
10051
|
-
|
|
10071
|
+
dispatch(removeStructAction());
|
|
10072
|
+
dispatchAction('save');
|
|
10052
10073
|
},
|
|
10053
10074
|
onUndo: function onUndo() {
|
|
10054
10075
|
return dispatchAction('undo');
|
|
@@ -10198,9 +10219,9 @@ function lookup(map, event) {
|
|
|
10198
10219
|
}
|
|
10199
10220
|
keyNorm.lookup = lookup;
|
|
10200
10221
|
|
|
10201
|
-
function _createForOfIteratorHelper$
|
|
10202
|
-
function _unsupportedIterableToArray$
|
|
10203
|
-
function _arrayLikeToArray$
|
|
10222
|
+
function _createForOfIteratorHelper$c(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$c(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
10223
|
+
function _unsupportedIterableToArray$c(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$c(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$c(o, minLen); }
|
|
10224
|
+
function _arrayLikeToArray$c(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10204
10225
|
var APointTool = function () {
|
|
10205
10226
|
function APointTool(editor) {
|
|
10206
10227
|
_classCallCheck(this, APointTool);
|
|
@@ -10236,7 +10257,7 @@ var APointTool = function () {
|
|
|
10236
10257
|
}
|
|
10237
10258
|
}
|
|
10238
10259
|
if (atomResult.length > 0) {
|
|
10239
|
-
var _iterator = _createForOfIteratorHelper$
|
|
10260
|
+
var _iterator = _createForOfIteratorHelper$c(atomResult),
|
|
10240
10261
|
_step;
|
|
10241
10262
|
try {
|
|
10242
10263
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -10347,9 +10368,9 @@ var utils = {
|
|
|
10347
10368
|
getNonGroupItemsAndAttachmentPoints: getNonGroupItemsAndAttachmentPoints
|
|
10348
10369
|
};
|
|
10349
10370
|
|
|
10350
|
-
function _createForOfIteratorHelper$
|
|
10351
|
-
function _unsupportedIterableToArray$
|
|
10352
|
-
function _arrayLikeToArray$
|
|
10371
|
+
function _createForOfIteratorHelper$b(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$b(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
10372
|
+
function _unsupportedIterableToArray$b(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$b(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$b(o, minLen); }
|
|
10373
|
+
function _arrayLikeToArray$b(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10353
10374
|
function _classPrivateFieldInitSpec$2(obj, privateMap, value) { _checkPrivateRedeclaration$2(obj, privateMap); privateMap.set(obj, value); }
|
|
10354
10375
|
function _checkPrivateRedeclaration$2(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
10355
10376
|
var _bondProps = new WeakMap();
|
|
@@ -10426,7 +10447,7 @@ var AtomTool = function () {
|
|
|
10426
10447
|
if (atomId !== null) atomResult.push(atomId);
|
|
10427
10448
|
}
|
|
10428
10449
|
if (atomResult.length > 0) {
|
|
10429
|
-
var _iterator = _createForOfIteratorHelper$
|
|
10450
|
+
var _iterator = _createForOfIteratorHelper$b(atomResult),
|
|
10430
10451
|
_step;
|
|
10431
10452
|
try {
|
|
10432
10453
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -10457,12 +10478,14 @@ var AtomTool = function () {
|
|
|
10457
10478
|
}, {
|
|
10458
10479
|
key: "mousemove",
|
|
10459
10480
|
value: function mousemove(event) {
|
|
10460
|
-
this.editor.hoverIcon.show();
|
|
10461
10481
|
var rnd = this.editor.render;
|
|
10462
10482
|
if (!this.dragCtx || !this.dragCtx.item) {
|
|
10483
|
+
this.editor.hoverIcon.show();
|
|
10463
10484
|
this.editor.hoverIcon.updatePosition();
|
|
10464
10485
|
this.editor.hover(this.editor.findItem(event, ['atoms', 'functionalGroups']), null, event);
|
|
10465
10486
|
return;
|
|
10487
|
+
} else {
|
|
10488
|
+
this.editor.hoverIcon.hide();
|
|
10466
10489
|
}
|
|
10467
10490
|
var dragCtx = this.dragCtx;
|
|
10468
10491
|
var ci = this.editor.findItem(event, ['atoms']);
|
|
@@ -10479,7 +10502,7 @@ var AtomTool = function () {
|
|
|
10479
10502
|
});
|
|
10480
10503
|
var newAtomPos = utils.calcNewAtomPos(atom === null || atom === void 0 ? void 0 : atom.pp, rnd.page2obj(event), event.ctrlKey);
|
|
10481
10504
|
if (dragCtx.action) dragCtx.action.perform(rnd.ctab);
|
|
10482
|
-
dragCtx.action = fromBondAddition(rnd.ctab, _classPrivateFieldGet(this, _bondProps), dragCtx.item.id, Object.assign({}, this.atomProps),
|
|
10505
|
+
dragCtx.action = fromBondAddition(rnd.ctab, _classPrivateFieldGet(this, _bondProps), dragCtx.item.id, Object.assign({}, this.atomProps), undefined, newAtomPos)[0];
|
|
10483
10506
|
this.editor.update(dragCtx.action, true);
|
|
10484
10507
|
}
|
|
10485
10508
|
}, {
|
|
@@ -10496,7 +10519,7 @@ var AtomTool = function () {
|
|
|
10496
10519
|
if (atomId !== null) atomResult.push(atomId);
|
|
10497
10520
|
}
|
|
10498
10521
|
if (atomResult.length > 0) {
|
|
10499
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
10522
|
+
var _iterator2 = _createForOfIteratorHelper$b(atomResult),
|
|
10500
10523
|
_step2;
|
|
10501
10524
|
try {
|
|
10502
10525
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -10565,9 +10588,9 @@ function atomLongtapEvent(tool, render) {
|
|
|
10565
10588
|
};
|
|
10566
10589
|
}
|
|
10567
10590
|
|
|
10568
|
-
function _createForOfIteratorHelper$
|
|
10569
|
-
function _unsupportedIterableToArray$
|
|
10570
|
-
function _arrayLikeToArray$
|
|
10591
|
+
function _createForOfIteratorHelper$a(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$a(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
10592
|
+
function _unsupportedIterableToArray$a(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$a(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$a(o, minLen); }
|
|
10593
|
+
function _arrayLikeToArray$a(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10571
10594
|
var AttachTool = function () {
|
|
10572
10595
|
function AttachTool(editor, attachPoints) {
|
|
10573
10596
|
_classCallCheck(this, AttachTool);
|
|
@@ -10620,7 +10643,7 @@ var AttachTool = function () {
|
|
|
10620
10643
|
}
|
|
10621
10644
|
}
|
|
10622
10645
|
if (atomResult.length > 0) {
|
|
10623
|
-
var _iterator = _createForOfIteratorHelper$
|
|
10646
|
+
var _iterator = _createForOfIteratorHelper$a(atomResult),
|
|
10624
10647
|
_step;
|
|
10625
10648
|
try {
|
|
10626
10649
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -10640,7 +10663,7 @@ var AttachTool = function () {
|
|
|
10640
10663
|
});
|
|
10641
10664
|
return;
|
|
10642
10665
|
} else if (bondResult.length > 0) {
|
|
10643
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
10666
|
+
var _iterator2 = _createForOfIteratorHelper$a(bondResult),
|
|
10644
10667
|
_step2;
|
|
10645
10668
|
try {
|
|
10646
10669
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -10676,9 +10699,9 @@ var AttachTool = function () {
|
|
|
10676
10699
|
return AttachTool;
|
|
10677
10700
|
}();
|
|
10678
10701
|
|
|
10679
|
-
function _createForOfIteratorHelper$
|
|
10680
|
-
function _unsupportedIterableToArray$
|
|
10681
|
-
function _arrayLikeToArray$
|
|
10702
|
+
function _createForOfIteratorHelper$9(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$9(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
10703
|
+
function _unsupportedIterableToArray$9(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$9(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$9(o, minLen); }
|
|
10704
|
+
function _arrayLikeToArray$9(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10682
10705
|
var BondTool = function () {
|
|
10683
10706
|
function BondTool(editor, bondProps) {
|
|
10684
10707
|
var _editor$selection;
|
|
@@ -10702,7 +10725,7 @@ var BondTool = function () {
|
|
|
10702
10725
|
var struct = this.editor.render.ctab;
|
|
10703
10726
|
var molecule = struct.molecule;
|
|
10704
10727
|
var functionalGroups = molecule.functionalGroups;
|
|
10705
|
-
var ci = this.editor.findItem(event, ['atoms', 'bonds']);
|
|
10728
|
+
var ci = this.editor.findItem(event, ['atoms', 'bonds', 'functionalGroups']);
|
|
10706
10729
|
var atomResult = [];
|
|
10707
10730
|
var bondResult = [];
|
|
10708
10731
|
var result = [];
|
|
@@ -10715,7 +10738,7 @@ var BondTool = function () {
|
|
|
10715
10738
|
if (bondId !== null) bondResult.push(bondId);
|
|
10716
10739
|
}
|
|
10717
10740
|
if (atomResult.length > 0) {
|
|
10718
|
-
var _iterator = _createForOfIteratorHelper$
|
|
10741
|
+
var _iterator = _createForOfIteratorHelper$9(atomResult),
|
|
10719
10742
|
_step;
|
|
10720
10743
|
try {
|
|
10721
10744
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -10735,7 +10758,7 @@ var BondTool = function () {
|
|
|
10735
10758
|
});
|
|
10736
10759
|
return;
|
|
10737
10760
|
} else if (bondResult.length > 0) {
|
|
10738
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
10761
|
+
var _iterator2 = _createForOfIteratorHelper$9(bondResult),
|
|
10739
10762
|
_step2;
|
|
10740
10763
|
try {
|
|
10741
10764
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -10755,12 +10778,19 @@ var BondTool = function () {
|
|
|
10755
10778
|
});
|
|
10756
10779
|
return;
|
|
10757
10780
|
}
|
|
10781
|
+
var attachmentAtomId;
|
|
10782
|
+
if ((ci === null || ci === void 0 ? void 0 : ci.map) === 'functionalGroups') {
|
|
10783
|
+
attachmentAtomId = SGroup$1.getAttachmentAtomIdBySGroupId(ci.id, molecule);
|
|
10784
|
+
}
|
|
10758
10785
|
var rnd = this.editor.render;
|
|
10759
10786
|
this.editor.hover(null);
|
|
10760
10787
|
this.editor.selection(null);
|
|
10761
10788
|
this.dragCtx = {
|
|
10762
10789
|
xy0: rnd.page2obj(event),
|
|
10763
|
-
item:
|
|
10790
|
+
item: attachmentAtomId === undefined ? ci : {
|
|
10791
|
+
map: 'atoms',
|
|
10792
|
+
id: attachmentAtomId
|
|
10793
|
+
}
|
|
10764
10794
|
};
|
|
10765
10795
|
if (!this.dragCtx.item)
|
|
10766
10796
|
delete this.dragCtx.item;
|
|
@@ -10785,24 +10815,26 @@ var BondTool = function () {
|
|
|
10785
10815
|
info: degrees + 'º'
|
|
10786
10816
|
});
|
|
10787
10817
|
if (!('item' in dragCtx) || dragCtx.item.map === 'atoms') {
|
|
10788
|
-
var
|
|
10818
|
+
var _endAtom2;
|
|
10789
10819
|
if ('action' in dragCtx) dragCtx.action.perform(rnd.ctab);
|
|
10790
10820
|
var beginAtom;
|
|
10791
10821
|
var endAtom;
|
|
10792
10822
|
var beginPos;
|
|
10793
10823
|
var endPos;
|
|
10794
|
-
var extraNeighbour = [];
|
|
10795
10824
|
if ('item' in dragCtx && dragCtx.item.map === 'atoms') {
|
|
10796
10825
|
beginAtom = dragCtx.item.id;
|
|
10797
10826
|
endAtom = editor.findItem(event, ['atoms'], dragCtx.item);
|
|
10798
10827
|
var closestSGroup = editor.findItem(event, ['functionalGroups']);
|
|
10799
10828
|
if (closestSGroup && FunctionalGroup.isContractedFunctionalGroup(closestSGroup.id, functionalGroups)) {
|
|
10800
|
-
var
|
|
10801
|
-
var
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10829
|
+
var closestAttachmentAtomId = SGroup$1.getAttachmentAtomIdBySGroupId(closestSGroup.id, molecule);
|
|
10830
|
+
var isSaltOrSolvent = closestAttachmentAtomId === undefined;
|
|
10831
|
+
var isBeginFunctionalGroupItself = closestAttachmentAtomId === beginAtom;
|
|
10832
|
+
if (!isSaltOrSolvent && !isBeginFunctionalGroupItself) {
|
|
10833
|
+
endAtom = {
|
|
10834
|
+
id: closestAttachmentAtomId,
|
|
10835
|
+
map: 'atoms'
|
|
10836
|
+
};
|
|
10837
|
+
}
|
|
10806
10838
|
}
|
|
10807
10839
|
var fGroupId = endAtom && FunctionalGroup.findFunctionalGroupByAtom(functionalGroups, endAtom.id);
|
|
10808
10840
|
var fGroup = typeof fGroupId === 'number' && sgroups.get(fGroupId);
|
|
@@ -10813,27 +10845,28 @@ var BondTool = function () {
|
|
|
10813
10845
|
});
|
|
10814
10846
|
endAtom = null;
|
|
10815
10847
|
}
|
|
10816
|
-
if (endAtom && fGroup && endAtom.id === (fGroupAtoms === null || fGroupAtoms === void 0 ? void 0 : fGroupAtoms[0])) {
|
|
10817
|
-
var atomNeighbours = molecule.atomGetNeighbors(endAtom.id);
|
|
10818
|
-
atomNeighbours === null || atomNeighbours === void 0 ? void 0 : atomNeighbours.forEach(function (nei) {
|
|
10819
|
-
!(fGroupAtoms !== null && fGroupAtoms !== void 0 && fGroupAtoms.includes(nei.aid)) && !extraNeighbour.includes(nei.aid) && extraNeighbour.push(nei.aid);
|
|
10820
|
-
});
|
|
10821
|
-
}
|
|
10822
|
-
if (extraNeighbour.length >= 1) {
|
|
10823
|
-
endAtom = null;
|
|
10824
|
-
}
|
|
10825
10848
|
} else {
|
|
10849
|
+
var _endAtom;
|
|
10826
10850
|
beginAtom = this.atomProps;
|
|
10827
10851
|
beginPos = dragCtx.xy0;
|
|
10828
|
-
endAtom = editor.findItem(event, ['atoms']);
|
|
10852
|
+
endAtom = editor.findItem(event, ['atoms', 'functionalGroups']);
|
|
10829
10853
|
var atomResult = [];
|
|
10830
10854
|
var result = [];
|
|
10831
10855
|
if (endAtom && endAtom.map === 'atoms' && functionalGroups.size && this.dragCtx) {
|
|
10832
10856
|
var atomId = FunctionalGroup.atomsInFunctionalGroup(functionalGroups, endAtom.id);
|
|
10833
10857
|
if (atomId !== null) atomResult.push(atomId);
|
|
10858
|
+
} else if (((_endAtom = endAtom) === null || _endAtom === void 0 ? void 0 : _endAtom.map) === 'functionalGroups') {
|
|
10859
|
+
var functionalGroup = molecule.functionalGroups.get(endAtom.id);
|
|
10860
|
+
if (!SGroup$1.isSaltOrSolvent((functionalGroup === null || functionalGroup === void 0 ? void 0 : functionalGroup.name) || '')) {
|
|
10861
|
+
var attachmentAtomId = SGroup$1.getAttachmentAtomIdBySGroupId(endAtom.id, molecule);
|
|
10862
|
+
endAtom = attachmentAtomId === undefined ? null : {
|
|
10863
|
+
map: 'atoms',
|
|
10864
|
+
id: attachmentAtomId
|
|
10865
|
+
};
|
|
10866
|
+
}
|
|
10834
10867
|
}
|
|
10835
10868
|
if (atomResult.length > 0) {
|
|
10836
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
10869
|
+
var _iterator3 = _createForOfIteratorHelper$9(atomResult),
|
|
10837
10870
|
_step3;
|
|
10838
10871
|
try {
|
|
10839
10872
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -10856,7 +10889,7 @@ var BondTool = function () {
|
|
|
10856
10889
|
}
|
|
10857
10890
|
}
|
|
10858
10891
|
var dist = Number.MAX_VALUE;
|
|
10859
|
-
if (((
|
|
10892
|
+
if (((_endAtom2 = endAtom) === null || _endAtom2 === void 0 ? void 0 : _endAtom2.map) === 'atoms') {
|
|
10860
10893
|
endAtom = endAtom.id;
|
|
10861
10894
|
} else {
|
|
10862
10895
|
endAtom = this.atomProps;
|
|
@@ -10866,7 +10899,7 @@ var BondTool = function () {
|
|
|
10866
10899
|
endPos = utils.calcNewAtomPos(beginPos, xy1, event.ctrlKey);
|
|
10867
10900
|
} else {
|
|
10868
10901
|
var atom = rnd.ctab.molecule.atoms.get(beginAtom);
|
|
10869
|
-
|
|
10902
|
+
endPos = utils.calcNewAtomPos(atom === null || atom === void 0 ? void 0 : atom.pp.get_xy0(), xy1, event.ctrlKey);
|
|
10870
10903
|
}
|
|
10871
10904
|
}
|
|
10872
10905
|
if (dist > 0.3) {
|
|
@@ -10887,7 +10920,7 @@ var BondTool = function () {
|
|
|
10887
10920
|
return true;
|
|
10888
10921
|
}
|
|
10889
10922
|
}
|
|
10890
|
-
this.editor.hover(this.editor.findItem(event, ['atoms', 'bonds']), null, event);
|
|
10923
|
+
this.editor.hover(this.editor.findItem(event, ['atoms', 'bonds', 'functionalGroups']), null, event);
|
|
10891
10924
|
return true;
|
|
10892
10925
|
}
|
|
10893
10926
|
}, {
|
|
@@ -10910,7 +10943,9 @@ var BondTool = function () {
|
|
|
10910
10943
|
}, Vec2.diff(xy, v), Vec2.sum(xy, v));
|
|
10911
10944
|
this.editor.update(bondAddition[0]);
|
|
10912
10945
|
} else if (dragCtx.item.map === 'atoms') {
|
|
10913
|
-
this.editor.update(fromBondAddition(rnd.ctab, this.bondProps, dragCtx.item.id,
|
|
10946
|
+
this.editor.update(fromBondAddition(rnd.ctab, this.bondProps, dragCtx.item.id, {
|
|
10947
|
+
label: 'C'
|
|
10948
|
+
})[0]);
|
|
10914
10949
|
delete this.dragCtx.existedBond;
|
|
10915
10950
|
} else if (dragCtx.item.map === 'bonds') {
|
|
10916
10951
|
var bondProps = Object.assign({}, this.bondProps);
|
|
@@ -10944,7 +10979,7 @@ var BondTool = function () {
|
|
|
10944
10979
|
}, {
|
|
10945
10980
|
key: "getExistingBond",
|
|
10946
10981
|
value: function getExistingBond(struct, begin, end) {
|
|
10947
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
10982
|
+
var _iterator4 = _createForOfIteratorHelper$9(struct.bonds.entries()),
|
|
10948
10983
|
_step4;
|
|
10949
10984
|
try {
|
|
10950
10985
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -10967,9 +11002,9 @@ var BondTool = function () {
|
|
|
10967
11002
|
return BondTool;
|
|
10968
11003
|
}();
|
|
10969
11004
|
|
|
10970
|
-
function _createForOfIteratorHelper$
|
|
10971
|
-
function _unsupportedIterableToArray$
|
|
10972
|
-
function _arrayLikeToArray$
|
|
11005
|
+
function _createForOfIteratorHelper$8(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$8(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
11006
|
+
function _unsupportedIterableToArray$8(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$8(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$8(o, minLen); }
|
|
11007
|
+
function _arrayLikeToArray$8(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10973
11008
|
var ChainTool = function () {
|
|
10974
11009
|
function ChainTool(editor) {
|
|
10975
11010
|
_classCallCheck(this, ChainTool);
|
|
@@ -10984,7 +11019,7 @@ var ChainTool = function () {
|
|
|
10984
11019
|
var molecule = struct.molecule;
|
|
10985
11020
|
var functionalGroups = molecule.functionalGroups;
|
|
10986
11021
|
var rnd = this.editor.render;
|
|
10987
|
-
var ci = this.editor.findItem(event, ['atoms', 'bonds']);
|
|
11022
|
+
var ci = this.editor.findItem(event, ['atoms', 'bonds', 'functionalGroups']);
|
|
10988
11023
|
var atomResult = [];
|
|
10989
11024
|
var bondResult = [];
|
|
10990
11025
|
var result = [];
|
|
@@ -11001,7 +11036,7 @@ var ChainTool = function () {
|
|
|
11001
11036
|
}
|
|
11002
11037
|
}
|
|
11003
11038
|
if (atomResult.length > 0) {
|
|
11004
|
-
var _iterator = _createForOfIteratorHelper$
|
|
11039
|
+
var _iterator = _createForOfIteratorHelper$8(atomResult),
|
|
11005
11040
|
_step;
|
|
11006
11041
|
try {
|
|
11007
11042
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -11021,7 +11056,7 @@ var ChainTool = function () {
|
|
|
11021
11056
|
});
|
|
11022
11057
|
return;
|
|
11023
11058
|
} else if (bondResult.length > 0) {
|
|
11024
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
11059
|
+
var _iterator2 = _createForOfIteratorHelper$8(bondResult),
|
|
11025
11060
|
_step2;
|
|
11026
11061
|
try {
|
|
11027
11062
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -11052,6 +11087,18 @@ var ChainTool = function () {
|
|
|
11052
11087
|
});
|
|
11053
11088
|
atomLongtapEvent(this, rnd);
|
|
11054
11089
|
}
|
|
11090
|
+
if ((ci === null || ci === void 0 ? void 0 : ci.map) === 'functionalGroups') {
|
|
11091
|
+
var functionalGroup = molecule.functionalGroups.get(ci.id);
|
|
11092
|
+
if (!SGroup$1.isSaltOrSolvent((functionalGroup === null || functionalGroup === void 0 ? void 0 : functionalGroup.name) || '')) {
|
|
11093
|
+
var sGroupId = ci.id;
|
|
11094
|
+
var sGroup = molecule.sgroups.get(sGroupId);
|
|
11095
|
+
var attachmentAtomId = sGroup === null || sGroup === void 0 ? void 0 : sGroup.getAttAtomId(molecule);
|
|
11096
|
+
this.dragCtx.item = {
|
|
11097
|
+
map: 'atoms',
|
|
11098
|
+
id: attachmentAtomId
|
|
11099
|
+
};
|
|
11100
|
+
}
|
|
11101
|
+
}
|
|
11055
11102
|
if (!this.dragCtx.item)
|
|
11056
11103
|
delete this.dragCtx.item;
|
|
11057
11104
|
return true;
|
|
@@ -11062,7 +11109,7 @@ var ChainTool = function () {
|
|
|
11062
11109
|
var editor = this.editor;
|
|
11063
11110
|
var restruct = editor.render.ctab;
|
|
11064
11111
|
var dragCtx = this.dragCtx;
|
|
11065
|
-
editor.hover(this.editor.findItem(event, ['atoms', 'bonds']), null, event);
|
|
11112
|
+
editor.hover(this.editor.findItem(event, ['atoms', 'bonds', 'functionalGroups']), null, event);
|
|
11066
11113
|
if (!dragCtx) {
|
|
11067
11114
|
return true;
|
|
11068
11115
|
}
|
|
@@ -11114,7 +11161,7 @@ var ChainTool = function () {
|
|
|
11114
11161
|
}
|
|
11115
11162
|
}
|
|
11116
11163
|
if (atomResult.length > 0) {
|
|
11117
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
11164
|
+
var _iterator3 = _createForOfIteratorHelper$8(atomResult),
|
|
11118
11165
|
_step3;
|
|
11119
11166
|
try {
|
|
11120
11167
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -11176,9 +11223,9 @@ var ChainTool = function () {
|
|
|
11176
11223
|
return ChainTool;
|
|
11177
11224
|
}();
|
|
11178
11225
|
|
|
11179
|
-
function _createForOfIteratorHelper$
|
|
11180
|
-
function _unsupportedIterableToArray$
|
|
11181
|
-
function _arrayLikeToArray$
|
|
11226
|
+
function _createForOfIteratorHelper$7(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$7(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
11227
|
+
function _unsupportedIterableToArray$7(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$7(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$7(o, minLen); }
|
|
11228
|
+
function _arrayLikeToArray$7(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11182
11229
|
var ChargeTool = function () {
|
|
11183
11230
|
function ChargeTool(editor, charge) {
|
|
11184
11231
|
_classCallCheck(this, ChargeTool);
|
|
@@ -11219,7 +11266,7 @@ var ChargeTool = function () {
|
|
|
11219
11266
|
}
|
|
11220
11267
|
}
|
|
11221
11268
|
if (atomResult.length > 0) {
|
|
11222
|
-
var _iterator = _createForOfIteratorHelper$
|
|
11269
|
+
var _iterator = _createForOfIteratorHelper$7(atomResult),
|
|
11223
11270
|
_step;
|
|
11224
11271
|
try {
|
|
11225
11272
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -11582,9 +11629,9 @@ var LassoHelper = function () {
|
|
|
11582
11629
|
return LassoHelper;
|
|
11583
11630
|
}();
|
|
11584
11631
|
|
|
11585
|
-
function _createForOfIteratorHelper$
|
|
11586
|
-
function _unsupportedIterableToArray$
|
|
11587
|
-
function _arrayLikeToArray$
|
|
11632
|
+
function _createForOfIteratorHelper$6(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$6(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
11633
|
+
function _unsupportedIterableToArray$6(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$6(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$6(o, minLen); }
|
|
11634
|
+
function _arrayLikeToArray$6(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11588
11635
|
var searchMaps = ['atoms', 'bonds', 'sgroups', 'functionalGroups', 'sgroupData'];
|
|
11589
11636
|
var SGroupTool = function () {
|
|
11590
11637
|
function SGroupTool(editor) {
|
|
@@ -11616,7 +11663,7 @@ var SGroupTool = function () {
|
|
|
11616
11663
|
return isEqual(sgroup.atoms, selectedAtoms);
|
|
11617
11664
|
});
|
|
11618
11665
|
if (selectedAtoms && functionalGroups.size) {
|
|
11619
|
-
var _iterator = _createForOfIteratorHelper$
|
|
11666
|
+
var _iterator = _createForOfIteratorHelper$6(selectedAtoms),
|
|
11620
11667
|
_step;
|
|
11621
11668
|
try {
|
|
11622
11669
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -11628,7 +11675,7 @@ var SGroupTool = function () {
|
|
|
11628
11675
|
}
|
|
11629
11676
|
var atomFromStruct = atomId !== null && ((_struct$atoms$get = struct.atoms.get(atomId)) === null || _struct$atoms$get === void 0 ? void 0 : _struct$atoms$get.a);
|
|
11630
11677
|
if (atomFromStruct) {
|
|
11631
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
11678
|
+
var _iterator2 = _createForOfIteratorHelper$6(atomFromStruct.sgs.values()),
|
|
11632
11679
|
_step2;
|
|
11633
11680
|
try {
|
|
11634
11681
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -11641,7 +11688,7 @@ var SGroupTool = function () {
|
|
|
11641
11688
|
_iterator2.f();
|
|
11642
11689
|
}
|
|
11643
11690
|
}
|
|
11644
|
-
if (atomFromStruct && FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, false)) {
|
|
11691
|
+
if (atomFromStruct && (FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, false) || SGroup$1.isAtomInContractedSGroup(atomFromStruct, sgroups))) {
|
|
11645
11692
|
var _newSelected$atoms, _newSelected$bonds;
|
|
11646
11693
|
var sgroupAtoms = actualSgroupId !== undefined && SGroup$1.getAtoms(molecule, sgroups.get(actualSgroupId));
|
|
11647
11694
|
var sgroupBonds = actualSgroupId !== undefined && SGroup$1.getBonds(molecule, sgroups.get(actualSgroupId));
|
|
@@ -11661,7 +11708,7 @@ var SGroupTool = function () {
|
|
|
11661
11708
|
atomsResult = [];
|
|
11662
11709
|
}
|
|
11663
11710
|
if (atomsResult && atomsResult.length > 0) {
|
|
11664
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
11711
|
+
var _iterator3 = _createForOfIteratorHelper$6(atomsResult),
|
|
11665
11712
|
_step3;
|
|
11666
11713
|
try {
|
|
11667
11714
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -11703,7 +11750,7 @@ var SGroupTool = function () {
|
|
|
11703
11750
|
var _struct$atoms$get2;
|
|
11704
11751
|
var atomId = FunctionalGroup.atomsInFunctionalGroup(functionalGroups, ci.id);
|
|
11705
11752
|
var atomFromStruct = atomId !== null && ((_struct$atoms$get2 = struct.atoms.get(atomId)) === null || _struct$atoms$get2 === void 0 ? void 0 : _struct$atoms$get2.a);
|
|
11706
|
-
if (atomFromStruct && !FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, true)) {
|
|
11753
|
+
if (atomFromStruct && !(FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, true) || SGroup$1.isAtomInContractedSGroup(atomFromStruct, sgroups))) {
|
|
11707
11754
|
atomResult.push(atomId);
|
|
11708
11755
|
}
|
|
11709
11756
|
}
|
|
@@ -11711,7 +11758,7 @@ var SGroupTool = function () {
|
|
|
11711
11758
|
var _struct$bonds$get;
|
|
11712
11759
|
var bondId = FunctionalGroup.bondsInFunctionalGroup(molecule, functionalGroups, ci.id);
|
|
11713
11760
|
var bondFromStruct = bondId !== null && ((_struct$bonds$get = struct.bonds.get(bondId)) === null || _struct$bonds$get === void 0 ? void 0 : _struct$bonds$get.b);
|
|
11714
|
-
if (bondFromStruct && !FunctionalGroup.isBondInContractedFunctionalGroup(bondFromStruct, sgroups, functionalGroups)) {
|
|
11761
|
+
if (bondFromStruct && !(FunctionalGroup.isBondInContractedFunctionalGroup(bondFromStruct, sgroups, functionalGroups) || SGroup$1.isBondInContractedSGroup(bondFromStruct, sgroups))) {
|
|
11715
11762
|
bondResult.push(bondId);
|
|
11716
11763
|
}
|
|
11717
11764
|
}
|
|
@@ -11725,7 +11772,7 @@ var SGroupTool = function () {
|
|
|
11725
11772
|
}
|
|
11726
11773
|
}
|
|
11727
11774
|
if (atomResult.length > 0) {
|
|
11728
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
11775
|
+
var _iterator4 = _createForOfIteratorHelper$6(atomResult),
|
|
11729
11776
|
_step4;
|
|
11730
11777
|
try {
|
|
11731
11778
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -11745,7 +11792,7 @@ var SGroupTool = function () {
|
|
|
11745
11792
|
});
|
|
11746
11793
|
return;
|
|
11747
11794
|
} else if (bondResult.length > 0) {
|
|
11748
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
11795
|
+
var _iterator5 = _createForOfIteratorHelper$6(bondResult),
|
|
11749
11796
|
_step5;
|
|
11750
11797
|
try {
|
|
11751
11798
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -11807,7 +11854,7 @@ var SGroupTool = function () {
|
|
|
11807
11854
|
var result = [];
|
|
11808
11855
|
if (ci && ci.map === 'functionalGroups' && functionalGroups.size && FunctionalGroup.isContractedFunctionalGroup(ci.id, functionalGroups)) return;
|
|
11809
11856
|
if (selected && functionalGroups.size && selected.atoms) {
|
|
11810
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
11857
|
+
var _iterator6 = _createForOfIteratorHelper$6(selected.atoms),
|
|
11811
11858
|
_step6;
|
|
11812
11859
|
try {
|
|
11813
11860
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -11819,7 +11866,7 @@ var SGroupTool = function () {
|
|
|
11819
11866
|
}
|
|
11820
11867
|
var atomFromStruct = atomId !== null && ((_struct$atoms$get3 = struct.atoms.get(atomId)) === null || _struct$atoms$get3 === void 0 ? void 0 : _struct$atoms$get3.a);
|
|
11821
11868
|
if (atomFromStruct) {
|
|
11822
|
-
var _iterator7 = _createForOfIteratorHelper$
|
|
11869
|
+
var _iterator7 = _createForOfIteratorHelper$6(atomFromStruct.sgs.values()),
|
|
11823
11870
|
_step7;
|
|
11824
11871
|
try {
|
|
11825
11872
|
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
@@ -11832,7 +11879,7 @@ var SGroupTool = function () {
|
|
|
11832
11879
|
_iterator7.f();
|
|
11833
11880
|
}
|
|
11834
11881
|
}
|
|
11835
|
-
if (atomFromStruct && FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, true)) {
|
|
11882
|
+
if (atomFromStruct && (FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, true) || SGroup$1.isAtomInContractedSGroup(atomFromStruct, sgroups))) {
|
|
11836
11883
|
var _struct$sgroups$get, _struct$sgroups$get2, _newSelected$atoms2, _newSelected$bonds2;
|
|
11837
11884
|
var sgroupAtoms = actualSgroupId !== undefined && SGroup$1.getAtoms(molecule, (_struct$sgroups$get = struct.sgroups.get(actualSgroupId)) === null || _struct$sgroups$get === void 0 ? void 0 : _struct$sgroups$get.item);
|
|
11838
11885
|
var sgroupBonds = actualSgroupId !== undefined && SGroup$1.getBonds(molecule, (_struct$sgroups$get2 = struct.sgroups.get(actualSgroupId)) === null || _struct$sgroups$get2 === void 0 ? void 0 : _struct$sgroups$get2.item);
|
|
@@ -11849,7 +11896,7 @@ var SGroupTool = function () {
|
|
|
11849
11896
|
}
|
|
11850
11897
|
}
|
|
11851
11898
|
if (selected && functionalGroups.size && selected.bonds) {
|
|
11852
|
-
var _iterator8 = _createForOfIteratorHelper$
|
|
11899
|
+
var _iterator8 = _createForOfIteratorHelper$6(selected.bonds),
|
|
11853
11900
|
_step8;
|
|
11854
11901
|
try {
|
|
11855
11902
|
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
@@ -11891,7 +11938,7 @@ var SGroupTool = function () {
|
|
|
11891
11938
|
bondsResult = null;
|
|
11892
11939
|
}
|
|
11893
11940
|
if (atomsResult && atomsResult.length > 0) {
|
|
11894
|
-
var _iterator9 = _createForOfIteratorHelper$
|
|
11941
|
+
var _iterator9 = _createForOfIteratorHelper$6(atomsResult),
|
|
11895
11942
|
_step9;
|
|
11896
11943
|
try {
|
|
11897
11944
|
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
@@ -11908,7 +11955,7 @@ var SGroupTool = function () {
|
|
|
11908
11955
|
}
|
|
11909
11956
|
}
|
|
11910
11957
|
if (bondsResult && bondsResult.length > 0) {
|
|
11911
|
-
var _iterator10 = _createForOfIteratorHelper$
|
|
11958
|
+
var _iterator10 = _createForOfIteratorHelper$6(bondsResult),
|
|
11912
11959
|
_step10;
|
|
11913
11960
|
try {
|
|
11914
11961
|
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
@@ -12061,6 +12108,9 @@ function fromContextType(id, editor, newSg, currSelection) {
|
|
|
12061
12108
|
var sg = restruct.molecule.sgroups.get(id);
|
|
12062
12109
|
var sourceAtoms = sg && sg.atoms || currSelection.atoms || [];
|
|
12063
12110
|
var context = newSg.attrs.context;
|
|
12111
|
+
if (newSg.type === SGroup$1.TYPES.SUP) {
|
|
12112
|
+
newSg.attrs.expanded = true;
|
|
12113
|
+
}
|
|
12064
12114
|
var result = fromSgroupAction(context, restruct, newSg, sourceAtoms, currSelection);
|
|
12065
12115
|
result.selection = result.selection || currSelection;
|
|
12066
12116
|
if (id !== null && id !== undefined) {
|
|
@@ -12129,8 +12179,16 @@ function dropAndMerge(editor, mergeItems, action, resizeCanvas) {
|
|
|
12129
12179
|
if (isMerging) {
|
|
12130
12180
|
var expandGroupsAction = getExpandGroupsInMergeAction(editor.render.ctab, mergeItems);
|
|
12131
12181
|
dropItemAction = dropItemAction.mergeWith(expandGroupsAction);
|
|
12182
|
+
if (mergeItems.atomToFunctionalGroup) {
|
|
12183
|
+
var _extractAttachmentAto = extractAttachmentAtom(mergeItems, editor),
|
|
12184
|
+
_extractAttachmentAto2 = _slicedToArray(_extractAttachmentAto, 2),
|
|
12185
|
+
newMergeItems = _extractAttachmentAto2[0],
|
|
12186
|
+
extractAttachmentAtomAction = _extractAttachmentAto2[1];
|
|
12187
|
+
mergeItems = newMergeItems;
|
|
12188
|
+
dropItemAction = dropItemAction.mergeWith(extractAttachmentAtomAction);
|
|
12189
|
+
}
|
|
12190
|
+
dropItemAction = fromItemsFuse(restruct, mergeItems).mergeWith(dropItemAction);
|
|
12132
12191
|
}
|
|
12133
|
-
dropItemAction = fromItemsFuse(restruct, mergeItems).mergeWith(dropItemAction);
|
|
12134
12192
|
if (action) {
|
|
12135
12193
|
dropItemAction = dropItemAction.mergeWith(action);
|
|
12136
12194
|
}
|
|
@@ -12141,6 +12199,7 @@ function dropAndMerge(editor, mergeItems, action, resizeCanvas) {
|
|
|
12141
12199
|
resizeCanvas: !!resizeCanvas
|
|
12142
12200
|
});
|
|
12143
12201
|
}
|
|
12202
|
+
return dropItemAction;
|
|
12144
12203
|
}
|
|
12145
12204
|
function getExpandGroupsInMergeAction(restruct, mergeItems) {
|
|
12146
12205
|
var action = new Action();
|
|
@@ -12154,6 +12213,33 @@ function getExpandGroupsInMergeAction(restruct, mergeItems) {
|
|
|
12154
12213
|
}
|
|
12155
12214
|
return action;
|
|
12156
12215
|
}
|
|
12216
|
+
function extractAttachmentAtom(mergeItems, editor) {
|
|
12217
|
+
var _mergeItems$atomToFun;
|
|
12218
|
+
var struct = editor.struct();
|
|
12219
|
+
var reStruct = editor.render.ctab;
|
|
12220
|
+
var newMergeItems = {
|
|
12221
|
+
atoms: new Map(mergeItems.atoms),
|
|
12222
|
+
bonds: new Map(mergeItems.bonds)
|
|
12223
|
+
};
|
|
12224
|
+
var action = new Action();
|
|
12225
|
+
(_mergeItems$atomToFun = mergeItems.atomToFunctionalGroup) === null || _mergeItems$atomToFun === void 0 ? void 0 : _mergeItems$atomToFun.forEach(function (functionalGroupId, srcAtomId) {
|
|
12226
|
+
var sGroup = struct.sgroups.get(functionalGroupId);
|
|
12227
|
+
var attachmentAtomId = sGroup === null || sGroup === void 0 ? void 0 : sGroup.getAttAtomId(struct);
|
|
12228
|
+
if (attachmentAtomId !== undefined) {
|
|
12229
|
+
var atomsToDelete = _toConsumableArray(SGroup$1.getAtoms(struct, sGroup)).filter(function (atomId) {
|
|
12230
|
+
return atomId !== attachmentAtomId;
|
|
12231
|
+
});
|
|
12232
|
+
var bondsToDelete = _toConsumableArray(SGroup$1.getBonds(struct, sGroup));
|
|
12233
|
+
action.mergeWith(fromSgroupDeletion(reStruct, functionalGroupId));
|
|
12234
|
+
action.mergeWith(fromFragmentDeletion(reStruct, {
|
|
12235
|
+
atoms: atomsToDelete,
|
|
12236
|
+
bonds: bondsToDelete
|
|
12237
|
+
}));
|
|
12238
|
+
newMergeItems.atoms.set(srcAtomId, attachmentAtomId);
|
|
12239
|
+
}
|
|
12240
|
+
});
|
|
12241
|
+
return [newMergeItems, action];
|
|
12242
|
+
}
|
|
12157
12243
|
|
|
12158
12244
|
function ownKeys$Q(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12159
12245
|
function _objectSpread$Q(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$Q(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$Q(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -12162,29 +12248,6 @@ function getMergeItems(editor, items) {
|
|
|
12162
12248
|
return getItemsToFuse(editor, nonGroupItemsAndAttachPoints);
|
|
12163
12249
|
}
|
|
12164
12250
|
|
|
12165
|
-
function isAtomsArray(selectedElements) {
|
|
12166
|
-
return Array.isArray(selectedElements) && (selectedElements === null || selectedElements === void 0 ? void 0 : selectedElements.every(function (element) {
|
|
12167
|
-
return element instanceof Atom$2;
|
|
12168
|
-
}));
|
|
12169
|
-
}
|
|
12170
|
-
function generateCommonProperties(selectedElements) {
|
|
12171
|
-
var normalizedAtom = fromElement(selectedElements[0]);
|
|
12172
|
-
var properties = Object.getOwnPropertyNames(normalizedAtom);
|
|
12173
|
-
var resultAtomAttributes = {};
|
|
12174
|
-
properties.forEach(function (property) {
|
|
12175
|
-
var uniqueValues = new Set();
|
|
12176
|
-
selectedElements.forEach(function (element) {
|
|
12177
|
-
uniqueValues.add(element[property]);
|
|
12178
|
-
});
|
|
12179
|
-
var allAtomsHaveTheSameValue = uniqueValues.size === 1;
|
|
12180
|
-
if (allAtomsHaveTheSameValue) {
|
|
12181
|
-
resultAtomAttributes[property] = normalizedAtom[property];
|
|
12182
|
-
} else {
|
|
12183
|
-
resultAtomAttributes[property] = '';
|
|
12184
|
-
}
|
|
12185
|
-
});
|
|
12186
|
-
return resultAtomAttributes;
|
|
12187
|
-
}
|
|
12188
12251
|
function castAtomPropToType(property, value) {
|
|
12189
12252
|
var typesMapping = {
|
|
12190
12253
|
charge: Number,
|
|
@@ -12196,21 +12259,21 @@ function castAtomPropToType(property, value) {
|
|
|
12196
12259
|
}
|
|
12197
12260
|
return value;
|
|
12198
12261
|
}
|
|
12199
|
-
function updateOnlyChangedProperties(
|
|
12200
|
-
var
|
|
12201
|
-
|
|
12202
|
-
return userChangedAtom[key] !== '';
|
|
12262
|
+
function updateOnlyChangedProperties(unchangedElement, userChangedElement) {
|
|
12263
|
+
var updatedKeys = Object.getOwnPropertyNames(userChangedElement).filter(function (key) {
|
|
12264
|
+
return userChangedElement[key] !== '';
|
|
12203
12265
|
});
|
|
12204
|
-
return Object.getOwnPropertyNames(
|
|
12205
|
-
|
|
12206
|
-
|
|
12207
|
-
updatedAtom[key] = castAtomPropToType(key, userChangedAtom[key]);
|
|
12208
|
-
} else {
|
|
12209
|
-
updatedAtom[key] = unchangedAtom[key];
|
|
12210
|
-
}
|
|
12211
|
-
return updatedAtom;
|
|
12266
|
+
return Object.getOwnPropertyNames(unchangedElement).reduce(function (updatedElement, key) {
|
|
12267
|
+
updatedElement[key] = updatedKeys.includes(key) ? castAtomPropToType(key, userChangedElement[key]) : unchangedElement[key];
|
|
12268
|
+
return updatedElement;
|
|
12212
12269
|
}, {});
|
|
12213
12270
|
}
|
|
12271
|
+
|
|
12272
|
+
function isAtomsArray(selectedElements) {
|
|
12273
|
+
return Array.isArray(selectedElements) && (selectedElements === null || selectedElements === void 0 ? void 0 : selectedElements.every(function (element) {
|
|
12274
|
+
return element instanceof Atom$2;
|
|
12275
|
+
}));
|
|
12276
|
+
}
|
|
12214
12277
|
function updateSelectedAtoms(_ref) {
|
|
12215
12278
|
var atoms = _ref.atoms,
|
|
12216
12279
|
changeAtomPromise = _ref.changeAtomPromise,
|
|
@@ -12221,7 +12284,8 @@ function updateSelectedAtoms(_ref) {
|
|
|
12221
12284
|
if (atoms) {
|
|
12222
12285
|
Promise.resolve(changeAtomPromise).then(function (userChangedAtom) {
|
|
12223
12286
|
atoms.forEach(function (atomId) {
|
|
12224
|
-
var
|
|
12287
|
+
var unchangedAtom = molecule.atoms.get(atomId);
|
|
12288
|
+
var atomWithChangedProperties = updateOnlyChangedProperties(unchangedAtom, userChangedAtom);
|
|
12225
12289
|
action.mergeWith(fromAtomsAttrs(struct, atomId, atomWithChangedProperties, false));
|
|
12226
12290
|
});
|
|
12227
12291
|
editor.update(action);
|
|
@@ -12231,6 +12295,27 @@ function updateSelectedAtoms(_ref) {
|
|
|
12231
12295
|
}
|
|
12232
12296
|
}
|
|
12233
12297
|
|
|
12298
|
+
function updateSelectedBonds(_ref) {
|
|
12299
|
+
var bonds = _ref.bonds,
|
|
12300
|
+
changeBondPromise = _ref.changeBondPromise,
|
|
12301
|
+
editor = _ref.editor;
|
|
12302
|
+
var action = new Action();
|
|
12303
|
+
var struct = editor.render.ctab;
|
|
12304
|
+
var molecule = struct.molecule;
|
|
12305
|
+
if (bonds) {
|
|
12306
|
+
Promise.resolve(changeBondPromise).then(function (userChangedBond) {
|
|
12307
|
+
bonds.forEach(function (bondId) {
|
|
12308
|
+
var unchangedBond = molecule.bonds.get(bondId);
|
|
12309
|
+
var bondWithChangedProperties = updateOnlyChangedProperties(unchangedBond, userChangedBond);
|
|
12310
|
+
action.mergeWith(fromBondsAttrs(struct, bondId, bondWithChangedProperties, false));
|
|
12311
|
+
});
|
|
12312
|
+
editor.update(action);
|
|
12313
|
+
})["catch"](function () {
|
|
12314
|
+
return null;
|
|
12315
|
+
});
|
|
12316
|
+
}
|
|
12317
|
+
}
|
|
12318
|
+
|
|
12234
12319
|
function hasAtomsOutsideCanvas(atoms, render, scale) {
|
|
12235
12320
|
return atoms.some(function (atom) {
|
|
12236
12321
|
var canvasSize = render.sz;
|
|
@@ -12241,9 +12326,9 @@ function hasAtomsOutsideCanvas(atoms, render, scale) {
|
|
|
12241
12326
|
});
|
|
12242
12327
|
}
|
|
12243
12328
|
|
|
12244
|
-
function _createForOfIteratorHelper$
|
|
12245
|
-
function _unsupportedIterableToArray$
|
|
12246
|
-
function _arrayLikeToArray$
|
|
12329
|
+
function _createForOfIteratorHelper$5(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$5(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
12330
|
+
function _unsupportedIterableToArray$5(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$5(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen); }
|
|
12331
|
+
function _arrayLikeToArray$5(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12247
12332
|
function ownKeys$P(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12248
12333
|
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$P(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$P(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12249
12334
|
function _classPrivateFieldInitSpec$1(obj, privateMap, value) { _checkPrivateRedeclaration$1(obj, privateMap); privateMap.set(obj, value); }
|
|
@@ -12408,7 +12493,8 @@ var SelectTool = function () {
|
|
|
12408
12493
|
if ((_this$dragCtx = this.dragCtx) !== null && _this$dragCtx !== void 0 && _this$dragCtx.stopTapping) this.dragCtx.stopTapping();
|
|
12409
12494
|
var possibleSaltOrSolvent = struct.sgroups.get(selectedSgroups[selectedSgroups.length - 1]);
|
|
12410
12495
|
var isDraggingSaltOrSolventOnStructure = SGroup$1.isSaltOrSolvent(possibleSaltOrSolvent === null || possibleSaltOrSolvent === void 0 ? void 0 : possibleSaltOrSolvent.item.data.name);
|
|
12411
|
-
|
|
12496
|
+
var isDraggingCustomSgroupOnStructure = SGroup$1.isSuperAtom(possibleSaltOrSolvent === null || possibleSaltOrSolvent === void 0 ? void 0 : possibleSaltOrSolvent.item) && !FunctionalGroup.isFunctionalGroup(possibleSaltOrSolvent === null || possibleSaltOrSolvent === void 0 ? void 0 : possibleSaltOrSolvent.item);
|
|
12497
|
+
if (this.dragCtx && (isDraggingCustomSgroupOnStructure || isDraggingSaltOrSolventOnStructure || this.isDraggingStructureOnSaltOrSolvent(this.dragCtx, struct.sgroups))) {
|
|
12412
12498
|
preventSaltAndSolventsMerge(struct, this.dragCtx, editor);
|
|
12413
12499
|
delete this.dragCtx;
|
|
12414
12500
|
}
|
|
@@ -12434,7 +12520,6 @@ var SelectTool = function () {
|
|
|
12434
12520
|
var molecule = struct.molecule,
|
|
12435
12521
|
sgroups = struct.sgroups;
|
|
12436
12522
|
var functionalGroups = molecule.functionalGroups;
|
|
12437
|
-
var rnd = editor.render;
|
|
12438
12523
|
var ci = editor.findItem(event, ['atoms', 'bonds', 'sgroups', 'functionalGroups', 'sgroupData', 'texts'], null);
|
|
12439
12524
|
var atomResult = [];
|
|
12440
12525
|
var bondResult = [];
|
|
@@ -12443,7 +12528,7 @@ var SelectTool = function () {
|
|
|
12443
12528
|
var _struct$atoms$get;
|
|
12444
12529
|
var atomId = FunctionalGroup.atomsInFunctionalGroup(functionalGroups, ci.id);
|
|
12445
12530
|
var atomFromStruct = atomId !== null && ((_struct$atoms$get = struct.atoms.get(atomId)) === null || _struct$atoms$get === void 0 ? void 0 : _struct$atoms$get.a);
|
|
12446
|
-
if (
|
|
12531
|
+
if (atomFromStruct && !FunctionalGroup.isAtomInContractedFunctionalGroup(
|
|
12447
12532
|
atomFromStruct, sgroups, functionalGroups, true)) atomResult.push(atomId);
|
|
12448
12533
|
}
|
|
12449
12534
|
if (ci && functionalGroups && ci.map === 'bonds') {
|
|
@@ -12454,7 +12539,7 @@ var SelectTool = function () {
|
|
|
12454
12539
|
bondFromStruct, sgroups, functionalGroups)) bondResult.push(bondId);
|
|
12455
12540
|
}
|
|
12456
12541
|
if (atomResult.length > 0) {
|
|
12457
|
-
var _iterator = _createForOfIteratorHelper$
|
|
12542
|
+
var _iterator = _createForOfIteratorHelper$5(atomResult),
|
|
12458
12543
|
_step;
|
|
12459
12544
|
try {
|
|
12460
12545
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -12474,7 +12559,7 @@ var SelectTool = function () {
|
|
|
12474
12559
|
});
|
|
12475
12560
|
return;
|
|
12476
12561
|
} else if (bondResult.length > 0) {
|
|
12477
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
12562
|
+
var _iterator2 = _createForOfIteratorHelper$5(bondResult),
|
|
12478
12563
|
_step2;
|
|
12479
12564
|
try {
|
|
12480
12565
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -12505,21 +12590,13 @@ var SelectTool = function () {
|
|
|
12505
12590
|
changeAtomPromise: changeAtomPromise
|
|
12506
12591
|
});
|
|
12507
12592
|
} else if (ci.map === 'bonds') {
|
|
12508
|
-
var
|
|
12509
|
-
var
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
bondsSelection.forEach(function (bid) {
|
|
12516
|
-
action.mergeWith(fromBondsAttrs(struct, bid, newbond));
|
|
12517
|
-
});
|
|
12518
|
-
editor.update(action);
|
|
12519
|
-
})["catch"](function () {
|
|
12520
|
-
return null;
|
|
12521
|
-
});
|
|
12522
|
-
}
|
|
12593
|
+
var bonds = getSelectedBonds(selection, molecule);
|
|
12594
|
+
var changeBondPromise = editor.event.bondEdit.dispatch(bonds);
|
|
12595
|
+
updateSelectedBonds({
|
|
12596
|
+
bonds: (selection === null || selection === void 0 ? void 0 : selection.bonds) || [],
|
|
12597
|
+
changeBondPromise: changeBondPromise,
|
|
12598
|
+
editor: editor
|
|
12599
|
+
});
|
|
12523
12600
|
} else if (ci.map === 'sgroups' && !FunctionalGroup.isFunctionalGroup(molecule.sgroups.get(ci.id)) || ci.map === 'sgroupData') {
|
|
12524
12601
|
editor.selection(closestToSel(ci));
|
|
12525
12602
|
SGroupTool.sgroupDialog(editor, ci.id);
|
|
@@ -12654,12 +12731,24 @@ function getSelectedAtoms(selection, molecule) {
|
|
|
12654
12731
|
}
|
|
12655
12732
|
return [];
|
|
12656
12733
|
}
|
|
12734
|
+
function getSelectedBonds(selection, molecule) {
|
|
12735
|
+
if (selection !== null && selection !== void 0 && selection.bonds) {
|
|
12736
|
+
return mapBondIdsToBonds(selection === null || selection === void 0 ? void 0 : selection.bonds, molecule);
|
|
12737
|
+
}
|
|
12738
|
+
return [];
|
|
12739
|
+
}
|
|
12657
12740
|
function mapAtomIdsToAtoms(atomsIds, molecule) {
|
|
12658
12741
|
return atomsIds.map(function (atomId) {
|
|
12659
12742
|
var atomOrReAtom = molecule.atoms.get(atomId);
|
|
12660
12743
|
return atomOrReAtom.a || atomOrReAtom;
|
|
12661
12744
|
});
|
|
12662
12745
|
}
|
|
12746
|
+
function mapBondIdsToBonds(bondsIds, molecule) {
|
|
12747
|
+
return bondsIds.map(function (bondId) {
|
|
12748
|
+
var bondOrReBond = molecule.bonds.get(bondId);
|
|
12749
|
+
return (bondOrReBond === null || bondOrReBond === void 0 ? void 0 : bondOrReBond.b) || bondOrReBond;
|
|
12750
|
+
});
|
|
12751
|
+
}
|
|
12663
12752
|
function uniqArray(dest, add, reversible) {
|
|
12664
12753
|
return add.reduce(function (_, item) {
|
|
12665
12754
|
if (reversible) dest = xor(dest, [item]);else if (!dest.includes(item)) dest.push(item);
|
|
@@ -12690,7 +12779,7 @@ function getNewSelectedItems(editor, selectedSgroups) {
|
|
|
12690
12779
|
atoms: [],
|
|
12691
12780
|
bonds: []
|
|
12692
12781
|
};
|
|
12693
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
12782
|
+
var _iterator3 = _createForOfIteratorHelper$5(selectedSgroups),
|
|
12694
12783
|
_step3;
|
|
12695
12784
|
try {
|
|
12696
12785
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -12712,9 +12801,9 @@ function getNewSelectedItems(editor, selectedSgroups) {
|
|
|
12712
12801
|
return newSelected;
|
|
12713
12802
|
}
|
|
12714
12803
|
|
|
12715
|
-
function _createForOfIteratorHelper$
|
|
12716
|
-
function _unsupportedIterableToArray$
|
|
12717
|
-
function _arrayLikeToArray$
|
|
12804
|
+
function _createForOfIteratorHelper$4(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$4(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
12805
|
+
function _unsupportedIterableToArray$4(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$4(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen); }
|
|
12806
|
+
function _arrayLikeToArray$4(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12718
12807
|
var EraserTool = function () {
|
|
12719
12808
|
function EraserTool(editor, mode) {
|
|
12720
12809
|
_classCallCheck(this, EraserTool);
|
|
@@ -12762,7 +12851,7 @@ var EraserTool = function () {
|
|
|
12762
12851
|
var bondsResult = [];
|
|
12763
12852
|
var preResult = [];
|
|
12764
12853
|
if (selected && functionalGroups.size && selected.atoms) {
|
|
12765
|
-
var _iterator = _createForOfIteratorHelper$
|
|
12854
|
+
var _iterator = _createForOfIteratorHelper$4(selected.atoms),
|
|
12766
12855
|
_step;
|
|
12767
12856
|
try {
|
|
12768
12857
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -12771,7 +12860,7 @@ var EraserTool = function () {
|
|
|
12771
12860
|
var atomId = FunctionalGroup.atomsInFunctionalGroup(functionalGroups, atom);
|
|
12772
12861
|
var atomFromStruct = atomId !== null && ((_struct$atoms$get = struct.atoms.get(atomId)) === null || _struct$atoms$get === void 0 ? void 0 : _struct$atoms$get.a);
|
|
12773
12862
|
if (atomFromStruct) {
|
|
12774
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
12863
|
+
var _iterator2 = _createForOfIteratorHelper$4(atomFromStruct.sgs.values()),
|
|
12775
12864
|
_step2;
|
|
12776
12865
|
try {
|
|
12777
12866
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -12801,7 +12890,7 @@ var EraserTool = function () {
|
|
|
12801
12890
|
}
|
|
12802
12891
|
}
|
|
12803
12892
|
if (selected && functionalGroups.size && selected.bonds) {
|
|
12804
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
12893
|
+
var _iterator3 = _createForOfIteratorHelper$4(selected.bonds),
|
|
12805
12894
|
_step3;
|
|
12806
12895
|
try {
|
|
12807
12896
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -12820,7 +12909,7 @@ var EraserTool = function () {
|
|
|
12820
12909
|
}
|
|
12821
12910
|
}
|
|
12822
12911
|
if (atomsResult.length > 0) {
|
|
12823
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
12912
|
+
var _iterator4 = _createForOfIteratorHelper$4(atomsResult),
|
|
12824
12913
|
_step4;
|
|
12825
12914
|
try {
|
|
12826
12915
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -12835,7 +12924,7 @@ var EraserTool = function () {
|
|
|
12835
12924
|
}
|
|
12836
12925
|
}
|
|
12837
12926
|
if (bondsResult.length > 0) {
|
|
12838
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
12927
|
+
var _iterator5 = _createForOfIteratorHelper$4(bondsResult),
|
|
12839
12928
|
_step5;
|
|
12840
12929
|
try {
|
|
12841
12930
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -12906,7 +12995,7 @@ var EraserTool = function () {
|
|
|
12906
12995
|
}
|
|
12907
12996
|
}
|
|
12908
12997
|
if (atomResult.length) {
|
|
12909
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
12998
|
+
var _iterator6 = _createForOfIteratorHelper$4(atomResult),
|
|
12910
12999
|
_step6;
|
|
12911
13000
|
try {
|
|
12912
13001
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -12922,7 +13011,7 @@ var EraserTool = function () {
|
|
|
12922
13011
|
_iterator6.f();
|
|
12923
13012
|
}
|
|
12924
13013
|
} else if (bondResult.length) {
|
|
12925
|
-
var _iterator7 = _createForOfIteratorHelper$
|
|
13014
|
+
var _iterator7 = _createForOfIteratorHelper$4(bondResult),
|
|
12926
13015
|
_step7;
|
|
12927
13016
|
try {
|
|
12928
13017
|
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
@@ -13083,7 +13172,8 @@ function ownKeys$O(object, enumerableOnly) { var keys = Object.keys(object); if
|
|
|
13083
13172
|
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$O(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$O(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13084
13173
|
var PasteTool = function () {
|
|
13085
13174
|
function PasteTool(editor, struct) {
|
|
13086
|
-
var _struct$functionalGro
|
|
13175
|
+
var _struct$functionalGro,
|
|
13176
|
+
_this = this;
|
|
13087
13177
|
_classCallCheck(this, PasteTool);
|
|
13088
13178
|
this.editor = editor;
|
|
13089
13179
|
this.editor.selection(null);
|
|
@@ -13103,6 +13193,15 @@ var PasteTool = function () {
|
|
|
13103
13193
|
pasteItems = _fromPaste2[1];
|
|
13104
13194
|
this.action = action;
|
|
13105
13195
|
this.editor.update(this.action, true);
|
|
13196
|
+
struct.sgroups.forEach(function (sgroup) {
|
|
13197
|
+
var countAttachmentPoint = FunctionalGroup.getAttachmentPointCount(sgroup, _this.editor.render.ctab.molecule);
|
|
13198
|
+
if (countAttachmentPoint > 1) {
|
|
13199
|
+
action.mergeWith(setExpandSGroup(_this.editor.render.ctab, sgroup.id, {
|
|
13200
|
+
expanded: true
|
|
13201
|
+
}));
|
|
13202
|
+
}
|
|
13203
|
+
});
|
|
13204
|
+
this.editor.update(this.action, true);
|
|
13106
13205
|
this.findItems = ['functionalGroups'];
|
|
13107
13206
|
this.mergeItems = getItemsToFuse(this.editor, pasteItems);
|
|
13108
13207
|
this.editor.hover(getHoverToFuse(this.mergeItems), this);
|
|
@@ -13136,6 +13235,7 @@ var PasteTool = function () {
|
|
|
13136
13235
|
}, {
|
|
13137
13236
|
key: "mousemove",
|
|
13138
13237
|
value: function mousemove(event) {
|
|
13238
|
+
var _this2 = this;
|
|
13139
13239
|
if (this.action) {
|
|
13140
13240
|
var _this$action2;
|
|
13141
13241
|
(_this$action2 = this.action) === null || _this$action2 === void 0 ? void 0 : _this$action2.perform(this.editor.render.ctab);
|
|
@@ -13166,6 +13266,12 @@ var PasteTool = function () {
|
|
|
13166
13266
|
this.dragCtx.action = action;
|
|
13167
13267
|
this.editor.update(this.dragCtx.action, true);
|
|
13168
13268
|
} else {
|
|
13269
|
+
this.struct.sgroups.forEach(function (sgroup) {
|
|
13270
|
+
var countAttachmentPoint = FunctionalGroup.getAttachmentPointCount(sgroup, _this2.struct);
|
|
13271
|
+
if (countAttachmentPoint > 1) {
|
|
13272
|
+
sgroup.setAttr('expanded', true);
|
|
13273
|
+
}
|
|
13274
|
+
});
|
|
13169
13275
|
var _fromPaste5 = fromPaste(this.editor.render.ctab, this.struct, this.editor.render.page2obj(event)),
|
|
13170
13276
|
_fromPaste6 = _slicedToArray(_fromPaste5, 2),
|
|
13171
13277
|
_action = _fromPaste6[0],
|
|
@@ -13205,7 +13311,9 @@ var PasteTool = function () {
|
|
|
13205
13311
|
} else {
|
|
13206
13312
|
var action = this.action;
|
|
13207
13313
|
delete this.action;
|
|
13208
|
-
|
|
13314
|
+
if (!this.isSingleContractedGroup || !this.mergeItems) {
|
|
13315
|
+
this.editor.update(dropAndMerge(this.editor, this.mergeItems, action, true));
|
|
13316
|
+
}
|
|
13209
13317
|
}
|
|
13210
13318
|
}
|
|
13211
13319
|
}, {
|
|
@@ -13244,9 +13352,9 @@ function prepareTemplateFromSingleGroup(molecule) {
|
|
|
13244
13352
|
return template;
|
|
13245
13353
|
}
|
|
13246
13354
|
|
|
13247
|
-
function _createForOfIteratorHelper$
|
|
13248
|
-
function _unsupportedIterableToArray$
|
|
13249
|
-
function _arrayLikeToArray$
|
|
13355
|
+
function _createForOfIteratorHelper$3(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
13356
|
+
function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
|
|
13357
|
+
function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13250
13358
|
var RGroupAtomTool = function () {
|
|
13251
13359
|
function RGroupAtomTool(editor) {
|
|
13252
13360
|
_classCallCheck(this, RGroupAtomTool);
|
|
@@ -13282,7 +13390,7 @@ var RGroupAtomTool = function () {
|
|
|
13282
13390
|
}
|
|
13283
13391
|
}
|
|
13284
13392
|
if (atomResult.length > 0) {
|
|
13285
|
-
var _iterator = _createForOfIteratorHelper$
|
|
13393
|
+
var _iterator = _createForOfIteratorHelper$3(atomResult),
|
|
13286
13394
|
_step;
|
|
13287
13395
|
try {
|
|
13288
13396
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -13346,9 +13454,9 @@ function propsDialog$1(editor, id, pos) {
|
|
|
13346
13454
|
});
|
|
13347
13455
|
}
|
|
13348
13456
|
|
|
13349
|
-
function _createForOfIteratorHelper$
|
|
13350
|
-
function _unsupportedIterableToArray$
|
|
13351
|
-
function _arrayLikeToArray$
|
|
13457
|
+
function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
13458
|
+
function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
|
|
13459
|
+
function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13352
13460
|
var RGroupFragmentTool = function () {
|
|
13353
13461
|
function RGroupFragmentTool(editor) {
|
|
13354
13462
|
_classCallCheck(this, RGroupFragmentTool);
|
|
@@ -13385,7 +13493,7 @@ var RGroupFragmentTool = function () {
|
|
|
13385
13493
|
}
|
|
13386
13494
|
}
|
|
13387
13495
|
if (atomResult.length > 0) {
|
|
13388
|
-
var _iterator = _createForOfIteratorHelper$
|
|
13496
|
+
var _iterator = _createForOfIteratorHelper$2(atomResult),
|
|
13389
13497
|
_step;
|
|
13390
13498
|
try {
|
|
13391
13499
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -13405,7 +13513,7 @@ var RGroupFragmentTool = function () {
|
|
|
13405
13513
|
});
|
|
13406
13514
|
return;
|
|
13407
13515
|
} else if (bondResult.length > 0) {
|
|
13408
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
13516
|
+
var _iterator2 = _createForOfIteratorHelper$2(bondResult),
|
|
13409
13517
|
_step2;
|
|
13410
13518
|
try {
|
|
13411
13519
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -14067,6 +14175,47 @@ var TemplateTool = function () {
|
|
|
14067
14175
|
editor.hoverIcon.updatePosition();
|
|
14068
14176
|
}
|
|
14069
14177
|
_createClass(TemplateTool, [{
|
|
14178
|
+
key: "struct",
|
|
14179
|
+
get: function get() {
|
|
14180
|
+
return this.editor.render.ctab.molecule;
|
|
14181
|
+
}
|
|
14182
|
+
}, {
|
|
14183
|
+
key: "functionalGroups",
|
|
14184
|
+
get: function get() {
|
|
14185
|
+
return this.struct.functionalGroups;
|
|
14186
|
+
}
|
|
14187
|
+
}, {
|
|
14188
|
+
key: "isModeFunctionalGroup",
|
|
14189
|
+
get: function get() {
|
|
14190
|
+
return this.mode === MODES.FG;
|
|
14191
|
+
}
|
|
14192
|
+
}, {
|
|
14193
|
+
key: "closestItem",
|
|
14194
|
+
get: function get() {
|
|
14195
|
+
return this.editor.findItem(this.event, ['atoms', 'bonds', 'sgroups', 'functionalGroups']);
|
|
14196
|
+
}
|
|
14197
|
+
}, {
|
|
14198
|
+
key: "isNeedToShowRemoveAbbreviationPopup",
|
|
14199
|
+
get: function get() {
|
|
14200
|
+
var _this$closestItem, _this$functionalGroup;
|
|
14201
|
+
var targetId = this.findKeyOfRelatedGroupId((_this$closestItem = this.closestItem) === null || _this$closestItem === void 0 ? void 0 : _this$closestItem.id);
|
|
14202
|
+
var isTargetExpanded = (_this$functionalGroup = this.functionalGroups.get(targetId)) === null || _this$functionalGroup === void 0 ? void 0 : _this$functionalGroup.isExpanded;
|
|
14203
|
+
var isTargetAtomOrBond = this.targetGroupsIds.length && !this.isModeFunctionalGroup;
|
|
14204
|
+
return Boolean(isTargetExpanded || isTargetAtomOrBond);
|
|
14205
|
+
}
|
|
14206
|
+
}, {
|
|
14207
|
+
key: "findKeyOfRelatedGroupId",
|
|
14208
|
+
value: function findKeyOfRelatedGroupId(clickedClosestItemId) {
|
|
14209
|
+
var targetId;
|
|
14210
|
+
var relatedGroupId = FunctionalGroup.findFunctionalGroupByAtom(this.functionalGroups, clickedClosestItemId);
|
|
14211
|
+
this.functionalGroups.forEach(function (fg, key) {
|
|
14212
|
+
if (fg.relatedSGroupId === relatedGroupId) {
|
|
14213
|
+
targetId = key;
|
|
14214
|
+
}
|
|
14215
|
+
});
|
|
14216
|
+
return targetId;
|
|
14217
|
+
}
|
|
14218
|
+
}, {
|
|
14070
14219
|
key: "showRemoveAbbreviationPopup",
|
|
14071
14220
|
value: function showRemoveAbbreviationPopup() {
|
|
14072
14221
|
var _this = this;
|
|
@@ -14077,77 +14226,68 @@ var TemplateTool = function () {
|
|
|
14077
14226
|
return Promise.resolve();
|
|
14078
14227
|
});
|
|
14079
14228
|
}
|
|
14080
|
-
}, {
|
|
14081
|
-
key: "isModeFunctionalGroup",
|
|
14082
|
-
get: function get() {
|
|
14083
|
-
return this.mode === MODES.FG;
|
|
14084
|
-
}
|
|
14085
14229
|
}, {
|
|
14086
14230
|
key: "mousedown",
|
|
14087
14231
|
value: function () {
|
|
14088
14232
|
var _mousedown = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(event) {
|
|
14089
|
-
var
|
|
14090
|
-
var
|
|
14233
|
+
var _this2 = this;
|
|
14234
|
+
var _this$closestItem2, _this$closestItem3, _this$closestItem4, dragCtx, ci, _this$struct$atoms$ge, _this$struct$halfBond, xy0, bond, frid, frIds, count, loop, _this$struct$halfBond2, _this$struct$loops$ge, loopHbs, sign;
|
|
14091
14235
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
14092
14236
|
while (1) {
|
|
14093
14237
|
switch (_context.prev = _context.next) {
|
|
14094
14238
|
case 0:
|
|
14095
|
-
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
|
|
14100
|
-
|
|
14101
|
-
}), (closestItem === null || closestItem === void 0 ? void 0 : closestItem.map) === 'bonds' && {
|
|
14102
|
-
bonds: [closestItem.id]
|
|
14239
|
+
this.event = event;
|
|
14240
|
+
if (this.functionalGroups.size) {
|
|
14241
|
+
this.targetGroupsIds = getGroupIdsFromItemArrays(this.struct, _objectSpread$N(_objectSpread$N({}, ((_this$closestItem2 = this.closestItem) === null || _this$closestItem2 === void 0 ? void 0 : _this$closestItem2.map) === 'atoms' && {
|
|
14242
|
+
atoms: [this.closestItem.id]
|
|
14243
|
+
}), ((_this$closestItem3 = this.closestItem) === null || _this$closestItem3 === void 0 ? void 0 : _this$closestItem3.map) === 'bonds' && {
|
|
14244
|
+
bonds: [this.closestItem.id]
|
|
14103
14245
|
}));
|
|
14104
14246
|
if (
|
|
14105
|
-
(closestItem === null ||
|
|
14106
|
-
this.targetGroupsIds.push(closestItem.id);
|
|
14247
|
+
((_this$closestItem4 = this.closestItem) === null || _this$closestItem4 === void 0 ? void 0 : _this$closestItem4.map) === 'functionalGroups' && FunctionalGroup.isContractedFunctionalGroup(this.closestItem.id, this.functionalGroups)) {
|
|
14248
|
+
this.targetGroupsIds.push(this.closestItem.id);
|
|
14107
14249
|
}
|
|
14108
14250
|
}
|
|
14109
|
-
|
|
14110
|
-
|
|
14111
|
-
if (!(isTargetAtomOrBond || isTargetExpanded)) {
|
|
14112
|
-
_context.next = 10;
|
|
14251
|
+
if (!this.isNeedToShowRemoveAbbreviationPopup) {
|
|
14252
|
+
_context.next = 6;
|
|
14113
14253
|
break;
|
|
14114
14254
|
}
|
|
14115
|
-
_context.next =
|
|
14255
|
+
_context.next = 5;
|
|
14116
14256
|
return this.showRemoveAbbreviationPopup();
|
|
14117
|
-
case
|
|
14257
|
+
case 5:
|
|
14118
14258
|
return _context.abrupt("return");
|
|
14119
|
-
case
|
|
14259
|
+
case 6:
|
|
14120
14260
|
this.editor.hover(null);
|
|
14121
14261
|
this.dragCtx = {
|
|
14122
|
-
xy0: this.editor.render.page2obj(event),
|
|
14123
|
-
item: this.editor.findItem(event, this.findItems)
|
|
14262
|
+
xy0: this.editor.render.page2obj(this.event),
|
|
14263
|
+
item: this.editor.findItem(this.event, this.findItems)
|
|
14124
14264
|
};
|
|
14125
14265
|
dragCtx = this.dragCtx;
|
|
14126
14266
|
ci = dragCtx.item;
|
|
14127
14267
|
if (!(!ci || this.isSaltOrSolvent)) {
|
|
14128
|
-
_context.next =
|
|
14268
|
+
_context.next = 13;
|
|
14129
14269
|
break;
|
|
14130
14270
|
}
|
|
14131
14271
|
delete dragCtx.item;
|
|
14132
14272
|
return _context.abrupt("return");
|
|
14133
|
-
case
|
|
14273
|
+
case 13:
|
|
14134
14274
|
if (ci.map === 'bonds' && !this.isModeFunctionalGroup) {
|
|
14135
14275
|
xy0 = new Vec2();
|
|
14136
|
-
bond = struct.bonds.get(ci.id);
|
|
14137
|
-
frid = (
|
|
14138
|
-
frIds = struct.getFragmentIds(frid);
|
|
14276
|
+
bond = this.struct.bonds.get(ci.id);
|
|
14277
|
+
frid = (_this$struct$atoms$ge = this.struct.atoms.get(bond === null || bond === void 0 ? void 0 : bond.begin)) === null || _this$struct$atoms$ge === void 0 ? void 0 : _this$struct$atoms$ge.fragment;
|
|
14278
|
+
frIds = this.struct.getFragmentIds(frid);
|
|
14139
14279
|
count = 0;
|
|
14140
|
-
loop = (
|
|
14280
|
+
loop = (_this$struct$halfBond = this.struct.halfBonds.get(bond === null || bond === void 0 ? void 0 : bond.hb1)) === null || _this$struct$halfBond === void 0 ? void 0 : _this$struct$halfBond.loop;
|
|
14141
14281
|
if (loop && loop < 0) {
|
|
14142
|
-
loop = (
|
|
14282
|
+
loop = (_this$struct$halfBond2 = this.struct.halfBonds.get(bond === null || bond === void 0 ? void 0 : bond.hb2)) === null || _this$struct$halfBond2 === void 0 ? void 0 : _this$struct$halfBond2.loop;
|
|
14143
14283
|
}
|
|
14144
14284
|
if (loop && loop >= 0) {
|
|
14145
|
-
loopHbs = (
|
|
14285
|
+
loopHbs = (_this$struct$loops$ge = this.struct.loops.get(loop)) === null || _this$struct$loops$ge === void 0 ? void 0 : _this$struct$loops$ge.hbs;
|
|
14146
14286
|
loopHbs === null || loopHbs === void 0 ? void 0 : loopHbs.forEach(function (hb) {
|
|
14147
|
-
var
|
|
14148
|
-
var halfBondBegin = (
|
|
14287
|
+
var _this2$struct$halfBon;
|
|
14288
|
+
var halfBondBegin = (_this2$struct$halfBon = _this2.struct.halfBonds.get(hb)) === null || _this2$struct$halfBon === void 0 ? void 0 : _this2$struct$halfBon.begin;
|
|
14149
14289
|
if (halfBondBegin) {
|
|
14150
|
-
var hbbAtom = struct.atoms.get(halfBondBegin);
|
|
14290
|
+
var hbbAtom = _this2.struct.atoms.get(halfBondBegin);
|
|
14151
14291
|
if (hbbAtom) {
|
|
14152
14292
|
xy0.add_(hbbAtom.pp);
|
|
14153
14293
|
count++;
|
|
@@ -14156,7 +14296,7 @@ var TemplateTool = function () {
|
|
|
14156
14296
|
});
|
|
14157
14297
|
} else {
|
|
14158
14298
|
frIds.forEach(function (id) {
|
|
14159
|
-
var atomById = struct.atoms.get(id);
|
|
14299
|
+
var atomById = _this2.struct.atoms.get(id);
|
|
14160
14300
|
if (atomById) {
|
|
14161
14301
|
xy0.add_(atomById.pp);
|
|
14162
14302
|
count++;
|
|
@@ -14164,11 +14304,11 @@ var TemplateTool = function () {
|
|
|
14164
14304
|
});
|
|
14165
14305
|
}
|
|
14166
14306
|
dragCtx.v0 = xy0.scaled(1 / count);
|
|
14167
|
-
sign = getSign(struct, bond, dragCtx.v0);
|
|
14307
|
+
sign = getSign(this.struct, bond, dragCtx.v0);
|
|
14168
14308
|
dragCtx.sign1 = sign || 1;
|
|
14169
14309
|
dragCtx.sign2 = this.template.sign;
|
|
14170
14310
|
}
|
|
14171
|
-
case
|
|
14311
|
+
case 14:
|
|
14172
14312
|
case "end":
|
|
14173
14313
|
return _context.stop();
|
|
14174
14314
|
}
|
|
@@ -14193,10 +14333,9 @@ var TemplateTool = function () {
|
|
|
14193
14333
|
var ci = dragCtx.item;
|
|
14194
14334
|
var targetPos = null;
|
|
14195
14335
|
var eventPos = this.editor.render.page2obj(event);
|
|
14196
|
-
var struct = this.editor.render.ctab.molecule;
|
|
14197
14336
|
if (ci && ci.map === 'bonds' && !this.isModeFunctionalGroup) {
|
|
14198
|
-
var bond = struct.bonds.get(ci.id);
|
|
14199
|
-
var sign = getSign(struct, bond, eventPos);
|
|
14337
|
+
var bond = this.struct.bonds.get(ci.id);
|
|
14338
|
+
var sign = getSign(this.struct, bond, eventPos);
|
|
14200
14339
|
if (dragCtx.sign1 * this.template.sign > 0) {
|
|
14201
14340
|
sign = -sign;
|
|
14202
14341
|
}
|
|
@@ -14220,9 +14359,9 @@ var TemplateTool = function () {
|
|
|
14220
14359
|
if (!ci) {
|
|
14221
14360
|
targetPos = dragCtx.xy0;
|
|
14222
14361
|
} else if (ci.map === 'atoms' || ci.map === 'functionalGroups') {
|
|
14223
|
-
var atomId = getTargetAtomId(struct, ci);
|
|
14362
|
+
var atomId = getTargetAtomId(this.struct, ci);
|
|
14224
14363
|
if (atomId !== undefined) {
|
|
14225
|
-
var atom = struct.atoms.get(atomId);
|
|
14364
|
+
var atom = this.struct.atoms.get(atomId);
|
|
14226
14365
|
targetPos = atom === null || atom === void 0 ? void 0 : atom.pp;
|
|
14227
14366
|
if (targetPos) {
|
|
14228
14367
|
extraBond = this.isModeFunctionalGroup ? true : Vec2.dist(targetPos, eventPos) > 1;
|
|
@@ -14262,7 +14401,7 @@ var TemplateTool = function () {
|
|
|
14262
14401
|
action = _fromTemplateOnCanvas2[0];
|
|
14263
14402
|
pasteItems = _fromTemplateOnCanvas2[1];
|
|
14264
14403
|
} else if ((ci === null || ci === void 0 ? void 0 : ci.map) === 'atoms' || (ci === null || ci === void 0 ? void 0 : ci.map) === 'functionalGroups') {
|
|
14265
|
-
var _atomId = getTargetAtomId(struct, ci);
|
|
14404
|
+
var _atomId = getTargetAtomId(this.struct, ci);
|
|
14266
14405
|
var _fromTemplateOnAtom = fromTemplateOnAtom(this.editor.render.ctab, this.template, _atomId, angle, extraBond);
|
|
14267
14406
|
var _fromTemplateOnAtom2 = _slicedToArray(_fromTemplateOnAtom, 2);
|
|
14268
14407
|
action = _fromTemplateOnAtom2[0];
|
|
@@ -14281,7 +14420,7 @@ var TemplateTool = function () {
|
|
|
14281
14420
|
}, {
|
|
14282
14421
|
key: "mouseup",
|
|
14283
14422
|
value: function mouseup(event) {
|
|
14284
|
-
var
|
|
14423
|
+
var _this3 = this,
|
|
14285
14424
|
_ci;
|
|
14286
14425
|
var dragCtx = this.dragCtx;
|
|
14287
14426
|
if (!dragCtx) {
|
|
@@ -14289,9 +14428,7 @@ var TemplateTool = function () {
|
|
|
14289
14428
|
}
|
|
14290
14429
|
delete this.dragCtx;
|
|
14291
14430
|
var restruct = this.editor.render.ctab;
|
|
14292
|
-
var struct = restruct.molecule;
|
|
14293
14431
|
var ci = dragCtx.item;
|
|
14294
|
-
var functionalGroups = struct.functionalGroups;
|
|
14295
14432
|
if (dragCtx.action && ci && ci.map === 'bonds' && !this.isModeFunctionalGroup) {
|
|
14296
14433
|
dragCtx.action.perform(restruct);
|
|
14297
14434
|
var promise = fromTemplateOnBondAction(restruct, this.template, ci.id, this.editor.event, dragCtx.sign1 * dragCtx.sign2 > 0, true);
|
|
@@ -14299,9 +14436,9 @@ var TemplateTool = function () {
|
|
|
14299
14436
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
14300
14437
|
action = _ref2[0],
|
|
14301
14438
|
pasteItems = _ref2[1];
|
|
14302
|
-
var mergeItems = getItemsToFuse(
|
|
14439
|
+
var mergeItems = getItemsToFuse(_this3.editor, pasteItems);
|
|
14303
14440
|
action = fromItemsFuse(restruct, mergeItems).mergeWith(action);
|
|
14304
|
-
|
|
14441
|
+
_this3.editor.update(action);
|
|
14305
14442
|
});
|
|
14306
14443
|
return true;
|
|
14307
14444
|
}
|
|
@@ -14309,14 +14446,14 @@ var TemplateTool = function () {
|
|
|
14309
14446
|
var pasteItems = null;
|
|
14310
14447
|
if (this.isSaltOrSolvent) {
|
|
14311
14448
|
addSaltsAndSolventsOnCanvasWithoutMerge(restruct, this.template, dragCtx, this.editor);
|
|
14449
|
+
this.editor.hover(this.editor.findItem(event, this.findItems), null, event);
|
|
14312
14450
|
return true;
|
|
14313
|
-
} else if (((_ci = ci) === null || _ci === void 0 ? void 0 : _ci.map) === 'functionalGroups' && FunctionalGroup.isContractedFunctionalGroup(ci.id, functionalGroups) && this.isModeFunctionalGroup && this.targetGroupsIds.length) {
|
|
14451
|
+
} else if (((_ci = ci) === null || _ci === void 0 ? void 0 : _ci.map) === 'functionalGroups' && FunctionalGroup.isContractedFunctionalGroup(ci.id, this.functionalGroups) && this.isModeFunctionalGroup && this.targetGroupsIds.length) {
|
|
14314
14452
|
functionalGroupRemoveAction = new Action();
|
|
14315
|
-
var _struct = this.editor.struct();
|
|
14316
14453
|
var _restruct = this.editor.render.ctab;
|
|
14317
|
-
var functionalGroupToReplace =
|
|
14318
|
-
var attachmentAtomId = functionalGroupToReplace.getAttAtomId(
|
|
14319
|
-
var atomsWithoutAttachmentAtom = SGroup$1.getAtoms(
|
|
14454
|
+
var functionalGroupToReplace = this.struct.sgroups.get(ci.id);
|
|
14455
|
+
var attachmentAtomId = functionalGroupToReplace.getAttAtomId(this.struct);
|
|
14456
|
+
var atomsWithoutAttachmentAtom = SGroup$1.getAtoms(this.struct, functionalGroupToReplace).filter(function (id) {
|
|
14320
14457
|
return id !== attachmentAtomId;
|
|
14321
14458
|
});
|
|
14322
14459
|
functionalGroupRemoveAction.mergeWith(fromSgroupDeletion(_restruct, ci.id));
|
|
@@ -14342,10 +14479,10 @@ var TemplateTool = function () {
|
|
|
14342
14479
|
if (degree && degree > 1) {
|
|
14343
14480
|
angle = null;
|
|
14344
14481
|
} else if (degree === 1) {
|
|
14345
|
-
var
|
|
14346
|
-
var atom = struct.atoms.get(ci.id);
|
|
14347
|
-
var neiId = atom && ((
|
|
14348
|
-
var nei = (neiId || neiId === 0) && struct.atoms.get(neiId);
|
|
14482
|
+
var _this$struct$halfBond3;
|
|
14483
|
+
var atom = this.struct.atoms.get(ci.id);
|
|
14484
|
+
var neiId = atom && ((_this$struct$halfBond3 = this.struct.halfBonds.get(atom.neighbors[0])) === null || _this$struct$halfBond3 === void 0 ? void 0 : _this$struct$halfBond3.end);
|
|
14485
|
+
var nei = (neiId || neiId === 0) && this.struct.atoms.get(neiId);
|
|
14349
14486
|
angle = event.ctrlKey ? utils.calcAngle(nei === null || nei === void 0 ? void 0 : nei.pp, atom === null || atom === void 0 ? void 0 : atom.pp) : utils.fracAngle(utils.calcAngle(nei.pp, atom === null || atom === void 0 ? void 0 : atom.pp), null);
|
|
14350
14487
|
} else {
|
|
14351
14488
|
angle = 0;
|
|
@@ -14364,10 +14501,10 @@ var TemplateTool = function () {
|
|
|
14364
14501
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
14365
14502
|
action = _ref4[0],
|
|
14366
14503
|
pasteItems = _ref4[1];
|
|
14367
|
-
if (!
|
|
14368
|
-
var mergeItems = getItemsToFuse(
|
|
14504
|
+
if (!_this3.isModeFunctionalGroup) {
|
|
14505
|
+
var mergeItems = getItemsToFuse(_this3.editor, pasteItems);
|
|
14369
14506
|
action = fromItemsFuse(restruct, mergeItems).mergeWith(action);
|
|
14370
|
-
|
|
14507
|
+
_this3.editor.update(action);
|
|
14371
14508
|
}
|
|
14372
14509
|
});
|
|
14373
14510
|
return true;
|
|
@@ -14565,9 +14702,6 @@ var tools = {
|
|
|
14565
14702
|
text: TextTool
|
|
14566
14703
|
};
|
|
14567
14704
|
|
|
14568
|
-
function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
14569
|
-
function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
|
|
14570
|
-
function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14571
14705
|
function ownKeys$M(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14572
14706
|
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$M(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$M(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14573
14707
|
function handleHotkeyOverItem(props) {
|
|
@@ -14577,20 +14711,53 @@ function handleHotkeyOverItem(props) {
|
|
|
14577
14711
|
handleDialog(props);
|
|
14578
14712
|
} else if (props.newAction.tool) {
|
|
14579
14713
|
handleTool(props);
|
|
14714
|
+
} else {
|
|
14715
|
+
handleOtherActions(props);
|
|
14580
14716
|
}
|
|
14581
14717
|
}
|
|
14582
|
-
function
|
|
14583
|
-
var
|
|
14584
|
-
|
|
14585
|
-
|
|
14718
|
+
function handleOtherActions(_ref) {
|
|
14719
|
+
var dispatch = _ref.dispatch,
|
|
14720
|
+
newAction = _ref.newAction;
|
|
14721
|
+
dispatch(onAction(newAction));
|
|
14722
|
+
}
|
|
14723
|
+
function eraseItem(_ref2) {
|
|
14724
|
+
var editor = _ref2.editor,
|
|
14725
|
+
item = _ref2.item;
|
|
14726
|
+
var action = fromFragmentDeletion(editor.render.ctab, item);
|
|
14586
14727
|
editor.update(action);
|
|
14587
14728
|
editor.hover(null);
|
|
14588
14729
|
}
|
|
14589
|
-
function
|
|
14590
|
-
var
|
|
14591
|
-
|
|
14592
|
-
|
|
14593
|
-
dispatch =
|
|
14730
|
+
function handleEraser(_ref3) {
|
|
14731
|
+
var editor = _ref3.editor,
|
|
14732
|
+
hoveredItem = _ref3.hoveredItem,
|
|
14733
|
+
newAction = _ref3.newAction,
|
|
14734
|
+
dispatch = _ref3.dispatch;
|
|
14735
|
+
var item = mapItemsToArrays(hoveredItem);
|
|
14736
|
+
var itemType = Object.keys(hoveredItem)[0];
|
|
14737
|
+
if ([STRUCT_TYPE.atoms, STRUCT_TYPE.bonds].includes(itemType)) {
|
|
14738
|
+
isFunctionalGroupChange({
|
|
14739
|
+
editor: editor,
|
|
14740
|
+
hoveredItemId: item[itemType][0],
|
|
14741
|
+
newAction: newAction,
|
|
14742
|
+
dispatch: dispatch
|
|
14743
|
+
}, itemType).then(function (res) {
|
|
14744
|
+
res && eraseItem({
|
|
14745
|
+
editor: editor,
|
|
14746
|
+
item: item
|
|
14747
|
+
});
|
|
14748
|
+
});
|
|
14749
|
+
return;
|
|
14750
|
+
}
|
|
14751
|
+
eraseItem({
|
|
14752
|
+
editor: editor,
|
|
14753
|
+
item: item
|
|
14754
|
+
});
|
|
14755
|
+
}
|
|
14756
|
+
function handleDialog(_ref4) {
|
|
14757
|
+
var hoveredItem = _ref4.hoveredItem,
|
|
14758
|
+
newAction = _ref4.newAction,
|
|
14759
|
+
editor = _ref4.editor,
|
|
14760
|
+
dispatch = _ref4.dispatch;
|
|
14594
14761
|
var dialogType = Object.keys(hoveredItem)[0];
|
|
14595
14762
|
var dialogHandler = getDialogHandler(dialogType);
|
|
14596
14763
|
var hoveredItemId = hoveredItem[dialogType];
|
|
@@ -14616,11 +14783,11 @@ function getDialogHandler(itemType) {
|
|
|
14616
14783
|
var dialog = dialogs[itemType];
|
|
14617
14784
|
return dialog;
|
|
14618
14785
|
}
|
|
14619
|
-
function handleAtomPropsDialog(
|
|
14620
|
-
var hoveredItemId =
|
|
14621
|
-
newAction =
|
|
14622
|
-
editor =
|
|
14623
|
-
dispatch =
|
|
14786
|
+
function handleAtomPropsDialog(_ref5) {
|
|
14787
|
+
var hoveredItemId = _ref5.hoveredItemId,
|
|
14788
|
+
newAction = _ref5.newAction,
|
|
14789
|
+
editor = _ref5.editor,
|
|
14790
|
+
dispatch = _ref5.dispatch;
|
|
14624
14791
|
var selection = editor.selection();
|
|
14625
14792
|
var atomsSelected = selection === null || selection === void 0 ? void 0 : selection.atoms;
|
|
14626
14793
|
var restruct = editor.render.ctab;
|
|
@@ -14643,11 +14810,11 @@ function handleAtomPropsDialog(_ref3) {
|
|
|
14643
14810
|
});
|
|
14644
14811
|
}
|
|
14645
14812
|
}
|
|
14646
|
-
function handleBondPropsDialog(
|
|
14647
|
-
var hoveredItemId =
|
|
14648
|
-
newAction =
|
|
14649
|
-
editor =
|
|
14650
|
-
dispatch =
|
|
14813
|
+
function handleBondPropsDialog(_ref6) {
|
|
14814
|
+
var hoveredItemId = _ref6.hoveredItemId,
|
|
14815
|
+
newAction = _ref6.newAction,
|
|
14816
|
+
editor = _ref6.editor,
|
|
14817
|
+
dispatch = _ref6.dispatch;
|
|
14651
14818
|
var restruct = editor.render.ctab;
|
|
14652
14819
|
var bondFromStruct = restruct.bonds.get(hoveredItemId);
|
|
14653
14820
|
var convertedBondForModal = fromBond(bondFromStruct === null || bondFromStruct === void 0 ? void 0 : bondFromStruct.b);
|
|
@@ -14658,11 +14825,11 @@ function handleBondPropsDialog(_ref4) {
|
|
|
14658
14825
|
return null;
|
|
14659
14826
|
});
|
|
14660
14827
|
}
|
|
14661
|
-
function handleTool(
|
|
14662
|
-
var hoveredItem =
|
|
14663
|
-
newAction =
|
|
14664
|
-
editor =
|
|
14665
|
-
dispatch =
|
|
14828
|
+
function handleTool(_ref7) {
|
|
14829
|
+
var hoveredItem = _ref7.hoveredItem,
|
|
14830
|
+
newAction = _ref7.newAction,
|
|
14831
|
+
editor = _ref7.editor,
|
|
14832
|
+
dispatch = _ref7.dispatch;
|
|
14666
14833
|
var _loop = function _loop(item) {
|
|
14667
14834
|
var toolHandler = getToolHandler(item, newAction.tool);
|
|
14668
14835
|
var isChangeStructureTool = newAction.tool !== 'hand';
|
|
@@ -14674,7 +14841,7 @@ function handleTool(_ref5) {
|
|
|
14674
14841
|
newAction: newAction,
|
|
14675
14842
|
dispatch: dispatch
|
|
14676
14843
|
};
|
|
14677
|
-
isFunctionalGroupChange(props).then(function (result) {
|
|
14844
|
+
isFunctionalGroupChange(props, item).then(function (result) {
|
|
14678
14845
|
if (!result && isChangeStructureTool) return;
|
|
14679
14846
|
toolHandler(props);
|
|
14680
14847
|
});
|
|
@@ -14684,17 +14851,17 @@ function handleTool(_ref5) {
|
|
|
14684
14851
|
_loop(item);
|
|
14685
14852
|
}
|
|
14686
14853
|
}
|
|
14687
|
-
function isFunctionalGroupChange(_x) {
|
|
14854
|
+
function isFunctionalGroupChange(_x, _x2) {
|
|
14688
14855
|
return _isFunctionalGroupChange.apply(this, arguments);
|
|
14689
14856
|
}
|
|
14690
14857
|
function _isFunctionalGroupChange() {
|
|
14691
|
-
_isFunctionalGroupChange = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(props) {
|
|
14858
|
+
_isFunctionalGroupChange = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(props, type) {
|
|
14692
14859
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
14693
14860
|
while (1) {
|
|
14694
14861
|
switch (_context.prev = _context.next) {
|
|
14695
14862
|
case 0:
|
|
14696
14863
|
_context.next = 2;
|
|
14697
|
-
return isChangingFunctionalGroup(props);
|
|
14864
|
+
return isChangingFunctionalGroup(props, type);
|
|
14698
14865
|
case 2:
|
|
14699
14866
|
return _context.abrupt("return", _context.sent);
|
|
14700
14867
|
case 3:
|
|
@@ -14722,13 +14889,13 @@ function getToolHandler(itemType) {
|
|
|
14722
14889
|
rgroupatom: function rgroupatom(props) {
|
|
14723
14890
|
return handleRGroupAtomTool(props);
|
|
14724
14891
|
},
|
|
14725
|
-
sgroup: function sgroup(
|
|
14726
|
-
var editor =
|
|
14727
|
-
hoveredItemId =
|
|
14892
|
+
sgroup: function sgroup(_ref8) {
|
|
14893
|
+
var editor = _ref8.editor,
|
|
14894
|
+
hoveredItemId = _ref8.hoveredItemId;
|
|
14728
14895
|
tools.sgroup.sgroupDialog(editor, hoveredItemId);
|
|
14729
14896
|
},
|
|
14730
|
-
hand: function hand(
|
|
14731
|
-
var dispatch =
|
|
14897
|
+
hand: function hand(_ref9) {
|
|
14898
|
+
var dispatch = _ref9.dispatch;
|
|
14732
14899
|
return dispatch(onAction({
|
|
14733
14900
|
tool: 'hand'
|
|
14734
14901
|
}));
|
|
@@ -14742,26 +14909,28 @@ function getToolHandler(itemType) {
|
|
|
14742
14909
|
}
|
|
14743
14910
|
return items._default[toolName];
|
|
14744
14911
|
}
|
|
14745
|
-
function handleAtomTool(
|
|
14746
|
-
var hoveredItemId =
|
|
14747
|
-
newAction =
|
|
14748
|
-
editor =
|
|
14912
|
+
function handleAtomTool(_ref10) {
|
|
14913
|
+
var hoveredItemId = _ref10.hoveredItemId,
|
|
14914
|
+
newAction = _ref10.newAction,
|
|
14915
|
+
editor = _ref10.editor;
|
|
14749
14916
|
var atomProps = _objectSpread$M({}, newAction.opts);
|
|
14750
14917
|
var updatedAtoms = fromAtomsAttrs(editor.render.ctab, hoveredItemId, atomProps, true);
|
|
14751
14918
|
editor.update(updatedAtoms);
|
|
14752
14919
|
}
|
|
14753
|
-
function handleBondTool(
|
|
14754
|
-
var hoveredItemId =
|
|
14755
|
-
newAction =
|
|
14756
|
-
editor =
|
|
14757
|
-
var newBond = fromBondAddition(editor.render.ctab, newAction.opts, hoveredItemId,
|
|
14920
|
+
function handleBondTool(_ref11) {
|
|
14921
|
+
var hoveredItemId = _ref11.hoveredItemId,
|
|
14922
|
+
newAction = _ref11.newAction,
|
|
14923
|
+
editor = _ref11.editor;
|
|
14924
|
+
var newBond = fromBondAddition(editor.render.ctab, newAction.opts, hoveredItemId, {
|
|
14925
|
+
label: 'C'
|
|
14926
|
+
})[0];
|
|
14758
14927
|
editor.update(newBond);
|
|
14759
14928
|
}
|
|
14760
|
-
function handleChargeTool(
|
|
14929
|
+
function handleChargeTool(_ref12) {
|
|
14761
14930
|
var _editor$render$ctab$a;
|
|
14762
|
-
var hoveredItemId =
|
|
14763
|
-
newAction =
|
|
14764
|
-
editor =
|
|
14931
|
+
var hoveredItemId = _ref12.hoveredItemId,
|
|
14932
|
+
newAction = _ref12.newAction,
|
|
14933
|
+
editor = _ref12.editor;
|
|
14765
14934
|
var existingAtom = (_editor$render$ctab$a = editor.render.ctab.atoms.get(hoveredItemId)) === null || _editor$render$ctab$a === void 0 ? void 0 : _editor$render$ctab$a.a;
|
|
14766
14935
|
if (existingAtom) {
|
|
14767
14936
|
var updatedAtom = fromAtomsAttrs(editor.render.ctab, hoveredItemId, {
|
|
@@ -14777,17 +14946,17 @@ function mapItemsToArrays(items) {
|
|
|
14777
14946
|
}
|
|
14778
14947
|
return mappedItems;
|
|
14779
14948
|
}
|
|
14780
|
-
function handleRGroupAtomTool(
|
|
14949
|
+
function handleRGroupAtomTool(_x3) {
|
|
14781
14950
|
return _handleRGroupAtomTool.apply(this, arguments);
|
|
14782
14951
|
}
|
|
14783
14952
|
function _handleRGroupAtomTool() {
|
|
14784
|
-
_handleRGroupAtomTool = _asyncToGenerator( _regeneratorRuntime.mark(function _callee2(
|
|
14953
|
+
_handleRGroupAtomTool = _asyncToGenerator( _regeneratorRuntime.mark(function _callee2(_ref13) {
|
|
14785
14954
|
var hoveredItemId, editor, struct, atom, rglabel, label, element;
|
|
14786
14955
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
14787
14956
|
while (1) {
|
|
14788
14957
|
switch (_context2.prev = _context2.next) {
|
|
14789
14958
|
case 0:
|
|
14790
|
-
hoveredItemId =
|
|
14959
|
+
hoveredItemId = _ref13.hoveredItemId, editor = _ref13.editor;
|
|
14791
14960
|
struct = editor.render.ctab.molecule;
|
|
14792
14961
|
atom = hoveredItemId || hoveredItemId === 0 ? struct.atoms.get(hoveredItemId) : null;
|
|
14793
14962
|
rglabel = atom ? atom.rglabel : 0;
|
|
@@ -14824,64 +14993,36 @@ function _handleRGroupAtomTool() {
|
|
|
14824
14993
|
}));
|
|
14825
14994
|
return _handleRGroupAtomTool.apply(this, arguments);
|
|
14826
14995
|
}
|
|
14827
|
-
function
|
|
14996
|
+
function getFunctionalGroupIdByItem(editor, hoveredItemId, type) {
|
|
14997
|
+
var molecule = editor.render.ctab.molecule;
|
|
14998
|
+
var functionalGroups = molecule.functionalGroups;
|
|
14999
|
+
return type === 'atoms' ? FunctionalGroup.findFunctionalGroupByAtom(functionalGroups, hoveredItemId) : FunctionalGroup.findFunctionalGroupByBond(molecule, functionalGroups, hoveredItemId);
|
|
15000
|
+
}
|
|
15001
|
+
function isChangingFunctionalGroup(_x4, _x5) {
|
|
14828
15002
|
return _isChangingFunctionalGroup.apply(this, arguments);
|
|
14829
15003
|
}
|
|
14830
15004
|
function _isChangingFunctionalGroup() {
|
|
14831
|
-
_isChangingFunctionalGroup = _asyncToGenerator( _regeneratorRuntime.mark(function _callee3(
|
|
14832
|
-
var
|
|
14833
|
-
var hoveredItemId, editor, atomResult, result, atom, molecule, functionalGroups, sgroupsOnCanvas, atomId, isFunctionalGroup, _iterator, _step, id, fgId;
|
|
15005
|
+
_isChangingFunctionalGroup = _asyncToGenerator( _regeneratorRuntime.mark(function _callee3(_ref14, type) {
|
|
15006
|
+
var hoveredItemId, editor, fgId;
|
|
14834
15007
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
14835
15008
|
while (1) {
|
|
14836
15009
|
switch (_context3.prev = _context3.next) {
|
|
14837
15010
|
case 0:
|
|
14838
|
-
hoveredItemId =
|
|
14839
|
-
|
|
14840
|
-
|
|
14841
|
-
|
|
14842
|
-
molecule = editor.render.ctab.molecule;
|
|
14843
|
-
functionalGroups = molecule.functionalGroups;
|
|
14844
|
-
sgroupsOnCanvas = Array.from(molecule.sgroups.values());
|
|
14845
|
-
if (atom && functionalGroups) {
|
|
14846
|
-
atomId = FunctionalGroup.atomsInFunctionalGroup(functionalGroups, hoveredItemId);
|
|
14847
|
-
if (atomId !== null) {
|
|
14848
|
-
atomResult.push(atomId);
|
|
14849
|
-
}
|
|
14850
|
-
}
|
|
14851
|
-
isFunctionalGroup = atomResult.length > 0;
|
|
14852
|
-
if (!isFunctionalGroup) {
|
|
14853
|
-
_context3.next = 17;
|
|
15011
|
+
hoveredItemId = _ref14.hoveredItemId, editor = _ref14.editor;
|
|
15012
|
+
fgId = getFunctionalGroupIdByItem(editor, hoveredItemId, type);
|
|
15013
|
+
if (!(fgId !== null)) {
|
|
15014
|
+
_context3.next = 6;
|
|
14854
15015
|
break;
|
|
14855
15016
|
}
|
|
14856
|
-
|
|
14857
|
-
_context3.next = 12;
|
|
14858
|
-
break;
|
|
14859
|
-
}
|
|
14860
|
-
return _context3.abrupt("return", false);
|
|
14861
|
-
case 12:
|
|
14862
|
-
_iterator = _createForOfIteratorHelper$2(atomResult);
|
|
14863
|
-
try {
|
|
14864
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
14865
|
-
id = _step.value;
|
|
14866
|
-
fgId = FunctionalGroup.findFunctionalGroupByAtom(functionalGroups, id);
|
|
14867
|
-
if (fgId !== null && !result.includes(fgId)) {
|
|
14868
|
-
result.push(fgId);
|
|
14869
|
-
}
|
|
14870
|
-
}
|
|
14871
|
-
} catch (err) {
|
|
14872
|
-
_iterator.e(err);
|
|
14873
|
-
} finally {
|
|
14874
|
-
_iterator.f();
|
|
14875
|
-
}
|
|
14876
|
-
_context3.next = 16;
|
|
15017
|
+
_context3.next = 5;
|
|
14877
15018
|
return editor.event.removeFG.dispatch({
|
|
14878
|
-
fgIds:
|
|
15019
|
+
fgIds: [fgId]
|
|
14879
15020
|
});
|
|
14880
|
-
case
|
|
14881
|
-
return _context3.abrupt("return",
|
|
14882
|
-
case
|
|
15021
|
+
case 5:
|
|
15022
|
+
return _context3.abrupt("return", false);
|
|
15023
|
+
case 6:
|
|
14883
15024
|
return _context3.abrupt("return", true);
|
|
14884
|
-
case
|
|
15025
|
+
case 7:
|
|
14885
15026
|
case "end":
|
|
14886
15027
|
return _context3.stop();
|
|
14887
15028
|
}
|
|
@@ -14899,15 +15040,10 @@ function initKeydownListener(element) {
|
|
|
14899
15040
|
});
|
|
14900
15041
|
};
|
|
14901
15042
|
}
|
|
14902
|
-
function removeNotRenderedStruct(actionTool,
|
|
14903
|
-
var
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
var savedSelectedTool = SettingsManager.selectionTool;
|
|
14907
|
-
dispatch({
|
|
14908
|
-
type: 'ACTION',
|
|
14909
|
-
action: savedSelectedTool || tools$1['select-rectangle'].action
|
|
14910
|
-
});
|
|
15043
|
+
function removeNotRenderedStruct(actionTool, group, dispatch) {
|
|
15044
|
+
var affectedTools = ['paste', 'template'];
|
|
15045
|
+
if (affectedTools.includes(actionTool.tool) && group !== null && group !== void 0 && group.includes('save')) {
|
|
15046
|
+
dispatch(removeStructAction());
|
|
14911
15047
|
}
|
|
14912
15048
|
}
|
|
14913
15049
|
function keyHandle(dispatch, state, hotKeys, event) {
|
|
@@ -14959,7 +15095,7 @@ function keyHandle(dispatch, state, hotKeys, event) {
|
|
|
14959
15095
|
event.preventDefault();
|
|
14960
15096
|
return;
|
|
14961
15097
|
}
|
|
14962
|
-
removeNotRenderedStruct(actionTool,
|
|
15098
|
+
removeNotRenderedStruct(actionTool, group, dispatch);
|
|
14963
15099
|
if (actions.indexOf(actName) === -1) {
|
|
14964
15100
|
var newAction = config[actName].action;
|
|
14965
15101
|
var _hoveredItem = getHoveredItem(render.ctab);
|
|
@@ -15129,7 +15265,7 @@ var mapDispatchToProps$d = function mapDispatchToProps(dispatch) {
|
|
|
15129
15265
|
};
|
|
15130
15266
|
var AppHiddenContainer = connect(null, mapDispatchToProps$d)(AppHidden);
|
|
15131
15267
|
|
|
15132
|
-
var classes$
|
|
15268
|
+
var classes$F = {"button-common-styles":"Modal-module_button-common-styles__ko9E5","scrollbar":"Modal-module_scrollbar__yPIJc","modalOverlay":"Modal-module_modalOverlay__AzVeg","animate":"Modal-module_animate__pnPNj","hide":"Modal-module_hide__0CTey","smallScreen":"Modal-module_smallScreen__nzt2L"};
|
|
15133
15269
|
|
|
15134
15270
|
var selectClasses = {"button-common-styles":"Select-module_button-common-styles__cgaVz","scrollbar":"Select-module_scrollbar__cA89D","dropdownList":"Select-module_dropdownList__rdcrH","listDivider":"Select-module_listDivider__4vJyh","selectContainer":"Select-module_selectContainer__yXT-t"};
|
|
15135
15271
|
|
|
@@ -15388,7 +15524,7 @@ function findClosestBond(restruct, pos, skip, minDist, scale) {
|
|
|
15388
15524
|
if (bid === skipId) return;
|
|
15389
15525
|
var a1 = restruct.atoms.get(bond.b.begin).a;
|
|
15390
15526
|
var a2 = restruct.atoms.get(bond.b.end).a;
|
|
15391
|
-
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups)) return null;
|
|
15527
|
+
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups) || SGroup$1.isBondInContractedSGroup(bond.b, sGroups)) return null;
|
|
15392
15528
|
var mid = Vec2.lc2(a1.pp, 0.5, a2.pp, 0.5);
|
|
15393
15529
|
var cdist = Vec2.dist(pos, mid);
|
|
15394
15530
|
if (cdist < minCDist) {
|
|
@@ -15398,7 +15534,7 @@ function findClosestBond(restruct, pos, skip, minDist, scale) {
|
|
|
15398
15534
|
});
|
|
15399
15535
|
restruct.bonds.forEach(function (bond, bid) {
|
|
15400
15536
|
if (bid === skipId) return;
|
|
15401
|
-
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups)) return null;
|
|
15537
|
+
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups) || SGroup$1.isBondInContractedSGroup(bond.b, sGroups)) return null;
|
|
15402
15538
|
var hb = restruct.molecule.halfBonds.get(bond.b.hb1);
|
|
15403
15539
|
var dir = hb.dir;
|
|
15404
15540
|
var norm = hb.norm;
|
|
@@ -15573,7 +15709,7 @@ function findClosestFG(restruct, pos, skip) {
|
|
|
15573
15709
|
reSGroupId = _step$value[0],
|
|
15574
15710
|
reSGroup = _step$value[1];
|
|
15575
15711
|
if (reSGroupId === skipId) continue;
|
|
15576
|
-
var _reSGroup$getTextHigh = reSGroup.getTextHighlightDimensions(),
|
|
15712
|
+
var _reSGroup$getTextHigh = reSGroup.getTextHighlightDimensions(0, restruct.render),
|
|
15577
15713
|
startX = _reSGroup$getTextHigh.startX,
|
|
15578
15714
|
startY = _reSGroup$getTextHigh.startY,
|
|
15579
15715
|
width = _reSGroup$getTextHigh.width,
|
|
@@ -15634,20 +15770,55 @@ function findCloseMerge(restruct, selected) {
|
|
|
15634
15770
|
var bond = struct.bonds.get(bid);
|
|
15635
15771
|
pos.bonds.set(bid, Vec2.lc2(struct.atoms.get(bond.begin).pp, 0.5, struct.atoms.get(bond.end).pp, 0.5));
|
|
15636
15772
|
});
|
|
15637
|
-
var result = {
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
|
|
15647
|
-
}
|
|
15773
|
+
var result = {
|
|
15774
|
+
atoms: new Map(),
|
|
15775
|
+
atomToFunctionalGroup: new Map()
|
|
15776
|
+
};
|
|
15777
|
+
maps.forEach(function (map) {
|
|
15778
|
+
if (map === 'atoms') {
|
|
15779
|
+
Array.from(pos.atoms.keys()).forEach(function (atomId) {
|
|
15780
|
+
var atomPosition = pos.atoms.get(atomId);
|
|
15781
|
+
mergeAtomToAtom(atomId, restruct, atomPosition, selected, result) || mergeAtomToFunctionalGroup(atomId, restruct, atomPosition, result);
|
|
15782
|
+
});
|
|
15783
|
+
} else {
|
|
15784
|
+
result[map] = Array.from(pos[map].keys()).reduce(function (res, srcId) {
|
|
15785
|
+
var skip = {
|
|
15786
|
+
map: map,
|
|
15787
|
+
id: srcId
|
|
15788
|
+
};
|
|
15789
|
+
var item = findMaps[map](restruct, pos[map].get(srcId), skip, null, scale);
|
|
15790
|
+
if (item && !selected[map].includes(item.id)) {
|
|
15791
|
+
res.set(srcId, item.id);
|
|
15792
|
+
}
|
|
15793
|
+
return res;
|
|
15794
|
+
}, new Map());
|
|
15795
|
+
}
|
|
15648
15796
|
});
|
|
15649
15797
|
return result;
|
|
15650
15798
|
}
|
|
15799
|
+
function mergeAtomToAtom(atomId, restruct, atomPosition, selected, result) {
|
|
15800
|
+
var skip = {
|
|
15801
|
+
map: 'atoms',
|
|
15802
|
+
id: atomId
|
|
15803
|
+
};
|
|
15804
|
+
var closestAtom = findClosestAtom(restruct, atomPosition, skip, null);
|
|
15805
|
+
if (closestAtom && !selected.atoms.includes(closestAtom.id)) {
|
|
15806
|
+
result.atoms.set(atomId, closestAtom.id);
|
|
15807
|
+
return true;
|
|
15808
|
+
}
|
|
15809
|
+
return false;
|
|
15810
|
+
}
|
|
15811
|
+
function mergeAtomToFunctionalGroup(atomId, restruct, atomPosition, result) {
|
|
15812
|
+
if (FunctionalGroup.isAttachmentPointAtom(atomId, restruct.molecule)) {
|
|
15813
|
+
return false;
|
|
15814
|
+
}
|
|
15815
|
+
var closestFunctionalGroup = findClosestFG(restruct, atomPosition, null);
|
|
15816
|
+
if (closestFunctionalGroup) {
|
|
15817
|
+
result.atomToFunctionalGroup.set(atomId, closestFunctionalGroup.id);
|
|
15818
|
+
return true;
|
|
15819
|
+
}
|
|
15820
|
+
return false;
|
|
15821
|
+
}
|
|
15651
15822
|
var closest = {
|
|
15652
15823
|
atom: findClosestAtom,
|
|
15653
15824
|
item: findClosestItem,
|
|
@@ -16526,7 +16697,7 @@ function setHover(ci, visible, render) {
|
|
|
16526
16697
|
return true;
|
|
16527
16698
|
}
|
|
16528
16699
|
|
|
16529
|
-
var classes$
|
|
16700
|
+
var classes$E = {"button-common-styles":"StructEditor-module_button-common-styles__3P7PO","scrollbar":"StructEditor-module_scrollbar__SUs-o","spinnerOverlay":"StructEditor-module_spinnerOverlay__5H1IM","canvas":"StructEditor-module_canvas__LLnzh","measureLog":"StructEditor-module_measureLog__B2wuy","visible":"StructEditor-module_visible__3eFNB","intermediateCanvas":"StructEditor-module_intermediateCanvas__fR3ws","enableCursor":"StructEditor-module_enableCursor__Qla0A"};
|
|
16530
16701
|
|
|
16531
16702
|
var Cursor = function Cursor(_ref) {
|
|
16532
16703
|
var Icon = _ref.Icon,
|
|
@@ -16788,8 +16959,7 @@ var useBondEdit = function useBondEdit() {
|
|
|
16788
16959
|
getKetcherInstance = _useAppContext.getKetcherInstance;
|
|
16789
16960
|
var handler = useCallback( function () {
|
|
16790
16961
|
var _ref2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(_ref) {
|
|
16791
|
-
var
|
|
16792
|
-
var props, editor, bondIds, bond, newBond;
|
|
16962
|
+
var props, editor, bondIds, molecule, bonds, changeBondPromise;
|
|
16793
16963
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16794
16964
|
while (1) {
|
|
16795
16965
|
switch (_context.prev = _context.next) {
|
|
@@ -16797,24 +16967,29 @@ var useBondEdit = function useBondEdit() {
|
|
|
16797
16967
|
props = _ref.props;
|
|
16798
16968
|
editor = getKetcherInstance().editor;
|
|
16799
16969
|
bondIds = (props === null || props === void 0 ? void 0 : props.bondIds) || [];
|
|
16800
|
-
|
|
16970
|
+
molecule = editor.render.ctab;
|
|
16801
16971
|
_context.prev = 4;
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16972
|
+
bonds = mapBondIdsToBonds(bondIds, molecule);
|
|
16973
|
+
_context.next = 8;
|
|
16974
|
+
return editor.event.bondEdit.dispatch(bonds);
|
|
16975
|
+
case 8:
|
|
16976
|
+
changeBondPromise = _context.sent;
|
|
16977
|
+
updateSelectedBonds({
|
|
16978
|
+
bonds: bondIds,
|
|
16979
|
+
changeBondPromise: changeBondPromise,
|
|
16980
|
+
editor: editor
|
|
16981
|
+
});
|
|
16982
|
+
_context.next = 15;
|
|
16808
16983
|
break;
|
|
16809
|
-
case
|
|
16810
|
-
_context.prev =
|
|
16984
|
+
case 12:
|
|
16985
|
+
_context.prev = 12;
|
|
16811
16986
|
_context.t0 = _context["catch"](4);
|
|
16812
|
-
case
|
|
16987
|
+
case 15:
|
|
16813
16988
|
case "end":
|
|
16814
16989
|
return _context.stop();
|
|
16815
16990
|
}
|
|
16816
16991
|
}
|
|
16817
|
-
}, _callee, null, [[4,
|
|
16992
|
+
}, _callee, null, [[4, 12]]);
|
|
16818
16993
|
}));
|
|
16819
16994
|
return function (_x) {
|
|
16820
16995
|
return _ref2.apply(this, arguments);
|
|
@@ -17006,7 +17181,16 @@ var useFunctionalGroupEoc = function useFunctionalGroupEoc() {
|
|
|
17006
17181
|
return toExpand ? functionalGroup.isExpanded : !functionalGroup.isExpanded;
|
|
17007
17182
|
}));
|
|
17008
17183
|
}, []);
|
|
17009
|
-
|
|
17184
|
+
var disabled = useCallback(function (_ref3) {
|
|
17185
|
+
var _props$functionalGrou2;
|
|
17186
|
+
var props = _ref3.props;
|
|
17187
|
+
var editor = getKetcherInstance().editor;
|
|
17188
|
+
var molecule = editor.render.ctab.molecule;
|
|
17189
|
+
return Boolean(props === null || props === void 0 ? void 0 : (_props$functionalGrou2 = props.functionalGroups) === null || _props$functionalGrou2 === void 0 ? void 0 : _props$functionalGrou2.every(function (functionalGroup) {
|
|
17190
|
+
return FunctionalGroup.getAttachmentPointCount(functionalGroup === null || functionalGroup === void 0 ? void 0 : functionalGroup.relatedSGroup, molecule) > 1;
|
|
17191
|
+
}));
|
|
17192
|
+
}, []);
|
|
17193
|
+
return [handler, hidden, disabled];
|
|
17010
17194
|
};
|
|
17011
17195
|
|
|
17012
17196
|
var useFunctionalGroupRemove = function useFunctionalGroupRemove() {
|
|
@@ -17034,12 +17218,16 @@ function ownKeys$G(object, enumerableOnly) { var keys = Object.keys(object); if
|
|
|
17034
17218
|
function _objectSpread$G(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$G(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$G(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17035
17219
|
var FunctionalGroupMenuItems = function FunctionalGroupMenuItems(props) {
|
|
17036
17220
|
var _useFunctionalGroupEo = useFunctionalGroupEoc(),
|
|
17037
|
-
_useFunctionalGroupEo2 = _slicedToArray(_useFunctionalGroupEo,
|
|
17221
|
+
_useFunctionalGroupEo2 = _slicedToArray(_useFunctionalGroupEo, 3),
|
|
17038
17222
|
handleExpandOrContract = _useFunctionalGroupEo2[0],
|
|
17039
|
-
ExpandOrContractHidden = _useFunctionalGroupEo2[1]
|
|
17223
|
+
ExpandOrContractHidden = _useFunctionalGroupEo2[1],
|
|
17224
|
+
ExpandOrContractDisabled = _useFunctionalGroupEo2[2];
|
|
17040
17225
|
var handleRemove = useFunctionalGroupRemove();
|
|
17041
17226
|
return jsxs(Fragment, {
|
|
17042
17227
|
children: [jsx(Item, _objectSpread$G(_objectSpread$G({}, props), {}, {
|
|
17228
|
+
disabled: function disabled(params) {
|
|
17229
|
+
return ExpandOrContractDisabled(params);
|
|
17230
|
+
},
|
|
17043
17231
|
hidden: function hidden(params) {
|
|
17044
17232
|
return ExpandOrContractHidden(params, true);
|
|
17045
17233
|
},
|
|
@@ -17048,6 +17236,9 @@ var FunctionalGroupMenuItems = function FunctionalGroupMenuItems(props) {
|
|
|
17048
17236
|
},
|
|
17049
17237
|
children: "Expand Abbreviation"
|
|
17050
17238
|
})), jsx(Item, _objectSpread$G(_objectSpread$G({}, props), {}, {
|
|
17239
|
+
disabled: function disabled(params) {
|
|
17240
|
+
return ExpandOrContractDisabled(params);
|
|
17241
|
+
},
|
|
17051
17242
|
hidden: function hidden(params) {
|
|
17052
17243
|
return ExpandOrContractHidden(params, false);
|
|
17053
17244
|
},
|
|
@@ -17342,7 +17533,7 @@ var StructRender = function (_Component) {
|
|
|
17342
17533
|
return StructRender;
|
|
17343
17534
|
}(Component);
|
|
17344
17535
|
|
|
17345
|
-
var classes$
|
|
17536
|
+
var classes$D = {"infoPanel":"InfoPanel-module_infoPanel__irvZL"};
|
|
17346
17537
|
|
|
17347
17538
|
var X_COORD_INDEX = 0;
|
|
17348
17539
|
var Y_COORD_INDEX = 1;
|
|
@@ -17447,7 +17638,7 @@ var SGroupDataRender = function SGroupDataRender(props) {
|
|
|
17447
17638
|
left: panelCoordinate.x + 'px',
|
|
17448
17639
|
top: panelCoordinate.y + 'px'
|
|
17449
17640
|
},
|
|
17450
|
-
className: clsx(classes$
|
|
17641
|
+
className: clsx(classes$D.infoPanel, className),
|
|
17451
17642
|
children: sGroupData
|
|
17452
17643
|
}) : null;
|
|
17453
17644
|
};
|
|
@@ -17523,11 +17714,9 @@ var InfoPanel = function InfoPanel(props) {
|
|
|
17523
17714
|
var childRef = useRef(null);
|
|
17524
17715
|
var groupName = sGroup === null || sGroup === void 0 ? void 0 : (_sGroup$data = sGroup.data) === null || _sGroup$data === void 0 ? void 0 : _sGroup$data.name;
|
|
17525
17716
|
useEffect(function () {
|
|
17526
|
-
|
|
17527
|
-
|
|
17528
|
-
|
|
17529
|
-
var _sGroup$data3, _sGroup$data4;
|
|
17530
|
-
setSGroupData("".concat((_sGroup$data3 = sGroup.data) === null || _sGroup$data3 === void 0 ? void 0 : _sGroup$data3.fieldName, "=").concat((_sGroup$data4 = sGroup.data) === null || _sGroup$data4 === void 0 ? void 0 : _sGroup$data4.fieldValue));
|
|
17717
|
+
if (!groupStruct && (sGroup === null || sGroup === void 0 ? void 0 : sGroup.type) === 'DAT') {
|
|
17718
|
+
var _sGroup$data2, _sGroup$data3;
|
|
17719
|
+
setSGroupData("".concat((_sGroup$data2 = sGroup.data) === null || _sGroup$data2 === void 0 ? void 0 : _sGroup$data2.fieldName, "=").concat((_sGroup$data3 = sGroup.data) === null || _sGroup$data3 === void 0 ? void 0 : _sGroup$data3.fieldValue));
|
|
17531
17720
|
} else {
|
|
17532
17721
|
setSGroupData(null);
|
|
17533
17722
|
}
|
|
@@ -17551,7 +17740,7 @@ var InfoPanel = function InfoPanel(props) {
|
|
|
17551
17740
|
left: x + 'px',
|
|
17552
17741
|
top: y + 'px'
|
|
17553
17742
|
},
|
|
17554
|
-
className: clsx(classes$
|
|
17743
|
+
className: clsx(classes$D.infoPanel, className),
|
|
17555
17744
|
children: jsx(StructRender, {
|
|
17556
17745
|
struct: molecule,
|
|
17557
17746
|
id: groupName,
|
|
@@ -17561,6 +17750,7 @@ var InfoPanel = function InfoPanel(props) {
|
|
|
17561
17750
|
autoScaleMargin: 0,
|
|
17562
17751
|
rescaleAmount: 1,
|
|
17563
17752
|
cachePrefix: 'infoPanel',
|
|
17753
|
+
needCache: false,
|
|
17564
17754
|
viewSz: new Vec2(width, height),
|
|
17565
17755
|
width: width,
|
|
17566
17756
|
height: height
|
|
@@ -17668,15 +17858,15 @@ var StructEditor = function (_Component) {
|
|
|
17668
17858
|
} catch (_unused) {
|
|
17669
17859
|
el.innerHTML = msg.info;
|
|
17670
17860
|
}
|
|
17671
|
-
el.classList.add(classes$
|
|
17861
|
+
el.classList.add(classes$E.visible);
|
|
17672
17862
|
} else {
|
|
17673
|
-
el.classList.remove(classes$
|
|
17863
|
+
el.classList.remove(classes$E.visible);
|
|
17674
17864
|
}
|
|
17675
17865
|
});
|
|
17676
17866
|
this.editor.event.cursor.add(function (csr) {
|
|
17677
17867
|
switch (csr.status) {
|
|
17678
17868
|
case 'enable':
|
|
17679
|
-
_this2.editorRef.current.classList.add(classes$
|
|
17869
|
+
_this2.editorRef.current.classList.add(classes$E.enableCursor);
|
|
17680
17870
|
var _this2$editorRef$curr = _this2.editorRef.current.getBoundingClientRect(),
|
|
17681
17871
|
left = _this2$editorRef$curr.left,
|
|
17682
17872
|
top = _this2$editorRef$curr.top,
|
|
@@ -17693,7 +17883,7 @@ var StructEditor = function (_Component) {
|
|
|
17693
17883
|
}
|
|
17694
17884
|
break;
|
|
17695
17885
|
case 'move':
|
|
17696
|
-
_this2.editorRef.current.classList.add(classes$
|
|
17886
|
+
_this2.editorRef.current.classList.add(classes$E.enableCursor);
|
|
17697
17887
|
_this2.setState({
|
|
17698
17888
|
enableCursor: true,
|
|
17699
17889
|
clientX: clientX,
|
|
@@ -17701,19 +17891,19 @@ var StructEditor = function (_Component) {
|
|
|
17701
17891
|
});
|
|
17702
17892
|
break;
|
|
17703
17893
|
case 'disable':
|
|
17704
|
-
_this2.editorRef.current.classList.remove(classes$
|
|
17894
|
+
_this2.editorRef.current.classList.remove(classes$E.enableCursor);
|
|
17705
17895
|
_this2.setState({
|
|
17706
17896
|
enableCursor: false
|
|
17707
17897
|
});
|
|
17708
17898
|
break;
|
|
17709
17899
|
case 'leave':
|
|
17710
|
-
_this2.editorRef.current.classList.remove(classes$
|
|
17900
|
+
_this2.editorRef.current.classList.remove(classes$E.enableCursor);
|
|
17711
17901
|
_this2.setState({
|
|
17712
17902
|
enableCursor: false
|
|
17713
17903
|
});
|
|
17714
17904
|
break;
|
|
17715
17905
|
case 'mouseover':
|
|
17716
|
-
_this2.editorRef.current.classList.add(classes$
|
|
17906
|
+
_this2.editorRef.current.classList.add(classes$E.enableCursor);
|
|
17717
17907
|
_this2.setState({
|
|
17718
17908
|
enableCursor: true
|
|
17719
17909
|
});
|
|
@@ -17766,22 +17956,22 @@ var StructEditor = function (_Component) {
|
|
|
17766
17956
|
_this$state$clientY = _this$state.clientY,
|
|
17767
17957
|
clientY = _this$state$clientY === void 0 ? 0 : _this$state$clientY;
|
|
17768
17958
|
return jsxs(Tag, _objectSpread$B(_objectSpread$B({
|
|
17769
|
-
className: clsx(classes$
|
|
17959
|
+
className: clsx(classes$E.canvas, className)
|
|
17770
17960
|
}, props), {}, {
|
|
17771
17961
|
children: [jsx(ContextMenuTrigger, {
|
|
17772
17962
|
children: jsx("div", {
|
|
17773
17963
|
ref: this.editorRef,
|
|
17774
|
-
className: clsx(classes$
|
|
17964
|
+
className: clsx(classes$E.intermediateCanvas)
|
|
17775
17965
|
})
|
|
17776
17966
|
}), jsx(Cursor, {
|
|
17777
17967
|
Icon: SvgHand,
|
|
17778
17968
|
PressedIcon: SvgCompressedHand,
|
|
17779
17969
|
enableHandTool: this.state.enableCursor
|
|
17780
17970
|
}), jsx("div", {
|
|
17781
|
-
className: classes$
|
|
17971
|
+
className: classes$E.measureLog,
|
|
17782
17972
|
ref: this.logRef
|
|
17783
17973
|
}), indigoVerification && jsx("div", {
|
|
17784
|
-
className: "".concat(classes$
|
|
17974
|
+
className: "".concat(classes$E.spinnerOverlay, " loading-spinner"),
|
|
17785
17975
|
children: jsx(LoadingCircles, {})
|
|
17786
17976
|
}), jsx(InfoPanel$1, {
|
|
17787
17977
|
clientX: clientX,
|
|
@@ -17846,35 +18036,35 @@ function SvgLogo(props) {
|
|
|
17846
18036
|
})))));
|
|
17847
18037
|
}
|
|
17848
18038
|
|
|
17849
|
-
var classes$
|
|
18039
|
+
var classes$C = {"button-common-styles":"About-module_button-common-styles__XmSbT","scrollbar":"About-module_scrollbar__4-AeI","dialog_body":"About-module_dialog_body__ebQu-","about":"About-module_about__ZVesh","body":"About-module_body__8VOc3","versionName":"About-module_versionName__1gqJr","firstline":"About-module_firstline__h5XMW","links":"About-module_links__sMpyx","infoLinks":"About-module_infoLinks__4-Tot","indigoVersion":"About-module_indigoVersion__WKFlu","headerContent":"About-module_headerContent__YclOx","title":"About-module_title__k-6Zg","indigoFirstLine":"About-module_indigoFirstLine__-86rb","okButton":"About-module_okButton__FMcEk"};
|
|
17850
18040
|
|
|
17851
18041
|
function AboutDialog(props) {
|
|
17852
18042
|
var indigoInfo = props.indigoVersion && props.indigoVersion.split('.r');
|
|
17853
18043
|
return jsxs(Dialog, {
|
|
17854
|
-
className: "".concat(classes$
|
|
18044
|
+
className: "".concat(classes$C.about, " ").concat(classes$C.dialog_body),
|
|
17855
18045
|
params: props,
|
|
17856
18046
|
buttons: [jsx("button", {
|
|
17857
18047
|
onClick: props.onOk,
|
|
17858
|
-
className: classes$
|
|
18048
|
+
className: classes$C.okButton,
|
|
17859
18049
|
children: "Ok"
|
|
17860
18050
|
}, "ok")],
|
|
17861
18051
|
children: [jsx("div", {
|
|
17862
|
-
className: classes$
|
|
18052
|
+
className: classes$C.headerContent,
|
|
17863
18053
|
children: jsxs("a", {
|
|
17864
18054
|
href: props.overviewLink,
|
|
17865
18055
|
target: "_blank",
|
|
17866
18056
|
rel: "noopener noreferrer",
|
|
17867
18057
|
children: [jsx(SvgLogo, {}), jsx("span", {
|
|
17868
|
-
className: classes$
|
|
18058
|
+
className: classes$C.title,
|
|
17869
18059
|
children: "Ketcher"
|
|
17870
18060
|
})]
|
|
17871
18061
|
})
|
|
17872
18062
|
}), jsx("div", {
|
|
17873
|
-
className: classes$
|
|
18063
|
+
className: classes$C.body,
|
|
17874
18064
|
children: jsx("div", {
|
|
17875
|
-
className: classes$
|
|
18065
|
+
className: classes$C.verionsInfo,
|
|
17876
18066
|
children: jsxs("dl", {
|
|
17877
|
-
className: classes$
|
|
18067
|
+
className: classes$C.ketcherVersionInfo,
|
|
17878
18068
|
children: [jsx("dt", {
|
|
17879
18069
|
children: jsxs("a", {
|
|
17880
18070
|
href: props.overviewLink,
|
|
@@ -17887,7 +18077,7 @@ function AboutDialog(props) {
|
|
|
17887
18077
|
children: props.date
|
|
17888
18078
|
})]
|
|
17889
18079
|
}), jsxs("div", {
|
|
17890
|
-
className: classes$
|
|
18080
|
+
className: classes$C.infoLinks,
|
|
17891
18081
|
children: [jsx("dt", {
|
|
17892
18082
|
children: jsx("a", {
|
|
17893
18083
|
href: props.feedbackLink,
|
|
@@ -17904,7 +18094,7 @@ function AboutDialog(props) {
|
|
|
17904
18094
|
})
|
|
17905
18095
|
})]
|
|
17906
18096
|
}), jsx("br", {}), jsxs("div", {
|
|
17907
|
-
className: classes$
|
|
18097
|
+
className: classes$C.indigoVersion,
|
|
17908
18098
|
children: [jsxs("a", {
|
|
17909
18099
|
href: "http://lifescience.opensource.epam.com/indigo/",
|
|
17910
18100
|
target: "_blank",
|
|
@@ -17982,7 +18172,7 @@ var ErrorPopover = function ErrorPopover(_ref) {
|
|
|
17982
18172
|
});
|
|
17983
18173
|
};
|
|
17984
18174
|
|
|
17985
|
-
var classes$
|
|
18175
|
+
var classes$B = {"fieldSetLabel":"input-module_fieldSetLabel__DxKa5","input":"input-module_input__WzHgL","checkbox":"input-module_checkbox__CowSc","radioButton":"input-module_radioButton__2eHO0","slider":"input-module_slider__-Xsc0","select":"input-module_select__GhgBs","genericInput":"input-module_genericInput__XdZ2R"};
|
|
17986
18176
|
|
|
17987
18177
|
var _excluded$o = ["schema", "value", "onChange", "innerRef", "type", "isFocused"],
|
|
17988
18178
|
_excluded2$4 = ["schema", "value", "onChange"],
|
|
@@ -18022,12 +18212,12 @@ function GenericInput(_ref) {
|
|
|
18022
18212
|
value: value !== null && value !== void 0 ? value : '',
|
|
18023
18213
|
onInput: onChange,
|
|
18024
18214
|
onChange: onChange,
|
|
18025
|
-
className: clsx(classes$
|
|
18215
|
+
className: clsx(classes$B.input, classes$B.genericInput),
|
|
18026
18216
|
ref: inputRef
|
|
18027
18217
|
}, props)), type === 'checkbox' && jsx("span", {
|
|
18028
|
-
className: classes$
|
|
18218
|
+
className: classes$B.checkbox
|
|
18029
18219
|
}), type === 'radio' && jsx("span", {
|
|
18030
|
-
className: classes$
|
|
18220
|
+
className: classes$B.radioButton
|
|
18031
18221
|
})]
|
|
18032
18222
|
});
|
|
18033
18223
|
}
|
|
@@ -18058,16 +18248,16 @@ function CheckBox(_ref3) {
|
|
|
18058
18248
|
innerRef = _ref3.innerRef,
|
|
18059
18249
|
rest = _objectWithoutProperties(_ref3, _excluded3$1);
|
|
18060
18250
|
return jsxs("div", {
|
|
18061
|
-
className: classes$
|
|
18251
|
+
className: classes$B.fieldSetItem,
|
|
18062
18252
|
children: [jsx("input", _objectSpread$A({
|
|
18063
18253
|
type: "checkbox",
|
|
18064
18254
|
checked: Boolean(value),
|
|
18065
18255
|
onClick: onChange,
|
|
18066
18256
|
onChange: onChange,
|
|
18067
|
-
className: classes$
|
|
18257
|
+
className: classes$B.input,
|
|
18068
18258
|
ref: innerRef
|
|
18069
18259
|
}, rest)), jsx("span", {
|
|
18070
|
-
className: classes$
|
|
18260
|
+
className: classes$B.checkbox
|
|
18071
18261
|
})]
|
|
18072
18262
|
});
|
|
18073
18263
|
}
|
|
@@ -18088,7 +18278,7 @@ function Select$1(_ref4) {
|
|
|
18088
18278
|
value: value,
|
|
18089
18279
|
name: name,
|
|
18090
18280
|
multiple: multiple,
|
|
18091
|
-
className: clsx(classes$
|
|
18281
|
+
className: clsx(classes$B.select, className),
|
|
18092
18282
|
children: enumSchema(schema, function (title, val) {
|
|
18093
18283
|
return jsx("option", {
|
|
18094
18284
|
value: val,
|
|
@@ -18118,18 +18308,18 @@ function FieldSet(_ref5) {
|
|
|
18118
18308
|
onClick: onSelect,
|
|
18119
18309
|
children: enumSchema(schema, function (title, val) {
|
|
18120
18310
|
return jsx("li", {
|
|
18121
|
-
className: classes$
|
|
18311
|
+
className: classes$B.fieldSetItem,
|
|
18122
18312
|
children: jsxs("label", {
|
|
18123
|
-
className: classes$
|
|
18313
|
+
className: classes$B.fieldSetLabel,
|
|
18124
18314
|
children: [jsx("input", _objectSpread$A({
|
|
18125
18315
|
type: type,
|
|
18126
18316
|
defaultChecked: type === 'radio' ? selected(val, checked) : selected(val, value),
|
|
18127
18317
|
value: _typeof(val) !== 'object' && val,
|
|
18128
|
-
className: classes$
|
|
18318
|
+
className: classes$B.input
|
|
18129
18319
|
}, rest)), type === 'checkbox' && jsx("span", {
|
|
18130
|
-
className: classes$
|
|
18320
|
+
className: classes$B.checkbox
|
|
18131
18321
|
}), type === 'radio' && jsx("span", {
|
|
18132
|
-
className: classes$
|
|
18322
|
+
className: classes$B.radioButton
|
|
18133
18323
|
}), title]
|
|
18134
18324
|
})
|
|
18135
18325
|
}, title);
|
|
@@ -18159,7 +18349,7 @@ function Slider(_ref6) {
|
|
|
18159
18349
|
name = _ref6.name,
|
|
18160
18350
|
rest = _objectWithoutProperties(_ref6, _excluded5$1);
|
|
18161
18351
|
return jsxs("div", {
|
|
18162
|
-
className: classes$
|
|
18352
|
+
className: classes$B.slider,
|
|
18163
18353
|
children: [jsx("input", _objectSpread$A({
|
|
18164
18354
|
type: "checkbox",
|
|
18165
18355
|
checked: value,
|
|
@@ -18346,7 +18536,7 @@ var Select = function Select(_ref2) {
|
|
|
18346
18536
|
});
|
|
18347
18537
|
};
|
|
18348
18538
|
|
|
18349
|
-
var classes$
|
|
18539
|
+
var classes$A = {"button-common-styles":"form-module_button-common-styles__BvKSn","scrollbar":"form-module_scrollbar__MgLtc","dataError":"form-module_dataError__IXK1h","inputWrapper":"form-module_inputWrapper__sIDHH"};
|
|
18350
18540
|
|
|
18351
18541
|
var _excluded$n = ["schema", "result", "customValid"],
|
|
18352
18542
|
_excluded2$3 = ["labelPos", "title", "children"],
|
|
@@ -18505,13 +18695,13 @@ function Field(props) {
|
|
|
18505
18695
|
}, fieldOpts), rest));
|
|
18506
18696
|
if (labelPos === false) return formField;
|
|
18507
18697
|
return jsxs(Label, {
|
|
18508
|
-
className: clsx(_defineProperty({}, classes$
|
|
18698
|
+
className: clsx(_defineProperty({}, classes$A.dataError, dataError), className),
|
|
18509
18699
|
error: dataError,
|
|
18510
18700
|
title: rest.title || desc.title,
|
|
18511
18701
|
labelPos: labelPos,
|
|
18512
18702
|
tooltip: rest === null || rest === void 0 ? void 0 : rest.tooltip,
|
|
18513
18703
|
children: [jsx("span", {
|
|
18514
|
-
className: classes$
|
|
18704
|
+
className: classes$A.inputWrapper,
|
|
18515
18705
|
onMouseEnter: handlePopoverOpen,
|
|
18516
18706
|
onMouseLeave: handlePopoverClose,
|
|
18517
18707
|
children: formField
|
|
@@ -18618,7 +18808,7 @@ function getErrorsObj(errors) {
|
|
|
18618
18808
|
return errs;
|
|
18619
18809
|
}
|
|
18620
18810
|
|
|
18621
|
-
var classes$
|
|
18811
|
+
var classes$z = {"colorPickerInput":"ColorPicker-module_colorPickerInput__voi2r","selectedInput":"ColorPicker-module_selectedInput__Ykcjd","colorPickerWrap":"ColorPicker-module_colorPickerWrap__IAQVo","withPalette":"ColorPicker-module_withPalette__gTwNu","colorPicker":"ColorPicker-module_colorPicker__Uz3PM","colorPickerBtn":"ColorPicker-module_colorPickerBtn__nr6ph","colorPickerPreview":"ColorPicker-module_colorPickerPreview__-Rf-i","colorPickerOverlay":"ColorPicker-module_colorPickerOverlay__WzC-w","colorContainer":"ColorPicker-module_colorContainer__ib5up","hex":"ColorPicker-module_hex__mE9my","presetColors":"ColorPicker-module_presetColors__J-ysq","chooseColor":"ColorPicker-module_chooseColor__fdzt8","clicked":"ColorPicker-module_clicked__8BNoN","expandIcon":"ColorPicker-module_expandIcon__oH4ka","turnedIcon":"ColorPicker-module_turnedIcon__-zaq-","colorPickerWrapper":"ColorPicker-module_colorPickerWrapper__GJm87"};
|
|
18622
18812
|
|
|
18623
18813
|
var presetColors = ['#FF4545', '#FFAD31', '#68D442', '#3ACACC', '#4434FF', '#9C9C9C', '#000000'];
|
|
18624
18814
|
var ColorPicker = function ColorPicker(props) {
|
|
@@ -18667,32 +18857,32 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
18667
18857
|
}
|
|
18668
18858
|
};
|
|
18669
18859
|
return jsxs("div", {
|
|
18670
|
-
className: classes$
|
|
18860
|
+
className: classes$z.colorPickerWrapper,
|
|
18671
18861
|
"data-testid": isOpen ? 'color-picker-field-open' : 'color-picker-field',
|
|
18672
18862
|
onClick: function onClick(e) {
|
|
18673
18863
|
return e.preventDefault();
|
|
18674
18864
|
},
|
|
18675
18865
|
children: [jsxs("div", {
|
|
18676
|
-
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$
|
|
18866
|
+
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$z.colorPickerInput, true), _defineProperty(_clsx, classes$z.selectedInput, isOpen), _clsx)),
|
|
18677
18867
|
onClick: handleClick,
|
|
18678
18868
|
children: [jsx("div", {
|
|
18679
|
-
className: classes$
|
|
18869
|
+
className: classes$z.colorPickerPreview,
|
|
18680
18870
|
"data-testid": "color-picker-preview",
|
|
18681
18871
|
style: {
|
|
18682
18872
|
backgroundColor: value
|
|
18683
18873
|
}
|
|
18684
18874
|
}), jsx(Icon, {
|
|
18685
|
-
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$
|
|
18875
|
+
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$z.expandIcon, true), _defineProperty(_clsx2, classes$z.turnedIcon, !isOpen), _clsx2)),
|
|
18686
18876
|
name: "chevron"
|
|
18687
18877
|
})]
|
|
18688
18878
|
}), isOpen && jsxs("div", {
|
|
18689
|
-
className: clsx(classes$
|
|
18879
|
+
className: clsx(classes$z.colorPickerWrap, isPaletteOpen && classes$z.withPalette),
|
|
18690
18880
|
onBlur: handleBlur,
|
|
18691
18881
|
"data-testid": "color-picker-preset",
|
|
18692
18882
|
children: [jsxs("div", {
|
|
18693
|
-
className: classes$
|
|
18883
|
+
className: classes$z.presetColors,
|
|
18694
18884
|
children: [jsx("button", {
|
|
18695
|
-
className: clsx(classes$
|
|
18885
|
+
className: clsx(classes$z.chooseColor, isPaletteOpen && classes$z.clicked),
|
|
18696
18886
|
onClick: handlePaletteOpen,
|
|
18697
18887
|
autoFocus: true,
|
|
18698
18888
|
"data-testid": "color-picker-btn"
|
|
@@ -18704,19 +18894,19 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
18704
18894
|
style: {
|
|
18705
18895
|
backgroundColor: color
|
|
18706
18896
|
},
|
|
18707
|
-
className: classes$
|
|
18897
|
+
className: classes$z.presetColor
|
|
18708
18898
|
}, color);
|
|
18709
18899
|
})]
|
|
18710
18900
|
}), isPaletteOpen && jsxs("div", {
|
|
18711
|
-
className: classes$
|
|
18901
|
+
className: classes$z.colorPicker,
|
|
18712
18902
|
"data-testid": "color-palette",
|
|
18713
18903
|
children: [jsx(HexColorPicker, {
|
|
18714
18904
|
color: value,
|
|
18715
18905
|
onChange: handleChange
|
|
18716
18906
|
}), jsxs("div", {
|
|
18717
|
-
className: classes$
|
|
18907
|
+
className: classes$z.colorContainer,
|
|
18718
18908
|
children: [jsx("span", {
|
|
18719
|
-
className: classes$
|
|
18909
|
+
className: classes$z.hex,
|
|
18720
18910
|
children: "HEX"
|
|
18721
18911
|
}), jsx(HexColorInput, {
|
|
18722
18912
|
"data-testid": "color-picker-input",
|
|
@@ -18810,7 +19000,7 @@ function convertValue(value, measureFrom, measureTo) {
|
|
|
18810
19000
|
return measureTo === 'px' || measureTo === 'pt' ? (value * measureMap[measureFrom] / measureMap[measureTo]).toFixed() - 0 : (value * measureMap[measureFrom] / measureMap[measureTo]).toFixed(3) - 0;
|
|
18811
19001
|
}
|
|
18812
19002
|
|
|
18813
|
-
var classes$
|
|
19003
|
+
var classes$y = {"button-common-styles":"buttons-module_button-common-styles__qWDOz","scrollbar":"buttons-module_scrollbar__SpaVV","openButton":"buttons-module_openButton__wErm9"};
|
|
18814
19004
|
|
|
18815
19005
|
var _excluded$l = ["children", "type", "server", "className"];
|
|
18816
19006
|
function ownKeys$x(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -18864,7 +19054,7 @@ var OpenButton = function (_Component) {
|
|
|
18864
19054
|
onClick: function onClick() {
|
|
18865
19055
|
return _this2.btn.click();
|
|
18866
19056
|
},
|
|
18867
|
-
className: clsx(classes$
|
|
19057
|
+
className: clsx(classes$y.openButton, className)
|
|
18868
19058
|
}, props), {}, {
|
|
18869
19059
|
children: [jsx("input", {
|
|
18870
19060
|
onChange: function onChange(ev) {
|
|
@@ -18966,7 +19156,7 @@ var fileSaver = function fileSaver(server) {
|
|
|
18966
19156
|
});
|
|
18967
19157
|
};
|
|
18968
19158
|
|
|
18969
|
-
var classes$
|
|
19159
|
+
var classes$x = {"button-common-styles":"Accordion-module_button-common-styles__enTfZ","scrollbar":"Accordion-module_scrollbar__lJTa6","accordionWrapper":"Accordion-module_accordionWrapper__RKk00","expandIcon":"Accordion-module_expandIcon__ncUKv","turnedIcon":"Accordion-module_turnedIcon__v1sCA","accordionSummaryWrapper":"Accordion-module_accordionSummaryWrapper__roIRd","accordionSummary":"Accordion-module_accordionSummary__1Gq0d","accordionDetailsWrapper":"Accordion-module_accordionDetailsWrapper__fnSnc","hiddenAccordion":"Accordion-module_hiddenAccordion__WZFcJ","accordionDetails":"Accordion-module_accordionDetails__g2RM0","groupIcon":"Accordion-module_groupIcon__1g1lx","groupLabel":"Accordion-module_groupLabel__23y4U","changeMarker":"Accordion-module_changeMarker__UPtGx"};
|
|
18970
19160
|
|
|
18971
19161
|
var Accordion = function Accordion(_ref) {
|
|
18972
19162
|
var tabs = _ref.tabs,
|
|
@@ -18985,7 +19175,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
18985
19175
|
};
|
|
18986
19176
|
};
|
|
18987
19177
|
return jsx("div", {
|
|
18988
|
-
className: clsx(classes$
|
|
19178
|
+
className: clsx(classes$x.accordionWrapper, className),
|
|
18989
19179
|
children: tabs.map(function (_ref2) {
|
|
18990
19180
|
var _clsx, _clsx2;
|
|
18991
19181
|
var label = _ref2.label,
|
|
@@ -18995,28 +19185,28 @@ var Accordion = function Accordion(_ref) {
|
|
|
18995
19185
|
return jsxs("div", {
|
|
18996
19186
|
children: [jsx("div", {
|
|
18997
19187
|
onClick: handleAccordionChange(label),
|
|
18998
|
-
className: classes$
|
|
19188
|
+
className: classes$x.accordionSummaryWrapper,
|
|
18999
19189
|
children: jsxs("div", {
|
|
19000
|
-
className: classes$
|
|
19190
|
+
className: classes$x.accordionSummary,
|
|
19001
19191
|
children: [jsx(Icon, {
|
|
19002
|
-
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$
|
|
19192
|
+
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$x.expandIcon, true), _defineProperty(_clsx, classes$x.turnedIcon, !shouldGroupBeRended), _clsx)),
|
|
19003
19193
|
name: "chevron"
|
|
19004
19194
|
}), jsxs("div", {
|
|
19005
|
-
className: classes$
|
|
19195
|
+
className: classes$x.groupLabel,
|
|
19006
19196
|
children: [jsx(Icon, {
|
|
19007
19197
|
name: "elements-group",
|
|
19008
|
-
className: classes$
|
|
19198
|
+
className: classes$x.groupIcon
|
|
19009
19199
|
}), jsx("span", {
|
|
19010
19200
|
children: label
|
|
19011
19201
|
})]
|
|
19012
19202
|
}), changedGroups.has(label) && jsx("span", {
|
|
19013
|
-
className: classes$
|
|
19203
|
+
className: classes$x.changeMarker
|
|
19014
19204
|
})]
|
|
19015
19205
|
})
|
|
19016
19206
|
}), jsx("div", {
|
|
19017
|
-
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$
|
|
19207
|
+
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$x.accordionDetailsWrapper, true), _defineProperty(_clsx2, classes$x.hiddenAccordion, !shouldGroupBeRended), _clsx2)),
|
|
19018
19208
|
children: jsx("div", {
|
|
19019
|
-
className: classes$
|
|
19209
|
+
className: classes$x.accordionDetails,
|
|
19020
19210
|
children: content
|
|
19021
19211
|
})
|
|
19022
19212
|
})]
|
|
@@ -19074,7 +19264,7 @@ function SystemFonts(props) {
|
|
|
19074
19264
|
});
|
|
19075
19265
|
}
|
|
19076
19266
|
|
|
19077
|
-
var classes$
|
|
19267
|
+
var classes$w = {"headerContent":"Settings-module_headerContent__wBYFf","title":"Settings-module_title__a6mod","button":"Settings-module_button__VZ2w7","accordion":"Settings-module_accordion__1uSYy","settings":"Settings-module_settings__Z5btc"};
|
|
19078
19268
|
|
|
19079
19269
|
var fieldGroups = {
|
|
19080
19270
|
resetToSelect: 'General',
|
|
@@ -19132,15 +19322,15 @@ var HeaderContent$1 = function HeaderContent(_ref) {
|
|
|
19132
19322
|
if (formState.result.init) return isEqual$1(defaultSettings, initState);else return isEqual$1(defaultSettings, formState.result);
|
|
19133
19323
|
};
|
|
19134
19324
|
return jsxs("div", {
|
|
19135
|
-
className: classes$
|
|
19325
|
+
className: classes$w.headerContent,
|
|
19136
19326
|
children: [jsx("span", {
|
|
19137
|
-
className: classes$
|
|
19327
|
+
className: classes$w.title,
|
|
19138
19328
|
children: " Settings"
|
|
19139
19329
|
}), jsx(OpenButton, {
|
|
19140
19330
|
title: "Open from File",
|
|
19141
19331
|
server: server,
|
|
19142
19332
|
onLoad: onOpenFile,
|
|
19143
|
-
className: classes$
|
|
19333
|
+
className: classes$w.button,
|
|
19144
19334
|
children: jsx(Icon, {
|
|
19145
19335
|
name: "open-1"
|
|
19146
19336
|
})
|
|
@@ -19148,14 +19338,14 @@ var HeaderContent$1 = function HeaderContent(_ref) {
|
|
|
19148
19338
|
title: "Save to File",
|
|
19149
19339
|
data: JSON.stringify(formState.result),
|
|
19150
19340
|
filename: "ketcher-settings",
|
|
19151
|
-
className: classes$
|
|
19341
|
+
className: classes$w.button,
|
|
19152
19342
|
children: jsx(Icon, {
|
|
19153
19343
|
name: "save-1"
|
|
19154
19344
|
})
|
|
19155
19345
|
}, "ketcher-settings"), jsx("button", {
|
|
19156
19346
|
title: "Reset",
|
|
19157
19347
|
onClick: onReset,
|
|
19158
|
-
className: classes$
|
|
19348
|
+
className: classes$w.button,
|
|
19159
19349
|
disabled: getIsResetDisabled(),
|
|
19160
19350
|
children: jsx(Icon, {
|
|
19161
19351
|
name: "reset"
|
|
@@ -19314,7 +19504,7 @@ var SettingsDialog = function SettingsDialog(props) {
|
|
|
19314
19504
|
label: '3D Viewer',
|
|
19315
19505
|
content:
|
|
19316
19506
|
jsxs("fieldset", {
|
|
19317
|
-
className: classes$
|
|
19507
|
+
className: classes$w.viewer,
|
|
19318
19508
|
children: [jsx(Field, {
|
|
19319
19509
|
name: "miewMode",
|
|
19320
19510
|
component: Select,
|
|
@@ -19347,7 +19537,7 @@ var SettingsDialog = function SettingsDialog(props) {
|
|
|
19347
19537
|
};
|
|
19348
19538
|
var tabs = [generalTab, stereoTab, atomsTab, bondsTab, serverTab, threeDViewerTab, debuggingTab];
|
|
19349
19539
|
return jsx(Dialog, {
|
|
19350
|
-
className: classes$
|
|
19540
|
+
className: classes$w.settings,
|
|
19351
19541
|
result: function result() {
|
|
19352
19542
|
return formState.result;
|
|
19353
19543
|
},
|
|
@@ -19374,7 +19564,7 @@ var SettingsDialog = function SettingsDialog(props) {
|
|
|
19374
19564
|
}, formState), {}, {
|
|
19375
19565
|
children: jsx(Accordion, {
|
|
19376
19566
|
tabs: tabs,
|
|
19377
|
-
className: classes$
|
|
19567
|
+
className: classes$w.accordion,
|
|
19378
19568
|
changedGroups: changedGroups
|
|
19379
19569
|
})
|
|
19380
19570
|
}))
|
|
@@ -19671,7 +19861,7 @@ function FrozenInput(_ref) {
|
|
|
19671
19861
|
});
|
|
19672
19862
|
}
|
|
19673
19863
|
|
|
19674
|
-
var classes$
|
|
19864
|
+
var classes$v = {"button-common-styles":"Analyse-module_button-common-styles__8No07","scrollbar":"Analyse-module_scrollbar__UAaIN","analyse":"Analyse-module_analyse__MR-Tu","inputWrapper":"Analyse-module_inputWrapper__uR995","contentWrapper":"Analyse-module_contentWrapper__B4WCi","selectWrapper":"Analyse-module_selectWrapper__xEkKL","select":"Analyse-module_select__c6hFt"};
|
|
19675
19865
|
|
|
19676
19866
|
var _excluded$i = ["values", "round", "loading", "onAnalyse", "onChangeRound"];
|
|
19677
19867
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -19709,7 +19899,7 @@ var AnalyseDialog = function (_Component) {
|
|
|
19709
19899
|
props = _objectWithoutProperties(_this$props, _excluded$i);
|
|
19710
19900
|
return jsx(Dialog, {
|
|
19711
19901
|
title: "Calculated Values",
|
|
19712
|
-
className: classes$
|
|
19902
|
+
className: classes$v.analyse,
|
|
19713
19903
|
withDivider: true,
|
|
19714
19904
|
needMargin: true,
|
|
19715
19905
|
valid: function valid() {
|
|
@@ -19742,9 +19932,9 @@ var AnalyseDialog = function (_Component) {
|
|
|
19742
19932
|
withSelector: false
|
|
19743
19933
|
}].map(function (item) {
|
|
19744
19934
|
return jsxs("li", {
|
|
19745
|
-
className: classes$
|
|
19935
|
+
className: classes$v.contentWrapper,
|
|
19746
19936
|
children: [jsxs("div", {
|
|
19747
|
-
className: classes$
|
|
19937
|
+
className: classes$v.inputWrapper,
|
|
19748
19938
|
children: [jsxs("label", {
|
|
19749
19939
|
children: [item.name, ":"]
|
|
19750
19940
|
}), item.key === 'gross' ? jsx(FormulaInput, {
|
|
@@ -19757,7 +19947,7 @@ var AnalyseDialog = function (_Component) {
|
|
|
19757
19947
|
value: values && !loading ? roundOff(values[item.key], round[item.round]) : 0
|
|
19758
19948
|
})]
|
|
19759
19949
|
}), item.withSelector ? jsxs("div", {
|
|
19760
|
-
className: classes$
|
|
19950
|
+
className: classes$v.selectWrapper,
|
|
19761
19951
|
children: [jsx("span", {
|
|
19762
19952
|
children: "Decimal places"
|
|
19763
19953
|
}), jsx(Select, {
|
|
@@ -19766,7 +19956,7 @@ var AnalyseDialog = function (_Component) {
|
|
|
19766
19956
|
onChange: function onChange(val) {
|
|
19767
19957
|
return onChangeRound(item.round, val);
|
|
19768
19958
|
},
|
|
19769
|
-
className: classes$
|
|
19959
|
+
className: classes$v.select
|
|
19770
19960
|
})]
|
|
19771
19961
|
}) : null]
|
|
19772
19962
|
}, item.key);
|
|
@@ -19801,7 +19991,7 @@ var mapDispatchToProps$9 = function mapDispatchToProps(dispatch) {
|
|
|
19801
19991
|
};
|
|
19802
19992
|
var Analyse = connect(mapStateToProps$c, mapDispatchToProps$9)(AnalyseDialog);
|
|
19803
19993
|
|
|
19804
|
-
var classes$
|
|
19994
|
+
var classes$u = {"button-common-styles":"Recognize-module_button-common-styles__B04E6","scrollbar":"Recognize-module_scrollbar__rohcP","recognize":"Recognize-module_recognize__66jG2","footerContent":"Recognize-module_footerContent__0MAC7","imagoVersion":"Recognize-module_imagoVersion__nBIj6","openButton":"Recognize-module_openButton__H-j5I","imagesContainer":"Recognize-module_imagesContainer__rXWWk","topBody":"Recognize-module_topBody__ZCCjN","output":"Recognize-module_output__WgRnP","picture":"Recognize-module_picture__x2Y7S","filename":"Recognize-module_filename__-1HIU","messageContainer":"Recognize-module_messageContainer__tMvyb","primaryButton":"Recognize-module_primaryButton__rzm03","secondaryButton":"Recognize-module_secondaryButton__H1Q28","struct":"Recognize-module_struct__W55TL"};
|
|
19805
19995
|
|
|
19806
19996
|
var DialogActionButton = function DialogActionButton(_ref) {
|
|
19807
19997
|
var clickHandler = _ref.clickHandler,
|
|
@@ -19833,11 +20023,11 @@ function FooterContent$3(_ref) {
|
|
|
19833
20023
|
openHandler = _ref.openHandler,
|
|
19834
20024
|
copyHandler = _ref.copyHandler;
|
|
19835
20025
|
return jsxs("div", {
|
|
19836
|
-
className: classes$
|
|
20026
|
+
className: classes$u.footerContent,
|
|
19837
20027
|
children: [jsxs(OpenButton, {
|
|
19838
20028
|
onLoad: onImage,
|
|
19839
20029
|
type: "image/*",
|
|
19840
|
-
className: classes$
|
|
20030
|
+
className: classes$u.openButton,
|
|
19841
20031
|
children: [jsx(Icon, {
|
|
19842
20032
|
name: "open"
|
|
19843
20033
|
}), jsx("span", {
|
|
@@ -19847,12 +20037,12 @@ function FooterContent$3(_ref) {
|
|
|
19847
20037
|
children: [jsx(DialogActionButton, {
|
|
19848
20038
|
disabled: !structStr,
|
|
19849
20039
|
clickHandler: openHandler,
|
|
19850
|
-
styles: classes$
|
|
20040
|
+
styles: classes$u.secondaryButton,
|
|
19851
20041
|
label: "Open as new Project"
|
|
19852
20042
|
}, "openButton"), jsx(DialogActionButton, {
|
|
19853
20043
|
disabled: !structStr,
|
|
19854
20044
|
clickHandler: copyHandler,
|
|
19855
|
-
styles: classes$
|
|
20045
|
+
styles: classes$u.primaryButton,
|
|
19856
20046
|
label: "Add to Canvas",
|
|
19857
20047
|
title: "Structure will be loaded as fragment and added to Clipboard"
|
|
19858
20048
|
}, "copyButton")]
|
|
@@ -19903,7 +20093,7 @@ function RecognizeDialog(prop) {
|
|
|
19903
20093
|
};
|
|
19904
20094
|
return jsxs(Dialog, {
|
|
19905
20095
|
title: "Import Structure from Image",
|
|
19906
|
-
className: classes$
|
|
20096
|
+
className: classes$u.recognize,
|
|
19907
20097
|
params: _objectSpread$u(_objectSpread$u({}, props), {}, {
|
|
19908
20098
|
onOk: onOk
|
|
19909
20099
|
}),
|
|
@@ -19920,9 +20110,9 @@ function RecognizeDialog(prop) {
|
|
|
19920
20110
|
}),
|
|
19921
20111
|
buttons: [],
|
|
19922
20112
|
children: [jsxs("div", {
|
|
19923
|
-
className: classes$
|
|
20113
|
+
className: classes$u.topBody,
|
|
19924
20114
|
children: [jsxs("label", {
|
|
19925
|
-
className: classes$
|
|
20115
|
+
className: classes$u.imagoVersion,
|
|
19926
20116
|
children: ["Imago version", jsx(Input$1, {
|
|
19927
20117
|
schema: {
|
|
19928
20118
|
"enum": imagoVersions,
|
|
@@ -19939,9 +20129,9 @@ function RecognizeDialog(prop) {
|
|
|
19939
20129
|
children: "Recognized structure preview"
|
|
19940
20130
|
})]
|
|
19941
20131
|
}), jsxs("div", {
|
|
19942
|
-
className: classes$
|
|
20132
|
+
className: classes$u.imagesContainer,
|
|
19943
20133
|
children: [jsxs("div", {
|
|
19944
|
-
className: classes$
|
|
20134
|
+
className: classes$u.picture,
|
|
19945
20135
|
children: [file && isImage(file) && canPreviewImage && jsx("img", {
|
|
19946
20136
|
alt: "",
|
|
19947
20137
|
id: "pic",
|
|
@@ -19950,27 +20140,27 @@ function RecognizeDialog(prop) {
|
|
|
19950
20140
|
setCanPreviewImage(false);
|
|
19951
20141
|
}
|
|
19952
20142
|
}), jsxs("span", {
|
|
19953
|
-
className: classes$
|
|
20143
|
+
className: classes$u.filename,
|
|
19954
20144
|
children: [" ", file ? file.name : null, " "]
|
|
19955
20145
|
}), file && isImage(file) && !canPreviewImage && jsx("div", {
|
|
19956
|
-
className: classes$
|
|
20146
|
+
className: classes$u.messageContainer,
|
|
19957
20147
|
children: jsxs("p", {
|
|
19958
20148
|
children: ["Preview of '", file.type, "' MIME type is not supported by current browser"]
|
|
19959
20149
|
})
|
|
19960
20150
|
}), (!file || !isImage(file) && clearFile()) && jsx("div", {
|
|
19961
|
-
className: classes$
|
|
20151
|
+
className: classes$u.messageContainer,
|
|
19962
20152
|
children: jsx("p", {
|
|
19963
20153
|
children: "Please choose image"
|
|
19964
20154
|
})
|
|
19965
20155
|
})]
|
|
19966
20156
|
}), jsx("div", {
|
|
19967
|
-
className: classes$
|
|
20157
|
+
className: classes$u.output,
|
|
19968
20158
|
children: structStr && (
|
|
19969
20159
|
structStr instanceof Promise || typeof structStr !== 'string' ? jsx("div", {
|
|
19970
|
-
className: classes$
|
|
20160
|
+
className: classes$u.messageContainer,
|
|
19971
20161
|
children: jsx(LoadingCircles, {})
|
|
19972
20162
|
}) : jsx(StructRender, {
|
|
19973
|
-
className: classes$
|
|
20163
|
+
className: classes$u.struct,
|
|
19974
20164
|
struct: structStr
|
|
19975
20165
|
}))
|
|
19976
20166
|
})]
|
|
@@ -20016,7 +20206,7 @@ var mapDispatchToProps$8 = function mapDispatchToProps(dispatch) {
|
|
|
20016
20206
|
};
|
|
20017
20207
|
var Recognize = connect(mapStateToProps$b, mapDispatchToProps$8)(RecognizeDialog);
|
|
20018
20208
|
|
|
20019
|
-
var classes$
|
|
20209
|
+
var classes$t = {"button-common-styles":"Miew-module_button-common-styles__8FE-p","scrollbar":"Miew-module_scrollbar__ZMWH-","warning":"Miew-module_warning__IDl5F","applyButton":"Miew-module_applyButton__ZDE-i","miewDialog":"Miew-module_miewDialog__gHvYc","miewContainer":"Miew-module_miewContainer__2SNw3","miewDarkTheme":"Miew-module_miewDarkTheme__kMFzc"};
|
|
20020
20210
|
|
|
20021
20211
|
var _excluded$g = ["miewOpts", "server", "struct", "onExportCML", "miewTheme"];
|
|
20022
20212
|
var BACKGROUND_COLOR = {
|
|
@@ -20074,7 +20264,7 @@ function createMiewOptions(userOpts) {
|
|
|
20074
20264
|
var CHANGING_WARNING = 'Stereocenters can be changed after the strong 3D rotation';
|
|
20075
20265
|
var FooterContent$2 = function FooterContent() {
|
|
20076
20266
|
return jsx("div", {
|
|
20077
|
-
className: classes$
|
|
20267
|
+
className: classes$t.warning,
|
|
20078
20268
|
children: CHANGING_WARNING
|
|
20079
20269
|
});
|
|
20080
20270
|
};
|
|
@@ -20116,14 +20306,14 @@ var MiewDialog = function MiewDialog(_ref) {
|
|
|
20116
20306
|
params: prop,
|
|
20117
20307
|
buttons: ['Cancel', jsx("button", {
|
|
20118
20308
|
onClick: exportCML,
|
|
20119
|
-
className: classes$
|
|
20309
|
+
className: classes$t.applyButton,
|
|
20120
20310
|
children: "Apply"
|
|
20121
20311
|
}, "apply")],
|
|
20122
20312
|
footerContent: jsx(FooterContent$2, {}),
|
|
20123
|
-
className: classes$
|
|
20313
|
+
className: classes$t.miewDialog,
|
|
20124
20314
|
children: jsx("div", {
|
|
20125
20315
|
children: jsx("div", {
|
|
20126
|
-
className: "".concat(classes$
|
|
20316
|
+
className: "".concat(classes$t.miewContainer, " ").concat(miewTheme === 'dark' ? classes$t.miewDarkTheme : ''),
|
|
20127
20317
|
children: jsx(Viewer, {
|
|
20128
20318
|
onInit: onMiewInit
|
|
20129
20319
|
})
|
|
@@ -20163,7 +20353,7 @@ var ElementNumber = function ElementNumber(props) {
|
|
|
20163
20353
|
});
|
|
20164
20354
|
};
|
|
20165
20355
|
|
|
20166
|
-
var classes$
|
|
20356
|
+
var classes$s = {"button-common-styles":"Atom-module_button-common-styles__ipWaI","scrollbar":"Atom-module_scrollbar__z5cVx","atomProps":"Atom-module_atomProps__pqBjY","accordionWrapper":"Atom-module_accordionWrapper__MSuU7","expandIcon":"Atom-module_expandIcon__mPszC","turnedIcon":"Atom-module_turnedIcon__0Kzwy","accordionSummaryWrapper":"Atom-module_accordionSummaryWrapper__MGqsq","accordionSummary":"Atom-module_accordionSummary__HMKzl","accordionDetailsWrapper":"Atom-module_accordionDetailsWrapper__p6EI7","hiddenAccordion":"Atom-module_hiddenAccordion__pDNdM","accordionDetails":"Atom-module_accordionDetails__-B3jK","checkbox":"Atom-module_checkbox__Vup40","reactionFlags":"Atom-module_reactionFlags__gdNb1","querySpecific":"Atom-module_querySpecific__7XxMr"};
|
|
20167
20357
|
|
|
20168
20358
|
var _excluded$f = ["formState", "stereoParity", "isMultipleAtoms"];
|
|
20169
20359
|
function ownKeys$t(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -20223,7 +20413,7 @@ var Atom = function Atom(props) {
|
|
|
20223
20413
|
}, {
|
|
20224
20414
|
groupName: 'Query specific',
|
|
20225
20415
|
component: jsxs("div", {
|
|
20226
|
-
className: classes$
|
|
20416
|
+
className: classes$s.querySpecific,
|
|
20227
20417
|
children: [jsx(Field, {
|
|
20228
20418
|
name: "ringBondCount",
|
|
20229
20419
|
component: Select,
|
|
@@ -20239,13 +20429,13 @@ var Atom = function Atom(props) {
|
|
|
20239
20429
|
}), jsx(Field, {
|
|
20240
20430
|
name: "unsaturatedAtom",
|
|
20241
20431
|
labelPos: "before",
|
|
20242
|
-
className: classes$
|
|
20432
|
+
className: classes$s.checkbox
|
|
20243
20433
|
})]
|
|
20244
20434
|
})
|
|
20245
20435
|
}, {
|
|
20246
20436
|
groupName: 'Reaction flags',
|
|
20247
20437
|
component: jsxs("div", {
|
|
20248
|
-
className: classes$
|
|
20438
|
+
className: classes$s.reactionFlags,
|
|
20249
20439
|
children: [jsx(Field, {
|
|
20250
20440
|
name: "invRet",
|
|
20251
20441
|
component: Select,
|
|
@@ -20253,13 +20443,13 @@ var Atom = function Atom(props) {
|
|
|
20253
20443
|
}), jsx(Field, {
|
|
20254
20444
|
name: "exactChangeFlag",
|
|
20255
20445
|
labelPos: "before",
|
|
20256
|
-
className: classes$
|
|
20446
|
+
className: classes$s.checkbox
|
|
20257
20447
|
})]
|
|
20258
20448
|
})
|
|
20259
20449
|
}];
|
|
20260
20450
|
return jsx(Dialog, {
|
|
20261
20451
|
title: "Atom Properties",
|
|
20262
|
-
className: classes$
|
|
20452
|
+
className: classes$s.atomProps,
|
|
20263
20453
|
result: function result() {
|
|
20264
20454
|
return formState.result;
|
|
20265
20455
|
},
|
|
@@ -20285,7 +20475,7 @@ var Atom = function Atom(props) {
|
|
|
20285
20475
|
init: rest
|
|
20286
20476
|
}, formState), {}, {
|
|
20287
20477
|
children: jsx("div", {
|
|
20288
|
-
className: classes$
|
|
20478
|
+
className: classes$s.accordionWrapper,
|
|
20289
20479
|
children: itemGroups.map(function (_ref) {
|
|
20290
20480
|
var _clsx, _clsx2;
|
|
20291
20481
|
var groupName = _ref.groupName,
|
|
@@ -20294,20 +20484,20 @@ var Atom = function Atom(props) {
|
|
|
20294
20484
|
return jsxs("div", {
|
|
20295
20485
|
children: [jsx("div", {
|
|
20296
20486
|
onClick: handleAccordionChange(groupName),
|
|
20297
|
-
className: classes$
|
|
20487
|
+
className: classes$s.accordionSummaryWrapper,
|
|
20298
20488
|
children: jsxs("div", {
|
|
20299
|
-
className: classes$
|
|
20489
|
+
className: classes$s.accordionSummary,
|
|
20300
20490
|
children: [jsx("span", {
|
|
20301
20491
|
children: groupName
|
|
20302
20492
|
}), jsx(Icon, {
|
|
20303
|
-
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$
|
|
20493
|
+
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$s.expandIcon, true), _defineProperty(_clsx, classes$s.turnedIcon, !shouldGroupBeRended), _clsx)),
|
|
20304
20494
|
name: "chevron"
|
|
20305
20495
|
})]
|
|
20306
20496
|
})
|
|
20307
20497
|
}), jsx("div", {
|
|
20308
|
-
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$
|
|
20498
|
+
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$s.accordionDetailsWrapper, true), _defineProperty(_clsx2, classes$s.hiddenAccordion, !shouldGroupBeRended), _clsx2)),
|
|
20309
20499
|
children: jsx("div", {
|
|
20310
|
-
className: classes$
|
|
20500
|
+
className: classes$s.accordionDetails,
|
|
20311
20501
|
children: component
|
|
20312
20502
|
})
|
|
20313
20503
|
})]
|
|
@@ -20341,7 +20531,7 @@ var mapStateToProps$9 = function mapStateToProps(state) {
|
|
|
20341
20531
|
};
|
|
20342
20532
|
var AtomContainer = connect(mapStateToProps$9)(Atom);
|
|
20343
20533
|
|
|
20344
|
-
var classes$
|
|
20534
|
+
var classes$r = {"attachPoints":"Attach-module_attachPoints__5QEAv"};
|
|
20345
20535
|
|
|
20346
20536
|
var _excluded$e = ["formState"];
|
|
20347
20537
|
function ownKeys$s(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -20351,7 +20541,7 @@ var AttachPoints = function AttachPoints(props) {
|
|
|
20351
20541
|
rest = _objectWithoutProperties(props, _excluded$e);
|
|
20352
20542
|
return jsx(Dialog, {
|
|
20353
20543
|
title: "Attachment Points",
|
|
20354
|
-
className: classes$
|
|
20544
|
+
className: classes$r.attachPoints,
|
|
20355
20545
|
result: function result() {
|
|
20356
20546
|
return formState.result;
|
|
20357
20547
|
},
|
|
@@ -20384,7 +20574,7 @@ var mapStateToProps$8 = function mapStateToProps(state) {
|
|
|
20384
20574
|
};
|
|
20385
20575
|
var AttachPointsContainer = connect(mapStateToProps$8)(AttachPoints);
|
|
20386
20576
|
|
|
20387
|
-
var classes$
|
|
20577
|
+
var classes$q = {"automap":"Automap-module_automap__531ko"};
|
|
20388
20578
|
|
|
20389
20579
|
var _excluded$d = ["formState"];
|
|
20390
20580
|
function ownKeys$r(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -20407,7 +20597,7 @@ var Automap = function Automap(props) {
|
|
|
20407
20597
|
rest = _objectWithoutProperties(props, _excluded$d);
|
|
20408
20598
|
return jsx(Dialog, {
|
|
20409
20599
|
title: "Reaction Auto-Mapping",
|
|
20410
|
-
className: classes$
|
|
20600
|
+
className: classes$q.automap,
|
|
20411
20601
|
result: function result() {
|
|
20412
20602
|
return formState.result;
|
|
20413
20603
|
},
|
|
@@ -20448,7 +20638,7 @@ var mapDispatchToProps$6 = function mapDispatchToProps(dispatch, ownProps) {
|
|
|
20448
20638
|
};
|
|
20449
20639
|
var AutomapContainer = connect(mapStateToProps$7, mapDispatchToProps$6)(Automap);
|
|
20450
20640
|
|
|
20451
|
-
var classes$
|
|
20641
|
+
var classes$p = {"bond":"Bond-module_bond__EDfLY"};
|
|
20452
20642
|
|
|
20453
20643
|
var _excluded$c = ["formState"];
|
|
20454
20644
|
function ownKeys$q(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -20459,7 +20649,7 @@ var Bond = function Bond(props) {
|
|
|
20459
20649
|
var bondProps = bond.properties;
|
|
20460
20650
|
return jsx(Dialog, {
|
|
20461
20651
|
title: "Bond Properties",
|
|
20462
|
-
className: classes$
|
|
20652
|
+
className: classes$p.bond,
|
|
20463
20653
|
result: function result() {
|
|
20464
20654
|
return formState.result;
|
|
20465
20655
|
},
|
|
@@ -20500,7 +20690,7 @@ var mapStateToProps$6 = function mapStateToProps(state) {
|
|
|
20500
20690
|
};
|
|
20501
20691
|
var BondContainer = connect(mapStateToProps$6)(Bond);
|
|
20502
20692
|
|
|
20503
|
-
var classes$
|
|
20693
|
+
var classes$o = {"field":"IfThenSelect-module_field__9YaPA"};
|
|
20504
20694
|
|
|
20505
20695
|
function ownKeys$p(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20506
20696
|
function _objectSpread$p(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$p(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$p(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -20523,14 +20713,14 @@ var IfThenSelect = function IfThenSelect(props) {
|
|
|
20523
20713
|
});
|
|
20524
20714
|
return jsx(Field, _objectSpread$p(_objectSpread$p({
|
|
20525
20715
|
schema: desc,
|
|
20526
|
-
className: classes$
|
|
20716
|
+
className: classes$o.field
|
|
20527
20717
|
}, props), {}, {
|
|
20528
20718
|
component: Select,
|
|
20529
20719
|
options: getSelectOptionsFromSchema(desc)
|
|
20530
20720
|
}));
|
|
20531
20721
|
};
|
|
20532
20722
|
|
|
20533
|
-
var classes$
|
|
20723
|
+
var classes$n = {"button-common-styles":"RgroupLogic-module_button-common-styles__P-ABP","scrollbar":"RgroupLogic-module_scrollbar__gDniy","rgroupLogic":"RgroupLogic-module_rgroupLogic__q4RTy","resth":"RgroupLogic-module_resth__RL2qE"};
|
|
20534
20724
|
|
|
20535
20725
|
var _excluded$b = ["formState", "label", "rgroupLabels"];
|
|
20536
20726
|
function ownKeys$o(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -20542,7 +20732,7 @@ var RgroupLogic = function RgroupLogic(props) {
|
|
|
20542
20732
|
rest = _objectWithoutProperties(props, _excluded$b);
|
|
20543
20733
|
return jsx(Dialog, {
|
|
20544
20734
|
title: "R-Group Logic Condition",
|
|
20545
|
-
className: classes$
|
|
20735
|
+
className: classes$n.rgroupLogic,
|
|
20546
20736
|
result: function result() {
|
|
20547
20737
|
return formState.result;
|
|
20548
20738
|
},
|
|
@@ -20569,7 +20759,7 @@ var RgroupLogic = function RgroupLogic(props) {
|
|
|
20569
20759
|
}), jsx(Field, {
|
|
20570
20760
|
name: "resth",
|
|
20571
20761
|
labelPos: "after",
|
|
20572
|
-
className: classes$
|
|
20762
|
+
className: classes$n.resth
|
|
20573
20763
|
}), jsx(IfThenSelect, {
|
|
20574
20764
|
name: "ifthen",
|
|
20575
20765
|
label: label,
|
|
@@ -20592,7 +20782,7 @@ var mapStateToProps$5 = function mapStateToProps(state) {
|
|
|
20592
20782
|
};
|
|
20593
20783
|
var RgroupLogicContainer = connect(mapStateToProps$5)(RgroupLogic);
|
|
20594
20784
|
|
|
20595
|
-
var classes$
|
|
20785
|
+
var classes$m = {"button-common-styles":"Open-module_button-common-styles__NBSQP","scrollbar":"Open-module_scrollbar__sRvYM","open":"Open-module_open__m8V9g","textareaEditor":"Open-module_textareaEditor__ZbEVj","footerContent":"Open-module_footerContent__Q0hTw","buttonsContainer":"Open-module_buttonsContainer__L1HqU","openButton":"Open-module_openButton__cj3oU","cancelButton":"Open-module_cancelButton__0TQzA","copyButton":"Open-module_copyButton__KlXKd"};
|
|
20596
20786
|
|
|
20597
20787
|
var styles$8 = {"analyzingFileWrapper":"AnalyzingFile-module_analyzingFileWrapper__j0Ltf","fileBox":"AnalyzingFile-module_fileBox__ywFIh"};
|
|
20598
20788
|
|
|
@@ -20729,7 +20919,7 @@ var TextEditor = function TextEditor(_ref) {
|
|
|
20729
20919
|
autoFocus = _ref$autoFocus === void 0 ? false : _ref$autoFocus;
|
|
20730
20920
|
return jsx(Fragment, {
|
|
20731
20921
|
children: jsx("textarea", {
|
|
20732
|
-
className: classes$
|
|
20922
|
+
className: classes$m.textareaEditor,
|
|
20733
20923
|
value: structStr,
|
|
20734
20924
|
onChange: function onChange(event) {
|
|
20735
20925
|
return inputHandler(event.target.value);
|
|
@@ -20772,22 +20962,22 @@ var FooterContent$1 = function FooterContent(_ref) {
|
|
|
20772
20962
|
copyHandler = _ref.copyHandler,
|
|
20773
20963
|
onCancel = _ref.onCancel;
|
|
20774
20964
|
return jsxs("div", {
|
|
20775
|
-
className: classes$
|
|
20965
|
+
className: classes$m.footerContent,
|
|
20776
20966
|
children: [jsx("button", {
|
|
20777
20967
|
onClick: onCancel,
|
|
20778
|
-
className: classes$
|
|
20968
|
+
className: classes$m.cancelButton,
|
|
20779
20969
|
children: "Cancel"
|
|
20780
20970
|
}), jsxs("div", {
|
|
20781
|
-
className: classes$
|
|
20971
|
+
className: classes$m.buttonsContainer,
|
|
20782
20972
|
children: [jsx(DialogActionButton, {
|
|
20783
20973
|
disabled: !structStr,
|
|
20784
20974
|
clickHandler: openHandler,
|
|
20785
|
-
styles: classes$
|
|
20975
|
+
styles: classes$m.openButton,
|
|
20786
20976
|
label: "Open as New Project"
|
|
20787
20977
|
}, "openButton"), jsx(DialogActionButton, {
|
|
20788
20978
|
disabled: !structStr,
|
|
20789
20979
|
clickHandler: copyHandler,
|
|
20790
|
-
styles: classes$
|
|
20980
|
+
styles: classes$m.copyButton,
|
|
20791
20981
|
label: "Add to Canvas",
|
|
20792
20982
|
title: "Structure will be loaded as fragment and added to Clipboard"
|
|
20793
20983
|
}, "copyButton")]
|
|
@@ -20861,7 +21051,7 @@ var Open = function Open(props) {
|
|
|
20861
21051
|
}
|
|
20862
21052
|
return jsx(Dialog, {
|
|
20863
21053
|
title: "Open structure",
|
|
20864
|
-
className: classes$
|
|
21054
|
+
className: classes$m.open,
|
|
20865
21055
|
params: rest,
|
|
20866
21056
|
result: function result() {
|
|
20867
21057
|
return null;
|
|
@@ -20985,7 +21175,7 @@ function couldBeSaved(struct, format) {
|
|
|
20985
21175
|
return null;
|
|
20986
21176
|
}
|
|
20987
21177
|
|
|
20988
|
-
var classes$
|
|
21178
|
+
var classes$l = {"tabs":"Tabs-module_tabs__PuztJ","active":"Tabs-module_active__eeyNd"};
|
|
20989
21179
|
|
|
20990
21180
|
function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20991
21181
|
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -21037,10 +21227,10 @@ var Tabs = function (_Component) {
|
|
|
21037
21227
|
className: className,
|
|
21038
21228
|
tabIndex: tabIndex,
|
|
21039
21229
|
children: jsx("li", {
|
|
21040
|
-
className: classes$
|
|
21230
|
+
className: classes$l.tabs,
|
|
21041
21231
|
children: tabs.map(function (tabPanel, index) {
|
|
21042
21232
|
return jsx("a", {
|
|
21043
|
-
className: clsx(_defineProperty({}, classes$
|
|
21233
|
+
className: clsx(_defineProperty({}, classes$l.active, _this2.state.tabIndex === index)),
|
|
21044
21234
|
onClick: function onClick(ev) {
|
|
21045
21235
|
return _this2.changeTab(ev, index);
|
|
21046
21236
|
},
|
|
@@ -21058,7 +21248,7 @@ var Tabs = function (_Component) {
|
|
|
21058
21248
|
return Tabs;
|
|
21059
21249
|
}(Component);
|
|
21060
21250
|
|
|
21061
|
-
var classes$
|
|
21251
|
+
var classes$k = {"button-common-styles":"Save-module_button-common-styles__mpLS8","scrollbar":"Save-module_scrollbar__XMf7I","dialog":"Save-module_dialog__of-0M","formContainer":"Save-module_formContainer__v1pIq","tabs":"Save-module_tabs__TOB-R","warnings":"Save-module_warnings__1PxJT","warningsContainer":"Save-module_warningsContainer__-3yVy","warningsArr":"Save-module_warningsArr__bKUFY","previewBackground":"Save-module_previewBackground__AbaUf","previewArea":"Save-module_previewArea__-0SLb","loadingCirclesContainer":"Save-module_loadingCirclesContainer__COUKN","imageContainer":"Save-module_imageContainer__gFELk","previewMessage":"Save-module_previewMessage__CZfZB","ok":"Save-module_ok__SgeCM","cancel":"Save-module_cancel__SMkEV","saveTmpl":"Save-module_saveTmpl__O-d0T"};
|
|
21062
21252
|
|
|
21063
21253
|
function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21064
21254
|
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -21210,7 +21400,7 @@ var SaveDialog = function (_Component) {
|
|
|
21210
21400
|
tabIndex: 1
|
|
21211
21401
|
}];
|
|
21212
21402
|
return jsxs("div", {
|
|
21213
|
-
className: classes$
|
|
21403
|
+
className: classes$k.formContainer,
|
|
21214
21404
|
children: [jsxs(Form$1, _objectSpread$j(_objectSpread$j({
|
|
21215
21405
|
schema: _this.saveSchema,
|
|
21216
21406
|
init: {
|
|
@@ -21227,7 +21417,7 @@ var SaveDialog = function (_Component) {
|
|
|
21227
21417
|
component: Select
|
|
21228
21418
|
})]
|
|
21229
21419
|
})), jsx(Tabs, {
|
|
21230
|
-
className: classes$
|
|
21420
|
+
className: classes$k.tabs,
|
|
21231
21421
|
captions: tabs,
|
|
21232
21422
|
tabIndex: _this.state.tabIndex,
|
|
21233
21423
|
changeTab: _this.changeTab,
|
|
@@ -21248,13 +21438,13 @@ var SaveDialog = function (_Component) {
|
|
|
21248
21438
|
var isCleanStruct = _this.props.struct.isBlank();
|
|
21249
21439
|
var LoadingState = function LoadingState() {
|
|
21250
21440
|
return jsx("div", {
|
|
21251
|
-
className: classes$
|
|
21441
|
+
className: classes$k.loadingCirclesContainer,
|
|
21252
21442
|
children: jsx(LoadingCircles, {})
|
|
21253
21443
|
});
|
|
21254
21444
|
};
|
|
21255
21445
|
var ImageContent = function ImageContent() {
|
|
21256
21446
|
return jsx("div", {
|
|
21257
|
-
className: classes$
|
|
21447
|
+
className: classes$k.imageContainer,
|
|
21258
21448
|
children: !isCleanStruct && jsx("img", {
|
|
21259
21449
|
src: "data:image/".concat(format, "+xml;base64,").concat(imageSrc),
|
|
21260
21450
|
alt: "".concat(format, " preview")
|
|
@@ -21263,10 +21453,10 @@ var SaveDialog = function (_Component) {
|
|
|
21263
21453
|
};
|
|
21264
21454
|
var BinaryContent = function BinaryContent() {
|
|
21265
21455
|
return jsx("div", {
|
|
21266
|
-
className: classes$
|
|
21456
|
+
className: classes$k.previewBackground,
|
|
21267
21457
|
children: jsx("textarea", {
|
|
21268
21458
|
value: "Can not display binary content",
|
|
21269
|
-
className: classes$
|
|
21459
|
+
className: classes$k.previewArea,
|
|
21270
21460
|
readOnly: true,
|
|
21271
21461
|
ref: _this.textAreaRef
|
|
21272
21462
|
})
|
|
@@ -21274,10 +21464,10 @@ var SaveDialog = function (_Component) {
|
|
|
21274
21464
|
};
|
|
21275
21465
|
var PreviewContent = function PreviewContent() {
|
|
21276
21466
|
return jsx("div", {
|
|
21277
|
-
className: classes$
|
|
21467
|
+
className: classes$k.previewBackground,
|
|
21278
21468
|
children: jsx("textarea", {
|
|
21279
21469
|
value: structStr,
|
|
21280
|
-
className: classes$
|
|
21470
|
+
className: classes$k.previewArea,
|
|
21281
21471
|
readOnly: true,
|
|
21282
21472
|
ref: _this.textAreaRef
|
|
21283
21473
|
})
|
|
@@ -21300,12 +21490,12 @@ var SaveDialog = function (_Component) {
|
|
|
21300
21490
|
var format = _formState$result3.format;
|
|
21301
21491
|
var warnings = _this.getWarnings(format);
|
|
21302
21492
|
return warnings.length ? jsx("div", {
|
|
21303
|
-
className: classes$
|
|
21493
|
+
className: classes$k.warnings,
|
|
21304
21494
|
children: warnings.map(function (warning) {
|
|
21305
21495
|
return jsx("div", {
|
|
21306
|
-
className: classes$
|
|
21496
|
+
className: classes$k.warningsContainer,
|
|
21307
21497
|
children: jsx("span", {
|
|
21308
|
-
className: classes$
|
|
21498
|
+
className: classes$k.warningsArr,
|
|
21309
21499
|
children: warning
|
|
21310
21500
|
})
|
|
21311
21501
|
});
|
|
@@ -21326,7 +21516,7 @@ var SaveDialog = function (_Component) {
|
|
|
21326
21516
|
var savingStruct = _this.isBinaryCdxFormat(format) && !isLoading ? b64toBlob(structStr) : structStr;
|
|
21327
21517
|
var isMoleculeContain = _this.props.struct.atoms.size && _this.props.struct.bonds.size;
|
|
21328
21518
|
var buttons = [jsx("button", {
|
|
21329
|
-
className: classes$
|
|
21519
|
+
className: classes$k.saveTmpl,
|
|
21330
21520
|
disabled: disableControls || isCleanStruct || !isMoleculeContain,
|
|
21331
21521
|
onClick: function onClick() {
|
|
21332
21522
|
return _this.props.onTmplSave(_this.props.struct);
|
|
@@ -21335,7 +21525,7 @@ var SaveDialog = function (_Component) {
|
|
|
21335
21525
|
}, "save-tmpl")];
|
|
21336
21526
|
buttons.push( jsx("button", {
|
|
21337
21527
|
mode: "onCancel",
|
|
21338
|
-
className: classes$
|
|
21528
|
+
className: classes$k.cancel,
|
|
21339
21529
|
onClick: function onClick() {
|
|
21340
21530
|
return _this.props.onOk({});
|
|
21341
21531
|
},
|
|
@@ -21351,7 +21541,7 @@ var SaveDialog = function (_Component) {
|
|
|
21351
21541
|
type: "image/".concat(format, "+xml"),
|
|
21352
21542
|
onSave: _this.props.onOk,
|
|
21353
21543
|
disabled: disableControls || !formState.valid || isCleanStruct || !_this.props.server,
|
|
21354
|
-
className: classes$
|
|
21544
|
+
className: classes$k.ok,
|
|
21355
21545
|
children: "Save"
|
|
21356
21546
|
}, "save-image-button"));
|
|
21357
21547
|
} else {
|
|
@@ -21363,7 +21553,7 @@ var SaveDialog = function (_Component) {
|
|
|
21363
21553
|
server: _this.props.server,
|
|
21364
21554
|
onSave: _this.props.onOk,
|
|
21365
21555
|
disabled: disableControls || !formState.valid || isCleanStruct,
|
|
21366
|
-
className: classes$
|
|
21556
|
+
className: classes$k.ok,
|
|
21367
21557
|
children: "Save"
|
|
21368
21558
|
}, "save-file-button"));
|
|
21369
21559
|
}
|
|
@@ -21407,7 +21597,7 @@ var SaveDialog = function (_Component) {
|
|
|
21407
21597
|
key: "render",
|
|
21408
21598
|
value: function render() {
|
|
21409
21599
|
return jsx(Dialog, {
|
|
21410
|
-
className: classes$
|
|
21600
|
+
className: classes$k.dialog,
|
|
21411
21601
|
title: "Save Structure",
|
|
21412
21602
|
params: this.props,
|
|
21413
21603
|
buttons: this.getButtons(),
|
|
@@ -21446,7 +21636,7 @@ var mapDispatchToProps$4 = function mapDispatchToProps(dispatch) {
|
|
|
21446
21636
|
};
|
|
21447
21637
|
var Save = connect(mapStateToProps$3, mapDispatchToProps$4)(SaveDialog);
|
|
21448
21638
|
|
|
21449
|
-
var classes$
|
|
21639
|
+
var classes$j = {"enhancedStereo":"enhancedStereo-module_enhancedStereo__8FLSY","stereoLabelItem":"enhancedStereo-module_stereoLabelItem__lEf-0","labelGroupSelect":"enhancedStereo-module_labelGroupSelect__K7TYC"};
|
|
21450
21640
|
|
|
21451
21641
|
var _excluded$8 = ["struct", "formState", "init"];
|
|
21452
21642
|
function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -21478,7 +21668,7 @@ var EnhancedStereo = function EnhancedStereo(props) {
|
|
|
21478
21668
|
};
|
|
21479
21669
|
return jsx(Dialog, {
|
|
21480
21670
|
title: "Enhanced Stereochemistry",
|
|
21481
|
-
className: classes$
|
|
21671
|
+
className: classes$j.enhancedStereo,
|
|
21482
21672
|
params: rest,
|
|
21483
21673
|
result: function result() {
|
|
21484
21674
|
return _result;
|
|
@@ -21515,7 +21705,7 @@ var EnhancedStereo = function EnhancedStereo(props) {
|
|
|
21515
21705
|
name: "andNumber",
|
|
21516
21706
|
schema: range$1(1, maxAnd + 1),
|
|
21517
21707
|
type: "text",
|
|
21518
|
-
className: classes$
|
|
21708
|
+
className: classes$j.labelGroupSelect
|
|
21519
21709
|
}), "Group"]
|
|
21520
21710
|
}), maxOr !== 0 && jsxs("label", {
|
|
21521
21711
|
children: [jsx(Field, {
|
|
@@ -21528,7 +21718,7 @@ var EnhancedStereo = function EnhancedStereo(props) {
|
|
|
21528
21718
|
name: "orNumber",
|
|
21529
21719
|
schema: range$1(1, maxOr + 1),
|
|
21530
21720
|
type: "text",
|
|
21531
|
-
className: classes$
|
|
21721
|
+
className: classes$j.labelGroupSelect
|
|
21532
21722
|
}), "Group"]
|
|
21533
21723
|
}), jsxs("label", {
|
|
21534
21724
|
children: [jsx(Field, {
|
|
@@ -21673,7 +21863,7 @@ var LabelEdit$1 = connect(function (store) {
|
|
|
21673
21863
|
};
|
|
21674
21864
|
})(LabelEdit);
|
|
21675
21865
|
|
|
21676
|
-
var classes$
|
|
21866
|
+
var classes$i = {"button-common-styles":"AtomInfo-module_button-common-styles__x3ucv","scrollbar":"AtomInfo-module_scrollbar__8GiyC","ket_atom_info":"AtomInfo-module_ket_atom_info__GOuZ6","none":"AtomInfo-module_none__PRuzx"};
|
|
21677
21867
|
|
|
21678
21868
|
function AtomInfo(_ref) {
|
|
21679
21869
|
var el = _ref.el,
|
|
@@ -21688,7 +21878,7 @@ function AtomInfo(_ref) {
|
|
|
21688
21878
|
fontSize: '18px'
|
|
21689
21879
|
};
|
|
21690
21880
|
return jsxs("div", {
|
|
21691
|
-
className: clsx(classes$
|
|
21881
|
+
className: clsx(classes$i.ket_atom_info, !isInfo && classes$i.none),
|
|
21692
21882
|
children: [jsx("div", {
|
|
21693
21883
|
style: numberStyle,
|
|
21694
21884
|
children: el.number
|
|
@@ -21921,13 +22111,35 @@ var VerticalBoxWithLines = function VerticalBoxWithLines() {
|
|
|
21921
22111
|
});
|
|
21922
22112
|
};
|
|
21923
22113
|
|
|
21924
|
-
var classes$
|
|
22114
|
+
var classes$h = {"button-common-styles":"GenSet-module_button-common-styles__0Ro-U","scrollbar":"GenSet-module_scrollbar__Ev8Uz","genGroupLegendBox":"GenSet-module_genGroupLegendBox__CSTQr","legendBox":"GenSet-module_legendBox__0zIAk","SpecialNodes":"GenSet-module_SpecialNodes__oFKp3","AtomGenerics":"GenSet-module_AtomGenerics__MoQCf","GroupGenerics":"GenSet-module_GroupGenerics__pFPtX","Cyclic":"GenSet-module_Cyclic__VJRtt","Acyclic":"GenSet-module_Acyclic__R97MM","CyclicCarbo":"GenSet-module_CyclicCarbo__Aanb0","AcyclicCarbo":"GenSet-module_AcyclicCarbo__nowGn","CyclicHetero":"GenSet-module_CyclicHetero__bbOnT","AcyclicHetero":"GenSet-module_AcyclicHetero__hnr4G"};
|
|
21925
22115
|
|
|
21926
22116
|
var isGenericGroup = function isGenericGroup(group) {
|
|
21927
22117
|
var cyclicGroups = ['Acyclic', 'Cyclic', 'Acyclic Carbo', 'Cyclic Carbo', 'Acyclic Hetero', 'Cyclic Hetero'];
|
|
21928
22118
|
return cyclicGroups.includes(group);
|
|
21929
22119
|
};
|
|
21930
22120
|
|
|
22121
|
+
var classes$g = {"button-common-styles":"ButtonGenSet-module_button-common-styles__3bEj7","scrollbar":"ButtonGenSet-module_scrollbar__CKIcM","button":"ButtonGenSet-module_button__hBoCQ","selected":"ButtonGenSet-module_selected__XAfYj"};
|
|
22122
|
+
|
|
22123
|
+
var ButtonGenSet = function ButtonGenSet(_ref) {
|
|
22124
|
+
var button = _ref.button,
|
|
22125
|
+
onAtomSelect = _ref.onAtomSelect,
|
|
22126
|
+
selected = _ref.selected,
|
|
22127
|
+
disabled = _ref.disabled;
|
|
22128
|
+
var titleText = disabled ? "".concat(button.label, " is disabled") : button.description || button.label;
|
|
22129
|
+
return jsx("button", {
|
|
22130
|
+
onClick: function onClick() {
|
|
22131
|
+
return onAtomSelect(button.label, false);
|
|
22132
|
+
},
|
|
22133
|
+
onDoubleClick: function onDoubleClick() {
|
|
22134
|
+
return onAtomSelect(button.label, true);
|
|
22135
|
+
},
|
|
22136
|
+
title: titleText,
|
|
22137
|
+
disabled: disabled,
|
|
22138
|
+
className: clsx(_defineProperty({}, classes$g.selected, selected(button.label)), classes$g.button),
|
|
22139
|
+
children: button.label
|
|
22140
|
+
});
|
|
22141
|
+
};
|
|
22142
|
+
|
|
21931
22143
|
var getGroupClassName = function getGroupClassName(groupName) {
|
|
21932
22144
|
return groupName.replaceAll(' ', '');
|
|
21933
22145
|
};
|
|
@@ -21936,7 +22148,8 @@ function GenSet(_ref) {
|
|
|
21936
22148
|
selected = _ref.selected,
|
|
21937
22149
|
onAtomSelect = _ref.onAtomSelect,
|
|
21938
22150
|
className = _ref.className,
|
|
21939
|
-
group = _ref.group
|
|
22151
|
+
group = _ref.group,
|
|
22152
|
+
disabledQueryElements = _ref.disabledQueryElements;
|
|
21940
22153
|
return jsx(Fragment, {
|
|
21941
22154
|
children: labels.map(function (item, index) {
|
|
21942
22155
|
var buttons = item.items;
|
|
@@ -21944,29 +22157,24 @@ function GenSet(_ref) {
|
|
|
21944
22157
|
return jsxs("fieldset", {
|
|
21945
22158
|
className: className,
|
|
21946
22159
|
children: [jsx("div", {
|
|
21947
|
-
className: classes$
|
|
22160
|
+
className: classes$h[getGroupClassName(group)],
|
|
21948
22161
|
children: buttons.map(function (button, index) {
|
|
21949
|
-
return jsx(
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
21954
|
-
return onAtomSelect(button.label, true);
|
|
21955
|
-
},
|
|
21956
|
-
title: button.description || button.label,
|
|
21957
|
-
className: clsx(_defineProperty({}, classes$g.selected, selected(button.label)), classes$g.button),
|
|
21958
|
-
children: button.label
|
|
22162
|
+
return jsx(ButtonGenSet, {
|
|
22163
|
+
button: button,
|
|
22164
|
+
onAtomSelect: onAtomSelect,
|
|
22165
|
+
selected: selected,
|
|
22166
|
+
disabled: Boolean(disabledQueryElements === null || disabledQueryElements === void 0 ? void 0 : disabledQueryElements.includes(button.label))
|
|
21959
22167
|
}, index);
|
|
21960
22168
|
})
|
|
21961
22169
|
}), !isGenericGroup(group) && caption && jsx("div", {
|
|
21962
|
-
className: classes$
|
|
22170
|
+
className: classes$h.legendBox,
|
|
21963
22171
|
children: jsx("legend", {
|
|
21964
22172
|
children: caption
|
|
21965
22173
|
})
|
|
21966
22174
|
}), isGenericGroup(group) && caption && jsx("div", {
|
|
21967
|
-
className: classes$
|
|
22175
|
+
className: classes$h.genGroupLegendBox,
|
|
21968
22176
|
children: jsx("legend", {
|
|
21969
|
-
className: classes$
|
|
22177
|
+
className: classes$h.genGroupLegend,
|
|
21970
22178
|
children: caption
|
|
21971
22179
|
})
|
|
21972
22180
|
})]
|
|
@@ -21985,7 +22193,8 @@ var getLegendClassname = function getLegendClassname(title) {
|
|
|
21985
22193
|
var GenGroup = function GenGroup(_ref) {
|
|
21986
22194
|
var group = _ref.group,
|
|
21987
22195
|
onAtomSelect = _ref.onAtomSelect,
|
|
21988
|
-
selected = _ref.selected
|
|
22196
|
+
selected = _ref.selected,
|
|
22197
|
+
disabledQueryElements = _ref.disabledQueryElements;
|
|
21989
22198
|
return jsx("div", {
|
|
21990
22199
|
className: styles$2.fieldFlexWrapper,
|
|
21991
22200
|
children: jsxs("fieldset", {
|
|
@@ -22000,7 +22209,8 @@ var GenGroup = function GenGroup(_ref) {
|
|
|
22000
22209
|
selected: selected,
|
|
22001
22210
|
onAtomSelect: onAtomSelect,
|
|
22002
22211
|
className: styles$2.subGroup,
|
|
22003
|
-
group: group.title
|
|
22212
|
+
group: group.title,
|
|
22213
|
+
disabledQueryElements: disabledQueryElements
|
|
22004
22214
|
})
|
|
22005
22215
|
})]
|
|
22006
22216
|
})
|
|
@@ -22023,36 +22233,38 @@ var getGenericsGroupsMap = function getGenericsGroupsMap(tree) {
|
|
|
22023
22233
|
}
|
|
22024
22234
|
return newGroups;
|
|
22025
22235
|
};
|
|
22026
|
-
var renderGenGroupComponent = function renderGenGroupComponent(group, selected, onAtomSelect) {
|
|
22236
|
+
var renderGenGroupComponent = function renderGenGroupComponent(group, selected, onAtomSelect, disabledQueryElements) {
|
|
22027
22237
|
return jsx(GenGroup, {
|
|
22028
22238
|
group: groupsMap[group],
|
|
22029
22239
|
selected: selected,
|
|
22030
|
-
onAtomSelect: onAtomSelect
|
|
22240
|
+
onAtomSelect: onAtomSelect,
|
|
22241
|
+
disabledQueryElements: disabledQueryElements
|
|
22031
22242
|
});
|
|
22032
22243
|
};
|
|
22033
22244
|
var groupsMap = getGenericsGroupsMap(Generics);
|
|
22034
22245
|
function GenericGroups(_ref) {
|
|
22035
22246
|
var selected = _ref.selected,
|
|
22036
|
-
onAtomSelect = _ref.onAtomSelect
|
|
22247
|
+
onAtomSelect = _ref.onAtomSelect,
|
|
22248
|
+
disabledQueryElements = _ref.disabledQueryElements;
|
|
22037
22249
|
return jsxs("div", {
|
|
22038
22250
|
className: classes$f.genericGroups,
|
|
22039
22251
|
children: [jsxs("div", {
|
|
22040
22252
|
className: classes$f.topGroupsContainer,
|
|
22041
|
-
children: [renderGenGroupComponent(groupNames.atomsGen, selected, onAtomSelect), renderGenGroupComponent(groupNames.specialNodes, selected, onAtomSelect)]
|
|
22042
|
-
}), renderGenGroupComponent(groupNames.groupGen, selected, onAtomSelect), jsx(HorizontalBoxWithLines, {}), jsxs("div", {
|
|
22253
|
+
children: [renderGenGroupComponent(groupNames.atomsGen, selected, onAtomSelect, disabledQueryElements), renderGenGroupComponent(groupNames.specialNodes, selected, onAtomSelect, disabledQueryElements)]
|
|
22254
|
+
}), renderGenGroupComponent(groupNames.groupGen, selected, onAtomSelect, disabledQueryElements), jsx(HorizontalBoxWithLines, {}), jsxs("div", {
|
|
22043
22255
|
className: classes$f.groupGenerics,
|
|
22044
22256
|
children: [jsxs("div", {
|
|
22045
|
-
children: [renderGenGroupComponent(groupNames.groupAcyclic, selected, onAtomSelect), jsxs("div", {
|
|
22257
|
+
children: [renderGenGroupComponent(groupNames.groupAcyclic, selected, onAtomSelect, disabledQueryElements), jsxs("div", {
|
|
22046
22258
|
className: classes$f.subgroupContainer,
|
|
22047
22259
|
children: [jsx(VerticalBoxWithLines, {}), jsxs("div", {
|
|
22048
|
-
children: [renderGenGroupComponent(groupNames.acyclicCarbo, selected, onAtomSelect), renderGenGroupComponent(groupNames.acyclicHetero, selected, onAtomSelect)]
|
|
22260
|
+
children: [renderGenGroupComponent(groupNames.acyclicCarbo, selected, onAtomSelect, disabledQueryElements), renderGenGroupComponent(groupNames.acyclicHetero, selected, onAtomSelect, disabledQueryElements)]
|
|
22049
22261
|
})]
|
|
22050
22262
|
})]
|
|
22051
22263
|
}), jsxs("div", {
|
|
22052
|
-
children: [renderGenGroupComponent(groupNames.groupCyclic, selected, onAtomSelect), jsxs("div", {
|
|
22264
|
+
children: [renderGenGroupComponent(groupNames.groupCyclic, selected, onAtomSelect, disabledQueryElements), jsxs("div", {
|
|
22053
22265
|
className: classes$f.subgroupContainer,
|
|
22054
22266
|
children: [jsx(VerticalBoxWithLines, {}), jsxs("div", {
|
|
22055
|
-
children: [renderGenGroupComponent(groupNames.cyclicCarbo, selected, onAtomSelect), renderGenGroupComponent(groupNames.cyclicHetero, selected, onAtomSelect)]
|
|
22267
|
+
children: [renderGenGroupComponent(groupNames.cyclicCarbo, selected, onAtomSelect, disabledQueryElements), renderGenGroupComponent(groupNames.cyclicHetero, selected, onAtomSelect, disabledQueryElements)]
|
|
22056
22268
|
})]
|
|
22057
22269
|
})]
|
|
22058
22270
|
})]
|
|
@@ -22333,7 +22545,8 @@ var Table = function Table(props) {
|
|
|
22333
22545
|
needMargin: false,
|
|
22334
22546
|
children: jsx(GenericGroups, {
|
|
22335
22547
|
selected: selected,
|
|
22336
|
-
onAtomSelect: onAtomSelect
|
|
22548
|
+
onAtomSelect: onAtomSelect,
|
|
22549
|
+
disabledQueryElements: props.disabledQueryElements
|
|
22337
22550
|
})
|
|
22338
22551
|
});
|
|
22339
22552
|
};
|
|
@@ -22348,10 +22561,14 @@ function mapSelectionToProps(editor) {
|
|
|
22348
22561
|
return {};
|
|
22349
22562
|
}
|
|
22350
22563
|
var mapStateToProps$1 = function mapStateToProps(state, ownProps) {
|
|
22564
|
+
var editor = state.editor;
|
|
22351
22565
|
if (ownProps.values || ownProps.label) {
|
|
22352
22566
|
return {};
|
|
22353
22567
|
}
|
|
22354
|
-
|
|
22568
|
+
var disabledQueryElements = editor.render.options.disableQueryElements;
|
|
22569
|
+
return _objectSpread$a({
|
|
22570
|
+
disabledQueryElements: disabledQueryElements
|
|
22571
|
+
}, mapSelectionToProps(editor));
|
|
22355
22572
|
};
|
|
22356
22573
|
var mapDispatchToProps$2 = function mapDispatchToProps(dispatch, ownProps) {
|
|
22357
22574
|
return {
|
|
@@ -22650,7 +22867,7 @@ var classes$8 = {"button-common-styles":"template-lib-module_button-common-style
|
|
|
22650
22867
|
|
|
22651
22868
|
var _excluded$3 = ["onInit"],
|
|
22652
22869
|
_excluded2$1 = ["name", "onNameEdit", "onAttachEdit"];
|
|
22653
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
22870
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
22654
22871
|
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22655
22872
|
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22656
22873
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -22658,14 +22875,15 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
22658
22875
|
var TemplateEditDialog = styled(Dialog)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: #fff;\n\n & header {\n text-transform: none;\n border-bottom: 1px solid #e1e5ea;\n margin: 0;\n padding: 12px;\n }\n\n & form {\n display: flex;\n\n & label::after {\n top: 92px;\n margin-right: 12px;\n }\n }\n"])));
|
|
22659
22876
|
var Editor$2 = styled('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid #b4b9d6;\n background-color: #ffff;\n border-radius: 5px;\n position: relative;\n height: 300px;\n width: 330px;\n overflow: hidden;\n\n & .structEditor {\n height: 100%;\n width: 100%;\n border: none;\n }\n"])));
|
|
22660
22877
|
var Warning = styled('div')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 0 5px;\n"])));
|
|
22661
|
-
var
|
|
22662
|
-
var
|
|
22663
|
-
var
|
|
22664
|
-
var
|
|
22665
|
-
var
|
|
22666
|
-
var
|
|
22667
|
-
var
|
|
22668
|
-
var
|
|
22878
|
+
var Message = styled('div')(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: #e1e5ea;\n color: #333333;\n padding: 10px 12px;\n border-top: 1px solid #cad3dd;\n border-bottom: 1px solid #cad3dd;\n"])));
|
|
22879
|
+
var LeftColumn = styled('div')(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 12px;\n border-radius: 0 0 0 8px;\n background-color: #eff2f5;\n"])));
|
|
22880
|
+
var RightColumn = styled('div')(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 40%;\n min-width: 200px;\n box-sizing: border-box;\n padding: 12px;\n display: flex;\n flex-direction: column;\n"])));
|
|
22881
|
+
var NameInput = styled(Field)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n margin-bottom: 12px;\n\n & input[type='text'] {\n display: block;\n width: 100%;\n box-sizing: border-box;\n border: 1px solid #cad3dd;\n border-radius: 4px;\n line-height: 16px;\n font-size: 14px;\n margin-top: 4px;\n\n &:hover {\n border-color: #43b5c0;\n }\n\n &:hover,\n :focus {\n box-shadow: none;\n }\n }\n\n & span {\n display: block;\n width: 100%;\n }\n"])));
|
|
22882
|
+
var AttachmentOutput = styled('span')(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: block;\n width: 100%;\n height: 24px;\n box-sizing: border-box;\n padding: 4px 8px;\n border: 1px solid #cad3dd;\n border-radius: 4px;\n line-height: 14px;\n font-size: 14px;\n background-color: #eff2f5;\n margin-top: 4px;\n"])));
|
|
22883
|
+
var Buttons = styled('div')(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n margin-top: auto;\n justify-content: flex-end;\n gap: 8px;\n"])));
|
|
22884
|
+
var buttonCommonStyles = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n width: fit-content;\n padding: 5px 8px;\n text-transform: none;\n font-size: 12px;\n line-height: 14px;\n box-shadow: none;\n"])));
|
|
22885
|
+
var SaveButton = styled(Button$1)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", "\n background-color: #167782;\n\n &:hover {\n background-color: #43b5c0;\n box-shadow: none;\n }\n\n &:disabled {\n background-color: #e1e5ea;\n color: #333333;\n }\n"])), buttonCommonStyles);
|
|
22886
|
+
var CancelButton = styled(Button$1)(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n ", "\n border-color: #585858;\n color: #585858;\n\n &:hover {\n border-color: #333333;\n color: #333333;\n box-shadow: none;\n }\n"])), buttonCommonStyles);
|
|
22669
22887
|
var editorStyles = {
|
|
22670
22888
|
selectionStyle: {
|
|
22671
22889
|
fill: '#167782',
|
|
@@ -22689,6 +22907,11 @@ var Attach = function (_Component) {
|
|
|
22689
22907
|
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
22690
22908
|
_classCallCheck(this, Attach);
|
|
22691
22909
|
_this = _super.call(this);
|
|
22910
|
+
_defineProperty(_assertThisInitialized(_this), "MODES", {
|
|
22911
|
+
SAVE: 'save',
|
|
22912
|
+
EDIT: 'edit'
|
|
22913
|
+
});
|
|
22914
|
+
_this.mode = isEmpty$1(props.tmpl.props) ? _this.MODES.SAVE : _this.MODES.EDIT;
|
|
22692
22915
|
_this.tmpl = initTmpl(props.tmpl);
|
|
22693
22916
|
onInit(_this.tmpl.struct.name, _this.tmpl.props);
|
|
22694
22917
|
_this.onResult = _this.onResult.bind(_assertThisInitialized(_this));
|
|
@@ -22732,8 +22955,10 @@ var Attach = function (_Component) {
|
|
|
22732
22955
|
var options = Object.assign(editorStyles, this.props.globalSettings, {
|
|
22733
22956
|
scale: getScale(struct)
|
|
22734
22957
|
});
|
|
22735
|
-
|
|
22736
|
-
|
|
22958
|
+
var dialogTitle = this.mode === this.MODES.SAVE ? 'Save to Templates' : 'Template Edit';
|
|
22959
|
+
var warningObject = this.mode === this.MODES.SAVE ? 'Templates' : 'Edited templates';
|
|
22960
|
+
return jsxs(TemplateEditDialog, {
|
|
22961
|
+
title: dialogTitle,
|
|
22737
22962
|
result: this.onResult,
|
|
22738
22963
|
valid: function valid() {
|
|
22739
22964
|
return _this2.props.formState.valid && name;
|
|
@@ -22741,7 +22966,13 @@ var Attach = function (_Component) {
|
|
|
22741
22966
|
params: prop,
|
|
22742
22967
|
buttons: [],
|
|
22743
22968
|
needMargin: false,
|
|
22744
|
-
children: jsxs(
|
|
22969
|
+
children: [jsxs(Message, {
|
|
22970
|
+
children: [jsxs("div", {
|
|
22971
|
+
children: [warningObject, " are saved locally and cannot be accessed on different browsers or computers."]
|
|
22972
|
+
}), jsx("div", {
|
|
22973
|
+
children: "Be aware that other users of the same computer and browser can access them as well."
|
|
22974
|
+
})]
|
|
22975
|
+
}), jsxs(Form$1, _objectSpread$6(_objectSpread$6({
|
|
22745
22976
|
schema: attachSchema,
|
|
22746
22977
|
customValid: {
|
|
22747
22978
|
name: function name(_name) {
|
|
@@ -22793,11 +23024,11 @@ var Attach = function (_Component) {
|
|
|
22793
23024
|
},
|
|
22794
23025
|
className: classes$8.button,
|
|
22795
23026
|
disabled: !this.checkIsValidName(name),
|
|
22796
|
-
children:
|
|
23027
|
+
children: this.mode === this.MODES.SAVE ? 'Save' : 'Edit'
|
|
22797
23028
|
})]
|
|
22798
23029
|
})]
|
|
22799
23030
|
})]
|
|
22800
|
-
}))
|
|
23031
|
+
}))]
|
|
22801
23032
|
});
|
|
22802
23033
|
}
|
|
22803
23034
|
}]);
|
|
@@ -23692,10 +23923,10 @@ function Modal(props) {
|
|
|
23692
23923
|
var Component = modals[modal.name];
|
|
23693
23924
|
if (!Component) throw new Error("There is no modal window named ".concat(modal.name));
|
|
23694
23925
|
return jsx("div", {
|
|
23695
|
-
className: clsx(classes$
|
|
23926
|
+
className: clsx(classes$F.modalOverlay, selectClasses.selectContainer),
|
|
23696
23927
|
ref: containerRef,
|
|
23697
23928
|
children: jsx(Component, _objectSpread$3({
|
|
23698
|
-
className: clsx(_defineProperty({}, classes$
|
|
23929
|
+
className: clsx(_defineProperty({}, classes$F.smallScreen, height && height <= mediaSizes$1.smallHeight || width && width <= mediaSizes$1.smallWidth))
|
|
23699
23930
|
}, rest))
|
|
23700
23931
|
});
|
|
23701
23932
|
}
|
|
@@ -23739,6 +23970,24 @@ var mergeProps = function mergeProps(stateProps, dispatchProps) {
|
|
|
23739
23970
|
};
|
|
23740
23971
|
var ModalContainer = connect(mapStateToProps, mapDispatchToProps$1, mergeProps)(Modal);
|
|
23741
23972
|
|
|
23973
|
+
function generateCommonProperties(selectedElements, normalizedElement) {
|
|
23974
|
+
var properties = Object.getOwnPropertyNames(normalizedElement);
|
|
23975
|
+
var resultElementAttributes = {};
|
|
23976
|
+
properties.forEach(function (property) {
|
|
23977
|
+
var uniqueValues = new Set();
|
|
23978
|
+
selectedElements.forEach(function (element) {
|
|
23979
|
+
uniqueValues.add(element[property]);
|
|
23980
|
+
});
|
|
23981
|
+
var allElementsHaveTheSameValue = uniqueValues.size === 1;
|
|
23982
|
+
if (allElementsHaveTheSameValue) {
|
|
23983
|
+
resultElementAttributes[property] = normalizedElement[property];
|
|
23984
|
+
} else {
|
|
23985
|
+
resultElementAttributes[property] = '';
|
|
23986
|
+
}
|
|
23987
|
+
});
|
|
23988
|
+
return resultElementAttributes;
|
|
23989
|
+
}
|
|
23990
|
+
|
|
23742
23991
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23743
23992
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23744
23993
|
function initEditor(dispatch, getState) {
|
|
@@ -23782,7 +24031,7 @@ function initEditor(dispatch, getState) {
|
|
|
23782
24031
|
},
|
|
23783
24032
|
onElementEdit: function onElementEdit(selem) {
|
|
23784
24033
|
if (isAtomsArray(selem)) {
|
|
23785
|
-
var atomAttributes = generateCommonProperties(selem);
|
|
24034
|
+
var atomAttributes = generateCommonProperties(selem, fromAtom(selem[0]));
|
|
23786
24035
|
return openDialog(dispatch, 'atomProps', _objectSpread$1(_objectSpread$1({}, atomAttributes), {}, {
|
|
23787
24036
|
isMultipleAtoms: true
|
|
23788
24037
|
})).then(toElement);
|
|
@@ -23845,8 +24094,9 @@ function initEditor(dispatch, getState) {
|
|
|
23845
24094
|
onQuickEdit: function onQuickEdit(atom) {
|
|
23846
24095
|
return openDialog(dispatch, 'labelEdit', atom);
|
|
23847
24096
|
},
|
|
23848
|
-
onBondEdit: function onBondEdit(
|
|
23849
|
-
|
|
24097
|
+
onBondEdit: function onBondEdit(bonds) {
|
|
24098
|
+
var bondsAttributes = generateCommonProperties(bonds, bonds[0]);
|
|
24099
|
+
return openDialog(dispatch, 'bondProps', fromBond(bondsAttributes)).then(toBond);
|
|
23850
24100
|
},
|
|
23851
24101
|
onRgroupEdit: function onRgroupEdit(rgroup) {
|
|
23852
24102
|
var struct = getState().editor.struct();
|
|
@@ -24060,8 +24310,8 @@ var KetcherBuilder = function () {
|
|
|
24060
24310
|
initApp(element, staticResourcesUrl, {
|
|
24061
24311
|
buttons: buttons || {},
|
|
24062
24312
|
errorHandler: errorHandler || null,
|
|
24063
|
-
version: "2.
|
|
24064
|
-
buildDate: "2023-
|
|
24313
|
+
version: "2.10.0-rc.2" ,
|
|
24314
|
+
buildDate: "2023-05-03T14:52:11" ,
|
|
24065
24315
|
buildNumber: ''
|
|
24066
24316
|
}, structService, resolve);
|
|
24067
24317
|
});
|
|
@@ -24171,5 +24421,5 @@ function Editor(props) {
|
|
|
24171
24421
|
});
|
|
24172
24422
|
}
|
|
24173
24423
|
|
|
24174
|
-
export { Editor, KETCHER_INIT_EVENT_NAME, KETCHER_SAVED_SETTINGS_KEY, MODES };
|
|
24424
|
+
export { Editor, KETCHER_INIT_EVENT_NAME, KETCHER_SAVED_SETTINGS_KEY, MODES, STRUCT_TYPE };
|
|
24175
24425
|
//# sourceMappingURL=index.modern.js.map
|