Markdown & Editor
Renderize markdown no estilo GitHub como texto formatado e edite-o com barra de ferramentas, pré-visualização ao vivo e visualização dividida.
Disponível em
Angular: disponível Vue: disponível React: disponível React Native: ainda não disponível
Uso
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>Importação
import {
SoneFloatingDockDirective,
SoneMarkdownComponent,
SoneMarkdownEditorComponent,
SoneMarkdownEditorFooterDirective,
SoneMarkdownEditorToolsDirective,
SoneMarkdownPreviewDirective,
} from "@surface-one/angular/markdown";Referência da API
SoneFloatingDockDirectiveDiretiva
| Nome | Tipo | Padrão |
|---|---|---|
soneFloatingDock | boolean | false |
floatingDockAnchorobrigatório | HTMLElement | — |
SoneMarkdownComponentComponente
| Nome | Tipo | Padrão |
|---|---|---|
source | string | null | undefined | "" |
size | MarkdownSize | "default" |
breaks | boolean | true |
SoneMarkdownEditorComponentComponente
| Nome | Tipo | Padrão |
|---|---|---|
valuebidirecional | string | "" |
modebidirecional | 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 |
| Nome | Tipo |
|---|---|
editorInput | Event |
editorKeydown | KeyboardEvent |
editorPaste | ClipboardEvent |
editorDragover | DragEvent |
editorDrop | DragEvent |
editorFocus | FocusEvent |
editorBlur | FocusEvent |
selectionChange | MarkdownSelection |
toolbarCommand | MarkdownToolbarCommandEvent |