@rnacanvas/draw.svg 2.0.2 → 2.2.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/CoordinateSystem.d.ts +34 -0
- package/dist/CoordinateSystem.d.ts.map +1 -0
- package/dist/bringToFront.d.ts +11 -0
- package/dist/bringToFront.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/sendToBack.d.ts +11 -0
- package/dist/sendToBack.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the coordinate system of a target SVG document.
|
|
3
|
+
*/
|
|
4
|
+
export declare class CoordinateSystem {
|
|
5
|
+
private targetSVGDoc;
|
|
6
|
+
constructor(targetSVGDoc: SVGSVGElement);
|
|
7
|
+
/**
|
|
8
|
+
* The width of the coordinate system of the target SVG document
|
|
9
|
+
* (i.e., the width of its view box).
|
|
10
|
+
*/
|
|
11
|
+
get width(): number;
|
|
12
|
+
/**
|
|
13
|
+
* The height of the coordinate system of the target SVG document
|
|
14
|
+
* (i.e., the height of its view box).
|
|
15
|
+
*/
|
|
16
|
+
get height(): number;
|
|
17
|
+
/**
|
|
18
|
+
* The minimum X coordinate of the view box of the target SVG document.
|
|
19
|
+
*/
|
|
20
|
+
get minX(): number;
|
|
21
|
+
/**
|
|
22
|
+
* The maximum X coordinate of the view box of the target SVG document.
|
|
23
|
+
*/
|
|
24
|
+
get maxX(): number;
|
|
25
|
+
/**
|
|
26
|
+
* The minimum Y coordinate of the view box of the target SVG document.
|
|
27
|
+
*/
|
|
28
|
+
get minY(): number;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum Y coordinate of the view box of the target SVG document.
|
|
31
|
+
*/
|
|
32
|
+
get maxY(): number;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=CoordinateSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoordinateSystem.d.ts","sourceRoot":"","sources":["../src/CoordinateSystem.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,gBAAgB;IACf,OAAO,CAAC,YAAY;gBAAZ,YAAY,EAAE,aAAa;IAE/C;;;OAGG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes the target SVG element the last child of its immediate parent node.
|
|
3
|
+
*
|
|
4
|
+
* Has no effect if the target SVG element has no parent node.
|
|
5
|
+
*
|
|
6
|
+
* Note that if the immediate parent node of the target SVG element is not the root SVG document
|
|
7
|
+
* (e.g., the target SVG element is in a group), then the target SVG element is only made the last child
|
|
8
|
+
* of its immediate parent node (not the root SVG document).
|
|
9
|
+
*/
|
|
10
|
+
export declare function bringToFront(targetSVGElement: SVGElement): void;
|
|
11
|
+
//# sourceMappingURL=bringToFront.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bringToFront.d.ts","sourceRoot":"","sources":["../src/bringToFront.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAM/D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { assignUUID } from './assignUUID';
|
|
2
2
|
export { assignUUID };
|
|
3
|
+
import { CoordinateSystem } from './CoordinateSystem';
|
|
4
|
+
export { CoordinateSystem };
|
|
3
5
|
import { Scaling } from './Scaling';
|
|
4
6
|
export { Scaling };
|
|
5
7
|
import { HorizontalClientScaling } from './HorizontalClientScaling';
|
|
6
8
|
export { HorizontalClientScaling };
|
|
7
9
|
import { VerticalClientScaling } from './VerticalClientScaling';
|
|
8
10
|
export { VerticalClientScaling };
|
|
11
|
+
import { bringToFront } from './bringToFront';
|
|
12
|
+
export { bringToFront };
|
|
13
|
+
import { sendToBack } from './sendToBack';
|
|
14
|
+
export { sendToBack };
|
|
9
15
|
//# sourceMappingURL=index.d.ts.map
|
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,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["draw.svg"]=e():t["draw.svg"]=e()}(this,(()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["draw.svg"]=e():t["draw.svg"]=e()}(this,(()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{CoordinateSystem:()=>p,HorizontalClientScaling:()=>f,Scaling:()=>d,VerticalClientScaling:()=>g,assignUUID:()=>u,bringToFront:()=>s,sendToBack:()=>l});const o={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const r=new Uint8Array(16);function i(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)}const a=[];for(let t=0;t<256;++t)a.push((t+256).toString(16).slice(1));const c=function(t,e,n){if(o.randomUUID&&!e&&!t)return o.randomUUID();const r=(t=t||{}).random||(t.rng||i)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return function(t,e=0){return a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]}(r)};function u(t){t.id="uuid-"+c()}var p=function(){function t(t){this.targetSVGDoc=t}return Object.defineProperty(t.prototype,"width",{get:function(){return this.targetSVGDoc.viewBox.baseVal.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.targetSVGDoc.viewBox.baseVal.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minX",{get:function(){return this.targetSVGDoc.viewBox.baseVal.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.minX+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.targetSVGDoc.viewBox.baseVal.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.minY+this.height},enumerable:!1,configurable:!0}),t}(),d=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")},t}(),f=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),g=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();function s(t){var e=t.parentNode;e&&e.appendChild(t)}function l(t){var e=t.parentNode;e&&e.prepend(t)}return e})()));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes the target SVG element the first child of its immediate parent node.
|
|
3
|
+
*
|
|
4
|
+
* Has no effect if the target SVG element has no parent node.
|
|
5
|
+
*
|
|
6
|
+
* Note that if the immediate parent node of the target SVG element is not the root SVG document
|
|
7
|
+
* (e.g., the target SVG element is in a group), then the target SVG element is only made the first child
|
|
8
|
+
* of its immediate parent node (not the root SVG document).
|
|
9
|
+
*/
|
|
10
|
+
export declare function sendToBack(targetSVGElement: SVGElement): void;
|
|
11
|
+
//# sourceMappingURL=sendToBack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendToBack.d.ts","sourceRoot":"","sources":["../src/sendToBack.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAM7D"}
|