stable

Clone or download

Read-only

refactor: rethink popover buttons inclusion

part of story #38627 : Choice of a new Rich Text Editor Currently, the design of the popover buttons inclusion is not really good: - Each button element must extend a "type" property, but needs to omit it in their component definition (in order to not have to define a readonly property). - We need a button-creator to render each button. It has to somehow pass the props to the buttons so they can render themselves. In short, this is kind of a mess. We had to establish this strategy because there were a bug in hybrids preventing us to pass children components their properties ([see GH issue](https://github.com/hybridsjs/hybrids/issues/273)). Now it has been corrected, and that hybrids has been successfully upgraded to version 9.1.6 in the whole codebase, then we can refactor the current popover buttons inclusion system to make it simpler and more convenient to use. -- no functional change expected Change-Id: Iff689add5532b1d0ea6a5ae15f2b7218402d5e4f

Modified Files

Name
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/LinkPopoverButtonsRenderers.test.ts +66 −0 Go to diff View file
A lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/LinkPopoverButtonsRenderers.ts +77 −0 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/LinkPopoverElement.test.ts +1 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/LinkPopoverElement.ts +4 −15 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/LinkPopoverTemplate.ts +1 −4 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/items/CopyToClipboardButtonElement.ts +0 −25 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/items/OpenLinkButtonElement.ts +1 −25 Go to diff View file
R lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/items/RemoveLinkButton.test.ts Go to diff View file
R lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/items/RemoveLinkButton.ts Go to diff View file
D lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/items/button-creator.test.ts +0 −82 Go to diff View file
D lib/frontend/prose-mirror-editor/src/plugins/link-popover/element/items/button-creator.ts +0 −41 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/RemoveLinkCallbackBuilder.ts +1 −1 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/create-link-popover.ts +13 −35 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/link-popover/helper/stubs/BuildRemoveLinkCallbackStub.ts +1 −1 Go to diff View file