stable

Clone or download

Read-only

refactor: stop importing custom_schema everywhere

Part of story #38627: Choice of a new Rich Text Editor Context: In the editor, we define a custom schema. This custom schema is used to parse and manipulate the document. However, we'll need to be able to extend it for the "mono-editor" feature. Since it is built as a single object, and that it is imported everywhere, the nodes defined outside of the custom_schema object won't be recongized as valid nodes. Moreover, most of the features won't work because there will be a clash between the extended schema and the custom_schema object. To avoid that, we need to make sure that every object of the lib needing a schema have the same one. To do so, we build the schema using a function in use-editor, and we inject it in the editor code. -- No functional change expected. Co-authored-by: Clarisse Deschamps <clarisse.deschamps@enalean.com> Co-authored-by: Thomas Gorka <thomas.gorka@enalean.com> Change-Id: If4d9642569025870d7c6a5ed858a4eb22c68da62

Modified Files

Name
M lib/frontend/prose-mirror-editor/src/custom_schema.ts +18 −10 Go to diff View file
M lib/frontend/prose-mirror-editor/src/helpers/EditorTextNodeCreator.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/helpers/IsMarkTypeRepeatedInSelectionChecker.test.ts +3 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/helpers/LinkPropertiesExtractor.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/helpers/UpdatedCrossReferenceTransactionDispatcher.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/helpers/get-word-or-url-just-before-cursor.test.ts +3 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/automagic-links/convert-url-to-link-after-a-space.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/close-marks-after-space/close-all-marks.test.ts +6 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/close-marks-after-space/close-all-marks.ts +6 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/close-marks-after-space/close-mark.test.ts +2 −1 Go to diff View file
D lib/frontend/prose-mirror-editor/src/plugins/close-marks-after-space/marks-to-close.ts +0 −26 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/drop-file/plugin-drop-file.ts +1 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/cross-reference-decorator.test.ts +3 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/helpers/DescendentsContainingReferenceFinder.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/integration/references-decorator.test.ts +3 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/update/CrossReferenceDecorationFinder.test.ts +2 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/update/CrossReferenceDecorationReplacer.test.ts +2 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/update/UpdateCrossReferenceHandler.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/extract-referencies/update/UpdatedCrossReferenceInTransactionFinder.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/EditCrossReferenceCallbackBuilder.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/LinkNodeDetector.test.ts +3 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/RemoveLinkCallbackBuilder.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/get-selection-that-wraps-all-selected-links.test.ts +3 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/remove-selected-links.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/helper/MonoToolbarActionActivator.ts +8 −15 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/helper/NodeInfoRetriever.test.ts +4 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/image/CanInsertImageChecker.ts +3 −4 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/image/ImageFromSelectionExtractor.test.ts +4 −4 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/image/ImageFromSelectionExtractor.ts +1 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/image/ImageNodeInserter.test.ts +2 −0 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/image/ImageNodeInserter.ts +1 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/index.ts +6 −5 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/keymap.ts +16 −15 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/links/LinkStateBuilder.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/links/LinkStateBuilder.ts +4 −3 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/list/ListsInSelectionDetector.test.ts +3 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/list/ListsInSelectionDetector.ts +3 −4 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/list/SingleListInSelectionDetector.test.ts +2 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/mono-toolbar.ts +24 −20 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/quote/add-blockquote.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/quote/has-previous-node-type.test.ts +3 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/quote/is-selection-a-block-quote.test.ts +3 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/quote/quote-command.test.ts +3 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/quote/remove-blockquote.test.ts +2 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/text-style/HeadingInSelectionRetriever.test.ts +5 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/text-style/HeadingInSelectionRetriever.ts +4 −3 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/text-style/ParagraphsInSelectionDetector.test.ts +3 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/text-style/ParagraphsInSelectionDetector.ts +3 −6 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/text-style/PreformattedTextInSelectionDetector.test.ts +2 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/text-style/PreformattedTextInSelectionDetector.ts +1 −2 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/text-style/transform-text.test.ts +19 −6 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/text-style/transform-text.ts +7 −8 Go to diff View file
M lib/frontend/prose-mirror-editor/src/use-editor.ts +7 −6 Go to diff View file