Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
226862d
update: 默认README为英文
JessYan0913 Oct 9, 2023
daba543
update: 更新README的codesandbox地址
JessYan0913 Oct 12, 2023
75d66a7
update: 新增codesandbox地址
JessYan0913 Oct 12, 2023
e5b9a2c
Merge branch 'main' into develop
JessYan0913 Oct 12, 2023
f354da6
update: 新增宣传图
JessYan0913 Oct 18, 2023
0a4fbc2
fix: 修复移动画布后解除组合导致画布偏移问题
Oct 21, 2023
99772ba
fix: 解决ts引入的时的类型错误
JessYan0913 Oct 22, 2023
f77ee10
Merge branch 'develop' of https://github.com/JessYan0913/pictode into…
JessYan0913 Oct 22, 2023
6a6c5d5
update: 更新依赖包文件
JessYan0913 Oct 23, 2023
6214d46
update: 更新版本号
JessYan0913 Oct 23, 2023
5fdfde2
Merge branch 'main' into develop
JessYan0913 Oct 23, 2023
e156af7
update: 添加贡献者名单
Oct 24, 2023
1014ad0
Merge remote-tracking branch 'origin' into develop
Oct 24, 2023
54b1901
Merge remote-tracking branch 'origin/main' into develop
JessYan0913 Oct 24, 2023
2a76523
update: 发布新版本
JessYan0913 Oct 24, 2023
a3fba2e
update: 更新版本号
Oct 26, 2023
6b59ef5
Merge remote-tracking branch 'origin/main' into develop
Oct 26, 2023
b763a0d
update: 更新包管理
Oct 26, 2023
49cfa46
update: 删除无用依赖,并更新eslint
Oct 26, 2023
340d11b
update: 升级版本号
Oct 26, 2023
f164e9d
Merge remote-tracking branch 'origin/main' into develop
Oct 26, 2023
51d9a81
update: 用workspace代替线上版本号
JessYan0913 Oct 26, 2023
b643fa4
update: 更新属性工具属性入参
JessYan0913 Oct 26, 2023
bb233b6
update: 更新本地依赖包
JessYan0913 Oct 26, 2023
12a150d
update: 更新setTool方法
JessYan0913 Oct 26, 2023
139db95
update: 更新tool的config类型
JessYan0913 Oct 28, 2023
8eff6d7
refactor: diamond -> regularPolygon
JessYan0913 Oct 28, 2023
f594b6a
update: setTool可以设置null也可设置相同tool
JessYan0913 Oct 30, 2023
0a544dd
update: 同一tool导出内容
JessYan0913 Oct 30, 2023
5bfc67d
update: 更新版本号
JessYan0913 Oct 30, 2023
321d96e
Merge remote-tracking branch 'origin/main' into develop
JessYan0913 Oct 30, 2023
a6340cc
update: 使用空间别名饮用依赖包
JessYan0913 Oct 30, 2023
d5afbf0
update: 更新tools的config配置
JessYan0913 Oct 30, 2023
f652ddf
update: 工具ImageTool导出ImageConfig
JessYan0913 Oct 30, 2023
ba4ffdf
update: 升级版本到1.0.0
JessYan0913 Oct 30, 2023
4800779
Merge remote-tracking branch 'origin/main' into develop
JessYan0913 Oct 30, 2023
6e4bf9e
update: 删除无用的公共依赖
JessYan0913 Nov 8, 2023
10c45c1
update: 更新vitest版本号
JessYan0913 Nov 8, 2023
418ce7e
update: 增加本地启动逻辑
JessYan0913 Nov 14, 2023
fed8e5a
fix: 修复文本在编辑态删除
Nov 24, 2023
df769cf
update: 更新版本号
Nov 24, 2023
038a07d
fix: #40
Nov 24, 2023
d5bc14e
Merge remote-tracking branch 'origin/main' into develop
JessYan0913 Mar 6, 2024
bf4fbcb
update: 更新本地依赖
JessYan0913 Mar 6, 2024
6e1dc6c
Merge remote-tracking branch 'origin/main' into develop
Mar 8, 2024
cb67d94
Merge remote-tracking branch 'origin/main' into develop
JessYan0913 Mar 8, 2024
99b44db
Merge branch 'develop' of https://github.com/JessYan0913/pictode into…
JessYan0913 Mar 8, 2024
1c0ef7b
update: 更新部分依赖包版本
Mar 8, 2024
028a94f
update: 更新网址国际化
Mar 8, 2024
7209102
Merge remote-tracking branch 'origin/main' into develop
JessYan0913 Mar 11, 2024
19dc9d2
refactor: 重构代码结构
JessYan0913 Mar 11, 2024
2aa32e3
update: 补充history:installed事件的触发
JessYan0913 Mar 11, 2024
482cd49
Merge remote-tracking branch 'origin/main' into develop
Mar 12, 2024
7652d6e
Merge remote-tracking branch 'origin/main' into develop
Mar 12, 2024
2e48717
update: 升级版本号
Mar 12, 2024
9593d8a
update: 更新版本号
Mar 12, 2024
e337157
update: 更新版本号1.0.1->1.0.2
Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pictode/core",
"private": false,
"version": "1.0.1",
"version": "1.0.2",
"main": "dist/pictode-core.umd.js",
"module": "dist/pictode-core.mjs",
"types": "types/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-history/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pictode/plugin-history",
"private": false,
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/pictode-plugin-history.umd.js",
"module": "dist/pictode-plugin-history.mjs",
"types": "types/index.d.ts",
Expand Down
35 changes: 7 additions & 28 deletions packages/plugin-history/src/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ export class History {
command.executed = true;
command.executeTime = new Date().getTime();
this.redoStack = [];
this.app.emit('stack:changed', {
undoStack: this.undoStack,
redoStack: this.redoStack,
});
this.app.emit('stack:changed', { undoStack: this.undoStack, redoStack: this.redoStack });
}

public undo(step: number = 1): BaseCmd | undefined {
Expand All @@ -56,18 +53,12 @@ export class History {
if (command) {
command.undo();
this.redoStack.push(command);
this.app.emit('stack:changed', {
undoStack: this.undoStack,
redoStack: this.redoStack,
});
this.app.emit('stack:changed', { undoStack: this.undoStack, redoStack: this.redoStack });
}
}
--step;
}
this.app.emit('history:undo', {
step,
command: command?.toJSON(),
});
this.app.emit('history:undo', { step, command: command?.toJSON() });
return command;
}

Expand All @@ -82,18 +73,12 @@ export class History {
if (command) {
command.execute();
this.undoStack.push(command);
this.app.emit('stack:changed', {
undoStack: this.undoStack,
redoStack: this.redoStack,
});
this.app.emit('stack:changed', { undoStack: this.undoStack, redoStack: this.redoStack });
}
}
--step;
}
this.app.emit('history:redo', {
command: command?.toJSON(),
step,
});
this.app.emit('history:redo', { step, command: command?.toJSON() });
return command;
}

Expand Down Expand Up @@ -131,19 +116,13 @@ export class History {
}
}

this.app.emit('stack:changed', {
undoStack: this.undoStack,
redoStack: this.redoStack,
});
this.app.emit('stack:changed', { undoStack: this.undoStack, redoStack: this.redoStack });
}

public destroy(): void {
this.undoStack = [];
this.redoStack = [];
this.app.emit('stack:changed', {
undoStack: this.undoStack,
redoStack: this.redoStack,
});
this.app.emit('stack:changed', { undoStack: this.undoStack, redoStack: this.redoStack });
}
}

Expand Down
12 changes: 5 additions & 7 deletions packages/plugin-history/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ export class HistoryPlugin implements Plugin {
this.app.on('node:added', this.onNodeAdded);
this.app.on('node:removed', this.onNodeRemove);
this.app.on('node:update:before', this.onNodeUpdateBefore);
this.app.on('node:updated', this.onNodeUpdated);
this.app.on('node:zindex:changed', this.onNodeZIndexChanged);
this.app.on('node:group:make', this.onMakeGroup);
this.app.on('node:group:decompose', this.onDecomposeGroup);
this.app.on('node:updated', this.onNodeUpdated);
this.app.emit('history:installed', { history: this });
}

public destroy(): void {
Expand All @@ -49,31 +50,28 @@ export class HistoryPlugin implements Plugin {
this.app?.off('node:removed', this.onNodeRemove);
this.app?.off('node:update:before', this.onNodeUpdateBefore);
this.app?.off('node:updated', this.onNodeUpdated);
this.app?.off('node:zindex:changed', this.onNodeZIndexChanged);
this.app?.off('node:group:make', this.onMakeGroup);
this.app?.off('node:group:decompose', this.onDecomposeGroup);
this.app?.emit('history:destroy', {
history: this,
});
this.app?.emit('history:destroy', { history: this });
}

public enable(): void {
if (!this.history) {
return;
}
this.options.enabled = true;
this.history.enabled = true;
}

public disable(): void {
if (!this.history) {
return;
}
this.options.enabled = false;
this.history.enabled = false;
}

public isEnabled(): boolean {
return this.options.enabled && (this.history?.enabled ?? false);
return this.history?.enabled ?? false;
}

private onNodeAdded = ({ nodes }: EventArgs['node:added']) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-selector/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pictode/plugin-selector",
"private": false,
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/pictode-plugin-selector.umd.js",
"module": "dist/pictode-plugin-selector.mjs",
"types": "types/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion pictode/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pictode",
"private": false,
"version": "1.0.1",
"version": "1.0.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down