@rnacanvas/copy-interface 3.0.1 → 4.0.0
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/dist/App.d.ts +6 -0
- package/dist/App.d.ts.map +1 -1
- package/dist/CutHandler.d.ts +12 -0
- package/dist/CutHandler.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/App.d.ts
CHANGED
|
@@ -17,6 +17,12 @@ export interface App {
|
|
|
17
17
|
* Not necessarily in the same order as in the drawing of the app.
|
|
18
18
|
*/
|
|
19
19
|
readonly selectedBases: Iterable<Nucleobase>;
|
|
20
|
+
/**
|
|
21
|
+
* Removes the selected elements from the drawing.
|
|
22
|
+
*
|
|
23
|
+
* (Also pushes the undo stack before doing so.)
|
|
24
|
+
*/
|
|
25
|
+
removeSelected(): void;
|
|
20
26
|
/**
|
|
21
27
|
* Returns the state of the app (in a JSON-serializable form) at the time this method is called.
|
|
22
28
|
*/
|
package/dist/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,OAAO,EAAE;QAChB;;WAEG;QACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;KACtC,CAAC;IAEF,QAAQ,CAAC,SAAS,EAAE;QAClB;;;WAGG;QACH,OAAO,IAAI,OAAO,CAAC;KACpB,CAAA;IAED;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE7C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,aAAa,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxC;AAED;;;;;;GAMG;AACH,KAAK,QAAQ,GAAG,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,OAAO,EAAE;QAChB;;WAEG;QACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;KACtC,CAAC;IAEF,QAAQ,CAAC,SAAS,EAAE;QAClB;;;WAGG;QACH,OAAO,IAAI,OAAO,CAAC;KACpB,CAAA;IAED;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE7C;;;;OAIG;IACH,cAAc,IAAI,IAAI,CAAC;IAEvB;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,aAAa,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxC;AAED;;;;;;GAMG;AACH,KAAK,QAAQ,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { App } from './App';
|
|
2
|
+
export declare class CutHandler {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(targetApp: App);
|
|
5
|
+
/**
|
|
6
|
+
* Handles the input cut event.
|
|
7
|
+
*
|
|
8
|
+
* (Or writes to the window navigator clipboard if no cut event object is provided.)
|
|
9
|
+
*/
|
|
10
|
+
handle(event?: ClipboardEvent): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=CutHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CutHandler.d.ts","sourceRoot":"","sources":["../src/CutHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,qBAAa,UAAU;;gBAKT,SAAS,EAAE,GAAG;IAM1B;;;;OAIG;IACG,MAAM,CAAC,KAAK,CAAC,EAAE,cAAc;CAoBpC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.copyInterface=t():e.copyInterface=t()}(this,()=>(()=>{"use strict";const e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{CopyHandler:()=>a});var o,r=function(e,t,o,r){if("a"===o&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?r:"a"===o?r.call(e):r?r.value:t.get(e)};class a{constructor(e){o.set(this,void 0),function(e,t,o,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?a.call(e,o):a?a.value=o:t.set(e,o)}(this,o,e,"f")}async handle(e){var t,a;let i=window.getSelection();if(i&&(i.toString()||!i.isCollapsed))return;if(r(this,o,"f").selection.isEmpty())return;null==e||e.preventDefault(),null==e||e.stopPropagation();let n=new Set(r(this,o,"f").selectedBases);if(n.size>0){let a=[...r(this,o,"f").drawing.bases].filter(e=>n.has(e)).map(e=>e.domNode.textContent).join("");e?null===(t=e.clipboardData)||void 0===t||t.setData("text/plain",a):await navigator.clipboard.writeText(a)}null===(a=null==e?void 0:e.clipboardData)||void 0===a||a.setData("application/json",JSON.stringify(r(this,o,"f").serialized()))}}return o=new WeakMap,t})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.copyInterface=t():e.copyInterface=t()}(this,()=>(()=>{"use strict";const e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{CopyHandler:()=>a,CutHandler:()=>c});var o,r=function(e,t,o,r){if("a"===o&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?r:"a"===o?r.call(e):r?r.value:t.get(e)};class a{constructor(e){o.set(this,void 0),function(e,t,o,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?a.call(e,o):a?a.value=o:t.set(e,o)}(this,o,e,"f")}async handle(e){var t,a;let i=window.getSelection();if(i&&(i.toString()||!i.isCollapsed))return;if(r(this,o,"f").selection.isEmpty())return;null==e||e.preventDefault(),null==e||e.stopPropagation();let n=new Set(r(this,o,"f").selectedBases);if(n.size>0){let a=[...r(this,o,"f").drawing.bases].filter(e=>n.has(e)).map(e=>e.domNode.textContent).join("");e?null===(t=e.clipboardData)||void 0===t||t.setData("text/plain",a):await navigator.clipboard.writeText(a)}null===(a=null==e?void 0:e.clipboardData)||void 0===a||a.setData("application/json",JSON.stringify(r(this,o,"f").serialized()))}}o=new WeakMap;var i,n,s=function(e,t,o,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,o):a?a.value=o:t.set(e,o),o},l=function(e,t,o,r){if("a"===o&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?r:"a"===o?r.call(e):r?r.value:t.get(e)};class c{constructor(e){i.set(this,void 0),n.set(this,void 0),s(this,i,e,"f"),s(this,n,new a(e),"f")}async handle(e){let t=window.getSelection();(!t||!t.toString()&&t.isCollapsed)&&(l(this,i,"f").selection.isEmpty()||(await l(this,n,"f").handle(e),l(this,i,"f").removeSelected()))}}return i=new WeakMap,n=new WeakMap,t})());
|