@teselagen/ove 0.7.3 → 0.7.5
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 +4 -0
- package/index.cjs.js +732 -101
- package/index.es.js +733 -102
- package/index.umd.js +721 -81
- package/package.json +3 -6
- package/src/AlignmentView/index.js +45 -83
- package/src/withEditorInteractions/Keyboard.js +2 -2
- package/src/withEditorInteractions/index.js +13 -20
- package/withEditorInteractions/Keyboard.d.ts +2 -2
package/index.es.js
CHANGED
|
@@ -59,7 +59,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
59
59
|
var _E, _F, _G, _H, _I, _L, _O, _V;
|
|
60
60
|
import { Icon, Classes, Button, Intent, MenuItem, Keys, Tag, Popover, Tooltip, Spinner, Position, FormGroup, Checkbox, Switch, InputGroup, TextArea, EditableText, NumericInput, RadioGroup, Menu, Toaster, MenuDivider, useHotkeys, ContextMenu, Callout, Dialog, Card, Tabs, Tab, Colors, KeyCombo, AnchorButton, Slider as Slider$1, ButtonGroup, HTMLSelect, Label, ResizeSensor, FocusStyleManager } from "@blueprintjs/core";
|
|
61
61
|
import * as React$2 from "react";
|
|
62
|
-
import React__default$1, { useState, useEffect, forwardRef, useImperativeHandle, Fragment, useMemo as useMemo$1, useRef, useReducer, useCallback as useCallback$1, createElement, Component, useLayoutEffect as useLayoutEffect$1, createContext, memo, useContext, isValidElement, PureComponent } from "react";
|
|
62
|
+
import React__default$1, { useState, useEffect, forwardRef, useImperativeHandle, Fragment, useMemo as useMemo$1, useRef, useReducer, useCallback as useCallback$1, createElement, Component, useLayoutEffect as useLayoutEffect$1, createContext, memo, useContext, isValidElement, PureComponent, createPortal as createPortal$1 } from "react";
|
|
63
63
|
import { formValueSelector, initialize, change, Field, reduxForm, SubmissionError, destroy as destroy$1, touch, FormName, reducer as reducer$4, getFormValues, FieldArray } from "redux-form";
|
|
64
64
|
import ReactDOM$1, { unstable_batchedUpdates, createPortal, flushSync, findDOMNode as findDOMNode$1, unmountComponentAtNode, render as render$2 } from "react-dom";
|
|
65
65
|
import { connect, useDispatch, useSelector, useStore, Provider } from "react-redux";
|
|
@@ -17945,25 +17945,16 @@ var getIntrinsic = /* @__PURE__ */ __name(function GetIntrinsic(name2, allowMiss
|
|
|
17945
17945
|
return value;
|
|
17946
17946
|
}, "GetIntrinsic");
|
|
17947
17947
|
var callBind$3 = { exports: {} };
|
|
17948
|
-
var
|
|
17949
|
-
var
|
|
17950
|
-
|
|
17951
|
-
|
|
17952
|
-
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
var $defineProperty2 = GetIntrinsic3("%Object.defineProperty%", true) || false;
|
|
17956
|
-
if ($defineProperty2) {
|
|
17957
|
-
try {
|
|
17958
|
-
$defineProperty2({}, "a", { value: 1 });
|
|
17959
|
-
} catch (e) {
|
|
17960
|
-
$defineProperty2 = false;
|
|
17961
|
-
}
|
|
17948
|
+
var GetIntrinsic$4 = getIntrinsic;
|
|
17949
|
+
var $defineProperty$2 = GetIntrinsic$4("%Object.defineProperty%", true) || false;
|
|
17950
|
+
if ($defineProperty$2) {
|
|
17951
|
+
try {
|
|
17952
|
+
$defineProperty$2({}, "a", { value: 1 });
|
|
17953
|
+
} catch (e) {
|
|
17954
|
+
$defineProperty$2 = false;
|
|
17962
17955
|
}
|
|
17963
|
-
esDefineProperty = $defineProperty2;
|
|
17964
|
-
return esDefineProperty;
|
|
17965
17956
|
}
|
|
17966
|
-
|
|
17957
|
+
var esDefineProperty = $defineProperty$2;
|
|
17967
17958
|
var GetIntrinsic$3 = getIntrinsic;
|
|
17968
17959
|
var $gOPD$1 = GetIntrinsic$3("%Object.getOwnPropertyDescriptor%", true);
|
|
17969
17960
|
if ($gOPD$1) {
|
|
@@ -17974,7 +17965,7 @@ if ($gOPD$1) {
|
|
|
17974
17965
|
}
|
|
17975
17966
|
}
|
|
17976
17967
|
var gopd$1 = $gOPD$1;
|
|
17977
|
-
var $defineProperty$1 =
|
|
17968
|
+
var $defineProperty$1 = esDefineProperty;
|
|
17978
17969
|
var $SyntaxError = syntax;
|
|
17979
17970
|
var $TypeError$4 = type$1;
|
|
17980
17971
|
var gopd = gopd$1;
|
|
@@ -18015,7 +18006,7 @@ var defineDataProperty$1 = /* @__PURE__ */ __name(function defineDataProperty(ob
|
|
|
18015
18006
|
throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
|
18016
18007
|
}
|
|
18017
18008
|
}, "defineDataProperty");
|
|
18018
|
-
var $defineProperty =
|
|
18009
|
+
var $defineProperty = esDefineProperty;
|
|
18019
18010
|
var hasPropertyDescriptors = /* @__PURE__ */ __name(function hasPropertyDescriptors2() {
|
|
18020
18011
|
return !!$defineProperty;
|
|
18021
18012
|
}, "hasPropertyDescriptors");
|
|
@@ -18084,7 +18075,7 @@ var setFunctionLength = /* @__PURE__ */ __name(function setFunctionLength2(fn4,
|
|
|
18084
18075
|
var $apply = GetIntrinsic3("%Function.prototype.apply%");
|
|
18085
18076
|
var $call = GetIntrinsic3("%Function.prototype.call%");
|
|
18086
18077
|
var $reflectApply = GetIntrinsic3("%Reflect.apply%", true) || bind3.call($call, $apply);
|
|
18087
|
-
var $defineProperty2 =
|
|
18078
|
+
var $defineProperty2 = esDefineProperty;
|
|
18088
18079
|
var $max = GetIntrinsic3("%Math.max%");
|
|
18089
18080
|
module2.exports = /* @__PURE__ */ __name(function callBind2(originalFunction) {
|
|
18090
18081
|
if (typeof originalFunction !== "function") {
|
|
@@ -73504,7 +73495,7 @@ let FillWindow$1 = (_F = class extends React__default$1.Component {
|
|
|
73504
73495
|
this.props.children && isFunction$7(this.props.children) ? this.props.children(windowDimensions) : this.props.children
|
|
73505
73496
|
);
|
|
73506
73497
|
if (asPortal)
|
|
73507
|
-
return
|
|
73498
|
+
return createPortal$1(inner2, window.document.body);
|
|
73508
73499
|
return inner2;
|
|
73509
73500
|
}
|
|
73510
73501
|
}, __name(_F, "FillWindow"), _F);
|
|
@@ -116418,6 +116409,684 @@ const ConnectedDroppable = connect(
|
|
|
116418
116409
|
)(Droppable$1);
|
|
116419
116410
|
ConnectedDroppable.defaultProps = defaultProps;
|
|
116420
116411
|
var ConnectedDroppable$1 = ConnectedDroppable;
|
|
116412
|
+
var clipboard = { exports: {} };
|
|
116413
|
+
/*!
|
|
116414
|
+
* clipboard.js v2.0.11
|
|
116415
|
+
* https://clipboardjs.com/
|
|
116416
|
+
*
|
|
116417
|
+
* Licensed MIT © Zeno Rocha
|
|
116418
|
+
*/
|
|
116419
|
+
(function(module2, exports2) {
|
|
116420
|
+
(/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root2, factory) {
|
|
116421
|
+
module2.exports = factory();
|
|
116422
|
+
}, "webpackUniversalModuleDefinition"))(commonjsGlobal, function() {
|
|
116423
|
+
return (
|
|
116424
|
+
/******/
|
|
116425
|
+
function() {
|
|
116426
|
+
var __webpack_modules__ = {
|
|
116427
|
+
/***/
|
|
116428
|
+
686: (
|
|
116429
|
+
/***/
|
|
116430
|
+
function(__unused_webpack_module, __webpack_exports__, __webpack_require__2) {
|
|
116431
|
+
__webpack_require__2.d(__webpack_exports__, {
|
|
116432
|
+
"default": function() {
|
|
116433
|
+
return (
|
|
116434
|
+
/* binding */
|
|
116435
|
+
clipboard2
|
|
116436
|
+
);
|
|
116437
|
+
}
|
|
116438
|
+
});
|
|
116439
|
+
var tiny_emitter = __webpack_require__2(279);
|
|
116440
|
+
var tiny_emitter_default = /* @__PURE__ */ __webpack_require__2.n(tiny_emitter);
|
|
116441
|
+
var listen = __webpack_require__2(370);
|
|
116442
|
+
var listen_default = /* @__PURE__ */ __webpack_require__2.n(listen);
|
|
116443
|
+
var src_select = __webpack_require__2(817);
|
|
116444
|
+
var select_default = /* @__PURE__ */ __webpack_require__2.n(src_select);
|
|
116445
|
+
function command(type2) {
|
|
116446
|
+
try {
|
|
116447
|
+
return document.execCommand(type2);
|
|
116448
|
+
} catch (err2) {
|
|
116449
|
+
return false;
|
|
116450
|
+
}
|
|
116451
|
+
}
|
|
116452
|
+
__name(command, "command");
|
|
116453
|
+
var ClipboardActionCut = /* @__PURE__ */ __name(function ClipboardActionCut2(target) {
|
|
116454
|
+
var selectedText = select_default()(target);
|
|
116455
|
+
command("cut");
|
|
116456
|
+
return selectedText;
|
|
116457
|
+
}, "ClipboardActionCut");
|
|
116458
|
+
var actions_cut = ClipboardActionCut;
|
|
116459
|
+
function createFakeElement(value) {
|
|
116460
|
+
var isRTL = document.documentElement.getAttribute("dir") === "rtl";
|
|
116461
|
+
var fakeElement = document.createElement("textarea");
|
|
116462
|
+
fakeElement.style.fontSize = "12pt";
|
|
116463
|
+
fakeElement.style.border = "0";
|
|
116464
|
+
fakeElement.style.padding = "0";
|
|
116465
|
+
fakeElement.style.margin = "0";
|
|
116466
|
+
fakeElement.style.position = "absolute";
|
|
116467
|
+
fakeElement.style[isRTL ? "right" : "left"] = "-9999px";
|
|
116468
|
+
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
|
116469
|
+
fakeElement.style.top = "".concat(yPosition, "px");
|
|
116470
|
+
fakeElement.setAttribute("readonly", "");
|
|
116471
|
+
fakeElement.value = value;
|
|
116472
|
+
return fakeElement;
|
|
116473
|
+
}
|
|
116474
|
+
__name(createFakeElement, "createFakeElement");
|
|
116475
|
+
var fakeCopyAction = /* @__PURE__ */ __name(function fakeCopyAction2(value, options) {
|
|
116476
|
+
var fakeElement = createFakeElement(value);
|
|
116477
|
+
options.container.appendChild(fakeElement);
|
|
116478
|
+
var selectedText = select_default()(fakeElement);
|
|
116479
|
+
command("copy");
|
|
116480
|
+
fakeElement.remove();
|
|
116481
|
+
return selectedText;
|
|
116482
|
+
}, "fakeCopyAction");
|
|
116483
|
+
var ClipboardActionCopy = /* @__PURE__ */ __name(function ClipboardActionCopy2(target) {
|
|
116484
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
116485
|
+
container: document.body
|
|
116486
|
+
};
|
|
116487
|
+
var selectedText = "";
|
|
116488
|
+
if (typeof target === "string") {
|
|
116489
|
+
selectedText = fakeCopyAction(target, options);
|
|
116490
|
+
} else if (target instanceof HTMLInputElement && !["text", "search", "url", "tel", "password"].includes(target === null || target === void 0 ? void 0 : target.type)) {
|
|
116491
|
+
selectedText = fakeCopyAction(target.value, options);
|
|
116492
|
+
} else {
|
|
116493
|
+
selectedText = select_default()(target);
|
|
116494
|
+
command("copy");
|
|
116495
|
+
}
|
|
116496
|
+
return selectedText;
|
|
116497
|
+
}, "ClipboardActionCopy");
|
|
116498
|
+
var actions_copy = ClipboardActionCopy;
|
|
116499
|
+
function _typeof2(obj) {
|
|
116500
|
+
"@babel/helpers - typeof";
|
|
116501
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
116502
|
+
_typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116503
|
+
return typeof obj2;
|
|
116504
|
+
}, "_typeof");
|
|
116505
|
+
} else {
|
|
116506
|
+
_typeof2 = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116507
|
+
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
116508
|
+
}, "_typeof");
|
|
116509
|
+
}
|
|
116510
|
+
return _typeof2(obj);
|
|
116511
|
+
}
|
|
116512
|
+
__name(_typeof2, "_typeof");
|
|
116513
|
+
var ClipboardActionDefault = /* @__PURE__ */ __name(function ClipboardActionDefault2() {
|
|
116514
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
116515
|
+
var _options$action = options.action, action2 = _options$action === void 0 ? "copy" : _options$action, container = options.container, target = options.target, text2 = options.text;
|
|
116516
|
+
if (action2 !== "copy" && action2 !== "cut") {
|
|
116517
|
+
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
|
116518
|
+
}
|
|
116519
|
+
if (target !== void 0) {
|
|
116520
|
+
if (target && _typeof2(target) === "object" && target.nodeType === 1) {
|
|
116521
|
+
if (action2 === "copy" && target.hasAttribute("disabled")) {
|
|
116522
|
+
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
|
116523
|
+
}
|
|
116524
|
+
if (action2 === "cut" && (target.hasAttribute("readonly") || target.hasAttribute("disabled"))) {
|
|
116525
|
+
throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
|
|
116526
|
+
}
|
|
116527
|
+
} else {
|
|
116528
|
+
throw new Error('Invalid "target" value, use a valid Element');
|
|
116529
|
+
}
|
|
116530
|
+
}
|
|
116531
|
+
if (text2) {
|
|
116532
|
+
return actions_copy(text2, {
|
|
116533
|
+
container
|
|
116534
|
+
});
|
|
116535
|
+
}
|
|
116536
|
+
if (target) {
|
|
116537
|
+
return action2 === "cut" ? actions_cut(target) : actions_copy(target, {
|
|
116538
|
+
container
|
|
116539
|
+
});
|
|
116540
|
+
}
|
|
116541
|
+
}, "ClipboardActionDefault");
|
|
116542
|
+
var actions_default = ClipboardActionDefault;
|
|
116543
|
+
function clipboard_typeof(obj) {
|
|
116544
|
+
"@babel/helpers - typeof";
|
|
116545
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
116546
|
+
clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116547
|
+
return typeof obj2;
|
|
116548
|
+
}, "_typeof");
|
|
116549
|
+
} else {
|
|
116550
|
+
clipboard_typeof = /* @__PURE__ */ __name(function _typeof3(obj2) {
|
|
116551
|
+
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
116552
|
+
}, "_typeof");
|
|
116553
|
+
}
|
|
116554
|
+
return clipboard_typeof(obj);
|
|
116555
|
+
}
|
|
116556
|
+
__name(clipboard_typeof, "clipboard_typeof");
|
|
116557
|
+
function _classCallCheck2(instance, Constructor) {
|
|
116558
|
+
if (!(instance instanceof Constructor)) {
|
|
116559
|
+
throw new TypeError("Cannot call a class as a function");
|
|
116560
|
+
}
|
|
116561
|
+
}
|
|
116562
|
+
__name(_classCallCheck2, "_classCallCheck");
|
|
116563
|
+
function _defineProperties2(target, props) {
|
|
116564
|
+
for (var i = 0; i < props.length; i++) {
|
|
116565
|
+
var descriptor = props[i];
|
|
116566
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
116567
|
+
descriptor.configurable = true;
|
|
116568
|
+
if ("value" in descriptor)
|
|
116569
|
+
descriptor.writable = true;
|
|
116570
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
116571
|
+
}
|
|
116572
|
+
}
|
|
116573
|
+
__name(_defineProperties2, "_defineProperties");
|
|
116574
|
+
function _createClass2(Constructor, protoProps, staticProps) {
|
|
116575
|
+
if (protoProps)
|
|
116576
|
+
_defineProperties2(Constructor.prototype, protoProps);
|
|
116577
|
+
if (staticProps)
|
|
116578
|
+
_defineProperties2(Constructor, staticProps);
|
|
116579
|
+
return Constructor;
|
|
116580
|
+
}
|
|
116581
|
+
__name(_createClass2, "_createClass");
|
|
116582
|
+
function _inherits2(subClass, superClass) {
|
|
116583
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
116584
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
116585
|
+
}
|
|
116586
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
116587
|
+
if (superClass)
|
|
116588
|
+
_setPrototypeOf2(subClass, superClass);
|
|
116589
|
+
}
|
|
116590
|
+
__name(_inherits2, "_inherits");
|
|
116591
|
+
function _setPrototypeOf2(o2, p2) {
|
|
116592
|
+
_setPrototypeOf2 = Object.setPrototypeOf || /* @__PURE__ */ __name(function _setPrototypeOf3(o3, p3) {
|
|
116593
|
+
o3.__proto__ = p3;
|
|
116594
|
+
return o3;
|
|
116595
|
+
}, "_setPrototypeOf");
|
|
116596
|
+
return _setPrototypeOf2(o2, p2);
|
|
116597
|
+
}
|
|
116598
|
+
__name(_setPrototypeOf2, "_setPrototypeOf");
|
|
116599
|
+
function _createSuper2(Derived) {
|
|
116600
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
|
|
116601
|
+
return /* @__PURE__ */ __name(function _createSuperInternal() {
|
|
116602
|
+
var Super = _getPrototypeOf2(Derived), result;
|
|
116603
|
+
if (hasNativeReflectConstruct) {
|
|
116604
|
+
var NewTarget = _getPrototypeOf2(this).constructor;
|
|
116605
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
116606
|
+
} else {
|
|
116607
|
+
result = Super.apply(this, arguments);
|
|
116608
|
+
}
|
|
116609
|
+
return _possibleConstructorReturn2(this, result);
|
|
116610
|
+
}, "_createSuperInternal");
|
|
116611
|
+
}
|
|
116612
|
+
__name(_createSuper2, "_createSuper");
|
|
116613
|
+
function _possibleConstructorReturn2(self2, call2) {
|
|
116614
|
+
if (call2 && (clipboard_typeof(call2) === "object" || typeof call2 === "function")) {
|
|
116615
|
+
return call2;
|
|
116616
|
+
}
|
|
116617
|
+
return _assertThisInitialized2(self2);
|
|
116618
|
+
}
|
|
116619
|
+
__name(_possibleConstructorReturn2, "_possibleConstructorReturn");
|
|
116620
|
+
function _assertThisInitialized2(self2) {
|
|
116621
|
+
if (self2 === void 0) {
|
|
116622
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
116623
|
+
}
|
|
116624
|
+
return self2;
|
|
116625
|
+
}
|
|
116626
|
+
__name(_assertThisInitialized2, "_assertThisInitialized");
|
|
116627
|
+
function _isNativeReflectConstruct2() {
|
|
116628
|
+
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
116629
|
+
return false;
|
|
116630
|
+
if (Reflect.construct.sham)
|
|
116631
|
+
return false;
|
|
116632
|
+
if (typeof Proxy === "function")
|
|
116633
|
+
return true;
|
|
116634
|
+
try {
|
|
116635
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], function() {
|
|
116636
|
+
}));
|
|
116637
|
+
return true;
|
|
116638
|
+
} catch (e) {
|
|
116639
|
+
return false;
|
|
116640
|
+
}
|
|
116641
|
+
}
|
|
116642
|
+
__name(_isNativeReflectConstruct2, "_isNativeReflectConstruct");
|
|
116643
|
+
function _getPrototypeOf2(o2) {
|
|
116644
|
+
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : /* @__PURE__ */ __name(function _getPrototypeOf3(o3) {
|
|
116645
|
+
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
116646
|
+
}, "_getPrototypeOf");
|
|
116647
|
+
return _getPrototypeOf2(o2);
|
|
116648
|
+
}
|
|
116649
|
+
__name(_getPrototypeOf2, "_getPrototypeOf");
|
|
116650
|
+
function getAttributeValue(suffix, element2) {
|
|
116651
|
+
var attribute = "data-clipboard-".concat(suffix);
|
|
116652
|
+
if (!element2.hasAttribute(attribute)) {
|
|
116653
|
+
return;
|
|
116654
|
+
}
|
|
116655
|
+
return element2.getAttribute(attribute);
|
|
116656
|
+
}
|
|
116657
|
+
__name(getAttributeValue, "getAttributeValue");
|
|
116658
|
+
var Clipboard2 = /* @__PURE__ */ function(_Emitter) {
|
|
116659
|
+
_inherits2(Clipboard3, _Emitter);
|
|
116660
|
+
var _super = _createSuper2(Clipboard3);
|
|
116661
|
+
function Clipboard3(trigger2, options) {
|
|
116662
|
+
var _this;
|
|
116663
|
+
_classCallCheck2(this, Clipboard3);
|
|
116664
|
+
_this = _super.call(this);
|
|
116665
|
+
_this.resolveOptions(options);
|
|
116666
|
+
_this.listenClick(trigger2);
|
|
116667
|
+
return _this;
|
|
116668
|
+
}
|
|
116669
|
+
__name(Clipboard3, "Clipboard");
|
|
116670
|
+
_createClass2(Clipboard3, [{
|
|
116671
|
+
key: "resolveOptions",
|
|
116672
|
+
value: /* @__PURE__ */ __name(function resolveOptions() {
|
|
116673
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
116674
|
+
this.action = typeof options.action === "function" ? options.action : this.defaultAction;
|
|
116675
|
+
this.target = typeof options.target === "function" ? options.target : this.defaultTarget;
|
|
116676
|
+
this.text = typeof options.text === "function" ? options.text : this.defaultText;
|
|
116677
|
+
this.container = clipboard_typeof(options.container) === "object" ? options.container : document.body;
|
|
116678
|
+
}, "resolveOptions")
|
|
116679
|
+
/**
|
|
116680
|
+
* Adds a click event listener to the passed trigger.
|
|
116681
|
+
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
|
|
116682
|
+
*/
|
|
116683
|
+
}, {
|
|
116684
|
+
key: "listenClick",
|
|
116685
|
+
value: /* @__PURE__ */ __name(function listenClick(trigger2) {
|
|
116686
|
+
var _this2 = this;
|
|
116687
|
+
this.listener = listen_default()(trigger2, "click", function(e) {
|
|
116688
|
+
return _this2.onClick(e);
|
|
116689
|
+
});
|
|
116690
|
+
}, "listenClick")
|
|
116691
|
+
/**
|
|
116692
|
+
* Defines a new `ClipboardAction` on each click event.
|
|
116693
|
+
* @param {Event} e
|
|
116694
|
+
*/
|
|
116695
|
+
}, {
|
|
116696
|
+
key: "onClick",
|
|
116697
|
+
value: /* @__PURE__ */ __name(function onClick(e) {
|
|
116698
|
+
var trigger2 = e.delegateTarget || e.currentTarget;
|
|
116699
|
+
var action2 = this.action(trigger2) || "copy";
|
|
116700
|
+
var text2 = actions_default({
|
|
116701
|
+
action: action2,
|
|
116702
|
+
container: this.container,
|
|
116703
|
+
target: this.target(trigger2),
|
|
116704
|
+
text: this.text(trigger2)
|
|
116705
|
+
});
|
|
116706
|
+
this.emit(text2 ? "success" : "error", {
|
|
116707
|
+
action: action2,
|
|
116708
|
+
text: text2,
|
|
116709
|
+
trigger: trigger2,
|
|
116710
|
+
clearSelection: /* @__PURE__ */ __name(function clearSelection() {
|
|
116711
|
+
if (trigger2) {
|
|
116712
|
+
trigger2.focus();
|
|
116713
|
+
}
|
|
116714
|
+
window.getSelection().removeAllRanges();
|
|
116715
|
+
}, "clearSelection")
|
|
116716
|
+
});
|
|
116717
|
+
}, "onClick")
|
|
116718
|
+
/**
|
|
116719
|
+
* Default `action` lookup function.
|
|
116720
|
+
* @param {Element} trigger
|
|
116721
|
+
*/
|
|
116722
|
+
}, {
|
|
116723
|
+
key: "defaultAction",
|
|
116724
|
+
value: /* @__PURE__ */ __name(function defaultAction(trigger2) {
|
|
116725
|
+
return getAttributeValue("action", trigger2);
|
|
116726
|
+
}, "defaultAction")
|
|
116727
|
+
/**
|
|
116728
|
+
* Default `target` lookup function.
|
|
116729
|
+
* @param {Element} trigger
|
|
116730
|
+
*/
|
|
116731
|
+
}, {
|
|
116732
|
+
key: "defaultTarget",
|
|
116733
|
+
value: /* @__PURE__ */ __name(function defaultTarget(trigger2) {
|
|
116734
|
+
var selector = getAttributeValue("target", trigger2);
|
|
116735
|
+
if (selector) {
|
|
116736
|
+
return document.querySelector(selector);
|
|
116737
|
+
}
|
|
116738
|
+
}, "defaultTarget")
|
|
116739
|
+
/**
|
|
116740
|
+
* Allow fire programmatically a copy action
|
|
116741
|
+
* @param {String|HTMLElement} target
|
|
116742
|
+
* @param {Object} options
|
|
116743
|
+
* @returns Text copied.
|
|
116744
|
+
*/
|
|
116745
|
+
}, {
|
|
116746
|
+
key: "defaultText",
|
|
116747
|
+
/**
|
|
116748
|
+
* Default `text` lookup function.
|
|
116749
|
+
* @param {Element} trigger
|
|
116750
|
+
*/
|
|
116751
|
+
value: /* @__PURE__ */ __name(function defaultText(trigger2) {
|
|
116752
|
+
return getAttributeValue("text", trigger2);
|
|
116753
|
+
}, "defaultText")
|
|
116754
|
+
/**
|
|
116755
|
+
* Destroy lifecycle.
|
|
116756
|
+
*/
|
|
116757
|
+
}, {
|
|
116758
|
+
key: "destroy",
|
|
116759
|
+
value: /* @__PURE__ */ __name(function destroy2() {
|
|
116760
|
+
this.listener.destroy();
|
|
116761
|
+
}, "destroy")
|
|
116762
|
+
}], [{
|
|
116763
|
+
key: "copy",
|
|
116764
|
+
value: /* @__PURE__ */ __name(function copy2(target) {
|
|
116765
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
116766
|
+
container: document.body
|
|
116767
|
+
};
|
|
116768
|
+
return actions_copy(target, options);
|
|
116769
|
+
}, "copy")
|
|
116770
|
+
/**
|
|
116771
|
+
* Allow fire programmatically a cut action
|
|
116772
|
+
* @param {String|HTMLElement} target
|
|
116773
|
+
* @returns Text cutted.
|
|
116774
|
+
*/
|
|
116775
|
+
}, {
|
|
116776
|
+
key: "cut",
|
|
116777
|
+
value: /* @__PURE__ */ __name(function cut(target) {
|
|
116778
|
+
return actions_cut(target);
|
|
116779
|
+
}, "cut")
|
|
116780
|
+
/**
|
|
116781
|
+
* Returns the support of the given action, or all actions if no action is
|
|
116782
|
+
* given.
|
|
116783
|
+
* @param {String} [action]
|
|
116784
|
+
*/
|
|
116785
|
+
}, {
|
|
116786
|
+
key: "isSupported",
|
|
116787
|
+
value: /* @__PURE__ */ __name(function isSupported() {
|
|
116788
|
+
var action2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"];
|
|
116789
|
+
var actions2 = typeof action2 === "string" ? [action2] : action2;
|
|
116790
|
+
var support = !!document.queryCommandSupported;
|
|
116791
|
+
actions2.forEach(function(action3) {
|
|
116792
|
+
support = support && !!document.queryCommandSupported(action3);
|
|
116793
|
+
});
|
|
116794
|
+
return support;
|
|
116795
|
+
}, "isSupported")
|
|
116796
|
+
}]);
|
|
116797
|
+
return Clipboard3;
|
|
116798
|
+
}(tiny_emitter_default());
|
|
116799
|
+
var clipboard2 = Clipboard2;
|
|
116800
|
+
}
|
|
116801
|
+
),
|
|
116802
|
+
/***/
|
|
116803
|
+
828: (
|
|
116804
|
+
/***/
|
|
116805
|
+
function(module3) {
|
|
116806
|
+
var DOCUMENT_NODE_TYPE = 9;
|
|
116807
|
+
if (typeof Element !== "undefined" && !Element.prototype.matches) {
|
|
116808
|
+
var proto = Element.prototype;
|
|
116809
|
+
proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
|
|
116810
|
+
}
|
|
116811
|
+
function closest2(element2, selector) {
|
|
116812
|
+
while (element2 && element2.nodeType !== DOCUMENT_NODE_TYPE) {
|
|
116813
|
+
if (typeof element2.matches === "function" && element2.matches(selector)) {
|
|
116814
|
+
return element2;
|
|
116815
|
+
}
|
|
116816
|
+
element2 = element2.parentNode;
|
|
116817
|
+
}
|
|
116818
|
+
}
|
|
116819
|
+
__name(closest2, "closest");
|
|
116820
|
+
module3.exports = closest2;
|
|
116821
|
+
}
|
|
116822
|
+
),
|
|
116823
|
+
/***/
|
|
116824
|
+
438: (
|
|
116825
|
+
/***/
|
|
116826
|
+
function(module3, __unused_webpack_exports, __webpack_require__2) {
|
|
116827
|
+
var closest2 = __webpack_require__2(828);
|
|
116828
|
+
function _delegate(element2, selector, type2, callback2, useCapture) {
|
|
116829
|
+
var listenerFn = listener.apply(this, arguments);
|
|
116830
|
+
element2.addEventListener(type2, listenerFn, useCapture);
|
|
116831
|
+
return {
|
|
116832
|
+
destroy: function() {
|
|
116833
|
+
element2.removeEventListener(type2, listenerFn, useCapture);
|
|
116834
|
+
}
|
|
116835
|
+
};
|
|
116836
|
+
}
|
|
116837
|
+
__name(_delegate, "_delegate");
|
|
116838
|
+
function delegate(elements, selector, type2, callback2, useCapture) {
|
|
116839
|
+
if (typeof elements.addEventListener === "function") {
|
|
116840
|
+
return _delegate.apply(null, arguments);
|
|
116841
|
+
}
|
|
116842
|
+
if (typeof type2 === "function") {
|
|
116843
|
+
return _delegate.bind(null, document).apply(null, arguments);
|
|
116844
|
+
}
|
|
116845
|
+
if (typeof elements === "string") {
|
|
116846
|
+
elements = document.querySelectorAll(elements);
|
|
116847
|
+
}
|
|
116848
|
+
return Array.prototype.map.call(elements, function(element2) {
|
|
116849
|
+
return _delegate(element2, selector, type2, callback2, useCapture);
|
|
116850
|
+
});
|
|
116851
|
+
}
|
|
116852
|
+
__name(delegate, "delegate");
|
|
116853
|
+
function listener(element2, selector, type2, callback2) {
|
|
116854
|
+
return function(e) {
|
|
116855
|
+
e.delegateTarget = closest2(e.target, selector);
|
|
116856
|
+
if (e.delegateTarget) {
|
|
116857
|
+
callback2.call(element2, e);
|
|
116858
|
+
}
|
|
116859
|
+
};
|
|
116860
|
+
}
|
|
116861
|
+
__name(listener, "listener");
|
|
116862
|
+
module3.exports = delegate;
|
|
116863
|
+
}
|
|
116864
|
+
),
|
|
116865
|
+
/***/
|
|
116866
|
+
879: (
|
|
116867
|
+
/***/
|
|
116868
|
+
function(__unused_webpack_module, exports3) {
|
|
116869
|
+
exports3.node = function(value) {
|
|
116870
|
+
return value !== void 0 && value instanceof HTMLElement && value.nodeType === 1;
|
|
116871
|
+
};
|
|
116872
|
+
exports3.nodeList = function(value) {
|
|
116873
|
+
var type2 = Object.prototype.toString.call(value);
|
|
116874
|
+
return value !== void 0 && (type2 === "[object NodeList]" || type2 === "[object HTMLCollection]") && "length" in value && (value.length === 0 || exports3.node(value[0]));
|
|
116875
|
+
};
|
|
116876
|
+
exports3.string = function(value) {
|
|
116877
|
+
return typeof value === "string" || value instanceof String;
|
|
116878
|
+
};
|
|
116879
|
+
exports3.fn = function(value) {
|
|
116880
|
+
var type2 = Object.prototype.toString.call(value);
|
|
116881
|
+
return type2 === "[object Function]";
|
|
116882
|
+
};
|
|
116883
|
+
}
|
|
116884
|
+
),
|
|
116885
|
+
/***/
|
|
116886
|
+
370: (
|
|
116887
|
+
/***/
|
|
116888
|
+
function(module3, __unused_webpack_exports, __webpack_require__2) {
|
|
116889
|
+
var is3 = __webpack_require__2(879);
|
|
116890
|
+
var delegate = __webpack_require__2(438);
|
|
116891
|
+
function listen(target, type2, callback2) {
|
|
116892
|
+
if (!target && !type2 && !callback2) {
|
|
116893
|
+
throw new Error("Missing required arguments");
|
|
116894
|
+
}
|
|
116895
|
+
if (!is3.string(type2)) {
|
|
116896
|
+
throw new TypeError("Second argument must be a String");
|
|
116897
|
+
}
|
|
116898
|
+
if (!is3.fn(callback2)) {
|
|
116899
|
+
throw new TypeError("Third argument must be a Function");
|
|
116900
|
+
}
|
|
116901
|
+
if (is3.node(target)) {
|
|
116902
|
+
return listenNode(target, type2, callback2);
|
|
116903
|
+
} else if (is3.nodeList(target)) {
|
|
116904
|
+
return listenNodeList(target, type2, callback2);
|
|
116905
|
+
} else if (is3.string(target)) {
|
|
116906
|
+
return listenSelector(target, type2, callback2);
|
|
116907
|
+
} else {
|
|
116908
|
+
throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
|
|
116909
|
+
}
|
|
116910
|
+
}
|
|
116911
|
+
__name(listen, "listen");
|
|
116912
|
+
function listenNode(node2, type2, callback2) {
|
|
116913
|
+
node2.addEventListener(type2, callback2);
|
|
116914
|
+
return {
|
|
116915
|
+
destroy: function() {
|
|
116916
|
+
node2.removeEventListener(type2, callback2);
|
|
116917
|
+
}
|
|
116918
|
+
};
|
|
116919
|
+
}
|
|
116920
|
+
__name(listenNode, "listenNode");
|
|
116921
|
+
function listenNodeList(nodeList, type2, callback2) {
|
|
116922
|
+
Array.prototype.forEach.call(nodeList, function(node2) {
|
|
116923
|
+
node2.addEventListener(type2, callback2);
|
|
116924
|
+
});
|
|
116925
|
+
return {
|
|
116926
|
+
destroy: function() {
|
|
116927
|
+
Array.prototype.forEach.call(nodeList, function(node2) {
|
|
116928
|
+
node2.removeEventListener(type2, callback2);
|
|
116929
|
+
});
|
|
116930
|
+
}
|
|
116931
|
+
};
|
|
116932
|
+
}
|
|
116933
|
+
__name(listenNodeList, "listenNodeList");
|
|
116934
|
+
function listenSelector(selector, type2, callback2) {
|
|
116935
|
+
return delegate(document.body, selector, type2, callback2);
|
|
116936
|
+
}
|
|
116937
|
+
__name(listenSelector, "listenSelector");
|
|
116938
|
+
module3.exports = listen;
|
|
116939
|
+
}
|
|
116940
|
+
),
|
|
116941
|
+
/***/
|
|
116942
|
+
817: (
|
|
116943
|
+
/***/
|
|
116944
|
+
function(module3) {
|
|
116945
|
+
function select(element2) {
|
|
116946
|
+
var selectedText;
|
|
116947
|
+
if (element2.nodeName === "SELECT") {
|
|
116948
|
+
element2.focus();
|
|
116949
|
+
selectedText = element2.value;
|
|
116950
|
+
} else if (element2.nodeName === "INPUT" || element2.nodeName === "TEXTAREA") {
|
|
116951
|
+
var isReadOnly = element2.hasAttribute("readonly");
|
|
116952
|
+
if (!isReadOnly) {
|
|
116953
|
+
element2.setAttribute("readonly", "");
|
|
116954
|
+
}
|
|
116955
|
+
element2.select();
|
|
116956
|
+
element2.setSelectionRange(0, element2.value.length);
|
|
116957
|
+
if (!isReadOnly) {
|
|
116958
|
+
element2.removeAttribute("readonly");
|
|
116959
|
+
}
|
|
116960
|
+
selectedText = element2.value;
|
|
116961
|
+
} else {
|
|
116962
|
+
if (element2.hasAttribute("contenteditable")) {
|
|
116963
|
+
element2.focus();
|
|
116964
|
+
}
|
|
116965
|
+
var selection = window.getSelection();
|
|
116966
|
+
var range2 = document.createRange();
|
|
116967
|
+
range2.selectNodeContents(element2);
|
|
116968
|
+
selection.removeAllRanges();
|
|
116969
|
+
selection.addRange(range2);
|
|
116970
|
+
selectedText = selection.toString();
|
|
116971
|
+
}
|
|
116972
|
+
return selectedText;
|
|
116973
|
+
}
|
|
116974
|
+
__name(select, "select");
|
|
116975
|
+
module3.exports = select;
|
|
116976
|
+
}
|
|
116977
|
+
),
|
|
116978
|
+
/***/
|
|
116979
|
+
279: (
|
|
116980
|
+
/***/
|
|
116981
|
+
function(module3) {
|
|
116982
|
+
function E2() {
|
|
116983
|
+
}
|
|
116984
|
+
__name(E2, "E");
|
|
116985
|
+
E2.prototype = {
|
|
116986
|
+
on: function(name2, callback2, ctx) {
|
|
116987
|
+
var e = this.e || (this.e = {});
|
|
116988
|
+
(e[name2] || (e[name2] = [])).push({
|
|
116989
|
+
fn: callback2,
|
|
116990
|
+
ctx
|
|
116991
|
+
});
|
|
116992
|
+
return this;
|
|
116993
|
+
},
|
|
116994
|
+
once: function(name2, callback2, ctx) {
|
|
116995
|
+
var self2 = this;
|
|
116996
|
+
function listener() {
|
|
116997
|
+
self2.off(name2, listener);
|
|
116998
|
+
callback2.apply(ctx, arguments);
|
|
116999
|
+
}
|
|
117000
|
+
__name(listener, "listener");
|
|
117001
|
+
listener._ = callback2;
|
|
117002
|
+
return this.on(name2, listener, ctx);
|
|
117003
|
+
},
|
|
117004
|
+
emit: function(name2) {
|
|
117005
|
+
var data = [].slice.call(arguments, 1);
|
|
117006
|
+
var evtArr = ((this.e || (this.e = {}))[name2] || []).slice();
|
|
117007
|
+
var i = 0;
|
|
117008
|
+
var len = evtArr.length;
|
|
117009
|
+
for (i; i < len; i++) {
|
|
117010
|
+
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
|
117011
|
+
}
|
|
117012
|
+
return this;
|
|
117013
|
+
},
|
|
117014
|
+
off: function(name2, callback2) {
|
|
117015
|
+
var e = this.e || (this.e = {});
|
|
117016
|
+
var evts = e[name2];
|
|
117017
|
+
var liveEvents = [];
|
|
117018
|
+
if (evts && callback2) {
|
|
117019
|
+
for (var i = 0, len = evts.length; i < len; i++) {
|
|
117020
|
+
if (evts[i].fn !== callback2 && evts[i].fn._ !== callback2)
|
|
117021
|
+
liveEvents.push(evts[i]);
|
|
117022
|
+
}
|
|
117023
|
+
}
|
|
117024
|
+
liveEvents.length ? e[name2] = liveEvents : delete e[name2];
|
|
117025
|
+
return this;
|
|
117026
|
+
}
|
|
117027
|
+
};
|
|
117028
|
+
module3.exports = E2;
|
|
117029
|
+
module3.exports.TinyEmitter = E2;
|
|
117030
|
+
}
|
|
117031
|
+
)
|
|
117032
|
+
/******/
|
|
117033
|
+
};
|
|
117034
|
+
var __webpack_module_cache__ = {};
|
|
117035
|
+
function __webpack_require__(moduleId) {
|
|
117036
|
+
if (__webpack_module_cache__[moduleId]) {
|
|
117037
|
+
return __webpack_module_cache__[moduleId].exports;
|
|
117038
|
+
}
|
|
117039
|
+
var module3 = __webpack_module_cache__[moduleId] = {
|
|
117040
|
+
/******/
|
|
117041
|
+
// no module.id needed
|
|
117042
|
+
/******/
|
|
117043
|
+
// no module.loaded needed
|
|
117044
|
+
/******/
|
|
117045
|
+
exports: {}
|
|
117046
|
+
/******/
|
|
117047
|
+
};
|
|
117048
|
+
__webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
|
|
117049
|
+
return module3.exports;
|
|
117050
|
+
}
|
|
117051
|
+
__name(__webpack_require__, "__webpack_require__");
|
|
117052
|
+
!function() {
|
|
117053
|
+
__webpack_require__.n = function(module3) {
|
|
117054
|
+
var getter = module3 && module3.__esModule ? (
|
|
117055
|
+
/******/
|
|
117056
|
+
function() {
|
|
117057
|
+
return module3["default"];
|
|
117058
|
+
}
|
|
117059
|
+
) : (
|
|
117060
|
+
/******/
|
|
117061
|
+
function() {
|
|
117062
|
+
return module3;
|
|
117063
|
+
}
|
|
117064
|
+
);
|
|
117065
|
+
__webpack_require__.d(getter, { a: getter });
|
|
117066
|
+
return getter;
|
|
117067
|
+
};
|
|
117068
|
+
}();
|
|
117069
|
+
!function() {
|
|
117070
|
+
__webpack_require__.d = function(exports3, definition2) {
|
|
117071
|
+
for (var key in definition2) {
|
|
117072
|
+
if (__webpack_require__.o(definition2, key) && !__webpack_require__.o(exports3, key)) {
|
|
117073
|
+
Object.defineProperty(exports3, key, { enumerable: true, get: definition2[key] });
|
|
117074
|
+
}
|
|
117075
|
+
}
|
|
117076
|
+
};
|
|
117077
|
+
}();
|
|
117078
|
+
!function() {
|
|
117079
|
+
__webpack_require__.o = function(obj, prop2) {
|
|
117080
|
+
return Object.prototype.hasOwnProperty.call(obj, prop2);
|
|
117081
|
+
};
|
|
117082
|
+
}();
|
|
117083
|
+
return __webpack_require__(686);
|
|
117084
|
+
}().default
|
|
117085
|
+
);
|
|
117086
|
+
});
|
|
117087
|
+
})(clipboard);
|
|
117088
|
+
var clipboardExports = clipboard.exports;
|
|
117089
|
+
const Clipboard$1 = /* @__PURE__ */ getDefaultExportFromCjs(clipboardExports);
|
|
116421
117090
|
var connectionStore = /* @__PURE__ */ new WeakMap();
|
|
116422
117091
|
var ITERATION_KEY = Symbol("iteration key");
|
|
116423
117092
|
function storeObservable(obj) {
|
|
@@ -122392,7 +123061,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
122392
123061
|
}
|
|
122393
123062
|
__name(showFileDialog, "showFileDialog");
|
|
122394
123063
|
const name = "@teselagen/ove";
|
|
122395
|
-
const version = "0.7.
|
|
123064
|
+
const version = "0.7.4";
|
|
122396
123065
|
const main = "./src/index.js";
|
|
122397
123066
|
const type = "module";
|
|
122398
123067
|
const exports$1 = {
|
|
@@ -126300,7 +126969,7 @@ function isElementInViewport(el) {
|
|
|
126300
126969
|
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
126301
126970
|
}
|
|
126302
126971
|
__name(isElementInViewport, "isElementInViewport");
|
|
126303
|
-
const
|
|
126972
|
+
const _Clipboard = class _Clipboard extends React__default$1.Component {
|
|
126304
126973
|
constructor() {
|
|
126305
126974
|
super(...arguments);
|
|
126306
126975
|
__publicField(this, "handleKeyDown", /* @__PURE__ */ __name((e) => {
|
|
@@ -126369,14 +127038,14 @@ const _Keyboard = class _Keyboard extends React__default$1.Component {
|
|
|
126369
127038
|
);
|
|
126370
127039
|
}
|
|
126371
127040
|
};
|
|
126372
|
-
__name(
|
|
127041
|
+
__name(_Clipboard, "Clipboard");
|
|
126373
127042
|
// static propTypes = {
|
|
126374
127043
|
// value: PropTypes.string.isRequired
|
|
126375
127044
|
// };
|
|
126376
|
-
__publicField(
|
|
127045
|
+
__publicField(_Clipboard, "defaultProps", {
|
|
126377
127046
|
className: "clipboard"
|
|
126378
127047
|
});
|
|
126379
|
-
let
|
|
127048
|
+
let Clipboard = _Clipboard;
|
|
126380
127049
|
let dragInProgress = false;
|
|
126381
127050
|
let selectionStartOrEndGrabbed;
|
|
126382
127051
|
let caretPositionOnDragStart;
|
|
@@ -127392,8 +128061,14 @@ function VectorInteractionHOC(Component2) {
|
|
|
127392
128061
|
const { sequenceData: sequenceData2, readOnly: readOnly2, disableBpEditing, selectionLayer: selectionLayer2 } = this.props;
|
|
127393
128062
|
const { isProtein: isProtein2 } = sequenceData2;
|
|
127394
128063
|
const makeTextCopyable = /* @__PURE__ */ __name((transformFunc, className, action2 = "copy") => {
|
|
127395
|
-
|
|
127396
|
-
|
|
128064
|
+
return new Clipboard$1(`.${className}`, {
|
|
128065
|
+
action: () => action2,
|
|
128066
|
+
text: () => {
|
|
128067
|
+
if (action2 === "copy") {
|
|
128068
|
+
document.body.addEventListener("copy", this.handleCopy);
|
|
128069
|
+
} else {
|
|
128070
|
+
document.body.addEventListener("cut", this.handleCut);
|
|
128071
|
+
}
|
|
127397
128072
|
const { editorName, store: store2 } = this.props;
|
|
127398
128073
|
const { sequenceData: sequenceData22, copyOptions: copyOptions2, selectionLayer: selectionLayer22 } = store2.getState().VectorEditor[editorName];
|
|
127399
128074
|
const selectedSeqData = getSequenceDataBetweenRange(
|
|
@@ -127418,22 +128093,12 @@ function VectorInteractionHOC(Component2) {
|
|
|
127418
128093
|
sequenceData22
|
|
127419
128094
|
);
|
|
127420
128095
|
this.sequenceDataToCopy = sequenceDataToCopy;
|
|
127421
|
-
const textToCopy = sequenceDataToCopy.textToCopy || sequenceDataToCopy.sequence;
|
|
127422
|
-
try {
|
|
127423
|
-
yield navigator.clipboard.writeText(textToCopy);
|
|
127424
|
-
} catch (err2) {
|
|
127425
|
-
console.error("Failed to copy text:", err2);
|
|
127426
|
-
}
|
|
127427
|
-
if (action2 === "copy") {
|
|
127428
|
-
document.body.addEventListener("copy", this.handleCopy);
|
|
127429
|
-
} else {
|
|
127430
|
-
document.body.addEventListener("cut", this.handleCut);
|
|
127431
|
-
}
|
|
127432
128096
|
if (window.Cypress) {
|
|
127433
128097
|
window.Cypress.textToCopy = sequenceDataToCopy.textToCopy;
|
|
127434
128098
|
window.Cypress.seqDataToCopy = sequenceDataToCopy;
|
|
127435
128099
|
}
|
|
127436
|
-
|
|
128100
|
+
return sequenceDataToCopy.textToCopy || sequenceDataToCopy.sequence;
|
|
128101
|
+
}
|
|
127437
128102
|
});
|
|
127438
128103
|
}, "makeTextCopyable");
|
|
127439
128104
|
const aaCopy = {
|
|
@@ -128071,7 +128736,7 @@ function VectorInteractionHOC(Component2) {
|
|
|
128071
128736
|
},
|
|
128072
128737
|
closePanelButton,
|
|
128073
128738
|
/* @__PURE__ */ React__default$1.createElement(
|
|
128074
|
-
|
|
128739
|
+
Clipboard,
|
|
128075
128740
|
{
|
|
128076
128741
|
value: selectedBps,
|
|
128077
128742
|
onCopy: this.handleCopy,
|
|
@@ -146244,27 +146909,15 @@ ${seqDataToCopy}\r
|
|
|
146244
146909
|
this.copyAllAlignmentsFastaClipboardHelper && this.copyAllAlignmentsFastaClipboardHelper.destroy();
|
|
146245
146910
|
},
|
|
146246
146911
|
didMount: () => {
|
|
146247
|
-
|
|
146248
|
-
`.copyAllAlignmentsFastaClipboardHelper
|
|
146912
|
+
this.copyAllAlignmentsFastaClipboardHelper = new Clipboard$1(
|
|
146913
|
+
`.copyAllAlignmentsFastaClipboardHelper`,
|
|
146914
|
+
{
|
|
146915
|
+
action: "copyAllAlignmentsFasta",
|
|
146916
|
+
text: () => {
|
|
146917
|
+
return this.getAllAlignmentsFastaText();
|
|
146918
|
+
}
|
|
146919
|
+
}
|
|
146249
146920
|
);
|
|
146250
|
-
elements.forEach((element2) => {
|
|
146251
|
-
element2.addEventListener(
|
|
146252
|
-
"click",
|
|
146253
|
-
() => __async(this, null, function* () {
|
|
146254
|
-
const textToCopy = this.getAllAlignmentsFastaText();
|
|
146255
|
-
try {
|
|
146256
|
-
yield navigator.clipboard.writeText(
|
|
146257
|
-
textToCopy
|
|
146258
|
-
);
|
|
146259
|
-
} catch (err2) {
|
|
146260
|
-
console.error(
|
|
146261
|
-
"Failed to copy text:",
|
|
146262
|
-
err2
|
|
146263
|
-
);
|
|
146264
|
-
}
|
|
146265
|
-
})
|
|
146266
|
-
);
|
|
146267
|
-
});
|
|
146268
146921
|
},
|
|
146269
146922
|
onClick: () => {
|
|
146270
146923
|
window.toastr.success("Selection Copied");
|
|
@@ -146277,13 +146930,11 @@ ${seqDataToCopy}\r
|
|
|
146277
146930
|
this.copySpecificAlignmentFastaClipboardHelper && this.copySpecificAlignmentFastaClipboardHelper.destroy();
|
|
146278
146931
|
},
|
|
146279
146932
|
didMount: () => {
|
|
146280
|
-
|
|
146281
|
-
`.copySpecificAlignmentFastaClipboardHelper
|
|
146282
|
-
|
|
146283
|
-
|
|
146284
|
-
|
|
146285
|
-
"click",
|
|
146286
|
-
() => __async(this, null, function* () {
|
|
146933
|
+
this.copySpecificAlignmentFastaClipboardHelper = new Clipboard$1(
|
|
146934
|
+
`.copySpecificAlignmentFastaClipboardHelper`,
|
|
146935
|
+
{
|
|
146936
|
+
action: "copySpecificAlignmentFasta",
|
|
146937
|
+
text: () => {
|
|
146287
146938
|
const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
|
|
146288
146939
|
const seqDataToCopy = getSequenceDataBetweenRange(
|
|
146289
146940
|
alignmentData,
|
|
@@ -146292,19 +146943,10 @@ ${seqDataToCopy}\r
|
|
|
146292
146943
|
const seqDataToCopyAsFasta = `>${name2}\r
|
|
146293
146944
|
${seqDataToCopy}\r
|
|
146294
146945
|
`;
|
|
146295
|
-
|
|
146296
|
-
|
|
146297
|
-
|
|
146298
|
-
|
|
146299
|
-
} catch (err2) {
|
|
146300
|
-
console.error(
|
|
146301
|
-
"Failed to copy text:",
|
|
146302
|
-
err2
|
|
146303
|
-
);
|
|
146304
|
-
}
|
|
146305
|
-
})
|
|
146306
|
-
);
|
|
146307
|
-
});
|
|
146946
|
+
return seqDataToCopyAsFasta;
|
|
146947
|
+
}
|
|
146948
|
+
}
|
|
146949
|
+
);
|
|
146308
146950
|
},
|
|
146309
146951
|
onClick: () => {
|
|
146310
146952
|
window.toastr.success(
|
|
@@ -146319,31 +146961,20 @@ ${seqDataToCopy}\r
|
|
|
146319
146961
|
this.copySpecificAlignmentAsPlainClipboardHelper && this.copySpecificAlignmentAsPlainClipboardHelper.destroy();
|
|
146320
146962
|
},
|
|
146321
146963
|
didMount: () => {
|
|
146322
|
-
|
|
146323
|
-
`.copySpecificAlignmentAsPlainClipboardHelper
|
|
146324
|
-
|
|
146325
|
-
|
|
146326
|
-
|
|
146327
|
-
"click",
|
|
146328
|
-
() => __async(this, null, function* () {
|
|
146964
|
+
this.copySpecificAlignmentAsPlainClipboardHelper = new Clipboard$1(
|
|
146965
|
+
`.copySpecificAlignmentAsPlainClipboardHelper`,
|
|
146966
|
+
{
|
|
146967
|
+
action: "copySpecificAlignmentFasta",
|
|
146968
|
+
text: () => {
|
|
146329
146969
|
const { selectionLayer: selectionLayer2 } = this.props.store.getState().VectorEditor.__allEditorsOptions.alignments[this.props.id] || {};
|
|
146330
146970
|
const seqDataToCopy = getSequenceDataBetweenRange(
|
|
146331
146971
|
alignmentData,
|
|
146332
146972
|
selectionLayer2
|
|
146333
146973
|
).sequence;
|
|
146334
|
-
|
|
146335
|
-
|
|
146336
|
-
|
|
146337
|
-
|
|
146338
|
-
} catch (err2) {
|
|
146339
|
-
console.error(
|
|
146340
|
-
"Failed to copy text:",
|
|
146341
|
-
err2
|
|
146342
|
-
);
|
|
146343
|
-
}
|
|
146344
|
-
})
|
|
146345
|
-
);
|
|
146346
|
-
});
|
|
146974
|
+
return seqDataToCopy;
|
|
146975
|
+
}
|
|
146976
|
+
}
|
|
146977
|
+
);
|
|
146347
146978
|
},
|
|
146348
146979
|
onClick: () => {
|
|
146349
146980
|
window.toastr.success("Selection Copied");
|