stable

Clone or download

Read-only

feat: Jump back and forth from title to description

part of story #38627: Choice of a new Rich Text Editor You can switch from title to description by pressing Enter key from anywhere in the title. You can go from the description to the title by pressing the backspace key from the beginning of the description. Positioning in prosemirror works like this: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 <div> <p> T h e _ t i t l e </p> <div> Note: The artidoc-section-description contains paragraph nodes. So when we say "beginning of the description" it means the beginning of the paragraph (position 2 in the example). How to test: -- With an existing section, go anywhere the title and press Enter key. -> The cursor should jump to the begining of the description and the toolbar should become enabled. -- Press then Backspace key. -> The cursor should jumb back to the last position of the title and the toolbar should become disabled. -- Continue to press Backspace key. -> It should start removing the title. -- Create a new section, write the title, then press Enter key and write the description. -> Everything should work fine. -- At the end of the description keep pressing the backspace key. -> Description and title should be deleted. Change-Id: I7dff39c619d72b39e650b5375263206a43bc167b

Modified Files

Name
M lib/frontend/prose-mirror-editor/src/index.ts +1 −0 Go to diff View file
M lib/frontend/prose-mirror-editor/src/use-editor.ts +2 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/package.json +3 −1 Go to diff View file
M plugins/artidoc/scripts/artidoc/pnpm-lock.yaml +41 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/components/section/description/SectionDescriptionEditorProseMirror.vue +6 −2 Go to diff View file
R plugins/artidoc/scripts/artidoc/src/components/section/description/artidoc-editor-schema.ts Go to diff View file
A plugins/artidoc/scripts/artidoc/src/components/section/mono-editor/jump-to-section-node.test.ts +123 −0 Go to diff View file
A plugins/artidoc/scripts/artidoc/src/components/section/mono-editor/jump-to-section-node.ts +160 −0 Go to diff View file