@machete-jhun/canvas-studio 0.0.1 → 0.0.5

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 @@
1
+ import{a as s,i as a,n as o,o as r,r as t,s as i,t as m}from"../utils-HkiclU4u.js";export{m as assertNever,o as complementaryHexColor,t as getPointerPosition,a as getStageCenter,s as getStageViewPortCenter,r as getVector2Position,i as isMac};
@@ -0,0 +1 @@
1
+ function t(){return/macintosh|mac os x/i.test(window.navigator.userAgent)}function e(t){throw new Error(`Unexpected object: ${t}`)}const n=t=>{let e="#";for(let n=0;n<3;n++)e+=(255-Number(`0x${t.slice(2*n+1,2*n+3)}`)).toString(16).padStart(2,"0");return e};function s(t,e){const{x:n,y:s}=t.position(),o=t.scaleX();return{x:(e.x-n)/o,y:(e.y-s)/o}}function o(t){return s(t.currentTarget,{x:t.evt.offsetX,y:t.evt.offsetY})}function r(t,e=0,n=0){return{x:(t.width()+e+t.offsetX())/t.scaleX()/2,y:(t.height()+n+t.offsetY())/t.scaleY()/2}}function a({stage:t,offsetWidth:e=0,offsetHeight:n=0}){const s=r(t,e,n);return{x:s.x-t.x()/t.scaleX(),y:s.y-t.y()/t.scaleY()}}export{a,r as i,n,s as o,o as r,t as s,e as t};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@machete-jhun/canvas-studio",
3
3
  "description": "一个基于 React 和 Konva 的画布编辑组件库,支持多种图形和媒体元素的添加与编辑,适用于构建复杂的图形应用。",
4
4
  "private": false,
5
- "version": "0.0.1",
5
+ "version": "0.0.5",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.js",
@@ -14,10 +14,15 @@
14
14
  ".": {
15
15
  "import": "./dist/index.js",
16
16
  "types": "./dist/index.d.ts"
17
+ },
18
+ "./utils": {
19
+ "import": "./dist/utils/index.js",
20
+ "types": "./dist/utils/index.d.ts"
17
21
  }
18
22
  },
19
23
  "files": [
20
- "dist"
24
+ "dist",
25
+ "README.md"
21
26
  ],
22
27
  "scripts": {
23
28
  "dev": "vite",