stable

Clone or download

Read-only

Minimal reference support

part of story #38627 : Choice of a new Rich Text Editor How to test: Add a tuleap reference in an artidoc `art #1`, when you press space the reference is tranfsormed into a link Note: In order to keep this revue small following points will be done in dedicated commits - error handling - if you have an existing reference, it will be not transformed into a link at document load - paste reference are not transformed into link Implementation note: Finding the correspondence between text and proseMirror is not easy at all I tried following approaches: - passing the `selection.from` to easily find reference => KO, it does not keep existing Decorations DecorationSet.add does not add my Decoration to existing DecorationSet, consequences, you'll loose link on existing refrences - retrieving the position from view.dom.innerText => KO when my text have lists, lists are included in proseMirror positions - retrieving the position from view.dom.innerHTML => KO prose mirror does not keeps position of all html element, my position is always later in text The choosen solution is to - browse tree and find prose mirror positions - retrieve the node corresponding to the position - retrieve the position of cross reference inside node.textContent Change-Id: I16f897555f7e1daaed2836cddf0f84c9de464273

Modified Files

Name
A lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/README.md +2 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/cross-ref-loader.ts +41 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/index.ts +69 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/link-decorator.test.ts +83 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/link-decorator.ts +49 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/reference-extractor.test.ts +77 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/reference-extractor.ts +52 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/reference-position-finder.test.ts +71 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/reference-position-finder.ts +57 −0 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/index.ts +1 −0 Go to diff View file
M lib/frontend/prose-mirror-editor/src/use-editor.ts +9 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/themes/editor.scss +6 −0 Go to diff View file
M plugins/artidoc/include/Artidoc/Document/Tracker/DocumentTrackerRepresentation.php +6 −1 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/components/print/SectionPrinterVersion.vue +1 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/components/section/SectionContent.vue +10 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/components/section/description/SectionDescription.test.ts +1 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/components/section/description/SectionDescription.vue +2 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/components/section/description/SectionDescriptionEditorProseMirror.vue +2 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/helpers/stubs/TrackerStub.ts +6 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/stores/configuration-store.ts +2 −0 Go to diff View file
M plugins/artidoc/tests/unit/Artidoc/Document/Tracker/DocumentTrackerRepresentationTest.php +13 −11 Go to diff View file
M src/common/Project/REST/v1/ProjectResource.class.php +43 −0 Go to diff View file
M tests/rest/tests/ProjectTest.php +30 −0 Go to diff View file