@teselagen/ove 0.7.3-beta.6 → 0.7.3-beta.7

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/index.cjs.js CHANGED
@@ -84,26 +84,6 @@ function _interopNamespaceDefault(e) {
84
84
  return Object.freeze(n2);
85
85
  }
86
86
  __name(_interopNamespaceDefault, "_interopNamespaceDefault");
87
- function _mergeNamespaces(n2, m2) {
88
- for (var i = 0; i < m2.length; i++) {
89
- const e = m2[i];
90
- if (typeof e !== "string" && !Array.isArray(e)) {
91
- for (const k2 in e) {
92
- if (k2 !== "default" && !(k2 in n2)) {
93
- const d2 = Object.getOwnPropertyDescriptor(e, k2);
94
- if (d2) {
95
- Object.defineProperty(n2, k2, d2.get ? d2 : {
96
- enumerable: true,
97
- get: () => e[k2]
98
- });
99
- }
100
- }
101
- }
102
- }
103
- }
104
- return Object.freeze(Object.defineProperty(n2, Symbol.toStringTag, { value: "Module" }));
105
- }
106
- __name(_mergeNamespaces, "_mergeNamespaces");
107
87
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React$2);
108
88
  var top = "top";
109
89
  var bottom = "bottom";
@@ -17948,16 +17928,25 @@ var getIntrinsic = /* @__PURE__ */ __name(function GetIntrinsic(name2, allowMiss
17948
17928
  return value;
17949
17929
  }, "GetIntrinsic");
17950
17930
  var callBind$3 = { exports: {} };
17951
- var GetIntrinsic$4 = getIntrinsic;
17952
- var $defineProperty$2 = GetIntrinsic$4("%Object.defineProperty%", true) || false;
17953
- if ($defineProperty$2) {
17954
- try {
17955
- $defineProperty$2({}, "a", { value: 1 });
17956
- } catch (e) {
17957
- $defineProperty$2 = false;
17931
+ var esDefineProperty;
17932
+ var hasRequiredEsDefineProperty;
17933
+ function requireEsDefineProperty() {
17934
+ if (hasRequiredEsDefineProperty)
17935
+ return esDefineProperty;
17936
+ hasRequiredEsDefineProperty = 1;
17937
+ var GetIntrinsic3 = getIntrinsic;
17938
+ var $defineProperty2 = GetIntrinsic3("%Object.defineProperty%", true) || false;
17939
+ if ($defineProperty2) {
17940
+ try {
17941
+ $defineProperty2({}, "a", { value: 1 });
17942
+ } catch (e) {
17943
+ $defineProperty2 = false;
17944
+ }
17958
17945
  }
17946
+ esDefineProperty = $defineProperty2;
17947
+ return esDefineProperty;
17959
17948
  }
17960
- var esDefineProperty = $defineProperty$2;
17949
+ __name(requireEsDefineProperty, "requireEsDefineProperty");
17961
17950
  var GetIntrinsic$3 = getIntrinsic;
17962
17951
  var $gOPD$1 = GetIntrinsic$3("%Object.getOwnPropertyDescriptor%", true);
17963
17952
  if ($gOPD$1) {
@@ -17968,7 +17957,7 @@ if ($gOPD$1) {
17968
17957
  }
17969
17958
  }
17970
17959
  var gopd$1 = $gOPD$1;
17971
- var $defineProperty$1 = esDefineProperty;
17960
+ var $defineProperty$1 = requireEsDefineProperty();
17972
17961
  var $SyntaxError = syntax;
17973
17962
  var $TypeError$4 = type$1;
17974
17963
  var gopd = gopd$1;
@@ -18009,7 +17998,7 @@ var defineDataProperty$1 = /* @__PURE__ */ __name(function defineDataProperty(ob
18009
17998
  throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
18010
17999
  }
18011
18000
  }, "defineDataProperty");
18012
- var $defineProperty = esDefineProperty;
18001
+ var $defineProperty = requireEsDefineProperty();
18013
18002
  var hasPropertyDescriptors = /* @__PURE__ */ __name(function hasPropertyDescriptors2() {
18014
18003
  return !!$defineProperty;
18015
18004
  }, "hasPropertyDescriptors");
@@ -18078,7 +18067,7 @@ var setFunctionLength = /* @__PURE__ */ __name(function setFunctionLength2(fn4,
18078
18067
  var $apply = GetIntrinsic3("%Function.prototype.apply%");
18079
18068
  var $call = GetIntrinsic3("%Function.prototype.call%");
18080
18069
  var $reflectApply = GetIntrinsic3("%Reflect.apply%", true) || bind3.call($call, $apply);
18081
- var $defineProperty2 = esDefineProperty;
18070
+ var $defineProperty2 = requireEsDefineProperty();
18082
18071
  var $max = GetIntrinsic3("%Math.max%");
18083
18072
  module2.exports = /* @__PURE__ */ __name(function callBind2(originalFunction) {
18084
18073
  if (typeof originalFunction !== "function") {
@@ -116416,789 +116405,6 @@ const ConnectedDroppable = reactRedux.connect(
116416
116405
  )(Droppable$1);
116417
116406
  ConnectedDroppable.defaultProps = defaultProps;
116418
116407
  var ConnectedDroppable$1 = ConnectedDroppable;
116419
- var clipboard$1 = { exports: {} };
116420
- /*!
116421
- * clipboard.js v2.0.8
116422
- * https://clipboardjs.com/
116423
- *
116424
- * Licensed MIT © Zeno Rocha
116425
- */
116426
- (function(module2, exports2) {
116427
- (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root2, factory) {
116428
- module2.exports = factory();
116429
- }, "webpackUniversalModuleDefinition"))(commonjsGlobal, function() {
116430
- return (
116431
- /******/
116432
- function() {
116433
- var __webpack_modules__ = {
116434
- /***/
116435
- 134: (
116436
- /***/
116437
- function(__unused_webpack_module, __webpack_exports__, __webpack_require__2) {
116438
- __webpack_require__2.d(__webpack_exports__, {
116439
- "default": function() {
116440
- return (
116441
- /* binding */
116442
- clipboard2
116443
- );
116444
- }
116445
- });
116446
- var tiny_emitter = __webpack_require__2(279);
116447
- var tiny_emitter_default = /* @__PURE__ */ __webpack_require__2.n(tiny_emitter);
116448
- var listen = __webpack_require__2(370);
116449
- var listen_default = /* @__PURE__ */ __webpack_require__2.n(listen);
116450
- var src_select = __webpack_require__2(817);
116451
- var select_default = /* @__PURE__ */ __webpack_require__2.n(src_select);
116452
- function _typeof2(obj) {
116453
- "@babel/helpers - typeof";
116454
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
116455
- _typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
116456
- return typeof obj2;
116457
- }, "_typeof");
116458
- } else {
116459
- _typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
116460
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
116461
- }, "_typeof");
116462
- }
116463
- return _typeof2(obj);
116464
- }
116465
- __name(_typeof2, "_typeof");
116466
- function _classCallCheck2(instance, Constructor) {
116467
- if (!(instance instanceof Constructor)) {
116468
- throw new TypeError("Cannot call a class as a function");
116469
- }
116470
- }
116471
- __name(_classCallCheck2, "_classCallCheck");
116472
- function _defineProperties2(target, props) {
116473
- for (var i = 0; i < props.length; i++) {
116474
- var descriptor = props[i];
116475
- descriptor.enumerable = descriptor.enumerable || false;
116476
- descriptor.configurable = true;
116477
- if ("value" in descriptor)
116478
- descriptor.writable = true;
116479
- Object.defineProperty(target, descriptor.key, descriptor);
116480
- }
116481
- }
116482
- __name(_defineProperties2, "_defineProperties");
116483
- function _createClass2(Constructor, protoProps, staticProps) {
116484
- if (protoProps)
116485
- _defineProperties2(Constructor.prototype, protoProps);
116486
- return Constructor;
116487
- }
116488
- __name(_createClass2, "_createClass");
116489
- var ClipboardAction = /* @__PURE__ */ function() {
116490
- function ClipboardAction2(options) {
116491
- _classCallCheck2(this, ClipboardAction2);
116492
- this.resolveOptions(options);
116493
- this.initSelection();
116494
- }
116495
- __name(ClipboardAction2, "ClipboardAction");
116496
- _createClass2(ClipboardAction2, [{
116497
- key: "resolveOptions",
116498
- value: /* @__PURE__ */ __name(function resolveOptions() {
116499
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
116500
- this.action = options.action;
116501
- this.container = options.container;
116502
- this.emitter = options.emitter;
116503
- this.target = options.target;
116504
- this.text = options.text;
116505
- this.trigger = options.trigger;
116506
- this.selectedText = "";
116507
- }, "resolveOptions")
116508
- /**
116509
- * Decides which selection strategy is going to be applied based
116510
- * on the existence of `text` and `target` properties.
116511
- */
116512
- }, {
116513
- key: "initSelection",
116514
- value: /* @__PURE__ */ __name(function initSelection() {
116515
- if (this.text) {
116516
- this.selectFake();
116517
- } else if (this.target) {
116518
- this.selectTarget();
116519
- }
116520
- }, "initSelection")
116521
- /**
116522
- * Creates a fake textarea element, sets its value from `text` property,
116523
- */
116524
- }, {
116525
- key: "createFakeElement",
116526
- value: /* @__PURE__ */ __name(function createFakeElement() {
116527
- var isRTL = document.documentElement.getAttribute("dir") === "rtl";
116528
- this.fakeElem = document.createElement("textarea");
116529
- this.fakeElem.style.fontSize = "12pt";
116530
- this.fakeElem.style.border = "0";
116531
- this.fakeElem.style.padding = "0";
116532
- this.fakeElem.style.margin = "0";
116533
- this.fakeElem.style.position = "absolute";
116534
- this.fakeElem.style[isRTL ? "right" : "left"] = "-9999px";
116535
- var yPosition = window.pageYOffset || document.documentElement.scrollTop;
116536
- this.fakeElem.style.top = "".concat(yPosition, "px");
116537
- this.fakeElem.setAttribute("readonly", "");
116538
- this.fakeElem.value = this.text;
116539
- return this.fakeElem;
116540
- }, "createFakeElement")
116541
- /**
116542
- * Get's the value of fakeElem,
116543
- * and makes a selection on it.
116544
- */
116545
- }, {
116546
- key: "selectFake",
116547
- value: /* @__PURE__ */ __name(function selectFake() {
116548
- var _this = this;
116549
- var fakeElem = this.createFakeElement();
116550
- this.fakeHandlerCallback = function() {
116551
- return _this.removeFake();
116552
- };
116553
- this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || true;
116554
- this.container.appendChild(fakeElem);
116555
- this.selectedText = select_default()(fakeElem);
116556
- this.copyText();
116557
- this.removeFake();
116558
- }, "selectFake")
116559
- /**
116560
- * Only removes the fake element after another click event, that way
116561
- * a user can hit `Ctrl+C` to copy because selection still exists.
116562
- */
116563
- }, {
116564
- key: "removeFake",
116565
- value: /* @__PURE__ */ __name(function removeFake() {
116566
- if (this.fakeHandler) {
116567
- this.container.removeEventListener("click", this.fakeHandlerCallback);
116568
- this.fakeHandler = null;
116569
- this.fakeHandlerCallback = null;
116570
- }
116571
- if (this.fakeElem) {
116572
- this.container.removeChild(this.fakeElem);
116573
- this.fakeElem = null;
116574
- }
116575
- }, "removeFake")
116576
- /**
116577
- * Selects the content from element passed on `target` property.
116578
- */
116579
- }, {
116580
- key: "selectTarget",
116581
- value: /* @__PURE__ */ __name(function selectTarget() {
116582
- this.selectedText = select_default()(this.target);
116583
- this.copyText();
116584
- }, "selectTarget")
116585
- /**
116586
- * Executes the copy operation based on the current selection.
116587
- */
116588
- }, {
116589
- key: "copyText",
116590
- value: /* @__PURE__ */ __name(function copyText() {
116591
- var succeeded;
116592
- try {
116593
- succeeded = document.execCommand(this.action);
116594
- } catch (err2) {
116595
- succeeded = false;
116596
- }
116597
- this.handleResult(succeeded);
116598
- }, "copyText")
116599
- /**
116600
- * Fires an event based on the copy operation result.
116601
- * @param {Boolean} succeeded
116602
- */
116603
- }, {
116604
- key: "handleResult",
116605
- value: /* @__PURE__ */ __name(function handleResult(succeeded) {
116606
- this.emitter.emit(succeeded ? "success" : "error", {
116607
- action: this.action,
116608
- text: this.selectedText,
116609
- trigger: this.trigger,
116610
- clearSelection: this.clearSelection.bind(this)
116611
- });
116612
- }, "handleResult")
116613
- /**
116614
- * Moves focus away from `target` and back to the trigger, removes current selection.
116615
- */
116616
- }, {
116617
- key: "clearSelection",
116618
- value: /* @__PURE__ */ __name(function clearSelection() {
116619
- if (this.trigger) {
116620
- this.trigger.focus();
116621
- }
116622
- document.activeElement.blur();
116623
- window.getSelection().removeAllRanges();
116624
- }, "clearSelection")
116625
- /**
116626
- * Sets the `action` to be performed which can be either 'copy' or 'cut'.
116627
- * @param {String} action
116628
- */
116629
- }, {
116630
- key: "destroy",
116631
- /**
116632
- * Destroy lifecycle.
116633
- */
116634
- value: /* @__PURE__ */ __name(function destroy2() {
116635
- this.removeFake();
116636
- }, "destroy")
116637
- }, {
116638
- key: "action",
116639
- set: /* @__PURE__ */ __name(function set6() {
116640
- var action2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "copy";
116641
- this._action = action2;
116642
- if (this._action !== "copy" && this._action !== "cut") {
116643
- throw new Error('Invalid "action" value, use either "copy" or "cut"');
116644
- }
116645
- }, "set"),
116646
- get: /* @__PURE__ */ __name(function get7() {
116647
- return this._action;
116648
- }, "get")
116649
- /**
116650
- * Sets the `target` property using an element
116651
- * that will be have its content copied.
116652
- * @param {Element} target
116653
- */
116654
- }, {
116655
- key: "target",
116656
- set: /* @__PURE__ */ __name(function set6(target) {
116657
- if (target !== void 0) {
116658
- if (target && _typeof2(target) === "object" && target.nodeType === 1) {
116659
- if (this.action === "copy" && target.hasAttribute("disabled")) {
116660
- throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
116661
- }
116662
- if (this.action === "cut" && (target.hasAttribute("readonly") || target.hasAttribute("disabled"))) {
116663
- throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
116664
- }
116665
- this._target = target;
116666
- } else {
116667
- throw new Error('Invalid "target" value, use a valid Element');
116668
- }
116669
- }
116670
- }, "set"),
116671
- get: /* @__PURE__ */ __name(function get7() {
116672
- return this._target;
116673
- }, "get")
116674
- }]);
116675
- return ClipboardAction2;
116676
- }();
116677
- var clipboard_action = ClipboardAction;
116678
- function clipboard_typeof(obj) {
116679
- "@babel/helpers - typeof";
116680
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
116681
- clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
116682
- return typeof obj2;
116683
- }, "_typeof");
116684
- } else {
116685
- clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
116686
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
116687
- }, "_typeof");
116688
- }
116689
- return clipboard_typeof(obj);
116690
- }
116691
- __name(clipboard_typeof, "clipboard_typeof");
116692
- function clipboard_classCallCheck(instance, Constructor) {
116693
- if (!(instance instanceof Constructor)) {
116694
- throw new TypeError("Cannot call a class as a function");
116695
- }
116696
- }
116697
- __name(clipboard_classCallCheck, "clipboard_classCallCheck");
116698
- function clipboard_defineProperties(target, props) {
116699
- for (var i = 0; i < props.length; i++) {
116700
- var descriptor = props[i];
116701
- descriptor.enumerable = descriptor.enumerable || false;
116702
- descriptor.configurable = true;
116703
- if ("value" in descriptor)
116704
- descriptor.writable = true;
116705
- Object.defineProperty(target, descriptor.key, descriptor);
116706
- }
116707
- }
116708
- __name(clipboard_defineProperties, "clipboard_defineProperties");
116709
- function clipboard_createClass(Constructor, protoProps, staticProps) {
116710
- if (protoProps)
116711
- clipboard_defineProperties(Constructor.prototype, protoProps);
116712
- if (staticProps)
116713
- clipboard_defineProperties(Constructor, staticProps);
116714
- return Constructor;
116715
- }
116716
- __name(clipboard_createClass, "clipboard_createClass");
116717
- function _inherits2(subClass, superClass) {
116718
- if (typeof superClass !== "function" && superClass !== null) {
116719
- throw new TypeError("Super expression must either be null or a function");
116720
- }
116721
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
116722
- if (superClass)
116723
- _setPrototypeOf2(subClass, superClass);
116724
- }
116725
- __name(_inherits2, "_inherits");
116726
- function _setPrototypeOf2(o2, p2) {
116727
- _setPrototypeOf2 = Object.setPrototypeOf || /* @__PURE__ */ __name(function _setPrototypeOf3(o3, p3) {
116728
- o3.__proto__ = p3;
116729
- return o3;
116730
- }, "_setPrototypeOf");
116731
- return _setPrototypeOf2(o2, p2);
116732
- }
116733
- __name(_setPrototypeOf2, "_setPrototypeOf");
116734
- function _createSuper2(Derived) {
116735
- var hasNativeReflectConstruct = _isNativeReflectConstruct2();
116736
- return /* @__PURE__ */ __name(function _createSuperInternal() {
116737
- var Super = _getPrototypeOf2(Derived), result;
116738
- if (hasNativeReflectConstruct) {
116739
- var NewTarget = _getPrototypeOf2(this).constructor;
116740
- result = Reflect.construct(Super, arguments, NewTarget);
116741
- } else {
116742
- result = Super.apply(this, arguments);
116743
- }
116744
- return _possibleConstructorReturn2(this, result);
116745
- }, "_createSuperInternal");
116746
- }
116747
- __name(_createSuper2, "_createSuper");
116748
- function _possibleConstructorReturn2(self2, call2) {
116749
- if (call2 && (clipboard_typeof(call2) === "object" || typeof call2 === "function")) {
116750
- return call2;
116751
- }
116752
- return _assertThisInitialized2(self2);
116753
- }
116754
- __name(_possibleConstructorReturn2, "_possibleConstructorReturn");
116755
- function _assertThisInitialized2(self2) {
116756
- if (self2 === void 0) {
116757
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
116758
- }
116759
- return self2;
116760
- }
116761
- __name(_assertThisInitialized2, "_assertThisInitialized");
116762
- function _isNativeReflectConstruct2() {
116763
- if (typeof Reflect === "undefined" || !Reflect.construct)
116764
- return false;
116765
- if (Reflect.construct.sham)
116766
- return false;
116767
- if (typeof Proxy === "function")
116768
- return true;
116769
- try {
116770
- Date.prototype.toString.call(Reflect.construct(Date, [], function() {
116771
- }));
116772
- return true;
116773
- } catch (e) {
116774
- return false;
116775
- }
116776
- }
116777
- __name(_isNativeReflectConstruct2, "_isNativeReflectConstruct");
116778
- function _getPrototypeOf2(o2) {
116779
- _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : /* @__PURE__ */ __name(function _getPrototypeOf3(o3) {
116780
- return o3.__proto__ || Object.getPrototypeOf(o3);
116781
- }, "_getPrototypeOf");
116782
- return _getPrototypeOf2(o2);
116783
- }
116784
- __name(_getPrototypeOf2, "_getPrototypeOf");
116785
- function getAttributeValue(suffix, element2) {
116786
- var attribute = "data-clipboard-".concat(suffix);
116787
- if (!element2.hasAttribute(attribute)) {
116788
- return;
116789
- }
116790
- return element2.getAttribute(attribute);
116791
- }
116792
- __name(getAttributeValue, "getAttributeValue");
116793
- var Clipboard2 = /* @__PURE__ */ function(_Emitter) {
116794
- _inherits2(Clipboard3, _Emitter);
116795
- var _super = _createSuper2(Clipboard3);
116796
- function Clipboard3(trigger2, options) {
116797
- var _this;
116798
- clipboard_classCallCheck(this, Clipboard3);
116799
- _this = _super.call(this);
116800
- _this.resolveOptions(options);
116801
- _this.listenClick(trigger2);
116802
- return _this;
116803
- }
116804
- __name(Clipboard3, "Clipboard");
116805
- clipboard_createClass(Clipboard3, [{
116806
- key: "resolveOptions",
116807
- value: /* @__PURE__ */ __name(function resolveOptions() {
116808
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
116809
- this.action = typeof options.action === "function" ? options.action : this.defaultAction;
116810
- this.target = typeof options.target === "function" ? options.target : this.defaultTarget;
116811
- this.text = typeof options.text === "function" ? options.text : this.defaultText;
116812
- this.container = clipboard_typeof(options.container) === "object" ? options.container : document.body;
116813
- }, "resolveOptions")
116814
- /**
116815
- * Adds a click event listener to the passed trigger.
116816
- * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
116817
- */
116818
- }, {
116819
- key: "listenClick",
116820
- value: /* @__PURE__ */ __name(function listenClick(trigger2) {
116821
- var _this2 = this;
116822
- this.listener = listen_default()(trigger2, "click", function(e) {
116823
- return _this2.onClick(e);
116824
- });
116825
- }, "listenClick")
116826
- /**
116827
- * Defines a new `ClipboardAction` on each click event.
116828
- * @param {Event} e
116829
- */
116830
- }, {
116831
- key: "onClick",
116832
- value: /* @__PURE__ */ __name(function onClick(e) {
116833
- var trigger2 = e.delegateTarget || e.currentTarget;
116834
- if (this.clipboardAction) {
116835
- this.clipboardAction = null;
116836
- }
116837
- this.clipboardAction = new clipboard_action({
116838
- action: this.action(trigger2),
116839
- target: this.target(trigger2),
116840
- text: this.text(trigger2),
116841
- container: this.container,
116842
- trigger: trigger2,
116843
- emitter: this
116844
- });
116845
- }, "onClick")
116846
- /**
116847
- * Default `action` lookup function.
116848
- * @param {Element} trigger
116849
- */
116850
- }, {
116851
- key: "defaultAction",
116852
- value: /* @__PURE__ */ __name(function defaultAction(trigger2) {
116853
- return getAttributeValue("action", trigger2);
116854
- }, "defaultAction")
116855
- /**
116856
- * Default `target` lookup function.
116857
- * @param {Element} trigger
116858
- */
116859
- }, {
116860
- key: "defaultTarget",
116861
- value: /* @__PURE__ */ __name(function defaultTarget(trigger2) {
116862
- var selector = getAttributeValue("target", trigger2);
116863
- if (selector) {
116864
- return document.querySelector(selector);
116865
- }
116866
- }, "defaultTarget")
116867
- /**
116868
- * Returns the support of the given action, or all actions if no action is
116869
- * given.
116870
- * @param {String} [action]
116871
- */
116872
- }, {
116873
- key: "defaultText",
116874
- /**
116875
- * Default `text` lookup function.
116876
- * @param {Element} trigger
116877
- */
116878
- value: /* @__PURE__ */ __name(function defaultText(trigger2) {
116879
- return getAttributeValue("text", trigger2);
116880
- }, "defaultText")
116881
- /**
116882
- * Destroy lifecycle.
116883
- */
116884
- }, {
116885
- key: "destroy",
116886
- value: /* @__PURE__ */ __name(function destroy2() {
116887
- this.listener.destroy();
116888
- if (this.clipboardAction) {
116889
- this.clipboardAction.destroy();
116890
- this.clipboardAction = null;
116891
- }
116892
- }, "destroy")
116893
- }], [{
116894
- key: "isSupported",
116895
- value: /* @__PURE__ */ __name(function isSupported() {
116896
- var action2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"];
116897
- var actions2 = typeof action2 === "string" ? [action2] : action2;
116898
- var support = !!document.queryCommandSupported;
116899
- actions2.forEach(function(action3) {
116900
- support = support && !!document.queryCommandSupported(action3);
116901
- });
116902
- return support;
116903
- }, "isSupported")
116904
- }]);
116905
- return Clipboard3;
116906
- }(tiny_emitter_default());
116907
- var clipboard2 = Clipboard2;
116908
- }
116909
- ),
116910
- /***/
116911
- 828: (
116912
- /***/
116913
- function(module3) {
116914
- var DOCUMENT_NODE_TYPE = 9;
116915
- if (typeof Element !== "undefined" && !Element.prototype.matches) {
116916
- var proto = Element.prototype;
116917
- proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
116918
- }
116919
- function closest2(element2, selector) {
116920
- while (element2 && element2.nodeType !== DOCUMENT_NODE_TYPE) {
116921
- if (typeof element2.matches === "function" && element2.matches(selector)) {
116922
- return element2;
116923
- }
116924
- element2 = element2.parentNode;
116925
- }
116926
- }
116927
- __name(closest2, "closest");
116928
- module3.exports = closest2;
116929
- }
116930
- ),
116931
- /***/
116932
- 438: (
116933
- /***/
116934
- function(module3, __unused_webpack_exports, __webpack_require__2) {
116935
- var closest2 = __webpack_require__2(828);
116936
- function _delegate(element2, selector, type2, callback2, useCapture) {
116937
- var listenerFn = listener.apply(this, arguments);
116938
- element2.addEventListener(type2, listenerFn, useCapture);
116939
- return {
116940
- destroy: function() {
116941
- element2.removeEventListener(type2, listenerFn, useCapture);
116942
- }
116943
- };
116944
- }
116945
- __name(_delegate, "_delegate");
116946
- function delegate(elements, selector, type2, callback2, useCapture) {
116947
- if (typeof elements.addEventListener === "function") {
116948
- return _delegate.apply(null, arguments);
116949
- }
116950
- if (typeof type2 === "function") {
116951
- return _delegate.bind(null, document).apply(null, arguments);
116952
- }
116953
- if (typeof elements === "string") {
116954
- elements = document.querySelectorAll(elements);
116955
- }
116956
- return Array.prototype.map.call(elements, function(element2) {
116957
- return _delegate(element2, selector, type2, callback2, useCapture);
116958
- });
116959
- }
116960
- __name(delegate, "delegate");
116961
- function listener(element2, selector, type2, callback2) {
116962
- return function(e) {
116963
- e.delegateTarget = closest2(e.target, selector);
116964
- if (e.delegateTarget) {
116965
- callback2.call(element2, e);
116966
- }
116967
- };
116968
- }
116969
- __name(listener, "listener");
116970
- module3.exports = delegate;
116971
- }
116972
- ),
116973
- /***/
116974
- 879: (
116975
- /***/
116976
- function(__unused_webpack_module, exports3) {
116977
- exports3.node = function(value) {
116978
- return value !== void 0 && value instanceof HTMLElement && value.nodeType === 1;
116979
- };
116980
- exports3.nodeList = function(value) {
116981
- var type2 = Object.prototype.toString.call(value);
116982
- return value !== void 0 && (type2 === "[object NodeList]" || type2 === "[object HTMLCollection]") && "length" in value && (value.length === 0 || exports3.node(value[0]));
116983
- };
116984
- exports3.string = function(value) {
116985
- return typeof value === "string" || value instanceof String;
116986
- };
116987
- exports3.fn = function(value) {
116988
- var type2 = Object.prototype.toString.call(value);
116989
- return type2 === "[object Function]";
116990
- };
116991
- }
116992
- ),
116993
- /***/
116994
- 370: (
116995
- /***/
116996
- function(module3, __unused_webpack_exports, __webpack_require__2) {
116997
- var is3 = __webpack_require__2(879);
116998
- var delegate = __webpack_require__2(438);
116999
- function listen(target, type2, callback2) {
117000
- if (!target && !type2 && !callback2) {
117001
- throw new Error("Missing required arguments");
117002
- }
117003
- if (!is3.string(type2)) {
117004
- throw new TypeError("Second argument must be a String");
117005
- }
117006
- if (!is3.fn(callback2)) {
117007
- throw new TypeError("Third argument must be a Function");
117008
- }
117009
- if (is3.node(target)) {
117010
- return listenNode(target, type2, callback2);
117011
- } else if (is3.nodeList(target)) {
117012
- return listenNodeList(target, type2, callback2);
117013
- } else if (is3.string(target)) {
117014
- return listenSelector(target, type2, callback2);
117015
- } else {
117016
- throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
117017
- }
117018
- }
117019
- __name(listen, "listen");
117020
- function listenNode(node2, type2, callback2) {
117021
- node2.addEventListener(type2, callback2);
117022
- return {
117023
- destroy: function() {
117024
- node2.removeEventListener(type2, callback2);
117025
- }
117026
- };
117027
- }
117028
- __name(listenNode, "listenNode");
117029
- function listenNodeList(nodeList, type2, callback2) {
117030
- Array.prototype.forEach.call(nodeList, function(node2) {
117031
- node2.addEventListener(type2, callback2);
117032
- });
117033
- return {
117034
- destroy: function() {
117035
- Array.prototype.forEach.call(nodeList, function(node2) {
117036
- node2.removeEventListener(type2, callback2);
117037
- });
117038
- }
117039
- };
117040
- }
117041
- __name(listenNodeList, "listenNodeList");
117042
- function listenSelector(selector, type2, callback2) {
117043
- return delegate(document.body, selector, type2, callback2);
117044
- }
117045
- __name(listenSelector, "listenSelector");
117046
- module3.exports = listen;
117047
- }
117048
- ),
117049
- /***/
117050
- 817: (
117051
- /***/
117052
- function(module3) {
117053
- function select2(element2) {
117054
- var selectedText;
117055
- if (element2.nodeName === "SELECT") {
117056
- element2.focus();
117057
- selectedText = element2.value;
117058
- } else if (element2.nodeName === "INPUT" || element2.nodeName === "TEXTAREA") {
117059
- var isReadOnly = element2.hasAttribute("readonly");
117060
- if (!isReadOnly) {
117061
- element2.setAttribute("readonly", "");
117062
- }
117063
- element2.select();
117064
- element2.setSelectionRange(0, element2.value.length);
117065
- if (!isReadOnly) {
117066
- element2.removeAttribute("readonly");
117067
- }
117068
- selectedText = element2.value;
117069
- } else {
117070
- if (element2.hasAttribute("contenteditable")) {
117071
- element2.focus();
117072
- }
117073
- var selection = window.getSelection();
117074
- var range2 = document.createRange();
117075
- range2.selectNodeContents(element2);
117076
- selection.removeAllRanges();
117077
- selection.addRange(range2);
117078
- selectedText = selection.toString();
117079
- }
117080
- return selectedText;
117081
- }
117082
- __name(select2, "select");
117083
- module3.exports = select2;
117084
- }
117085
- ),
117086
- /***/
117087
- 279: (
117088
- /***/
117089
- function(module3) {
117090
- function E2() {
117091
- }
117092
- __name(E2, "E");
117093
- E2.prototype = {
117094
- on: function(name2, callback2, ctx) {
117095
- var e = this.e || (this.e = {});
117096
- (e[name2] || (e[name2] = [])).push({
117097
- fn: callback2,
117098
- ctx
117099
- });
117100
- return this;
117101
- },
117102
- once: function(name2, callback2, ctx) {
117103
- var self2 = this;
117104
- function listener() {
117105
- self2.off(name2, listener);
117106
- callback2.apply(ctx, arguments);
117107
- }
117108
- __name(listener, "listener");
117109
- listener._ = callback2;
117110
- return this.on(name2, listener, ctx);
117111
- },
117112
- emit: function(name2) {
117113
- var data = [].slice.call(arguments, 1);
117114
- var evtArr = ((this.e || (this.e = {}))[name2] || []).slice();
117115
- var i = 0;
117116
- var len = evtArr.length;
117117
- for (i; i < len; i++) {
117118
- evtArr[i].fn.apply(evtArr[i].ctx, data);
117119
- }
117120
- return this;
117121
- },
117122
- off: function(name2, callback2) {
117123
- var e = this.e || (this.e = {});
117124
- var evts = e[name2];
117125
- var liveEvents = [];
117126
- if (evts && callback2) {
117127
- for (var i = 0, len = evts.length; i < len; i++) {
117128
- if (evts[i].fn !== callback2 && evts[i].fn._ !== callback2)
117129
- liveEvents.push(evts[i]);
117130
- }
117131
- }
117132
- liveEvents.length ? e[name2] = liveEvents : delete e[name2];
117133
- return this;
117134
- }
117135
- };
117136
- module3.exports = E2;
117137
- module3.exports.TinyEmitter = E2;
117138
- }
117139
- )
117140
- /******/
117141
- };
117142
- var __webpack_module_cache__ = {};
117143
- function __webpack_require__(moduleId) {
117144
- if (__webpack_module_cache__[moduleId]) {
117145
- return __webpack_module_cache__[moduleId].exports;
117146
- }
117147
- var module3 = __webpack_module_cache__[moduleId] = {
117148
- /******/
117149
- // no module.id needed
117150
- /******/
117151
- // no module.loaded needed
117152
- /******/
117153
- exports: {}
117154
- /******/
117155
- };
117156
- __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
117157
- return module3.exports;
117158
- }
117159
- __name(__webpack_require__, "__webpack_require__");
117160
- !function() {
117161
- __webpack_require__.n = function(module3) {
117162
- var getter = module3 && module3.__esModule ? (
117163
- /******/
117164
- function() {
117165
- return module3["default"];
117166
- }
117167
- ) : (
117168
- /******/
117169
- function() {
117170
- return module3;
117171
- }
117172
- );
117173
- __webpack_require__.d(getter, { a: getter });
117174
- return getter;
117175
- };
117176
- }();
117177
- !function() {
117178
- __webpack_require__.d = function(exports3, definition2) {
117179
- for (var key in definition2) {
117180
- if (__webpack_require__.o(definition2, key) && !__webpack_require__.o(exports3, key)) {
117181
- Object.defineProperty(exports3, key, { enumerable: true, get: definition2[key] });
117182
- }
117183
- }
117184
- };
117185
- }();
117186
- !function() {
117187
- __webpack_require__.o = function(obj, prop2) {
117188
- return Object.prototype.hasOwnProperty.call(obj, prop2);
117189
- };
117190
- }();
117191
- return __webpack_require__(134);
117192
- }().default
117193
- );
117194
- });
117195
- })(clipboard$1);
117196
- var clipboardExports = clipboard$1.exports;
117197
- const clipboard = /* @__PURE__ */ getDefaultExportFromCjs(clipboardExports);
117198
- const ClipboardJS = /* @__PURE__ */ _mergeNamespaces({
117199
- __proto__: null,
117200
- default: clipboard
117201
- }, [clipboardExports]);
117202
116408
  var connectionStore = /* @__PURE__ */ new WeakMap();
117203
116409
  var ITERATION_KEY = Symbol("iteration key");
117204
116410
  function storeObservable(obj) {
@@ -123173,7 +122379,7 @@ function showFileDialog({ multiple = false, onSelect }) {
123173
122379
  }
123174
122380
  __name(showFileDialog, "showFileDialog");
123175
122381
  const name = "@teselagen/ove";
123176
- const version = "0.7.3-beta.5";
122382
+ const version = "0.7.3-beta.6";
123177
122383
  const main = "./src/index.js";
123178
122384
  const type = "module";
123179
122385
  const exports$1 = {
@@ -127081,7 +126287,7 @@ function isElementInViewport(el) {
127081
126287
  return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
127082
126288
  }
127083
126289
  __name(isElementInViewport, "isElementInViewport");
127084
- const _Clipboard = class _Clipboard extends React$2.Component {
126290
+ const _Keyboard = class _Keyboard extends React$2.Component {
127085
126291
  constructor() {
127086
126292
  super(...arguments);
127087
126293
  __publicField(this, "handleKeyDown", /* @__PURE__ */ __name((e) => {
@@ -127150,14 +126356,14 @@ const _Clipboard = class _Clipboard extends React$2.Component {
127150
126356
  );
127151
126357
  }
127152
126358
  };
127153
- __name(_Clipboard, "Clipboard");
126359
+ __name(_Keyboard, "Keyboard");
127154
126360
  // static propTypes = {
127155
126361
  // value: PropTypes.string.isRequired
127156
126362
  // };
127157
- __publicField(_Clipboard, "defaultProps", {
126363
+ __publicField(_Keyboard, "defaultProps", {
127158
126364
  className: "clipboard"
127159
126365
  });
127160
- let Clipboard = _Clipboard;
126366
+ let Keyboard = _Keyboard;
127161
126367
  let dragInProgress = false;
127162
126368
  let selectionStartOrEndGrabbed;
127163
126369
  let caretPositionOnDragStart;
@@ -128173,9 +127379,8 @@ function VectorInteractionHOC(Component) {
128173
127379
  const { sequenceData: sequenceData2, readOnly: readOnly2, disableBpEditing, selectionLayer: selectionLayer2 } = this.props;
128174
127380
  const { isProtein: isProtein2 } = sequenceData2;
128175
127381
  const makeTextCopyable = /* @__PURE__ */ __name((transformFunc, className, action2 = "copy") => {
128176
- return new ClipboardJS(`.${className}`, {
128177
- action: () => action2,
128178
- text: () => {
127382
+ document.querySelectorAll(`.${className}`).forEach((element2) => {
127383
+ element2.addEventListener("click", () => __async(this, null, function* () {
128179
127384
  const { selectionLayer: selectionLayer22, editorName, store: store2 } = this.props;
128180
127385
  const { sequenceData: sequenceData22, copyOptions: copyOptions2 } = store2.getState().VectorEditor[editorName];
128181
127386
  const selectedSeqData = getSequenceDataBetweenRange(
@@ -128200,17 +127405,19 @@ function VectorInteractionHOC(Component) {
128200
127405
  sequenceData22
128201
127406
  );
128202
127407
  this.sequenceDataToCopy = sequenceDataToCopy;
128203
- if (action2 === "copy") {
128204
- document.body.addEventListener("copy", this.handleCopy);
128205
- } else {
128206
- document.body.addEventListener("cut", this.handleCut);
128207
- }
128208
- if (window.Cypress) {
128209
- window.Cypress.textToCopy = sequenceDataToCopy.textToCopy;
128210
- window.Cypress.seqDataToCopy = sequenceDataToCopy;
127408
+ const textToCopy = sequenceDataToCopy.textToCopy || sequenceDataToCopy.sequence;
127409
+ try {
127410
+ yield navigator.clipboard.writeText(textToCopy);
127411
+ if (action2 === "cut") {
127412
+ }
127413
+ if (window.Cypress) {
127414
+ window.Cypress.textToCopy = sequenceDataToCopy.textToCopy;
127415
+ window.Cypress.seqDataToCopy = sequenceDataToCopy;
127416
+ }
127417
+ } catch (err2) {
127418
+ console.error(`${action2} failed:`, err2);
128211
127419
  }
128212
- return sequenceDataToCopy.textToCopy || sequenceDataToCopy.sequence;
128213
- }
127420
+ }));
128214
127421
  });
128215
127422
  }, "makeTextCopyable");
128216
127423
  const aaCopy = {
@@ -128848,7 +128055,7 @@ function VectorInteractionHOC(Component) {
128848
128055
  },
128849
128056
  closePanelButton,
128850
128057
  /* @__PURE__ */ React$2.createElement(
128851
- Clipboard,
128058
+ Keyboard,
128852
128059
  {
128853
128060
  value: selectedBps,
128854
128061
  onCopy: this.handleCopy,
@@ -141051,15 +140258,27 @@ ${seqDataToCopy}\r
141051
140258
  this.copyAllAlignmentsFastaClipboardHelper && this.copyAllAlignmentsFastaClipboardHelper.destroy();
141052
140259
  },
141053
140260
  didMount: () => {
141054
- this.copyAllAlignmentsFastaClipboardHelper = new ClipboardJS(
141055
- `.copyAllAlignmentsFastaClipboardHelper`,
141056
- {
141057
- action: "copyAllAlignmentsFasta",
141058
- text: () => {
141059
- return this.getAllAlignmentsFastaText();
141060
- }
141061
- }
140261
+ const elements = document.querySelectorAll(
140262
+ `.copyAllAlignmentsFastaClipboardHelper`
141062
140263
  );
140264
+ elements.forEach((element2) => {
140265
+ element2.addEventListener(
140266
+ "click",
140267
+ () => __async(this, null, function* () {
140268
+ const textToCopy = this.getAllAlignmentsFastaText();
140269
+ try {
140270
+ yield navigator.clipboard.writeText(
140271
+ textToCopy
140272
+ );
140273
+ } catch (err2) {
140274
+ console.error(
140275
+ "Failed to copy text:",
140276
+ err2
140277
+ );
140278
+ }
140279
+ })
140280
+ );
140281
+ });
141063
140282
  },
141064
140283
  onClick: () => {
141065
140284
  window.toastr.success("Selection Copied");
@@ -141072,11 +140291,13 @@ ${seqDataToCopy}\r
141072
140291
  this.copySpecificAlignmentFastaClipboardHelper && this.copySpecificAlignmentFastaClipboardHelper.destroy();
141073
140292
  },
141074
140293
  didMount: () => {
141075
- this.copySpecificAlignmentFastaClipboardHelper = new ClipboardJS(
141076
- `.copySpecificAlignmentFastaClipboardHelper`,
141077
- {
141078
- action: "copySpecificAlignmentFasta",
141079
- text: () => {
140294
+ const elements = document.querySelectorAll(
140295
+ `.copySpecificAlignmentFastaClipboardHelper`
140296
+ );
140297
+ elements.forEach((element2) => {
140298
+ element2.addEventListener(
140299
+ "click",
140300
+ () => __async(this, null, function* () {
141080
140301
  const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
141081
140302
  const seqDataToCopy = getSequenceDataBetweenRange(
141082
140303
  alignmentData,
@@ -141085,10 +140306,19 @@ ${seqDataToCopy}\r
141085
140306
  const seqDataToCopyAsFasta = `>${name2}\r
141086
140307
  ${seqDataToCopy}\r
141087
140308
  `;
141088
- return seqDataToCopyAsFasta;
141089
- }
141090
- }
141091
- );
140309
+ try {
140310
+ yield navigator.clipboard.writeText(
140311
+ seqDataToCopyAsFasta
140312
+ );
140313
+ } catch (err2) {
140314
+ console.error(
140315
+ "Failed to copy text:",
140316
+ err2
140317
+ );
140318
+ }
140319
+ })
140320
+ );
140321
+ });
141092
140322
  },
141093
140323
  onClick: () => {
141094
140324
  window.toastr.success(
@@ -141103,20 +140333,31 @@ ${seqDataToCopy}\r
141103
140333
  this.copySpecificAlignmentAsPlainClipboardHelper && this.copySpecificAlignmentAsPlainClipboardHelper.destroy();
141104
140334
  },
141105
140335
  didMount: () => {
141106
- this.copySpecificAlignmentAsPlainClipboardHelper = new ClipboardJS(
141107
- `.copySpecificAlignmentAsPlainClipboardHelper`,
141108
- {
141109
- action: "copySpecificAlignmentFasta",
141110
- text: () => {
140336
+ const elements = document.querySelectorAll(
140337
+ `.copySpecificAlignmentAsPlainClipboardHelper`
140338
+ );
140339
+ elements.forEach((element2) => {
140340
+ element2.addEventListener(
140341
+ "click",
140342
+ () => __async(this, null, function* () {
141111
140343
  const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
141112
140344
  const seqDataToCopy = getSequenceDataBetweenRange(
141113
140345
  alignmentData,
141114
140346
  selectionLayer2
141115
140347
  ).sequence;
141116
- return seqDataToCopy;
141117
- }
141118
- }
141119
- );
140348
+ try {
140349
+ yield navigator.clipboard.writeText(
140350
+ seqDataToCopy
140351
+ );
140352
+ } catch (err2) {
140353
+ console.error(
140354
+ "Failed to copy text:",
140355
+ err2
140356
+ );
140357
+ }
140358
+ })
140359
+ );
140360
+ });
141120
140361
  },
141121
140362
  onClick: () => {
141122
140363
  window.toastr.success("Selection Copied");