Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5,105 changes: 5,105 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@
},
"devDependencies": {
"@rollup/plugin-typescript": "^10.0.1",
"@types/node": "16.18.96",
"@types/node": "^22.13.4",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"cypress": "13.6.0",
"cypress-file-upload": "^5.0.8",
"eslint": "7.32.0",
"simple-git-hooks": "^2.8.1",
"typescript": "4.9.5",
"typescript": "^5.7.3",
"vite": "^2.4.2",
"vite-plugin-css-injected-by-js": "^2.1.1",
"vitepress": "1.0.0-beta.6",
Expand Down
7 changes: 3 additions & 4 deletions src/components/signature/Signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,9 @@ export class Signature {
this.canvasWidth,
this.canvasHeight
)
const self = this
this._saveUndoFn(function () {
self.ctx.clearRect(0, 0, self.canvasWidth, self.canvasHeight)
self.ctx.putImageData(imageData, 0, 0)
this._saveUndoFn(() => {
this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)
this.ctx.putImageData(imageData, 0, 0)
})
this.isDrawn = false
}
Expand Down
8 changes: 0 additions & 8 deletions src/editor/assets/css/contextmenu/contextmenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,10 @@
background-image: url(../../../assets/images/table-border-empty.svg);
}

.ce-contextmenu-border-dash {
background-image: url(../../../assets/images/table-border-dash.svg);
}

.ce-contextmenu-border-external {
background-image: url(../../../assets/images/table-border-external.svg);
}

.ce-contextmenu-border-internal {
background-image: url(../../../assets/images/table-border-internal.svg);
}

.ce-contextmenu-border-td {
background-image: url(../../../assets/images/table-border-td.svg);
}
Expand Down
2 changes: 1 addition & 1 deletion src/editor/assets/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
margin: 0;
padding: 0;
left: 0;
top: 0;
right: 0;
letter-spacing: 0;
font-size: 12px;
position: absolute;
Expand Down
51 changes: 0 additions & 51 deletions src/editor/assets/css/table/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
.ce-table-tool__row .ce-table-tool__row__item {
width: 100%;
position: relative;
cursor: pointer;
transition: all .3s;
}

.ce-table-tool__row .ce-table-tool__row__item::after {
Expand All @@ -23,53 +21,10 @@
background-color: #C0C6CF;
}

.ce-table-tool__row .ce-table-tool__row__item:hover {
background-color: #dadce0;
}

.ce-table-tool__row .ce-table-tool__row__item:last-child:after {
display: none;
}

.ce-table-tool__quick__add {
width: 16px;
height: 16px;
position: absolute;
border-radius: 50%;
background-color: #E2E6ED;
cursor: pointer;
}

.ce-table-tool__quick__add::after {
content: '+';
color: #ffffff;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -55%);
}

.ce-table-tool__select {
width: 16px;
height: 18px;
position: absolute;
border-radius: 3px;
cursor: pointer;
}

.ce-table-tool__select:hover {
background-color: #E2E6ED;
}

.ce-table-tool__select::after {
content: ':::';
color: #AAAAAB;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-75%, -50%) rotate(-90deg);
}

.ce-table-tool__col {
position: absolute;
height: 12px;
Expand All @@ -82,8 +37,6 @@
.ce-table-tool__col .ce-table-tool__col__item {
height: 100%;
position: relative;
cursor: pointer;
transition: all .3s;
}

.ce-table-tool__col .ce-table-tool__col__item::after {
Expand All @@ -97,10 +50,6 @@
background-color: #C0C6CF;
}

.ce-table-tool__col .ce-table-tool__col__item:hover {
background-color: #dadce0;
}

.ce-table-tool__col .ce-table-tool__col__item:first-child:after {
display: none;
}
Expand Down
1 change: 0 additions & 1 deletion src/editor/assets/images/table-border-dash.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/editor/assets/images/table-border-internal.svg

This file was deleted.

38 changes: 6 additions & 32 deletions src/editor/core/command/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class Command {
public executePainter: CommandAdapt['painter']
public executeApplyPainterStyle: CommandAdapt['applyPainterStyle']
public executeFormat: CommandAdapt['format']
public executeFootnote: CommandAdapt['footnote']
public executeFont: CommandAdapt['font']
public executeSize: CommandAdapt['size']
public executeSizeAdd: CommandAdapt['sizeAdd']
Expand All @@ -44,11 +45,8 @@ export class Command {
public executeDeleteTable: CommandAdapt['deleteTable']
public executeMergeTableCell: CommandAdapt['mergeTableCell']
public executeCancelMergeTableCell: CommandAdapt['cancelMergeTableCell']
public executeSplitVerticalTableCell: CommandAdapt['splitVerticalTableCell']
public executeSplitHorizontalTableCell: CommandAdapt['splitHorizontalTableCell']
public executeTableTdVerticalAlign: CommandAdapt['tableTdVerticalAlign']
public executeTableBorderType: CommandAdapt['tableBorderType']
public executeTableBorderColor: CommandAdapt['tableBorderColor']
public executeTableTdBorderType: CommandAdapt['tableTdBorderType']
public executeTableTdSlashType: CommandAdapt['tableTdSlashType']
public executeTableTdBackgroundColor: CommandAdapt['tableTdBackgroundColor']
Expand All @@ -71,22 +69,15 @@ export class Command {
public executeSaveAsImageElement: CommandAdapt['saveAsImageElement']
public executeChangeImageDisplay: CommandAdapt['changeImageDisplay']
public executePageMode: CommandAdapt['pageMode']
public executePageScale: CommandAdapt['pageScale']
public executePageScaleRecovery: CommandAdapt['pageScaleRecovery']
public executePageScaleMinus: CommandAdapt['pageScaleMinus']
public executePageScaleAdd: CommandAdapt['pageScaleAdd']
public executePaperSize: CommandAdapt['paperSize']
public executePaperDirection: CommandAdapt['paperDirection']
public executeSetPaperMargin: CommandAdapt['setPaperMargin']
public executeSetMainBadge: CommandAdapt['setMainBadge']
public executeSetAreaBadge: CommandAdapt['setAreaBadge']
public executeInsertElementList: CommandAdapt['insertElementList']
public executeInsertArea: CommandAdapt['insertArea']
public executeSetAreaProperties: CommandAdapt['setAreaProperties']
public executeLocationArea: CommandAdapt['locationArea']
public executeAppendElementList: CommandAdapt['appendElementList']
public executeUpdateElementById: CommandAdapt['updateElementById']
public executeDeleteElementById: CommandAdapt['deleteElementById']
public executeSetValue: CommandAdapt['setValue']
public executeRemoveControl: CommandAdapt['removeControl']
public executeSetLocale: CommandAdapt['setLocale']
Expand All @@ -110,18 +101,15 @@ export class Command {
public getImage: CommandAdapt['getImage']
public getOptions: CommandAdapt['getOptions']
public getValue: CommandAdapt['getValue']
public getAreaValue: CommandAdapt['getAreaValue']
public getHTML: CommandAdapt['getHTML']
public getText: CommandAdapt['getText']
public getWordCount: CommandAdapt['getWordCount']
public getCursorPosition: CommandAdapt['getCursorPosition']
public getRange: CommandAdapt['getRange']
public getRangeText: CommandAdapt['getRangeText']
public getRangeContext: CommandAdapt['getRangeContext']
public getRangeRow: CommandAdapt['getRangeRow']
public getRangeParagraph: CommandAdapt['getRangeParagraph']
public getKeywordRangeList: CommandAdapt['getKeywordRangeList']
public getKeywordContext: CommandAdapt['getKeywordContext']
public getPaperMargin: CommandAdapt['getPaperMargin']
public getSearchNavigateInfo: CommandAdapt['getSearchNavigateInfo']
public getLocale: CommandAdapt['getLocale']
Expand All @@ -131,7 +119,8 @@ export class Command {
public getContainer: CommandAdapt['getContainer']
public getTitleValue: CommandAdapt['getTitleValue']
public getPositionContextByEvent: CommandAdapt['getPositionContextByEvent']
public getElementById: CommandAdapt['getElementById']
public getParagraphId: CommandAdapt['getParagraphId']
public executeParagraphIndent: CommandAdapt['setParagraphIndent']

constructor(adapt: CommandAdapt) {
// 全局命令
Expand All @@ -153,6 +142,7 @@ export class Command {
this.executeApplyPainterStyle = adapt.applyPainterStyle.bind(adapt)
this.executeFormat = adapt.format.bind(adapt)
// 字体、字体大小、字体变大、字体变小、加粗、斜体、下划线、删除线、字体颜色、背景色
this.executeFootnote = adapt.footnote.bind(adapt)
this.executeFont = adapt.font.bind(adapt)
this.executeSize = adapt.size.bind(adapt)
this.executeSizeAdd = adapt.sizeAdd.bind(adapt)
Expand Down Expand Up @@ -181,13 +171,8 @@ export class Command {
this.executeDeleteTable = adapt.deleteTable.bind(adapt)
this.executeMergeTableCell = adapt.mergeTableCell.bind(adapt)
this.executeCancelMergeTableCell = adapt.cancelMergeTableCell.bind(adapt)
this.executeSplitVerticalTableCell =
adapt.splitVerticalTableCell.bind(adapt)
this.executeSplitHorizontalTableCell =
adapt.splitHorizontalTableCell.bind(adapt)
this.executeTableTdVerticalAlign = adapt.tableTdVerticalAlign.bind(adapt)
this.executeTableBorderType = adapt.tableBorderType.bind(adapt)
this.executeTableBorderColor = adapt.tableBorderColor.bind(adapt)
this.executeTableTdBorderType = adapt.tableTdBorderType.bind(adapt)
this.executeTableTdSlashType = adapt.tableTdSlashType.bind(adapt)
this.executeTableTdBackgroundColor =
Expand All @@ -212,26 +197,16 @@ export class Command {
this.executeChangeImageDisplay = adapt.changeImageDisplay.bind(adapt)
// 页面模式、页面缩放、纸张大小、纸张方向、页边距
this.executePageMode = adapt.pageMode.bind(adapt)
this.executePageScale = adapt.pageScale.bind(adapt)
this.executePageScaleRecovery = adapt.pageScaleRecovery.bind(adapt)
this.executePageScaleMinus = adapt.pageScaleMinus.bind(adapt)
this.executePageScaleAdd = adapt.pageScaleAdd.bind(adapt)
this.executePaperSize = adapt.paperSize.bind(adapt)
this.executePaperDirection = adapt.paperDirection.bind(adapt)
this.executeSetPaperMargin = adapt.setPaperMargin.bind(adapt)
// 签章
this.executeSetMainBadge = adapt.setMainBadge.bind(adapt)
this.executeSetAreaBadge = adapt.setAreaBadge.bind(adapt)
// 区域
this.getAreaValue = adapt.getAreaValue.bind(adapt)
this.executeInsertArea = adapt.insertArea.bind(adapt)
this.executeSetAreaProperties = adapt.setAreaProperties.bind(adapt)
this.executeLocationArea = adapt.locationArea.bind(adapt)
// 通用
this.executeInsertElementList = adapt.insertElementList.bind(adapt)
this.executeAppendElementList = adapt.appendElementList.bind(adapt)
this.executeUpdateElementById = adapt.updateElementById.bind(adapt)
this.executeDeleteElementById = adapt.deleteElementById.bind(adapt)
this.executeSetValue = adapt.setValue.bind(adapt)
this.executeRemoveControl = adapt.removeControl.bind(adapt)
this.executeSetLocale = adapt.setLocale.bind(adapt)
Expand All @@ -252,14 +227,12 @@ export class Command {
this.getHTML = adapt.getHTML.bind(adapt)
this.getText = adapt.getText.bind(adapt)
this.getWordCount = adapt.getWordCount.bind(adapt)
this.getCursorPosition = adapt.getCursorPosition.bind(adapt)
this.getRange = adapt.getRange.bind(adapt)
this.getRangeText = adapt.getRangeText.bind(adapt)
this.getRangeContext = adapt.getRangeContext.bind(adapt)
this.getRangeRow = adapt.getRangeRow.bind(adapt)
this.getRangeParagraph = adapt.getRangeParagraph.bind(adapt)
this.getKeywordRangeList = adapt.getKeywordRangeList.bind(adapt)
this.getKeywordContext = adapt.getKeywordContext.bind(adapt)
this.getCatalog = adapt.getCatalog.bind(adapt)
this.getPaperMargin = adapt.getPaperMargin.bind(adapt)
this.getSearchNavigateInfo = adapt.getSearchNavigateInfo.bind(adapt)
Expand All @@ -268,7 +241,6 @@ export class Command {
this.getContainer = adapt.getContainer.bind(adapt)
this.getTitleValue = adapt.getTitleValue.bind(adapt)
this.getPositionContextByEvent = adapt.getPositionContextByEvent.bind(adapt)
this.getElementById = adapt.getElementById.bind(adapt)
// 控件
this.executeSetControlValue = adapt.setControlValue.bind(adapt)
this.executeSetControlExtension = adapt.setControlExtension.bind(adapt)
Expand All @@ -278,5 +250,7 @@ export class Command {
this.getControlList = adapt.getControlList.bind(adapt)
this.executeLocationControl = adapt.locationControl.bind(adapt)
this.executeInsertControl = adapt.insertControl.bind(adapt)
this.getParagraphId = adapt.getParagraphId.bind(adapt)
this.executeParagraphIndent = adapt.setParagraphIndent.bind(adapt)
}
}
Loading