ketcher-react 3.16.0-rc.1 → 3.16.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +44 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{index.modern-e64c5206.js → index.modern-efd61935.js} +3 -3
- package/dist/cjs/{index.modern-e64c5206.js.map → index.modern-efd61935.js.map} +1 -1
- package/dist/cjs/script/ui/component/cliparea/cliparea.d.ts +1 -0
- package/dist/cjs/script/ui/state/hotkeys.d.ts +1 -0
- package/dist/index.js +45 -24
- package/dist/index.js.map +1 -1
- package/dist/{index.modern-b91d8a59.js → index.modern-75d2a92d.js} +3 -3
- package/dist/{index.modern-b91d8a59.js.map → index.modern-75d2a92d.js.map} +1 -1
- package/dist/script/ui/component/cliparea/cliparea.d.ts +1 -0
- package/dist/script/ui/state/hotkeys.d.ts +1 -0
- package/package.json +1 -1
|
@@ -25,6 +25,7 @@ interface ClipAreaProps {
|
|
|
25
25
|
onCopy: () => Promise<ClipboardData | null | undefined>;
|
|
26
26
|
onCut: () => Promise<ClipboardData | null | undefined>;
|
|
27
27
|
onPaste: (data: ClipboardItem[] | ClipboardData, isSmarts?: boolean) => Promise<void>;
|
|
28
|
+
onLegacyCopy: () => ClipboardData | null | undefined;
|
|
28
29
|
onLegacyCut: () => ClipboardData | null | undefined;
|
|
29
30
|
onLegacyPaste: (data: ClipboardData, isSmarts?: boolean) => void;
|
|
30
31
|
target?: HTMLElement;
|
|
@@ -18,6 +18,7 @@ export declare function removeKeydownListener(element: any): () => void;
|
|
|
18
18
|
export declare function initClipboard(dispatch: any, getState: any): {
|
|
19
19
|
formats: any[];
|
|
20
20
|
focused(): boolean;
|
|
21
|
+
onLegacyCopy(): {} | null;
|
|
21
22
|
onLegacyCut(): {} | null;
|
|
22
23
|
onCut(): Promise<{} | null | undefined>;
|
|
23
24
|
onCopy(): Promise<{} | null | undefined>;
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import 'url-search-params-polyfill';
|
|
|
27
27
|
import 'whatwg-fetch';
|
|
28
28
|
import _classCallCheck$2 from '@babel/runtime/helpers/classCallCheck';
|
|
29
29
|
import _createClass$2 from '@babel/runtime/helpers/createClass';
|
|
30
|
-
import { KetSerializer, MolSerializer, KetcherLogger, ketcherProvider, defaultBondThickness,
|
|
30
|
+
import { KetSerializer, MolSerializer, KetcherLogger, ketcherProvider, defaultBondThickness, notifyCopyCut, isClipboardAPIAvailable, notifyRequestCompleted, isControlKey, StereoLabelStyleType, StereoColoringType, ShowHydrogenLabels, ShowHydrogenLabelNames, SettingsManager, SdfSerializer, KETCHER_SAVED_OPTIONS_KEY, SUPERATOM_CLASS, Bond as Bond$2, Elements, AtomList, getAtomType, StereoLabel, isAttachmentBond, Atom as Atom$2, findStereoAtoms, RxnArrowMode, MULTITAIL_ARROW_TOOL_NAME, CREATE_MONOMER_TOOL_NAME, SimpleObjectMode, IMAGE_KEY, SGroup as SGroup$1, getSelectionFromStruct, identifyStructFormat, SupportedFormat, FormatterFactory, ChemicalMimeType, RenderStruct, Struct, ZoomTool, KETCHER_MACROMOLECULES_ROOT_NODE_SELECTOR, shortcutStr, MonomerMicromolecule, FunctionalGroupsProvider, SaltsAndSolventsProvider, KetcherAsyncEvents, ElementColor, generateMenuShortcuts, Vec2, Scale, fromMultipleMove, FunctionalGroup, MULTITAIL_ARROW_KEY, CoordinateTransformation, mergeMapOfItemsToSet, fromSgroupDeletion, fromFragmentDeletion, vectorUtils, fromBondAddition, Action, fromAtomAddition, fromAtomsAttrs, checkOverlapping, fromSeveralSgroupAddition, expandSGroupWithMultipleAttachmentPoint, SgContexts, Pile, fromSgroupAction, fromItemsFuse, ReBond, setExpandSGroup, fromBondsAttrs, OperationType, ReStruct, imageReferencePositionToCursor, multitailArrowReferenceLinesToCursor, multitailReferencePositionToCursor, fromArrowAddition, fromArrowResizing, fromArrowDeletion, fromMultitailArrowCreation, MultitailArrowRefName, fromMultitailArrowHeadTailMove, fromMultitailArrowHeadTailsResize, fromMultitailArrowMove, fromPaste, fromImageResize, fromSimpleObjectResizing, getItemsToFuse, getHoverToFuse, fromTextDeletion, fromTextUpdating, fromTemplateOnCanvas, fromTemplateOnBondAction, fromTemplateOnAtom, BondAttr, AtomAttr, formatProperties, runAsyncAction, getStructStringFromClipboardData, getStructure, initHotKeys, keyNorm, Fragment as Fragment$1, fromRGroupAttachmentPointUpdate, fromOneBondDeletion, bondChangingAction, fromChain, removeInfoLabelFromAtoms, fromStereoFlagUpdate, fromOneAtomDeletion, fromPlusDeletion, fromSimpleObjectDeletion, fromRGroupAttachmentPointDeletion, fromImageDeletion, fromMultitailArrowDeletion, notifyItemsToMergeInitializationComplete, RGroup as RGroup$2, fromRGroupFragment, fromUpdateIfThen, fromRGroupAttrs, fromPlusAddition, getRelSGroupsBySelection, RotateMonomerOperation, fromRotate, fromFlip, fromSimpleObjectAddition, fromTextCreation, fromImageMove, fromImageCreation, fromHighlightCreate, fromHighlightClear, getOptionsWithConvertedUnits, provideEditorSettings, fromNewCanvas, Render, Coordinates, MarkAsRnaComponentOperation, isSingleRGroupAttachmentPoint, genericsList, getAttachmentPointLabelWithBinaryShift, AttachmentPointName, getAttachmentPointLabel, getAttachmentPointNumberFromLabel, getNextFreeAttachmentPoint, AtomLabel, AssignLeavingGroupAtomOperation, AssignAttachmentAtomOperation, setMonomerTemplatePrefix, getHELMClassByKetMonomerClass, fillNaturalAnalogueForPhosphateAndSugar, KetTemplateType, normalizeMonomerAtomsPositions, monomerFactory, MacromoleculesConverter, fromSgroupAddition, setMonomerGroupTemplatePrefix, KetMonomerClass, KetConnectionType, getKetRef, ReassignLeavingAtomOperation, ReassignAttachmentPointOperation, RemoveAttachmentPointOperation, MonomerCreationComponentStructureUpdateEvent, fromDescriptorsAlign, Visel, paperPathFromSVGElement, LayerMap, HELM_ALIAS_FORMAT_ERROR_MESSAGE, atomGetAttr, fromBondFlipping, setExpandMonomerSGroup, fromMultitailArrowTailAdd, MultitailArrow, fromMultitailArrowTailRemove, AmbiguousMonomer, MonomerCreationAttachmentPointClickEvent, provideEditorInstance, compareByTitleWithNaturalFirst, NO_NATURAL_ANALOGUE, isValidHelmAlias, getAtomCustomQuery, getFormatMimeTypeByFileName, getPropertiesByFormat, StereoFlag, getPropertiesByImgFormat, legacyCopy as legacyCopy$1, b64toBlob, Generics, TextCommand, Ketcher, DefaultStructServiceOptions } from 'ketcher-core';
|
|
31
31
|
export { EditorClassName, KETCHER_MACROMOLECULES_ROOT_NODE_SELECTOR } from 'ketcher-core';
|
|
32
32
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
33
33
|
import _possibleConstructorReturn$2 from '@babel/runtime/helpers/possibleConstructorReturn';
|
|
@@ -288,6 +288,12 @@ function _arrayLikeToArray$m(r, a) { (null == a || a > r.length) && (a = r.lengt
|
|
|
288
288
|
function _callSuper$d(t, o, e) { return o = _getPrototypeOf$2(o), _possibleConstructorReturn$2(t, _isNativeReflectConstruct$f() ? Reflect.construct(o, e || [], _getPrototypeOf$2(t).constructor) : o.apply(t, e)); }
|
|
289
289
|
function _isNativeReflectConstruct$f() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$f = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
290
290
|
var ieCb = typeof window !== 'undefined' ? window.clipboardData : undefined;
|
|
291
|
+
var isSafariBrowser = function isSafariBrowser() {
|
|
292
|
+
return typeof navigator !== 'undefined' && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
293
|
+
};
|
|
294
|
+
var isAsyncClipboardWriteAvailable = function isAsyncClipboardWriteAvailable() {
|
|
295
|
+
return isClipboardAPIAvailable() && !isSafariBrowser();
|
|
296
|
+
};
|
|
291
297
|
var CLIP_AREA_BASE_CLASS = 'cliparea';
|
|
292
298
|
var needSkipCopyEvent = false;
|
|
293
299
|
var isUserEditing = function isUserEditing() {
|
|
@@ -332,7 +338,7 @@ var ClipArea = function (_Component) {
|
|
|
332
338
|
if (!_this2.props.focused() || isUserEditing()) {
|
|
333
339
|
return;
|
|
334
340
|
}
|
|
335
|
-
if (
|
|
341
|
+
if (isAsyncClipboardWriteAvailable()) {
|
|
336
342
|
_this2.props.onCopy().then(function (data) {
|
|
337
343
|
if (!data) {
|
|
338
344
|
return;
|
|
@@ -343,31 +349,39 @@ var ClipArea = function (_Component) {
|
|
|
343
349
|
});
|
|
344
350
|
});
|
|
345
351
|
} else {
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
352
|
+
if (isSafariBrowser()) {
|
|
353
|
+
var data = _this2.props.onLegacyCopy();
|
|
354
|
+
if (data && event.clipboardData) {
|
|
355
|
+
legacyCopy(event.clipboardData, data);
|
|
356
|
+
}
|
|
357
|
+
event.preventDefault();
|
|
358
|
+
} else {
|
|
359
|
+
if (needSkipCopyEvent) {
|
|
360
|
+
needSkipCopyEvent = false;
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
needSkipCopyEvent = true;
|
|
364
|
+
_this2.props.onCopy().then(function (data) {
|
|
365
|
+
addEventListener('copy', function (evt) {
|
|
366
|
+
var clipboardEvent = evt;
|
|
367
|
+
if (clipboardEvent.clipboardData && data) {
|
|
368
|
+
legacyCopy(clipboardEvent.clipboardData, data);
|
|
369
|
+
}
|
|
370
|
+
evt.preventDefault();
|
|
371
|
+
}, {
|
|
372
|
+
once: true
|
|
373
|
+
});
|
|
374
|
+
document.execCommand('copy');
|
|
360
375
|
});
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
event.preventDefault();
|
|
376
|
+
event.preventDefault();
|
|
377
|
+
}
|
|
364
378
|
}
|
|
365
379
|
},
|
|
366
380
|
cut: function cut(event) {
|
|
367
381
|
if (!_this2.props.focused() || isUserEditing()) {
|
|
368
382
|
return;
|
|
369
383
|
}
|
|
370
|
-
if (
|
|
384
|
+
if (isAsyncClipboardWriteAvailable()) {
|
|
371
385
|
_asyncToGenerator(_regeneratorRuntime.mark(function _callee() {
|
|
372
386
|
var data;
|
|
373
387
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -4036,7 +4050,7 @@ var zoom = {
|
|
|
4036
4050
|
|
|
4037
4051
|
var openHelpLink = function openHelpLink() {
|
|
4038
4052
|
var _window$open;
|
|
4039
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.16.0-rc.
|
|
4053
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.16.0-rc.2\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
|
|
4040
4054
|
};
|
|
4041
4055
|
var help = {
|
|
4042
4056
|
help: {
|
|
@@ -21445,6 +21459,13 @@ function initClipboard(dispatch, getState) {
|
|
|
21445
21459
|
var state = getState();
|
|
21446
21460
|
return !state.modal;
|
|
21447
21461
|
},
|
|
21462
|
+
onLegacyCopy: function onLegacyCopy() {
|
|
21463
|
+
var state = getState();
|
|
21464
|
+
var editor = state.editor;
|
|
21465
|
+
var data = legacyClipData(editor);
|
|
21466
|
+
editor.selection(null);
|
|
21467
|
+
return data;
|
|
21468
|
+
},
|
|
21448
21469
|
onLegacyCut: function onLegacyCut() {
|
|
21449
21470
|
var state = getState();
|
|
21450
21471
|
var editor = state.editor;
|
|
@@ -42672,8 +42693,8 @@ var KetcherBuilder = function () {
|
|
|
42672
42693
|
cleanup = initApp(prevKetcherId, ketcherId, element, appRoot, staticResourcesUrl, {
|
|
42673
42694
|
buttons: buttons !== null && buttons !== void 0 ? buttons : {},
|
|
42674
42695
|
errorHandler: errorHandler !== null && errorHandler !== void 0 ? errorHandler : null,
|
|
42675
|
-
version: (_rc = "3.16.0-rc.
|
|
42676
|
-
buildDate: (_T = "2026-05-
|
|
42696
|
+
version: (_rc = "3.16.0-rc.2") !== null && _rc !== void 0 ? _rc : '',
|
|
42697
|
+
buildDate: (_T = "2026-05-26T16:48:21") !== null && _T !== void 0 ? _T : '',
|
|
42677
42698
|
buildNumber: '',
|
|
42678
42699
|
customButtons: customButtons !== null && customButtons !== void 0 ? customButtons : []
|
|
42679
42700
|
}, structService, resolve, togglerComponent);
|
|
@@ -42986,7 +43007,7 @@ var ModeControl = function ModeControl(_ref4) {
|
|
|
42986
43007
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
42987
43008
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
42988
43009
|
var MacromoleculesEditorComponent = lazy(function () {
|
|
42989
|
-
return import('./index.modern-
|
|
43010
|
+
return import('./index.modern-75d2a92d.js');
|
|
42990
43011
|
});
|
|
42991
43012
|
var Editor = function Editor(props) {
|
|
42992
43013
|
var _useState = useState(false),
|