This repository has been archived by the owner on Nov 7, 2022. It is now read-only.
Refactor @mashcard/editor
#276
Darmody
announced in
Feature Shaping
Replies: 1 comment
-
ref to Prosemirror guide, we should keep the concept of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
@mashcard/editor
provides an editor for the mashcard web app. As features grow,@mashcard/editor
become more and more complex. Extensions get coupled deeper, and the relation between web app and editor becomes unclear. Because the editor is just a carrier of documents, it is necessary to make the editor pluggable conveniently (maybe the editor can be replaced by another document carrier someday).Goal
@mashcard/editor
is a themed editor based on@mashcard/design-system
.@mashcard/editor
should focus on building a toolkit for building document editors.@mashcard/editor
should decouple frommashcard
app and connect withmashcard
app as a document carrier.Prosemirror
directly, droptiptap
.Solution
packages/editor/src/editors/documentEditor
toapps/client-web
, which meansdocument editor
is adocument carrier
built on@mashcard/editor
toolkit and coupled withapps/client-web
is reasonable.@mashcard/editor
, creates a newplugins/editor
package with editor interface, node schema, and extension interface.plugins/editor
built onProsemirror
and drops@tiptap
progressively.plugins/editor/extensions
progressively.@mashcard/design-system
).apps/client-web
, it should be placed inapps/client-web
and become an app extension but not an editor extension, e.g.formula extension
andspreadsheet extension
maybe are app extensions.Dig into the detail of the editor node and extension:
Node
(Block
represent for document node too before).BlockActions
should be an independent extension that can be applied on nodes, likemark
ordecoration
.singleton document node
likeDiscussion
,SlashMenu
, and so on.Beta Was this translation helpful? Give feedback.
All reactions