Skip to content

Commit

Permalink
Merge pull request #74 from idrawjs/dev-v0.4
Browse files Browse the repository at this point in the history
deps: update idraw.js
  • Loading branch information
chenshenhai authored Mar 24, 2024
2 parents 31a143d + 5c71dcd commit c381483
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 49 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": false,
"version": "0.4.0-alpha.16",
"version": "0.4.0-alpha.18",
"workspaces": [
"packages/*"
],
Expand All @@ -19,7 +19,7 @@
"upgrade:version": "vite-node ./scripts/upgrade-version.ts && pnpm i"
},
"dependencies": {
"idraw": "0.4.0-beta.16",
"idraw": "0.4.0-beta.18",
"antd": "5.12.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/studio-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idraw/studio-base",
"version": "0.4.0-alpha.16",
"version": "0.4.0-alpha.18",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -22,7 +22,7 @@
"peerDependencies": {
"antd": "^5.12.1",
"classnames": "^2.3.2",
"idraw": "^0.4.0-beta.16",
"idraw": "^0.4.0-beta.18",
"react": "^18.2.0",
"react-color": "^2.19.3",
"react-dom": "^18.2.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idraw/studio",
"version": "0.4.0-alpha.16",
"version": "0.4.0-alpha.18",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -20,13 +20,13 @@
"author": "chenshenhai",
"license": "MIT",
"dependencies": {
"@idraw/studio-base": "^0.4.0-alpha.16",
"@idraw/studio-base": "^0.4.0-alpha.18",
"classnames": "^2.3.2",
"is-hotkey": "^0.2.0"
},
"peerDependencies": {
"antd": "^5.12.1",
"idraw": "^0.4.0-beta.16",
"idraw": "^0.4.0-beta.18",
"react": "^18.2.0",
"react-color": "^2.19.3",
"react-dom": "^18.2.0"
Expand Down
9 changes: 3 additions & 6 deletions packages/studio/src/util/data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Data, DataUnderlay, Element, ElementPosition } from 'idraw';
import type { Data, DataLayout, Element, ElementPosition } from 'idraw';
import { getElementPositionFromList, deepClone, findElementFromListByPosition } from 'idraw';

export function cloneEditingData(editingUUID: string | null, data: Data): Data {
Expand All @@ -22,18 +22,15 @@ export function cloneEditingDataByPosition(position: ElementPosition, data: Data
if (elem?.type === 'group') {
const { w, h, detail } = elem as Element<'group'>;
const { children, ...restDetail } = detail;
const underlay: DataUnderlay = {
type: 'rect',
x: 0,
y: 0,
const layout: DataLayout = {
w,
h,
detail: {
...restDetail
}
};
editingData.elements = deepClone(children || []);
editingData.underlay = underlay;
editingData.layout = layout;
}
return editingData;
}
Expand Down
72 changes: 36 additions & 36 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c381483

Please sign in to comment.