Repository navigation
Add MarkdownEditor with formatting, preview and configurable completion - #393
Merged
Merged
Conversation
A controlled markdown editor published as the ./MarkdownEditor subpath: one bordered box with a formatting toolbar and a round corner toggle that swaps it to a host-rendered preview. - Completion is generic: a MarkdownCompletion names a string or RegExp trigger and a suggest callback. The editor recognizes the trigger at the caret, debounces, aborts and drops stale answers, renders the list at the caret above any dialog, and inserts the picked suggestion. - Pasted and dropped files upload through an uploadFile callback behind a placeholder that is resolved by value, or removed on failure. - No markdown renderer ships: renderPreview hands rendering and sanitization to the host, so the subpath adds no dependencies. - Stable parts, labels with English defaults, and a toolbar with one Tab stop and Control/Command shortcuts.
Give styles.MarkdownEditor.css its measured per-area ceiling, and move the aggregate ceilings by what the editor's rules measured: raw to 210 KiB and gzip to 33 KiB. The aggregate had 54 gzip bytes of headroom before the editor, whose rules were already cut to what they need.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
MarkdownEditor(@cratis/components/MarkdownEditor): a markdown editor with a formatting toolbar, keyboard shortcuts, a write/preview toggle and file uploads, styled through--cratis-*tokens andptparts (part of Cratis/Direct#1275)MarkdownEditor: give it trigger characters or patterns (for example#) and a callback that returns suggestions. The editor shows the list and inserts the chosen item (part of Cratis/Direct#1275)