@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.es.js
CHANGED
|
@@ -69297,11 +69297,19 @@ const Loading = /* @__PURE__ */ __name(({
|
|
|
69297
69297
|
inDialog,
|
|
69298
69298
|
centeredInPage
|
|
69299
69299
|
}) => {
|
|
69300
|
+
const [longerThan200MS, setLongerThan200MS] = useState(false);
|
|
69301
|
+
useEffect(() => {
|
|
69302
|
+
const timeoutId = setTimeout(() => {
|
|
69303
|
+
setLongerThan200MS(true);
|
|
69304
|
+
}, 200);
|
|
69305
|
+
return () => {
|
|
69306
|
+
clearTimeout(timeoutId);
|
|
69307
|
+
};
|
|
69308
|
+
}, []);
|
|
69300
69309
|
const style2 = __spreadValues(__spreadValues({}, userStyle), inDialog && { minHeight: 120 });
|
|
69301
69310
|
const LoaderComp = bounce || inDialog ? BounceLoader : DNALoader;
|
|
69302
69311
|
if (loading || !children) {
|
|
69303
|
-
if (!displayInstantly &&
|
|
69304
|
-
(!bounce && !inDialog || withTimeout)) {
|
|
69312
|
+
if (!displayInstantly && !longerThan200MS && (!bounce && !inDialog || withTimeout)) {
|
|
69305
69313
|
return /* @__PURE__ */ React__default$1.createElement("div", null);
|
|
69306
69314
|
}
|
|
69307
69315
|
return /* @__PURE__ */ React__default$1.createElement(
|
|
@@ -116379,785 +116387,6 @@ const ConnectedDroppable = connect(
|
|
|
116379
116387
|
)(Droppable$1);
|
|
116380
116388
|
ConnectedDroppable.defaultProps = defaultProps;
|
|
116381
116389
|
var ConnectedDroppable$1 = ConnectedDroppable;
|
|
116382
|
-
var clipboard = { exports: {} };
|
|
116383
|
-
/*!
|
|
116384
|
-
* clipboard.js v2.0.8
|
|
116385
|
-
* https://clipboardjs.com/
|
|
116386
|
-
*
|
|
116387
|
-
* Licensed MIT © Zeno Rocha
|
|
116388
|
-
*/
|
|
116389
|
-
(function(module2, exports2) {
|
|
116390
|
-
(/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root2, factory) {
|
|
116391
|
-
module2.exports = factory();
|
|
116392
|
-
}, "webpackUniversalModuleDefinition"))(commonjsGlobal, function() {
|
|
116393
|
-
return (
|
|
116394
|
-
/******/
|
|
116395
|
-
function() {
|
|
116396
|
-
var __webpack_modules__ = {
|
|
116397
|
-
/***/
|
|
116398
|
-
134: (
|
|
116399
|
-
/***/
|
|
116400
|
-
function(__unused_webpack_module, __webpack_exports__, __webpack_require__2) {
|
|
116401
|
-
__webpack_require__2.d(__webpack_exports__, {
|
|
116402
|
-
"default": function() {
|
|
116403
|
-
return (
|
|
116404
|
-
/* binding */
|
|
116405
|
-
clipboard2
|
|
116406
|
-
);
|
|
116407
|
-
}
|
|
116408
|
-
});
|
|
116409
|
-
var tiny_emitter = __webpack_require__2(279);
|
|
116410
|
-
var tiny_emitter_default = /* @__PURE__ */ __webpack_require__2.n(tiny_emitter);
|
|
116411
|
-
var listen = __webpack_require__2(370);
|
|
116412
|
-
var listen_default = /* @__PURE__ */ __webpack_require__2.n(listen);
|
|
116413
|
-
var src_select = __webpack_require__2(817);
|
|
116414
|
-
var select_default = /* @__PURE__ */ __webpack_require__2.n(src_select);
|
|
116415
|
-
function _typeof2(obj) {
|
|
116416
|
-
"@babel/helpers - typeof";
|
|
116417
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
116418
|
-
_typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116419
|
-
return typeof obj2;
|
|
116420
|
-
}, "_typeof");
|
|
116421
|
-
} else {
|
|
116422
|
-
_typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116423
|
-
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
116424
|
-
}, "_typeof");
|
|
116425
|
-
}
|
|
116426
|
-
return _typeof2(obj);
|
|
116427
|
-
}
|
|
116428
|
-
__name(_typeof2, "_typeof");
|
|
116429
|
-
function _classCallCheck2(instance, Constructor) {
|
|
116430
|
-
if (!(instance instanceof Constructor)) {
|
|
116431
|
-
throw new TypeError("Cannot call a class as a function");
|
|
116432
|
-
}
|
|
116433
|
-
}
|
|
116434
|
-
__name(_classCallCheck2, "_classCallCheck");
|
|
116435
|
-
function _defineProperties2(target, props) {
|
|
116436
|
-
for (var i = 0; i < props.length; i++) {
|
|
116437
|
-
var descriptor = props[i];
|
|
116438
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
116439
|
-
descriptor.configurable = true;
|
|
116440
|
-
if ("value" in descriptor)
|
|
116441
|
-
descriptor.writable = true;
|
|
116442
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
116443
|
-
}
|
|
116444
|
-
}
|
|
116445
|
-
__name(_defineProperties2, "_defineProperties");
|
|
116446
|
-
function _createClass2(Constructor, protoProps, staticProps) {
|
|
116447
|
-
if (protoProps)
|
|
116448
|
-
_defineProperties2(Constructor.prototype, protoProps);
|
|
116449
|
-
return Constructor;
|
|
116450
|
-
}
|
|
116451
|
-
__name(_createClass2, "_createClass");
|
|
116452
|
-
var ClipboardAction = /* @__PURE__ */ function() {
|
|
116453
|
-
function ClipboardAction2(options) {
|
|
116454
|
-
_classCallCheck2(this, ClipboardAction2);
|
|
116455
|
-
this.resolveOptions(options);
|
|
116456
|
-
this.initSelection();
|
|
116457
|
-
}
|
|
116458
|
-
__name(ClipboardAction2, "ClipboardAction");
|
|
116459
|
-
_createClass2(ClipboardAction2, [{
|
|
116460
|
-
key: "resolveOptions",
|
|
116461
|
-
value: /* @__PURE__ */ __name(function resolveOptions() {
|
|
116462
|
-
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
116463
|
-
this.action = options.action;
|
|
116464
|
-
this.container = options.container;
|
|
116465
|
-
this.emitter = options.emitter;
|
|
116466
|
-
this.target = options.target;
|
|
116467
|
-
this.text = options.text;
|
|
116468
|
-
this.trigger = options.trigger;
|
|
116469
|
-
this.selectedText = "";
|
|
116470
|
-
}, "resolveOptions")
|
|
116471
|
-
/**
|
|
116472
|
-
* Decides which selection strategy is going to be applied based
|
|
116473
|
-
* on the existence of `text` and `target` properties.
|
|
116474
|
-
*/
|
|
116475
|
-
}, {
|
|
116476
|
-
key: "initSelection",
|
|
116477
|
-
value: /* @__PURE__ */ __name(function initSelection() {
|
|
116478
|
-
if (this.text) {
|
|
116479
|
-
this.selectFake();
|
|
116480
|
-
} else if (this.target) {
|
|
116481
|
-
this.selectTarget();
|
|
116482
|
-
}
|
|
116483
|
-
}, "initSelection")
|
|
116484
|
-
/**
|
|
116485
|
-
* Creates a fake textarea element, sets its value from `text` property,
|
|
116486
|
-
*/
|
|
116487
|
-
}, {
|
|
116488
|
-
key: "createFakeElement",
|
|
116489
|
-
value: /* @__PURE__ */ __name(function createFakeElement() {
|
|
116490
|
-
var isRTL = document.documentElement.getAttribute("dir") === "rtl";
|
|
116491
|
-
this.fakeElem = document.createElement("textarea");
|
|
116492
|
-
this.fakeElem.style.fontSize = "12pt";
|
|
116493
|
-
this.fakeElem.style.border = "0";
|
|
116494
|
-
this.fakeElem.style.padding = "0";
|
|
116495
|
-
this.fakeElem.style.margin = "0";
|
|
116496
|
-
this.fakeElem.style.position = "absolute";
|
|
116497
|
-
this.fakeElem.style[isRTL ? "right" : "left"] = "-9999px";
|
|
116498
|
-
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
|
116499
|
-
this.fakeElem.style.top = "".concat(yPosition, "px");
|
|
116500
|
-
this.fakeElem.setAttribute("readonly", "");
|
|
116501
|
-
this.fakeElem.value = this.text;
|
|
116502
|
-
return this.fakeElem;
|
|
116503
|
-
}, "createFakeElement")
|
|
116504
|
-
/**
|
|
116505
|
-
* Get's the value of fakeElem,
|
|
116506
|
-
* and makes a selection on it.
|
|
116507
|
-
*/
|
|
116508
|
-
}, {
|
|
116509
|
-
key: "selectFake",
|
|
116510
|
-
value: /* @__PURE__ */ __name(function selectFake() {
|
|
116511
|
-
var _this = this;
|
|
116512
|
-
var fakeElem = this.createFakeElement();
|
|
116513
|
-
this.fakeHandlerCallback = function() {
|
|
116514
|
-
return _this.removeFake();
|
|
116515
|
-
};
|
|
116516
|
-
this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || true;
|
|
116517
|
-
this.container.appendChild(fakeElem);
|
|
116518
|
-
this.selectedText = select_default()(fakeElem);
|
|
116519
|
-
this.copyText();
|
|
116520
|
-
this.removeFake();
|
|
116521
|
-
}, "selectFake")
|
|
116522
|
-
/**
|
|
116523
|
-
* Only removes the fake element after another click event, that way
|
|
116524
|
-
* a user can hit `Ctrl+C` to copy because selection still exists.
|
|
116525
|
-
*/
|
|
116526
|
-
}, {
|
|
116527
|
-
key: "removeFake",
|
|
116528
|
-
value: /* @__PURE__ */ __name(function removeFake() {
|
|
116529
|
-
if (this.fakeHandler) {
|
|
116530
|
-
this.container.removeEventListener("click", this.fakeHandlerCallback);
|
|
116531
|
-
this.fakeHandler = null;
|
|
116532
|
-
this.fakeHandlerCallback = null;
|
|
116533
|
-
}
|
|
116534
|
-
if (this.fakeElem) {
|
|
116535
|
-
this.container.removeChild(this.fakeElem);
|
|
116536
|
-
this.fakeElem = null;
|
|
116537
|
-
}
|
|
116538
|
-
}, "removeFake")
|
|
116539
|
-
/**
|
|
116540
|
-
* Selects the content from element passed on `target` property.
|
|
116541
|
-
*/
|
|
116542
|
-
}, {
|
|
116543
|
-
key: "selectTarget",
|
|
116544
|
-
value: /* @__PURE__ */ __name(function selectTarget() {
|
|
116545
|
-
this.selectedText = select_default()(this.target);
|
|
116546
|
-
this.copyText();
|
|
116547
|
-
}, "selectTarget")
|
|
116548
|
-
/**
|
|
116549
|
-
* Executes the copy operation based on the current selection.
|
|
116550
|
-
*/
|
|
116551
|
-
}, {
|
|
116552
|
-
key: "copyText",
|
|
116553
|
-
value: /* @__PURE__ */ __name(function copyText() {
|
|
116554
|
-
var succeeded;
|
|
116555
|
-
try {
|
|
116556
|
-
succeeded = document.execCommand(this.action);
|
|
116557
|
-
} catch (err2) {
|
|
116558
|
-
succeeded = false;
|
|
116559
|
-
}
|
|
116560
|
-
this.handleResult(succeeded);
|
|
116561
|
-
}, "copyText")
|
|
116562
|
-
/**
|
|
116563
|
-
* Fires an event based on the copy operation result.
|
|
116564
|
-
* @param {Boolean} succeeded
|
|
116565
|
-
*/
|
|
116566
|
-
}, {
|
|
116567
|
-
key: "handleResult",
|
|
116568
|
-
value: /* @__PURE__ */ __name(function handleResult(succeeded) {
|
|
116569
|
-
this.emitter.emit(succeeded ? "success" : "error", {
|
|
116570
|
-
action: this.action,
|
|
116571
|
-
text: this.selectedText,
|
|
116572
|
-
trigger: this.trigger,
|
|
116573
|
-
clearSelection: this.clearSelection.bind(this)
|
|
116574
|
-
});
|
|
116575
|
-
}, "handleResult")
|
|
116576
|
-
/**
|
|
116577
|
-
* Moves focus away from `target` and back to the trigger, removes current selection.
|
|
116578
|
-
*/
|
|
116579
|
-
}, {
|
|
116580
|
-
key: "clearSelection",
|
|
116581
|
-
value: /* @__PURE__ */ __name(function clearSelection() {
|
|
116582
|
-
if (this.trigger) {
|
|
116583
|
-
this.trigger.focus();
|
|
116584
|
-
}
|
|
116585
|
-
document.activeElement.blur();
|
|
116586
|
-
window.getSelection().removeAllRanges();
|
|
116587
|
-
}, "clearSelection")
|
|
116588
|
-
/**
|
|
116589
|
-
* Sets the `action` to be performed which can be either 'copy' or 'cut'.
|
|
116590
|
-
* @param {String} action
|
|
116591
|
-
*/
|
|
116592
|
-
}, {
|
|
116593
|
-
key: "destroy",
|
|
116594
|
-
/**
|
|
116595
|
-
* Destroy lifecycle.
|
|
116596
|
-
*/
|
|
116597
|
-
value: /* @__PURE__ */ __name(function destroy2() {
|
|
116598
|
-
this.removeFake();
|
|
116599
|
-
}, "destroy")
|
|
116600
|
-
}, {
|
|
116601
|
-
key: "action",
|
|
116602
|
-
set: /* @__PURE__ */ __name(function set6() {
|
|
116603
|
-
var action2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "copy";
|
|
116604
|
-
this._action = action2;
|
|
116605
|
-
if (this._action !== "copy" && this._action !== "cut") {
|
|
116606
|
-
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
|
116607
|
-
}
|
|
116608
|
-
}, "set"),
|
|
116609
|
-
get: /* @__PURE__ */ __name(function get7() {
|
|
116610
|
-
return this._action;
|
|
116611
|
-
}, "get")
|
|
116612
|
-
/**
|
|
116613
|
-
* Sets the `target` property using an element
|
|
116614
|
-
* that will be have its content copied.
|
|
116615
|
-
* @param {Element} target
|
|
116616
|
-
*/
|
|
116617
|
-
}, {
|
|
116618
|
-
key: "target",
|
|
116619
|
-
set: /* @__PURE__ */ __name(function set6(target) {
|
|
116620
|
-
if (target !== void 0) {
|
|
116621
|
-
if (target && _typeof2(target) === "object" && target.nodeType === 1) {
|
|
116622
|
-
if (this.action === "copy" && target.hasAttribute("disabled")) {
|
|
116623
|
-
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
|
116624
|
-
}
|
|
116625
|
-
if (this.action === "cut" && (target.hasAttribute("readonly") || target.hasAttribute("disabled"))) {
|
|
116626
|
-
throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
|
|
116627
|
-
}
|
|
116628
|
-
this._target = target;
|
|
116629
|
-
} else {
|
|
116630
|
-
throw new Error('Invalid "target" value, use a valid Element');
|
|
116631
|
-
}
|
|
116632
|
-
}
|
|
116633
|
-
}, "set"),
|
|
116634
|
-
get: /* @__PURE__ */ __name(function get7() {
|
|
116635
|
-
return this._target;
|
|
116636
|
-
}, "get")
|
|
116637
|
-
}]);
|
|
116638
|
-
return ClipboardAction2;
|
|
116639
|
-
}();
|
|
116640
|
-
var clipboard_action = ClipboardAction;
|
|
116641
|
-
function clipboard_typeof(obj) {
|
|
116642
|
-
"@babel/helpers - typeof";
|
|
116643
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
116644
|
-
clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116645
|
-
return typeof obj2;
|
|
116646
|
-
}, "_typeof");
|
|
116647
|
-
} else {
|
|
116648
|
-
clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116649
|
-
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
116650
|
-
}, "_typeof");
|
|
116651
|
-
}
|
|
116652
|
-
return clipboard_typeof(obj);
|
|
116653
|
-
}
|
|
116654
|
-
__name(clipboard_typeof, "clipboard_typeof");
|
|
116655
|
-
function clipboard_classCallCheck(instance, Constructor) {
|
|
116656
|
-
if (!(instance instanceof Constructor)) {
|
|
116657
|
-
throw new TypeError("Cannot call a class as a function");
|
|
116658
|
-
}
|
|
116659
|
-
}
|
|
116660
|
-
__name(clipboard_classCallCheck, "clipboard_classCallCheck");
|
|
116661
|
-
function clipboard_defineProperties(target, props) {
|
|
116662
|
-
for (var i = 0; i < props.length; i++) {
|
|
116663
|
-
var descriptor = props[i];
|
|
116664
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
116665
|
-
descriptor.configurable = true;
|
|
116666
|
-
if ("value" in descriptor)
|
|
116667
|
-
descriptor.writable = true;
|
|
116668
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
116669
|
-
}
|
|
116670
|
-
}
|
|
116671
|
-
__name(clipboard_defineProperties, "clipboard_defineProperties");
|
|
116672
|
-
function clipboard_createClass(Constructor, protoProps, staticProps) {
|
|
116673
|
-
if (protoProps)
|
|
116674
|
-
clipboard_defineProperties(Constructor.prototype, protoProps);
|
|
116675
|
-
if (staticProps)
|
|
116676
|
-
clipboard_defineProperties(Constructor, staticProps);
|
|
116677
|
-
return Constructor;
|
|
116678
|
-
}
|
|
116679
|
-
__name(clipboard_createClass, "clipboard_createClass");
|
|
116680
|
-
function _inherits2(subClass, superClass) {
|
|
116681
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
116682
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
116683
|
-
}
|
|
116684
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
116685
|
-
if (superClass)
|
|
116686
|
-
_setPrototypeOf2(subClass, superClass);
|
|
116687
|
-
}
|
|
116688
|
-
__name(_inherits2, "_inherits");
|
|
116689
|
-
function _setPrototypeOf2(o2, p2) {
|
|
116690
|
-
_setPrototypeOf2 = Object.setPrototypeOf || /* @__PURE__ */ __name(function _setPrototypeOf3(o3, p3) {
|
|
116691
|
-
o3.__proto__ = p3;
|
|
116692
|
-
return o3;
|
|
116693
|
-
}, "_setPrototypeOf");
|
|
116694
|
-
return _setPrototypeOf2(o2, p2);
|
|
116695
|
-
}
|
|
116696
|
-
__name(_setPrototypeOf2, "_setPrototypeOf");
|
|
116697
|
-
function _createSuper2(Derived) {
|
|
116698
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
|
|
116699
|
-
return /* @__PURE__ */ __name(function _createSuperInternal() {
|
|
116700
|
-
var Super = _getPrototypeOf2(Derived), result;
|
|
116701
|
-
if (hasNativeReflectConstruct) {
|
|
116702
|
-
var NewTarget = _getPrototypeOf2(this).constructor;
|
|
116703
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
116704
|
-
} else {
|
|
116705
|
-
result = Super.apply(this, arguments);
|
|
116706
|
-
}
|
|
116707
|
-
return _possibleConstructorReturn2(this, result);
|
|
116708
|
-
}, "_createSuperInternal");
|
|
116709
|
-
}
|
|
116710
|
-
__name(_createSuper2, "_createSuper");
|
|
116711
|
-
function _possibleConstructorReturn2(self2, call2) {
|
|
116712
|
-
if (call2 && (clipboard_typeof(call2) === "object" || typeof call2 === "function")) {
|
|
116713
|
-
return call2;
|
|
116714
|
-
}
|
|
116715
|
-
return _assertThisInitialized2(self2);
|
|
116716
|
-
}
|
|
116717
|
-
__name(_possibleConstructorReturn2, "_possibleConstructorReturn");
|
|
116718
|
-
function _assertThisInitialized2(self2) {
|
|
116719
|
-
if (self2 === void 0) {
|
|
116720
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
116721
|
-
}
|
|
116722
|
-
return self2;
|
|
116723
|
-
}
|
|
116724
|
-
__name(_assertThisInitialized2, "_assertThisInitialized");
|
|
116725
|
-
function _isNativeReflectConstruct2() {
|
|
116726
|
-
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
116727
|
-
return false;
|
|
116728
|
-
if (Reflect.construct.sham)
|
|
116729
|
-
return false;
|
|
116730
|
-
if (typeof Proxy === "function")
|
|
116731
|
-
return true;
|
|
116732
|
-
try {
|
|
116733
|
-
Date.prototype.toString.call(Reflect.construct(Date, [], function() {
|
|
116734
|
-
}));
|
|
116735
|
-
return true;
|
|
116736
|
-
} catch (e) {
|
|
116737
|
-
return false;
|
|
116738
|
-
}
|
|
116739
|
-
}
|
|
116740
|
-
__name(_isNativeReflectConstruct2, "_isNativeReflectConstruct");
|
|
116741
|
-
function _getPrototypeOf2(o2) {
|
|
116742
|
-
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : /* @__PURE__ */ __name(function _getPrototypeOf3(o3) {
|
|
116743
|
-
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
116744
|
-
}, "_getPrototypeOf");
|
|
116745
|
-
return _getPrototypeOf2(o2);
|
|
116746
|
-
}
|
|
116747
|
-
__name(_getPrototypeOf2, "_getPrototypeOf");
|
|
116748
|
-
function getAttributeValue(suffix, element2) {
|
|
116749
|
-
var attribute = "data-clipboard-".concat(suffix);
|
|
116750
|
-
if (!element2.hasAttribute(attribute)) {
|
|
116751
|
-
return;
|
|
116752
|
-
}
|
|
116753
|
-
return element2.getAttribute(attribute);
|
|
116754
|
-
}
|
|
116755
|
-
__name(getAttributeValue, "getAttributeValue");
|
|
116756
|
-
var Clipboard2 = /* @__PURE__ */ function(_Emitter) {
|
|
116757
|
-
_inherits2(Clipboard3, _Emitter);
|
|
116758
|
-
var _super = _createSuper2(Clipboard3);
|
|
116759
|
-
function Clipboard3(trigger2, options) {
|
|
116760
|
-
var _this;
|
|
116761
|
-
clipboard_classCallCheck(this, Clipboard3);
|
|
116762
|
-
_this = _super.call(this);
|
|
116763
|
-
_this.resolveOptions(options);
|
|
116764
|
-
_this.listenClick(trigger2);
|
|
116765
|
-
return _this;
|
|
116766
|
-
}
|
|
116767
|
-
__name(Clipboard3, "Clipboard");
|
|
116768
|
-
clipboard_createClass(Clipboard3, [{
|
|
116769
|
-
key: "resolveOptions",
|
|
116770
|
-
value: /* @__PURE__ */ __name(function resolveOptions() {
|
|
116771
|
-
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
116772
|
-
this.action = typeof options.action === "function" ? options.action : this.defaultAction;
|
|
116773
|
-
this.target = typeof options.target === "function" ? options.target : this.defaultTarget;
|
|
116774
|
-
this.text = typeof options.text === "function" ? options.text : this.defaultText;
|
|
116775
|
-
this.container = clipboard_typeof(options.container) === "object" ? options.container : document.body;
|
|
116776
|
-
}, "resolveOptions")
|
|
116777
|
-
/**
|
|
116778
|
-
* Adds a click event listener to the passed trigger.
|
|
116779
|
-
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
|
|
116780
|
-
*/
|
|
116781
|
-
}, {
|
|
116782
|
-
key: "listenClick",
|
|
116783
|
-
value: /* @__PURE__ */ __name(function listenClick(trigger2) {
|
|
116784
|
-
var _this2 = this;
|
|
116785
|
-
this.listener = listen_default()(trigger2, "click", function(e) {
|
|
116786
|
-
return _this2.onClick(e);
|
|
116787
|
-
});
|
|
116788
|
-
}, "listenClick")
|
|
116789
|
-
/**
|
|
116790
|
-
* Defines a new `ClipboardAction` on each click event.
|
|
116791
|
-
* @param {Event} e
|
|
116792
|
-
*/
|
|
116793
|
-
}, {
|
|
116794
|
-
key: "onClick",
|
|
116795
|
-
value: /* @__PURE__ */ __name(function onClick(e) {
|
|
116796
|
-
var trigger2 = e.delegateTarget || e.currentTarget;
|
|
116797
|
-
if (this.clipboardAction) {
|
|
116798
|
-
this.clipboardAction = null;
|
|
116799
|
-
}
|
|
116800
|
-
this.clipboardAction = new clipboard_action({
|
|
116801
|
-
action: this.action(trigger2),
|
|
116802
|
-
target: this.target(trigger2),
|
|
116803
|
-
text: this.text(trigger2),
|
|
116804
|
-
container: this.container,
|
|
116805
|
-
trigger: trigger2,
|
|
116806
|
-
emitter: this
|
|
116807
|
-
});
|
|
116808
|
-
}, "onClick")
|
|
116809
|
-
/**
|
|
116810
|
-
* Default `action` lookup function.
|
|
116811
|
-
* @param {Element} trigger
|
|
116812
|
-
*/
|
|
116813
|
-
}, {
|
|
116814
|
-
key: "defaultAction",
|
|
116815
|
-
value: /* @__PURE__ */ __name(function defaultAction(trigger2) {
|
|
116816
|
-
return getAttributeValue("action", trigger2);
|
|
116817
|
-
}, "defaultAction")
|
|
116818
|
-
/**
|
|
116819
|
-
* Default `target` lookup function.
|
|
116820
|
-
* @param {Element} trigger
|
|
116821
|
-
*/
|
|
116822
|
-
}, {
|
|
116823
|
-
key: "defaultTarget",
|
|
116824
|
-
value: /* @__PURE__ */ __name(function defaultTarget(trigger2) {
|
|
116825
|
-
var selector = getAttributeValue("target", trigger2);
|
|
116826
|
-
if (selector) {
|
|
116827
|
-
return document.querySelector(selector);
|
|
116828
|
-
}
|
|
116829
|
-
}, "defaultTarget")
|
|
116830
|
-
/**
|
|
116831
|
-
* Returns the support of the given action, or all actions if no action is
|
|
116832
|
-
* given.
|
|
116833
|
-
* @param {String} [action]
|
|
116834
|
-
*/
|
|
116835
|
-
}, {
|
|
116836
|
-
key: "defaultText",
|
|
116837
|
-
/**
|
|
116838
|
-
* Default `text` lookup function.
|
|
116839
|
-
* @param {Element} trigger
|
|
116840
|
-
*/
|
|
116841
|
-
value: /* @__PURE__ */ __name(function defaultText(trigger2) {
|
|
116842
|
-
return getAttributeValue("text", trigger2);
|
|
116843
|
-
}, "defaultText")
|
|
116844
|
-
/**
|
|
116845
|
-
* Destroy lifecycle.
|
|
116846
|
-
*/
|
|
116847
|
-
}, {
|
|
116848
|
-
key: "destroy",
|
|
116849
|
-
value: /* @__PURE__ */ __name(function destroy2() {
|
|
116850
|
-
this.listener.destroy();
|
|
116851
|
-
if (this.clipboardAction) {
|
|
116852
|
-
this.clipboardAction.destroy();
|
|
116853
|
-
this.clipboardAction = null;
|
|
116854
|
-
}
|
|
116855
|
-
}, "destroy")
|
|
116856
|
-
}], [{
|
|
116857
|
-
key: "isSupported",
|
|
116858
|
-
value: /* @__PURE__ */ __name(function isSupported() {
|
|
116859
|
-
var action2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"];
|
|
116860
|
-
var actions2 = typeof action2 === "string" ? [action2] : action2;
|
|
116861
|
-
var support = !!document.queryCommandSupported;
|
|
116862
|
-
actions2.forEach(function(action3) {
|
|
116863
|
-
support = support && !!document.queryCommandSupported(action3);
|
|
116864
|
-
});
|
|
116865
|
-
return support;
|
|
116866
|
-
}, "isSupported")
|
|
116867
|
-
}]);
|
|
116868
|
-
return Clipboard3;
|
|
116869
|
-
}(tiny_emitter_default());
|
|
116870
|
-
var clipboard2 = Clipboard2;
|
|
116871
|
-
}
|
|
116872
|
-
),
|
|
116873
|
-
/***/
|
|
116874
|
-
828: (
|
|
116875
|
-
/***/
|
|
116876
|
-
function(module3) {
|
|
116877
|
-
var DOCUMENT_NODE_TYPE = 9;
|
|
116878
|
-
if (typeof Element !== "undefined" && !Element.prototype.matches) {
|
|
116879
|
-
var proto = Element.prototype;
|
|
116880
|
-
proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
|
|
116881
|
-
}
|
|
116882
|
-
function closest2(element2, selector) {
|
|
116883
|
-
while (element2 && element2.nodeType !== DOCUMENT_NODE_TYPE) {
|
|
116884
|
-
if (typeof element2.matches === "function" && element2.matches(selector)) {
|
|
116885
|
-
return element2;
|
|
116886
|
-
}
|
|
116887
|
-
element2 = element2.parentNode;
|
|
116888
|
-
}
|
|
116889
|
-
}
|
|
116890
|
-
__name(closest2, "closest");
|
|
116891
|
-
module3.exports = closest2;
|
|
116892
|
-
}
|
|
116893
|
-
),
|
|
116894
|
-
/***/
|
|
116895
|
-
438: (
|
|
116896
|
-
/***/
|
|
116897
|
-
function(module3, __unused_webpack_exports, __webpack_require__2) {
|
|
116898
|
-
var closest2 = __webpack_require__2(828);
|
|
116899
|
-
function _delegate(element2, selector, type2, callback2, useCapture) {
|
|
116900
|
-
var listenerFn = listener.apply(this, arguments);
|
|
116901
|
-
element2.addEventListener(type2, listenerFn, useCapture);
|
|
116902
|
-
return {
|
|
116903
|
-
destroy: function() {
|
|
116904
|
-
element2.removeEventListener(type2, listenerFn, useCapture);
|
|
116905
|
-
}
|
|
116906
|
-
};
|
|
116907
|
-
}
|
|
116908
|
-
__name(_delegate, "_delegate");
|
|
116909
|
-
function delegate(elements, selector, type2, callback2, useCapture) {
|
|
116910
|
-
if (typeof elements.addEventListener === "function") {
|
|
116911
|
-
return _delegate.apply(null, arguments);
|
|
116912
|
-
}
|
|
116913
|
-
if (typeof type2 === "function") {
|
|
116914
|
-
return _delegate.bind(null, document).apply(null, arguments);
|
|
116915
|
-
}
|
|
116916
|
-
if (typeof elements === "string") {
|
|
116917
|
-
elements = document.querySelectorAll(elements);
|
|
116918
|
-
}
|
|
116919
|
-
return Array.prototype.map.call(elements, function(element2) {
|
|
116920
|
-
return _delegate(element2, selector, type2, callback2, useCapture);
|
|
116921
|
-
});
|
|
116922
|
-
}
|
|
116923
|
-
__name(delegate, "delegate");
|
|
116924
|
-
function listener(element2, selector, type2, callback2) {
|
|
116925
|
-
return function(e) {
|
|
116926
|
-
e.delegateTarget = closest2(e.target, selector);
|
|
116927
|
-
if (e.delegateTarget) {
|
|
116928
|
-
callback2.call(element2, e);
|
|
116929
|
-
}
|
|
116930
|
-
};
|
|
116931
|
-
}
|
|
116932
|
-
__name(listener, "listener");
|
|
116933
|
-
module3.exports = delegate;
|
|
116934
|
-
}
|
|
116935
|
-
),
|
|
116936
|
-
/***/
|
|
116937
|
-
879: (
|
|
116938
|
-
/***/
|
|
116939
|
-
function(__unused_webpack_module, exports3) {
|
|
116940
|
-
exports3.node = function(value) {
|
|
116941
|
-
return value !== void 0 && value instanceof HTMLElement && value.nodeType === 1;
|
|
116942
|
-
};
|
|
116943
|
-
exports3.nodeList = function(value) {
|
|
116944
|
-
var type2 = Object.prototype.toString.call(value);
|
|
116945
|
-
return value !== void 0 && (type2 === "[object NodeList]" || type2 === "[object HTMLCollection]") && "length" in value && (value.length === 0 || exports3.node(value[0]));
|
|
116946
|
-
};
|
|
116947
|
-
exports3.string = function(value) {
|
|
116948
|
-
return typeof value === "string" || value instanceof String;
|
|
116949
|
-
};
|
|
116950
|
-
exports3.fn = function(value) {
|
|
116951
|
-
var type2 = Object.prototype.toString.call(value);
|
|
116952
|
-
return type2 === "[object Function]";
|
|
116953
|
-
};
|
|
116954
|
-
}
|
|
116955
|
-
),
|
|
116956
|
-
/***/
|
|
116957
|
-
370: (
|
|
116958
|
-
/***/
|
|
116959
|
-
function(module3, __unused_webpack_exports, __webpack_require__2) {
|
|
116960
|
-
var is3 = __webpack_require__2(879);
|
|
116961
|
-
var delegate = __webpack_require__2(438);
|
|
116962
|
-
function listen(target, type2, callback2) {
|
|
116963
|
-
if (!target && !type2 && !callback2) {
|
|
116964
|
-
throw new Error("Missing required arguments");
|
|
116965
|
-
}
|
|
116966
|
-
if (!is3.string(type2)) {
|
|
116967
|
-
throw new TypeError("Second argument must be a String");
|
|
116968
|
-
}
|
|
116969
|
-
if (!is3.fn(callback2)) {
|
|
116970
|
-
throw new TypeError("Third argument must be a Function");
|
|
116971
|
-
}
|
|
116972
|
-
if (is3.node(target)) {
|
|
116973
|
-
return listenNode(target, type2, callback2);
|
|
116974
|
-
} else if (is3.nodeList(target)) {
|
|
116975
|
-
return listenNodeList(target, type2, callback2);
|
|
116976
|
-
} else if (is3.string(target)) {
|
|
116977
|
-
return listenSelector(target, type2, callback2);
|
|
116978
|
-
} else {
|
|
116979
|
-
throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
|
|
116980
|
-
}
|
|
116981
|
-
}
|
|
116982
|
-
__name(listen, "listen");
|
|
116983
|
-
function listenNode(node2, type2, callback2) {
|
|
116984
|
-
node2.addEventListener(type2, callback2);
|
|
116985
|
-
return {
|
|
116986
|
-
destroy: function() {
|
|
116987
|
-
node2.removeEventListener(type2, callback2);
|
|
116988
|
-
}
|
|
116989
|
-
};
|
|
116990
|
-
}
|
|
116991
|
-
__name(listenNode, "listenNode");
|
|
116992
|
-
function listenNodeList(nodeList, type2, callback2) {
|
|
116993
|
-
Array.prototype.forEach.call(nodeList, function(node2) {
|
|
116994
|
-
node2.addEventListener(type2, callback2);
|
|
116995
|
-
});
|
|
116996
|
-
return {
|
|
116997
|
-
destroy: function() {
|
|
116998
|
-
Array.prototype.forEach.call(nodeList, function(node2) {
|
|
116999
|
-
node2.removeEventListener(type2, callback2);
|
|
117000
|
-
});
|
|
117001
|
-
}
|
|
117002
|
-
};
|
|
117003
|
-
}
|
|
117004
|
-
__name(listenNodeList, "listenNodeList");
|
|
117005
|
-
function listenSelector(selector, type2, callback2) {
|
|
117006
|
-
return delegate(document.body, selector, type2, callback2);
|
|
117007
|
-
}
|
|
117008
|
-
__name(listenSelector, "listenSelector");
|
|
117009
|
-
module3.exports = listen;
|
|
117010
|
-
}
|
|
117011
|
-
),
|
|
117012
|
-
/***/
|
|
117013
|
-
817: (
|
|
117014
|
-
/***/
|
|
117015
|
-
function(module3) {
|
|
117016
|
-
function select(element2) {
|
|
117017
|
-
var selectedText;
|
|
117018
|
-
if (element2.nodeName === "SELECT") {
|
|
117019
|
-
element2.focus();
|
|
117020
|
-
selectedText = element2.value;
|
|
117021
|
-
} else if (element2.nodeName === "INPUT" || element2.nodeName === "TEXTAREA") {
|
|
117022
|
-
var isReadOnly = element2.hasAttribute("readonly");
|
|
117023
|
-
if (!isReadOnly) {
|
|
117024
|
-
element2.setAttribute("readonly", "");
|
|
117025
|
-
}
|
|
117026
|
-
element2.select();
|
|
117027
|
-
element2.setSelectionRange(0, element2.value.length);
|
|
117028
|
-
if (!isReadOnly) {
|
|
117029
|
-
element2.removeAttribute("readonly");
|
|
117030
|
-
}
|
|
117031
|
-
selectedText = element2.value;
|
|
117032
|
-
} else {
|
|
117033
|
-
if (element2.hasAttribute("contenteditable")) {
|
|
117034
|
-
element2.focus();
|
|
117035
|
-
}
|
|
117036
|
-
var selection = window.getSelection();
|
|
117037
|
-
var range2 = document.createRange();
|
|
117038
|
-
range2.selectNodeContents(element2);
|
|
117039
|
-
selection.removeAllRanges();
|
|
117040
|
-
selection.addRange(range2);
|
|
117041
|
-
selectedText = selection.toString();
|
|
117042
|
-
}
|
|
117043
|
-
return selectedText;
|
|
117044
|
-
}
|
|
117045
|
-
__name(select, "select");
|
|
117046
|
-
module3.exports = select;
|
|
117047
|
-
}
|
|
117048
|
-
),
|
|
117049
|
-
/***/
|
|
117050
|
-
279: (
|
|
117051
|
-
/***/
|
|
117052
|
-
function(module3) {
|
|
117053
|
-
function E2() {
|
|
117054
|
-
}
|
|
117055
|
-
__name(E2, "E");
|
|
117056
|
-
E2.prototype = {
|
|
117057
|
-
on: function(name2, callback2, ctx) {
|
|
117058
|
-
var e = this.e || (this.e = {});
|
|
117059
|
-
(e[name2] || (e[name2] = [])).push({
|
|
117060
|
-
fn: callback2,
|
|
117061
|
-
ctx
|
|
117062
|
-
});
|
|
117063
|
-
return this;
|
|
117064
|
-
},
|
|
117065
|
-
once: function(name2, callback2, ctx) {
|
|
117066
|
-
var self2 = this;
|
|
117067
|
-
function listener() {
|
|
117068
|
-
self2.off(name2, listener);
|
|
117069
|
-
callback2.apply(ctx, arguments);
|
|
117070
|
-
}
|
|
117071
|
-
__name(listener, "listener");
|
|
117072
|
-
listener._ = callback2;
|
|
117073
|
-
return this.on(name2, listener, ctx);
|
|
117074
|
-
},
|
|
117075
|
-
emit: function(name2) {
|
|
117076
|
-
var data = [].slice.call(arguments, 1);
|
|
117077
|
-
var evtArr = ((this.e || (this.e = {}))[name2] || []).slice();
|
|
117078
|
-
var i = 0;
|
|
117079
|
-
var len = evtArr.length;
|
|
117080
|
-
for (i; i < len; i++) {
|
|
117081
|
-
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
|
117082
|
-
}
|
|
117083
|
-
return this;
|
|
117084
|
-
},
|
|
117085
|
-
off: function(name2, callback2) {
|
|
117086
|
-
var e = this.e || (this.e = {});
|
|
117087
|
-
var evts = e[name2];
|
|
117088
|
-
var liveEvents = [];
|
|
117089
|
-
if (evts && callback2) {
|
|
117090
|
-
for (var i = 0, len = evts.length; i < len; i++) {
|
|
117091
|
-
if (evts[i].fn !== callback2 && evts[i].fn._ !== callback2)
|
|
117092
|
-
liveEvents.push(evts[i]);
|
|
117093
|
-
}
|
|
117094
|
-
}
|
|
117095
|
-
liveEvents.length ? e[name2] = liveEvents : delete e[name2];
|
|
117096
|
-
return this;
|
|
117097
|
-
}
|
|
117098
|
-
};
|
|
117099
|
-
module3.exports = E2;
|
|
117100
|
-
module3.exports.TinyEmitter = E2;
|
|
117101
|
-
}
|
|
117102
|
-
)
|
|
117103
|
-
/******/
|
|
117104
|
-
};
|
|
117105
|
-
var __webpack_module_cache__ = {};
|
|
117106
|
-
function __webpack_require__(moduleId) {
|
|
117107
|
-
if (__webpack_module_cache__[moduleId]) {
|
|
117108
|
-
return __webpack_module_cache__[moduleId].exports;
|
|
117109
|
-
}
|
|
117110
|
-
var module3 = __webpack_module_cache__[moduleId] = {
|
|
117111
|
-
/******/
|
|
117112
|
-
// no module.id needed
|
|
117113
|
-
/******/
|
|
117114
|
-
// no module.loaded needed
|
|
117115
|
-
/******/
|
|
117116
|
-
exports: {}
|
|
117117
|
-
/******/
|
|
117118
|
-
};
|
|
117119
|
-
__webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
|
|
117120
|
-
return module3.exports;
|
|
117121
|
-
}
|
|
117122
|
-
__name(__webpack_require__, "__webpack_require__");
|
|
117123
|
-
!function() {
|
|
117124
|
-
__webpack_require__.n = function(module3) {
|
|
117125
|
-
var getter = module3 && module3.__esModule ? (
|
|
117126
|
-
/******/
|
|
117127
|
-
function() {
|
|
117128
|
-
return module3["default"];
|
|
117129
|
-
}
|
|
117130
|
-
) : (
|
|
117131
|
-
/******/
|
|
117132
|
-
function() {
|
|
117133
|
-
return module3;
|
|
117134
|
-
}
|
|
117135
|
-
);
|
|
117136
|
-
__webpack_require__.d(getter, { a: getter });
|
|
117137
|
-
return getter;
|
|
117138
|
-
};
|
|
117139
|
-
}();
|
|
117140
|
-
!function() {
|
|
117141
|
-
__webpack_require__.d = function(exports3, definition2) {
|
|
117142
|
-
for (var key in definition2) {
|
|
117143
|
-
if (__webpack_require__.o(definition2, key) && !__webpack_require__.o(exports3, key)) {
|
|
117144
|
-
Object.defineProperty(exports3, key, { enumerable: true, get: definition2[key] });
|
|
117145
|
-
}
|
|
117146
|
-
}
|
|
117147
|
-
};
|
|
117148
|
-
}();
|
|
117149
|
-
!function() {
|
|
117150
|
-
__webpack_require__.o = function(obj, prop2) {
|
|
117151
|
-
return Object.prototype.hasOwnProperty.call(obj, prop2);
|
|
117152
|
-
};
|
|
117153
|
-
}();
|
|
117154
|
-
return __webpack_require__(134);
|
|
117155
|
-
}().default
|
|
117156
|
-
);
|
|
117157
|
-
});
|
|
117158
|
-
})(clipboard);
|
|
117159
|
-
var clipboardExports = clipboard.exports;
|
|
117160
|
-
const Clipboard$1 = /* @__PURE__ */ getDefaultExportFromCjs(clipboardExports);
|
|
117161
116390
|
var connectionStore = /* @__PURE__ */ new WeakMap();
|
|
117162
116391
|
var ITERATION_KEY = Symbol("iteration key");
|
|
117163
116392
|
function storeObservable(obj) {
|
|
@@ -123132,7 +122361,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
123132
122361
|
}
|
|
123133
122362
|
__name(showFileDialog, "showFileDialog");
|
|
123134
122363
|
const name = "@teselagen/ove";
|
|
123135
|
-
const version = "0.7.3-beta.
|
|
122364
|
+
const version = "0.7.3-beta.6";
|
|
123136
122365
|
const main = "./src/index.js";
|
|
123137
122366
|
const type = "module";
|
|
123138
122367
|
const exports$1 = {
|
|
@@ -127040,7 +126269,7 @@ function isElementInViewport(el) {
|
|
|
127040
126269
|
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
127041
126270
|
}
|
|
127042
126271
|
__name(isElementInViewport, "isElementInViewport");
|
|
127043
|
-
const
|
|
126272
|
+
const _Keyboard = class _Keyboard extends React__default$1.Component {
|
|
127044
126273
|
constructor() {
|
|
127045
126274
|
super(...arguments);
|
|
127046
126275
|
__publicField(this, "handleKeyDown", /* @__PURE__ */ __name((e) => {
|
|
@@ -127109,14 +126338,14 @@ const _Clipboard = class _Clipboard extends React__default$1.Component {
|
|
|
127109
126338
|
);
|
|
127110
126339
|
}
|
|
127111
126340
|
};
|
|
127112
|
-
__name(
|
|
126341
|
+
__name(_Keyboard, "Keyboard");
|
|
127113
126342
|
// static propTypes = {
|
|
127114
126343
|
// value: PropTypes.string.isRequired
|
|
127115
126344
|
// };
|
|
127116
|
-
__publicField(
|
|
126345
|
+
__publicField(_Keyboard, "defaultProps", {
|
|
127117
126346
|
className: "clipboard"
|
|
127118
126347
|
});
|
|
127119
|
-
let
|
|
126348
|
+
let Keyboard = _Keyboard;
|
|
127120
126349
|
let dragInProgress = false;
|
|
127121
126350
|
let selectionStartOrEndGrabbed;
|
|
127122
126351
|
let caretPositionOnDragStart;
|
|
@@ -128132,9 +127361,8 @@ function VectorInteractionHOC(Component2) {
|
|
|
128132
127361
|
const { sequenceData: sequenceData2, readOnly: readOnly2, disableBpEditing, selectionLayer: selectionLayer2 } = this.props;
|
|
128133
127362
|
const { isProtein: isProtein2 } = sequenceData2;
|
|
128134
127363
|
const makeTextCopyable = /* @__PURE__ */ __name((transformFunc, className, action2 = "copy") => {
|
|
128135
|
-
|
|
128136
|
-
|
|
128137
|
-
text: () => {
|
|
127364
|
+
document.querySelectorAll(`.${className}`).forEach((element2) => {
|
|
127365
|
+
element2.addEventListener("click", () => __async(this, null, function* () {
|
|
128138
127366
|
const { selectionLayer: selectionLayer22, editorName, store: store2 } = this.props;
|
|
128139
127367
|
const { sequenceData: sequenceData22, copyOptions: copyOptions2 } = store2.getState().VectorEditor[editorName];
|
|
128140
127368
|
const selectedSeqData = getSequenceDataBetweenRange(
|
|
@@ -128159,17 +127387,19 @@ function VectorInteractionHOC(Component2) {
|
|
|
128159
127387
|
sequenceData22
|
|
128160
127388
|
);
|
|
128161
127389
|
this.sequenceDataToCopy = sequenceDataToCopy;
|
|
128162
|
-
|
|
128163
|
-
|
|
128164
|
-
|
|
128165
|
-
|
|
128166
|
-
|
|
128167
|
-
|
|
128168
|
-
|
|
128169
|
-
|
|
127390
|
+
const textToCopy = sequenceDataToCopy.textToCopy || sequenceDataToCopy.sequence;
|
|
127391
|
+
try {
|
|
127392
|
+
yield navigator.clipboard.writeText(textToCopy);
|
|
127393
|
+
if (action2 === "cut") {
|
|
127394
|
+
}
|
|
127395
|
+
if (window.Cypress) {
|
|
127396
|
+
window.Cypress.textToCopy = sequenceDataToCopy.textToCopy;
|
|
127397
|
+
window.Cypress.seqDataToCopy = sequenceDataToCopy;
|
|
127398
|
+
}
|
|
127399
|
+
} catch (err2) {
|
|
127400
|
+
console.error(`${action2} failed:`, err2);
|
|
128170
127401
|
}
|
|
128171
|
-
|
|
128172
|
-
}
|
|
127402
|
+
}));
|
|
128173
127403
|
});
|
|
128174
127404
|
}, "makeTextCopyable");
|
|
128175
127405
|
const aaCopy = {
|
|
@@ -128807,7 +128037,7 @@ function VectorInteractionHOC(Component2) {
|
|
|
128807
128037
|
},
|
|
128808
128038
|
closePanelButton,
|
|
128809
128039
|
/* @__PURE__ */ React__default$1.createElement(
|
|
128810
|
-
|
|
128040
|
+
Keyboard,
|
|
128811
128041
|
{
|
|
128812
128042
|
value: selectedBps,
|
|
128813
128043
|
onCopy: this.handleCopy,
|
|
@@ -141010,15 +140240,27 @@ ${seqDataToCopy}\r
|
|
|
141010
140240
|
this.copyAllAlignmentsFastaClipboardHelper && this.copyAllAlignmentsFastaClipboardHelper.destroy();
|
|
141011
140241
|
},
|
|
141012
140242
|
didMount: () => {
|
|
141013
|
-
|
|
141014
|
-
`.copyAllAlignmentsFastaClipboardHelper
|
|
141015
|
-
{
|
|
141016
|
-
action: "copyAllAlignmentsFasta",
|
|
141017
|
-
text: () => {
|
|
141018
|
-
return this.getAllAlignmentsFastaText();
|
|
141019
|
-
}
|
|
141020
|
-
}
|
|
140243
|
+
const elements = document.querySelectorAll(
|
|
140244
|
+
`.copyAllAlignmentsFastaClipboardHelper`
|
|
141021
140245
|
);
|
|
140246
|
+
elements.forEach((element2) => {
|
|
140247
|
+
element2.addEventListener(
|
|
140248
|
+
"click",
|
|
140249
|
+
() => __async(this, null, function* () {
|
|
140250
|
+
const textToCopy = this.getAllAlignmentsFastaText();
|
|
140251
|
+
try {
|
|
140252
|
+
yield navigator.clipboard.writeText(
|
|
140253
|
+
textToCopy
|
|
140254
|
+
);
|
|
140255
|
+
} catch (err2) {
|
|
140256
|
+
console.error(
|
|
140257
|
+
"Failed to copy text:",
|
|
140258
|
+
err2
|
|
140259
|
+
);
|
|
140260
|
+
}
|
|
140261
|
+
})
|
|
140262
|
+
);
|
|
140263
|
+
});
|
|
141022
140264
|
},
|
|
141023
140265
|
onClick: () => {
|
|
141024
140266
|
window.toastr.success("Selection Copied");
|
|
@@ -141031,11 +140273,13 @@ ${seqDataToCopy}\r
|
|
|
141031
140273
|
this.copySpecificAlignmentFastaClipboardHelper && this.copySpecificAlignmentFastaClipboardHelper.destroy();
|
|
141032
140274
|
},
|
|
141033
140275
|
didMount: () => {
|
|
141034
|
-
|
|
141035
|
-
`.copySpecificAlignmentFastaClipboardHelper
|
|
141036
|
-
|
|
141037
|
-
|
|
141038
|
-
|
|
140276
|
+
const elements = document.querySelectorAll(
|
|
140277
|
+
`.copySpecificAlignmentFastaClipboardHelper`
|
|
140278
|
+
);
|
|
140279
|
+
elements.forEach((element2) => {
|
|
140280
|
+
element2.addEventListener(
|
|
140281
|
+
"click",
|
|
140282
|
+
() => __async(this, null, function* () {
|
|
141039
140283
|
const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
|
|
141040
140284
|
const seqDataToCopy = getSequenceDataBetweenRange(
|
|
141041
140285
|
alignmentData,
|
|
@@ -141044,10 +140288,19 @@ ${seqDataToCopy}\r
|
|
|
141044
140288
|
const seqDataToCopyAsFasta = `>${name2}\r
|
|
141045
140289
|
${seqDataToCopy}\r
|
|
141046
140290
|
`;
|
|
141047
|
-
|
|
141048
|
-
|
|
141049
|
-
|
|
141050
|
-
|
|
140291
|
+
try {
|
|
140292
|
+
yield navigator.clipboard.writeText(
|
|
140293
|
+
seqDataToCopyAsFasta
|
|
140294
|
+
);
|
|
140295
|
+
} catch (err2) {
|
|
140296
|
+
console.error(
|
|
140297
|
+
"Failed to copy text:",
|
|
140298
|
+
err2
|
|
140299
|
+
);
|
|
140300
|
+
}
|
|
140301
|
+
})
|
|
140302
|
+
);
|
|
140303
|
+
});
|
|
141051
140304
|
},
|
|
141052
140305
|
onClick: () => {
|
|
141053
140306
|
window.toastr.success(
|
|
@@ -141062,20 +140315,31 @@ ${seqDataToCopy}\r
|
|
|
141062
140315
|
this.copySpecificAlignmentAsPlainClipboardHelper && this.copySpecificAlignmentAsPlainClipboardHelper.destroy();
|
|
141063
140316
|
},
|
|
141064
140317
|
didMount: () => {
|
|
141065
|
-
|
|
141066
|
-
`.copySpecificAlignmentAsPlainClipboardHelper
|
|
141067
|
-
|
|
141068
|
-
|
|
141069
|
-
|
|
140318
|
+
const elements = document.querySelectorAll(
|
|
140319
|
+
`.copySpecificAlignmentAsPlainClipboardHelper`
|
|
140320
|
+
);
|
|
140321
|
+
elements.forEach((element2) => {
|
|
140322
|
+
element2.addEventListener(
|
|
140323
|
+
"click",
|
|
140324
|
+
() => __async(this, null, function* () {
|
|
141070
140325
|
const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
|
|
141071
140326
|
const seqDataToCopy = getSequenceDataBetweenRange(
|
|
141072
140327
|
alignmentData,
|
|
141073
140328
|
selectionLayer2
|
|
141074
140329
|
).sequence;
|
|
141075
|
-
|
|
141076
|
-
|
|
141077
|
-
|
|
141078
|
-
|
|
140330
|
+
try {
|
|
140331
|
+
yield navigator.clipboard.writeText(
|
|
140332
|
+
seqDataToCopy
|
|
140333
|
+
);
|
|
140334
|
+
} catch (err2) {
|
|
140335
|
+
console.error(
|
|
140336
|
+
"Failed to copy text:",
|
|
140337
|
+
err2
|
|
140338
|
+
);
|
|
140339
|
+
}
|
|
140340
|
+
})
|
|
140341
|
+
);
|
|
140342
|
+
});
|
|
141079
140343
|
},
|
|
141080
140344
|
onClick: () => {
|
|
141081
140345
|
window.toastr.success("Selection Copied");
|