@rnacanvas/draw.svg 1.2.0 → 1.3.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.
@@ -0,0 +1,16 @@
1
+ import * as SVG from '@svgdotjs/svg.js';
2
+ /**
3
+ * The horizontal scaling factor for a target SVG document
4
+ * going from the coordinate system of the SVG document (as determined by its view box)
5
+ * to the client coordinate system (i.e., the coordinate system used by methods such as `getBoundingClientRect`).
6
+ */
7
+ export declare class HorizontalClientScaling {
8
+ private targetSVGDoc;
9
+ constructor(targetSVGDoc: SVG.Svg);
10
+ /**
11
+ * Can possibly return a nonfinite value
12
+ * (e.g., if the target SVG document has a width of zero).
13
+ */
14
+ get(): number;
15
+ }
16
+ //# sourceMappingURL=HorizontalClientScaling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HorizontalClientScaling.d.ts","sourceRoot":"","sources":["../src/HorizontalClientScaling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAExC;;;;GAIG;AACH,qBAAa,uBAAuB;IACtB,OAAO,CAAC,YAAY;gBAAZ,YAAY,EAAE,GAAG,CAAC,GAAG;IAEzC;;;OAGG;IACH,GAAG,IAAI,MAAM;CAMd"}
package/dist/index.d.ts CHANGED
@@ -2,4 +2,6 @@ import { assignUUID } from './assignUUID';
2
2
  export { assignUUID };
3
3
  import { Scaling } from './Scaling';
4
4
  export { Scaling };
5
+ import { HorizontalClientScaling } from './HorizontalClientScaling';
6
+ export { HorizontalClientScaling };
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
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"}
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 r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},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,{Scaling:()=>a,assignUUID:()=>c});const o={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const n=new Uint8Array(16);function i(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)}const d=[];for(let t=0;t<256;++t)d.push((t+256).toString(16).slice(1));const u=function(t,e,r){if(o.randomUUID&&!e&&!t)return o.randomUUID();const n=(t=t||{}).random||(t.rng||i)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return d[t[e+0]]+d[t[e+1]]+d[t[e+2]]+d[t[e+3]]+"-"+d[t[e+4]]+d[t[e+5]]+"-"+d[t[e+6]]+d[t[e+7]]+"-"+d[t[e+8]]+d[t[e+9]]+"-"+d[t[e+10]]+d[t[e+11]]+d[t[e+12]]+d[t[e+13]]+d[t[e+14]]+d[t[e+15]]}(n)};function c(t){t.attr("id","uuid-"+u())}var a=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewbox();this.targetSVGDoc.attr({width:t*e.width+"px",height:t*e.height+"px"})},t}();return e})()));
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 r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},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:()=>p,Scaling:()=>a,assignUUID:()=>d});const o={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const n=new Uint8Array(16);function i(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)}const u=[];for(let t=0;t<256;++t)u.push((t+256).toString(16).slice(1));const c=function(t,e,r){if(o.randomUUID&&!e&&!t)return o.randomUUID();const n=(t=t||{}).random||(t.rng||i)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]}(n)};function d(t){t.attr("id","uuid-"+c())}var a=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewbox();this.targetSVGDoc.attr({width:t*e.width+"px",height:t*e.height+"px"})},t}(),p=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.node.getBoundingClientRect(),e=this.targetSVGDoc.viewbox();return t.width/e.width},t}();return e})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnacanvas/draw.svg",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "SVG drawing utilities",
5
5
  "repository": {
6
6
  "type": "git",