MCPcopy Create free account
hub / github.com/editablejs/editable / withPlugins

Function withPlugins

packages/plugins/plugins/src/index.ts:60–100  ·  view source on GitHub ↗
(editor: T, options: PluginOptions = {})

Source from the content-addressed store, hash-verified

58}
59
60export const withPlugins = <T extends Editable>(editor: T, options: PluginOptions = {}) => {
61 let newEditor = withContextMenu(editor)
62 newEditor = withIndent(newEditor, options.indent)
63 newEditor = withMark(newEditor, options.mark)
64 newEditor = withFontSize(newEditor, options.fontSize)
65 newEditor = withFontColor(newEditor, options.fontColor)
66 newEditor = withBackgroundColor(newEditor, options.backgroundColor)
67 newEditor = withHeading(newEditor, options.heading)
68 newEditor = withBlockquote(newEditor, options.blockquote)
69 newEditor = withOrderedList(newEditor, options.orderedList)
70 newEditor = withUnorderedList(newEditor, options.unorderedList)
71 newEditor = withTaskList(newEditor, options.taskList)
72 newEditor = withTable(newEditor, options.table)
73 newEditor = withLink(newEditor, options.link)
74 newEditor = withImage(newEditor, options.image)
75 newEditor = withHr(newEditor, options.hr)
76 newEditor = withAlign(newEditor, options.align)
77 newEditor = withLeading(newEditor, options.leading)
78 newEditor = withMention(newEditor, options.mention)
79 newEditor = withCodeBlock(newEditor, options.codeBlock)
80 return newEditor as T &
81 ContextMenuEditor &
82 MarkEditor &
83 HeadingEditor &
84 FontSizeEditor &
85 BlockquoteEditor &
86 OrderedListEditor &
87 IndentEditor &
88 UnorderedListEditor &
89 TaskListEditor &
90 TableEditor &
91 LinkEditor &
92 ImageEditor &
93 HrEditor &
94 AlignEditor &
95 LeadingEditor &
96 FontColorEditor &
97 BackgroundColorEditor &
98 MentionEditor &
99 CodeBlockEditor
100}
101
102export * from '@editablejs/plugin-mark'
103export * from '@editablejs/plugin-font/size'

Callers 1

PlaygroundFunction · 0.90

Calls 15

withFontSizeFunction · 0.90
withFontColorFunction · 0.90
withBackgroundColorFunction · 0.90
withContextMenuFunction · 0.85
withIndentFunction · 0.85
withMarkFunction · 0.85
withHeadingFunction · 0.85
withBlockquoteFunction · 0.85
withOrderedListFunction · 0.85
withUnorderedListFunction · 0.85
withTaskListFunction · 0.85
withTableFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…