geneviewer-js 0.3.0 → 0.3.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.
@@ -7297,7 +7297,7 @@ function createSaveIcon(widgetId, el, container2, iconClass = null, save = downl
7297
7297
  }
7298
7298
 
7299
7299
  // src/lib/chart.js
7300
- var version = "0.3.0";
7300
+ var version = "0.3.1";
7301
7301
  var renderSequence = 0;
7302
7302
  var chartCount = 0;
7303
7303
  var activeShortcuts = null;
@@ -7537,9 +7537,15 @@ function newChart(target, renderModel, options) {
7537
7537
  return keyOf(item) === key;
7538
7538
  });
7539
7539
  };
7540
+ var copyItem = function(item) {
7541
+ return item === null ? null : structuredClone(item);
7542
+ };
7543
+ var copySelection = function() {
7544
+ return selection.map(copyItem);
7545
+ };
7540
7546
  var reportSelection = function() {
7541
- report("select", selected);
7542
- report("selection", selection);
7547
+ report("select", copyItem(selected));
7548
+ report("selection", copySelection());
7543
7549
  };
7544
7550
  var applySelection = function(refresh) {
7545
7551
  var previous = JSON.stringify(selection.map(function(item) {
@@ -8910,7 +8916,7 @@ function newChart(target, renderModel, options) {
8910
8916
  changeSelection(matchItems(items == null ? [] : Array.isArray(items) ? items : [items]), "replace");
8911
8917
  },
8912
8918
  getSelection: function() {
8913
- return selection.slice();
8919
+ return copySelection();
8914
8920
  },
8915
8921
  undo: function() {
8916
8922
  if (!destroyed) step(true);