ketcher-react 2.26.0-rc.5 → 2.26.0-rc.6

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.
@@ -3733,7 +3733,7 @@ var zoom = {
3733
3733
 
3734
3734
  var openHelpLink = function openHelpLink() {
3735
3735
  var _window$open;
3736
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.26.0-rc.5\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3736
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.26.0-rc.6\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3737
3737
  };
3738
3738
  var help = {
3739
3739
  help: {
@@ -23299,6 +23299,7 @@ var supportedMimesForRegex = supportedMimes.map(function (item) {
23299
23299
  }).join('|');
23300
23300
  var allowList = new RegExp("^image/(".concat(supportedMimesForRegex, ")$"));
23301
23301
  var MIN_DIMENSION_SIZE = 16;
23302
+ var MIN_SIZELESS_IMAGE_SRC_LENGTH = 320;
23302
23303
  var ImageTool = function () {
23303
23304
  function ImageTool(editor) {
23304
23305
  _classCallCheck$2(this, ImageTool);
@@ -23383,7 +23384,9 @@ var ImageTool = function () {
23383
23384
  });
23384
23385
  image.onload = function () {
23385
23386
  _this.resetElementValue();
23386
- if (image.width < MIN_DIMENSION_SIZE || image.height < MIN_DIMENSION_SIZE) {
23387
+ var isValidSize = image.width >= MIN_DIMENSION_SIZE && image.height >= MIN_DIMENSION_SIZE;
23388
+ var isValidSizeless = image.width === 0 && image.height === 0 && image.src.length >= MIN_SIZELESS_IMAGE_SRC_LENGTH;
23389
+ if (!isValidSize && !isValidSizeless) {
23387
23390
  var _errorMessage = 'Image should be at least 16x16 pixels';
23388
23391
  KetcherLogger.error("".concat(TAG, ":onLoad"), _errorMessage);
23389
23392
  if (errorHandler) {
@@ -23391,8 +23394,9 @@ var ImageTool = function () {
23391
23394
  }
23392
23395
  return;
23393
23396
  }
23394
- var halfSize = Scale.canvasToModel(new Vec2(image.width / 2, image.height / 2), _this.editor.render.options);
23395
- _this.editor.update(fromImageCreation(_this.editor.render.ctab, image.src, clickPosition, halfSize));
23397
+ var halfSize = isValidSizeless ? new Vec2(MIN_DIMENSION_SIZE, MIN_DIMENSION_SIZE) : new Vec2(image.width / 2, image.height / 2);
23398
+ var halfSizeScaled = Scale.canvasToModel(halfSize, _this.editor.render.options);
23399
+ _this.editor.update(fromImageCreation(_this.editor.render.ctab, image.src, clickPosition, halfSizeScaled));
23396
23400
  };
23397
23401
  image.onerror = function (e) {
23398
23402
  _this.resetElementValue();
@@ -34780,8 +34784,8 @@ var KetcherBuilder = function () {
34780
34784
  cleanup = initApp(element, appRoot, staticResourcesUrl, {
34781
34785
  buttons: buttons || {},
34782
34786
  errorHandler: errorHandler || null,
34783
- version: "2.26.0-rc.5" ,
34784
- buildDate: "2024-10-21T15:20:30" ,
34787
+ version: "2.26.0-rc.6" ,
34788
+ buildDate: "2024-10-25T09:50:21" ,
34785
34789
  buildNumber: '',
34786
34790
  customButtons: customButtons || []
34787
34791
  }, structService, resolve, togglerComponent);