@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/AlignmentView/index.d.ts +0 -4
- package/index.cjs.js +90 -826
- package/index.es.js +90 -826
- package/index.umd.js +101 -846
- package/package.json +1 -2
- package/src/AlignmentView/index.js +83 -45
- package/src/withEditorInteractions/Keyboard.js +2 -2
- package/src/withEditorInteractions/index.js +19 -16
- package/withEditorInteractions/Keyboard.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -69315,11 +69315,19 @@ const Loading = /* @__PURE__ */ __name(({
|
|
|
69315
69315
|
inDialog,
|
|
69316
69316
|
centeredInPage
|
|
69317
69317
|
}) => {
|
|
69318
|
+
const [longerThan200MS, setLongerThan200MS] = React$2.useState(false);
|
|
69319
|
+
React$2.useEffect(() => {
|
|
69320
|
+
const timeoutId = setTimeout(() => {
|
|
69321
|
+
setLongerThan200MS(true);
|
|
69322
|
+
}, 200);
|
|
69323
|
+
return () => {
|
|
69324
|
+
clearTimeout(timeoutId);
|
|
69325
|
+
};
|
|
69326
|
+
}, []);
|
|
69318
69327
|
const style2 = __spreadValues(__spreadValues({}, userStyle), inDialog && { minHeight: 120 });
|
|
69319
69328
|
const LoaderComp = bounce || inDialog ? BounceLoader : DNALoader;
|
|
69320
69329
|
if (loading || !children) {
|
|
69321
|
-
if (!displayInstantly &&
|
|
69322
|
-
(!bounce && !inDialog || withTimeout)) {
|
|
69330
|
+
if (!displayInstantly && !longerThan200MS && (!bounce && !inDialog || withTimeout)) {
|
|
69323
69331
|
return /* @__PURE__ */ React$2.createElement("div", null);
|
|
69324
69332
|
}
|
|
69325
69333
|
return /* @__PURE__ */ React$2.createElement(
|
|
@@ -116397,785 +116405,6 @@ const ConnectedDroppable = reactRedux.connect(
|
|
|
116397
116405
|
)(Droppable$1);
|
|
116398
116406
|
ConnectedDroppable.defaultProps = defaultProps;
|
|
116399
116407
|
var ConnectedDroppable$1 = ConnectedDroppable;
|
|
116400
|
-
var clipboard = { exports: {} };
|
|
116401
|
-
/*!
|
|
116402
|
-
* clipboard.js v2.0.8
|
|
116403
|
-
* https://clipboardjs.com/
|
|
116404
|
-
*
|
|
116405
|
-
* Licensed MIT © Zeno Rocha
|
|
116406
|
-
*/
|
|
116407
|
-
(function(module2, exports2) {
|
|
116408
|
-
(/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root2, factory) {
|
|
116409
|
-
module2.exports = factory();
|
|
116410
|
-
}, "webpackUniversalModuleDefinition"))(commonjsGlobal, function() {
|
|
116411
|
-
return (
|
|
116412
|
-
/******/
|
|
116413
|
-
function() {
|
|
116414
|
-
var __webpack_modules__ = {
|
|
116415
|
-
/***/
|
|
116416
|
-
134: (
|
|
116417
|
-
/***/
|
|
116418
|
-
function(__unused_webpack_module, __webpack_exports__, __webpack_require__2) {
|
|
116419
|
-
__webpack_require__2.d(__webpack_exports__, {
|
|
116420
|
-
"default": function() {
|
|
116421
|
-
return (
|
|
116422
|
-
/* binding */
|
|
116423
|
-
clipboard2
|
|
116424
|
-
);
|
|
116425
|
-
}
|
|
116426
|
-
});
|
|
116427
|
-
var tiny_emitter = __webpack_require__2(279);
|
|
116428
|
-
var tiny_emitter_default = /* @__PURE__ */ __webpack_require__2.n(tiny_emitter);
|
|
116429
|
-
var listen = __webpack_require__2(370);
|
|
116430
|
-
var listen_default = /* @__PURE__ */ __webpack_require__2.n(listen);
|
|
116431
|
-
var src_select = __webpack_require__2(817);
|
|
116432
|
-
var select_default = /* @__PURE__ */ __webpack_require__2.n(src_select);
|
|
116433
|
-
function _typeof2(obj) {
|
|
116434
|
-
"@babel/helpers - typeof";
|
|
116435
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
116436
|
-
_typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116437
|
-
return typeof obj2;
|
|
116438
|
-
}, "_typeof");
|
|
116439
|
-
} else {
|
|
116440
|
-
_typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116441
|
-
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
116442
|
-
}, "_typeof");
|
|
116443
|
-
}
|
|
116444
|
-
return _typeof2(obj);
|
|
116445
|
-
}
|
|
116446
|
-
__name(_typeof2, "_typeof");
|
|
116447
|
-
function _classCallCheck2(instance, Constructor) {
|
|
116448
|
-
if (!(instance instanceof Constructor)) {
|
|
116449
|
-
throw new TypeError("Cannot call a class as a function");
|
|
116450
|
-
}
|
|
116451
|
-
}
|
|
116452
|
-
__name(_classCallCheck2, "_classCallCheck");
|
|
116453
|
-
function _defineProperties2(target, props) {
|
|
116454
|
-
for (var i = 0; i < props.length; i++) {
|
|
116455
|
-
var descriptor = props[i];
|
|
116456
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
116457
|
-
descriptor.configurable = true;
|
|
116458
|
-
if ("value" in descriptor)
|
|
116459
|
-
descriptor.writable = true;
|
|
116460
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
116461
|
-
}
|
|
116462
|
-
}
|
|
116463
|
-
__name(_defineProperties2, "_defineProperties");
|
|
116464
|
-
function _createClass2(Constructor, protoProps, staticProps) {
|
|
116465
|
-
if (protoProps)
|
|
116466
|
-
_defineProperties2(Constructor.prototype, protoProps);
|
|
116467
|
-
return Constructor;
|
|
116468
|
-
}
|
|
116469
|
-
__name(_createClass2, "_createClass");
|
|
116470
|
-
var ClipboardAction = /* @__PURE__ */ function() {
|
|
116471
|
-
function ClipboardAction2(options) {
|
|
116472
|
-
_classCallCheck2(this, ClipboardAction2);
|
|
116473
|
-
this.resolveOptions(options);
|
|
116474
|
-
this.initSelection();
|
|
116475
|
-
}
|
|
116476
|
-
__name(ClipboardAction2, "ClipboardAction");
|
|
116477
|
-
_createClass2(ClipboardAction2, [{
|
|
116478
|
-
key: "resolveOptions",
|
|
116479
|
-
value: /* @__PURE__ */ __name(function resolveOptions() {
|
|
116480
|
-
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
116481
|
-
this.action = options.action;
|
|
116482
|
-
this.container = options.container;
|
|
116483
|
-
this.emitter = options.emitter;
|
|
116484
|
-
this.target = options.target;
|
|
116485
|
-
this.text = options.text;
|
|
116486
|
-
this.trigger = options.trigger;
|
|
116487
|
-
this.selectedText = "";
|
|
116488
|
-
}, "resolveOptions")
|
|
116489
|
-
/**
|
|
116490
|
-
* Decides which selection strategy is going to be applied based
|
|
116491
|
-
* on the existence of `text` and `target` properties.
|
|
116492
|
-
*/
|
|
116493
|
-
}, {
|
|
116494
|
-
key: "initSelection",
|
|
116495
|
-
value: /* @__PURE__ */ __name(function initSelection() {
|
|
116496
|
-
if (this.text) {
|
|
116497
|
-
this.selectFake();
|
|
116498
|
-
} else if (this.target) {
|
|
116499
|
-
this.selectTarget();
|
|
116500
|
-
}
|
|
116501
|
-
}, "initSelection")
|
|
116502
|
-
/**
|
|
116503
|
-
* Creates a fake textarea element, sets its value from `text` property,
|
|
116504
|
-
*/
|
|
116505
|
-
}, {
|
|
116506
|
-
key: "createFakeElement",
|
|
116507
|
-
value: /* @__PURE__ */ __name(function createFakeElement() {
|
|
116508
|
-
var isRTL = document.documentElement.getAttribute("dir") === "rtl";
|
|
116509
|
-
this.fakeElem = document.createElement("textarea");
|
|
116510
|
-
this.fakeElem.style.fontSize = "12pt";
|
|
116511
|
-
this.fakeElem.style.border = "0";
|
|
116512
|
-
this.fakeElem.style.padding = "0";
|
|
116513
|
-
this.fakeElem.style.margin = "0";
|
|
116514
|
-
this.fakeElem.style.position = "absolute";
|
|
116515
|
-
this.fakeElem.style[isRTL ? "right" : "left"] = "-9999px";
|
|
116516
|
-
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
|
116517
|
-
this.fakeElem.style.top = "".concat(yPosition, "px");
|
|
116518
|
-
this.fakeElem.setAttribute("readonly", "");
|
|
116519
|
-
this.fakeElem.value = this.text;
|
|
116520
|
-
return this.fakeElem;
|
|
116521
|
-
}, "createFakeElement")
|
|
116522
|
-
/**
|
|
116523
|
-
* Get's the value of fakeElem,
|
|
116524
|
-
* and makes a selection on it.
|
|
116525
|
-
*/
|
|
116526
|
-
}, {
|
|
116527
|
-
key: "selectFake",
|
|
116528
|
-
value: /* @__PURE__ */ __name(function selectFake() {
|
|
116529
|
-
var _this = this;
|
|
116530
|
-
var fakeElem = this.createFakeElement();
|
|
116531
|
-
this.fakeHandlerCallback = function() {
|
|
116532
|
-
return _this.removeFake();
|
|
116533
|
-
};
|
|
116534
|
-
this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || true;
|
|
116535
|
-
this.container.appendChild(fakeElem);
|
|
116536
|
-
this.selectedText = select_default()(fakeElem);
|
|
116537
|
-
this.copyText();
|
|
116538
|
-
this.removeFake();
|
|
116539
|
-
}, "selectFake")
|
|
116540
|
-
/**
|
|
116541
|
-
* Only removes the fake element after another click event, that way
|
|
116542
|
-
* a user can hit `Ctrl+C` to copy because selection still exists.
|
|
116543
|
-
*/
|
|
116544
|
-
}, {
|
|
116545
|
-
key: "removeFake",
|
|
116546
|
-
value: /* @__PURE__ */ __name(function removeFake() {
|
|
116547
|
-
if (this.fakeHandler) {
|
|
116548
|
-
this.container.removeEventListener("click", this.fakeHandlerCallback);
|
|
116549
|
-
this.fakeHandler = null;
|
|
116550
|
-
this.fakeHandlerCallback = null;
|
|
116551
|
-
}
|
|
116552
|
-
if (this.fakeElem) {
|
|
116553
|
-
this.container.removeChild(this.fakeElem);
|
|
116554
|
-
this.fakeElem = null;
|
|
116555
|
-
}
|
|
116556
|
-
}, "removeFake")
|
|
116557
|
-
/**
|
|
116558
|
-
* Selects the content from element passed on `target` property.
|
|
116559
|
-
*/
|
|
116560
|
-
}, {
|
|
116561
|
-
key: "selectTarget",
|
|
116562
|
-
value: /* @__PURE__ */ __name(function selectTarget() {
|
|
116563
|
-
this.selectedText = select_default()(this.target);
|
|
116564
|
-
this.copyText();
|
|
116565
|
-
}, "selectTarget")
|
|
116566
|
-
/**
|
|
116567
|
-
* Executes the copy operation based on the current selection.
|
|
116568
|
-
*/
|
|
116569
|
-
}, {
|
|
116570
|
-
key: "copyText",
|
|
116571
|
-
value: /* @__PURE__ */ __name(function copyText() {
|
|
116572
|
-
var succeeded;
|
|
116573
|
-
try {
|
|
116574
|
-
succeeded = document.execCommand(this.action);
|
|
116575
|
-
} catch (err2) {
|
|
116576
|
-
succeeded = false;
|
|
116577
|
-
}
|
|
116578
|
-
this.handleResult(succeeded);
|
|
116579
|
-
}, "copyText")
|
|
116580
|
-
/**
|
|
116581
|
-
* Fires an event based on the copy operation result.
|
|
116582
|
-
* @param {Boolean} succeeded
|
|
116583
|
-
*/
|
|
116584
|
-
}, {
|
|
116585
|
-
key: "handleResult",
|
|
116586
|
-
value: /* @__PURE__ */ __name(function handleResult(succeeded) {
|
|
116587
|
-
this.emitter.emit(succeeded ? "success" : "error", {
|
|
116588
|
-
action: this.action,
|
|
116589
|
-
text: this.selectedText,
|
|
116590
|
-
trigger: this.trigger,
|
|
116591
|
-
clearSelection: this.clearSelection.bind(this)
|
|
116592
|
-
});
|
|
116593
|
-
}, "handleResult")
|
|
116594
|
-
/**
|
|
116595
|
-
* Moves focus away from `target` and back to the trigger, removes current selection.
|
|
116596
|
-
*/
|
|
116597
|
-
}, {
|
|
116598
|
-
key: "clearSelection",
|
|
116599
|
-
value: /* @__PURE__ */ __name(function clearSelection() {
|
|
116600
|
-
if (this.trigger) {
|
|
116601
|
-
this.trigger.focus();
|
|
116602
|
-
}
|
|
116603
|
-
document.activeElement.blur();
|
|
116604
|
-
window.getSelection().removeAllRanges();
|
|
116605
|
-
}, "clearSelection")
|
|
116606
|
-
/**
|
|
116607
|
-
* Sets the `action` to be performed which can be either 'copy' or 'cut'.
|
|
116608
|
-
* @param {String} action
|
|
116609
|
-
*/
|
|
116610
|
-
}, {
|
|
116611
|
-
key: "destroy",
|
|
116612
|
-
/**
|
|
116613
|
-
* Destroy lifecycle.
|
|
116614
|
-
*/
|
|
116615
|
-
value: /* @__PURE__ */ __name(function destroy2() {
|
|
116616
|
-
this.removeFake();
|
|
116617
|
-
}, "destroy")
|
|
116618
|
-
}, {
|
|
116619
|
-
key: "action",
|
|
116620
|
-
set: /* @__PURE__ */ __name(function set6() {
|
|
116621
|
-
var action2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "copy";
|
|
116622
|
-
this._action = action2;
|
|
116623
|
-
if (this._action !== "copy" && this._action !== "cut") {
|
|
116624
|
-
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
|
116625
|
-
}
|
|
116626
|
-
}, "set"),
|
|
116627
|
-
get: /* @__PURE__ */ __name(function get7() {
|
|
116628
|
-
return this._action;
|
|
116629
|
-
}, "get")
|
|
116630
|
-
/**
|
|
116631
|
-
* Sets the `target` property using an element
|
|
116632
|
-
* that will be have its content copied.
|
|
116633
|
-
* @param {Element} target
|
|
116634
|
-
*/
|
|
116635
|
-
}, {
|
|
116636
|
-
key: "target",
|
|
116637
|
-
set: /* @__PURE__ */ __name(function set6(target) {
|
|
116638
|
-
if (target !== void 0) {
|
|
116639
|
-
if (target && _typeof2(target) === "object" && target.nodeType === 1) {
|
|
116640
|
-
if (this.action === "copy" && target.hasAttribute("disabled")) {
|
|
116641
|
-
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
|
116642
|
-
}
|
|
116643
|
-
if (this.action === "cut" && (target.hasAttribute("readonly") || target.hasAttribute("disabled"))) {
|
|
116644
|
-
throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
|
|
116645
|
-
}
|
|
116646
|
-
this._target = target;
|
|
116647
|
-
} else {
|
|
116648
|
-
throw new Error('Invalid "target" value, use a valid Element');
|
|
116649
|
-
}
|
|
116650
|
-
}
|
|
116651
|
-
}, "set"),
|
|
116652
|
-
get: /* @__PURE__ */ __name(function get7() {
|
|
116653
|
-
return this._target;
|
|
116654
|
-
}, "get")
|
|
116655
|
-
}]);
|
|
116656
|
-
return ClipboardAction2;
|
|
116657
|
-
}();
|
|
116658
|
-
var clipboard_action = ClipboardAction;
|
|
116659
|
-
function clipboard_typeof(obj) {
|
|
116660
|
-
"@babel/helpers - typeof";
|
|
116661
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
116662
|
-
clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116663
|
-
return typeof obj2;
|
|
116664
|
-
}, "_typeof");
|
|
116665
|
-
} else {
|
|
116666
|
-
clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116667
|
-
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
116668
|
-
}, "_typeof");
|
|
116669
|
-
}
|
|
116670
|
-
return clipboard_typeof(obj);
|
|
116671
|
-
}
|
|
116672
|
-
__name(clipboard_typeof, "clipboard_typeof");
|
|
116673
|
-
function clipboard_classCallCheck(instance, Constructor) {
|
|
116674
|
-
if (!(instance instanceof Constructor)) {
|
|
116675
|
-
throw new TypeError("Cannot call a class as a function");
|
|
116676
|
-
}
|
|
116677
|
-
}
|
|
116678
|
-
__name(clipboard_classCallCheck, "clipboard_classCallCheck");
|
|
116679
|
-
function clipboard_defineProperties(target, props) {
|
|
116680
|
-
for (var i = 0; i < props.length; i++) {
|
|
116681
|
-
var descriptor = props[i];
|
|
116682
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
116683
|
-
descriptor.configurable = true;
|
|
116684
|
-
if ("value" in descriptor)
|
|
116685
|
-
descriptor.writable = true;
|
|
116686
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
116687
|
-
}
|
|
116688
|
-
}
|
|
116689
|
-
__name(clipboard_defineProperties, "clipboard_defineProperties");
|
|
116690
|
-
function clipboard_createClass(Constructor, protoProps, staticProps) {
|
|
116691
|
-
if (protoProps)
|
|
116692
|
-
clipboard_defineProperties(Constructor.prototype, protoProps);
|
|
116693
|
-
if (staticProps)
|
|
116694
|
-
clipboard_defineProperties(Constructor, staticProps);
|
|
116695
|
-
return Constructor;
|
|
116696
|
-
}
|
|
116697
|
-
__name(clipboard_createClass, "clipboard_createClass");
|
|
116698
|
-
function _inherits2(subClass, superClass) {
|
|
116699
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
116700
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
116701
|
-
}
|
|
116702
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
116703
|
-
if (superClass)
|
|
116704
|
-
_setPrototypeOf2(subClass, superClass);
|
|
116705
|
-
}
|
|
116706
|
-
__name(_inherits2, "_inherits");
|
|
116707
|
-
function _setPrototypeOf2(o2, p2) {
|
|
116708
|
-
_setPrototypeOf2 = Object.setPrototypeOf || /* @__PURE__ */ __name(function _setPrototypeOf3(o3, p3) {
|
|
116709
|
-
o3.__proto__ = p3;
|
|
116710
|
-
return o3;
|
|
116711
|
-
}, "_setPrototypeOf");
|
|
116712
|
-
return _setPrototypeOf2(o2, p2);
|
|
116713
|
-
}
|
|
116714
|
-
__name(_setPrototypeOf2, "_setPrototypeOf");
|
|
116715
|
-
function _createSuper2(Derived) {
|
|
116716
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
|
|
116717
|
-
return /* @__PURE__ */ __name(function _createSuperInternal() {
|
|
116718
|
-
var Super = _getPrototypeOf2(Derived), result;
|
|
116719
|
-
if (hasNativeReflectConstruct) {
|
|
116720
|
-
var NewTarget = _getPrototypeOf2(this).constructor;
|
|
116721
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
116722
|
-
} else {
|
|
116723
|
-
result = Super.apply(this, arguments);
|
|
116724
|
-
}
|
|
116725
|
-
return _possibleConstructorReturn2(this, result);
|
|
116726
|
-
}, "_createSuperInternal");
|
|
116727
|
-
}
|
|
116728
|
-
__name(_createSuper2, "_createSuper");
|
|
116729
|
-
function _possibleConstructorReturn2(self2, call2) {
|
|
116730
|
-
if (call2 && (clipboard_typeof(call2) === "object" || typeof call2 === "function")) {
|
|
116731
|
-
return call2;
|
|
116732
|
-
}
|
|
116733
|
-
return _assertThisInitialized2(self2);
|
|
116734
|
-
}
|
|
116735
|
-
__name(_possibleConstructorReturn2, "_possibleConstructorReturn");
|
|
116736
|
-
function _assertThisInitialized2(self2) {
|
|
116737
|
-
if (self2 === void 0) {
|
|
116738
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
116739
|
-
}
|
|
116740
|
-
return self2;
|
|
116741
|
-
}
|
|
116742
|
-
__name(_assertThisInitialized2, "_assertThisInitialized");
|
|
116743
|
-
function _isNativeReflectConstruct2() {
|
|
116744
|
-
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
116745
|
-
return false;
|
|
116746
|
-
if (Reflect.construct.sham)
|
|
116747
|
-
return false;
|
|
116748
|
-
if (typeof Proxy === "function")
|
|
116749
|
-
return true;
|
|
116750
|
-
try {
|
|
116751
|
-
Date.prototype.toString.call(Reflect.construct(Date, [], function() {
|
|
116752
|
-
}));
|
|
116753
|
-
return true;
|
|
116754
|
-
} catch (e) {
|
|
116755
|
-
return false;
|
|
116756
|
-
}
|
|
116757
|
-
}
|
|
116758
|
-
__name(_isNativeReflectConstruct2, "_isNativeReflectConstruct");
|
|
116759
|
-
function _getPrototypeOf2(o2) {
|
|
116760
|
-
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : /* @__PURE__ */ __name(function _getPrototypeOf3(o3) {
|
|
116761
|
-
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
116762
|
-
}, "_getPrototypeOf");
|
|
116763
|
-
return _getPrototypeOf2(o2);
|
|
116764
|
-
}
|
|
116765
|
-
__name(_getPrototypeOf2, "_getPrototypeOf");
|
|
116766
|
-
function getAttributeValue(suffix, element2) {
|
|
116767
|
-
var attribute = "data-clipboard-".concat(suffix);
|
|
116768
|
-
if (!element2.hasAttribute(attribute)) {
|
|
116769
|
-
return;
|
|
116770
|
-
}
|
|
116771
|
-
return element2.getAttribute(attribute);
|
|
116772
|
-
}
|
|
116773
|
-
__name(getAttributeValue, "getAttributeValue");
|
|
116774
|
-
var Clipboard2 = /* @__PURE__ */ function(_Emitter) {
|
|
116775
|
-
_inherits2(Clipboard3, _Emitter);
|
|
116776
|
-
var _super = _createSuper2(Clipboard3);
|
|
116777
|
-
function Clipboard3(trigger2, options) {
|
|
116778
|
-
var _this;
|
|
116779
|
-
clipboard_classCallCheck(this, Clipboard3);
|
|
116780
|
-
_this = _super.call(this);
|
|
116781
|
-
_this.resolveOptions(options);
|
|
116782
|
-
_this.listenClick(trigger2);
|
|
116783
|
-
return _this;
|
|
116784
|
-
}
|
|
116785
|
-
__name(Clipboard3, "Clipboard");
|
|
116786
|
-
clipboard_createClass(Clipboard3, [{
|
|
116787
|
-
key: "resolveOptions",
|
|
116788
|
-
value: /* @__PURE__ */ __name(function resolveOptions() {
|
|
116789
|
-
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
116790
|
-
this.action = typeof options.action === "function" ? options.action : this.defaultAction;
|
|
116791
|
-
this.target = typeof options.target === "function" ? options.target : this.defaultTarget;
|
|
116792
|
-
this.text = typeof options.text === "function" ? options.text : this.defaultText;
|
|
116793
|
-
this.container = clipboard_typeof(options.container) === "object" ? options.container : document.body;
|
|
116794
|
-
}, "resolveOptions")
|
|
116795
|
-
/**
|
|
116796
|
-
* Adds a click event listener to the passed trigger.
|
|
116797
|
-
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
|
|
116798
|
-
*/
|
|
116799
|
-
}, {
|
|
116800
|
-
key: "listenClick",
|
|
116801
|
-
value: /* @__PURE__ */ __name(function listenClick(trigger2) {
|
|
116802
|
-
var _this2 = this;
|
|
116803
|
-
this.listener = listen_default()(trigger2, "click", function(e) {
|
|
116804
|
-
return _this2.onClick(e);
|
|
116805
|
-
});
|
|
116806
|
-
}, "listenClick")
|
|
116807
|
-
/**
|
|
116808
|
-
* Defines a new `ClipboardAction` on each click event.
|
|
116809
|
-
* @param {Event} e
|
|
116810
|
-
*/
|
|
116811
|
-
}, {
|
|
116812
|
-
key: "onClick",
|
|
116813
|
-
value: /* @__PURE__ */ __name(function onClick(e) {
|
|
116814
|
-
var trigger2 = e.delegateTarget || e.currentTarget;
|
|
116815
|
-
if (this.clipboardAction) {
|
|
116816
|
-
this.clipboardAction = null;
|
|
116817
|
-
}
|
|
116818
|
-
this.clipboardAction = new clipboard_action({
|
|
116819
|
-
action: this.action(trigger2),
|
|
116820
|
-
target: this.target(trigger2),
|
|
116821
|
-
text: this.text(trigger2),
|
|
116822
|
-
container: this.container,
|
|
116823
|
-
trigger: trigger2,
|
|
116824
|
-
emitter: this
|
|
116825
|
-
});
|
|
116826
|
-
}, "onClick")
|
|
116827
|
-
/**
|
|
116828
|
-
* Default `action` lookup function.
|
|
116829
|
-
* @param {Element} trigger
|
|
116830
|
-
*/
|
|
116831
|
-
}, {
|
|
116832
|
-
key: "defaultAction",
|
|
116833
|
-
value: /* @__PURE__ */ __name(function defaultAction(trigger2) {
|
|
116834
|
-
return getAttributeValue("action", trigger2);
|
|
116835
|
-
}, "defaultAction")
|
|
116836
|
-
/**
|
|
116837
|
-
* Default `target` lookup function.
|
|
116838
|
-
* @param {Element} trigger
|
|
116839
|
-
*/
|
|
116840
|
-
}, {
|
|
116841
|
-
key: "defaultTarget",
|
|
116842
|
-
value: /* @__PURE__ */ __name(function defaultTarget(trigger2) {
|
|
116843
|
-
var selector = getAttributeValue("target", trigger2);
|
|
116844
|
-
if (selector) {
|
|
116845
|
-
return document.querySelector(selector);
|
|
116846
|
-
}
|
|
116847
|
-
}, "defaultTarget")
|
|
116848
|
-
/**
|
|
116849
|
-
* Returns the support of the given action, or all actions if no action is
|
|
116850
|
-
* given.
|
|
116851
|
-
* @param {String} [action]
|
|
116852
|
-
*/
|
|
116853
|
-
}, {
|
|
116854
|
-
key: "defaultText",
|
|
116855
|
-
/**
|
|
116856
|
-
* Default `text` lookup function.
|
|
116857
|
-
* @param {Element} trigger
|
|
116858
|
-
*/
|
|
116859
|
-
value: /* @__PURE__ */ __name(function defaultText(trigger2) {
|
|
116860
|
-
return getAttributeValue("text", trigger2);
|
|
116861
|
-
}, "defaultText")
|
|
116862
|
-
/**
|
|
116863
|
-
* Destroy lifecycle.
|
|
116864
|
-
*/
|
|
116865
|
-
}, {
|
|
116866
|
-
key: "destroy",
|
|
116867
|
-
value: /* @__PURE__ */ __name(function destroy2() {
|
|
116868
|
-
this.listener.destroy();
|
|
116869
|
-
if (this.clipboardAction) {
|
|
116870
|
-
this.clipboardAction.destroy();
|
|
116871
|
-
this.clipboardAction = null;
|
|
116872
|
-
}
|
|
116873
|
-
}, "destroy")
|
|
116874
|
-
}], [{
|
|
116875
|
-
key: "isSupported",
|
|
116876
|
-
value: /* @__PURE__ */ __name(function isSupported() {
|
|
116877
|
-
var action2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"];
|
|
116878
|
-
var actions2 = typeof action2 === "string" ? [action2] : action2;
|
|
116879
|
-
var support = !!document.queryCommandSupported;
|
|
116880
|
-
actions2.forEach(function(action3) {
|
|
116881
|
-
support = support && !!document.queryCommandSupported(action3);
|
|
116882
|
-
});
|
|
116883
|
-
return support;
|
|
116884
|
-
}, "isSupported")
|
|
116885
|
-
}]);
|
|
116886
|
-
return Clipboard3;
|
|
116887
|
-
}(tiny_emitter_default());
|
|
116888
|
-
var clipboard2 = Clipboard2;
|
|
116889
|
-
}
|
|
116890
|
-
),
|
|
116891
|
-
/***/
|
|
116892
|
-
828: (
|
|
116893
|
-
/***/
|
|
116894
|
-
function(module3) {
|
|
116895
|
-
var DOCUMENT_NODE_TYPE = 9;
|
|
116896
|
-
if (typeof Element !== "undefined" && !Element.prototype.matches) {
|
|
116897
|
-
var proto = Element.prototype;
|
|
116898
|
-
proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
|
|
116899
|
-
}
|
|
116900
|
-
function closest2(element2, selector) {
|
|
116901
|
-
while (element2 && element2.nodeType !== DOCUMENT_NODE_TYPE) {
|
|
116902
|
-
if (typeof element2.matches === "function" && element2.matches(selector)) {
|
|
116903
|
-
return element2;
|
|
116904
|
-
}
|
|
116905
|
-
element2 = element2.parentNode;
|
|
116906
|
-
}
|
|
116907
|
-
}
|
|
116908
|
-
__name(closest2, "closest");
|
|
116909
|
-
module3.exports = closest2;
|
|
116910
|
-
}
|
|
116911
|
-
),
|
|
116912
|
-
/***/
|
|
116913
|
-
438: (
|
|
116914
|
-
/***/
|
|
116915
|
-
function(module3, __unused_webpack_exports, __webpack_require__2) {
|
|
116916
|
-
var closest2 = __webpack_require__2(828);
|
|
116917
|
-
function _delegate(element2, selector, type2, callback2, useCapture) {
|
|
116918
|
-
var listenerFn = listener.apply(this, arguments);
|
|
116919
|
-
element2.addEventListener(type2, listenerFn, useCapture);
|
|
116920
|
-
return {
|
|
116921
|
-
destroy: function() {
|
|
116922
|
-
element2.removeEventListener(type2, listenerFn, useCapture);
|
|
116923
|
-
}
|
|
116924
|
-
};
|
|
116925
|
-
}
|
|
116926
|
-
__name(_delegate, "_delegate");
|
|
116927
|
-
function delegate(elements, selector, type2, callback2, useCapture) {
|
|
116928
|
-
if (typeof elements.addEventListener === "function") {
|
|
116929
|
-
return _delegate.apply(null, arguments);
|
|
116930
|
-
}
|
|
116931
|
-
if (typeof type2 === "function") {
|
|
116932
|
-
return _delegate.bind(null, document).apply(null, arguments);
|
|
116933
|
-
}
|
|
116934
|
-
if (typeof elements === "string") {
|
|
116935
|
-
elements = document.querySelectorAll(elements);
|
|
116936
|
-
}
|
|
116937
|
-
return Array.prototype.map.call(elements, function(element2) {
|
|
116938
|
-
return _delegate(element2, selector, type2, callback2, useCapture);
|
|
116939
|
-
});
|
|
116940
|
-
}
|
|
116941
|
-
__name(delegate, "delegate");
|
|
116942
|
-
function listener(element2, selector, type2, callback2) {
|
|
116943
|
-
return function(e) {
|
|
116944
|
-
e.delegateTarget = closest2(e.target, selector);
|
|
116945
|
-
if (e.delegateTarget) {
|
|
116946
|
-
callback2.call(element2, e);
|
|
116947
|
-
}
|
|
116948
|
-
};
|
|
116949
|
-
}
|
|
116950
|
-
__name(listener, "listener");
|
|
116951
|
-
module3.exports = delegate;
|
|
116952
|
-
}
|
|
116953
|
-
),
|
|
116954
|
-
/***/
|
|
116955
|
-
879: (
|
|
116956
|
-
/***/
|
|
116957
|
-
function(__unused_webpack_module, exports3) {
|
|
116958
|
-
exports3.node = function(value) {
|
|
116959
|
-
return value !== void 0 && value instanceof HTMLElement && value.nodeType === 1;
|
|
116960
|
-
};
|
|
116961
|
-
exports3.nodeList = function(value) {
|
|
116962
|
-
var type2 = Object.prototype.toString.call(value);
|
|
116963
|
-
return value !== void 0 && (type2 === "[object NodeList]" || type2 === "[object HTMLCollection]") && "length" in value && (value.length === 0 || exports3.node(value[0]));
|
|
116964
|
-
};
|
|
116965
|
-
exports3.string = function(value) {
|
|
116966
|
-
return typeof value === "string" || value instanceof String;
|
|
116967
|
-
};
|
|
116968
|
-
exports3.fn = function(value) {
|
|
116969
|
-
var type2 = Object.prototype.toString.call(value);
|
|
116970
|
-
return type2 === "[object Function]";
|
|
116971
|
-
};
|
|
116972
|
-
}
|
|
116973
|
-
),
|
|
116974
|
-
/***/
|
|
116975
|
-
370: (
|
|
116976
|
-
/***/
|
|
116977
|
-
function(module3, __unused_webpack_exports, __webpack_require__2) {
|
|
116978
|
-
var is3 = __webpack_require__2(879);
|
|
116979
|
-
var delegate = __webpack_require__2(438);
|
|
116980
|
-
function listen(target, type2, callback2) {
|
|
116981
|
-
if (!target && !type2 && !callback2) {
|
|
116982
|
-
throw new Error("Missing required arguments");
|
|
116983
|
-
}
|
|
116984
|
-
if (!is3.string(type2)) {
|
|
116985
|
-
throw new TypeError("Second argument must be a String");
|
|
116986
|
-
}
|
|
116987
|
-
if (!is3.fn(callback2)) {
|
|
116988
|
-
throw new TypeError("Third argument must be a Function");
|
|
116989
|
-
}
|
|
116990
|
-
if (is3.node(target)) {
|
|
116991
|
-
return listenNode(target, type2, callback2);
|
|
116992
|
-
} else if (is3.nodeList(target)) {
|
|
116993
|
-
return listenNodeList(target, type2, callback2);
|
|
116994
|
-
} else if (is3.string(target)) {
|
|
116995
|
-
return listenSelector(target, type2, callback2);
|
|
116996
|
-
} else {
|
|
116997
|
-
throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
|
|
116998
|
-
}
|
|
116999
|
-
}
|
|
117000
|
-
__name(listen, "listen");
|
|
117001
|
-
function listenNode(node2, type2, callback2) {
|
|
117002
|
-
node2.addEventListener(type2, callback2);
|
|
117003
|
-
return {
|
|
117004
|
-
destroy: function() {
|
|
117005
|
-
node2.removeEventListener(type2, callback2);
|
|
117006
|
-
}
|
|
117007
|
-
};
|
|
117008
|
-
}
|
|
117009
|
-
__name(listenNode, "listenNode");
|
|
117010
|
-
function listenNodeList(nodeList, type2, callback2) {
|
|
117011
|
-
Array.prototype.forEach.call(nodeList, function(node2) {
|
|
117012
|
-
node2.addEventListener(type2, callback2);
|
|
117013
|
-
});
|
|
117014
|
-
return {
|
|
117015
|
-
destroy: function() {
|
|
117016
|
-
Array.prototype.forEach.call(nodeList, function(node2) {
|
|
117017
|
-
node2.removeEventListener(type2, callback2);
|
|
117018
|
-
});
|
|
117019
|
-
}
|
|
117020
|
-
};
|
|
117021
|
-
}
|
|
117022
|
-
__name(listenNodeList, "listenNodeList");
|
|
117023
|
-
function listenSelector(selector, type2, callback2) {
|
|
117024
|
-
return delegate(document.body, selector, type2, callback2);
|
|
117025
|
-
}
|
|
117026
|
-
__name(listenSelector, "listenSelector");
|
|
117027
|
-
module3.exports = listen;
|
|
117028
|
-
}
|
|
117029
|
-
),
|
|
117030
|
-
/***/
|
|
117031
|
-
817: (
|
|
117032
|
-
/***/
|
|
117033
|
-
function(module3) {
|
|
117034
|
-
function select2(element2) {
|
|
117035
|
-
var selectedText;
|
|
117036
|
-
if (element2.nodeName === "SELECT") {
|
|
117037
|
-
element2.focus();
|
|
117038
|
-
selectedText = element2.value;
|
|
117039
|
-
} else if (element2.nodeName === "INPUT" || element2.nodeName === "TEXTAREA") {
|
|
117040
|
-
var isReadOnly = element2.hasAttribute("readonly");
|
|
117041
|
-
if (!isReadOnly) {
|
|
117042
|
-
element2.setAttribute("readonly", "");
|
|
117043
|
-
}
|
|
117044
|
-
element2.select();
|
|
117045
|
-
element2.setSelectionRange(0, element2.value.length);
|
|
117046
|
-
if (!isReadOnly) {
|
|
117047
|
-
element2.removeAttribute("readonly");
|
|
117048
|
-
}
|
|
117049
|
-
selectedText = element2.value;
|
|
117050
|
-
} else {
|
|
117051
|
-
if (element2.hasAttribute("contenteditable")) {
|
|
117052
|
-
element2.focus();
|
|
117053
|
-
}
|
|
117054
|
-
var selection = window.getSelection();
|
|
117055
|
-
var range2 = document.createRange();
|
|
117056
|
-
range2.selectNodeContents(element2);
|
|
117057
|
-
selection.removeAllRanges();
|
|
117058
|
-
selection.addRange(range2);
|
|
117059
|
-
selectedText = selection.toString();
|
|
117060
|
-
}
|
|
117061
|
-
return selectedText;
|
|
117062
|
-
}
|
|
117063
|
-
__name(select2, "select");
|
|
117064
|
-
module3.exports = select2;
|
|
117065
|
-
}
|
|
117066
|
-
),
|
|
117067
|
-
/***/
|
|
117068
|
-
279: (
|
|
117069
|
-
/***/
|
|
117070
|
-
function(module3) {
|
|
117071
|
-
function E2() {
|
|
117072
|
-
}
|
|
117073
|
-
__name(E2, "E");
|
|
117074
|
-
E2.prototype = {
|
|
117075
|
-
on: function(name2, callback2, ctx) {
|
|
117076
|
-
var e = this.e || (this.e = {});
|
|
117077
|
-
(e[name2] || (e[name2] = [])).push({
|
|
117078
|
-
fn: callback2,
|
|
117079
|
-
ctx
|
|
117080
|
-
});
|
|
117081
|
-
return this;
|
|
117082
|
-
},
|
|
117083
|
-
once: function(name2, callback2, ctx) {
|
|
117084
|
-
var self2 = this;
|
|
117085
|
-
function listener() {
|
|
117086
|
-
self2.off(name2, listener);
|
|
117087
|
-
callback2.apply(ctx, arguments);
|
|
117088
|
-
}
|
|
117089
|
-
__name(listener, "listener");
|
|
117090
|
-
listener._ = callback2;
|
|
117091
|
-
return this.on(name2, listener, ctx);
|
|
117092
|
-
},
|
|
117093
|
-
emit: function(name2) {
|
|
117094
|
-
var data = [].slice.call(arguments, 1);
|
|
117095
|
-
var evtArr = ((this.e || (this.e = {}))[name2] || []).slice();
|
|
117096
|
-
var i = 0;
|
|
117097
|
-
var len = evtArr.length;
|
|
117098
|
-
for (i; i < len; i++) {
|
|
117099
|
-
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
|
117100
|
-
}
|
|
117101
|
-
return this;
|
|
117102
|
-
},
|
|
117103
|
-
off: function(name2, callback2) {
|
|
117104
|
-
var e = this.e || (this.e = {});
|
|
117105
|
-
var evts = e[name2];
|
|
117106
|
-
var liveEvents = [];
|
|
117107
|
-
if (evts && callback2) {
|
|
117108
|
-
for (var i = 0, len = evts.length; i < len; i++) {
|
|
117109
|
-
if (evts[i].fn !== callback2 && evts[i].fn._ !== callback2)
|
|
117110
|
-
liveEvents.push(evts[i]);
|
|
117111
|
-
}
|
|
117112
|
-
}
|
|
117113
|
-
liveEvents.length ? e[name2] = liveEvents : delete e[name2];
|
|
117114
|
-
return this;
|
|
117115
|
-
}
|
|
117116
|
-
};
|
|
117117
|
-
module3.exports = E2;
|
|
117118
|
-
module3.exports.TinyEmitter = E2;
|
|
117119
|
-
}
|
|
117120
|
-
)
|
|
117121
|
-
/******/
|
|
117122
|
-
};
|
|
117123
|
-
var __webpack_module_cache__ = {};
|
|
117124
|
-
function __webpack_require__(moduleId) {
|
|
117125
|
-
if (__webpack_module_cache__[moduleId]) {
|
|
117126
|
-
return __webpack_module_cache__[moduleId].exports;
|
|
117127
|
-
}
|
|
117128
|
-
var module3 = __webpack_module_cache__[moduleId] = {
|
|
117129
|
-
/******/
|
|
117130
|
-
// no module.id needed
|
|
117131
|
-
/******/
|
|
117132
|
-
// no module.loaded needed
|
|
117133
|
-
/******/
|
|
117134
|
-
exports: {}
|
|
117135
|
-
/******/
|
|
117136
|
-
};
|
|
117137
|
-
__webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
|
|
117138
|
-
return module3.exports;
|
|
117139
|
-
}
|
|
117140
|
-
__name(__webpack_require__, "__webpack_require__");
|
|
117141
|
-
!function() {
|
|
117142
|
-
__webpack_require__.n = function(module3) {
|
|
117143
|
-
var getter = module3 && module3.__esModule ? (
|
|
117144
|
-
/******/
|
|
117145
|
-
function() {
|
|
117146
|
-
return module3["default"];
|
|
117147
|
-
}
|
|
117148
|
-
) : (
|
|
117149
|
-
/******/
|
|
117150
|
-
function() {
|
|
117151
|
-
return module3;
|
|
117152
|
-
}
|
|
117153
|
-
);
|
|
117154
|
-
__webpack_require__.d(getter, { a: getter });
|
|
117155
|
-
return getter;
|
|
117156
|
-
};
|
|
117157
|
-
}();
|
|
117158
|
-
!function() {
|
|
117159
|
-
__webpack_require__.d = function(exports3, definition2) {
|
|
117160
|
-
for (var key in definition2) {
|
|
117161
|
-
if (__webpack_require__.o(definition2, key) && !__webpack_require__.o(exports3, key)) {
|
|
117162
|
-
Object.defineProperty(exports3, key, { enumerable: true, get: definition2[key] });
|
|
117163
|
-
}
|
|
117164
|
-
}
|
|
117165
|
-
};
|
|
117166
|
-
}();
|
|
117167
|
-
!function() {
|
|
117168
|
-
__webpack_require__.o = function(obj, prop2) {
|
|
117169
|
-
return Object.prototype.hasOwnProperty.call(obj, prop2);
|
|
117170
|
-
};
|
|
117171
|
-
}();
|
|
117172
|
-
return __webpack_require__(134);
|
|
117173
|
-
}().default
|
|
117174
|
-
);
|
|
117175
|
-
});
|
|
117176
|
-
})(clipboard);
|
|
117177
|
-
var clipboardExports = clipboard.exports;
|
|
117178
|
-
const Clipboard$1 = /* @__PURE__ */ getDefaultExportFromCjs(clipboardExports);
|
|
117179
116408
|
var connectionStore = /* @__PURE__ */ new WeakMap();
|
|
117180
116409
|
var ITERATION_KEY = Symbol("iteration key");
|
|
117181
116410
|
function storeObservable(obj) {
|
|
@@ -123150,7 +122379,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
123150
122379
|
}
|
|
123151
122380
|
__name(showFileDialog, "showFileDialog");
|
|
123152
122381
|
const name = "@teselagen/ove";
|
|
123153
|
-
const version = "0.7.3-beta.
|
|
122382
|
+
const version = "0.7.3-beta.6";
|
|
123154
122383
|
const main = "./src/index.js";
|
|
123155
122384
|
const type = "module";
|
|
123156
122385
|
const exports$1 = {
|
|
@@ -127058,7 +126287,7 @@ function isElementInViewport(el) {
|
|
|
127058
126287
|
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
127059
126288
|
}
|
|
127060
126289
|
__name(isElementInViewport, "isElementInViewport");
|
|
127061
|
-
const
|
|
126290
|
+
const _Keyboard = class _Keyboard extends React$2.Component {
|
|
127062
126291
|
constructor() {
|
|
127063
126292
|
super(...arguments);
|
|
127064
126293
|
__publicField(this, "handleKeyDown", /* @__PURE__ */ __name((e) => {
|
|
@@ -127127,14 +126356,14 @@ const _Clipboard = class _Clipboard extends React$2.Component {
|
|
|
127127
126356
|
);
|
|
127128
126357
|
}
|
|
127129
126358
|
};
|
|
127130
|
-
__name(
|
|
126359
|
+
__name(_Keyboard, "Keyboard");
|
|
127131
126360
|
// static propTypes = {
|
|
127132
126361
|
// value: PropTypes.string.isRequired
|
|
127133
126362
|
// };
|
|
127134
|
-
__publicField(
|
|
126363
|
+
__publicField(_Keyboard, "defaultProps", {
|
|
127135
126364
|
className: "clipboard"
|
|
127136
126365
|
});
|
|
127137
|
-
let
|
|
126366
|
+
let Keyboard = _Keyboard;
|
|
127138
126367
|
let dragInProgress = false;
|
|
127139
126368
|
let selectionStartOrEndGrabbed;
|
|
127140
126369
|
let caretPositionOnDragStart;
|
|
@@ -128150,9 +127379,8 @@ function VectorInteractionHOC(Component) {
|
|
|
128150
127379
|
const { sequenceData: sequenceData2, readOnly: readOnly2, disableBpEditing, selectionLayer: selectionLayer2 } = this.props;
|
|
128151
127380
|
const { isProtein: isProtein2 } = sequenceData2;
|
|
128152
127381
|
const makeTextCopyable = /* @__PURE__ */ __name((transformFunc, className, action2 = "copy") => {
|
|
128153
|
-
|
|
128154
|
-
|
|
128155
|
-
text: () => {
|
|
127382
|
+
document.querySelectorAll(`.${className}`).forEach((element2) => {
|
|
127383
|
+
element2.addEventListener("click", () => __async(this, null, function* () {
|
|
128156
127384
|
const { selectionLayer: selectionLayer22, editorName, store: store2 } = this.props;
|
|
128157
127385
|
const { sequenceData: sequenceData22, copyOptions: copyOptions2 } = store2.getState().VectorEditor[editorName];
|
|
128158
127386
|
const selectedSeqData = getSequenceDataBetweenRange(
|
|
@@ -128177,17 +127405,19 @@ function VectorInteractionHOC(Component) {
|
|
|
128177
127405
|
sequenceData22
|
|
128178
127406
|
);
|
|
128179
127407
|
this.sequenceDataToCopy = sequenceDataToCopy;
|
|
128180
|
-
|
|
128181
|
-
|
|
128182
|
-
|
|
128183
|
-
|
|
128184
|
-
|
|
128185
|
-
|
|
128186
|
-
|
|
128187
|
-
|
|
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);
|
|
128188
127419
|
}
|
|
128189
|
-
|
|
128190
|
-
}
|
|
127420
|
+
}));
|
|
128191
127421
|
});
|
|
128192
127422
|
}, "makeTextCopyable");
|
|
128193
127423
|
const aaCopy = {
|
|
@@ -128825,7 +128055,7 @@ function VectorInteractionHOC(Component) {
|
|
|
128825
128055
|
},
|
|
128826
128056
|
closePanelButton,
|
|
128827
128057
|
/* @__PURE__ */ React$2.createElement(
|
|
128828
|
-
|
|
128058
|
+
Keyboard,
|
|
128829
128059
|
{
|
|
128830
128060
|
value: selectedBps,
|
|
128831
128061
|
onCopy: this.handleCopy,
|
|
@@ -141028,15 +140258,27 @@ ${seqDataToCopy}\r
|
|
|
141028
140258
|
this.copyAllAlignmentsFastaClipboardHelper && this.copyAllAlignmentsFastaClipboardHelper.destroy();
|
|
141029
140259
|
},
|
|
141030
140260
|
didMount: () => {
|
|
141031
|
-
|
|
141032
|
-
`.copyAllAlignmentsFastaClipboardHelper
|
|
141033
|
-
{
|
|
141034
|
-
action: "copyAllAlignmentsFasta",
|
|
141035
|
-
text: () => {
|
|
141036
|
-
return this.getAllAlignmentsFastaText();
|
|
141037
|
-
}
|
|
141038
|
-
}
|
|
140261
|
+
const elements = document.querySelectorAll(
|
|
140262
|
+
`.copyAllAlignmentsFastaClipboardHelper`
|
|
141039
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
|
+
});
|
|
141040
140282
|
},
|
|
141041
140283
|
onClick: () => {
|
|
141042
140284
|
window.toastr.success("Selection Copied");
|
|
@@ -141049,11 +140291,13 @@ ${seqDataToCopy}\r
|
|
|
141049
140291
|
this.copySpecificAlignmentFastaClipboardHelper && this.copySpecificAlignmentFastaClipboardHelper.destroy();
|
|
141050
140292
|
},
|
|
141051
140293
|
didMount: () => {
|
|
141052
|
-
|
|
141053
|
-
`.copySpecificAlignmentFastaClipboardHelper
|
|
141054
|
-
|
|
141055
|
-
|
|
141056
|
-
|
|
140294
|
+
const elements = document.querySelectorAll(
|
|
140295
|
+
`.copySpecificAlignmentFastaClipboardHelper`
|
|
140296
|
+
);
|
|
140297
|
+
elements.forEach((element2) => {
|
|
140298
|
+
element2.addEventListener(
|
|
140299
|
+
"click",
|
|
140300
|
+
() => __async(this, null, function* () {
|
|
141057
140301
|
const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
|
|
141058
140302
|
const seqDataToCopy = getSequenceDataBetweenRange(
|
|
141059
140303
|
alignmentData,
|
|
@@ -141062,10 +140306,19 @@ ${seqDataToCopy}\r
|
|
|
141062
140306
|
const seqDataToCopyAsFasta = `>${name2}\r
|
|
141063
140307
|
${seqDataToCopy}\r
|
|
141064
140308
|
`;
|
|
141065
|
-
|
|
141066
|
-
|
|
141067
|
-
|
|
141068
|
-
|
|
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
|
+
});
|
|
141069
140322
|
},
|
|
141070
140323
|
onClick: () => {
|
|
141071
140324
|
window.toastr.success(
|
|
@@ -141080,20 +140333,31 @@ ${seqDataToCopy}\r
|
|
|
141080
140333
|
this.copySpecificAlignmentAsPlainClipboardHelper && this.copySpecificAlignmentAsPlainClipboardHelper.destroy();
|
|
141081
140334
|
},
|
|
141082
140335
|
didMount: () => {
|
|
141083
|
-
|
|
141084
|
-
`.copySpecificAlignmentAsPlainClipboardHelper
|
|
141085
|
-
|
|
141086
|
-
|
|
141087
|
-
|
|
140336
|
+
const elements = document.querySelectorAll(
|
|
140337
|
+
`.copySpecificAlignmentAsPlainClipboardHelper`
|
|
140338
|
+
);
|
|
140339
|
+
elements.forEach((element2) => {
|
|
140340
|
+
element2.addEventListener(
|
|
140341
|
+
"click",
|
|
140342
|
+
() => __async(this, null, function* () {
|
|
141088
140343
|
const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
|
|
141089
140344
|
const seqDataToCopy = getSequenceDataBetweenRange(
|
|
141090
140345
|
alignmentData,
|
|
141091
140346
|
selectionLayer2
|
|
141092
140347
|
).sequence;
|
|
141093
|
-
|
|
141094
|
-
|
|
141095
|
-
|
|
141096
|
-
|
|
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
|
+
});
|
|
141097
140361
|
},
|
|
141098
140362
|
onClick: () => {
|
|
141099
140363
|
window.toastr.success("Selection Copied");
|