@rnacanvas/draw.svg 1.0.0 → 1.1.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/assignUUID.d.ts +13 -0
- package/dist/assignUUID.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 +6 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as SVG from '@svgdotjs/svg.js';
|
|
2
|
+
/**
|
|
3
|
+
* Assigns a UUID to the id attribute of the SVG element.
|
|
4
|
+
*
|
|
5
|
+
* Overwrites any preexisting id attribute.
|
|
6
|
+
*
|
|
7
|
+
* Will also prepend some letters to the assigned UUID,
|
|
8
|
+
* as DOM element IDs must begin with a letter.
|
|
9
|
+
*
|
|
10
|
+
* Thus, assigned UUIDs will be a little bit bigger than 36 characters (the standard size for UUIDs).
|
|
11
|
+
*/
|
|
12
|
+
export declare function assignUUID(ele: SVG.Element): void;
|
|
13
|
+
//# sourceMappingURL=assignUUID.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignUUID.d.ts","sourceRoot":"","sources":["../src/assignUUID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAIxC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAEjD"}
|
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":""}
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(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,{assignUUID:()=>p});const o={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const n=new Uint8Array(16);function d(){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 i=function(t,e,r){if(o.randomUUID&&!e&&!t)return o.randomUUID();const n=(t=t||{}).random||(t.rng||d)();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 p(t){t.attr("id","uuid-"+i())}return e})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnacanvas/draw.svg",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "SVG drawing utilities",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,11 +17,16 @@
|
|
|
17
17
|
"@babel/core": "^7.23.7",
|
|
18
18
|
"@babel/preset-env": "^7.23.7",
|
|
19
19
|
"@babel/preset-typescript": "^7.23.3",
|
|
20
|
+
"@types/uuid": "^9.0.8",
|
|
20
21
|
"babel-jest": "^29.7.0",
|
|
21
22
|
"jest": "^29.7.0",
|
|
22
23
|
"ts-loader": "^9.5.1",
|
|
23
24
|
"typescript": "^5.3.3",
|
|
24
25
|
"webpack": "^5.89.0",
|
|
25
26
|
"webpack-cli": "^5.1.4"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@svgdotjs/svg.js": "^3.2.0",
|
|
30
|
+
"uuid": "^9.0.1"
|
|
26
31
|
}
|
|
27
32
|
}
|