Markdown & Editor

将 GitHub 风格的 Markdown 渲染为正文,并通过工具栏、实时预览和分屏视图进行编辑。

可用框架
  • Angular: 可用
  • Vue: 可用
  • React: 可用
  • React Native: 暂不可用

用法

Planning sync with Ada Park and Leo Ruiz.

  • Cut the onboarding checklist to five steps

  • Ship it behind the short-onboarding flag

  • Draft the invite copy

  • Legal review by Friday

导入

ts
import {
  SoneFloatingDockDirective,
  SoneMarkdownComponent,
  SoneMarkdownEditorComponent,
  SoneMarkdownEditorFooterDirective,
  SoneMarkdownEditorToolsDirective,
  SoneMarkdownPreviewDirective,
} from "@surface-one/angular/markdown";

API 参考

SoneFloatingDockDirective指令

选择器
[soneFloatingDock]
输入
名称类型 默认值
soneFloatingDockbooleanfalse
floatingDockAnchor必填HTMLElement—

SoneMarkdownComponent组件

选择器
sone-markdown
输入
名称类型 默认值
sourcestring | null | undefined""
sizeMarkdownSize"default"
breaksbooleantrue

SoneMarkdownEditorComponent组件

选择器
sone-markdown-editor
导出为
soneMarkdownEditor
输入
名称类型 默认值
value双向string""
mode双向MarkdownEditorMode"edit"
appearanceMarkdownEditorAppearance"field"
toolbarMarkdownEditorToolbar"full"
stickyToolbarbooleanfalse
toolbarPlacementMarkdownEditorToolbarPlacement"top"
focusFramebooleantrue
tabsbooleantrue
minRowsnumber4
ariaLabelstring | nullnull
ariaLabelledbystring | nullnull
ariaDescribedbystring | nullnull
maxlengthnumber | nullnull
placeholderstring""
spellcheckbooleantrue
autocapitalizestring"sentences"
readonlybooleanfalse
busybooleanfalse
invalidbooleanfalse
textareaClassstring""
livebooleanfalse
imageSourceMarkdownImageResolver | nullnull
shortcutsbooleantrue
continueListsbooleantrue
输出
名称类型
editorInputEvent
editorKeydownKeyboardEvent
editorPasteClipboardEvent
editorDragoverDragEvent
editorDropDragEvent
editorFocusFocusEvent
editorBlurFocusEvent
selectionChangeMarkdownSelection
toolbarCommandMarkdownToolbarCommandEvent

SoneMarkdownEditorFooterDirective指令

选择器
[soneMarkdownEditorFooter]

SoneMarkdownEditorToolsDirective指令

选择器
[soneMarkdownEditorTools]

SoneMarkdownPreviewDirective指令

选择器
ng-template[soneMarkdownPreview]