ketcher-react 2.9.0-rc.6 → 2.9.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3076,7 +3076,7 @@ var zoom = {
3076
3076
 
3077
3077
  var openHelpLink = function openHelpLink() {
3078
3078
  var _window$open;
3079
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.9.0-rc.6\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3079
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.9.0-rc.8\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3080
3080
  };
3081
3081
  var help = {
3082
3082
  help: {
@@ -12184,7 +12184,7 @@ function getGroupIdsFromItemMaps(struct, mergeMaps) {
12184
12184
  });
12185
12185
  }
12186
12186
 
12187
- function dropAndMerge(editor, mergeItems, action) {
12187
+ function dropAndMerge(editor, mergeItems, action, isPaste) {
12188
12188
  var _dropItemAction;
12189
12189
  var restruct = editor.render.ctab;
12190
12190
  var isMerging = !!mergeItems;
@@ -12200,7 +12200,9 @@ function dropAndMerge(editor, mergeItems, action) {
12200
12200
  editor.hover(null);
12201
12201
  if (isMerging) editor.selection(null);
12202
12202
  if (((_dropItemAction = dropItemAction) === null || _dropItemAction === void 0 ? void 0 : _dropItemAction.operations.length) > 0) {
12203
- editor.update(dropItemAction);
12203
+ editor.update(dropItemAction, false, {
12204
+ resizeCanvas: !!isPaste
12205
+ });
12204
12206
  }
12205
12207
  }
12206
12208
  function getExpandGroupsInMergeAction(restruct, mergeItems) {
@@ -12431,9 +12433,9 @@ var SelectTool = function () {
12431
12433
  dragCtx.action = ketcherCore.fromMultipleMove(restruct, expSel, editor.render.page2obj(event).sub(dragCtx.xy0));
12432
12434
  dragCtx.mergeItems = getMergeItems(editor, expSel);
12433
12435
  editor.hover(ketcherCore.getHoverToFuse(dragCtx.mergeItems));
12434
- extendCanvas(rnd, event);
12436
+ resizeCanvas(rnd, event);
12435
12437
  editor.update(dragCtx.action, true, {
12436
- extendCanvas: false
12438
+ resizeCanvas: false
12437
12439
  });
12438
12440
  return true;
12439
12441
  }
@@ -12633,7 +12635,7 @@ var SelectTool = function () {
12633
12635
  }]);
12634
12636
  return SelectTool;
12635
12637
  }();
12636
- function extendCanvas(render, event) {
12638
+ function resizeCanvas(render, event) {
12637
12639
  var offset = 1;
12638
12640
  var _isCloseToEdgeOfCanva = ketcherCore.isCloseToEdgeOfCanvas(event, render.sz),
12639
12641
  isCloseToLeftEdgeOfCanvas = _isCloseToEdgeOfCanva.isCloseToLeftEdgeOfCanvas,
@@ -13221,7 +13223,7 @@ var PasteTool = function () {
13221
13223
  pasteItems = _fromPaste6[1];
13222
13224
  this.action = _action;
13223
13225
  this.editor.update(this.action, true, {
13224
- extendCanvas: false
13226
+ resizeCanvas: false
13225
13227
  });
13226
13228
  this.mergeItems = getMergeItems(this.editor, pasteItems);
13227
13229
  this.editor.hover(ketcherCore.getHoverToFuse(this.mergeItems));
@@ -13254,7 +13256,7 @@ var PasteTool = function () {
13254
13256
  } else {
13255
13257
  var action = this.action;
13256
13258
  delete this.action;
13257
- dropAndMerge(this.editor, this.mergeItems, action);
13259
+ dropAndMerge(this.editor, this.mergeItems, action, true);
13258
13260
  }
13259
13261
  }
13260
13262
  }, {
@@ -16262,7 +16264,9 @@ var Editor$3 = function () {
16262
16264
  }
16263
16265
  this.render.ctab.setSelection(this._selection);
16264
16266
  this.event.selectionChange.dispatch(this._selection);
16265
- this.render.update();
16267
+ this.render.update(false, null, {
16268
+ resizeCanvas: false
16269
+ });
16266
16270
  return this._selection;
16267
16271
  }
16268
16272
  }, {
@@ -16281,7 +16285,7 @@ var Editor$3 = function () {
16281
16285
  key: "update",
16282
16286
  value: function update(action, ignoreHistory) {
16283
16287
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
16284
- extendCanvas: true
16288
+ resizeCanvas: true
16285
16289
  };
16286
16290
  if (action === true) {
16287
16291
  this.render.update(true, null, options);
@@ -18044,8 +18048,7 @@ function ownKeys$A(object, enumerableOnly) { var keys = Object.keys(object); if
18044
18048
  function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$A(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$A(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18045
18049
  function GenericInput(_ref) {
18046
18050
  _ref.schema;
18047
- var _ref$value = _ref.value,
18048
- value = _ref$value === void 0 ? '' : _ref$value,
18051
+ var value = _ref.value,
18049
18052
  onChange = _ref.onChange,
18050
18053
  innerRef = _ref.innerRef,
18051
18054
  _ref$type = _ref.type,
@@ -18067,7 +18070,7 @@ function GenericInput(_ref) {
18067
18070
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
18068
18071
  children: [jsxRuntime.jsx("input", _objectSpread$A({
18069
18072
  type: type,
18070
- value: value,
18073
+ value: value !== null && value !== void 0 ? value : '',
18071
18074
  onInput: onChange,
18072
18075
  onChange: onChange,
18073
18076
  className: clsx__default["default"](classes$A.input, classes$A.genericInput),
@@ -24108,8 +24111,8 @@ var KetcherBuilder = function () {
24108
24111
  initApp(element, staticResourcesUrl, {
24109
24112
  buttons: buttons || {},
24110
24113
  errorHandler: errorHandler || null,
24111
- version: "2.9.0-rc.6" ,
24112
- buildDate: "2023-04-10T13:09:58" ,
24114
+ version: "2.9.0-rc.8" ,
24115
+ buildDate: "2023-04-21T12:27:20" ,
24113
24116
  buildNumber: ''
24114
24117
  }, structService, resolve);
24115
24118
  });