Skip to content

Commit

Permalink
Merge pull request #308 from idrawjs/dev-v0.4
Browse files Browse the repository at this point in the history
Dev v0.4
  • Loading branch information
chenshenhai committed Apr 14, 2024
2 parents 532fda2 + efb379a commit 371ba79
Show file tree
Hide file tree
Showing 12 changed files with 1,416 additions and 1,581 deletions.
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": false,
"version": "0.4.0-beta.20",
"version": "0.4.0-beta.21",
"workspaces": [
"packages/*"
],
Expand Down Expand Up @@ -28,49 +28,49 @@
"upgrade:version": "ts-node --project ./tsconfig.node.json ./scripts/upgrade-version.ts && pnpm i"
},
"devDependencies": {
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/preset-typescript": "^7.23.3",
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"@babel/preset-typescript": "^7.24.1",
"@rollup/plugin-json": "^6.1.0",
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.12",
"@types/koa-compose": "^3.2.8",
"@types/node": "^20.11.16",
"@types/node": "^20.12.7",
"@types/serve-handler": "^6.1.4",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"@vitejs/plugin-react": "^4.2.1",
"babel-jest": "^29.7.0",
"canvas": "^2.11.2",
"chalk": "^5.3.0",
"dotenv": "^16.4.1",
"dotenv": "^16.4.5",
"enquirer": "^2.4.1",
"esbuild": "^0.20.0",
"eslint": "^8.56.0",
"esbuild": "^0.20.2",
"eslint": "^9.0.0",
"execa": "^8.0.1",
"fs-extra": "^11.2.0",
"glob": "^10.3.10",
"glob": "^10.3.12",
"http-server": "^14.1.1",
"husky": "^9.0.10",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.7.0",
"jimp": "^0.22.10",
"jimp": "^0.22.12",
"koa-compose": "^4.1.0",
"less": "^4.2.0",
"pixelmatch": "^5.3.0",
"pngjs": "^7.0.0",
"puppeteer": "^22.0.0",
"rollup": "^4.9.6",
"puppeteer": "^22.6.4",
"rollup": "^4.14.2",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-esbuild": "^6.1.1",
"serve-handler": "^6.1.5",
"terser": "^5.27.0",
"ts-morph": "^21.0.1",
"terser": "^5.30.3",
"ts-morph": "^22.0.0",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"vite": "^5.0.12"
"typescript": "^5.4.5",
"vite": "^5.2.8"
},
"__npminstall_done": false
}
8 changes: 4 additions & 4 deletions packages/board/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idraw/board",
"version": "0.4.0-beta.20",
"version": "0.4.0-beta.21",
"description": "",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand All @@ -21,12 +21,12 @@
"author": "chenshenhai",
"license": "MIT",
"devDependencies": {
"@idraw/types": "^0.4.0-beta.20"
"@idraw/types": "^0.4.0-beta.21"
},
"dependencies": {},
"peerDependencies": {
"@idraw/util": "^0.4.0-beta.20",
"@idraw/renderer": "^0.4.0-beta.20"
"@idraw/util": "^0.4.0-beta.21",
"@idraw/renderer": "^0.4.0-beta.21"
},
"publishConfig": {
"access": "public",
Expand Down
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idraw/core",
"version": "0.4.0-beta.20",
"version": "0.4.0-beta.21",
"description": "",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand All @@ -21,13 +21,13 @@
"author": "chenshenhai",
"license": "MIT",
"devDependencies": {
"@idraw/types": "^0.4.0-beta.20"
"@idraw/types": "^0.4.0-beta.21"
},
"dependencies": {},
"peerDependencies": {
"@idraw/board": "^0.4.0-beta.20",
"@idraw/renderer": "^0.4.0-beta.20",
"@idraw/util": "^0.4.0-beta.20"
"@idraw/board": "^0.4.0-beta.21",
"@idraw/renderer": "^0.4.0-beta.21",
"@idraw/util": "^0.4.0-beta.21"
},
"publishConfig": {
"access": "public",
Expand Down
16 changes: 8 additions & 8 deletions packages/core/src/middleware/layout-selector/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@ export const MiddlewareLayoutSelector: BoardMiddleware<LayoutSelectorSharedStora
const data = sharer.getActiveStorage('data');
if (data?.layout?.operations) {
const operations = data.layout.operations;
if (controlType === 'left' && operations.disableLeft === true) {
if (controlType === 'left' && operations.disabledLeft === true) {
return true;
}
if (controlType === 'top' && operations.disableTop === true) {
if (controlType === 'top' && operations.disabledTop === true) {
return true;
}
if (controlType === 'right' && operations.disableRight === true) {
if (controlType === 'right' && operations.disabledRight === true) {
return true;
}
if (controlType === 'bottom' && operations.disableBottom === true) {
if (controlType === 'bottom' && operations.disabledBottom === true) {
return true;
}
if (controlType === 'top-left' && operations.disableTopLeft === true) {
if (controlType === 'top-left' && operations.disabledTopLeft === true) {
return true;
}
if (controlType === 'top-right' && operations.disableTopRight === true) {
if (controlType === 'top-right' && operations.disabledTopRight === true) {
return true;
}
if (controlType === 'bottom-left' && operations.disableBottomLeft === true) {
if (controlType === 'bottom-left' && operations.disabledBottomLeft === true) {
return true;
}
if (controlType === 'bottom-right' && operations.disableBottomRight === true) {
if (controlType === 'bottom-right' && operations.disabledBottomRight === true) {
return true;
}
}
Expand Down
16 changes: 8 additions & 8 deletions packages/core/src/middleware/layout-selector/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,34 +76,34 @@ export function drawLayoutController(
const { controller, operations } = opts;
const { topLeft, topRight, bottomLeft, bottomRight, topMiddle, rightMiddle, bottomMiddle, leftMiddle } = controller;

drawControllerLine(ctx, { start: topLeft.center, end: topRight.center, centerVertexes: topMiddle.vertexes, disabled: !!operations?.disableTop });
drawControllerLine(ctx, { start: topRight.center, end: bottomRight.center, centerVertexes: rightMiddle.vertexes, disabled: !!operations?.disableRight });
drawControllerLine(ctx, { start: bottomRight.center, end: bottomLeft.center, centerVertexes: bottomMiddle.vertexes, disabled: !!operations?.disableBottom });
drawControllerLine(ctx, { start: bottomLeft.center, end: topLeft.center, centerVertexes: leftMiddle.vertexes, disabled: !!operations?.disableLeft });
drawControllerLine(ctx, { start: topLeft.center, end: topRight.center, centerVertexes: topMiddle.vertexes, disabled: !!operations?.disabledTop });
drawControllerLine(ctx, { start: topRight.center, end: bottomRight.center, centerVertexes: rightMiddle.vertexes, disabled: !!operations?.disabledRight });
drawControllerLine(ctx, { start: bottomRight.center, end: bottomLeft.center, centerVertexes: bottomMiddle.vertexes, disabled: !!operations?.disabledBottom });
drawControllerLine(ctx, { start: bottomLeft.center, end: topLeft.center, centerVertexes: leftMiddle.vertexes, disabled: !!operations?.disabledLeft });

const disabledOpts = {
lineWidth: 1,
strokeStyle: disableColor
};
if (operations?.disableTopLeft === true) {
if (operations?.disabledTopLeft === true) {
drawControllerCross(ctx, { vertexes: topLeft.vertexes, ...disabledOpts });
} else {
drawControllerBox(ctx, topLeft.vertexes);
}

if (operations?.disableTopRight === true) {
if (operations?.disabledTopRight === true) {
drawControllerCross(ctx, { vertexes: topRight.vertexes, ...disabledOpts });
} else {
drawControllerBox(ctx, topRight.vertexes);
}

if (operations?.disableBottomRight === true) {
if (operations?.disabledBottomRight === true) {
drawControllerCross(ctx, { vertexes: bottomRight.vertexes, ...disabledOpts });
} else {
drawControllerBox(ctx, bottomRight.vertexes);
}

if (operations?.disableBottomLeft === true) {
if (operations?.disabledBottomLeft === true) {
drawControllerCross(ctx, { vertexes: bottomLeft.vertexes, ...disabledOpts });
} else {
drawControllerBox(ctx, bottomLeft.vertexes);
Expand Down
12 changes: 6 additions & 6 deletions packages/idraw/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "idraw",
"version": "0.4.0-beta.20",
"version": "0.4.0-beta.21",
"description": "",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand All @@ -22,11 +22,11 @@
"license": "MIT",
"devDependencies": {},
"dependencies": {
"@idraw/board": "^0.4.0-beta.20",
"@idraw/core": "^0.4.0-beta.20",
"@idraw/renderer": "^0.4.0-beta.20",
"@idraw/types": "^0.4.0-beta.20",
"@idraw/util": "^0.4.0-beta.20"
"@idraw/board": "^0.4.0-beta.21",
"@idraw/core": "^0.4.0-beta.21",
"@idraw/renderer": "^0.4.0-beta.21",
"@idraw/types": "^0.4.0-beta.21",
"@idraw/util": "^0.4.0-beta.21"
},
"publishConfig": {
"access": "public",
Expand Down
8 changes: 4 additions & 4 deletions packages/lab/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "@idraw/lab",
"version": "0.4.0-beta.20",
"version": "0.4.0-beta.21",
"dependencies": {
"@ant-design/icons": "^5.1.3",
"@idraw/core": "^0.4.0-beta.20",
"@idraw/util": "^0.4.0-beta.20",
"@idraw/core": "^0.4.0-beta.21",
"@idraw/util": "^0.4.0-beta.21",
"antd": "^5.5.0",
"classnames": "^2.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@idraw/types": "^0.4.0-beta.20",
"@idraw/types": "^0.4.0-beta.21",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idraw/renderer",
"version": "0.4.0-beta.20",
"version": "0.4.0-beta.21",
"description": "",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand All @@ -21,11 +21,11 @@
"author": "chenshenhai",
"license": "MIT",
"devDependencies": {
"@idraw/types": "^0.4.0-beta.20"
"@idraw/types": "^0.4.0-beta.21"
},
"dependencies": {},
"peerDependencies": {
"@idraw/util": "^0.4.0-beta.20"
"@idraw/util": "^0.4.0-beta.21"
},
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idraw/types",
"version": "0.4.0-beta.20",
"version": "0.4.0-beta.21",
"description": "",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
16 changes: 8 additions & 8 deletions packages/types/src/lib/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export type DataLayout = Pick<ElementSize, 'x' | 'y' | 'w' | 'h'> & {
'background' | 'borderWidth' | 'overflow' | 'borderColor' | 'borderDash' | 'borderRadius' | 'shadowBlur' | 'shadowColor' | 'shadowOffsetX' | 'shadowOffsetY'
>;
operations?: {
disableLeft?: boolean;
disableTop?: boolean;
disableRight?: boolean;
disableBottom?: boolean;
disableTopLeft?: boolean;
disableTopRight?: boolean;
disableBottomLeft?: boolean;
disableBottomRight?: boolean;
disabledLeft?: boolean;
disabledTop?: boolean;
disabledRight?: boolean;
disabledBottom?: boolean;
disabledTopLeft?: boolean;
disabledTopRight?: boolean;
disabledBottomLeft?: boolean;
disabledBottomRight?: boolean;
};
};
export interface Data<E extends Record<string, any> = Record<string, any>> {
Expand Down
2 changes: 1 addition & 1 deletion packages/util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idraw/util",
"version": "0.4.0-beta.20",
"version": "0.4.0-beta.21",
"description": "",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down
Loading

0 comments on commit 371ba79

Please sign in to comment.