@rnacanvas/copy-interface 2.0.0 → 3.0.1
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 +24 -0
- package/dist/App.d.ts.map +1 -1
- package/dist/CopyHandler.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/App.d.ts
CHANGED
|
@@ -6,9 +6,33 @@ export interface App {
|
|
|
6
6
|
*/
|
|
7
7
|
readonly bases: Iterable<Nucleobase>;
|
|
8
8
|
};
|
|
9
|
+
readonly selection: {
|
|
10
|
+
/**
|
|
11
|
+
* Returns `true` if nothing is currently selected within the drawing of the app
|
|
12
|
+
* and `false` otherwise.
|
|
13
|
+
*/
|
|
14
|
+
isEmpty(): boolean;
|
|
15
|
+
};
|
|
9
16
|
/**
|
|
10
17
|
* Not necessarily in the same order as in the drawing of the app.
|
|
11
18
|
*/
|
|
12
19
|
readonly selectedBases: Iterable<Nucleobase>;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the state of the app (in a JSON-serializable form) at the time this method is called.
|
|
22
|
+
*/
|
|
23
|
+
serialized(): AppState;
|
|
24
|
+
/**
|
|
25
|
+
* Restores the app to the previous state.
|
|
26
|
+
*/
|
|
27
|
+
restore(previousState: AppState): void;
|
|
13
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* A JSON-serializable non-null object that stores the state of the app
|
|
31
|
+
* (including things such as the state of the drawing and which elements are currently selected).
|
|
32
|
+
*
|
|
33
|
+
* Can be included in a saved drawing file, for instance,
|
|
34
|
+
* or the undo stack of the app.
|
|
35
|
+
*/
|
|
36
|
+
type AppState = {};
|
|
37
|
+
export {};
|
|
14
38
|
//# sourceMappingURL=App.d.ts.map
|
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;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,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;;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyHandler.d.ts","sourceRoot":"","sources":["../src/CopyHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC;;GAEG;AACH,qBAAa,WAAW;;gBAGV,SAAS,EAAE,GAAG;IAI1B;;OAEG;IACG,MAAM,CAAC,KAAK,CAAC,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"CopyHandler.d.ts","sourceRoot":"","sources":["../src/CopyHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC;;GAEG;AACH,qBAAa,WAAW;;gBAGV,SAAS,EAAE,GAAG;IAI1B;;OAEG;IACG,MAAM,CAAC,KAAK,CAAC,EAAE,cAAc;CAuCpC"}
|
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";
|
|
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})());
|