@yannelli/live-markdown-vue 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.vue.d.ts +2 -0
- package/dist/components/MarkdownEditor.vue.d.ts +304 -0
- package/dist/index.d.ts +8 -0
- package/dist/live-markdown-vue.js +13248 -0
- package/dist/live-markdown-vue.umd.cjs +151 -0
- package/dist/main.d.ts +1 -0
- package/dist/style.css +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { ToolbarButtonName, MarkdownEditorProps } from '../types';
|
|
2
|
+
type __VLS_Props = MarkdownEditorProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
modelValue?: string;
|
|
5
|
+
} & __VLS_Props;
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
7
|
+
getEditor: () => {
|
|
8
|
+
value: {
|
|
9
|
+
(): string;
|
|
10
|
+
(val: string): void;
|
|
11
|
+
};
|
|
12
|
+
codemirror: {
|
|
13
|
+
hasFocus: {
|
|
14
|
+
(): boolean;
|
|
15
|
+
(): boolean;
|
|
16
|
+
};
|
|
17
|
+
findPosH: (start: CodeMirror.Position, amount: number, unit: string, visually: boolean) => {
|
|
18
|
+
line: number;
|
|
19
|
+
ch: number;
|
|
20
|
+
hitSide?: boolean | undefined;
|
|
21
|
+
};
|
|
22
|
+
findPosV: (start: CodeMirror.Position, amount: number, unit: string) => {
|
|
23
|
+
line: number;
|
|
24
|
+
ch: number;
|
|
25
|
+
hitSide?: boolean | undefined;
|
|
26
|
+
};
|
|
27
|
+
findWordAt: (pos: CodeMirror.Position) => CodeMirror.Range;
|
|
28
|
+
setOption: {
|
|
29
|
+
<K extends keyof CodeMirror.EditorConfiguration>(option: K, value: CodeMirror.EditorConfiguration[K]): void;
|
|
30
|
+
(option: string, value: unknown): void;
|
|
31
|
+
};
|
|
32
|
+
getOption: <K extends keyof CodeMirror.EditorConfiguration>(option: K) => CodeMirror.EditorConfiguration[K];
|
|
33
|
+
addKeyMap: (map: string | CodeMirror.KeyMap, bottom?: boolean) => void;
|
|
34
|
+
removeKeyMap: (map: string | CodeMirror.KeyMap) => void;
|
|
35
|
+
addOverlay: (mode: any, options?: {
|
|
36
|
+
opaque?: boolean | undefined;
|
|
37
|
+
priority?: number | undefined;
|
|
38
|
+
}) => void;
|
|
39
|
+
removeOverlay: (mode: any) => void;
|
|
40
|
+
getDoc: () => CodeMirror.Doc;
|
|
41
|
+
swapDoc: (doc: CodeMirror.Doc) => CodeMirror.Doc;
|
|
42
|
+
getValue: {
|
|
43
|
+
(seperator?: string): string;
|
|
44
|
+
(): string;
|
|
45
|
+
};
|
|
46
|
+
setValue: {
|
|
47
|
+
(content: string): void;
|
|
48
|
+
(value: string): void;
|
|
49
|
+
};
|
|
50
|
+
getCursor: (start?: string) => CodeMirror.Position;
|
|
51
|
+
setCursor: (pos: CodeMirror.Position | number, ch?: number, options?: {
|
|
52
|
+
bias?: number | undefined;
|
|
53
|
+
origin?: string | undefined;
|
|
54
|
+
scroll?: boolean | undefined;
|
|
55
|
+
}) => void;
|
|
56
|
+
setGutterMarker: (line: any, gutterID: string, value: HTMLElement | null) => CodeMirror.LineHandle;
|
|
57
|
+
clearGutter: (gutterID: string) => void;
|
|
58
|
+
addLineClass: (line: any, where: string, _class_: string) => CodeMirror.LineHandle;
|
|
59
|
+
removeLineClass: (line: any, where: string, class_?: string) => CodeMirror.LineHandle;
|
|
60
|
+
lineAtHeight: (height: number, mode?: CodeMirror.CoordsMode) => number;
|
|
61
|
+
heightAtLine: (line: any, mode?: CodeMirror.CoordsMode, includeWidgets?: boolean) => number;
|
|
62
|
+
lineInfo: (line: any) => {
|
|
63
|
+
line: any;
|
|
64
|
+
handle: any;
|
|
65
|
+
text: string;
|
|
66
|
+
gutterMarkers: any;
|
|
67
|
+
textClass: string;
|
|
68
|
+
bgClass: string;
|
|
69
|
+
wrapClass: string;
|
|
70
|
+
widgets: any;
|
|
71
|
+
};
|
|
72
|
+
addWidget: (pos: CodeMirror.Position, node: HTMLElement, scrollIntoView: boolean) => void;
|
|
73
|
+
addLineWidget: (line: any, node: HTMLElement, options?: CodeMirror.LineWidgetOptions) => CodeMirror.LineWidget;
|
|
74
|
+
setSize: (width: any, height: any) => void;
|
|
75
|
+
scrollTo: (x?: number | null, y?: number | null) => void;
|
|
76
|
+
getScrollInfo: () => CodeMirror.ScrollInfo;
|
|
77
|
+
scrollIntoView: (pos: CodeMirror.Position | null | {
|
|
78
|
+
line: number;
|
|
79
|
+
ch: number;
|
|
80
|
+
} | {
|
|
81
|
+
left: number;
|
|
82
|
+
top: number;
|
|
83
|
+
right: number;
|
|
84
|
+
bottom: number;
|
|
85
|
+
} | {
|
|
86
|
+
from: CodeMirror.Position;
|
|
87
|
+
to: CodeMirror.Position;
|
|
88
|
+
}, margin?: number) => void;
|
|
89
|
+
cursorCoords: (where?: boolean | CodeMirror.Position | null, mode?: CodeMirror.CoordsMode) => {
|
|
90
|
+
left: number;
|
|
91
|
+
top: number;
|
|
92
|
+
bottom: number;
|
|
93
|
+
};
|
|
94
|
+
charCoords: (pos: CodeMirror.Position, mode?: CodeMirror.CoordsMode) => {
|
|
95
|
+
left: number;
|
|
96
|
+
right: number;
|
|
97
|
+
top: number;
|
|
98
|
+
bottom: number;
|
|
99
|
+
};
|
|
100
|
+
coordsChar: (object: {
|
|
101
|
+
left: number;
|
|
102
|
+
top: number;
|
|
103
|
+
}, mode?: CodeMirror.CoordsMode) => CodeMirror.Position;
|
|
104
|
+
defaultTextHeight: () => number;
|
|
105
|
+
defaultCharWidth: () => number;
|
|
106
|
+
getViewport: () => {
|
|
107
|
+
from: number;
|
|
108
|
+
to: number;
|
|
109
|
+
};
|
|
110
|
+
refresh: () => void;
|
|
111
|
+
getModeAt: (pos: CodeMirror.Position) => CodeMirror.Mode<unknown>;
|
|
112
|
+
getTokenAt: (pos: CodeMirror.Position, precise?: boolean) => CodeMirror.Token;
|
|
113
|
+
getTokenTypeAt: (pos: CodeMirror.Position) => string;
|
|
114
|
+
getLineTokens: (line: number, precise?: boolean) => CodeMirror.Token[];
|
|
115
|
+
getStateAfter: (line?: number) => any;
|
|
116
|
+
operation: <T>(fn: () => T) => T;
|
|
117
|
+
startOperation: () => void;
|
|
118
|
+
endOperation: () => void;
|
|
119
|
+
indentLine: (line: number, dir?: string | null, aggresive?: boolean) => void;
|
|
120
|
+
indentSelection: (how: string) => void;
|
|
121
|
+
isReadOnly: () => boolean;
|
|
122
|
+
toggleOverwrite: (value?: boolean) => void;
|
|
123
|
+
execCommand: (name: string) => void;
|
|
124
|
+
focus: {
|
|
125
|
+
(): void;
|
|
126
|
+
(): void;
|
|
127
|
+
};
|
|
128
|
+
phrase: (text: string) => unknown;
|
|
129
|
+
getInputField: () => HTMLTextAreaElement;
|
|
130
|
+
getWrapperElement: {
|
|
131
|
+
(): HTMLElement;
|
|
132
|
+
(): HTMLElement;
|
|
133
|
+
};
|
|
134
|
+
getScrollerElement: () => HTMLElement;
|
|
135
|
+
getGutterElement: () => HTMLElement;
|
|
136
|
+
on: {
|
|
137
|
+
<T extends keyof CodeMirror.EditorEventMap>(eventName: T, handler: CodeMirror.EditorEventMap[T]): void;
|
|
138
|
+
<K extends CodeMirror.DOMEvent & keyof GlobalEventHandlersEventMap>(eventName: K, handler: (instance: CodeMirror.Editor, event: GlobalEventHandlersEventMap[K]) => void): void;
|
|
139
|
+
(event: string, handler: (...args: unknown[]) => void): void;
|
|
140
|
+
};
|
|
141
|
+
off: {
|
|
142
|
+
<T extends keyof CodeMirror.EditorEventMap>(eventName: T, handler: CodeMirror.EditorEventMap[T]): void;
|
|
143
|
+
<K extends CodeMirror.DOMEvent & keyof GlobalEventHandlersEventMap>(eventName: K, handler: (instance: CodeMirror.Editor, event: GlobalEventHandlersEventMap[K]) => void): void;
|
|
144
|
+
(event: string, handler: (...args: unknown[]) => void): void;
|
|
145
|
+
};
|
|
146
|
+
state: any;
|
|
147
|
+
setSelection: (from: CodeMirror.Position, to: CodeMirror.Position) => void;
|
|
148
|
+
modeOption: string | {
|
|
149
|
+
highlightNonStandardPropertyKeywords?: boolean | undefined | undefined;
|
|
150
|
+
version?: 2 | 3 | undefined | undefined;
|
|
151
|
+
singleLineStringErrors?: boolean | undefined | undefined;
|
|
152
|
+
hangingIndent?: number | undefined | undefined;
|
|
153
|
+
singleOperators?: unknown | undefined;
|
|
154
|
+
singleDelimiters?: unknown | undefined;
|
|
155
|
+
doubleOperators?: unknown | undefined;
|
|
156
|
+
doubleDelimiters?: unknown | undefined;
|
|
157
|
+
tripleDelimiters?: unknown | undefined;
|
|
158
|
+
identifiers?: unknown | undefined;
|
|
159
|
+
extra_keywords?: string[] | undefined | undefined;
|
|
160
|
+
extra_builtins?: string[] | undefined | undefined;
|
|
161
|
+
useCPP?: boolean | undefined | undefined;
|
|
162
|
+
base?: string | undefined | undefined;
|
|
163
|
+
tags?: {
|
|
164
|
+
[key: string]: unknown;
|
|
165
|
+
} | undefined | undefined;
|
|
166
|
+
json?: boolean | undefined | undefined;
|
|
167
|
+
jsonld?: boolean | undefined | undefined;
|
|
168
|
+
typescript?: boolean | undefined | undefined;
|
|
169
|
+
trackScope?: boolean | undefined | undefined;
|
|
170
|
+
statementIndent?: boolean | undefined | undefined;
|
|
171
|
+
wordCharacters?: unknown | undefined;
|
|
172
|
+
highlightFormatting?: boolean | undefined | undefined;
|
|
173
|
+
maxBlockquoteDepth?: boolean | undefined | undefined;
|
|
174
|
+
xml?: boolean | undefined | undefined;
|
|
175
|
+
fencedCodeBlockHighlighting?: boolean | undefined | undefined;
|
|
176
|
+
fencedCodeBlockDefaultMode?: string | undefined | undefined;
|
|
177
|
+
tokenTypeOverrides?: unknown | undefined;
|
|
178
|
+
allowAtxHeaderWithoutSpace?: boolean | undefined | undefined;
|
|
179
|
+
gitHubSpice?: boolean | undefined | undefined;
|
|
180
|
+
taskLists?: boolean | undefined | undefined;
|
|
181
|
+
strikethrough?: boolean | undefined | undefined;
|
|
182
|
+
emoji?: boolean | undefined | undefined;
|
|
183
|
+
leftDelimiter?: string | undefined | undefined;
|
|
184
|
+
rightDelimiter?: string | undefined | undefined;
|
|
185
|
+
baseMode?: string | undefined | undefined;
|
|
186
|
+
inMathMode?: boolean | undefined | undefined;
|
|
187
|
+
noIndentKeywords?: unknown | undefined;
|
|
188
|
+
atoms?: unknown | undefined;
|
|
189
|
+
hooks?: unknown | undefined;
|
|
190
|
+
multiLineStrings?: boolean | undefined | undefined;
|
|
191
|
+
htmlMode?: boolean | undefined | undefined;
|
|
192
|
+
matchClosing?: boolean | undefined | undefined;
|
|
193
|
+
alignCDATA?: boolean | undefined | undefined;
|
|
194
|
+
name: string;
|
|
195
|
+
};
|
|
196
|
+
getRange: (from: CodeMirror.Position, to: CodeMirror.Position, seperator?: string) => string;
|
|
197
|
+
replaceRange: (replacement: string | string[], from: CodeMirror.Position, to?: CodeMirror.Position, origin?: string) => void;
|
|
198
|
+
getLine: (n: number) => string;
|
|
199
|
+
setLine: (n: number, text: string) => void;
|
|
200
|
+
removeLine: (n: number) => void;
|
|
201
|
+
lineCount: () => number;
|
|
202
|
+
firstLine: () => number;
|
|
203
|
+
lastLine: () => number;
|
|
204
|
+
getLineHandle: (num: number) => CodeMirror.LineHandle;
|
|
205
|
+
getLineNumber: (handle: CodeMirror.LineHandle) => number | null;
|
|
206
|
+
eachLine: {
|
|
207
|
+
(f: (line: CodeMirror.LineHandle) => void): void;
|
|
208
|
+
(start: number, end: number, f: (line: CodeMirror.LineHandle) => void): void;
|
|
209
|
+
};
|
|
210
|
+
markClean: () => void;
|
|
211
|
+
changeGeneration: (closeEvent?: boolean) => number;
|
|
212
|
+
isClean: (generation?: number) => boolean;
|
|
213
|
+
getSelection: () => string;
|
|
214
|
+
getSelections: (lineSep?: string) => string[];
|
|
215
|
+
replaceSelection: (replacement: string, collapse?: string | null, origin?: string | null) => void;
|
|
216
|
+
replaceSelections: (replacements: string[], collapse?: string | null, origin?: string | null) => void;
|
|
217
|
+
listSelections: () => CodeMirror.Range[];
|
|
218
|
+
somethingSelected: () => boolean;
|
|
219
|
+
setSelections: (ranges: Array<{
|
|
220
|
+
anchor: CodeMirror.Position;
|
|
221
|
+
head: CodeMirror.Position;
|
|
222
|
+
}>, primary?: number, options?: CodeMirror.SelectionOptions) => void;
|
|
223
|
+
addSelection: (anchor: CodeMirror.Position, head?: CodeMirror.Position) => void;
|
|
224
|
+
extendSelection: (from: CodeMirror.Position, to?: CodeMirror.Position, options?: CodeMirror.SelectionOptions) => void;
|
|
225
|
+
extendSelections: (heads: CodeMirror.Position[], options?: CodeMirror.SelectionOptions) => void;
|
|
226
|
+
extendSelectionsBy: (f: (range: CodeMirror.Range) => CodeMirror.Position) => void;
|
|
227
|
+
setExtending: (value: boolean) => void;
|
|
228
|
+
getExtending: () => boolean;
|
|
229
|
+
linkedDoc: (options: {
|
|
230
|
+
sharedHist?: boolean | undefined;
|
|
231
|
+
from?: number | undefined;
|
|
232
|
+
to?: number | undefined;
|
|
233
|
+
mode?: string | CodeMirror.ModeSpec<CodeMirror.ModeSpecOptions> | undefined;
|
|
234
|
+
}) => CodeMirror.Doc;
|
|
235
|
+
unlinkDoc: (doc: CodeMirror.Doc) => void;
|
|
236
|
+
iterLinkedDocs: (fn: (doc: CodeMirror.Doc, sharedHist: boolean) => void) => void;
|
|
237
|
+
undo: () => void;
|
|
238
|
+
redo: () => void;
|
|
239
|
+
undoSelection: () => void;
|
|
240
|
+
redoSelection: () => void;
|
|
241
|
+
historySize: () => {
|
|
242
|
+
undo: number;
|
|
243
|
+
redo: number;
|
|
244
|
+
};
|
|
245
|
+
clearHistory: () => void;
|
|
246
|
+
getHistory: () => any;
|
|
247
|
+
setHistory: (history: any) => void;
|
|
248
|
+
markText: (from: CodeMirror.Position, to: CodeMirror.Position, options?: CodeMirror.TextMarkerOptions) => CodeMirror.TextMarker<CodeMirror.MarkerRange>;
|
|
249
|
+
setBookmark: (pos: CodeMirror.Position, options?: {
|
|
250
|
+
widget?: HTMLElement | undefined;
|
|
251
|
+
insertLeft?: boolean | undefined;
|
|
252
|
+
shared?: boolean | undefined;
|
|
253
|
+
handleMouseEvents?: boolean | undefined;
|
|
254
|
+
}) => CodeMirror.TextMarker<CodeMirror.Position>;
|
|
255
|
+
findMarks: (from: CodeMirror.Position, to: CodeMirror.Position) => CodeMirror.TextMarker[];
|
|
256
|
+
findMarksAt: (pos: CodeMirror.Position) => CodeMirror.TextMarker[];
|
|
257
|
+
getAllMarks: () => CodeMirror.TextMarker[];
|
|
258
|
+
removeLineWidget: (widget: CodeMirror.LineWidget) => void;
|
|
259
|
+
getMode: () => CodeMirror.Mode<unknown>;
|
|
260
|
+
lineSeparator: () => string;
|
|
261
|
+
posFromIndex: (index: number) => CodeMirror.Position;
|
|
262
|
+
indexFromPos: (object: CodeMirror.Position) => number;
|
|
263
|
+
};
|
|
264
|
+
cleanup: () => void;
|
|
265
|
+
toTextArea: () => void;
|
|
266
|
+
isPreviewActive: () => boolean;
|
|
267
|
+
isSideBySideActive: () => boolean;
|
|
268
|
+
isFullscreenActive: () => boolean;
|
|
269
|
+
clearAutosavedValue: () => void;
|
|
270
|
+
updateStatusBar: (itemName: string, content: string) => void;
|
|
271
|
+
} | null;
|
|
272
|
+
focus: () => void | undefined;
|
|
273
|
+
blur: () => void;
|
|
274
|
+
getValue: () => string;
|
|
275
|
+
setValue: (value: string) => void;
|
|
276
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
277
|
+
"update:modelValue": (...args: unknown[]) => any;
|
|
278
|
+
change: (value: string) => any;
|
|
279
|
+
blur: () => any;
|
|
280
|
+
focus: () => any;
|
|
281
|
+
upload: (file: File, onSuccess: (url: string) => void, onError: (message: string) => void) => any;
|
|
282
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
283
|
+
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
284
|
+
onChange?: ((value: string) => any) | undefined;
|
|
285
|
+
onBlur?: (() => any) | undefined;
|
|
286
|
+
onFocus?: (() => any) | undefined;
|
|
287
|
+
onUpload?: ((file: File, onSuccess: (url: string) => void, onError: (message: string) => void) => any) | undefined;
|
|
288
|
+
}>, {
|
|
289
|
+
disabled: boolean;
|
|
290
|
+
placeholder: string;
|
|
291
|
+
minHeight: string;
|
|
292
|
+
maxHeight: string;
|
|
293
|
+
autofocus: boolean;
|
|
294
|
+
spellcheck: boolean;
|
|
295
|
+
toolbarButtons: ToolbarButtonName[][];
|
|
296
|
+
canAttachFiles: boolean;
|
|
297
|
+
debounceMs: number;
|
|
298
|
+
translations: import('..').MarkdownEditorTranslations;
|
|
299
|
+
direction: "ltr" | "rtl";
|
|
300
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
301
|
+
containerRef: HTMLDivElement;
|
|
302
|
+
editorRef: HTMLTextAreaElement;
|
|
303
|
+
}, HTMLDivElement>;
|
|
304
|
+
export default _default;
|
package/dist/index.d.ts
ADDED