Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
508e634
feat: add track element type and how its rendered
daria2023 Aug 8, 2024
5d194be
feat: review edit mode
daria2023 Aug 9, 2024
64a9847
fix: restructure track element
daria2023 Aug 9, 2024
ca1134c
fix: review mode and related element operation under review mode
daria2023 Aug 9, 2024
f99315a
fix: text control set value
daria2023 Aug 9, 2024
b000841
fix: Adjust image rendering to avoid overlaying tracks; Ensure placeh…
daria2023 Aug 12, 2024
5dc974e
feat: date control under review mode
daria2023 Aug 12, 2024
0c03631
feat: control tracks display mode and support hide element 1.0
daria2023 Aug 12, 2024
97de0f7
feat: fix position error when hide track elements
daria2023 Aug 13, 2024
19158ce
feat: save hide track variable and fix insert track style when hide t…
daria2023 Aug 14, 2024
848ba11
fix: style error when insert different track type or untracked elemen…
daria2023 Aug 14, 2024
b992a0c
fix: same user insert and delete under review mode scenario
daria2023 Aug 14, 2024
7898af2
feat: add user option
daria2023 Aug 15, 2024
52d9847
feat: compare track author to current user
daria2023 Aug 15, 2024
f04ee1c
fix: text control log track info when turn into edit mode
daria2023 Aug 15, 2024
4369909
feat: edit and delete behavior under review mode
daria2023 Aug 15, 2024
6b7d3cd
feat: deal with track element when zip elements
daria2023 Aug 16, 2024
c6401fe
fix: set date value didn't show on date picker and zip track logic
daria2023 Aug 19, 2024
046b1da
fix: track popup style
daria2023 Aug 19, 2024
d925779
Merge branch 'Hufe921:main' into main_trackChanges
daria2023 Aug 19, 2024
9f046a8
fix: insert track info underline y
daria2023 Aug 19, 2024
4c69d44
Merge remote-tracking branch 'daria/main_trackChanges' into main_trac…
daria2023 Aug 19, 2024
46a6f83
perf: disable map when loop
daria2023 Aug 19, 2024
38bebcd
fix: delete whole row still preserve row height and delete not work w…
daria2023 Aug 19, 2024
8e0cf14
feat: merge branch
Oct 14, 2024
faeb449
fix: check element in table when hide tracks
Oct 14, 2024
0af9980
fix: hide list index under hideTrack mode
Oct 14, 2024
6ac8020
fix: hide track elements inside table element
Oct 14, 2024
3cd3a2b
fix: delete table as a whole under trackmode
daria2023 Feb 21, 2025
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
1 change: 1 addition & 0 deletions src/editor/assets/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@import './contextmenu/contextmenu.css';
@import './hyperlink/hyperlink.css';
@import './zone/zone.css';
@import './track/track.css';

.ce-inputarea {
width: 100px;
Expand Down
23 changes: 23 additions & 0 deletions src/editor/assets/css/track/track.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.ce-track-popup {
background: #fff;
box-shadow: 0 2px 12px 0 rgb(98 107 132 / 20%);
border-radius: 2px;
color: #3d4757;
padding: 8px 16px;
position: absolute;
z-index: 1;
text-align: center;
display: none;
}

.ce-track-popup div {
min-width: 100px;
max-width: 300px;
font-size: 12px;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
text-decoration: none;
}
3 changes: 3 additions & 0 deletions src/editor/core/command/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class Command {
public getContainer: CommandAdapt['getContainer']
public getTitleValue: CommandAdapt['getTitleValue']
public getPositionContextByEvent: CommandAdapt['getPositionContextByEvent']
public execHideTracks: CommandAdapt['hideTracks']

constructor(adapt: CommandAdapt) {
// 全局命令
Expand Down Expand Up @@ -248,5 +249,7 @@ export class Command {
this.getControlList = adapt.getControlList.bind(adapt)
this.executeLocationControl = adapt.locationControl.bind(adapt)
this.executeInsertControl = adapt.insertControl.bind(adapt)
// 审核
this.execHideTracks = adapt.hideTracks.bind(adapt)
}
}
14 changes: 14 additions & 0 deletions src/editor/core/command/CommandAdapt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2054,6 +2054,20 @@ export class CommandAdapt {
this.draw.insertElementList([cloneElement])
}

public hideTracks (hide:boolean) {

if(hide) {
this.draw.hideReview()
} else {
this.draw.showReview()
}
this.draw.render({
isSetCursor: false,
isSubmitHistory: false
})

}

public focus(payload?: IFocusOption) {
const { position = LocationPosition.AFTER } = payload || {}
const curIndex =
Expand Down
4 changes: 3 additions & 1 deletion src/editor/core/contextmenu/ContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { globalMenus } from './menus/globalMenus'
import { hyperlinkMenus } from './menus/hyperlinkMenus'
import { imageMenus } from './menus/imageMenus'
import { tableMenus } from './menus/tableMenus'
import {reviewMenus} from './menus/reviewMenus'

interface IRenderPayload {
contextMenuList: IRegisterContextMenu[]
Expand Down Expand Up @@ -56,7 +57,8 @@ export class ContextMenu {
...tableMenus,
...imageMenus,
...controlMenus,
...hyperlinkMenus
...hyperlinkMenus,
...reviewMenus
]
this.contextMenuContainerList = []
this.contextMenuRelationShip = new Map()
Expand Down
19 changes: 19 additions & 0 deletions src/editor/core/contextmenu/menus/reviewMenus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {IRegisterContextMenu} from '../../../interface/contextmenu/ContextMenu'
import {Command} from '../../command/Command'

export const reviewMenus: IRegisterContextMenu[] = [
{
name: '隐藏痕迹',
when: ()=>true,
callback: (command: Command) => {
command.execHideTracks(true)
}
},
{
name: '显示痕迹',
when: ()=>true,
callback: (command: Command) => {
command.execHideTracks(false)
}
}
]
Loading