diff --git a/package.json b/package.json index 4e4114170..d34c5686a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": false, - "version": "0.4.0-beta.18", + "version": "0.4.0-beta.19", "workspaces": [ "packages/*" ], diff --git a/packages/board/package.json b/packages/board/package.json index dfeb011db..0391753e3 100644 --- a/packages/board/package.json +++ b/packages/board/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/board", - "version": "0.4.0-beta.18", + "version": "0.4.0-beta.19", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", @@ -21,12 +21,12 @@ "author": "chenshenhai", "license": "MIT", "devDependencies": { - "@idraw/types": "^0.4.0-beta.18" + "@idraw/types": "^0.4.0-beta.19" }, "dependencies": {}, "peerDependencies": { - "@idraw/util": "^0.4.0-beta.18", - "@idraw/renderer": "^0.4.0-beta.18" + "@idraw/util": "^0.4.0-beta.19", + "@idraw/renderer": "^0.4.0-beta.19" }, "publishConfig": { "access": "public", diff --git a/packages/core/package.json b/packages/core/package.json index e16978b06..813203d30 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/core", - "version": "0.4.0-beta.18", + "version": "0.4.0-beta.19", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", @@ -21,13 +21,13 @@ "author": "chenshenhai", "license": "MIT", "devDependencies": { - "@idraw/types": "^0.4.0-beta.18" + "@idraw/types": "^0.4.0-beta.19" }, "dependencies": {}, "peerDependencies": { - "@idraw/board": "^0.4.0-beta.18", - "@idraw/renderer": "^0.4.0-beta.18", - "@idraw/util": "^0.4.0-beta.18" + "@idraw/board": "^0.4.0-beta.19", + "@idraw/renderer": "^0.4.0-beta.19", + "@idraw/util": "^0.4.0-beta.19" }, "publishConfig": { "access": "public", diff --git a/packages/idraw/dev/data.ts b/packages/idraw/dev/data.ts index 4f69f76f1..eea01c58e 100644 --- a/packages/idraw/dev/data.ts +++ b/packages/idraw/dev/data.ts @@ -288,8 +288,30 @@ const data: Data = { // originW: 80 // } } + }, + { + uuid: createUUID(), + type: 'text', + x: 0, + y: 150, + w: 200, + h: 100, + detail: { + text: '文字', + fontSize: 100 + // lineHeight: 100 + } + } + ], + layout: { + x: 0, + y: 0, + w: 400, + h: 400, + detail: { + background: '#F0F0F0' } - ] + } }; // const data: Data = { diff --git a/packages/idraw/dev/main.ts b/packages/idraw/dev/main.ts index 39143854a..3e0cc235d 100644 --- a/packages/idraw/dev/main.ts +++ b/packages/idraw/dev/main.ts @@ -3,10 +3,8 @@ import { iDraw } from '../src/index'; import { getData } from './data'; const opts = { - width: 400, - height: 400, - contextWidth: 400, - contextHeight: 400, + width: 800, + height: 500, devicePixelRatio: 2 }; @@ -20,6 +18,7 @@ const idraw = new iDraw( }) ); idraw.setData(data); +idraw.centerContent(); // idraw.scale(0.5); // idraw.scale(2); // idraw.scrollX(-80); diff --git a/packages/idraw/package.json b/packages/idraw/package.json index ae6fbfefe..5569c87e9 100644 --- a/packages/idraw/package.json +++ b/packages/idraw/package.json @@ -1,6 +1,6 @@ { "name": "idraw", - "version": "0.4.0-beta.18", + "version": "0.4.0-beta.19", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", @@ -22,11 +22,11 @@ "license": "MIT", "devDependencies": {}, "dependencies": { - "@idraw/board": "^0.4.0-beta.18", - "@idraw/core": "^0.4.0-beta.18", - "@idraw/renderer": "^0.4.0-beta.18", - "@idraw/types": "^0.4.0-beta.18", - "@idraw/util": "^0.4.0-beta.18" + "@idraw/board": "^0.4.0-beta.19", + "@idraw/core": "^0.4.0-beta.19", + "@idraw/renderer": "^0.4.0-beta.19", + "@idraw/types": "^0.4.0-beta.19", + "@idraw/util": "^0.4.0-beta.19" }, "publishConfig": { "access": "public", diff --git a/packages/lab/package.json b/packages/lab/package.json index 98af474f8..08115f9e2 100644 --- a/packages/lab/package.json +++ b/packages/lab/package.json @@ -1,17 +1,17 @@ { "name": "@idraw/lab", - "version": "0.4.0-beta.18", + "version": "0.4.0-beta.19", "dependencies": { "@ant-design/icons": "^5.1.3", - "@idraw/core": "^0.4.0-beta.18", - "@idraw/util": "^0.4.0-beta.18", + "@idraw/core": "^0.4.0-beta.19", + "@idraw/util": "^0.4.0-beta.19", "antd": "^5.5.0", "classnames": "^2.3.2", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@idraw/types": "^0.4.0-beta.18", + "@idraw/types": "^0.4.0-beta.19", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.1" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 521f069a2..95e9fab6d 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/renderer", - "version": "0.4.0-beta.18", + "version": "0.4.0-beta.19", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", @@ -21,11 +21,11 @@ "author": "chenshenhai", "license": "MIT", "devDependencies": { - "@idraw/types": "^0.4.0-beta.18" + "@idraw/types": "^0.4.0-beta.19" }, "dependencies": {}, "peerDependencies": { - "@idraw/util": "^0.4.0-beta.18" + "@idraw/util": "^0.4.0-beta.19" }, "publishConfig": { "access": "public", diff --git a/packages/types/package.json b/packages/types/package.json index 6c2da4b10..ef7f460e3 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/types", - "version": "0.4.0-beta.18", + "version": "0.4.0-beta.19", "description": "", "main": "src/index.ts", "types": "src/index.ts", diff --git a/packages/util/package.json b/packages/util/package.json index 1a226bb6b..054586af3 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@idraw/util", - "version": "0.4.0-beta.18", + "version": "0.4.0-beta.19", "description": "", "main": "dist/esm/index.js", "module": "dist/esm/index.js", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 534e96391..e8651a80b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -141,48 +141,48 @@ importers: packages/board: dependencies: '@idraw/renderer': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../renderer '@idraw/util': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../util devDependencies: '@idraw/types': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../types packages/core: dependencies: '@idraw/board': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../board '@idraw/renderer': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../renderer '@idraw/util': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../util devDependencies: '@idraw/types': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../types packages/idraw: dependencies: '@idraw/board': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../board '@idraw/core': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../core '@idraw/renderer': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../renderer '@idraw/types': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../types '@idraw/util': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../util packages/lab: @@ -191,10 +191,10 @@ importers: specifier: ^5.1.3 version: 5.1.3(react-dom@18.2.0)(react@18.2.0) '@idraw/core': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../core '@idraw/util': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../util antd: specifier: ^5.5.0 @@ -210,7 +210,7 @@ importers: version: 18.2.0(react@18.2.0) devDependencies: '@idraw/types': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../types '@types/react': specifier: ^18.2.0 @@ -222,11 +222,11 @@ importers: packages/renderer: dependencies: '@idraw/util': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../util devDependencies: '@idraw/types': - specifier: ^0.4.0-beta.18 + specifier: ^0.4.0-beta.19 version: link:../types packages/types: {}