ketcher-react 2.23.0-rc.3 → 2.23.0-rc.4

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
@@ -554,7 +554,7 @@ function _copy(_x3) {
554
554
  }
555
555
  function _copy2() {
556
556
  _copy2 = _asyncToGenerator__default["default"]( _regeneratorRuntime__default["default"].mark(function _callee3(data) {
557
- var clipboardItemData;
557
+ var clipboardItemData, clipboardItem, textData;
558
558
  return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
559
559
  while (1) switch (_context3.prev = _context3.next) {
560
560
  case 0:
@@ -566,20 +566,36 @@ function _copy2() {
566
566
  type: mimeTypeToSet
567
567
  }));
568
568
  });
569
- _context3.next = 5;
570
- return navigator.clipboard.write([new ClipboardItem(clipboardItemData)]);
571
- case 5:
572
- _context3.next = 11;
569
+ clipboardItem = new ClipboardItem(clipboardItemData);
570
+ if (!(clipboardItem.presentationStyle && clipboardItem.presentationStyle === 'unspecified')) {
571
+ _context3.next = 11;
572
+ break;
573
+ }
574
+ if (!navigator.clipboard.writeText) {
575
+ _context3.next = 9;
576
+ break;
577
+ }
578
+ textData = data['text/plain'] || JSON.stringify(data);
579
+ _context3.next = 9;
580
+ return navigator.clipboard.writeText(textData);
581
+ case 9:
582
+ _context3.next = 13;
573
583
  break;
574
- case 7:
575
- _context3.prev = 7;
584
+ case 11:
585
+ _context3.next = 13;
586
+ return navigator.clipboard.write([clipboardItem]);
587
+ case 13:
588
+ _context3.next = 19;
589
+ break;
590
+ case 15:
591
+ _context3.prev = 15;
576
592
  _context3.t0 = _context3["catch"](0);
577
593
  ketcherCore.KetcherLogger.error('cliparea.jsx::copy', _context3.t0);
578
- case 11:
594
+ case 19:
579
595
  case "end":
580
596
  return _context3.stop();
581
597
  }
582
- }, _callee3, null, [[0, 7]]);
598
+ }, _callee3, null, [[0, 15]]);
583
599
  }));
584
600
  return _copy2.apply(this, arguments);
585
601
  }
@@ -3660,7 +3676,7 @@ var zoom = {
3660
3676
 
3661
3677
  var openHelpLink = function openHelpLink() {
3662
3678
  var _window$open;
3663
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.23.0-rc.3\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3679
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.23.0-rc.4\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3664
3680
  };
3665
3681
  var help = {
3666
3682
  help: {
@@ -33159,8 +33175,8 @@ var KetcherBuilder = function () {
33159
33175
  initApp(element, appRoot, staticResourcesUrl, {
33160
33176
  buttons: buttons || {},
33161
33177
  errorHandler: errorHandler || null,
33162
- version: "2.23.0-rc.3" ,
33163
- buildDate: "2024-07-14T19:15:53" ,
33178
+ version: "2.23.0-rc.4" ,
33179
+ buildDate: "2024-08-14T15:07:42" ,
33164
33180
  buildNumber: ''
33165
33181
  }, structService, resolve, togglerComponent);
33166
33182
  });