@teselagen/ove 0.7.3-beta.5 → 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.umd.js CHANGED
@@ -9860,25 +9860,16 @@ var __async = (__this, __arguments, generator) => {
9860
9860
  return value;
9861
9861
  }, "GetIntrinsic");
9862
9862
  var callBind$3 = { exports: {} };
9863
- var esDefineProperty;
9864
- var hasRequiredEsDefineProperty;
9865
- function requireEsDefineProperty() {
9866
- if (hasRequiredEsDefineProperty)
9867
- return esDefineProperty;
9868
- hasRequiredEsDefineProperty = 1;
9869
- var GetIntrinsic2 = getIntrinsic;
9870
- var $defineProperty2 = GetIntrinsic2("%Object.defineProperty%", true) || false;
9871
- if ($defineProperty2) {
9872
- try {
9873
- $defineProperty2({}, "a", { value: 1 });
9874
- } catch (e2) {
9875
- $defineProperty2 = false;
9876
- }
9863
+ var GetIntrinsic$4 = getIntrinsic;
9864
+ var $defineProperty$2 = GetIntrinsic$4("%Object.defineProperty%", true) || false;
9865
+ if ($defineProperty$2) {
9866
+ try {
9867
+ $defineProperty$2({}, "a", { value: 1 });
9868
+ } catch (e2) {
9869
+ $defineProperty$2 = false;
9877
9870
  }
9878
- esDefineProperty = $defineProperty2;
9879
- return esDefineProperty;
9880
9871
  }
9881
- __name(requireEsDefineProperty, "requireEsDefineProperty");
9872
+ var esDefineProperty = $defineProperty$2;
9882
9873
  var GetIntrinsic$3 = getIntrinsic;
9883
9874
  var $gOPD$1 = GetIntrinsic$3("%Object.getOwnPropertyDescriptor%", true);
9884
9875
  if ($gOPD$1) {
@@ -9889,7 +9880,7 @@ var __async = (__this, __arguments, generator) => {
9889
9880
  }
9890
9881
  }
9891
9882
  var gopd$1 = $gOPD$1;
9892
- var $defineProperty$1 = requireEsDefineProperty();
9883
+ var $defineProperty$1 = esDefineProperty;
9893
9884
  var $SyntaxError = syntax;
9894
9885
  var $TypeError$4 = type$1;
9895
9886
  var gopd = gopd$1;
@@ -9930,7 +9921,7 @@ var __async = (__this, __arguments, generator) => {
9930
9921
  throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
9931
9922
  }
9932
9923
  }, "defineDataProperty");
9933
- var $defineProperty = requireEsDefineProperty();
9924
+ var $defineProperty = esDefineProperty;
9934
9925
  var hasPropertyDescriptors = /* @__PURE__ */ __name(function hasPropertyDescriptors2() {
9935
9926
  return !!$defineProperty;
9936
9927
  }, "hasPropertyDescriptors");
@@ -9999,7 +9990,7 @@ var __async = (__this, __arguments, generator) => {
9999
9990
  var $apply = GetIntrinsic2("%Function.prototype.apply%");
10000
9991
  var $call = GetIntrinsic2("%Function.prototype.call%");
10001
9992
  var $reflectApply = GetIntrinsic2("%Reflect.apply%", true) || bind2.call($call, $apply);
10002
- var $defineProperty2 = requireEsDefineProperty();
9993
+ var $defineProperty2 = esDefineProperty;
10003
9994
  var $max = GetIntrinsic2("%Math.max%");
10004
9995
  module2.exports = /* @__PURE__ */ __name(function callBind2(originalFunction) {
10005
9996
  if (typeof originalFunction !== "function") {
@@ -98604,11 +98595,19 @@ ${latestSubscriptionCallbackError.current.stack}
98604
98595
  inDialog,
98605
98596
  centeredInPage
98606
98597
  }) => {
98598
+ const [longerThan200MS, setLongerThan200MS] = reactExports.useState(false);
98599
+ reactExports.useEffect(() => {
98600
+ const timeoutId = setTimeout(() => {
98601
+ setLongerThan200MS(true);
98602
+ }, 200);
98603
+ return () => {
98604
+ clearTimeout(timeoutId);
98605
+ };
98606
+ }, []);
98607
98607
  const style2 = __spreadValues(__spreadValues({}, userStyle), inDialog && { minHeight: 120 });
98608
98608
  const LoaderComp = bounce || inDialog ? BounceLoader : DNALoader;
98609
98609
  if (loading || !children) {
98610
- if (!displayInstantly && // !longerThan200MS &&
98611
- (!bounce && !inDialog || withTimeout)) {
98610
+ if (!displayInstantly && !longerThan200MS && (!bounce && !inDialog || withTimeout)) {
98612
98611
  return /* @__PURE__ */ React$2.createElement("div", null);
98613
98612
  }
98614
98613
  return /* @__PURE__ */ React$2.createElement(
@@ -145011,785 +145010,6 @@ ${seq.sequence}
145011
145010
  )(Droppable$1);
145012
145011
  ConnectedDroppable.defaultProps = defaultProps;
145013
145012
  var ConnectedDroppable$1 = ConnectedDroppable;
145014
- var clipboard = { exports: {} };
145015
- /*!
145016
- * clipboard.js v2.0.8
145017
- * https://clipboardjs.com/
145018
- *
145019
- * Licensed MIT © Zeno Rocha
145020
- */
145021
- (function(module2, exports3) {
145022
- (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root2, factory) {
145023
- module2.exports = factory();
145024
- }, "webpackUniversalModuleDefinition"))(commonjsGlobal, function() {
145025
- return (
145026
- /******/
145027
- function() {
145028
- var __webpack_modules__ = {
145029
- /***/
145030
- 134: (
145031
- /***/
145032
- function(__unused_webpack_module, __webpack_exports__, __webpack_require__2) {
145033
- __webpack_require__2.d(__webpack_exports__, {
145034
- "default": function() {
145035
- return (
145036
- /* binding */
145037
- clipboard2
145038
- );
145039
- }
145040
- });
145041
- var tiny_emitter = __webpack_require__2(279);
145042
- var tiny_emitter_default = /* @__PURE__ */ __webpack_require__2.n(tiny_emitter);
145043
- var listen = __webpack_require__2(370);
145044
- var listen_default = /* @__PURE__ */ __webpack_require__2.n(listen);
145045
- var src_select = __webpack_require__2(817);
145046
- var select_default = /* @__PURE__ */ __webpack_require__2.n(src_select);
145047
- function _typeof2(obj) {
145048
- "@babel/helpers - typeof";
145049
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
145050
- _typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
145051
- return typeof obj2;
145052
- }, "_typeof");
145053
- } else {
145054
- _typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
145055
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
145056
- }, "_typeof");
145057
- }
145058
- return _typeof2(obj);
145059
- }
145060
- __name(_typeof2, "_typeof");
145061
- function _classCallCheck2(instance, Constructor) {
145062
- if (!(instance instanceof Constructor)) {
145063
- throw new TypeError("Cannot call a class as a function");
145064
- }
145065
- }
145066
- __name(_classCallCheck2, "_classCallCheck");
145067
- function _defineProperties2(target, props) {
145068
- for (var i2 = 0; i2 < props.length; i2++) {
145069
- var descriptor = props[i2];
145070
- descriptor.enumerable = descriptor.enumerable || false;
145071
- descriptor.configurable = true;
145072
- if ("value" in descriptor)
145073
- descriptor.writable = true;
145074
- Object.defineProperty(target, descriptor.key, descriptor);
145075
- }
145076
- }
145077
- __name(_defineProperties2, "_defineProperties");
145078
- function _createClass2(Constructor, protoProps, staticProps) {
145079
- if (protoProps)
145080
- _defineProperties2(Constructor.prototype, protoProps);
145081
- return Constructor;
145082
- }
145083
- __name(_createClass2, "_createClass");
145084
- var ClipboardAction = /* @__PURE__ */ function() {
145085
- function ClipboardAction2(options) {
145086
- _classCallCheck2(this, ClipboardAction2);
145087
- this.resolveOptions(options);
145088
- this.initSelection();
145089
- }
145090
- __name(ClipboardAction2, "ClipboardAction");
145091
- _createClass2(ClipboardAction2, [{
145092
- key: "resolveOptions",
145093
- value: /* @__PURE__ */ __name(function resolveOptions() {
145094
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
145095
- this.action = options.action;
145096
- this.container = options.container;
145097
- this.emitter = options.emitter;
145098
- this.target = options.target;
145099
- this.text = options.text;
145100
- this.trigger = options.trigger;
145101
- this.selectedText = "";
145102
- }, "resolveOptions")
145103
- /**
145104
- * Decides which selection strategy is going to be applied based
145105
- * on the existence of `text` and `target` properties.
145106
- */
145107
- }, {
145108
- key: "initSelection",
145109
- value: /* @__PURE__ */ __name(function initSelection() {
145110
- if (this.text) {
145111
- this.selectFake();
145112
- } else if (this.target) {
145113
- this.selectTarget();
145114
- }
145115
- }, "initSelection")
145116
- /**
145117
- * Creates a fake textarea element, sets its value from `text` property,
145118
- */
145119
- }, {
145120
- key: "createFakeElement",
145121
- value: /* @__PURE__ */ __name(function createFakeElement() {
145122
- var isRTL = document.documentElement.getAttribute("dir") === "rtl";
145123
- this.fakeElem = document.createElement("textarea");
145124
- this.fakeElem.style.fontSize = "12pt";
145125
- this.fakeElem.style.border = "0";
145126
- this.fakeElem.style.padding = "0";
145127
- this.fakeElem.style.margin = "0";
145128
- this.fakeElem.style.position = "absolute";
145129
- this.fakeElem.style[isRTL ? "right" : "left"] = "-9999px";
145130
- var yPosition = window.pageYOffset || document.documentElement.scrollTop;
145131
- this.fakeElem.style.top = "".concat(yPosition, "px");
145132
- this.fakeElem.setAttribute("readonly", "");
145133
- this.fakeElem.value = this.text;
145134
- return this.fakeElem;
145135
- }, "createFakeElement")
145136
- /**
145137
- * Get's the value of fakeElem,
145138
- * and makes a selection on it.
145139
- */
145140
- }, {
145141
- key: "selectFake",
145142
- value: /* @__PURE__ */ __name(function selectFake() {
145143
- var _this = this;
145144
- var fakeElem = this.createFakeElement();
145145
- this.fakeHandlerCallback = function() {
145146
- return _this.removeFake();
145147
- };
145148
- this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || true;
145149
- this.container.appendChild(fakeElem);
145150
- this.selectedText = select_default()(fakeElem);
145151
- this.copyText();
145152
- this.removeFake();
145153
- }, "selectFake")
145154
- /**
145155
- * Only removes the fake element after another click event, that way
145156
- * a user can hit `Ctrl+C` to copy because selection still exists.
145157
- */
145158
- }, {
145159
- key: "removeFake",
145160
- value: /* @__PURE__ */ __name(function removeFake() {
145161
- if (this.fakeHandler) {
145162
- this.container.removeEventListener("click", this.fakeHandlerCallback);
145163
- this.fakeHandler = null;
145164
- this.fakeHandlerCallback = null;
145165
- }
145166
- if (this.fakeElem) {
145167
- this.container.removeChild(this.fakeElem);
145168
- this.fakeElem = null;
145169
- }
145170
- }, "removeFake")
145171
- /**
145172
- * Selects the content from element passed on `target` property.
145173
- */
145174
- }, {
145175
- key: "selectTarget",
145176
- value: /* @__PURE__ */ __name(function selectTarget() {
145177
- this.selectedText = select_default()(this.target);
145178
- this.copyText();
145179
- }, "selectTarget")
145180
- /**
145181
- * Executes the copy operation based on the current selection.
145182
- */
145183
- }, {
145184
- key: "copyText",
145185
- value: /* @__PURE__ */ __name(function copyText() {
145186
- var succeeded;
145187
- try {
145188
- succeeded = document.execCommand(this.action);
145189
- } catch (err2) {
145190
- succeeded = false;
145191
- }
145192
- this.handleResult(succeeded);
145193
- }, "copyText")
145194
- /**
145195
- * Fires an event based on the copy operation result.
145196
- * @param {Boolean} succeeded
145197
- */
145198
- }, {
145199
- key: "handleResult",
145200
- value: /* @__PURE__ */ __name(function handleResult(succeeded) {
145201
- this.emitter.emit(succeeded ? "success" : "error", {
145202
- action: this.action,
145203
- text: this.selectedText,
145204
- trigger: this.trigger,
145205
- clearSelection: this.clearSelection.bind(this)
145206
- });
145207
- }, "handleResult")
145208
- /**
145209
- * Moves focus away from `target` and back to the trigger, removes current selection.
145210
- */
145211
- }, {
145212
- key: "clearSelection",
145213
- value: /* @__PURE__ */ __name(function clearSelection() {
145214
- if (this.trigger) {
145215
- this.trigger.focus();
145216
- }
145217
- document.activeElement.blur();
145218
- window.getSelection().removeAllRanges();
145219
- }, "clearSelection")
145220
- /**
145221
- * Sets the `action` to be performed which can be either 'copy' or 'cut'.
145222
- * @param {String} action
145223
- */
145224
- }, {
145225
- key: "destroy",
145226
- /**
145227
- * Destroy lifecycle.
145228
- */
145229
- value: /* @__PURE__ */ __name(function destroy2() {
145230
- this.removeFake();
145231
- }, "destroy")
145232
- }, {
145233
- key: "action",
145234
- set: /* @__PURE__ */ __name(function set2() {
145235
- var action2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "copy";
145236
- this._action = action2;
145237
- if (this._action !== "copy" && this._action !== "cut") {
145238
- throw new Error('Invalid "action" value, use either "copy" or "cut"');
145239
- }
145240
- }, "set"),
145241
- get: /* @__PURE__ */ __name(function get2() {
145242
- return this._action;
145243
- }, "get")
145244
- /**
145245
- * Sets the `target` property using an element
145246
- * that will be have its content copied.
145247
- * @param {Element} target
145248
- */
145249
- }, {
145250
- key: "target",
145251
- set: /* @__PURE__ */ __name(function set2(target) {
145252
- if (target !== void 0) {
145253
- if (target && _typeof2(target) === "object" && target.nodeType === 1) {
145254
- if (this.action === "copy" && target.hasAttribute("disabled")) {
145255
- throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
145256
- }
145257
- if (this.action === "cut" && (target.hasAttribute("readonly") || target.hasAttribute("disabled"))) {
145258
- throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
145259
- }
145260
- this._target = target;
145261
- } else {
145262
- throw new Error('Invalid "target" value, use a valid Element');
145263
- }
145264
- }
145265
- }, "set"),
145266
- get: /* @__PURE__ */ __name(function get2() {
145267
- return this._target;
145268
- }, "get")
145269
- }]);
145270
- return ClipboardAction2;
145271
- }();
145272
- var clipboard_action = ClipboardAction;
145273
- function clipboard_typeof(obj) {
145274
- "@babel/helpers - typeof";
145275
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
145276
- clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
145277
- return typeof obj2;
145278
- }, "_typeof");
145279
- } else {
145280
- clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
145281
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
145282
- }, "_typeof");
145283
- }
145284
- return clipboard_typeof(obj);
145285
- }
145286
- __name(clipboard_typeof, "clipboard_typeof");
145287
- function clipboard_classCallCheck(instance, Constructor) {
145288
- if (!(instance instanceof Constructor)) {
145289
- throw new TypeError("Cannot call a class as a function");
145290
- }
145291
- }
145292
- __name(clipboard_classCallCheck, "clipboard_classCallCheck");
145293
- function clipboard_defineProperties(target, props) {
145294
- for (var i2 = 0; i2 < props.length; i2++) {
145295
- var descriptor = props[i2];
145296
- descriptor.enumerable = descriptor.enumerable || false;
145297
- descriptor.configurable = true;
145298
- if ("value" in descriptor)
145299
- descriptor.writable = true;
145300
- Object.defineProperty(target, descriptor.key, descriptor);
145301
- }
145302
- }
145303
- __name(clipboard_defineProperties, "clipboard_defineProperties");
145304
- function clipboard_createClass(Constructor, protoProps, staticProps) {
145305
- if (protoProps)
145306
- clipboard_defineProperties(Constructor.prototype, protoProps);
145307
- if (staticProps)
145308
- clipboard_defineProperties(Constructor, staticProps);
145309
- return Constructor;
145310
- }
145311
- __name(clipboard_createClass, "clipboard_createClass");
145312
- function _inherits2(subClass, superClass) {
145313
- if (typeof superClass !== "function" && superClass !== null) {
145314
- throw new TypeError("Super expression must either be null or a function");
145315
- }
145316
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
145317
- if (superClass)
145318
- _setPrototypeOf2(subClass, superClass);
145319
- }
145320
- __name(_inherits2, "_inherits");
145321
- function _setPrototypeOf2(o2, p2) {
145322
- _setPrototypeOf2 = Object.setPrototypeOf || /* @__PURE__ */ __name(function _setPrototypeOf3(o3, p3) {
145323
- o3.__proto__ = p3;
145324
- return o3;
145325
- }, "_setPrototypeOf");
145326
- return _setPrototypeOf2(o2, p2);
145327
- }
145328
- __name(_setPrototypeOf2, "_setPrototypeOf");
145329
- function _createSuper2(Derived) {
145330
- var hasNativeReflectConstruct = _isNativeReflectConstruct2();
145331
- return /* @__PURE__ */ __name(function _createSuperInternal() {
145332
- var Super = _getPrototypeOf2(Derived), result;
145333
- if (hasNativeReflectConstruct) {
145334
- var NewTarget = _getPrototypeOf2(this).constructor;
145335
- result = Reflect.construct(Super, arguments, NewTarget);
145336
- } else {
145337
- result = Super.apply(this, arguments);
145338
- }
145339
- return _possibleConstructorReturn2(this, result);
145340
- }, "_createSuperInternal");
145341
- }
145342
- __name(_createSuper2, "_createSuper");
145343
- function _possibleConstructorReturn2(self2, call2) {
145344
- if (call2 && (clipboard_typeof(call2) === "object" || typeof call2 === "function")) {
145345
- return call2;
145346
- }
145347
- return _assertThisInitialized2(self2);
145348
- }
145349
- __name(_possibleConstructorReturn2, "_possibleConstructorReturn");
145350
- function _assertThisInitialized2(self2) {
145351
- if (self2 === void 0) {
145352
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
145353
- }
145354
- return self2;
145355
- }
145356
- __name(_assertThisInitialized2, "_assertThisInitialized");
145357
- function _isNativeReflectConstruct2() {
145358
- if (typeof Reflect === "undefined" || !Reflect.construct)
145359
- return false;
145360
- if (Reflect.construct.sham)
145361
- return false;
145362
- if (typeof Proxy === "function")
145363
- return true;
145364
- try {
145365
- Date.prototype.toString.call(Reflect.construct(Date, [], function() {
145366
- }));
145367
- return true;
145368
- } catch (e2) {
145369
- return false;
145370
- }
145371
- }
145372
- __name(_isNativeReflectConstruct2, "_isNativeReflectConstruct");
145373
- function _getPrototypeOf2(o2) {
145374
- _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : /* @__PURE__ */ __name(function _getPrototypeOf3(o3) {
145375
- return o3.__proto__ || Object.getPrototypeOf(o3);
145376
- }, "_getPrototypeOf");
145377
- return _getPrototypeOf2(o2);
145378
- }
145379
- __name(_getPrototypeOf2, "_getPrototypeOf");
145380
- function getAttributeValue(suffix, element2) {
145381
- var attribute = "data-clipboard-".concat(suffix);
145382
- if (!element2.hasAttribute(attribute)) {
145383
- return;
145384
- }
145385
- return element2.getAttribute(attribute);
145386
- }
145387
- __name(getAttributeValue, "getAttributeValue");
145388
- var Clipboard2 = /* @__PURE__ */ function(_Emitter) {
145389
- _inherits2(Clipboard3, _Emitter);
145390
- var _super = _createSuper2(Clipboard3);
145391
- function Clipboard3(trigger2, options) {
145392
- var _this;
145393
- clipboard_classCallCheck(this, Clipboard3);
145394
- _this = _super.call(this);
145395
- _this.resolveOptions(options);
145396
- _this.listenClick(trigger2);
145397
- return _this;
145398
- }
145399
- __name(Clipboard3, "Clipboard");
145400
- clipboard_createClass(Clipboard3, [{
145401
- key: "resolveOptions",
145402
- value: /* @__PURE__ */ __name(function resolveOptions() {
145403
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
145404
- this.action = typeof options.action === "function" ? options.action : this.defaultAction;
145405
- this.target = typeof options.target === "function" ? options.target : this.defaultTarget;
145406
- this.text = typeof options.text === "function" ? options.text : this.defaultText;
145407
- this.container = clipboard_typeof(options.container) === "object" ? options.container : document.body;
145408
- }, "resolveOptions")
145409
- /**
145410
- * Adds a click event listener to the passed trigger.
145411
- * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
145412
- */
145413
- }, {
145414
- key: "listenClick",
145415
- value: /* @__PURE__ */ __name(function listenClick(trigger2) {
145416
- var _this2 = this;
145417
- this.listener = listen_default()(trigger2, "click", function(e2) {
145418
- return _this2.onClick(e2);
145419
- });
145420
- }, "listenClick")
145421
- /**
145422
- * Defines a new `ClipboardAction` on each click event.
145423
- * @param {Event} e
145424
- */
145425
- }, {
145426
- key: "onClick",
145427
- value: /* @__PURE__ */ __name(function onClick(e2) {
145428
- var trigger2 = e2.delegateTarget || e2.currentTarget;
145429
- if (this.clipboardAction) {
145430
- this.clipboardAction = null;
145431
- }
145432
- this.clipboardAction = new clipboard_action({
145433
- action: this.action(trigger2),
145434
- target: this.target(trigger2),
145435
- text: this.text(trigger2),
145436
- container: this.container,
145437
- trigger: trigger2,
145438
- emitter: this
145439
- });
145440
- }, "onClick")
145441
- /**
145442
- * Default `action` lookup function.
145443
- * @param {Element} trigger
145444
- */
145445
- }, {
145446
- key: "defaultAction",
145447
- value: /* @__PURE__ */ __name(function defaultAction(trigger2) {
145448
- return getAttributeValue("action", trigger2);
145449
- }, "defaultAction")
145450
- /**
145451
- * Default `target` lookup function.
145452
- * @param {Element} trigger
145453
- */
145454
- }, {
145455
- key: "defaultTarget",
145456
- value: /* @__PURE__ */ __name(function defaultTarget(trigger2) {
145457
- var selector = getAttributeValue("target", trigger2);
145458
- if (selector) {
145459
- return document.querySelector(selector);
145460
- }
145461
- }, "defaultTarget")
145462
- /**
145463
- * Returns the support of the given action, or all actions if no action is
145464
- * given.
145465
- * @param {String} [action]
145466
- */
145467
- }, {
145468
- key: "defaultText",
145469
- /**
145470
- * Default `text` lookup function.
145471
- * @param {Element} trigger
145472
- */
145473
- value: /* @__PURE__ */ __name(function defaultText(trigger2) {
145474
- return getAttributeValue("text", trigger2);
145475
- }, "defaultText")
145476
- /**
145477
- * Destroy lifecycle.
145478
- */
145479
- }, {
145480
- key: "destroy",
145481
- value: /* @__PURE__ */ __name(function destroy2() {
145482
- this.listener.destroy();
145483
- if (this.clipboardAction) {
145484
- this.clipboardAction.destroy();
145485
- this.clipboardAction = null;
145486
- }
145487
- }, "destroy")
145488
- }], [{
145489
- key: "isSupported",
145490
- value: /* @__PURE__ */ __name(function isSupported() {
145491
- var action2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"];
145492
- var actions2 = typeof action2 === "string" ? [action2] : action2;
145493
- var support = !!document.queryCommandSupported;
145494
- actions2.forEach(function(action3) {
145495
- support = support && !!document.queryCommandSupported(action3);
145496
- });
145497
- return support;
145498
- }, "isSupported")
145499
- }]);
145500
- return Clipboard3;
145501
- }(tiny_emitter_default());
145502
- var clipboard2 = Clipboard2;
145503
- }
145504
- ),
145505
- /***/
145506
- 828: (
145507
- /***/
145508
- function(module3) {
145509
- var DOCUMENT_NODE_TYPE = 9;
145510
- if (typeof Element !== "undefined" && !Element.prototype.matches) {
145511
- var proto = Element.prototype;
145512
- proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
145513
- }
145514
- function closest2(element2, selector) {
145515
- while (element2 && element2.nodeType !== DOCUMENT_NODE_TYPE) {
145516
- if (typeof element2.matches === "function" && element2.matches(selector)) {
145517
- return element2;
145518
- }
145519
- element2 = element2.parentNode;
145520
- }
145521
- }
145522
- __name(closest2, "closest");
145523
- module3.exports = closest2;
145524
- }
145525
- ),
145526
- /***/
145527
- 438: (
145528
- /***/
145529
- function(module3, __unused_webpack_exports, __webpack_require__2) {
145530
- var closest2 = __webpack_require__2(828);
145531
- function _delegate(element2, selector, type2, callback2, useCapture) {
145532
- var listenerFn = listener.apply(this, arguments);
145533
- element2.addEventListener(type2, listenerFn, useCapture);
145534
- return {
145535
- destroy: function() {
145536
- element2.removeEventListener(type2, listenerFn, useCapture);
145537
- }
145538
- };
145539
- }
145540
- __name(_delegate, "_delegate");
145541
- function delegate(elements, selector, type2, callback2, useCapture) {
145542
- if (typeof elements.addEventListener === "function") {
145543
- return _delegate.apply(null, arguments);
145544
- }
145545
- if (typeof type2 === "function") {
145546
- return _delegate.bind(null, document).apply(null, arguments);
145547
- }
145548
- if (typeof elements === "string") {
145549
- elements = document.querySelectorAll(elements);
145550
- }
145551
- return Array.prototype.map.call(elements, function(element2) {
145552
- return _delegate(element2, selector, type2, callback2, useCapture);
145553
- });
145554
- }
145555
- __name(delegate, "delegate");
145556
- function listener(element2, selector, type2, callback2) {
145557
- return function(e2) {
145558
- e2.delegateTarget = closest2(e2.target, selector);
145559
- if (e2.delegateTarget) {
145560
- callback2.call(element2, e2);
145561
- }
145562
- };
145563
- }
145564
- __name(listener, "listener");
145565
- module3.exports = delegate;
145566
- }
145567
- ),
145568
- /***/
145569
- 879: (
145570
- /***/
145571
- function(__unused_webpack_module, exports4) {
145572
- exports4.node = function(value) {
145573
- return value !== void 0 && value instanceof HTMLElement && value.nodeType === 1;
145574
- };
145575
- exports4.nodeList = function(value) {
145576
- var type2 = Object.prototype.toString.call(value);
145577
- return value !== void 0 && (type2 === "[object NodeList]" || type2 === "[object HTMLCollection]") && "length" in value && (value.length === 0 || exports4.node(value[0]));
145578
- };
145579
- exports4.string = function(value) {
145580
- return typeof value === "string" || value instanceof String;
145581
- };
145582
- exports4.fn = function(value) {
145583
- var type2 = Object.prototype.toString.call(value);
145584
- return type2 === "[object Function]";
145585
- };
145586
- }
145587
- ),
145588
- /***/
145589
- 370: (
145590
- /***/
145591
- function(module3, __unused_webpack_exports, __webpack_require__2) {
145592
- var is2 = __webpack_require__2(879);
145593
- var delegate = __webpack_require__2(438);
145594
- function listen(target, type2, callback2) {
145595
- if (!target && !type2 && !callback2) {
145596
- throw new Error("Missing required arguments");
145597
- }
145598
- if (!is2.string(type2)) {
145599
- throw new TypeError("Second argument must be a String");
145600
- }
145601
- if (!is2.fn(callback2)) {
145602
- throw new TypeError("Third argument must be a Function");
145603
- }
145604
- if (is2.node(target)) {
145605
- return listenNode(target, type2, callback2);
145606
- } else if (is2.nodeList(target)) {
145607
- return listenNodeList(target, type2, callback2);
145608
- } else if (is2.string(target)) {
145609
- return listenSelector(target, type2, callback2);
145610
- } else {
145611
- throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
145612
- }
145613
- }
145614
- __name(listen, "listen");
145615
- function listenNode(node2, type2, callback2) {
145616
- node2.addEventListener(type2, callback2);
145617
- return {
145618
- destroy: function() {
145619
- node2.removeEventListener(type2, callback2);
145620
- }
145621
- };
145622
- }
145623
- __name(listenNode, "listenNode");
145624
- function listenNodeList(nodeList, type2, callback2) {
145625
- Array.prototype.forEach.call(nodeList, function(node2) {
145626
- node2.addEventListener(type2, callback2);
145627
- });
145628
- return {
145629
- destroy: function() {
145630
- Array.prototype.forEach.call(nodeList, function(node2) {
145631
- node2.removeEventListener(type2, callback2);
145632
- });
145633
- }
145634
- };
145635
- }
145636
- __name(listenNodeList, "listenNodeList");
145637
- function listenSelector(selector, type2, callback2) {
145638
- return delegate(document.body, selector, type2, callback2);
145639
- }
145640
- __name(listenSelector, "listenSelector");
145641
- module3.exports = listen;
145642
- }
145643
- ),
145644
- /***/
145645
- 817: (
145646
- /***/
145647
- function(module3) {
145648
- function select(element2) {
145649
- var selectedText;
145650
- if (element2.nodeName === "SELECT") {
145651
- element2.focus();
145652
- selectedText = element2.value;
145653
- } else if (element2.nodeName === "INPUT" || element2.nodeName === "TEXTAREA") {
145654
- var isReadOnly = element2.hasAttribute("readonly");
145655
- if (!isReadOnly) {
145656
- element2.setAttribute("readonly", "");
145657
- }
145658
- element2.select();
145659
- element2.setSelectionRange(0, element2.value.length);
145660
- if (!isReadOnly) {
145661
- element2.removeAttribute("readonly");
145662
- }
145663
- selectedText = element2.value;
145664
- } else {
145665
- if (element2.hasAttribute("contenteditable")) {
145666
- element2.focus();
145667
- }
145668
- var selection = window.getSelection();
145669
- var range2 = document.createRange();
145670
- range2.selectNodeContents(element2);
145671
- selection.removeAllRanges();
145672
- selection.addRange(range2);
145673
- selectedText = selection.toString();
145674
- }
145675
- return selectedText;
145676
- }
145677
- __name(select, "select");
145678
- module3.exports = select;
145679
- }
145680
- ),
145681
- /***/
145682
- 279: (
145683
- /***/
145684
- function(module3) {
145685
- function E2() {
145686
- }
145687
- __name(E2, "E");
145688
- E2.prototype = {
145689
- on: function(name2, callback2, ctx) {
145690
- var e2 = this.e || (this.e = {});
145691
- (e2[name2] || (e2[name2] = [])).push({
145692
- fn: callback2,
145693
- ctx
145694
- });
145695
- return this;
145696
- },
145697
- once: function(name2, callback2, ctx) {
145698
- var self2 = this;
145699
- function listener() {
145700
- self2.off(name2, listener);
145701
- callback2.apply(ctx, arguments);
145702
- }
145703
- __name(listener, "listener");
145704
- listener._ = callback2;
145705
- return this.on(name2, listener, ctx);
145706
- },
145707
- emit: function(name2) {
145708
- var data = [].slice.call(arguments, 1);
145709
- var evtArr = ((this.e || (this.e = {}))[name2] || []).slice();
145710
- var i2 = 0;
145711
- var len2 = evtArr.length;
145712
- for (i2; i2 < len2; i2++) {
145713
- evtArr[i2].fn.apply(evtArr[i2].ctx, data);
145714
- }
145715
- return this;
145716
- },
145717
- off: function(name2, callback2) {
145718
- var e2 = this.e || (this.e = {});
145719
- var evts = e2[name2];
145720
- var liveEvents = [];
145721
- if (evts && callback2) {
145722
- for (var i2 = 0, len2 = evts.length; i2 < len2; i2++) {
145723
- if (evts[i2].fn !== callback2 && evts[i2].fn._ !== callback2)
145724
- liveEvents.push(evts[i2]);
145725
- }
145726
- }
145727
- liveEvents.length ? e2[name2] = liveEvents : delete e2[name2];
145728
- return this;
145729
- }
145730
- };
145731
- module3.exports = E2;
145732
- module3.exports.TinyEmitter = E2;
145733
- }
145734
- )
145735
- /******/
145736
- };
145737
- var __webpack_module_cache__ = {};
145738
- function __webpack_require__(moduleId) {
145739
- if (__webpack_module_cache__[moduleId]) {
145740
- return __webpack_module_cache__[moduleId].exports;
145741
- }
145742
- var module3 = __webpack_module_cache__[moduleId] = {
145743
- /******/
145744
- // no module.id needed
145745
- /******/
145746
- // no module.loaded needed
145747
- /******/
145748
- exports: {}
145749
- /******/
145750
- };
145751
- __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
145752
- return module3.exports;
145753
- }
145754
- __name(__webpack_require__, "__webpack_require__");
145755
- !function() {
145756
- __webpack_require__.n = function(module3) {
145757
- var getter = module3 && module3.__esModule ? (
145758
- /******/
145759
- function() {
145760
- return module3["default"];
145761
- }
145762
- ) : (
145763
- /******/
145764
- function() {
145765
- return module3;
145766
- }
145767
- );
145768
- __webpack_require__.d(getter, { a: getter });
145769
- return getter;
145770
- };
145771
- }();
145772
- !function() {
145773
- __webpack_require__.d = function(exports4, definition2) {
145774
- for (var key2 in definition2) {
145775
- if (__webpack_require__.o(definition2, key2) && !__webpack_require__.o(exports4, key2)) {
145776
- Object.defineProperty(exports4, key2, { enumerable: true, get: definition2[key2] });
145777
- }
145778
- }
145779
- };
145780
- }();
145781
- !function() {
145782
- __webpack_require__.o = function(obj, prop2) {
145783
- return Object.prototype.hasOwnProperty.call(obj, prop2);
145784
- };
145785
- }();
145786
- return __webpack_require__(134);
145787
- }().default
145788
- );
145789
- });
145790
- })(clipboard);
145791
- var clipboardExports = clipboard.exports;
145792
- const Clipboard$1 = /* @__PURE__ */ getDefaultExportFromCjs(clipboardExports);
145793
145013
  var connectionStore = /* @__PURE__ */ new WeakMap();
145794
145014
  var ITERATION_KEY = Symbol("iteration key");
145795
145015
  function storeObservable(obj) {
@@ -151730,7 +150950,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
151730
150950
  }
151731
150951
  __name(showFileDialog, "showFileDialog");
151732
150952
  const name = "@teselagen/ove";
151733
- const version = "0.7.3-beta.4";
150953
+ const version = "0.7.3-beta.6";
151734
150954
  const main = "./src/index.js";
151735
150955
  const type = "module";
151736
150956
  const exports$1 = {
@@ -154033,7 +153253,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
154033
153253
  return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
154034
153254
  }
154035
153255
  __name(isElementInViewport, "isElementInViewport");
154036
- const _Clipboard = class _Clipboard extends React$2.Component {
153256
+ const _Keyboard = class _Keyboard extends React$2.Component {
154037
153257
  constructor() {
154038
153258
  super(...arguments);
154039
153259
  __publicField(this, "handleKeyDown", /* @__PURE__ */ __name((e2) => {
@@ -154102,14 +153322,14 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
154102
153322
  );
154103
153323
  }
154104
153324
  };
154105
- __name(_Clipboard, "Clipboard");
153325
+ __name(_Keyboard, "Keyboard");
154106
153326
  // static propTypes = {
154107
153327
  // value: PropTypes.string.isRequired
154108
153328
  // };
154109
- __publicField(_Clipboard, "defaultProps", {
153329
+ __publicField(_Keyboard, "defaultProps", {
154110
153330
  className: "clipboard"
154111
153331
  });
154112
- let Clipboard = _Clipboard;
153332
+ let Keyboard = _Keyboard;
154113
153333
  let dragInProgress = false;
154114
153334
  let selectionStartOrEndGrabbed;
154115
153335
  let caretPositionOnDragStart;
@@ -155125,9 +154345,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
155125
154345
  const { sequenceData: sequenceData2, readOnly: readOnly2, disableBpEditing, selectionLayer: selectionLayer2 } = this.props;
155126
154346
  const { isProtein: isProtein2 } = sequenceData2;
155127
154347
  const makeTextCopyable = /* @__PURE__ */ __name((transformFunc, className, action2 = "copy") => {
155128
- return new Clipboard$1(`.${className}`, {
155129
- action: () => action2,
155130
- text: () => {
154348
+ document.querySelectorAll(`.${className}`).forEach((element2) => {
154349
+ element2.addEventListener("click", () => __async(this, null, function* () {
155131
154350
  const { selectionLayer: selectionLayer22, editorName, store: store2 } = this.props;
155132
154351
  const { sequenceData: sequenceData22, copyOptions: copyOptions2 } = store2.getState().VectorEditor[editorName];
155133
154352
  const selectedSeqData = getSequenceDataBetweenRange(
@@ -155152,17 +154371,19 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
155152
154371
  sequenceData22
155153
154372
  );
155154
154373
  this.sequenceDataToCopy = sequenceDataToCopy;
155155
- if (action2 === "copy") {
155156
- document.body.addEventListener("copy", this.handleCopy);
155157
- } else {
155158
- document.body.addEventListener("cut", this.handleCut);
155159
- }
155160
- if (window.Cypress) {
155161
- window.Cypress.textToCopy = sequenceDataToCopy.textToCopy;
155162
- window.Cypress.seqDataToCopy = sequenceDataToCopy;
154374
+ const textToCopy = sequenceDataToCopy.textToCopy || sequenceDataToCopy.sequence;
154375
+ try {
154376
+ yield navigator.clipboard.writeText(textToCopy);
154377
+ if (action2 === "cut") {
154378
+ }
154379
+ if (window.Cypress) {
154380
+ window.Cypress.textToCopy = sequenceDataToCopy.textToCopy;
154381
+ window.Cypress.seqDataToCopy = sequenceDataToCopy;
154382
+ }
154383
+ } catch (err2) {
154384
+ console.error(`${action2} failed:`, err2);
155163
154385
  }
155164
- return sequenceDataToCopy.textToCopy || sequenceDataToCopy.sequence;
155165
- }
154386
+ }));
155166
154387
  });
155167
154388
  }, "makeTextCopyable");
155168
154389
  const aaCopy = {
@@ -155800,7 +155021,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
155800
155021
  },
155801
155022
  closePanelButton,
155802
155023
  /* @__PURE__ */ React$2.createElement(
155803
- Clipboard,
155024
+ Keyboard,
155804
155025
  {
155805
155026
  value: selectedBps,
155806
155027
  onCopy: this.handleCopy,
@@ -168003,15 +167224,27 @@ ${seqDataToCopy}\r
168003
167224
  this.copyAllAlignmentsFastaClipboardHelper && this.copyAllAlignmentsFastaClipboardHelper.destroy();
168004
167225
  },
168005
167226
  didMount: () => {
168006
- this.copyAllAlignmentsFastaClipboardHelper = new Clipboard$1(
168007
- `.copyAllAlignmentsFastaClipboardHelper`,
168008
- {
168009
- action: "copyAllAlignmentsFasta",
168010
- text: () => {
168011
- return this.getAllAlignmentsFastaText();
168012
- }
168013
- }
167227
+ const elements = document.querySelectorAll(
167228
+ `.copyAllAlignmentsFastaClipboardHelper`
168014
167229
  );
167230
+ elements.forEach((element2) => {
167231
+ element2.addEventListener(
167232
+ "click",
167233
+ () => __async(this, null, function* () {
167234
+ const textToCopy = this.getAllAlignmentsFastaText();
167235
+ try {
167236
+ yield navigator.clipboard.writeText(
167237
+ textToCopy
167238
+ );
167239
+ } catch (err2) {
167240
+ console.error(
167241
+ "Failed to copy text:",
167242
+ err2
167243
+ );
167244
+ }
167245
+ })
167246
+ );
167247
+ });
168015
167248
  },
168016
167249
  onClick: () => {
168017
167250
  window.toastr.success("Selection Copied");
@@ -168024,11 +167257,13 @@ ${seqDataToCopy}\r
168024
167257
  this.copySpecificAlignmentFastaClipboardHelper && this.copySpecificAlignmentFastaClipboardHelper.destroy();
168025
167258
  },
168026
167259
  didMount: () => {
168027
- this.copySpecificAlignmentFastaClipboardHelper = new Clipboard$1(
168028
- `.copySpecificAlignmentFastaClipboardHelper`,
168029
- {
168030
- action: "copySpecificAlignmentFasta",
168031
- text: () => {
167260
+ const elements = document.querySelectorAll(
167261
+ `.copySpecificAlignmentFastaClipboardHelper`
167262
+ );
167263
+ elements.forEach((element2) => {
167264
+ element2.addEventListener(
167265
+ "click",
167266
+ () => __async(this, null, function* () {
168032
167267
  const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
168033
167268
  const seqDataToCopy = getSequenceDataBetweenRange(
168034
167269
  alignmentData,
@@ -168037,10 +167272,19 @@ ${seqDataToCopy}\r
168037
167272
  const seqDataToCopyAsFasta = `>${name2}\r
168038
167273
  ${seqDataToCopy}\r
168039
167274
  `;
168040
- return seqDataToCopyAsFasta;
168041
- }
168042
- }
168043
- );
167275
+ try {
167276
+ yield navigator.clipboard.writeText(
167277
+ seqDataToCopyAsFasta
167278
+ );
167279
+ } catch (err2) {
167280
+ console.error(
167281
+ "Failed to copy text:",
167282
+ err2
167283
+ );
167284
+ }
167285
+ })
167286
+ );
167287
+ });
168044
167288
  },
168045
167289
  onClick: () => {
168046
167290
  window.toastr.success(
@@ -168055,20 +167299,31 @@ ${seqDataToCopy}\r
168055
167299
  this.copySpecificAlignmentAsPlainClipboardHelper && this.copySpecificAlignmentAsPlainClipboardHelper.destroy();
168056
167300
  },
168057
167301
  didMount: () => {
168058
- this.copySpecificAlignmentAsPlainClipboardHelper = new Clipboard$1(
168059
- `.copySpecificAlignmentAsPlainClipboardHelper`,
168060
- {
168061
- action: "copySpecificAlignmentFasta",
168062
- text: () => {
167302
+ const elements = document.querySelectorAll(
167303
+ `.copySpecificAlignmentAsPlainClipboardHelper`
167304
+ );
167305
+ elements.forEach((element2) => {
167306
+ element2.addEventListener(
167307
+ "click",
167308
+ () => __async(this, null, function* () {
168063
167309
  const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
168064
167310
  const seqDataToCopy = getSequenceDataBetweenRange(
168065
167311
  alignmentData,
168066
167312
  selectionLayer2
168067
167313
  ).sequence;
168068
- return seqDataToCopy;
168069
- }
168070
- }
168071
- );
167314
+ try {
167315
+ yield navigator.clipboard.writeText(
167316
+ seqDataToCopy
167317
+ );
167318
+ } catch (err2) {
167319
+ console.error(
167320
+ "Failed to copy text:",
167321
+ err2
167322
+ );
167323
+ }
167324
+ })
167325
+ );
167326
+ });
168072
167327
  },
168073
167328
  onClick: () => {
168074
167329
  window.toastr.success("Selection Copied");