Markdown & Editor
Affiche du markdown GitHub sous forme de texte mis en forme et permet de l’éditer avec barre d’outils, aperçu en direct et vue partagée.
Disponible pour
Angular: disponible Vue: disponible React: disponible React Native: pas encore disponible
Utilisation
Planning sync with Ada Park and Leo Ruiz.
Cut the onboarding checklist to five steps
Ship it behind the
short-onboardingflagDraft the invite copy
Legal review by Friday
<div class="demo-stack" style="max-width: 680px; width: 100%">
<div soneField>
<label soneFieldLabel for="markdown-source">Markdown</label>
<textarea
#sourceInput
id="markdown-source"
rows="6"
[value]="note()"
(input)="note.set(sourceInput.value)"
></textarea>
</div>
<sone-markdown data-testid="markdown-reference-preview" [source]="note()" />
<sone-markdown-editor
ariaLabel="Meeting note"
placeholder="Write in markdown…"
[minRows]="5"
[(value)]="draft"
/>
</div>Importation
import {
SoneFloatingDockDirective,
SoneMarkdownComponent,
SoneMarkdownEditorComponent,
SoneMarkdownEditorFooterDirective,
SoneMarkdownEditorToolsDirective,
SoneMarkdownPreviewDirective,
} from "@surface-one/angular/markdown";Référence de l’API
SoneFloatingDockDirectiveDirective
| Nom | Type | Par défaut |
|---|---|---|
soneFloatingDock | boolean | false |
floatingDockAnchorobligatoire | HTMLElement | — |
SoneMarkdownComponentComposant
| Nom | Type | Par défaut |
|---|---|---|
source | string | null | undefined | "" |
size | MarkdownSize | "default" |
breaks | boolean | true |
SoneMarkdownEditorComponentComposant
| Nom | Type | Par défaut |
|---|---|---|
valuebidirectionnel | string | "" |
modebidirectionnel | MarkdownEditorMode | "edit" |
appearance | MarkdownEditorAppearance | "field" |
toolbar | MarkdownEditorToolbar | "full" |
stickyToolbar | boolean | false |
toolbarPlacement | MarkdownEditorToolbarPlacement | "top" |
focusFrame | boolean | true |
tabs | boolean | true |
minRows | number | 4 |
ariaLabel | string | null | null |
ariaLabelledby | string | null | null |
ariaDescribedby | string | null | null |
maxlength | number | null | null |
placeholder | string | "" |
spellcheck | boolean | true |
autocapitalize | string | "sentences" |
readonly | boolean | false |
busy | boolean | false |
invalid | boolean | false |
textareaClass | string | "" |
live | boolean | false |
imageSource | MarkdownImageResolver | null | null |
shortcuts | boolean | true |
continueLists | boolean | true |
| Nom | Type |
|---|---|
editorInput | Event |
editorKeydown | KeyboardEvent |
editorPaste | ClipboardEvent |
editorDragover | DragEvent |
editorDrop | DragEvent |
editorFocus | FocusEvent |
editorBlur | FocusEvent |
selectionChange | MarkdownSelection |
toolbarCommand | MarkdownToolbarCommandEvent |