ketcher-react 2.9.0-rc.7 → 2.10.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +724 -529
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +726 -531
- 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 +1 -6
- 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/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, FunctionalGroup, FunctionalGroupsProvider, SaltsAndSolventsProvider, KetcherAsyncEvents, ElementColor, fromAtomsAttrs, fracAngle, Vec2, Action, fromSgroupDeletion, fromFragmentDeletion, fromAtomAddition, fromBondAddition,
|
|
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, FunctionalGroup, FunctionalGroupsProvider, SaltsAndSolventsProvider, KetcherAsyncEvents, ElementColor, 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, Struct, 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: {
|
|
@@ -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$e(
|
|
1950
|
+
var _iterator = _createForOfIteratorHelper$e(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$e(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$e(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
|
};
|
|
@@ -2959,7 +2949,7 @@ var templates = templates$1.reduce(function (res, struct, i) {
|
|
|
2959
2949
|
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
2950
|
var zoom = {
|
|
2961
2951
|
zoom: {
|
|
2962
|
-
shortcut: ['Mod+
|
|
2952
|
+
shortcut: ['Mod+0'],
|
|
2963
2953
|
selected: function selected(editor) {
|
|
2964
2954
|
return editor.zoom();
|
|
2965
2955
|
},
|
|
@@ -3013,7 +3003,7 @@ var zoom = {
|
|
|
3013
3003
|
|
|
3014
3004
|
var openHelpLink = function openHelpLink() {
|
|
3015
3005
|
var _window$open;
|
|
3016
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.
|
|
3006
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.10.0-rc.1\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
|
|
3017
3007
|
};
|
|
3018
3008
|
var help = {
|
|
3019
3009
|
help: {
|
|
@@ -6992,7 +6982,7 @@ function Icon(_ref) {
|
|
|
6992
6982
|
return jsx(Component, _objectSpread$17({}, props));
|
|
6993
6983
|
}
|
|
6994
6984
|
|
|
6995
|
-
var classes$
|
|
6985
|
+
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
6986
|
|
|
6997
6987
|
var shortcutAliasMap = {
|
|
6998
6988
|
Escape: 'Esc',
|
|
@@ -7031,10 +7021,11 @@ var ActionButton = function ActionButton(props) {
|
|
|
7031
7021
|
}
|
|
7032
7022
|
};
|
|
7033
7023
|
return jsxs("button", {
|
|
7024
|
+
"data-testid": name,
|
|
7034
7025
|
disabled: disabled,
|
|
7035
7026
|
onClick: handleClick,
|
|
7036
7027
|
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$
|
|
7028
|
+
className: clsx(classes$N.button, _defineProperty({}, classes$N.selected, selected), className),
|
|
7038
7029
|
children: [jsx(Icon, {
|
|
7039
7030
|
name: name
|
|
7040
7031
|
}), jsx("kbd", {
|
|
@@ -7190,7 +7181,7 @@ var DefaultMultiTool = function DefaultMultiTool(props) {
|
|
|
7190
7181
|
});
|
|
7191
7182
|
};
|
|
7192
7183
|
|
|
7193
|
-
var classes$
|
|
7184
|
+
var classes$M = {"group":"GroupedMultiTool-module_group__BJQAU"};
|
|
7194
7185
|
|
|
7195
7186
|
var GroupedMultiTool = function GroupedMultiTool(props) {
|
|
7196
7187
|
var groups = props.groups,
|
|
@@ -7205,7 +7196,7 @@ var GroupedMultiTool = function GroupedMultiTool(props) {
|
|
|
7205
7196
|
return jsx(Fragment, {
|
|
7206
7197
|
children: groups.map(function (descriptor) {
|
|
7207
7198
|
return jsx("div", {
|
|
7208
|
-
className: classes$
|
|
7199
|
+
className: classes$M.group,
|
|
7209
7200
|
children: options.slice(descriptor.start, descriptor.end).map(function (toolbarItem) {
|
|
7210
7201
|
var currentStatus = status[toolbarItem.id];
|
|
7211
7202
|
return jsx(ActionButton, {
|
|
@@ -7235,7 +7226,7 @@ function chooseMultiTool() {
|
|
|
7235
7226
|
}
|
|
7236
7227
|
}
|
|
7237
7228
|
|
|
7238
|
-
var classes$
|
|
7229
|
+
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
7230
|
|
|
7240
7231
|
function usePortalOpening(_ref) {
|
|
7241
7232
|
var _ref2 = _slicedToArray(_ref, 3),
|
|
@@ -7354,7 +7345,7 @@ var ToolbarMultiToolItem = function ToolbarMultiToolItem(props) {
|
|
|
7354
7345
|
portalClassName = _chooseMultiTool2[1];
|
|
7355
7346
|
return displayMultiToolItem ? jsxs("div", {
|
|
7356
7347
|
ref: ref,
|
|
7357
|
-
className: classes$
|
|
7348
|
+
className: classes$L.root,
|
|
7358
7349
|
children: [jsx(ActionButton, _objectSpread$16(_objectSpread$16({}, actionButtonProps), {}, {
|
|
7359
7350
|
className: className,
|
|
7360
7351
|
name: currentId,
|
|
@@ -7362,12 +7353,12 @@ var ToolbarMultiToolItem = function ToolbarMultiToolItem(props) {
|
|
|
7362
7353
|
status: currentStatus,
|
|
7363
7354
|
selected: selected
|
|
7364
7355
|
})), !isOpen && jsx(Icon, {
|
|
7365
|
-
className: "".concat(classes$
|
|
7356
|
+
className: "".concat(classes$L.icon, " ").concat((currentStatus === null || currentStatus === void 0 ? void 0 : currentStatus.selected) && classes$L.iconSelected),
|
|
7366
7357
|
name: "dropdown",
|
|
7367
7358
|
onClick: onOpenOptions
|
|
7368
7359
|
}), isOpen ? jsx(Portal, {
|
|
7369
7360
|
isOpen: isOpen,
|
|
7370
|
-
className: clsx(classes$
|
|
7361
|
+
className: clsx(classes$L.portal, vertical && classes$L['portal-vertical'], portalClassName),
|
|
7371
7362
|
style: portalStyle,
|
|
7372
7363
|
children: jsx(Component, {
|
|
7373
7364
|
options: options,
|
|
@@ -7452,7 +7443,7 @@ var TemplatesList = function TemplatesList(props) {
|
|
|
7452
7443
|
});
|
|
7453
7444
|
};
|
|
7454
7445
|
|
|
7455
|
-
var classes$
|
|
7446
|
+
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
7447
|
|
|
7457
7448
|
var _excluded$A = ["className"];
|
|
7458
7449
|
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 +7452,7 @@ var Group$1 = function Group(_ref) {
|
|
|
7461
7452
|
var children = _ref.children,
|
|
7462
7453
|
className = _ref.className;
|
|
7463
7454
|
return jsx("div", {
|
|
7464
|
-
className: clsx(classes$
|
|
7455
|
+
className: clsx(classes$K.group, className),
|
|
7465
7456
|
children: children
|
|
7466
7457
|
});
|
|
7467
7458
|
};
|
|
@@ -7473,7 +7464,7 @@ var BottomToolbar = function BottomToolbar(props) {
|
|
|
7473
7464
|
indigoVerification = rest.indigoVerification,
|
|
7474
7465
|
onAction = rest.onAction;
|
|
7475
7466
|
return jsxs("div", {
|
|
7476
|
-
className: clsx(classes$
|
|
7467
|
+
className: clsx(classes$K.root, className),
|
|
7477
7468
|
children: [jsx(Group$1, {
|
|
7478
7469
|
children: jsx(TemplatesList, {
|
|
7479
7470
|
active: active,
|
|
@@ -8050,7 +8041,7 @@ function showFunctionalGroupsTooltip(editor) {
|
|
|
8050
8041
|
if (closestCollapsibleStructures) {
|
|
8051
8042
|
var _editor$struct;
|
|
8052
8043
|
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) {
|
|
8044
|
+
if (sGroup && !sGroup.data.expanded && sGroup.hovering) {
|
|
8054
8045
|
var groupName = sGroup.data.name;
|
|
8055
8046
|
var groupStruct = FunctionalGroup.getFunctionalGroupByName(groupName);
|
|
8056
8047
|
infoPanelData = {
|
|
@@ -8459,7 +8450,7 @@ var selectOptions$2 = makeItems(['select-rectangle', 'select-lasso', 'select-fra
|
|
|
8459
8450
|
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
8451
|
var mappingOptions = makeItems(['reaction-map', 'reaction-unmap', 'reaction-automap']);
|
|
8461
8452
|
|
|
8462
|
-
var classes$
|
|
8453
|
+
var classes$J = {"scroll":"ArrowScroll-module_scroll__h9kCx","button":"ArrowScroll-module_button__ygMgL","down":"ArrowScroll-module_down__yDzZX","up":"ArrowScroll-module_up__Q1ubd"};
|
|
8463
8454
|
|
|
8464
8455
|
function useSettingsContext() {
|
|
8465
8456
|
return React__default.useContext(settingsContext);
|
|
@@ -8578,7 +8569,7 @@ var ArrowScroll = function ArrowScroll(_ref) {
|
|
|
8578
8569
|
};
|
|
8579
8570
|
}, [endInView]);
|
|
8580
8571
|
return jsxs("div", {
|
|
8581
|
-
className: classes$
|
|
8572
|
+
className: classes$J.scroll,
|
|
8582
8573
|
children: [endInView ? jsx(Fragment, {}) : jsx("button", {
|
|
8583
8574
|
onClick: function onClick() {
|
|
8584
8575
|
return scrollDown();
|
|
@@ -8589,7 +8580,7 @@ var ArrowScroll = function ArrowScroll(_ref) {
|
|
|
8589
8580
|
onMouseDown: function onMouseDown() {
|
|
8590
8581
|
return setScrollDown(true);
|
|
8591
8582
|
},
|
|
8592
|
-
className: clsx(classes$
|
|
8583
|
+
className: clsx(classes$J.button, classes$J.down),
|
|
8593
8584
|
children: "\u25BC"
|
|
8594
8585
|
}), startInView ? jsx(Fragment, {}) : jsx("button", {
|
|
8595
8586
|
onClick: function onClick() {
|
|
@@ -8601,7 +8592,7 @@ var ArrowScroll = function ArrowScroll(_ref) {
|
|
|
8601
8592
|
onMouseDown: function onMouseDown() {
|
|
8602
8593
|
return setScrollUp(true);
|
|
8603
8594
|
},
|
|
8604
|
-
className: clsx(classes$
|
|
8595
|
+
className: clsx(classes$J.button, classes$J.up),
|
|
8605
8596
|
children: "\u25B2"
|
|
8606
8597
|
})]
|
|
8607
8598
|
});
|
|
@@ -8687,7 +8678,7 @@ var Transform = function Transform(props) {
|
|
|
8687
8678
|
});
|
|
8688
8679
|
};
|
|
8689
8680
|
|
|
8690
|
-
var classes$
|
|
8681
|
+
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
8682
|
|
|
8692
8683
|
var _excluded$v = ["className"];
|
|
8693
8684
|
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 +8738,7 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8747
8738
|
});
|
|
8748
8739
|
}
|
|
8749
8740
|
return visibleItems.length ? jsx("div", {
|
|
8750
|
-
className: clsx(classes$
|
|
8741
|
+
className: clsx(classes$I.group, className),
|
|
8751
8742
|
children: visibleItems.map(function (item) {
|
|
8752
8743
|
switch (item.id) {
|
|
8753
8744
|
case 'bond-common':
|
|
@@ -8778,16 +8769,16 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8778
8769
|
}) : null;
|
|
8779
8770
|
};
|
|
8780
8771
|
return jsxs("div", {
|
|
8781
|
-
className: clsx(classes$
|
|
8772
|
+
className: clsx(classes$I.root, className),
|
|
8782
8773
|
ref: ref,
|
|
8783
8774
|
children: [jsxs("div", {
|
|
8784
|
-
className: classes$
|
|
8775
|
+
className: classes$I.buttons,
|
|
8785
8776
|
ref: scrollRef,
|
|
8786
8777
|
children: [jsx("div", {
|
|
8787
|
-
className: classes$
|
|
8778
|
+
className: classes$I.listener,
|
|
8788
8779
|
ref: startRef,
|
|
8789
8780
|
children: jsx(Group, {
|
|
8790
|
-
className: classes$
|
|
8781
|
+
className: classes$I.groupItem,
|
|
8791
8782
|
items: [{
|
|
8792
8783
|
id: 'hand'
|
|
8793
8784
|
}, {
|
|
@@ -8798,7 +8789,7 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8798
8789
|
}]
|
|
8799
8790
|
})
|
|
8800
8791
|
}), jsx(Group, {
|
|
8801
|
-
className: classes$
|
|
8792
|
+
className: classes$I.groupItem,
|
|
8802
8793
|
items: [{
|
|
8803
8794
|
id: 'bonds',
|
|
8804
8795
|
options: [].concat(_toConsumableArray(bondCommon), _toConsumableArray(bondQuery), _toConsumableArray(bondSpecial), _toConsumableArray(bondStereo))
|
|
@@ -8806,30 +8797,30 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8806
8797
|
id: 'chain'
|
|
8807
8798
|
}]
|
|
8808
8799
|
}), jsx(Group, {
|
|
8809
|
-
className: classes$
|
|
8800
|
+
className: classes$I.groupItem,
|
|
8810
8801
|
items: [{
|
|
8811
8802
|
id: 'enhanced-stereo'
|
|
8812
8803
|
}]
|
|
8813
8804
|
}), jsx(Group, {
|
|
8814
|
-
className: classes$
|
|
8805
|
+
className: classes$I.groupItem,
|
|
8815
8806
|
items: [{
|
|
8816
8807
|
id: 'charge-plus'
|
|
8817
8808
|
}, {
|
|
8818
8809
|
id: 'charge-minus'
|
|
8819
8810
|
}]
|
|
8820
8811
|
}), jsx(Group, {
|
|
8821
|
-
className: classes$
|
|
8812
|
+
className: classes$I.groupItem,
|
|
8822
8813
|
items: [{
|
|
8823
8814
|
id: 'transforms',
|
|
8824
8815
|
options: transformOptions
|
|
8825
8816
|
}]
|
|
8826
8817
|
}), jsx(Group, {
|
|
8827
|
-
className: classes$
|
|
8818
|
+
className: classes$I.groupItem,
|
|
8828
8819
|
items: [{
|
|
8829
8820
|
id: 'sgroup'
|
|
8830
8821
|
}]
|
|
8831
8822
|
}), jsx(Group, {
|
|
8832
|
-
className: classes$
|
|
8823
|
+
className: classes$I.groupItem,
|
|
8833
8824
|
items: [{
|
|
8834
8825
|
id: 'reaction-plus'
|
|
8835
8826
|
}, {
|
|
@@ -8840,17 +8831,17 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8840
8831
|
options: mappingOptions
|
|
8841
8832
|
}]
|
|
8842
8833
|
}), jsx("div", {
|
|
8843
|
-
className: classes$
|
|
8834
|
+
className: classes$I.listener,
|
|
8844
8835
|
ref: sizeRef,
|
|
8845
8836
|
children: jsx(Group, {
|
|
8846
|
-
className: classes$
|
|
8837
|
+
className: classes$I.groupItem,
|
|
8847
8838
|
items: [{
|
|
8848
8839
|
id: 'rgroup',
|
|
8849
8840
|
options: rGroupOptions
|
|
8850
8841
|
}]
|
|
8851
8842
|
})
|
|
8852
8843
|
}), jsx(Group, {
|
|
8853
|
-
className: classes$
|
|
8844
|
+
className: classes$I.groupItem,
|
|
8854
8845
|
items: [{
|
|
8855
8846
|
id: 'shapes',
|
|
8856
8847
|
options: shapeOptions
|
|
@@ -8858,7 +8849,7 @@ var LeftToolbar = function LeftToolbar(props) {
|
|
|
8858
8849
|
}), jsx("div", {
|
|
8859
8850
|
ref: endRef,
|
|
8860
8851
|
children: jsx(Group, {
|
|
8861
|
-
className: classes$
|
|
8852
|
+
className: classes$I.groupItem,
|
|
8862
8853
|
items: [{
|
|
8863
8854
|
id: 'text'
|
|
8864
8855
|
}]
|
|
@@ -8899,7 +8890,7 @@ var mapDispatchToProps$h = function mapDispatchToProps(dispatch) {
|
|
|
8899
8890
|
};
|
|
8900
8891
|
var LeftToolbarContainer = connect(mapStateToProps$i, mapDispatchToProps$h)(LeftToolbar);
|
|
8901
8892
|
|
|
8902
|
-
var classes$
|
|
8893
|
+
var classes$H = {"button-common-styles":"Atom-module_button-common-styles__j3EUJ","scrollbar":"Atom-module_scrollbar__iO-Ni","atom":"Atom-module_atom__g2RUu"};
|
|
8903
8894
|
|
|
8904
8895
|
var _excluded$u = ["el", "shortcut", "selected"];
|
|
8905
8896
|
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 +8902,7 @@ function Atom$1(_ref) {
|
|
|
8911
8902
|
props = _objectWithoutProperties(_ref, _excluded$u);
|
|
8912
8903
|
return jsx("button", _objectSpread$S(_objectSpread$S({
|
|
8913
8904
|
title: shortcut ? "".concat(el.title, " (").concat(shortcut, ")") : el.title,
|
|
8914
|
-
className: clsx(classes$
|
|
8905
|
+
className: clsx(classes$H.atom, {
|
|
8915
8906
|
selected: selected
|
|
8916
8907
|
}),
|
|
8917
8908
|
value: el.number
|
|
@@ -9290,7 +9281,7 @@ var AtomsList = forwardRef(function (props, ref) {
|
|
|
9290
9281
|
});
|
|
9291
9282
|
});
|
|
9292
9283
|
|
|
9293
|
-
var classes$
|
|
9284
|
+
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
9285
|
|
|
9295
9286
|
var _excluded$t = ["className"];
|
|
9296
9287
|
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 +9290,7 @@ var Group = function Group(_ref) {
|
|
|
9299
9290
|
var children = _ref.children,
|
|
9300
9291
|
className = _ref.className;
|
|
9301
9292
|
return jsx("div", {
|
|
9302
|
-
className: clsx(classes$
|
|
9293
|
+
className: clsx(classes$G.group, className),
|
|
9303
9294
|
children: children
|
|
9304
9295
|
});
|
|
9305
9296
|
};
|
|
@@ -9330,12 +9321,12 @@ var RightToolbar = function RightToolbar(props) {
|
|
|
9330
9321
|
scrollRef.current.scrollTop += sizeRef.current.offsetHeight;
|
|
9331
9322
|
};
|
|
9332
9323
|
return jsxs("div", {
|
|
9333
|
-
className: clsx(classes$
|
|
9324
|
+
className: clsx(classes$G.root, className),
|
|
9334
9325
|
children: [jsxs("div", {
|
|
9335
|
-
className: classes$
|
|
9326
|
+
className: classes$G.buttons,
|
|
9336
9327
|
ref: scrollRef,
|
|
9337
9328
|
children: [jsxs(Group, {
|
|
9338
|
-
className: classes$
|
|
9329
|
+
className: classes$G.atomsList,
|
|
9339
9330
|
children: [jsx(AtomsList, {
|
|
9340
9331
|
ref: startRef,
|
|
9341
9332
|
atoms: basicAtoms,
|
|
@@ -10457,12 +10448,14 @@ var AtomTool = function () {
|
|
|
10457
10448
|
}, {
|
|
10458
10449
|
key: "mousemove",
|
|
10459
10450
|
value: function mousemove(event) {
|
|
10460
|
-
this.editor.hoverIcon.show();
|
|
10461
10451
|
var rnd = this.editor.render;
|
|
10462
10452
|
if (!this.dragCtx || !this.dragCtx.item) {
|
|
10453
|
+
this.editor.hoverIcon.show();
|
|
10463
10454
|
this.editor.hoverIcon.updatePosition();
|
|
10464
10455
|
this.editor.hover(this.editor.findItem(event, ['atoms', 'functionalGroups']), null, event);
|
|
10465
10456
|
return;
|
|
10457
|
+
} else {
|
|
10458
|
+
this.editor.hoverIcon.hide();
|
|
10466
10459
|
}
|
|
10467
10460
|
var dragCtx = this.dragCtx;
|
|
10468
10461
|
var ci = this.editor.findItem(event, ['atoms']);
|
|
@@ -10479,7 +10472,7 @@ var AtomTool = function () {
|
|
|
10479
10472
|
});
|
|
10480
10473
|
var newAtomPos = utils.calcNewAtomPos(atom === null || atom === void 0 ? void 0 : atom.pp, rnd.page2obj(event), event.ctrlKey);
|
|
10481
10474
|
if (dragCtx.action) dragCtx.action.perform(rnd.ctab);
|
|
10482
|
-
dragCtx.action = fromBondAddition(rnd.ctab, _classPrivateFieldGet(this, _bondProps), dragCtx.item.id, Object.assign({}, this.atomProps),
|
|
10475
|
+
dragCtx.action = fromBondAddition(rnd.ctab, _classPrivateFieldGet(this, _bondProps), dragCtx.item.id, Object.assign({}, this.atomProps), undefined, newAtomPos)[0];
|
|
10483
10476
|
this.editor.update(dragCtx.action, true);
|
|
10484
10477
|
}
|
|
10485
10478
|
}, {
|
|
@@ -10702,7 +10695,7 @@ var BondTool = function () {
|
|
|
10702
10695
|
var struct = this.editor.render.ctab;
|
|
10703
10696
|
var molecule = struct.molecule;
|
|
10704
10697
|
var functionalGroups = molecule.functionalGroups;
|
|
10705
|
-
var ci = this.editor.findItem(event, ['atoms', 'bonds']);
|
|
10698
|
+
var ci = this.editor.findItem(event, ['atoms', 'bonds', 'functionalGroups']);
|
|
10706
10699
|
var atomResult = [];
|
|
10707
10700
|
var bondResult = [];
|
|
10708
10701
|
var result = [];
|
|
@@ -10755,12 +10748,19 @@ var BondTool = function () {
|
|
|
10755
10748
|
});
|
|
10756
10749
|
return;
|
|
10757
10750
|
}
|
|
10751
|
+
var attachmentAtomId;
|
|
10752
|
+
if ((ci === null || ci === void 0 ? void 0 : ci.map) === 'functionalGroups') {
|
|
10753
|
+
attachmentAtomId = SGroup$1.getAttachmentAtomIdBySGroupId(ci.id, molecule);
|
|
10754
|
+
}
|
|
10758
10755
|
var rnd = this.editor.render;
|
|
10759
10756
|
this.editor.hover(null);
|
|
10760
10757
|
this.editor.selection(null);
|
|
10761
10758
|
this.dragCtx = {
|
|
10762
10759
|
xy0: rnd.page2obj(event),
|
|
10763
|
-
item:
|
|
10760
|
+
item: attachmentAtomId === undefined ? ci : {
|
|
10761
|
+
map: 'atoms',
|
|
10762
|
+
id: attachmentAtomId
|
|
10763
|
+
}
|
|
10764
10764
|
};
|
|
10765
10765
|
if (!this.dragCtx.item)
|
|
10766
10766
|
delete this.dragCtx.item;
|
|
@@ -10785,24 +10785,26 @@ var BondTool = function () {
|
|
|
10785
10785
|
info: degrees + 'º'
|
|
10786
10786
|
});
|
|
10787
10787
|
if (!('item' in dragCtx) || dragCtx.item.map === 'atoms') {
|
|
10788
|
-
var
|
|
10788
|
+
var _endAtom2;
|
|
10789
10789
|
if ('action' in dragCtx) dragCtx.action.perform(rnd.ctab);
|
|
10790
10790
|
var beginAtom;
|
|
10791
10791
|
var endAtom;
|
|
10792
10792
|
var beginPos;
|
|
10793
10793
|
var endPos;
|
|
10794
|
-
var extraNeighbour = [];
|
|
10795
10794
|
if ('item' in dragCtx && dragCtx.item.map === 'atoms') {
|
|
10796
10795
|
beginAtom = dragCtx.item.id;
|
|
10797
10796
|
endAtom = editor.findItem(event, ['atoms'], dragCtx.item);
|
|
10798
10797
|
var closestSGroup = editor.findItem(event, ['functionalGroups']);
|
|
10799
10798
|
if (closestSGroup && FunctionalGroup.isContractedFunctionalGroup(closestSGroup.id, functionalGroups)) {
|
|
10800
|
-
var
|
|
10801
|
-
var
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10799
|
+
var closestAttachmentAtomId = SGroup$1.getAttachmentAtomIdBySGroupId(closestSGroup.id, molecule);
|
|
10800
|
+
var isSaltOrSolvent = closestAttachmentAtomId === undefined;
|
|
10801
|
+
var isBeginFunctionalGroupItself = closestAttachmentAtomId === beginAtom;
|
|
10802
|
+
if (!isSaltOrSolvent && !isBeginFunctionalGroupItself) {
|
|
10803
|
+
endAtom = {
|
|
10804
|
+
id: closestAttachmentAtomId,
|
|
10805
|
+
map: 'atoms'
|
|
10806
|
+
};
|
|
10807
|
+
}
|
|
10806
10808
|
}
|
|
10807
10809
|
var fGroupId = endAtom && FunctionalGroup.findFunctionalGroupByAtom(functionalGroups, endAtom.id);
|
|
10808
10810
|
var fGroup = typeof fGroupId === 'number' && sgroups.get(fGroupId);
|
|
@@ -10813,24 +10815,25 @@ var BondTool = function () {
|
|
|
10813
10815
|
});
|
|
10814
10816
|
endAtom = null;
|
|
10815
10817
|
}
|
|
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
10818
|
} else {
|
|
10819
|
+
var _endAtom;
|
|
10826
10820
|
beginAtom = this.atomProps;
|
|
10827
10821
|
beginPos = dragCtx.xy0;
|
|
10828
|
-
endAtom = editor.findItem(event, ['atoms']);
|
|
10822
|
+
endAtom = editor.findItem(event, ['atoms', 'functionalGroups']);
|
|
10829
10823
|
var atomResult = [];
|
|
10830
10824
|
var result = [];
|
|
10831
10825
|
if (endAtom && endAtom.map === 'atoms' && functionalGroups.size && this.dragCtx) {
|
|
10832
10826
|
var atomId = FunctionalGroup.atomsInFunctionalGroup(functionalGroups, endAtom.id);
|
|
10833
10827
|
if (atomId !== null) atomResult.push(atomId);
|
|
10828
|
+
} else if (((_endAtom = endAtom) === null || _endAtom === void 0 ? void 0 : _endAtom.map) === 'functionalGroups') {
|
|
10829
|
+
var functionalGroup = molecule.functionalGroups.get(endAtom.id);
|
|
10830
|
+
if (!SGroup$1.isSaltOrSolvent((functionalGroup === null || functionalGroup === void 0 ? void 0 : functionalGroup.name) || '')) {
|
|
10831
|
+
var attachmentAtomId = SGroup$1.getAttachmentAtomIdBySGroupId(endAtom.id, molecule);
|
|
10832
|
+
endAtom = attachmentAtomId === undefined ? null : {
|
|
10833
|
+
map: 'atoms',
|
|
10834
|
+
id: attachmentAtomId
|
|
10835
|
+
};
|
|
10836
|
+
}
|
|
10834
10837
|
}
|
|
10835
10838
|
if (atomResult.length > 0) {
|
|
10836
10839
|
var _iterator3 = _createForOfIteratorHelper$a(atomResult),
|
|
@@ -10856,7 +10859,7 @@ var BondTool = function () {
|
|
|
10856
10859
|
}
|
|
10857
10860
|
}
|
|
10858
10861
|
var dist = Number.MAX_VALUE;
|
|
10859
|
-
if (((
|
|
10862
|
+
if (((_endAtom2 = endAtom) === null || _endAtom2 === void 0 ? void 0 : _endAtom2.map) === 'atoms') {
|
|
10860
10863
|
endAtom = endAtom.id;
|
|
10861
10864
|
} else {
|
|
10862
10865
|
endAtom = this.atomProps;
|
|
@@ -10866,7 +10869,7 @@ var BondTool = function () {
|
|
|
10866
10869
|
endPos = utils.calcNewAtomPos(beginPos, xy1, event.ctrlKey);
|
|
10867
10870
|
} else {
|
|
10868
10871
|
var atom = rnd.ctab.molecule.atoms.get(beginAtom);
|
|
10869
|
-
|
|
10872
|
+
endPos = utils.calcNewAtomPos(atom === null || atom === void 0 ? void 0 : atom.pp.get_xy0(), xy1, event.ctrlKey);
|
|
10870
10873
|
}
|
|
10871
10874
|
}
|
|
10872
10875
|
if (dist > 0.3) {
|
|
@@ -10887,7 +10890,7 @@ var BondTool = function () {
|
|
|
10887
10890
|
return true;
|
|
10888
10891
|
}
|
|
10889
10892
|
}
|
|
10890
|
-
this.editor.hover(this.editor.findItem(event, ['atoms', 'bonds']), null, event);
|
|
10893
|
+
this.editor.hover(this.editor.findItem(event, ['atoms', 'bonds', 'functionalGroups']), null, event);
|
|
10891
10894
|
return true;
|
|
10892
10895
|
}
|
|
10893
10896
|
}, {
|
|
@@ -10910,7 +10913,9 @@ var BondTool = function () {
|
|
|
10910
10913
|
}, Vec2.diff(xy, v), Vec2.sum(xy, v));
|
|
10911
10914
|
this.editor.update(bondAddition[0]);
|
|
10912
10915
|
} else if (dragCtx.item.map === 'atoms') {
|
|
10913
|
-
this.editor.update(fromBondAddition(rnd.ctab, this.bondProps, dragCtx.item.id,
|
|
10916
|
+
this.editor.update(fromBondAddition(rnd.ctab, this.bondProps, dragCtx.item.id, {
|
|
10917
|
+
label: 'C'
|
|
10918
|
+
})[0]);
|
|
10914
10919
|
delete this.dragCtx.existedBond;
|
|
10915
10920
|
} else if (dragCtx.item.map === 'bonds') {
|
|
10916
10921
|
var bondProps = Object.assign({}, this.bondProps);
|
|
@@ -10984,7 +10989,7 @@ var ChainTool = function () {
|
|
|
10984
10989
|
var molecule = struct.molecule;
|
|
10985
10990
|
var functionalGroups = molecule.functionalGroups;
|
|
10986
10991
|
var rnd = this.editor.render;
|
|
10987
|
-
var ci = this.editor.findItem(event, ['atoms', 'bonds']);
|
|
10992
|
+
var ci = this.editor.findItem(event, ['atoms', 'bonds', 'functionalGroups']);
|
|
10988
10993
|
var atomResult = [];
|
|
10989
10994
|
var bondResult = [];
|
|
10990
10995
|
var result = [];
|
|
@@ -11052,6 +11057,18 @@ var ChainTool = function () {
|
|
|
11052
11057
|
});
|
|
11053
11058
|
atomLongtapEvent(this, rnd);
|
|
11054
11059
|
}
|
|
11060
|
+
if ((ci === null || ci === void 0 ? void 0 : ci.map) === 'functionalGroups') {
|
|
11061
|
+
var functionalGroup = molecule.functionalGroups.get(ci.id);
|
|
11062
|
+
if (!SGroup$1.isSaltOrSolvent((functionalGroup === null || functionalGroup === void 0 ? void 0 : functionalGroup.name) || '')) {
|
|
11063
|
+
var sGroupId = ci.id;
|
|
11064
|
+
var sGroup = molecule.sgroups.get(sGroupId);
|
|
11065
|
+
var attachmentAtomId = sGroup === null || sGroup === void 0 ? void 0 : sGroup.getAttAtomId(molecule);
|
|
11066
|
+
this.dragCtx.item = {
|
|
11067
|
+
map: 'atoms',
|
|
11068
|
+
id: attachmentAtomId
|
|
11069
|
+
};
|
|
11070
|
+
}
|
|
11071
|
+
}
|
|
11055
11072
|
if (!this.dragCtx.item)
|
|
11056
11073
|
delete this.dragCtx.item;
|
|
11057
11074
|
return true;
|
|
@@ -11062,7 +11079,7 @@ var ChainTool = function () {
|
|
|
11062
11079
|
var editor = this.editor;
|
|
11063
11080
|
var restruct = editor.render.ctab;
|
|
11064
11081
|
var dragCtx = this.dragCtx;
|
|
11065
|
-
editor.hover(this.editor.findItem(event, ['atoms', 'bonds']), null, event);
|
|
11082
|
+
editor.hover(this.editor.findItem(event, ['atoms', 'bonds', 'functionalGroups']), null, event);
|
|
11066
11083
|
if (!dragCtx) {
|
|
11067
11084
|
return true;
|
|
11068
11085
|
}
|
|
@@ -11641,7 +11658,7 @@ var SGroupTool = function () {
|
|
|
11641
11658
|
_iterator2.f();
|
|
11642
11659
|
}
|
|
11643
11660
|
}
|
|
11644
|
-
if (atomFromStruct && FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, false)) {
|
|
11661
|
+
if (atomFromStruct && (FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, false) || SGroup$1.isAtomInContractedSGroup(atomFromStruct, sgroups))) {
|
|
11645
11662
|
var _newSelected$atoms, _newSelected$bonds;
|
|
11646
11663
|
var sgroupAtoms = actualSgroupId !== undefined && SGroup$1.getAtoms(molecule, sgroups.get(actualSgroupId));
|
|
11647
11664
|
var sgroupBonds = actualSgroupId !== undefined && SGroup$1.getBonds(molecule, sgroups.get(actualSgroupId));
|
|
@@ -11703,7 +11720,7 @@ var SGroupTool = function () {
|
|
|
11703
11720
|
var _struct$atoms$get2;
|
|
11704
11721
|
var atomId = FunctionalGroup.atomsInFunctionalGroup(functionalGroups, ci.id);
|
|
11705
11722
|
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)) {
|
|
11723
|
+
if (atomFromStruct && !(FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, true) || SGroup$1.isAtomInContractedSGroup(atomFromStruct, sgroups))) {
|
|
11707
11724
|
atomResult.push(atomId);
|
|
11708
11725
|
}
|
|
11709
11726
|
}
|
|
@@ -11711,7 +11728,7 @@ var SGroupTool = function () {
|
|
|
11711
11728
|
var _struct$bonds$get;
|
|
11712
11729
|
var bondId = FunctionalGroup.bondsInFunctionalGroup(molecule, functionalGroups, ci.id);
|
|
11713
11730
|
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)) {
|
|
11731
|
+
if (bondFromStruct && !(FunctionalGroup.isBondInContractedFunctionalGroup(bondFromStruct, sgroups, functionalGroups) || SGroup$1.isBondInContractedSGroup(bondFromStruct, sgroups))) {
|
|
11715
11732
|
bondResult.push(bondId);
|
|
11716
11733
|
}
|
|
11717
11734
|
}
|
|
@@ -11832,7 +11849,7 @@ var SGroupTool = function () {
|
|
|
11832
11849
|
_iterator7.f();
|
|
11833
11850
|
}
|
|
11834
11851
|
}
|
|
11835
|
-
if (atomFromStruct && FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, true)) {
|
|
11852
|
+
if (atomFromStruct && (FunctionalGroup.isAtomInContractedFunctionalGroup(atomFromStruct, sgroups, functionalGroups, true) || SGroup$1.isAtomInContractedSGroup(atomFromStruct, sgroups))) {
|
|
11836
11853
|
var _struct$sgroups$get, _struct$sgroups$get2, _newSelected$atoms2, _newSelected$bonds2;
|
|
11837
11854
|
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
11855
|
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);
|
|
@@ -12129,8 +12146,16 @@ function dropAndMerge(editor, mergeItems, action) {
|
|
|
12129
12146
|
if (isMerging) {
|
|
12130
12147
|
var expandGroupsAction = getExpandGroupsInMergeAction(editor.render.ctab, mergeItems);
|
|
12131
12148
|
dropItemAction = dropItemAction.mergeWith(expandGroupsAction);
|
|
12149
|
+
if (mergeItems.atomToFunctionalGroup) {
|
|
12150
|
+
var _extractAttachmentAto = extractAttachmentAtom(mergeItems, editor),
|
|
12151
|
+
_extractAttachmentAto2 = _slicedToArray(_extractAttachmentAto, 2),
|
|
12152
|
+
newMergeItems = _extractAttachmentAto2[0],
|
|
12153
|
+
extractAttachmentAtomAction = _extractAttachmentAto2[1];
|
|
12154
|
+
mergeItems = newMergeItems;
|
|
12155
|
+
dropItemAction = dropItemAction.mergeWith(extractAttachmentAtomAction);
|
|
12156
|
+
}
|
|
12157
|
+
dropItemAction = fromItemsFuse(restruct, mergeItems).mergeWith(dropItemAction);
|
|
12132
12158
|
}
|
|
12133
|
-
dropItemAction = fromItemsFuse(restruct, mergeItems).mergeWith(dropItemAction);
|
|
12134
12159
|
if (action) {
|
|
12135
12160
|
dropItemAction = dropItemAction.mergeWith(action);
|
|
12136
12161
|
}
|
|
@@ -12141,6 +12166,7 @@ function dropAndMerge(editor, mergeItems, action) {
|
|
|
12141
12166
|
resizeCanvas: false
|
|
12142
12167
|
});
|
|
12143
12168
|
}
|
|
12169
|
+
return dropItemAction;
|
|
12144
12170
|
}
|
|
12145
12171
|
function getExpandGroupsInMergeAction(restruct, mergeItems) {
|
|
12146
12172
|
var action = new Action();
|
|
@@ -12154,6 +12180,36 @@ function getExpandGroupsInMergeAction(restruct, mergeItems) {
|
|
|
12154
12180
|
}
|
|
12155
12181
|
return action;
|
|
12156
12182
|
}
|
|
12183
|
+
function extractAttachmentAtom(mergeItems, editor) {
|
|
12184
|
+
var _mergeItems$atomToFun;
|
|
12185
|
+
var struct = editor.struct();
|
|
12186
|
+
var reStruct = editor.render.ctab;
|
|
12187
|
+
var newMergeItems = {
|
|
12188
|
+
atoms: new Map(mergeItems.atoms),
|
|
12189
|
+
bonds: new Map(mergeItems.bonds)
|
|
12190
|
+
};
|
|
12191
|
+
var removeNonAttachmentAtoms = new Action();
|
|
12192
|
+
var removeSGroup = new Action();
|
|
12193
|
+
(_mergeItems$atomToFun = mergeItems.atomToFunctionalGroup) === null || _mergeItems$atomToFun === void 0 ? void 0 : _mergeItems$atomToFun.forEach(function (functionalGroupId, srcAtomId) {
|
|
12194
|
+
var sGroup = struct.sgroups.get(functionalGroupId);
|
|
12195
|
+
var attachmentAtomId = sGroup === null || sGroup === void 0 ? void 0 : sGroup.getAttAtomId(struct);
|
|
12196
|
+
if (attachmentAtomId) {
|
|
12197
|
+
var attachmentAtom = struct.atoms.get(attachmentAtomId);
|
|
12198
|
+
if (SGroup$1.isAtomInContractedSGroup(attachmentAtom, struct.sgroups)) {
|
|
12199
|
+
return;
|
|
12200
|
+
}
|
|
12201
|
+
newMergeItems.atoms.set(srcAtomId, attachmentAtomId);
|
|
12202
|
+
removeNonAttachmentAtoms.mergeWith(fromFragmentDeletion(reStruct, {
|
|
12203
|
+
atoms: _toConsumableArray(SGroup$1.getAtoms(struct, sGroup)).filter(function (atomId) {
|
|
12204
|
+
return atomId !== attachmentAtomId;
|
|
12205
|
+
}),
|
|
12206
|
+
bonds: _toConsumableArray(SGroup$1.getBonds(struct, sGroup))
|
|
12207
|
+
}));
|
|
12208
|
+
removeSGroup.mergeWith(fromSgroupDeletion(reStruct, functionalGroupId));
|
|
12209
|
+
}
|
|
12210
|
+
});
|
|
12211
|
+
return [newMergeItems, removeNonAttachmentAtoms];
|
|
12212
|
+
}
|
|
12157
12213
|
|
|
12158
12214
|
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
12215
|
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 +12218,6 @@ function getMergeItems(editor, items) {
|
|
|
12162
12218
|
return getItemsToFuse(editor, nonGroupItemsAndAttachPoints);
|
|
12163
12219
|
}
|
|
12164
12220
|
|
|
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
12221
|
function castAtomPropToType(property, value) {
|
|
12189
12222
|
var typesMapping = {
|
|
12190
12223
|
charge: Number,
|
|
@@ -12196,21 +12229,21 @@ function castAtomPropToType(property, value) {
|
|
|
12196
12229
|
}
|
|
12197
12230
|
return value;
|
|
12198
12231
|
}
|
|
12199
|
-
function updateOnlyChangedProperties(
|
|
12200
|
-
var
|
|
12201
|
-
|
|
12202
|
-
return userChangedAtom[key] !== '';
|
|
12232
|
+
function updateOnlyChangedProperties(unchangedElement, userChangedElement) {
|
|
12233
|
+
var updatedKeys = Object.getOwnPropertyNames(userChangedElement).filter(function (key) {
|
|
12234
|
+
return userChangedElement[key] !== '';
|
|
12203
12235
|
});
|
|
12204
|
-
return Object.getOwnPropertyNames(
|
|
12205
|
-
|
|
12206
|
-
|
|
12207
|
-
updatedAtom[key] = castAtomPropToType(key, userChangedAtom[key]);
|
|
12208
|
-
} else {
|
|
12209
|
-
updatedAtom[key] = unchangedAtom[key];
|
|
12210
|
-
}
|
|
12211
|
-
return updatedAtom;
|
|
12236
|
+
return Object.getOwnPropertyNames(unchangedElement).reduce(function (updatedElement, key) {
|
|
12237
|
+
updatedElement[key] = updatedKeys.includes(key) ? castAtomPropToType(key, userChangedElement[key]) : unchangedElement[key];
|
|
12238
|
+
return updatedElement;
|
|
12212
12239
|
}, {});
|
|
12213
12240
|
}
|
|
12241
|
+
|
|
12242
|
+
function isAtomsArray(selectedElements) {
|
|
12243
|
+
return Array.isArray(selectedElements) && (selectedElements === null || selectedElements === void 0 ? void 0 : selectedElements.every(function (element) {
|
|
12244
|
+
return element instanceof Atom$2;
|
|
12245
|
+
}));
|
|
12246
|
+
}
|
|
12214
12247
|
function updateSelectedAtoms(_ref) {
|
|
12215
12248
|
var atoms = _ref.atoms,
|
|
12216
12249
|
changeAtomPromise = _ref.changeAtomPromise,
|
|
@@ -12221,7 +12254,8 @@ function updateSelectedAtoms(_ref) {
|
|
|
12221
12254
|
if (atoms) {
|
|
12222
12255
|
Promise.resolve(changeAtomPromise).then(function (userChangedAtom) {
|
|
12223
12256
|
atoms.forEach(function (atomId) {
|
|
12224
|
-
var
|
|
12257
|
+
var unchangedAtom = molecule.atoms.get(atomId);
|
|
12258
|
+
var atomWithChangedProperties = updateOnlyChangedProperties(unchangedAtom, userChangedAtom);
|
|
12225
12259
|
action.mergeWith(fromAtomsAttrs(struct, atomId, atomWithChangedProperties, false));
|
|
12226
12260
|
});
|
|
12227
12261
|
editor.update(action);
|
|
@@ -12231,6 +12265,27 @@ function updateSelectedAtoms(_ref) {
|
|
|
12231
12265
|
}
|
|
12232
12266
|
}
|
|
12233
12267
|
|
|
12268
|
+
function updateSelectedBonds(_ref) {
|
|
12269
|
+
var bonds = _ref.bonds,
|
|
12270
|
+
changeBondPromise = _ref.changeBondPromise,
|
|
12271
|
+
editor = _ref.editor;
|
|
12272
|
+
var action = new Action();
|
|
12273
|
+
var struct = editor.render.ctab;
|
|
12274
|
+
var molecule = struct.molecule;
|
|
12275
|
+
if (bonds) {
|
|
12276
|
+
Promise.resolve(changeBondPromise).then(function (userChangedBond) {
|
|
12277
|
+
bonds.forEach(function (bondId) {
|
|
12278
|
+
var unchangedBond = molecule.bonds.get(bondId);
|
|
12279
|
+
var bondWithChangedProperties = updateOnlyChangedProperties(unchangedBond, userChangedBond);
|
|
12280
|
+
action.mergeWith(fromBondsAttrs(struct, bondId, bondWithChangedProperties, false));
|
|
12281
|
+
});
|
|
12282
|
+
editor.update(action);
|
|
12283
|
+
})["catch"](function () {
|
|
12284
|
+
return null;
|
|
12285
|
+
});
|
|
12286
|
+
}
|
|
12287
|
+
}
|
|
12288
|
+
|
|
12234
12289
|
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; } } }; }
|
|
12235
12290
|
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); }
|
|
12236
12291
|
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; }
|
|
@@ -12398,7 +12453,8 @@ var SelectTool = function () {
|
|
|
12398
12453
|
if ((_this$dragCtx = this.dragCtx) !== null && _this$dragCtx !== void 0 && _this$dragCtx.stopTapping) this.dragCtx.stopTapping();
|
|
12399
12454
|
var possibleSaltOrSolvent = struct.sgroups.get(selectedSgroups[selectedSgroups.length - 1]);
|
|
12400
12455
|
var isDraggingSaltOrSolventOnStructure = SGroup$1.isSaltOrSolvent(possibleSaltOrSolvent === null || possibleSaltOrSolvent === void 0 ? void 0 : possibleSaltOrSolvent.item.data.name);
|
|
12401
|
-
|
|
12456
|
+
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);
|
|
12457
|
+
if (this.dragCtx && (isDraggingCustomSgroupOnStructure || isDraggingSaltOrSolventOnStructure || this.isDraggingStructureOnSaltOrSolvent(this.dragCtx, struct.sgroups))) {
|
|
12402
12458
|
preventSaltAndSolventsMerge(struct, this.dragCtx, editor);
|
|
12403
12459
|
delete this.dragCtx;
|
|
12404
12460
|
}
|
|
@@ -12422,7 +12478,6 @@ var SelectTool = function () {
|
|
|
12422
12478
|
var molecule = struct.molecule,
|
|
12423
12479
|
sgroups = struct.sgroups;
|
|
12424
12480
|
var functionalGroups = molecule.functionalGroups;
|
|
12425
|
-
var rnd = editor.render;
|
|
12426
12481
|
var ci = editor.findItem(event, ['atoms', 'bonds', 'sgroups', 'functionalGroups', 'sgroupData', 'texts'], null);
|
|
12427
12482
|
var atomResult = [];
|
|
12428
12483
|
var bondResult = [];
|
|
@@ -12431,7 +12486,7 @@ var SelectTool = function () {
|
|
|
12431
12486
|
var _struct$atoms$get;
|
|
12432
12487
|
var atomId = FunctionalGroup.atomsInFunctionalGroup(functionalGroups, ci.id);
|
|
12433
12488
|
var atomFromStruct = atomId !== null && ((_struct$atoms$get = struct.atoms.get(atomId)) === null || _struct$atoms$get === void 0 ? void 0 : _struct$atoms$get.a);
|
|
12434
|
-
if (
|
|
12489
|
+
if (atomFromStruct && !FunctionalGroup.isAtomInContractedFunctionalGroup(
|
|
12435
12490
|
atomFromStruct, sgroups, functionalGroups, true)) atomResult.push(atomId);
|
|
12436
12491
|
}
|
|
12437
12492
|
if (ci && functionalGroups && ci.map === 'bonds') {
|
|
@@ -12493,21 +12548,13 @@ var SelectTool = function () {
|
|
|
12493
12548
|
changeAtomPromise: changeAtomPromise
|
|
12494
12549
|
});
|
|
12495
12550
|
} else if (ci.map === 'bonds') {
|
|
12496
|
-
var
|
|
12497
|
-
var
|
|
12498
|
-
|
|
12499
|
-
|
|
12500
|
-
|
|
12501
|
-
|
|
12502
|
-
|
|
12503
|
-
bondsSelection.forEach(function (bid) {
|
|
12504
|
-
action.mergeWith(fromBondsAttrs(struct, bid, newbond));
|
|
12505
|
-
});
|
|
12506
|
-
editor.update(action);
|
|
12507
|
-
})["catch"](function () {
|
|
12508
|
-
return null;
|
|
12509
|
-
});
|
|
12510
|
-
}
|
|
12551
|
+
var bonds = getSelectedBonds(selection, molecule);
|
|
12552
|
+
var changeBondPromise = editor.event.bondEdit.dispatch(bonds);
|
|
12553
|
+
updateSelectedBonds({
|
|
12554
|
+
bonds: (selection === null || selection === void 0 ? void 0 : selection.bonds) || [],
|
|
12555
|
+
changeBondPromise: changeBondPromise,
|
|
12556
|
+
editor: editor
|
|
12557
|
+
});
|
|
12511
12558
|
} else if (ci.map === 'sgroups' && !FunctionalGroup.isFunctionalGroup(molecule.sgroups.get(ci.id)) || ci.map === 'sgroupData') {
|
|
12512
12559
|
editor.selection(closestToSel(ci));
|
|
12513
12560
|
SGroupTool.sgroupDialog(editor, ci.id);
|
|
@@ -12642,12 +12689,24 @@ function getSelectedAtoms(selection, molecule) {
|
|
|
12642
12689
|
}
|
|
12643
12690
|
return [];
|
|
12644
12691
|
}
|
|
12692
|
+
function getSelectedBonds(selection, molecule) {
|
|
12693
|
+
if (selection !== null && selection !== void 0 && selection.bonds) {
|
|
12694
|
+
return mapBondIdsToBonds(selection === null || selection === void 0 ? void 0 : selection.bonds, molecule);
|
|
12695
|
+
}
|
|
12696
|
+
return [];
|
|
12697
|
+
}
|
|
12645
12698
|
function mapAtomIdsToAtoms(atomsIds, molecule) {
|
|
12646
12699
|
return atomsIds.map(function (atomId) {
|
|
12647
12700
|
var atomOrReAtom = molecule.atoms.get(atomId);
|
|
12648
12701
|
return atomOrReAtom.a || atomOrReAtom;
|
|
12649
12702
|
});
|
|
12650
12703
|
}
|
|
12704
|
+
function mapBondIdsToBonds(bondsIds, molecule) {
|
|
12705
|
+
return bondsIds.map(function (bondId) {
|
|
12706
|
+
var bondOrReBond = molecule.bonds.get(bondId);
|
|
12707
|
+
return (bondOrReBond === null || bondOrReBond === void 0 ? void 0 : bondOrReBond.b) || bondOrReBond;
|
|
12708
|
+
});
|
|
12709
|
+
}
|
|
12651
12710
|
function uniqArray(dest, add, reversible) {
|
|
12652
12711
|
return add.reduce(function (_, item) {
|
|
12653
12712
|
if (reversible) dest = xor(dest, [item]);else if (!dest.includes(item)) dest.push(item);
|
|
@@ -13193,7 +13252,9 @@ var PasteTool = function () {
|
|
|
13193
13252
|
} else {
|
|
13194
13253
|
var action = this.action;
|
|
13195
13254
|
delete this.action;
|
|
13196
|
-
|
|
13255
|
+
if (!this.isSingleContractedGroup || !this.mergeItems) {
|
|
13256
|
+
this.editor.update(dropAndMerge(this.editor, this.mergeItems, action));
|
|
13257
|
+
}
|
|
13197
13258
|
}
|
|
13198
13259
|
}
|
|
13199
13260
|
}, {
|
|
@@ -14055,6 +14116,47 @@ var TemplateTool = function () {
|
|
|
14055
14116
|
editor.hoverIcon.updatePosition();
|
|
14056
14117
|
}
|
|
14057
14118
|
_createClass(TemplateTool, [{
|
|
14119
|
+
key: "struct",
|
|
14120
|
+
get: function get() {
|
|
14121
|
+
return this.editor.render.ctab.molecule;
|
|
14122
|
+
}
|
|
14123
|
+
}, {
|
|
14124
|
+
key: "functionalGroups",
|
|
14125
|
+
get: function get() {
|
|
14126
|
+
return this.struct.functionalGroups;
|
|
14127
|
+
}
|
|
14128
|
+
}, {
|
|
14129
|
+
key: "isModeFunctionalGroup",
|
|
14130
|
+
get: function get() {
|
|
14131
|
+
return this.mode === MODES.FG;
|
|
14132
|
+
}
|
|
14133
|
+
}, {
|
|
14134
|
+
key: "closestItem",
|
|
14135
|
+
get: function get() {
|
|
14136
|
+
return this.editor.findItem(this.event, ['atoms', 'bonds', 'sgroups', 'functionalGroups']);
|
|
14137
|
+
}
|
|
14138
|
+
}, {
|
|
14139
|
+
key: "isNeedToShowRemoveAbbreviationPopup",
|
|
14140
|
+
get: function get() {
|
|
14141
|
+
var _this$closestItem, _this$functionalGroup;
|
|
14142
|
+
var targetId = this.findKeyOfRelatedGroupId((_this$closestItem = this.closestItem) === null || _this$closestItem === void 0 ? void 0 : _this$closestItem.id);
|
|
14143
|
+
var isTargetExpanded = (_this$functionalGroup = this.functionalGroups.get(targetId)) === null || _this$functionalGroup === void 0 ? void 0 : _this$functionalGroup.isExpanded;
|
|
14144
|
+
var isTargetAtomOrBond = this.targetGroupsIds.length && !this.isModeFunctionalGroup;
|
|
14145
|
+
return Boolean(isTargetExpanded || isTargetAtomOrBond);
|
|
14146
|
+
}
|
|
14147
|
+
}, {
|
|
14148
|
+
key: "findKeyOfRelatedGroupId",
|
|
14149
|
+
value: function findKeyOfRelatedGroupId(clickedClosestItemId) {
|
|
14150
|
+
var targetId;
|
|
14151
|
+
var relatedGroupId = FunctionalGroup.findFunctionalGroupByAtom(this.functionalGroups, clickedClosestItemId);
|
|
14152
|
+
this.functionalGroups.forEach(function (fg, key) {
|
|
14153
|
+
if (fg.relatedSGroupId === relatedGroupId) {
|
|
14154
|
+
targetId = key;
|
|
14155
|
+
}
|
|
14156
|
+
});
|
|
14157
|
+
return targetId;
|
|
14158
|
+
}
|
|
14159
|
+
}, {
|
|
14058
14160
|
key: "showRemoveAbbreviationPopup",
|
|
14059
14161
|
value: function showRemoveAbbreviationPopup() {
|
|
14060
14162
|
var _this = this;
|
|
@@ -14065,77 +14167,68 @@ var TemplateTool = function () {
|
|
|
14065
14167
|
return Promise.resolve();
|
|
14066
14168
|
});
|
|
14067
14169
|
}
|
|
14068
|
-
}, {
|
|
14069
|
-
key: "isModeFunctionalGroup",
|
|
14070
|
-
get: function get() {
|
|
14071
|
-
return this.mode === MODES.FG;
|
|
14072
|
-
}
|
|
14073
14170
|
}, {
|
|
14074
14171
|
key: "mousedown",
|
|
14075
14172
|
value: function () {
|
|
14076
14173
|
var _mousedown = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(event) {
|
|
14077
|
-
var
|
|
14078
|
-
var
|
|
14174
|
+
var _this2 = this;
|
|
14175
|
+
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;
|
|
14079
14176
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
14080
14177
|
while (1) {
|
|
14081
14178
|
switch (_context.prev = _context.next) {
|
|
14082
14179
|
case 0:
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
|
|
14088
|
-
|
|
14089
|
-
}), (closestItem === null || closestItem === void 0 ? void 0 : closestItem.map) === 'bonds' && {
|
|
14090
|
-
bonds: [closestItem.id]
|
|
14180
|
+
this.event = event;
|
|
14181
|
+
if (this.functionalGroups.size) {
|
|
14182
|
+
this.targetGroupsIds = getGroupIdsFromItemArrays(this.struct, _objectSpread$N(_objectSpread$N({}, ((_this$closestItem2 = this.closestItem) === null || _this$closestItem2 === void 0 ? void 0 : _this$closestItem2.map) === 'atoms' && {
|
|
14183
|
+
atoms: [this.closestItem.id]
|
|
14184
|
+
}), ((_this$closestItem3 = this.closestItem) === null || _this$closestItem3 === void 0 ? void 0 : _this$closestItem3.map) === 'bonds' && {
|
|
14185
|
+
bonds: [this.closestItem.id]
|
|
14091
14186
|
}));
|
|
14092
14187
|
if (
|
|
14093
|
-
(closestItem === null ||
|
|
14094
|
-
this.targetGroupsIds.push(closestItem.id);
|
|
14188
|
+
((_this$closestItem4 = this.closestItem) === null || _this$closestItem4 === void 0 ? void 0 : _this$closestItem4.map) === 'functionalGroups' && FunctionalGroup.isContractedFunctionalGroup(this.closestItem.id, this.functionalGroups)) {
|
|
14189
|
+
this.targetGroupsIds.push(this.closestItem.id);
|
|
14095
14190
|
}
|
|
14096
14191
|
}
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
if (!(isTargetAtomOrBond || isTargetExpanded)) {
|
|
14100
|
-
_context.next = 10;
|
|
14192
|
+
if (!this.isNeedToShowRemoveAbbreviationPopup) {
|
|
14193
|
+
_context.next = 6;
|
|
14101
14194
|
break;
|
|
14102
14195
|
}
|
|
14103
|
-
_context.next =
|
|
14196
|
+
_context.next = 5;
|
|
14104
14197
|
return this.showRemoveAbbreviationPopup();
|
|
14105
|
-
case
|
|
14198
|
+
case 5:
|
|
14106
14199
|
return _context.abrupt("return");
|
|
14107
|
-
case
|
|
14200
|
+
case 6:
|
|
14108
14201
|
this.editor.hover(null);
|
|
14109
14202
|
this.dragCtx = {
|
|
14110
|
-
xy0: this.editor.render.page2obj(event),
|
|
14111
|
-
item: this.editor.findItem(event, this.findItems)
|
|
14203
|
+
xy0: this.editor.render.page2obj(this.event),
|
|
14204
|
+
item: this.editor.findItem(this.event, this.findItems)
|
|
14112
14205
|
};
|
|
14113
14206
|
dragCtx = this.dragCtx;
|
|
14114
14207
|
ci = dragCtx.item;
|
|
14115
14208
|
if (!(!ci || this.isSaltOrSolvent)) {
|
|
14116
|
-
_context.next =
|
|
14209
|
+
_context.next = 13;
|
|
14117
14210
|
break;
|
|
14118
14211
|
}
|
|
14119
14212
|
delete dragCtx.item;
|
|
14120
14213
|
return _context.abrupt("return");
|
|
14121
|
-
case
|
|
14214
|
+
case 13:
|
|
14122
14215
|
if (ci.map === 'bonds' && !this.isModeFunctionalGroup) {
|
|
14123
14216
|
xy0 = new Vec2();
|
|
14124
|
-
bond = struct.bonds.get(ci.id);
|
|
14125
|
-
frid = (
|
|
14126
|
-
frIds = struct.getFragmentIds(frid);
|
|
14217
|
+
bond = this.struct.bonds.get(ci.id);
|
|
14218
|
+
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;
|
|
14219
|
+
frIds = this.struct.getFragmentIds(frid);
|
|
14127
14220
|
count = 0;
|
|
14128
|
-
loop = (
|
|
14221
|
+
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;
|
|
14129
14222
|
if (loop && loop < 0) {
|
|
14130
|
-
loop = (
|
|
14223
|
+
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;
|
|
14131
14224
|
}
|
|
14132
14225
|
if (loop && loop >= 0) {
|
|
14133
|
-
loopHbs = (
|
|
14226
|
+
loopHbs = (_this$struct$loops$ge = this.struct.loops.get(loop)) === null || _this$struct$loops$ge === void 0 ? void 0 : _this$struct$loops$ge.hbs;
|
|
14134
14227
|
loopHbs === null || loopHbs === void 0 ? void 0 : loopHbs.forEach(function (hb) {
|
|
14135
|
-
var
|
|
14136
|
-
var halfBondBegin = (
|
|
14228
|
+
var _this2$struct$halfBon;
|
|
14229
|
+
var halfBondBegin = (_this2$struct$halfBon = _this2.struct.halfBonds.get(hb)) === null || _this2$struct$halfBon === void 0 ? void 0 : _this2$struct$halfBon.begin;
|
|
14137
14230
|
if (halfBondBegin) {
|
|
14138
|
-
var hbbAtom = struct.atoms.get(halfBondBegin);
|
|
14231
|
+
var hbbAtom = _this2.struct.atoms.get(halfBondBegin);
|
|
14139
14232
|
if (hbbAtom) {
|
|
14140
14233
|
xy0.add_(hbbAtom.pp);
|
|
14141
14234
|
count++;
|
|
@@ -14144,7 +14237,7 @@ var TemplateTool = function () {
|
|
|
14144
14237
|
});
|
|
14145
14238
|
} else {
|
|
14146
14239
|
frIds.forEach(function (id) {
|
|
14147
|
-
var atomById = struct.atoms.get(id);
|
|
14240
|
+
var atomById = _this2.struct.atoms.get(id);
|
|
14148
14241
|
if (atomById) {
|
|
14149
14242
|
xy0.add_(atomById.pp);
|
|
14150
14243
|
count++;
|
|
@@ -14152,11 +14245,11 @@ var TemplateTool = function () {
|
|
|
14152
14245
|
});
|
|
14153
14246
|
}
|
|
14154
14247
|
dragCtx.v0 = xy0.scaled(1 / count);
|
|
14155
|
-
sign = getSign(struct, bond, dragCtx.v0);
|
|
14248
|
+
sign = getSign(this.struct, bond, dragCtx.v0);
|
|
14156
14249
|
dragCtx.sign1 = sign || 1;
|
|
14157
14250
|
dragCtx.sign2 = this.template.sign;
|
|
14158
14251
|
}
|
|
14159
|
-
case
|
|
14252
|
+
case 14:
|
|
14160
14253
|
case "end":
|
|
14161
14254
|
return _context.stop();
|
|
14162
14255
|
}
|
|
@@ -14181,10 +14274,9 @@ var TemplateTool = function () {
|
|
|
14181
14274
|
var ci = dragCtx.item;
|
|
14182
14275
|
var targetPos = null;
|
|
14183
14276
|
var eventPos = this.editor.render.page2obj(event);
|
|
14184
|
-
var struct = this.editor.render.ctab.molecule;
|
|
14185
14277
|
if (ci && ci.map === 'bonds' && !this.isModeFunctionalGroup) {
|
|
14186
|
-
var bond = struct.bonds.get(ci.id);
|
|
14187
|
-
var sign = getSign(struct, bond, eventPos);
|
|
14278
|
+
var bond = this.struct.bonds.get(ci.id);
|
|
14279
|
+
var sign = getSign(this.struct, bond, eventPos);
|
|
14188
14280
|
if (dragCtx.sign1 * this.template.sign > 0) {
|
|
14189
14281
|
sign = -sign;
|
|
14190
14282
|
}
|
|
@@ -14208,9 +14300,9 @@ var TemplateTool = function () {
|
|
|
14208
14300
|
if (!ci) {
|
|
14209
14301
|
targetPos = dragCtx.xy0;
|
|
14210
14302
|
} else if (ci.map === 'atoms' || ci.map === 'functionalGroups') {
|
|
14211
|
-
var atomId = getTargetAtomId(struct, ci);
|
|
14303
|
+
var atomId = getTargetAtomId(this.struct, ci);
|
|
14212
14304
|
if (atomId !== undefined) {
|
|
14213
|
-
var atom = struct.atoms.get(atomId);
|
|
14305
|
+
var atom = this.struct.atoms.get(atomId);
|
|
14214
14306
|
targetPos = atom === null || atom === void 0 ? void 0 : atom.pp;
|
|
14215
14307
|
if (targetPos) {
|
|
14216
14308
|
extraBond = this.isModeFunctionalGroup ? true : Vec2.dist(targetPos, eventPos) > 1;
|
|
@@ -14250,7 +14342,7 @@ var TemplateTool = function () {
|
|
|
14250
14342
|
action = _fromTemplateOnCanvas2[0];
|
|
14251
14343
|
pasteItems = _fromTemplateOnCanvas2[1];
|
|
14252
14344
|
} else if ((ci === null || ci === void 0 ? void 0 : ci.map) === 'atoms' || (ci === null || ci === void 0 ? void 0 : ci.map) === 'functionalGroups') {
|
|
14253
|
-
var _atomId = getTargetAtomId(struct, ci);
|
|
14345
|
+
var _atomId = getTargetAtomId(this.struct, ci);
|
|
14254
14346
|
var _fromTemplateOnAtom = fromTemplateOnAtom(this.editor.render.ctab, this.template, _atomId, angle, extraBond);
|
|
14255
14347
|
var _fromTemplateOnAtom2 = _slicedToArray(_fromTemplateOnAtom, 2);
|
|
14256
14348
|
action = _fromTemplateOnAtom2[0];
|
|
@@ -14269,7 +14361,7 @@ var TemplateTool = function () {
|
|
|
14269
14361
|
}, {
|
|
14270
14362
|
key: "mouseup",
|
|
14271
14363
|
value: function mouseup(event) {
|
|
14272
|
-
var
|
|
14364
|
+
var _this3 = this,
|
|
14273
14365
|
_ci;
|
|
14274
14366
|
var dragCtx = this.dragCtx;
|
|
14275
14367
|
if (!dragCtx) {
|
|
@@ -14277,9 +14369,7 @@ var TemplateTool = function () {
|
|
|
14277
14369
|
}
|
|
14278
14370
|
delete this.dragCtx;
|
|
14279
14371
|
var restruct = this.editor.render.ctab;
|
|
14280
|
-
var struct = restruct.molecule;
|
|
14281
14372
|
var ci = dragCtx.item;
|
|
14282
|
-
var functionalGroups = struct.functionalGroups;
|
|
14283
14373
|
if (dragCtx.action && ci && ci.map === 'bonds' && !this.isModeFunctionalGroup) {
|
|
14284
14374
|
dragCtx.action.perform(restruct);
|
|
14285
14375
|
var promise = fromTemplateOnBondAction(restruct, this.template, ci.id, this.editor.event, dragCtx.sign1 * dragCtx.sign2 > 0, true);
|
|
@@ -14287,9 +14377,9 @@ var TemplateTool = function () {
|
|
|
14287
14377
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
14288
14378
|
action = _ref2[0],
|
|
14289
14379
|
pasteItems = _ref2[1];
|
|
14290
|
-
var mergeItems = getItemsToFuse(
|
|
14380
|
+
var mergeItems = getItemsToFuse(_this3.editor, pasteItems);
|
|
14291
14381
|
action = fromItemsFuse(restruct, mergeItems).mergeWith(action);
|
|
14292
|
-
|
|
14382
|
+
_this3.editor.update(action);
|
|
14293
14383
|
});
|
|
14294
14384
|
return true;
|
|
14295
14385
|
}
|
|
@@ -14297,14 +14387,14 @@ var TemplateTool = function () {
|
|
|
14297
14387
|
var pasteItems = null;
|
|
14298
14388
|
if (this.isSaltOrSolvent) {
|
|
14299
14389
|
addSaltsAndSolventsOnCanvasWithoutMerge(restruct, this.template, dragCtx, this.editor);
|
|
14390
|
+
this.editor.hover(this.editor.findItem(event, this.findItems), null, event);
|
|
14300
14391
|
return true;
|
|
14301
|
-
} else if (((_ci = ci) === null || _ci === void 0 ? void 0 : _ci.map) === 'functionalGroups' && FunctionalGroup.isContractedFunctionalGroup(ci.id, functionalGroups) && this.isModeFunctionalGroup && this.targetGroupsIds.length) {
|
|
14392
|
+
} else if (((_ci = ci) === null || _ci === void 0 ? void 0 : _ci.map) === 'functionalGroups' && FunctionalGroup.isContractedFunctionalGroup(ci.id, this.functionalGroups) && this.isModeFunctionalGroup && this.targetGroupsIds.length) {
|
|
14302
14393
|
functionalGroupRemoveAction = new Action();
|
|
14303
|
-
var _struct = this.editor.struct();
|
|
14304
14394
|
var _restruct = this.editor.render.ctab;
|
|
14305
|
-
var functionalGroupToReplace =
|
|
14306
|
-
var attachmentAtomId = functionalGroupToReplace.getAttAtomId(
|
|
14307
|
-
var atomsWithoutAttachmentAtom = SGroup$1.getAtoms(
|
|
14395
|
+
var functionalGroupToReplace = this.struct.sgroups.get(ci.id);
|
|
14396
|
+
var attachmentAtomId = functionalGroupToReplace.getAttAtomId(this.struct);
|
|
14397
|
+
var atomsWithoutAttachmentAtom = SGroup$1.getAtoms(this.struct, functionalGroupToReplace).filter(function (id) {
|
|
14308
14398
|
return id !== attachmentAtomId;
|
|
14309
14399
|
});
|
|
14310
14400
|
functionalGroupRemoveAction.mergeWith(fromSgroupDeletion(_restruct, ci.id));
|
|
@@ -14330,10 +14420,10 @@ var TemplateTool = function () {
|
|
|
14330
14420
|
if (degree && degree > 1) {
|
|
14331
14421
|
angle = null;
|
|
14332
14422
|
} else if (degree === 1) {
|
|
14333
|
-
var
|
|
14334
|
-
var atom = struct.atoms.get(ci.id);
|
|
14335
|
-
var neiId = atom && ((
|
|
14336
|
-
var nei = (neiId || neiId === 0) && struct.atoms.get(neiId);
|
|
14423
|
+
var _this$struct$halfBond3;
|
|
14424
|
+
var atom = this.struct.atoms.get(ci.id);
|
|
14425
|
+
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);
|
|
14426
|
+
var nei = (neiId || neiId === 0) && this.struct.atoms.get(neiId);
|
|
14337
14427
|
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);
|
|
14338
14428
|
} else {
|
|
14339
14429
|
angle = 0;
|
|
@@ -14352,10 +14442,10 @@ var TemplateTool = function () {
|
|
|
14352
14442
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
14353
14443
|
action = _ref4[0],
|
|
14354
14444
|
pasteItems = _ref4[1];
|
|
14355
|
-
if (!
|
|
14356
|
-
var mergeItems = getItemsToFuse(
|
|
14445
|
+
if (!_this3.isModeFunctionalGroup) {
|
|
14446
|
+
var mergeItems = getItemsToFuse(_this3.editor, pasteItems);
|
|
14357
14447
|
action = fromItemsFuse(restruct, mergeItems).mergeWith(action);
|
|
14358
|
-
|
|
14448
|
+
_this3.editor.update(action);
|
|
14359
14449
|
}
|
|
14360
14450
|
});
|
|
14361
14451
|
return true;
|
|
@@ -14565,20 +14655,27 @@ function handleHotkeyOverItem(props) {
|
|
|
14565
14655
|
handleDialog(props);
|
|
14566
14656
|
} else if (props.newAction.tool) {
|
|
14567
14657
|
handleTool(props);
|
|
14658
|
+
} else {
|
|
14659
|
+
handleOtherActions(props);
|
|
14568
14660
|
}
|
|
14569
14661
|
}
|
|
14570
|
-
function
|
|
14571
|
-
var
|
|
14572
|
-
|
|
14662
|
+
function handleOtherActions(_ref) {
|
|
14663
|
+
var dispatch = _ref.dispatch,
|
|
14664
|
+
newAction = _ref.newAction;
|
|
14665
|
+
dispatch(onAction(newAction));
|
|
14666
|
+
}
|
|
14667
|
+
function handleEraser(_ref2) {
|
|
14668
|
+
var editor = _ref2.editor,
|
|
14669
|
+
hoveredItem = _ref2.hoveredItem;
|
|
14573
14670
|
var action = fromFragmentDeletion(editor.render.ctab, mapItemsToArrays(hoveredItem));
|
|
14574
14671
|
editor.update(action);
|
|
14575
14672
|
editor.hover(null);
|
|
14576
14673
|
}
|
|
14577
|
-
function handleDialog(
|
|
14578
|
-
var hoveredItem =
|
|
14579
|
-
newAction =
|
|
14580
|
-
editor =
|
|
14581
|
-
dispatch =
|
|
14674
|
+
function handleDialog(_ref3) {
|
|
14675
|
+
var hoveredItem = _ref3.hoveredItem,
|
|
14676
|
+
newAction = _ref3.newAction,
|
|
14677
|
+
editor = _ref3.editor,
|
|
14678
|
+
dispatch = _ref3.dispatch;
|
|
14582
14679
|
var dialogType = Object.keys(hoveredItem)[0];
|
|
14583
14680
|
var dialogHandler = getDialogHandler(dialogType);
|
|
14584
14681
|
var hoveredItemId = hoveredItem[dialogType];
|
|
@@ -14604,11 +14701,11 @@ function getDialogHandler(itemType) {
|
|
|
14604
14701
|
var dialog = dialogs[itemType];
|
|
14605
14702
|
return dialog;
|
|
14606
14703
|
}
|
|
14607
|
-
function handleAtomPropsDialog(
|
|
14608
|
-
var hoveredItemId =
|
|
14609
|
-
newAction =
|
|
14610
|
-
editor =
|
|
14611
|
-
dispatch =
|
|
14704
|
+
function handleAtomPropsDialog(_ref4) {
|
|
14705
|
+
var hoveredItemId = _ref4.hoveredItemId,
|
|
14706
|
+
newAction = _ref4.newAction,
|
|
14707
|
+
editor = _ref4.editor,
|
|
14708
|
+
dispatch = _ref4.dispatch;
|
|
14612
14709
|
var selection = editor.selection();
|
|
14613
14710
|
var atomsSelected = selection === null || selection === void 0 ? void 0 : selection.atoms;
|
|
14614
14711
|
var restruct = editor.render.ctab;
|
|
@@ -14631,11 +14728,11 @@ function handleAtomPropsDialog(_ref3) {
|
|
|
14631
14728
|
});
|
|
14632
14729
|
}
|
|
14633
14730
|
}
|
|
14634
|
-
function handleBondPropsDialog(
|
|
14635
|
-
var hoveredItemId =
|
|
14636
|
-
newAction =
|
|
14637
|
-
editor =
|
|
14638
|
-
dispatch =
|
|
14731
|
+
function handleBondPropsDialog(_ref5) {
|
|
14732
|
+
var hoveredItemId = _ref5.hoveredItemId,
|
|
14733
|
+
newAction = _ref5.newAction,
|
|
14734
|
+
editor = _ref5.editor,
|
|
14735
|
+
dispatch = _ref5.dispatch;
|
|
14639
14736
|
var restruct = editor.render.ctab;
|
|
14640
14737
|
var bondFromStruct = restruct.bonds.get(hoveredItemId);
|
|
14641
14738
|
var convertedBondForModal = fromBond(bondFromStruct === null || bondFromStruct === void 0 ? void 0 : bondFromStruct.b);
|
|
@@ -14646,11 +14743,11 @@ function handleBondPropsDialog(_ref4) {
|
|
|
14646
14743
|
return null;
|
|
14647
14744
|
});
|
|
14648
14745
|
}
|
|
14649
|
-
function handleTool(
|
|
14650
|
-
var hoveredItem =
|
|
14651
|
-
newAction =
|
|
14652
|
-
editor =
|
|
14653
|
-
dispatch =
|
|
14746
|
+
function handleTool(_ref6) {
|
|
14747
|
+
var hoveredItem = _ref6.hoveredItem,
|
|
14748
|
+
newAction = _ref6.newAction,
|
|
14749
|
+
editor = _ref6.editor,
|
|
14750
|
+
dispatch = _ref6.dispatch;
|
|
14654
14751
|
var _loop = function _loop(item) {
|
|
14655
14752
|
var toolHandler = getToolHandler(item, newAction.tool);
|
|
14656
14753
|
var isChangeStructureTool = newAction.tool !== 'hand';
|
|
@@ -14710,13 +14807,13 @@ function getToolHandler(itemType) {
|
|
|
14710
14807
|
rgroupatom: function rgroupatom(props) {
|
|
14711
14808
|
return handleRGroupAtomTool(props);
|
|
14712
14809
|
},
|
|
14713
|
-
sgroup: function sgroup(
|
|
14714
|
-
var editor =
|
|
14715
|
-
hoveredItemId =
|
|
14810
|
+
sgroup: function sgroup(_ref7) {
|
|
14811
|
+
var editor = _ref7.editor,
|
|
14812
|
+
hoveredItemId = _ref7.hoveredItemId;
|
|
14716
14813
|
tools.sgroup.sgroupDialog(editor, hoveredItemId);
|
|
14717
14814
|
},
|
|
14718
|
-
hand: function hand(
|
|
14719
|
-
var dispatch =
|
|
14815
|
+
hand: function hand(_ref8) {
|
|
14816
|
+
var dispatch = _ref8.dispatch;
|
|
14720
14817
|
return dispatch(onAction({
|
|
14721
14818
|
tool: 'hand'
|
|
14722
14819
|
}));
|
|
@@ -14730,26 +14827,28 @@ function getToolHandler(itemType) {
|
|
|
14730
14827
|
}
|
|
14731
14828
|
return items._default[toolName];
|
|
14732
14829
|
}
|
|
14733
|
-
function handleAtomTool(
|
|
14734
|
-
var hoveredItemId = _ref8.hoveredItemId,
|
|
14735
|
-
newAction = _ref8.newAction,
|
|
14736
|
-
editor = _ref8.editor;
|
|
14737
|
-
var atomProps = _objectSpread$M({}, newAction.opts);
|
|
14738
|
-
var updatedAtoms = fromAtomsAttrs(editor.render.ctab, hoveredItemId, atomProps, true);
|
|
14739
|
-
editor.update(updatedAtoms);
|
|
14740
|
-
}
|
|
14741
|
-
function handleBondTool(_ref9) {
|
|
14830
|
+
function handleAtomTool(_ref9) {
|
|
14742
14831
|
var hoveredItemId = _ref9.hoveredItemId,
|
|
14743
14832
|
newAction = _ref9.newAction,
|
|
14744
14833
|
editor = _ref9.editor;
|
|
14745
|
-
var
|
|
14746
|
-
editor.
|
|
14834
|
+
var atomProps = _objectSpread$M({}, newAction.opts);
|
|
14835
|
+
var updatedAtoms = fromAtomsAttrs(editor.render.ctab, hoveredItemId, atomProps, true);
|
|
14836
|
+
editor.update(updatedAtoms);
|
|
14747
14837
|
}
|
|
14748
|
-
function
|
|
14749
|
-
var _editor$render$ctab$a;
|
|
14838
|
+
function handleBondTool(_ref10) {
|
|
14750
14839
|
var hoveredItemId = _ref10.hoveredItemId,
|
|
14751
14840
|
newAction = _ref10.newAction,
|
|
14752
14841
|
editor = _ref10.editor;
|
|
14842
|
+
var newBond = fromBondAddition(editor.render.ctab, newAction.opts, hoveredItemId, {
|
|
14843
|
+
label: 'C'
|
|
14844
|
+
})[0];
|
|
14845
|
+
editor.update(newBond);
|
|
14846
|
+
}
|
|
14847
|
+
function handleChargeTool(_ref11) {
|
|
14848
|
+
var _editor$render$ctab$a;
|
|
14849
|
+
var hoveredItemId = _ref11.hoveredItemId,
|
|
14850
|
+
newAction = _ref11.newAction,
|
|
14851
|
+
editor = _ref11.editor;
|
|
14753
14852
|
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;
|
|
14754
14853
|
if (existingAtom) {
|
|
14755
14854
|
var updatedAtom = fromAtomsAttrs(editor.render.ctab, hoveredItemId, {
|
|
@@ -14769,13 +14868,13 @@ function handleRGroupAtomTool(_x2) {
|
|
|
14769
14868
|
return _handleRGroupAtomTool.apply(this, arguments);
|
|
14770
14869
|
}
|
|
14771
14870
|
function _handleRGroupAtomTool() {
|
|
14772
|
-
_handleRGroupAtomTool = _asyncToGenerator( _regeneratorRuntime.mark(function _callee2(
|
|
14871
|
+
_handleRGroupAtomTool = _asyncToGenerator( _regeneratorRuntime.mark(function _callee2(_ref12) {
|
|
14773
14872
|
var hoveredItemId, editor, struct, atom, rglabel, label, element;
|
|
14774
14873
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
14775
14874
|
while (1) {
|
|
14776
14875
|
switch (_context2.prev = _context2.next) {
|
|
14777
14876
|
case 0:
|
|
14778
|
-
hoveredItemId =
|
|
14877
|
+
hoveredItemId = _ref12.hoveredItemId, editor = _ref12.editor;
|
|
14779
14878
|
struct = editor.render.ctab.molecule;
|
|
14780
14879
|
atom = hoveredItemId || hoveredItemId === 0 ? struct.atoms.get(hoveredItemId) : null;
|
|
14781
14880
|
rglabel = atom ? atom.rglabel : 0;
|
|
@@ -14816,14 +14915,14 @@ function isChangingFunctionalGroup(_x3) {
|
|
|
14816
14915
|
return _isChangingFunctionalGroup.apply(this, arguments);
|
|
14817
14916
|
}
|
|
14818
14917
|
function _isChangingFunctionalGroup() {
|
|
14819
|
-
_isChangingFunctionalGroup = _asyncToGenerator( _regeneratorRuntime.mark(function _callee3(
|
|
14918
|
+
_isChangingFunctionalGroup = _asyncToGenerator( _regeneratorRuntime.mark(function _callee3(_ref13) {
|
|
14820
14919
|
var _editor$render$ctab$a2;
|
|
14821
14920
|
var hoveredItemId, editor, atomResult, result, atom, molecule, functionalGroups, sgroupsOnCanvas, atomId, isFunctionalGroup, _iterator, _step, id, fgId;
|
|
14822
14921
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
14823
14922
|
while (1) {
|
|
14824
14923
|
switch (_context3.prev = _context3.next) {
|
|
14825
14924
|
case 0:
|
|
14826
|
-
hoveredItemId =
|
|
14925
|
+
hoveredItemId = _ref13.hoveredItemId, editor = _ref13.editor;
|
|
14827
14926
|
atomResult = [];
|
|
14828
14927
|
result = [];
|
|
14829
14928
|
atom = (_editor$render$ctab$a2 = editor.render.ctab.atoms.get(hoveredItemId)) === null || _editor$render$ctab$a2 === void 0 ? void 0 : _editor$render$ctab$a2.a;
|
|
@@ -14887,10 +14986,9 @@ function initKeydownListener(element) {
|
|
|
14887
14986
|
});
|
|
14888
14987
|
};
|
|
14889
14988
|
}
|
|
14890
|
-
function removeNotRenderedStruct(actionTool,
|
|
14891
|
-
var
|
|
14892
|
-
|
|
14893
|
-
if (actionTool.tool === 'paste' && code === 'KeyS' && metaKey) {
|
|
14989
|
+
function removeNotRenderedStruct(actionTool, group, dispatch) {
|
|
14990
|
+
var affectedTools = ['paste', 'template'];
|
|
14991
|
+
if (affectedTools.includes(actionTool.tool) && group !== null && group !== void 0 && group.includes('save')) {
|
|
14894
14992
|
var savedSelectedTool = SettingsManager.selectionTool;
|
|
14895
14993
|
dispatch({
|
|
14896
14994
|
type: 'ACTION',
|
|
@@ -14947,7 +15045,7 @@ function keyHandle(dispatch, state, hotKeys, event) {
|
|
|
14947
15045
|
event.preventDefault();
|
|
14948
15046
|
return;
|
|
14949
15047
|
}
|
|
14950
|
-
removeNotRenderedStruct(actionTool,
|
|
15048
|
+
removeNotRenderedStruct(actionTool, group, dispatch);
|
|
14951
15049
|
if (actions.indexOf(actName) === -1) {
|
|
14952
15050
|
var newAction = config[actName].action;
|
|
14953
15051
|
var _hoveredItem = getHoveredItem(render.ctab);
|
|
@@ -15117,7 +15215,7 @@ var mapDispatchToProps$d = function mapDispatchToProps(dispatch) {
|
|
|
15117
15215
|
};
|
|
15118
15216
|
var AppHiddenContainer = connect(null, mapDispatchToProps$d)(AppHidden);
|
|
15119
15217
|
|
|
15120
|
-
var classes$
|
|
15218
|
+
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"};
|
|
15121
15219
|
|
|
15122
15220
|
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"};
|
|
15123
15221
|
|
|
@@ -15376,7 +15474,7 @@ function findClosestBond(restruct, pos, skip, minDist, scale) {
|
|
|
15376
15474
|
if (bid === skipId) return;
|
|
15377
15475
|
var a1 = restruct.atoms.get(bond.b.begin).a;
|
|
15378
15476
|
var a2 = restruct.atoms.get(bond.b.end).a;
|
|
15379
|
-
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups)) return null;
|
|
15477
|
+
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups) || SGroup$1.isBondInContractedSGroup(bond.b, sGroups)) return null;
|
|
15380
15478
|
var mid = Vec2.lc2(a1.pp, 0.5, a2.pp, 0.5);
|
|
15381
15479
|
var cdist = Vec2.dist(pos, mid);
|
|
15382
15480
|
if (cdist < minCDist) {
|
|
@@ -15386,7 +15484,7 @@ function findClosestBond(restruct, pos, skip, minDist, scale) {
|
|
|
15386
15484
|
});
|
|
15387
15485
|
restruct.bonds.forEach(function (bond, bid) {
|
|
15388
15486
|
if (bid === skipId) return;
|
|
15389
|
-
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups)) return null;
|
|
15487
|
+
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups) || SGroup$1.isBondInContractedSGroup(bond.b, sGroups)) return null;
|
|
15390
15488
|
var hb = restruct.molecule.halfBonds.get(bond.b.hb1);
|
|
15391
15489
|
var dir = hb.dir;
|
|
15392
15490
|
var norm = hb.norm;
|
|
@@ -15622,20 +15720,55 @@ function findCloseMerge(restruct, selected) {
|
|
|
15622
15720
|
var bond = struct.bonds.get(bid);
|
|
15623
15721
|
pos.bonds.set(bid, Vec2.lc2(struct.atoms.get(bond.begin).pp, 0.5, struct.atoms.get(bond.end).pp, 0.5));
|
|
15624
15722
|
});
|
|
15625
|
-
var result = {
|
|
15626
|
-
|
|
15627
|
-
|
|
15628
|
-
|
|
15629
|
-
|
|
15630
|
-
|
|
15631
|
-
|
|
15632
|
-
|
|
15633
|
-
|
|
15634
|
-
|
|
15635
|
-
}
|
|
15723
|
+
var result = {
|
|
15724
|
+
atoms: new Map(),
|
|
15725
|
+
atomToFunctionalGroup: new Map()
|
|
15726
|
+
};
|
|
15727
|
+
maps.forEach(function (map) {
|
|
15728
|
+
if (map === 'atoms') {
|
|
15729
|
+
Array.from(pos.atoms.keys()).forEach(function (atomId) {
|
|
15730
|
+
var atomPosition = pos.atoms.get(atomId);
|
|
15731
|
+
mergeAtomToAtom(atomId, restruct, atomPosition, selected, result) || mergeAtomToFunctionalGroup(atomId, restruct, atomPosition, result);
|
|
15732
|
+
});
|
|
15733
|
+
} else {
|
|
15734
|
+
result[map] = Array.from(pos[map].keys()).reduce(function (res, srcId) {
|
|
15735
|
+
var skip = {
|
|
15736
|
+
map: map,
|
|
15737
|
+
id: srcId
|
|
15738
|
+
};
|
|
15739
|
+
var item = findMaps[map](restruct, pos[map].get(srcId), skip, null, scale);
|
|
15740
|
+
if (item && !selected[map].includes(item.id)) {
|
|
15741
|
+
res.set(srcId, item.id);
|
|
15742
|
+
}
|
|
15743
|
+
return res;
|
|
15744
|
+
}, new Map());
|
|
15745
|
+
}
|
|
15636
15746
|
});
|
|
15637
15747
|
return result;
|
|
15638
15748
|
}
|
|
15749
|
+
function mergeAtomToAtom(atomId, restruct, atomPosition, selected, result) {
|
|
15750
|
+
var skip = {
|
|
15751
|
+
map: 'atoms',
|
|
15752
|
+
id: atomId
|
|
15753
|
+
};
|
|
15754
|
+
var closestAtom = findClosestAtom(restruct, atomPosition, skip, null);
|
|
15755
|
+
if (closestAtom && !selected.atoms.includes(closestAtom.id)) {
|
|
15756
|
+
result.atoms.set(atomId, closestAtom.id);
|
|
15757
|
+
return true;
|
|
15758
|
+
}
|
|
15759
|
+
return false;
|
|
15760
|
+
}
|
|
15761
|
+
function mergeAtomToFunctionalGroup(atomId, restruct, atomPosition, result) {
|
|
15762
|
+
if (FunctionalGroup.isAttachmentPointAtom(atomId, restruct.molecule)) {
|
|
15763
|
+
return false;
|
|
15764
|
+
}
|
|
15765
|
+
var closestFunctionalGroup = findClosestFG(restruct, atomPosition, null);
|
|
15766
|
+
if (closestFunctionalGroup) {
|
|
15767
|
+
result.atomToFunctionalGroup.set(atomId, closestFunctionalGroup.id);
|
|
15768
|
+
return true;
|
|
15769
|
+
}
|
|
15770
|
+
return false;
|
|
15771
|
+
}
|
|
15639
15772
|
var closest = {
|
|
15640
15773
|
atom: findClosestAtom,
|
|
15641
15774
|
item: findClosestItem,
|
|
@@ -16514,7 +16647,7 @@ function setHover(ci, visible, render) {
|
|
|
16514
16647
|
return true;
|
|
16515
16648
|
}
|
|
16516
16649
|
|
|
16517
|
-
var classes$
|
|
16650
|
+
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"};
|
|
16518
16651
|
|
|
16519
16652
|
var Cursor = function Cursor(_ref) {
|
|
16520
16653
|
var Icon = _ref.Icon,
|
|
@@ -16776,8 +16909,7 @@ var useBondEdit = function useBondEdit() {
|
|
|
16776
16909
|
getKetcherInstance = _useAppContext.getKetcherInstance;
|
|
16777
16910
|
var handler = useCallback( function () {
|
|
16778
16911
|
var _ref2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(_ref) {
|
|
16779
|
-
var
|
|
16780
|
-
var props, editor, bondIds, bond, newBond;
|
|
16912
|
+
var props, editor, bondIds, molecule, bonds, changeBondPromise;
|
|
16781
16913
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16782
16914
|
while (1) {
|
|
16783
16915
|
switch (_context.prev = _context.next) {
|
|
@@ -16785,24 +16917,29 @@ var useBondEdit = function useBondEdit() {
|
|
|
16785
16917
|
props = _ref.props;
|
|
16786
16918
|
editor = getKetcherInstance().editor;
|
|
16787
16919
|
bondIds = (props === null || props === void 0 ? void 0 : props.bondIds) || [];
|
|
16788
|
-
|
|
16920
|
+
molecule = editor.render.ctab;
|
|
16789
16921
|
_context.prev = 4;
|
|
16790
|
-
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
16794
|
-
|
|
16795
|
-
|
|
16922
|
+
bonds = mapBondIdsToBonds(bondIds, molecule);
|
|
16923
|
+
_context.next = 8;
|
|
16924
|
+
return editor.event.bondEdit.dispatch(bonds);
|
|
16925
|
+
case 8:
|
|
16926
|
+
changeBondPromise = _context.sent;
|
|
16927
|
+
updateSelectedBonds({
|
|
16928
|
+
bonds: bondIds,
|
|
16929
|
+
changeBondPromise: changeBondPromise,
|
|
16930
|
+
editor: editor
|
|
16931
|
+
});
|
|
16932
|
+
_context.next = 15;
|
|
16796
16933
|
break;
|
|
16797
|
-
case
|
|
16798
|
-
_context.prev =
|
|
16934
|
+
case 12:
|
|
16935
|
+
_context.prev = 12;
|
|
16799
16936
|
_context.t0 = _context["catch"](4);
|
|
16800
|
-
case
|
|
16937
|
+
case 15:
|
|
16801
16938
|
case "end":
|
|
16802
16939
|
return _context.stop();
|
|
16803
16940
|
}
|
|
16804
16941
|
}
|
|
16805
|
-
}, _callee, null, [[4,
|
|
16942
|
+
}, _callee, null, [[4, 12]]);
|
|
16806
16943
|
}));
|
|
16807
16944
|
return function (_x) {
|
|
16808
16945
|
return _ref2.apply(this, arguments);
|
|
@@ -17330,7 +17467,7 @@ var StructRender = function (_Component) {
|
|
|
17330
17467
|
return StructRender;
|
|
17331
17468
|
}(Component);
|
|
17332
17469
|
|
|
17333
|
-
var classes$
|
|
17470
|
+
var classes$D = {"infoPanel":"InfoPanel-module_infoPanel__irvZL"};
|
|
17334
17471
|
|
|
17335
17472
|
var X_COORD_INDEX = 0;
|
|
17336
17473
|
var Y_COORD_INDEX = 1;
|
|
@@ -17435,7 +17572,7 @@ var SGroupDataRender = function SGroupDataRender(props) {
|
|
|
17435
17572
|
left: panelCoordinate.x + 'px',
|
|
17436
17573
|
top: panelCoordinate.y + 'px'
|
|
17437
17574
|
},
|
|
17438
|
-
className: clsx(classes$
|
|
17575
|
+
className: clsx(classes$D.infoPanel, className),
|
|
17439
17576
|
children: sGroupData
|
|
17440
17577
|
}) : null;
|
|
17441
17578
|
};
|
|
@@ -17511,11 +17648,9 @@ var InfoPanel = function InfoPanel(props) {
|
|
|
17511
17648
|
var childRef = useRef(null);
|
|
17512
17649
|
var groupName = sGroup === null || sGroup === void 0 ? void 0 : (_sGroup$data = sGroup.data) === null || _sGroup$data === void 0 ? void 0 : _sGroup$data.name;
|
|
17513
17650
|
useEffect(function () {
|
|
17514
|
-
|
|
17515
|
-
|
|
17516
|
-
|
|
17517
|
-
var _sGroup$data3, _sGroup$data4;
|
|
17518
|
-
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));
|
|
17651
|
+
if (!groupStruct && (sGroup === null || sGroup === void 0 ? void 0 : sGroup.type) === 'DAT') {
|
|
17652
|
+
var _sGroup$data2, _sGroup$data3;
|
|
17653
|
+
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));
|
|
17519
17654
|
} else {
|
|
17520
17655
|
setSGroupData(null);
|
|
17521
17656
|
}
|
|
@@ -17539,7 +17674,7 @@ var InfoPanel = function InfoPanel(props) {
|
|
|
17539
17674
|
left: x + 'px',
|
|
17540
17675
|
top: y + 'px'
|
|
17541
17676
|
},
|
|
17542
|
-
className: clsx(classes$
|
|
17677
|
+
className: clsx(classes$D.infoPanel, className),
|
|
17543
17678
|
children: jsx(StructRender, {
|
|
17544
17679
|
struct: molecule,
|
|
17545
17680
|
id: groupName,
|
|
@@ -17656,15 +17791,15 @@ var StructEditor = function (_Component) {
|
|
|
17656
17791
|
} catch (_unused) {
|
|
17657
17792
|
el.innerHTML = msg.info;
|
|
17658
17793
|
}
|
|
17659
|
-
el.classList.add(classes$
|
|
17794
|
+
el.classList.add(classes$E.visible);
|
|
17660
17795
|
} else {
|
|
17661
|
-
el.classList.remove(classes$
|
|
17796
|
+
el.classList.remove(classes$E.visible);
|
|
17662
17797
|
}
|
|
17663
17798
|
});
|
|
17664
17799
|
this.editor.event.cursor.add(function (csr) {
|
|
17665
17800
|
switch (csr.status) {
|
|
17666
17801
|
case 'enable':
|
|
17667
|
-
_this2.editorRef.current.classList.add(classes$
|
|
17802
|
+
_this2.editorRef.current.classList.add(classes$E.enableCursor);
|
|
17668
17803
|
var _this2$editorRef$curr = _this2.editorRef.current.getBoundingClientRect(),
|
|
17669
17804
|
left = _this2$editorRef$curr.left,
|
|
17670
17805
|
top = _this2$editorRef$curr.top,
|
|
@@ -17681,7 +17816,7 @@ var StructEditor = function (_Component) {
|
|
|
17681
17816
|
}
|
|
17682
17817
|
break;
|
|
17683
17818
|
case 'move':
|
|
17684
|
-
_this2.editorRef.current.classList.add(classes$
|
|
17819
|
+
_this2.editorRef.current.classList.add(classes$E.enableCursor);
|
|
17685
17820
|
_this2.setState({
|
|
17686
17821
|
enableCursor: true,
|
|
17687
17822
|
clientX: clientX,
|
|
@@ -17689,19 +17824,19 @@ var StructEditor = function (_Component) {
|
|
|
17689
17824
|
});
|
|
17690
17825
|
break;
|
|
17691
17826
|
case 'disable':
|
|
17692
|
-
_this2.editorRef.current.classList.remove(classes$
|
|
17827
|
+
_this2.editorRef.current.classList.remove(classes$E.enableCursor);
|
|
17693
17828
|
_this2.setState({
|
|
17694
17829
|
enableCursor: false
|
|
17695
17830
|
});
|
|
17696
17831
|
break;
|
|
17697
17832
|
case 'leave':
|
|
17698
|
-
_this2.editorRef.current.classList.remove(classes$
|
|
17833
|
+
_this2.editorRef.current.classList.remove(classes$E.enableCursor);
|
|
17699
17834
|
_this2.setState({
|
|
17700
17835
|
enableCursor: false
|
|
17701
17836
|
});
|
|
17702
17837
|
break;
|
|
17703
17838
|
case 'mouseover':
|
|
17704
|
-
_this2.editorRef.current.classList.add(classes$
|
|
17839
|
+
_this2.editorRef.current.classList.add(classes$E.enableCursor);
|
|
17705
17840
|
_this2.setState({
|
|
17706
17841
|
enableCursor: true
|
|
17707
17842
|
});
|
|
@@ -17754,22 +17889,22 @@ var StructEditor = function (_Component) {
|
|
|
17754
17889
|
_this$state$clientY = _this$state.clientY,
|
|
17755
17890
|
clientY = _this$state$clientY === void 0 ? 0 : _this$state$clientY;
|
|
17756
17891
|
return jsxs(Tag, _objectSpread$B(_objectSpread$B({
|
|
17757
|
-
className: clsx(classes$
|
|
17892
|
+
className: clsx(classes$E.canvas, className)
|
|
17758
17893
|
}, props), {}, {
|
|
17759
17894
|
children: [jsx(ContextMenuTrigger, {
|
|
17760
17895
|
children: jsx("div", {
|
|
17761
17896
|
ref: this.editorRef,
|
|
17762
|
-
className: clsx(classes$
|
|
17897
|
+
className: clsx(classes$E.intermediateCanvas)
|
|
17763
17898
|
})
|
|
17764
17899
|
}), jsx(Cursor, {
|
|
17765
17900
|
Icon: SvgHand,
|
|
17766
17901
|
PressedIcon: SvgCompressedHand,
|
|
17767
17902
|
enableHandTool: this.state.enableCursor
|
|
17768
17903
|
}), jsx("div", {
|
|
17769
|
-
className: classes$
|
|
17904
|
+
className: classes$E.measureLog,
|
|
17770
17905
|
ref: this.logRef
|
|
17771
17906
|
}), indigoVerification && jsx("div", {
|
|
17772
|
-
className: "".concat(classes$
|
|
17907
|
+
className: "".concat(classes$E.spinnerOverlay, " loading-spinner"),
|
|
17773
17908
|
children: jsx(LoadingCircles, {})
|
|
17774
17909
|
}), jsx(InfoPanel$1, {
|
|
17775
17910
|
clientX: clientX,
|
|
@@ -17834,35 +17969,35 @@ function SvgLogo(props) {
|
|
|
17834
17969
|
})))));
|
|
17835
17970
|
}
|
|
17836
17971
|
|
|
17837
|
-
var classes$
|
|
17972
|
+
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"};
|
|
17838
17973
|
|
|
17839
17974
|
function AboutDialog(props) {
|
|
17840
17975
|
var indigoInfo = props.indigoVersion && props.indigoVersion.split('.r');
|
|
17841
17976
|
return jsxs(Dialog, {
|
|
17842
|
-
className: "".concat(classes$
|
|
17977
|
+
className: "".concat(classes$C.about, " ").concat(classes$C.dialog_body),
|
|
17843
17978
|
params: props,
|
|
17844
17979
|
buttons: [jsx("button", {
|
|
17845
17980
|
onClick: props.onOk,
|
|
17846
|
-
className: classes$
|
|
17981
|
+
className: classes$C.okButton,
|
|
17847
17982
|
children: "Ok"
|
|
17848
17983
|
}, "ok")],
|
|
17849
17984
|
children: [jsx("div", {
|
|
17850
|
-
className: classes$
|
|
17985
|
+
className: classes$C.headerContent,
|
|
17851
17986
|
children: jsxs("a", {
|
|
17852
17987
|
href: props.overviewLink,
|
|
17853
17988
|
target: "_blank",
|
|
17854
17989
|
rel: "noopener noreferrer",
|
|
17855
17990
|
children: [jsx(SvgLogo, {}), jsx("span", {
|
|
17856
|
-
className: classes$
|
|
17991
|
+
className: classes$C.title,
|
|
17857
17992
|
children: "Ketcher"
|
|
17858
17993
|
})]
|
|
17859
17994
|
})
|
|
17860
17995
|
}), jsx("div", {
|
|
17861
|
-
className: classes$
|
|
17996
|
+
className: classes$C.body,
|
|
17862
17997
|
children: jsx("div", {
|
|
17863
|
-
className: classes$
|
|
17998
|
+
className: classes$C.verionsInfo,
|
|
17864
17999
|
children: jsxs("dl", {
|
|
17865
|
-
className: classes$
|
|
18000
|
+
className: classes$C.ketcherVersionInfo,
|
|
17866
18001
|
children: [jsx("dt", {
|
|
17867
18002
|
children: jsxs("a", {
|
|
17868
18003
|
href: props.overviewLink,
|
|
@@ -17875,7 +18010,7 @@ function AboutDialog(props) {
|
|
|
17875
18010
|
children: props.date
|
|
17876
18011
|
})]
|
|
17877
18012
|
}), jsxs("div", {
|
|
17878
|
-
className: classes$
|
|
18013
|
+
className: classes$C.infoLinks,
|
|
17879
18014
|
children: [jsx("dt", {
|
|
17880
18015
|
children: jsx("a", {
|
|
17881
18016
|
href: props.feedbackLink,
|
|
@@ -17892,7 +18027,7 @@ function AboutDialog(props) {
|
|
|
17892
18027
|
})
|
|
17893
18028
|
})]
|
|
17894
18029
|
}), jsx("br", {}), jsxs("div", {
|
|
17895
|
-
className: classes$
|
|
18030
|
+
className: classes$C.indigoVersion,
|
|
17896
18031
|
children: [jsxs("a", {
|
|
17897
18032
|
href: "http://lifescience.opensource.epam.com/indigo/",
|
|
17898
18033
|
target: "_blank",
|
|
@@ -17970,7 +18105,7 @@ var ErrorPopover = function ErrorPopover(_ref) {
|
|
|
17970
18105
|
});
|
|
17971
18106
|
};
|
|
17972
18107
|
|
|
17973
|
-
var classes$
|
|
18108
|
+
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"};
|
|
17974
18109
|
|
|
17975
18110
|
var _excluded$o = ["schema", "value", "onChange", "innerRef", "type", "isFocused"],
|
|
17976
18111
|
_excluded2$4 = ["schema", "value", "onChange"],
|
|
@@ -18010,12 +18145,12 @@ function GenericInput(_ref) {
|
|
|
18010
18145
|
value: value !== null && value !== void 0 ? value : '',
|
|
18011
18146
|
onInput: onChange,
|
|
18012
18147
|
onChange: onChange,
|
|
18013
|
-
className: clsx(classes$
|
|
18148
|
+
className: clsx(classes$B.input, classes$B.genericInput),
|
|
18014
18149
|
ref: inputRef
|
|
18015
18150
|
}, props)), type === 'checkbox' && jsx("span", {
|
|
18016
|
-
className: classes$
|
|
18151
|
+
className: classes$B.checkbox
|
|
18017
18152
|
}), type === 'radio' && jsx("span", {
|
|
18018
|
-
className: classes$
|
|
18153
|
+
className: classes$B.radioButton
|
|
18019
18154
|
})]
|
|
18020
18155
|
});
|
|
18021
18156
|
}
|
|
@@ -18046,16 +18181,16 @@ function CheckBox(_ref3) {
|
|
|
18046
18181
|
innerRef = _ref3.innerRef,
|
|
18047
18182
|
rest = _objectWithoutProperties(_ref3, _excluded3$1);
|
|
18048
18183
|
return jsxs("div", {
|
|
18049
|
-
className: classes$
|
|
18184
|
+
className: classes$B.fieldSetItem,
|
|
18050
18185
|
children: [jsx("input", _objectSpread$A({
|
|
18051
18186
|
type: "checkbox",
|
|
18052
18187
|
checked: Boolean(value),
|
|
18053
18188
|
onClick: onChange,
|
|
18054
18189
|
onChange: onChange,
|
|
18055
|
-
className: classes$
|
|
18190
|
+
className: classes$B.input,
|
|
18056
18191
|
ref: innerRef
|
|
18057
18192
|
}, rest)), jsx("span", {
|
|
18058
|
-
className: classes$
|
|
18193
|
+
className: classes$B.checkbox
|
|
18059
18194
|
})]
|
|
18060
18195
|
});
|
|
18061
18196
|
}
|
|
@@ -18076,7 +18211,7 @@ function Select$1(_ref4) {
|
|
|
18076
18211
|
value: value,
|
|
18077
18212
|
name: name,
|
|
18078
18213
|
multiple: multiple,
|
|
18079
|
-
className: clsx(classes$
|
|
18214
|
+
className: clsx(classes$B.select, className),
|
|
18080
18215
|
children: enumSchema(schema, function (title, val) {
|
|
18081
18216
|
return jsx("option", {
|
|
18082
18217
|
value: val,
|
|
@@ -18106,18 +18241,18 @@ function FieldSet(_ref5) {
|
|
|
18106
18241
|
onClick: onSelect,
|
|
18107
18242
|
children: enumSchema(schema, function (title, val) {
|
|
18108
18243
|
return jsx("li", {
|
|
18109
|
-
className: classes$
|
|
18244
|
+
className: classes$B.fieldSetItem,
|
|
18110
18245
|
children: jsxs("label", {
|
|
18111
|
-
className: classes$
|
|
18246
|
+
className: classes$B.fieldSetLabel,
|
|
18112
18247
|
children: [jsx("input", _objectSpread$A({
|
|
18113
18248
|
type: type,
|
|
18114
18249
|
defaultChecked: type === 'radio' ? selected(val, checked) : selected(val, value),
|
|
18115
18250
|
value: _typeof(val) !== 'object' && val,
|
|
18116
|
-
className: classes$
|
|
18251
|
+
className: classes$B.input
|
|
18117
18252
|
}, rest)), type === 'checkbox' && jsx("span", {
|
|
18118
|
-
className: classes$
|
|
18253
|
+
className: classes$B.checkbox
|
|
18119
18254
|
}), type === 'radio' && jsx("span", {
|
|
18120
|
-
className: classes$
|
|
18255
|
+
className: classes$B.radioButton
|
|
18121
18256
|
}), title]
|
|
18122
18257
|
})
|
|
18123
18258
|
}, title);
|
|
@@ -18147,7 +18282,7 @@ function Slider(_ref6) {
|
|
|
18147
18282
|
name = _ref6.name,
|
|
18148
18283
|
rest = _objectWithoutProperties(_ref6, _excluded5$1);
|
|
18149
18284
|
return jsxs("div", {
|
|
18150
|
-
className: classes$
|
|
18285
|
+
className: classes$B.slider,
|
|
18151
18286
|
children: [jsx("input", _objectSpread$A({
|
|
18152
18287
|
type: "checkbox",
|
|
18153
18288
|
checked: value,
|
|
@@ -18334,7 +18469,7 @@ var Select = function Select(_ref2) {
|
|
|
18334
18469
|
});
|
|
18335
18470
|
};
|
|
18336
18471
|
|
|
18337
|
-
var classes$
|
|
18472
|
+
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"};
|
|
18338
18473
|
|
|
18339
18474
|
var _excluded$n = ["schema", "result", "customValid"],
|
|
18340
18475
|
_excluded2$3 = ["labelPos", "title", "children"],
|
|
@@ -18493,13 +18628,13 @@ function Field(props) {
|
|
|
18493
18628
|
}, fieldOpts), rest));
|
|
18494
18629
|
if (labelPos === false) return formField;
|
|
18495
18630
|
return jsxs(Label, {
|
|
18496
|
-
className: clsx(_defineProperty({}, classes$
|
|
18631
|
+
className: clsx(_defineProperty({}, classes$A.dataError, dataError), className),
|
|
18497
18632
|
error: dataError,
|
|
18498
18633
|
title: rest.title || desc.title,
|
|
18499
18634
|
labelPos: labelPos,
|
|
18500
18635
|
tooltip: rest === null || rest === void 0 ? void 0 : rest.tooltip,
|
|
18501
18636
|
children: [jsx("span", {
|
|
18502
|
-
className: classes$
|
|
18637
|
+
className: classes$A.inputWrapper,
|
|
18503
18638
|
onMouseEnter: handlePopoverOpen,
|
|
18504
18639
|
onMouseLeave: handlePopoverClose,
|
|
18505
18640
|
children: formField
|
|
@@ -18606,7 +18741,7 @@ function getErrorsObj(errors) {
|
|
|
18606
18741
|
return errs;
|
|
18607
18742
|
}
|
|
18608
18743
|
|
|
18609
|
-
var classes$
|
|
18744
|
+
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"};
|
|
18610
18745
|
|
|
18611
18746
|
var presetColors = ['#FF4545', '#FFAD31', '#68D442', '#3ACACC', '#4434FF', '#9C9C9C', '#000000'];
|
|
18612
18747
|
var ColorPicker = function ColorPicker(props) {
|
|
@@ -18655,32 +18790,32 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
18655
18790
|
}
|
|
18656
18791
|
};
|
|
18657
18792
|
return jsxs("div", {
|
|
18658
|
-
className: classes$
|
|
18793
|
+
className: classes$z.colorPickerWrapper,
|
|
18659
18794
|
"data-testid": isOpen ? 'color-picker-field-open' : 'color-picker-field',
|
|
18660
18795
|
onClick: function onClick(e) {
|
|
18661
18796
|
return e.preventDefault();
|
|
18662
18797
|
},
|
|
18663
18798
|
children: [jsxs("div", {
|
|
18664
|
-
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$
|
|
18799
|
+
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$z.colorPickerInput, true), _defineProperty(_clsx, classes$z.selectedInput, isOpen), _clsx)),
|
|
18665
18800
|
onClick: handleClick,
|
|
18666
18801
|
children: [jsx("div", {
|
|
18667
|
-
className: classes$
|
|
18802
|
+
className: classes$z.colorPickerPreview,
|
|
18668
18803
|
"data-testid": "color-picker-preview",
|
|
18669
18804
|
style: {
|
|
18670
18805
|
backgroundColor: value
|
|
18671
18806
|
}
|
|
18672
18807
|
}), jsx(Icon, {
|
|
18673
|
-
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$
|
|
18808
|
+
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$z.expandIcon, true), _defineProperty(_clsx2, classes$z.turnedIcon, !isOpen), _clsx2)),
|
|
18674
18809
|
name: "chevron"
|
|
18675
18810
|
})]
|
|
18676
18811
|
}), isOpen && jsxs("div", {
|
|
18677
|
-
className: clsx(classes$
|
|
18812
|
+
className: clsx(classes$z.colorPickerWrap, isPaletteOpen && classes$z.withPalette),
|
|
18678
18813
|
onBlur: handleBlur,
|
|
18679
18814
|
"data-testid": "color-picker-preset",
|
|
18680
18815
|
children: [jsxs("div", {
|
|
18681
|
-
className: classes$
|
|
18816
|
+
className: classes$z.presetColors,
|
|
18682
18817
|
children: [jsx("button", {
|
|
18683
|
-
className: clsx(classes$
|
|
18818
|
+
className: clsx(classes$z.chooseColor, isPaletteOpen && classes$z.clicked),
|
|
18684
18819
|
onClick: handlePaletteOpen,
|
|
18685
18820
|
autoFocus: true,
|
|
18686
18821
|
"data-testid": "color-picker-btn"
|
|
@@ -18692,19 +18827,19 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
18692
18827
|
style: {
|
|
18693
18828
|
backgroundColor: color
|
|
18694
18829
|
},
|
|
18695
|
-
className: classes$
|
|
18830
|
+
className: classes$z.presetColor
|
|
18696
18831
|
}, color);
|
|
18697
18832
|
})]
|
|
18698
18833
|
}), isPaletteOpen && jsxs("div", {
|
|
18699
|
-
className: classes$
|
|
18834
|
+
className: classes$z.colorPicker,
|
|
18700
18835
|
"data-testid": "color-palette",
|
|
18701
18836
|
children: [jsx(HexColorPicker, {
|
|
18702
18837
|
color: value,
|
|
18703
18838
|
onChange: handleChange
|
|
18704
18839
|
}), jsxs("div", {
|
|
18705
|
-
className: classes$
|
|
18840
|
+
className: classes$z.colorContainer,
|
|
18706
18841
|
children: [jsx("span", {
|
|
18707
|
-
className: classes$
|
|
18842
|
+
className: classes$z.hex,
|
|
18708
18843
|
children: "HEX"
|
|
18709
18844
|
}), jsx(HexColorInput, {
|
|
18710
18845
|
"data-testid": "color-picker-input",
|
|
@@ -18798,7 +18933,7 @@ function convertValue(value, measureFrom, measureTo) {
|
|
|
18798
18933
|
return measureTo === 'px' || measureTo === 'pt' ? (value * measureMap[measureFrom] / measureMap[measureTo]).toFixed() - 0 : (value * measureMap[measureFrom] / measureMap[measureTo]).toFixed(3) - 0;
|
|
18799
18934
|
}
|
|
18800
18935
|
|
|
18801
|
-
var classes$
|
|
18936
|
+
var classes$y = {"button-common-styles":"buttons-module_button-common-styles__qWDOz","scrollbar":"buttons-module_scrollbar__SpaVV","openButton":"buttons-module_openButton__wErm9"};
|
|
18802
18937
|
|
|
18803
18938
|
var _excluded$l = ["children", "type", "server", "className"];
|
|
18804
18939
|
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; }
|
|
@@ -18852,7 +18987,7 @@ var OpenButton = function (_Component) {
|
|
|
18852
18987
|
onClick: function onClick() {
|
|
18853
18988
|
return _this2.btn.click();
|
|
18854
18989
|
},
|
|
18855
|
-
className: clsx(classes$
|
|
18990
|
+
className: clsx(classes$y.openButton, className)
|
|
18856
18991
|
}, props), {}, {
|
|
18857
18992
|
children: [jsx("input", {
|
|
18858
18993
|
onChange: function onChange(ev) {
|
|
@@ -18954,7 +19089,7 @@ var fileSaver = function fileSaver(server) {
|
|
|
18954
19089
|
});
|
|
18955
19090
|
};
|
|
18956
19091
|
|
|
18957
|
-
var classes$
|
|
19092
|
+
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"};
|
|
18958
19093
|
|
|
18959
19094
|
var Accordion = function Accordion(_ref) {
|
|
18960
19095
|
var tabs = _ref.tabs,
|
|
@@ -18973,7 +19108,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
18973
19108
|
};
|
|
18974
19109
|
};
|
|
18975
19110
|
return jsx("div", {
|
|
18976
|
-
className: clsx(classes$
|
|
19111
|
+
className: clsx(classes$x.accordionWrapper, className),
|
|
18977
19112
|
children: tabs.map(function (_ref2) {
|
|
18978
19113
|
var _clsx, _clsx2;
|
|
18979
19114
|
var label = _ref2.label,
|
|
@@ -18983,28 +19118,28 @@ var Accordion = function Accordion(_ref) {
|
|
|
18983
19118
|
return jsxs("div", {
|
|
18984
19119
|
children: [jsx("div", {
|
|
18985
19120
|
onClick: handleAccordionChange(label),
|
|
18986
|
-
className: classes$
|
|
19121
|
+
className: classes$x.accordionSummaryWrapper,
|
|
18987
19122
|
children: jsxs("div", {
|
|
18988
|
-
className: classes$
|
|
19123
|
+
className: classes$x.accordionSummary,
|
|
18989
19124
|
children: [jsx(Icon, {
|
|
18990
|
-
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$
|
|
19125
|
+
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$x.expandIcon, true), _defineProperty(_clsx, classes$x.turnedIcon, !shouldGroupBeRended), _clsx)),
|
|
18991
19126
|
name: "chevron"
|
|
18992
19127
|
}), jsxs("div", {
|
|
18993
|
-
className: classes$
|
|
19128
|
+
className: classes$x.groupLabel,
|
|
18994
19129
|
children: [jsx(Icon, {
|
|
18995
19130
|
name: "elements-group",
|
|
18996
|
-
className: classes$
|
|
19131
|
+
className: classes$x.groupIcon
|
|
18997
19132
|
}), jsx("span", {
|
|
18998
19133
|
children: label
|
|
18999
19134
|
})]
|
|
19000
19135
|
}), changedGroups.has(label) && jsx("span", {
|
|
19001
|
-
className: classes$
|
|
19136
|
+
className: classes$x.changeMarker
|
|
19002
19137
|
})]
|
|
19003
19138
|
})
|
|
19004
19139
|
}), jsx("div", {
|
|
19005
|
-
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$
|
|
19140
|
+
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$x.accordionDetailsWrapper, true), _defineProperty(_clsx2, classes$x.hiddenAccordion, !shouldGroupBeRended), _clsx2)),
|
|
19006
19141
|
children: jsx("div", {
|
|
19007
|
-
className: classes$
|
|
19142
|
+
className: classes$x.accordionDetails,
|
|
19008
19143
|
children: content
|
|
19009
19144
|
})
|
|
19010
19145
|
})]
|
|
@@ -19062,7 +19197,7 @@ function SystemFonts(props) {
|
|
|
19062
19197
|
});
|
|
19063
19198
|
}
|
|
19064
19199
|
|
|
19065
|
-
var classes$
|
|
19200
|
+
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"};
|
|
19066
19201
|
|
|
19067
19202
|
var fieldGroups = {
|
|
19068
19203
|
resetToSelect: 'General',
|
|
@@ -19120,15 +19255,15 @@ var HeaderContent$1 = function HeaderContent(_ref) {
|
|
|
19120
19255
|
if (formState.result.init) return isEqual$1(defaultSettings, initState);else return isEqual$1(defaultSettings, formState.result);
|
|
19121
19256
|
};
|
|
19122
19257
|
return jsxs("div", {
|
|
19123
|
-
className: classes$
|
|
19258
|
+
className: classes$w.headerContent,
|
|
19124
19259
|
children: [jsx("span", {
|
|
19125
|
-
className: classes$
|
|
19260
|
+
className: classes$w.title,
|
|
19126
19261
|
children: " Settings"
|
|
19127
19262
|
}), jsx(OpenButton, {
|
|
19128
19263
|
title: "Open from File",
|
|
19129
19264
|
server: server,
|
|
19130
19265
|
onLoad: onOpenFile,
|
|
19131
|
-
className: classes$
|
|
19266
|
+
className: classes$w.button,
|
|
19132
19267
|
children: jsx(Icon, {
|
|
19133
19268
|
name: "open-1"
|
|
19134
19269
|
})
|
|
@@ -19136,14 +19271,14 @@ var HeaderContent$1 = function HeaderContent(_ref) {
|
|
|
19136
19271
|
title: "Save to File",
|
|
19137
19272
|
data: JSON.stringify(formState.result),
|
|
19138
19273
|
filename: "ketcher-settings",
|
|
19139
|
-
className: classes$
|
|
19274
|
+
className: classes$w.button,
|
|
19140
19275
|
children: jsx(Icon, {
|
|
19141
19276
|
name: "save-1"
|
|
19142
19277
|
})
|
|
19143
19278
|
}, "ketcher-settings"), jsx("button", {
|
|
19144
19279
|
title: "Reset",
|
|
19145
19280
|
onClick: onReset,
|
|
19146
|
-
className: classes$
|
|
19281
|
+
className: classes$w.button,
|
|
19147
19282
|
disabled: getIsResetDisabled(),
|
|
19148
19283
|
children: jsx(Icon, {
|
|
19149
19284
|
name: "reset"
|
|
@@ -19302,7 +19437,7 @@ var SettingsDialog = function SettingsDialog(props) {
|
|
|
19302
19437
|
label: '3D Viewer',
|
|
19303
19438
|
content:
|
|
19304
19439
|
jsxs("fieldset", {
|
|
19305
|
-
className: classes$
|
|
19440
|
+
className: classes$w.viewer,
|
|
19306
19441
|
children: [jsx(Field, {
|
|
19307
19442
|
name: "miewMode",
|
|
19308
19443
|
component: Select,
|
|
@@ -19335,7 +19470,7 @@ var SettingsDialog = function SettingsDialog(props) {
|
|
|
19335
19470
|
};
|
|
19336
19471
|
var tabs = [generalTab, stereoTab, atomsTab, bondsTab, serverTab, threeDViewerTab, debuggingTab];
|
|
19337
19472
|
return jsx(Dialog, {
|
|
19338
|
-
className: classes$
|
|
19473
|
+
className: classes$w.settings,
|
|
19339
19474
|
result: function result() {
|
|
19340
19475
|
return formState.result;
|
|
19341
19476
|
},
|
|
@@ -19362,7 +19497,7 @@ var SettingsDialog = function SettingsDialog(props) {
|
|
|
19362
19497
|
}, formState), {}, {
|
|
19363
19498
|
children: jsx(Accordion, {
|
|
19364
19499
|
tabs: tabs,
|
|
19365
|
-
className: classes$
|
|
19500
|
+
className: classes$w.accordion,
|
|
19366
19501
|
changedGroups: changedGroups
|
|
19367
19502
|
})
|
|
19368
19503
|
}))
|
|
@@ -19659,7 +19794,7 @@ function FrozenInput(_ref) {
|
|
|
19659
19794
|
});
|
|
19660
19795
|
}
|
|
19661
19796
|
|
|
19662
|
-
var classes$
|
|
19797
|
+
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"};
|
|
19663
19798
|
|
|
19664
19799
|
var _excluded$i = ["values", "round", "loading", "onAnalyse", "onChangeRound"];
|
|
19665
19800
|
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); }; }
|
|
@@ -19697,7 +19832,7 @@ var AnalyseDialog = function (_Component) {
|
|
|
19697
19832
|
props = _objectWithoutProperties(_this$props, _excluded$i);
|
|
19698
19833
|
return jsx(Dialog, {
|
|
19699
19834
|
title: "Calculated Values",
|
|
19700
|
-
className: classes$
|
|
19835
|
+
className: classes$v.analyse,
|
|
19701
19836
|
withDivider: true,
|
|
19702
19837
|
needMargin: true,
|
|
19703
19838
|
valid: function valid() {
|
|
@@ -19730,9 +19865,9 @@ var AnalyseDialog = function (_Component) {
|
|
|
19730
19865
|
withSelector: false
|
|
19731
19866
|
}].map(function (item) {
|
|
19732
19867
|
return jsxs("li", {
|
|
19733
|
-
className: classes$
|
|
19868
|
+
className: classes$v.contentWrapper,
|
|
19734
19869
|
children: [jsxs("div", {
|
|
19735
|
-
className: classes$
|
|
19870
|
+
className: classes$v.inputWrapper,
|
|
19736
19871
|
children: [jsxs("label", {
|
|
19737
19872
|
children: [item.name, ":"]
|
|
19738
19873
|
}), item.key === 'gross' ? jsx(FormulaInput, {
|
|
@@ -19745,7 +19880,7 @@ var AnalyseDialog = function (_Component) {
|
|
|
19745
19880
|
value: values && !loading ? roundOff(values[item.key], round[item.round]) : 0
|
|
19746
19881
|
})]
|
|
19747
19882
|
}), item.withSelector ? jsxs("div", {
|
|
19748
|
-
className: classes$
|
|
19883
|
+
className: classes$v.selectWrapper,
|
|
19749
19884
|
children: [jsx("span", {
|
|
19750
19885
|
children: "Decimal places"
|
|
19751
19886
|
}), jsx(Select, {
|
|
@@ -19754,7 +19889,7 @@ var AnalyseDialog = function (_Component) {
|
|
|
19754
19889
|
onChange: function onChange(val) {
|
|
19755
19890
|
return onChangeRound(item.round, val);
|
|
19756
19891
|
},
|
|
19757
|
-
className: classes$
|
|
19892
|
+
className: classes$v.select
|
|
19758
19893
|
})]
|
|
19759
19894
|
}) : null]
|
|
19760
19895
|
}, item.key);
|
|
@@ -19789,7 +19924,7 @@ var mapDispatchToProps$9 = function mapDispatchToProps(dispatch) {
|
|
|
19789
19924
|
};
|
|
19790
19925
|
var Analyse = connect(mapStateToProps$c, mapDispatchToProps$9)(AnalyseDialog);
|
|
19791
19926
|
|
|
19792
|
-
var classes$
|
|
19927
|
+
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"};
|
|
19793
19928
|
|
|
19794
19929
|
var DialogActionButton = function DialogActionButton(_ref) {
|
|
19795
19930
|
var clickHandler = _ref.clickHandler,
|
|
@@ -19821,11 +19956,11 @@ function FooterContent$3(_ref) {
|
|
|
19821
19956
|
openHandler = _ref.openHandler,
|
|
19822
19957
|
copyHandler = _ref.copyHandler;
|
|
19823
19958
|
return jsxs("div", {
|
|
19824
|
-
className: classes$
|
|
19959
|
+
className: classes$u.footerContent,
|
|
19825
19960
|
children: [jsxs(OpenButton, {
|
|
19826
19961
|
onLoad: onImage,
|
|
19827
19962
|
type: "image/*",
|
|
19828
|
-
className: classes$
|
|
19963
|
+
className: classes$u.openButton,
|
|
19829
19964
|
children: [jsx(Icon, {
|
|
19830
19965
|
name: "open"
|
|
19831
19966
|
}), jsx("span", {
|
|
@@ -19835,12 +19970,12 @@ function FooterContent$3(_ref) {
|
|
|
19835
19970
|
children: [jsx(DialogActionButton, {
|
|
19836
19971
|
disabled: !structStr,
|
|
19837
19972
|
clickHandler: openHandler,
|
|
19838
|
-
styles: classes$
|
|
19973
|
+
styles: classes$u.secondaryButton,
|
|
19839
19974
|
label: "Open as new Project"
|
|
19840
19975
|
}, "openButton"), jsx(DialogActionButton, {
|
|
19841
19976
|
disabled: !structStr,
|
|
19842
19977
|
clickHandler: copyHandler,
|
|
19843
|
-
styles: classes$
|
|
19978
|
+
styles: classes$u.primaryButton,
|
|
19844
19979
|
label: "Add to Canvas",
|
|
19845
19980
|
title: "Structure will be loaded as fragment and added to Clipboard"
|
|
19846
19981
|
}, "copyButton")]
|
|
@@ -19891,7 +20026,7 @@ function RecognizeDialog(prop) {
|
|
|
19891
20026
|
};
|
|
19892
20027
|
return jsxs(Dialog, {
|
|
19893
20028
|
title: "Import Structure from Image",
|
|
19894
|
-
className: classes$
|
|
20029
|
+
className: classes$u.recognize,
|
|
19895
20030
|
params: _objectSpread$u(_objectSpread$u({}, props), {}, {
|
|
19896
20031
|
onOk: onOk
|
|
19897
20032
|
}),
|
|
@@ -19908,9 +20043,9 @@ function RecognizeDialog(prop) {
|
|
|
19908
20043
|
}),
|
|
19909
20044
|
buttons: [],
|
|
19910
20045
|
children: [jsxs("div", {
|
|
19911
|
-
className: classes$
|
|
20046
|
+
className: classes$u.topBody,
|
|
19912
20047
|
children: [jsxs("label", {
|
|
19913
|
-
className: classes$
|
|
20048
|
+
className: classes$u.imagoVersion,
|
|
19914
20049
|
children: ["Imago version", jsx(Input$1, {
|
|
19915
20050
|
schema: {
|
|
19916
20051
|
"enum": imagoVersions,
|
|
@@ -19927,9 +20062,9 @@ function RecognizeDialog(prop) {
|
|
|
19927
20062
|
children: "Recognized structure preview"
|
|
19928
20063
|
})]
|
|
19929
20064
|
}), jsxs("div", {
|
|
19930
|
-
className: classes$
|
|
20065
|
+
className: classes$u.imagesContainer,
|
|
19931
20066
|
children: [jsxs("div", {
|
|
19932
|
-
className: classes$
|
|
20067
|
+
className: classes$u.picture,
|
|
19933
20068
|
children: [file && isImage(file) && canPreviewImage && jsx("img", {
|
|
19934
20069
|
alt: "",
|
|
19935
20070
|
id: "pic",
|
|
@@ -19938,27 +20073,27 @@ function RecognizeDialog(prop) {
|
|
|
19938
20073
|
setCanPreviewImage(false);
|
|
19939
20074
|
}
|
|
19940
20075
|
}), jsxs("span", {
|
|
19941
|
-
className: classes$
|
|
20076
|
+
className: classes$u.filename,
|
|
19942
20077
|
children: [" ", file ? file.name : null, " "]
|
|
19943
20078
|
}), file && isImage(file) && !canPreviewImage && jsx("div", {
|
|
19944
|
-
className: classes$
|
|
20079
|
+
className: classes$u.messageContainer,
|
|
19945
20080
|
children: jsxs("p", {
|
|
19946
20081
|
children: ["Preview of '", file.type, "' MIME type is not supported by current browser"]
|
|
19947
20082
|
})
|
|
19948
20083
|
}), (!file || !isImage(file) && clearFile()) && jsx("div", {
|
|
19949
|
-
className: classes$
|
|
20084
|
+
className: classes$u.messageContainer,
|
|
19950
20085
|
children: jsx("p", {
|
|
19951
20086
|
children: "Please choose image"
|
|
19952
20087
|
})
|
|
19953
20088
|
})]
|
|
19954
20089
|
}), jsx("div", {
|
|
19955
|
-
className: classes$
|
|
20090
|
+
className: classes$u.output,
|
|
19956
20091
|
children: structStr && (
|
|
19957
20092
|
structStr instanceof Promise || typeof structStr !== 'string' ? jsx("div", {
|
|
19958
|
-
className: classes$
|
|
20093
|
+
className: classes$u.messageContainer,
|
|
19959
20094
|
children: jsx(LoadingCircles, {})
|
|
19960
20095
|
}) : jsx(StructRender, {
|
|
19961
|
-
className: classes$
|
|
20096
|
+
className: classes$u.struct,
|
|
19962
20097
|
struct: structStr
|
|
19963
20098
|
}))
|
|
19964
20099
|
})]
|
|
@@ -20004,7 +20139,7 @@ var mapDispatchToProps$8 = function mapDispatchToProps(dispatch) {
|
|
|
20004
20139
|
};
|
|
20005
20140
|
var Recognize = connect(mapStateToProps$b, mapDispatchToProps$8)(RecognizeDialog);
|
|
20006
20141
|
|
|
20007
|
-
var classes$
|
|
20142
|
+
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"};
|
|
20008
20143
|
|
|
20009
20144
|
var _excluded$g = ["miewOpts", "server", "struct", "onExportCML", "miewTheme"];
|
|
20010
20145
|
var BACKGROUND_COLOR = {
|
|
@@ -20062,7 +20197,7 @@ function createMiewOptions(userOpts) {
|
|
|
20062
20197
|
var CHANGING_WARNING = 'Stereocenters can be changed after the strong 3D rotation';
|
|
20063
20198
|
var FooterContent$2 = function FooterContent() {
|
|
20064
20199
|
return jsx("div", {
|
|
20065
|
-
className: classes$
|
|
20200
|
+
className: classes$t.warning,
|
|
20066
20201
|
children: CHANGING_WARNING
|
|
20067
20202
|
});
|
|
20068
20203
|
};
|
|
@@ -20104,14 +20239,14 @@ var MiewDialog = function MiewDialog(_ref) {
|
|
|
20104
20239
|
params: prop,
|
|
20105
20240
|
buttons: ['Cancel', jsx("button", {
|
|
20106
20241
|
onClick: exportCML,
|
|
20107
|
-
className: classes$
|
|
20242
|
+
className: classes$t.applyButton,
|
|
20108
20243
|
children: "Apply"
|
|
20109
20244
|
}, "apply")],
|
|
20110
20245
|
footerContent: jsx(FooterContent$2, {}),
|
|
20111
|
-
className: classes$
|
|
20246
|
+
className: classes$t.miewDialog,
|
|
20112
20247
|
children: jsx("div", {
|
|
20113
20248
|
children: jsx("div", {
|
|
20114
|
-
className: "".concat(classes$
|
|
20249
|
+
className: "".concat(classes$t.miewContainer, " ").concat(miewTheme === 'dark' ? classes$t.miewDarkTheme : ''),
|
|
20115
20250
|
children: jsx(Viewer, {
|
|
20116
20251
|
onInit: onMiewInit
|
|
20117
20252
|
})
|
|
@@ -20151,7 +20286,7 @@ var ElementNumber = function ElementNumber(props) {
|
|
|
20151
20286
|
});
|
|
20152
20287
|
};
|
|
20153
20288
|
|
|
20154
|
-
var classes$
|
|
20289
|
+
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"};
|
|
20155
20290
|
|
|
20156
20291
|
var _excluded$f = ["formState", "stereoParity", "isMultipleAtoms"];
|
|
20157
20292
|
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; }
|
|
@@ -20211,7 +20346,7 @@ var Atom = function Atom(props) {
|
|
|
20211
20346
|
}, {
|
|
20212
20347
|
groupName: 'Query specific',
|
|
20213
20348
|
component: jsxs("div", {
|
|
20214
|
-
className: classes$
|
|
20349
|
+
className: classes$s.querySpecific,
|
|
20215
20350
|
children: [jsx(Field, {
|
|
20216
20351
|
name: "ringBondCount",
|
|
20217
20352
|
component: Select,
|
|
@@ -20227,13 +20362,13 @@ var Atom = function Atom(props) {
|
|
|
20227
20362
|
}), jsx(Field, {
|
|
20228
20363
|
name: "unsaturatedAtom",
|
|
20229
20364
|
labelPos: "before",
|
|
20230
|
-
className: classes$
|
|
20365
|
+
className: classes$s.checkbox
|
|
20231
20366
|
})]
|
|
20232
20367
|
})
|
|
20233
20368
|
}, {
|
|
20234
20369
|
groupName: 'Reaction flags',
|
|
20235
20370
|
component: jsxs("div", {
|
|
20236
|
-
className: classes$
|
|
20371
|
+
className: classes$s.reactionFlags,
|
|
20237
20372
|
children: [jsx(Field, {
|
|
20238
20373
|
name: "invRet",
|
|
20239
20374
|
component: Select,
|
|
@@ -20241,13 +20376,13 @@ var Atom = function Atom(props) {
|
|
|
20241
20376
|
}), jsx(Field, {
|
|
20242
20377
|
name: "exactChangeFlag",
|
|
20243
20378
|
labelPos: "before",
|
|
20244
|
-
className: classes$
|
|
20379
|
+
className: classes$s.checkbox
|
|
20245
20380
|
})]
|
|
20246
20381
|
})
|
|
20247
20382
|
}];
|
|
20248
20383
|
return jsx(Dialog, {
|
|
20249
20384
|
title: "Atom Properties",
|
|
20250
|
-
className: classes$
|
|
20385
|
+
className: classes$s.atomProps,
|
|
20251
20386
|
result: function result() {
|
|
20252
20387
|
return formState.result;
|
|
20253
20388
|
},
|
|
@@ -20273,7 +20408,7 @@ var Atom = function Atom(props) {
|
|
|
20273
20408
|
init: rest
|
|
20274
20409
|
}, formState), {}, {
|
|
20275
20410
|
children: jsx("div", {
|
|
20276
|
-
className: classes$
|
|
20411
|
+
className: classes$s.accordionWrapper,
|
|
20277
20412
|
children: itemGroups.map(function (_ref) {
|
|
20278
20413
|
var _clsx, _clsx2;
|
|
20279
20414
|
var groupName = _ref.groupName,
|
|
@@ -20282,20 +20417,20 @@ var Atom = function Atom(props) {
|
|
|
20282
20417
|
return jsxs("div", {
|
|
20283
20418
|
children: [jsx("div", {
|
|
20284
20419
|
onClick: handleAccordionChange(groupName),
|
|
20285
|
-
className: classes$
|
|
20420
|
+
className: classes$s.accordionSummaryWrapper,
|
|
20286
20421
|
children: jsxs("div", {
|
|
20287
|
-
className: classes$
|
|
20422
|
+
className: classes$s.accordionSummary,
|
|
20288
20423
|
children: [jsx("span", {
|
|
20289
20424
|
children: groupName
|
|
20290
20425
|
}), jsx(Icon, {
|
|
20291
|
-
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$
|
|
20426
|
+
className: clsx((_clsx = {}, _defineProperty(_clsx, classes$s.expandIcon, true), _defineProperty(_clsx, classes$s.turnedIcon, !shouldGroupBeRended), _clsx)),
|
|
20292
20427
|
name: "chevron"
|
|
20293
20428
|
})]
|
|
20294
20429
|
})
|
|
20295
20430
|
}), jsx("div", {
|
|
20296
|
-
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$
|
|
20431
|
+
className: clsx((_clsx2 = {}, _defineProperty(_clsx2, classes$s.accordionDetailsWrapper, true), _defineProperty(_clsx2, classes$s.hiddenAccordion, !shouldGroupBeRended), _clsx2)),
|
|
20297
20432
|
children: jsx("div", {
|
|
20298
|
-
className: classes$
|
|
20433
|
+
className: classes$s.accordionDetails,
|
|
20299
20434
|
children: component
|
|
20300
20435
|
})
|
|
20301
20436
|
})]
|
|
@@ -20329,7 +20464,7 @@ var mapStateToProps$9 = function mapStateToProps(state) {
|
|
|
20329
20464
|
};
|
|
20330
20465
|
var AtomContainer = connect(mapStateToProps$9)(Atom);
|
|
20331
20466
|
|
|
20332
|
-
var classes$
|
|
20467
|
+
var classes$r = {"attachPoints":"Attach-module_attachPoints__5QEAv"};
|
|
20333
20468
|
|
|
20334
20469
|
var _excluded$e = ["formState"];
|
|
20335
20470
|
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; }
|
|
@@ -20339,7 +20474,7 @@ var AttachPoints = function AttachPoints(props) {
|
|
|
20339
20474
|
rest = _objectWithoutProperties(props, _excluded$e);
|
|
20340
20475
|
return jsx(Dialog, {
|
|
20341
20476
|
title: "Attachment Points",
|
|
20342
|
-
className: classes$
|
|
20477
|
+
className: classes$r.attachPoints,
|
|
20343
20478
|
result: function result() {
|
|
20344
20479
|
return formState.result;
|
|
20345
20480
|
},
|
|
@@ -20372,7 +20507,7 @@ var mapStateToProps$8 = function mapStateToProps(state) {
|
|
|
20372
20507
|
};
|
|
20373
20508
|
var AttachPointsContainer = connect(mapStateToProps$8)(AttachPoints);
|
|
20374
20509
|
|
|
20375
|
-
var classes$
|
|
20510
|
+
var classes$q = {"automap":"Automap-module_automap__531ko"};
|
|
20376
20511
|
|
|
20377
20512
|
var _excluded$d = ["formState"];
|
|
20378
20513
|
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; }
|
|
@@ -20395,7 +20530,7 @@ var Automap = function Automap(props) {
|
|
|
20395
20530
|
rest = _objectWithoutProperties(props, _excluded$d);
|
|
20396
20531
|
return jsx(Dialog, {
|
|
20397
20532
|
title: "Reaction Auto-Mapping",
|
|
20398
|
-
className: classes$
|
|
20533
|
+
className: classes$q.automap,
|
|
20399
20534
|
result: function result() {
|
|
20400
20535
|
return formState.result;
|
|
20401
20536
|
},
|
|
@@ -20436,7 +20571,7 @@ var mapDispatchToProps$6 = function mapDispatchToProps(dispatch, ownProps) {
|
|
|
20436
20571
|
};
|
|
20437
20572
|
var AutomapContainer = connect(mapStateToProps$7, mapDispatchToProps$6)(Automap);
|
|
20438
20573
|
|
|
20439
|
-
var classes$
|
|
20574
|
+
var classes$p = {"bond":"Bond-module_bond__EDfLY"};
|
|
20440
20575
|
|
|
20441
20576
|
var _excluded$c = ["formState"];
|
|
20442
20577
|
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; }
|
|
@@ -20447,7 +20582,7 @@ var Bond = function Bond(props) {
|
|
|
20447
20582
|
var bondProps = bond.properties;
|
|
20448
20583
|
return jsx(Dialog, {
|
|
20449
20584
|
title: "Bond Properties",
|
|
20450
|
-
className: classes$
|
|
20585
|
+
className: classes$p.bond,
|
|
20451
20586
|
result: function result() {
|
|
20452
20587
|
return formState.result;
|
|
20453
20588
|
},
|
|
@@ -20488,7 +20623,7 @@ var mapStateToProps$6 = function mapStateToProps(state) {
|
|
|
20488
20623
|
};
|
|
20489
20624
|
var BondContainer = connect(mapStateToProps$6)(Bond);
|
|
20490
20625
|
|
|
20491
|
-
var classes$
|
|
20626
|
+
var classes$o = {"field":"IfThenSelect-module_field__9YaPA"};
|
|
20492
20627
|
|
|
20493
20628
|
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; }
|
|
20494
20629
|
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; }
|
|
@@ -20511,14 +20646,14 @@ var IfThenSelect = function IfThenSelect(props) {
|
|
|
20511
20646
|
});
|
|
20512
20647
|
return jsx(Field, _objectSpread$p(_objectSpread$p({
|
|
20513
20648
|
schema: desc,
|
|
20514
|
-
className: classes$
|
|
20649
|
+
className: classes$o.field
|
|
20515
20650
|
}, props), {}, {
|
|
20516
20651
|
component: Select,
|
|
20517
20652
|
options: getSelectOptionsFromSchema(desc)
|
|
20518
20653
|
}));
|
|
20519
20654
|
};
|
|
20520
20655
|
|
|
20521
|
-
var classes$
|
|
20656
|
+
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"};
|
|
20522
20657
|
|
|
20523
20658
|
var _excluded$b = ["formState", "label", "rgroupLabels"];
|
|
20524
20659
|
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; }
|
|
@@ -20530,7 +20665,7 @@ var RgroupLogic = function RgroupLogic(props) {
|
|
|
20530
20665
|
rest = _objectWithoutProperties(props, _excluded$b);
|
|
20531
20666
|
return jsx(Dialog, {
|
|
20532
20667
|
title: "R-Group Logic Condition",
|
|
20533
|
-
className: classes$
|
|
20668
|
+
className: classes$n.rgroupLogic,
|
|
20534
20669
|
result: function result() {
|
|
20535
20670
|
return formState.result;
|
|
20536
20671
|
},
|
|
@@ -20557,7 +20692,7 @@ var RgroupLogic = function RgroupLogic(props) {
|
|
|
20557
20692
|
}), jsx(Field, {
|
|
20558
20693
|
name: "resth",
|
|
20559
20694
|
labelPos: "after",
|
|
20560
|
-
className: classes$
|
|
20695
|
+
className: classes$n.resth
|
|
20561
20696
|
}), jsx(IfThenSelect, {
|
|
20562
20697
|
name: "ifthen",
|
|
20563
20698
|
label: label,
|
|
@@ -20580,7 +20715,7 @@ var mapStateToProps$5 = function mapStateToProps(state) {
|
|
|
20580
20715
|
};
|
|
20581
20716
|
var RgroupLogicContainer = connect(mapStateToProps$5)(RgroupLogic);
|
|
20582
20717
|
|
|
20583
|
-
var classes$
|
|
20718
|
+
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"};
|
|
20584
20719
|
|
|
20585
20720
|
var styles$8 = {"analyzingFileWrapper":"AnalyzingFile-module_analyzingFileWrapper__j0Ltf","fileBox":"AnalyzingFile-module_fileBox__ywFIh"};
|
|
20586
20721
|
|
|
@@ -20717,7 +20852,7 @@ var TextEditor = function TextEditor(_ref) {
|
|
|
20717
20852
|
autoFocus = _ref$autoFocus === void 0 ? false : _ref$autoFocus;
|
|
20718
20853
|
return jsx(Fragment, {
|
|
20719
20854
|
children: jsx("textarea", {
|
|
20720
|
-
className: classes$
|
|
20855
|
+
className: classes$m.textareaEditor,
|
|
20721
20856
|
value: structStr,
|
|
20722
20857
|
onChange: function onChange(event) {
|
|
20723
20858
|
return inputHandler(event.target.value);
|
|
@@ -20760,22 +20895,22 @@ var FooterContent$1 = function FooterContent(_ref) {
|
|
|
20760
20895
|
copyHandler = _ref.copyHandler,
|
|
20761
20896
|
onCancel = _ref.onCancel;
|
|
20762
20897
|
return jsxs("div", {
|
|
20763
|
-
className: classes$
|
|
20898
|
+
className: classes$m.footerContent,
|
|
20764
20899
|
children: [jsx("button", {
|
|
20765
20900
|
onClick: onCancel,
|
|
20766
|
-
className: classes$
|
|
20901
|
+
className: classes$m.cancelButton,
|
|
20767
20902
|
children: "Cancel"
|
|
20768
20903
|
}), jsxs("div", {
|
|
20769
|
-
className: classes$
|
|
20904
|
+
className: classes$m.buttonsContainer,
|
|
20770
20905
|
children: [jsx(DialogActionButton, {
|
|
20771
20906
|
disabled: !structStr,
|
|
20772
20907
|
clickHandler: openHandler,
|
|
20773
|
-
styles: classes$
|
|
20908
|
+
styles: classes$m.openButton,
|
|
20774
20909
|
label: "Open as New Project"
|
|
20775
20910
|
}, "openButton"), jsx(DialogActionButton, {
|
|
20776
20911
|
disabled: !structStr,
|
|
20777
20912
|
clickHandler: copyHandler,
|
|
20778
|
-
styles: classes$
|
|
20913
|
+
styles: classes$m.copyButton,
|
|
20779
20914
|
label: "Add to Canvas",
|
|
20780
20915
|
title: "Structure will be loaded as fragment and added to Clipboard"
|
|
20781
20916
|
}, "copyButton")]
|
|
@@ -20849,7 +20984,7 @@ var Open = function Open(props) {
|
|
|
20849
20984
|
}
|
|
20850
20985
|
return jsx(Dialog, {
|
|
20851
20986
|
title: "Open structure",
|
|
20852
|
-
className: classes$
|
|
20987
|
+
className: classes$m.open,
|
|
20853
20988
|
params: rest,
|
|
20854
20989
|
result: function result() {
|
|
20855
20990
|
return null;
|
|
@@ -20973,7 +21108,7 @@ function couldBeSaved(struct, format) {
|
|
|
20973
21108
|
return null;
|
|
20974
21109
|
}
|
|
20975
21110
|
|
|
20976
|
-
var classes$
|
|
21111
|
+
var classes$l = {"tabs":"Tabs-module_tabs__PuztJ","active":"Tabs-module_active__eeyNd"};
|
|
20977
21112
|
|
|
20978
21113
|
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; }
|
|
20979
21114
|
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; }
|
|
@@ -21025,10 +21160,10 @@ var Tabs = function (_Component) {
|
|
|
21025
21160
|
className: className,
|
|
21026
21161
|
tabIndex: tabIndex,
|
|
21027
21162
|
children: jsx("li", {
|
|
21028
|
-
className: classes$
|
|
21163
|
+
className: classes$l.tabs,
|
|
21029
21164
|
children: tabs.map(function (tabPanel, index) {
|
|
21030
21165
|
return jsx("a", {
|
|
21031
|
-
className: clsx(_defineProperty({}, classes$
|
|
21166
|
+
className: clsx(_defineProperty({}, classes$l.active, _this2.state.tabIndex === index)),
|
|
21032
21167
|
onClick: function onClick(ev) {
|
|
21033
21168
|
return _this2.changeTab(ev, index);
|
|
21034
21169
|
},
|
|
@@ -21046,7 +21181,7 @@ var Tabs = function (_Component) {
|
|
|
21046
21181
|
return Tabs;
|
|
21047
21182
|
}(Component);
|
|
21048
21183
|
|
|
21049
|
-
var classes$
|
|
21184
|
+
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"};
|
|
21050
21185
|
|
|
21051
21186
|
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; }
|
|
21052
21187
|
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; }
|
|
@@ -21198,7 +21333,7 @@ var SaveDialog = function (_Component) {
|
|
|
21198
21333
|
tabIndex: 1
|
|
21199
21334
|
}];
|
|
21200
21335
|
return jsxs("div", {
|
|
21201
|
-
className: classes$
|
|
21336
|
+
className: classes$k.formContainer,
|
|
21202
21337
|
children: [jsxs(Form$1, _objectSpread$j(_objectSpread$j({
|
|
21203
21338
|
schema: _this.saveSchema,
|
|
21204
21339
|
init: {
|
|
@@ -21215,7 +21350,7 @@ var SaveDialog = function (_Component) {
|
|
|
21215
21350
|
component: Select
|
|
21216
21351
|
})]
|
|
21217
21352
|
})), jsx(Tabs, {
|
|
21218
|
-
className: classes$
|
|
21353
|
+
className: classes$k.tabs,
|
|
21219
21354
|
captions: tabs,
|
|
21220
21355
|
tabIndex: _this.state.tabIndex,
|
|
21221
21356
|
changeTab: _this.changeTab,
|
|
@@ -21236,13 +21371,13 @@ var SaveDialog = function (_Component) {
|
|
|
21236
21371
|
var isCleanStruct = _this.props.struct.isBlank();
|
|
21237
21372
|
var LoadingState = function LoadingState() {
|
|
21238
21373
|
return jsx("div", {
|
|
21239
|
-
className: classes$
|
|
21374
|
+
className: classes$k.loadingCirclesContainer,
|
|
21240
21375
|
children: jsx(LoadingCircles, {})
|
|
21241
21376
|
});
|
|
21242
21377
|
};
|
|
21243
21378
|
var ImageContent = function ImageContent() {
|
|
21244
21379
|
return jsx("div", {
|
|
21245
|
-
className: classes$
|
|
21380
|
+
className: classes$k.imageContainer,
|
|
21246
21381
|
children: !isCleanStruct && jsx("img", {
|
|
21247
21382
|
src: "data:image/".concat(format, "+xml;base64,").concat(imageSrc),
|
|
21248
21383
|
alt: "".concat(format, " preview")
|
|
@@ -21251,10 +21386,10 @@ var SaveDialog = function (_Component) {
|
|
|
21251
21386
|
};
|
|
21252
21387
|
var BinaryContent = function BinaryContent() {
|
|
21253
21388
|
return jsx("div", {
|
|
21254
|
-
className: classes$
|
|
21389
|
+
className: classes$k.previewBackground,
|
|
21255
21390
|
children: jsx("textarea", {
|
|
21256
21391
|
value: "Can not display binary content",
|
|
21257
|
-
className: classes$
|
|
21392
|
+
className: classes$k.previewArea,
|
|
21258
21393
|
readOnly: true,
|
|
21259
21394
|
ref: _this.textAreaRef
|
|
21260
21395
|
})
|
|
@@ -21262,10 +21397,10 @@ var SaveDialog = function (_Component) {
|
|
|
21262
21397
|
};
|
|
21263
21398
|
var PreviewContent = function PreviewContent() {
|
|
21264
21399
|
return jsx("div", {
|
|
21265
|
-
className: classes$
|
|
21400
|
+
className: classes$k.previewBackground,
|
|
21266
21401
|
children: jsx("textarea", {
|
|
21267
21402
|
value: structStr,
|
|
21268
|
-
className: classes$
|
|
21403
|
+
className: classes$k.previewArea,
|
|
21269
21404
|
readOnly: true,
|
|
21270
21405
|
ref: _this.textAreaRef
|
|
21271
21406
|
})
|
|
@@ -21288,12 +21423,12 @@ var SaveDialog = function (_Component) {
|
|
|
21288
21423
|
var format = _formState$result3.format;
|
|
21289
21424
|
var warnings = _this.getWarnings(format);
|
|
21290
21425
|
return warnings.length ? jsx("div", {
|
|
21291
|
-
className: classes$
|
|
21426
|
+
className: classes$k.warnings,
|
|
21292
21427
|
children: warnings.map(function (warning) {
|
|
21293
21428
|
return jsx("div", {
|
|
21294
|
-
className: classes$
|
|
21429
|
+
className: classes$k.warningsContainer,
|
|
21295
21430
|
children: jsx("span", {
|
|
21296
|
-
className: classes$
|
|
21431
|
+
className: classes$k.warningsArr,
|
|
21297
21432
|
children: warning
|
|
21298
21433
|
})
|
|
21299
21434
|
});
|
|
@@ -21314,7 +21449,7 @@ var SaveDialog = function (_Component) {
|
|
|
21314
21449
|
var savingStruct = _this.isBinaryCdxFormat(format) && !isLoading ? b64toBlob(structStr) : structStr;
|
|
21315
21450
|
var isMoleculeContain = _this.props.struct.atoms.size && _this.props.struct.bonds.size;
|
|
21316
21451
|
var buttons = [jsx("button", {
|
|
21317
|
-
className: classes$
|
|
21452
|
+
className: classes$k.saveTmpl,
|
|
21318
21453
|
disabled: disableControls || isCleanStruct || !isMoleculeContain,
|
|
21319
21454
|
onClick: function onClick() {
|
|
21320
21455
|
return _this.props.onTmplSave(_this.props.struct);
|
|
@@ -21323,7 +21458,7 @@ var SaveDialog = function (_Component) {
|
|
|
21323
21458
|
}, "save-tmpl")];
|
|
21324
21459
|
buttons.push( jsx("button", {
|
|
21325
21460
|
mode: "onCancel",
|
|
21326
|
-
className: classes$
|
|
21461
|
+
className: classes$k.cancel,
|
|
21327
21462
|
onClick: function onClick() {
|
|
21328
21463
|
return _this.props.onOk({});
|
|
21329
21464
|
},
|
|
@@ -21339,7 +21474,7 @@ var SaveDialog = function (_Component) {
|
|
|
21339
21474
|
type: "image/".concat(format, "+xml"),
|
|
21340
21475
|
onSave: _this.props.onOk,
|
|
21341
21476
|
disabled: disableControls || !formState.valid || isCleanStruct || !_this.props.server,
|
|
21342
|
-
className: classes$
|
|
21477
|
+
className: classes$k.ok,
|
|
21343
21478
|
children: "Save"
|
|
21344
21479
|
}, "save-image-button"));
|
|
21345
21480
|
} else {
|
|
@@ -21351,7 +21486,7 @@ var SaveDialog = function (_Component) {
|
|
|
21351
21486
|
server: _this.props.server,
|
|
21352
21487
|
onSave: _this.props.onOk,
|
|
21353
21488
|
disabled: disableControls || !formState.valid || isCleanStruct,
|
|
21354
|
-
className: classes$
|
|
21489
|
+
className: classes$k.ok,
|
|
21355
21490
|
children: "Save"
|
|
21356
21491
|
}, "save-file-button"));
|
|
21357
21492
|
}
|
|
@@ -21395,7 +21530,7 @@ var SaveDialog = function (_Component) {
|
|
|
21395
21530
|
key: "render",
|
|
21396
21531
|
value: function render() {
|
|
21397
21532
|
return jsx(Dialog, {
|
|
21398
|
-
className: classes$
|
|
21533
|
+
className: classes$k.dialog,
|
|
21399
21534
|
title: "Save Structure",
|
|
21400
21535
|
params: this.props,
|
|
21401
21536
|
buttons: this.getButtons(),
|
|
@@ -21434,7 +21569,7 @@ var mapDispatchToProps$4 = function mapDispatchToProps(dispatch) {
|
|
|
21434
21569
|
};
|
|
21435
21570
|
var Save = connect(mapStateToProps$3, mapDispatchToProps$4)(SaveDialog);
|
|
21436
21571
|
|
|
21437
|
-
var classes$
|
|
21572
|
+
var classes$j = {"enhancedStereo":"enhancedStereo-module_enhancedStereo__8FLSY","stereoLabelItem":"enhancedStereo-module_stereoLabelItem__lEf-0","labelGroupSelect":"enhancedStereo-module_labelGroupSelect__K7TYC"};
|
|
21438
21573
|
|
|
21439
21574
|
var _excluded$8 = ["struct", "formState", "init"];
|
|
21440
21575
|
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; }
|
|
@@ -21466,7 +21601,7 @@ var EnhancedStereo = function EnhancedStereo(props) {
|
|
|
21466
21601
|
};
|
|
21467
21602
|
return jsx(Dialog, {
|
|
21468
21603
|
title: "Enhanced Stereochemistry",
|
|
21469
|
-
className: classes$
|
|
21604
|
+
className: classes$j.enhancedStereo,
|
|
21470
21605
|
params: rest,
|
|
21471
21606
|
result: function result() {
|
|
21472
21607
|
return _result;
|
|
@@ -21503,7 +21638,7 @@ var EnhancedStereo = function EnhancedStereo(props) {
|
|
|
21503
21638
|
name: "andNumber",
|
|
21504
21639
|
schema: range$1(1, maxAnd + 1),
|
|
21505
21640
|
type: "text",
|
|
21506
|
-
className: classes$
|
|
21641
|
+
className: classes$j.labelGroupSelect
|
|
21507
21642
|
}), "Group"]
|
|
21508
21643
|
}), maxOr !== 0 && jsxs("label", {
|
|
21509
21644
|
children: [jsx(Field, {
|
|
@@ -21516,7 +21651,7 @@ var EnhancedStereo = function EnhancedStereo(props) {
|
|
|
21516
21651
|
name: "orNumber",
|
|
21517
21652
|
schema: range$1(1, maxOr + 1),
|
|
21518
21653
|
type: "text",
|
|
21519
|
-
className: classes$
|
|
21654
|
+
className: classes$j.labelGroupSelect
|
|
21520
21655
|
}), "Group"]
|
|
21521
21656
|
}), jsxs("label", {
|
|
21522
21657
|
children: [jsx(Field, {
|
|
@@ -21661,7 +21796,7 @@ var LabelEdit$1 = connect(function (store) {
|
|
|
21661
21796
|
};
|
|
21662
21797
|
})(LabelEdit);
|
|
21663
21798
|
|
|
21664
|
-
var classes$
|
|
21799
|
+
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"};
|
|
21665
21800
|
|
|
21666
21801
|
function AtomInfo(_ref) {
|
|
21667
21802
|
var el = _ref.el,
|
|
@@ -21676,7 +21811,7 @@ function AtomInfo(_ref) {
|
|
|
21676
21811
|
fontSize: '18px'
|
|
21677
21812
|
};
|
|
21678
21813
|
return jsxs("div", {
|
|
21679
|
-
className: clsx(classes$
|
|
21814
|
+
className: clsx(classes$i.ket_atom_info, !isInfo && classes$i.none),
|
|
21680
21815
|
children: [jsx("div", {
|
|
21681
21816
|
style: numberStyle,
|
|
21682
21817
|
children: el.number
|
|
@@ -21909,13 +22044,35 @@ var VerticalBoxWithLines = function VerticalBoxWithLines() {
|
|
|
21909
22044
|
});
|
|
21910
22045
|
};
|
|
21911
22046
|
|
|
21912
|
-
var classes$
|
|
22047
|
+
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"};
|
|
21913
22048
|
|
|
21914
22049
|
var isGenericGroup = function isGenericGroup(group) {
|
|
21915
22050
|
var cyclicGroups = ['Acyclic', 'Cyclic', 'Acyclic Carbo', 'Cyclic Carbo', 'Acyclic Hetero', 'Cyclic Hetero'];
|
|
21916
22051
|
return cyclicGroups.includes(group);
|
|
21917
22052
|
};
|
|
21918
22053
|
|
|
22054
|
+
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"};
|
|
22055
|
+
|
|
22056
|
+
var ButtonGenSet = function ButtonGenSet(_ref) {
|
|
22057
|
+
var button = _ref.button,
|
|
22058
|
+
onAtomSelect = _ref.onAtomSelect,
|
|
22059
|
+
selected = _ref.selected,
|
|
22060
|
+
disabled = _ref.disabled;
|
|
22061
|
+
var titleText = disabled ? "".concat(button.label, " is disabled") : button.description || button.label;
|
|
22062
|
+
return jsx("button", {
|
|
22063
|
+
onClick: function onClick() {
|
|
22064
|
+
return onAtomSelect(button.label, false);
|
|
22065
|
+
},
|
|
22066
|
+
onDoubleClick: function onDoubleClick() {
|
|
22067
|
+
return onAtomSelect(button.label, true);
|
|
22068
|
+
},
|
|
22069
|
+
title: titleText,
|
|
22070
|
+
disabled: disabled,
|
|
22071
|
+
className: clsx(_defineProperty({}, classes$g.selected, selected(button.label)), classes$g.button),
|
|
22072
|
+
children: button.label
|
|
22073
|
+
});
|
|
22074
|
+
};
|
|
22075
|
+
|
|
21919
22076
|
var getGroupClassName = function getGroupClassName(groupName) {
|
|
21920
22077
|
return groupName.replaceAll(' ', '');
|
|
21921
22078
|
};
|
|
@@ -21924,7 +22081,8 @@ function GenSet(_ref) {
|
|
|
21924
22081
|
selected = _ref.selected,
|
|
21925
22082
|
onAtomSelect = _ref.onAtomSelect,
|
|
21926
22083
|
className = _ref.className,
|
|
21927
|
-
group = _ref.group
|
|
22084
|
+
group = _ref.group,
|
|
22085
|
+
disabledQueryElements = _ref.disabledQueryElements;
|
|
21928
22086
|
return jsx(Fragment, {
|
|
21929
22087
|
children: labels.map(function (item, index) {
|
|
21930
22088
|
var buttons = item.items;
|
|
@@ -21932,29 +22090,24 @@ function GenSet(_ref) {
|
|
|
21932
22090
|
return jsxs("fieldset", {
|
|
21933
22091
|
className: className,
|
|
21934
22092
|
children: [jsx("div", {
|
|
21935
|
-
className: classes$
|
|
22093
|
+
className: classes$h[getGroupClassName(group)],
|
|
21936
22094
|
children: buttons.map(function (button, index) {
|
|
21937
|
-
return jsx(
|
|
21938
|
-
|
|
21939
|
-
|
|
21940
|
-
|
|
21941
|
-
|
|
21942
|
-
return onAtomSelect(button.label, true);
|
|
21943
|
-
},
|
|
21944
|
-
title: button.description || button.label,
|
|
21945
|
-
className: clsx(_defineProperty({}, classes$g.selected, selected(button.label)), classes$g.button),
|
|
21946
|
-
children: button.label
|
|
22095
|
+
return jsx(ButtonGenSet, {
|
|
22096
|
+
button: button,
|
|
22097
|
+
onAtomSelect: onAtomSelect,
|
|
22098
|
+
selected: selected,
|
|
22099
|
+
disabled: Boolean(disabledQueryElements === null || disabledQueryElements === void 0 ? void 0 : disabledQueryElements.includes(button.label))
|
|
21947
22100
|
}, index);
|
|
21948
22101
|
})
|
|
21949
22102
|
}), !isGenericGroup(group) && caption && jsx("div", {
|
|
21950
|
-
className: classes$
|
|
22103
|
+
className: classes$h.legendBox,
|
|
21951
22104
|
children: jsx("legend", {
|
|
21952
22105
|
children: caption
|
|
21953
22106
|
})
|
|
21954
22107
|
}), isGenericGroup(group) && caption && jsx("div", {
|
|
21955
|
-
className: classes$
|
|
22108
|
+
className: classes$h.genGroupLegendBox,
|
|
21956
22109
|
children: jsx("legend", {
|
|
21957
|
-
className: classes$
|
|
22110
|
+
className: classes$h.genGroupLegend,
|
|
21958
22111
|
children: caption
|
|
21959
22112
|
})
|
|
21960
22113
|
})]
|
|
@@ -21973,7 +22126,8 @@ var getLegendClassname = function getLegendClassname(title) {
|
|
|
21973
22126
|
var GenGroup = function GenGroup(_ref) {
|
|
21974
22127
|
var group = _ref.group,
|
|
21975
22128
|
onAtomSelect = _ref.onAtomSelect,
|
|
21976
|
-
selected = _ref.selected
|
|
22129
|
+
selected = _ref.selected,
|
|
22130
|
+
disabledQueryElements = _ref.disabledQueryElements;
|
|
21977
22131
|
return jsx("div", {
|
|
21978
22132
|
className: styles$2.fieldFlexWrapper,
|
|
21979
22133
|
children: jsxs("fieldset", {
|
|
@@ -21988,7 +22142,8 @@ var GenGroup = function GenGroup(_ref) {
|
|
|
21988
22142
|
selected: selected,
|
|
21989
22143
|
onAtomSelect: onAtomSelect,
|
|
21990
22144
|
className: styles$2.subGroup,
|
|
21991
|
-
group: group.title
|
|
22145
|
+
group: group.title,
|
|
22146
|
+
disabledQueryElements: disabledQueryElements
|
|
21992
22147
|
})
|
|
21993
22148
|
})]
|
|
21994
22149
|
})
|
|
@@ -22011,36 +22166,38 @@ var getGenericsGroupsMap = function getGenericsGroupsMap(tree) {
|
|
|
22011
22166
|
}
|
|
22012
22167
|
return newGroups;
|
|
22013
22168
|
};
|
|
22014
|
-
var renderGenGroupComponent = function renderGenGroupComponent(group, selected, onAtomSelect) {
|
|
22169
|
+
var renderGenGroupComponent = function renderGenGroupComponent(group, selected, onAtomSelect, disabledQueryElements) {
|
|
22015
22170
|
return jsx(GenGroup, {
|
|
22016
22171
|
group: groupsMap[group],
|
|
22017
22172
|
selected: selected,
|
|
22018
|
-
onAtomSelect: onAtomSelect
|
|
22173
|
+
onAtomSelect: onAtomSelect,
|
|
22174
|
+
disabledQueryElements: disabledQueryElements
|
|
22019
22175
|
});
|
|
22020
22176
|
};
|
|
22021
22177
|
var groupsMap = getGenericsGroupsMap(Generics);
|
|
22022
22178
|
function GenericGroups(_ref) {
|
|
22023
22179
|
var selected = _ref.selected,
|
|
22024
|
-
onAtomSelect = _ref.onAtomSelect
|
|
22180
|
+
onAtomSelect = _ref.onAtomSelect,
|
|
22181
|
+
disabledQueryElements = _ref.disabledQueryElements;
|
|
22025
22182
|
return jsxs("div", {
|
|
22026
22183
|
className: classes$f.genericGroups,
|
|
22027
22184
|
children: [jsxs("div", {
|
|
22028
22185
|
className: classes$f.topGroupsContainer,
|
|
22029
|
-
children: [renderGenGroupComponent(groupNames.atomsGen, selected, onAtomSelect), renderGenGroupComponent(groupNames.specialNodes, selected, onAtomSelect)]
|
|
22030
|
-
}), renderGenGroupComponent(groupNames.groupGen, selected, onAtomSelect), jsx(HorizontalBoxWithLines, {}), jsxs("div", {
|
|
22186
|
+
children: [renderGenGroupComponent(groupNames.atomsGen, selected, onAtomSelect, disabledQueryElements), renderGenGroupComponent(groupNames.specialNodes, selected, onAtomSelect, disabledQueryElements)]
|
|
22187
|
+
}), renderGenGroupComponent(groupNames.groupGen, selected, onAtomSelect, disabledQueryElements), jsx(HorizontalBoxWithLines, {}), jsxs("div", {
|
|
22031
22188
|
className: classes$f.groupGenerics,
|
|
22032
22189
|
children: [jsxs("div", {
|
|
22033
|
-
children: [renderGenGroupComponent(groupNames.groupAcyclic, selected, onAtomSelect), jsxs("div", {
|
|
22190
|
+
children: [renderGenGroupComponent(groupNames.groupAcyclic, selected, onAtomSelect, disabledQueryElements), jsxs("div", {
|
|
22034
22191
|
className: classes$f.subgroupContainer,
|
|
22035
22192
|
children: [jsx(VerticalBoxWithLines, {}), jsxs("div", {
|
|
22036
|
-
children: [renderGenGroupComponent(groupNames.acyclicCarbo, selected, onAtomSelect), renderGenGroupComponent(groupNames.acyclicHetero, selected, onAtomSelect)]
|
|
22193
|
+
children: [renderGenGroupComponent(groupNames.acyclicCarbo, selected, onAtomSelect, disabledQueryElements), renderGenGroupComponent(groupNames.acyclicHetero, selected, onAtomSelect, disabledQueryElements)]
|
|
22037
22194
|
})]
|
|
22038
22195
|
})]
|
|
22039
22196
|
}), jsxs("div", {
|
|
22040
|
-
children: [renderGenGroupComponent(groupNames.groupCyclic, selected, onAtomSelect), jsxs("div", {
|
|
22197
|
+
children: [renderGenGroupComponent(groupNames.groupCyclic, selected, onAtomSelect, disabledQueryElements), jsxs("div", {
|
|
22041
22198
|
className: classes$f.subgroupContainer,
|
|
22042
22199
|
children: [jsx(VerticalBoxWithLines, {}), jsxs("div", {
|
|
22043
|
-
children: [renderGenGroupComponent(groupNames.cyclicCarbo, selected, onAtomSelect), renderGenGroupComponent(groupNames.cyclicHetero, selected, onAtomSelect)]
|
|
22200
|
+
children: [renderGenGroupComponent(groupNames.cyclicCarbo, selected, onAtomSelect, disabledQueryElements), renderGenGroupComponent(groupNames.cyclicHetero, selected, onAtomSelect, disabledQueryElements)]
|
|
22044
22201
|
})]
|
|
22045
22202
|
})]
|
|
22046
22203
|
})]
|
|
@@ -22321,7 +22478,8 @@ var Table = function Table(props) {
|
|
|
22321
22478
|
needMargin: false,
|
|
22322
22479
|
children: jsx(GenericGroups, {
|
|
22323
22480
|
selected: selected,
|
|
22324
|
-
onAtomSelect: onAtomSelect
|
|
22481
|
+
onAtomSelect: onAtomSelect,
|
|
22482
|
+
disabledQueryElements: props.disabledQueryElements
|
|
22325
22483
|
})
|
|
22326
22484
|
});
|
|
22327
22485
|
};
|
|
@@ -22336,10 +22494,14 @@ function mapSelectionToProps(editor) {
|
|
|
22336
22494
|
return {};
|
|
22337
22495
|
}
|
|
22338
22496
|
var mapStateToProps$1 = function mapStateToProps(state, ownProps) {
|
|
22497
|
+
var editor = state.editor;
|
|
22339
22498
|
if (ownProps.values || ownProps.label) {
|
|
22340
22499
|
return {};
|
|
22341
22500
|
}
|
|
22342
|
-
|
|
22501
|
+
var disabledQueryElements = editor.render.options.disableQueryElements;
|
|
22502
|
+
return _objectSpread$a({
|
|
22503
|
+
disabledQueryElements: disabledQueryElements
|
|
22504
|
+
}, mapSelectionToProps(editor));
|
|
22343
22505
|
};
|
|
22344
22506
|
var mapDispatchToProps$2 = function mapDispatchToProps(dispatch, ownProps) {
|
|
22345
22507
|
return {
|
|
@@ -22638,7 +22800,7 @@ var classes$8 = {"button-common-styles":"template-lib-module_button-common-style
|
|
|
22638
22800
|
|
|
22639
22801
|
var _excluded$3 = ["onInit"],
|
|
22640
22802
|
_excluded2$1 = ["name", "onNameEdit", "onAttachEdit"];
|
|
22641
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
22803
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
22642
22804
|
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; }
|
|
22643
22805
|
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; }
|
|
22644
22806
|
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); }; }
|
|
@@ -22646,14 +22808,15 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
22646
22808
|
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"])));
|
|
22647
22809
|
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"])));
|
|
22648
22810
|
var Warning = styled('div')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 0 5px;\n"])));
|
|
22649
|
-
var
|
|
22650
|
-
var
|
|
22651
|
-
var
|
|
22652
|
-
var
|
|
22653
|
-
var
|
|
22654
|
-
var
|
|
22655
|
-
var
|
|
22656
|
-
var
|
|
22811
|
+
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"])));
|
|
22812
|
+
var LeftColumn = styled('div')(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 12px;\n border-radius: 0 0 0 8px;\n background-color: #eff2f5;\n"])));
|
|
22813
|
+
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"])));
|
|
22814
|
+
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"])));
|
|
22815
|
+
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"])));
|
|
22816
|
+
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"])));
|
|
22817
|
+
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"])));
|
|
22818
|
+
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);
|
|
22819
|
+
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);
|
|
22657
22820
|
var editorStyles = {
|
|
22658
22821
|
selectionStyle: {
|
|
22659
22822
|
fill: '#167782',
|
|
@@ -22677,6 +22840,11 @@ var Attach = function (_Component) {
|
|
|
22677
22840
|
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
22678
22841
|
_classCallCheck(this, Attach);
|
|
22679
22842
|
_this = _super.call(this);
|
|
22843
|
+
_defineProperty(_assertThisInitialized(_this), "MODES", {
|
|
22844
|
+
SAVE: 'save',
|
|
22845
|
+
EDIT: 'edit'
|
|
22846
|
+
});
|
|
22847
|
+
_this.mode = isEmpty$1(props.tmpl.props) ? _this.MODES.SAVE : _this.MODES.EDIT;
|
|
22680
22848
|
_this.tmpl = initTmpl(props.tmpl);
|
|
22681
22849
|
onInit(_this.tmpl.struct.name, _this.tmpl.props);
|
|
22682
22850
|
_this.onResult = _this.onResult.bind(_assertThisInitialized(_this));
|
|
@@ -22720,8 +22888,10 @@ var Attach = function (_Component) {
|
|
|
22720
22888
|
var options = Object.assign(editorStyles, this.props.globalSettings, {
|
|
22721
22889
|
scale: getScale(struct)
|
|
22722
22890
|
});
|
|
22723
|
-
|
|
22724
|
-
|
|
22891
|
+
var dialogTitle = this.mode === this.MODES.SAVE ? 'Save to Templates' : 'Template Edit';
|
|
22892
|
+
var warningObject = this.mode === this.MODES.SAVE ? 'Templates' : 'Edited templates';
|
|
22893
|
+
return jsxs(TemplateEditDialog, {
|
|
22894
|
+
title: dialogTitle,
|
|
22725
22895
|
result: this.onResult,
|
|
22726
22896
|
valid: function valid() {
|
|
22727
22897
|
return _this2.props.formState.valid && name;
|
|
@@ -22729,7 +22899,13 @@ var Attach = function (_Component) {
|
|
|
22729
22899
|
params: prop,
|
|
22730
22900
|
buttons: [],
|
|
22731
22901
|
needMargin: false,
|
|
22732
|
-
children: jsxs(
|
|
22902
|
+
children: [jsxs(Message, {
|
|
22903
|
+
children: [jsxs("div", {
|
|
22904
|
+
children: [warningObject, " are saved locally and cannot be accessed on different browsers or computers."]
|
|
22905
|
+
}), jsx("div", {
|
|
22906
|
+
children: "Be aware that other users of the same computer and browser can access them as well."
|
|
22907
|
+
})]
|
|
22908
|
+
}), jsxs(Form$1, _objectSpread$6(_objectSpread$6({
|
|
22733
22909
|
schema: attachSchema,
|
|
22734
22910
|
customValid: {
|
|
22735
22911
|
name: function name(_name) {
|
|
@@ -22781,11 +22957,11 @@ var Attach = function (_Component) {
|
|
|
22781
22957
|
},
|
|
22782
22958
|
className: classes$8.button,
|
|
22783
22959
|
disabled: !this.checkIsValidName(name),
|
|
22784
|
-
children:
|
|
22960
|
+
children: this.mode === this.MODES.SAVE ? 'Save' : 'Edit'
|
|
22785
22961
|
})]
|
|
22786
22962
|
})]
|
|
22787
22963
|
})]
|
|
22788
|
-
}))
|
|
22964
|
+
}))]
|
|
22789
22965
|
});
|
|
22790
22966
|
}
|
|
22791
22967
|
}]);
|
|
@@ -23680,10 +23856,10 @@ function Modal(props) {
|
|
|
23680
23856
|
var Component = modals[modal.name];
|
|
23681
23857
|
if (!Component) throw new Error("There is no modal window named ".concat(modal.name));
|
|
23682
23858
|
return jsx("div", {
|
|
23683
|
-
className: clsx(classes$
|
|
23859
|
+
className: clsx(classes$F.modalOverlay, selectClasses.selectContainer),
|
|
23684
23860
|
ref: containerRef,
|
|
23685
23861
|
children: jsx(Component, _objectSpread$3({
|
|
23686
|
-
className: clsx(_defineProperty({}, classes$
|
|
23862
|
+
className: clsx(_defineProperty({}, classes$F.smallScreen, height && height <= mediaSizes$1.smallHeight || width && width <= mediaSizes$1.smallWidth))
|
|
23687
23863
|
}, rest))
|
|
23688
23864
|
});
|
|
23689
23865
|
}
|
|
@@ -23727,6 +23903,24 @@ var mergeProps = function mergeProps(stateProps, dispatchProps) {
|
|
|
23727
23903
|
};
|
|
23728
23904
|
var ModalContainer = connect(mapStateToProps, mapDispatchToProps$1, mergeProps)(Modal);
|
|
23729
23905
|
|
|
23906
|
+
function generateCommonProperties(selectedElements, normalizedElement) {
|
|
23907
|
+
var properties = Object.getOwnPropertyNames(normalizedElement);
|
|
23908
|
+
var resultElementAttributes = {};
|
|
23909
|
+
properties.forEach(function (property) {
|
|
23910
|
+
var uniqueValues = new Set();
|
|
23911
|
+
selectedElements.forEach(function (element) {
|
|
23912
|
+
uniqueValues.add(element[property]);
|
|
23913
|
+
});
|
|
23914
|
+
var allElementsHaveTheSameValue = uniqueValues.size === 1;
|
|
23915
|
+
if (allElementsHaveTheSameValue) {
|
|
23916
|
+
resultElementAttributes[property] = normalizedElement[property];
|
|
23917
|
+
} else {
|
|
23918
|
+
resultElementAttributes[property] = '';
|
|
23919
|
+
}
|
|
23920
|
+
});
|
|
23921
|
+
return resultElementAttributes;
|
|
23922
|
+
}
|
|
23923
|
+
|
|
23730
23924
|
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; }
|
|
23731
23925
|
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; }
|
|
23732
23926
|
function initEditor(dispatch, getState) {
|
|
@@ -23770,7 +23964,7 @@ function initEditor(dispatch, getState) {
|
|
|
23770
23964
|
},
|
|
23771
23965
|
onElementEdit: function onElementEdit(selem) {
|
|
23772
23966
|
if (isAtomsArray(selem)) {
|
|
23773
|
-
var atomAttributes = generateCommonProperties(selem);
|
|
23967
|
+
var atomAttributes = generateCommonProperties(selem, fromAtom(selem[0]));
|
|
23774
23968
|
return openDialog(dispatch, 'atomProps', _objectSpread$1(_objectSpread$1({}, atomAttributes), {}, {
|
|
23775
23969
|
isMultipleAtoms: true
|
|
23776
23970
|
})).then(toElement);
|
|
@@ -23833,8 +24027,9 @@ function initEditor(dispatch, getState) {
|
|
|
23833
24027
|
onQuickEdit: function onQuickEdit(atom) {
|
|
23834
24028
|
return openDialog(dispatch, 'labelEdit', atom);
|
|
23835
24029
|
},
|
|
23836
|
-
onBondEdit: function onBondEdit(
|
|
23837
|
-
|
|
24030
|
+
onBondEdit: function onBondEdit(bonds) {
|
|
24031
|
+
var bondsAttributes = generateCommonProperties(bonds, bonds[0]);
|
|
24032
|
+
return openDialog(dispatch, 'bondProps', fromBond(bondsAttributes)).then(toBond);
|
|
23838
24033
|
},
|
|
23839
24034
|
onRgroupEdit: function onRgroupEdit(rgroup) {
|
|
23840
24035
|
var struct = getState().editor.struct();
|
|
@@ -24048,8 +24243,8 @@ var KetcherBuilder = function () {
|
|
|
24048
24243
|
initApp(element, staticResourcesUrl, {
|
|
24049
24244
|
buttons: buttons || {},
|
|
24050
24245
|
errorHandler: errorHandler || null,
|
|
24051
|
-
version: "2.
|
|
24052
|
-
buildDate: "2023-04-
|
|
24246
|
+
version: "2.10.0-rc.1" ,
|
|
24247
|
+
buildDate: "2023-04-21T11:09:47" ,
|
|
24053
24248
|
buildNumber: ''
|
|
24054
24249
|
}, structService, resolve);
|
|
24055
24250
|
});
|