mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
style: 删除无用代码
This commit is contained in:
parent
6f0d9f9484
commit
5efc17db3f
@ -1,19 +1,25 @@
|
||||
<template>
|
||||
<el-drawer :close-on-click-modal="false" v-model="open" size="40%">
|
||||
<el-drawer :close-on-click-modal="false" v-model="open" size="30%">
|
||||
<template #header>
|
||||
<Header :header="$t('commons.msg.operate')" :resource="resourceName" :back="handleClose"></Header>
|
||||
<Header :header="$t('app.update')" :resource="resourceName" :back="handleClose"></Header>
|
||||
</template>
|
||||
<div style="text-align: center" v-loading="loading">
|
||||
<p>{{ $t('app.versioneSelect') }}</p>
|
||||
<el-select v-model="operateReq.detailId">
|
||||
<el-option
|
||||
v-for="(version, index) in versions"
|
||||
:key="index"
|
||||
:value="version.detailId"
|
||||
:label="version.version"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1">
|
||||
<div v-loading="loading">
|
||||
<p>{{ $t('app.versioneSelect') }}</p>
|
||||
<el-select v-model="operateReq.detailId">
|
||||
<el-option
|
||||
v-for="(version, index) in versions"
|
||||
:key="index"
|
||||
:value="version.detailId"
|
||||
:label="version.version"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose" :disabled="loading">{{ $t('commons.button.cancel') }}</el-button>
|
||||
|
15
node_modules/.package-lock.json
generated
vendored
15
node_modules/.package-lock.json
generated
vendored
@ -1,15 +0,0 @@
|
||||
{
|
||||
"name": "1Panel",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/md-editor-v3": {
|
||||
"version": "2.7.2",
|
||||
"resolved": "https://registry.npmjs.org/md-editor-v3/-/md-editor-v3-2.7.2.tgz",
|
||||
"integrity": "sha512-CyLG7yZhMyKplXO/MYIccpL0AOcnys74cMpbBG77rmXWlANAmzLrznUU++g6MohTv3DCRNTz+5Uh/w9h9P2sSA==",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
21
node_modules/md-editor-v3/LICENSE
generated
vendored
21
node_modules/md-editor-v3/LICENSE
generated
vendored
@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 imzbf.cc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
779
node_modules/md-editor-v3/README.md
generated
vendored
779
node_modules/md-editor-v3/README.md
generated
vendored
@ -1,779 +0,0 @@
|
||||
# 🎄 md-editor-v3
|
||||
|
||||
![](https://img.shields.io/github/package-json/v/imzbf/md-editor-v3) ![](https://img.shields.io/npm/dm/md-editor-v3) ![](https://img.shields.io/bundlephobia/min/md-editor-v3) ![](https://img.shields.io/github/license/imzbf/md-editor-v3) ![](https://img.shields.io/badge/ssr-%3E1.6.0-brightgreen)
|
||||
|
||||
English \| [中文](https://github.com/imzbf/md-editor-v3/blob/develop/README-CN.md)
|
||||
|
||||
Markdown editor for vue3, developed in `jsx` and `typescript`.
|
||||
|
||||
- Documentation and example: [Go](https://imzbf.github.io/md-editor-v3)
|
||||
|
||||
- Use it online: [Go](https://codesandbox.io/s/epic-bird-2znqo)
|
||||
|
||||
- The same series editor for react: [md-editor-rt](https://github.com/imzbf/md-editor-rt)
|
||||
|
||||
## ⭐️ Features
|
||||
|
||||
- Toolbar, screenfull or screenfull in web pages and so on.
|
||||
- Themes, Built-in default and dark themes.
|
||||
- Shortcut key for editor.
|
||||
- Beautify your content by `prettier`(only for markdown content, not the code and other text).
|
||||
- Multi-language, build-in Chinese and English(default: Chinese).
|
||||
- Upload picture, paste or clip the picture and upload it.
|
||||
- Render article directly(no editor, no event listener, only preview of content).
|
||||
- Theme of preview, `defalut`, `vuepress`, `github`, `cyanosis`, `mk-cute`, `smart-blue` styles(not identical). It can be customized also(Refer to example page).
|
||||
- `mermaid`(>=1.8.0), `katex` mathematical formula(>=1.9.0).
|
||||
- Customize the toolbar as you like.
|
||||
|
||||
## 📦 Install
|
||||
|
||||
```shell
|
||||
yarn add md-editor-v3
|
||||
```
|
||||
|
||||
Please install `@types/marked` in your typescript project if you want to configure `renderer`:
|
||||
|
||||
```shell
|
||||
yarn add @types/marked -D
|
||||
```
|
||||
|
||||
Install existing extension of language and theme of preview:
|
||||
|
||||
```shell
|
||||
yarn add @vavt/md-editor-extension
|
||||
```
|
||||
|
||||
For more ways to use or contribute, please refer to: [md-editor-extension](https://github.com/imzbf/md-editor-extension)
|
||||
|
||||
## 💡 Usage
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<md-editor v-model="text" preview-only />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import MdEditor from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
|
||||
const text = ref('# Hello Editor');
|
||||
</script>
|
||||
```
|
||||
|
||||
## 🗺 Preview
|
||||
|
||||
| Default theme | Dark theme | Preview only |
|
||||
| --- | --- | --- |
|
||||
| ![](https://imzbf.github.io/md-editor-v3/imgs/preview-light.png) | ![](https://imzbf.github.io/md-editor-v3/imgs/preview-dark.png) | ![](https://imzbf.github.io/md-editor-v3/imgs/preview-previewOnly.png) |
|
||||
|
||||
mark and emoji extensions
|
||||
|
||||
![mark and emoji extension](https://imzbf.github.io/md-editor-v3/imgs/mark_emoji.gif)
|
||||
|
||||
## 🎁 Apis
|
||||
|
||||
### 🔩 Props
|
||||
|
||||
| name | type | default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| modelValue | `string` | '' | Markdown content, use `v-model` in vue template |
|
||||
| theme | `'light' \| 'dark'` | 'light' | Editor theme |
|
||||
| class | `string` | '' | |
|
||||
| historyLength | `number` | 10 | The max length of history(if it is too big, editor will use more `RAM`) |
|
||||
| pageFullscreen | `boolean` | false | Screenfull in web page |
|
||||
| preview | `boolean` | true | Preview content in editor |
|
||||
| htmlPreview | `boolean` | false | Preview html in editor |
|
||||
| previewOnly | `boolean` | false | Only render preview of content, no toolbar, no editing area |
|
||||
| language | `string` | 'zh-CN' | Build-in language('zh-CN','en-US') |
|
||||
| toolbars | `Array<ToolbarNames \| number>` | [toolbars] | Show contents of toolbar, all keys<sup>see `toolbars` below</sup> |
|
||||
| toolbarsExclude | `Array<ToolbarNames \| number>` | [] | Don't show contents of toolbar, all keys`toolbars` |
|
||||
| noPrettier | `boolean` | false | Use prettier to beautify content or not |
|
||||
| editorId | `string` | 'md-editor-v3' | Editor's id, it is used when there are more than two editors in the same page |
|
||||
| tabWidth | `number` | 2 | One tab eq some spaces |
|
||||
| showCodeRowNumber | `boolean` | false | Show row number for code block or not |
|
||||
| previewTheme | `'default' \| 'github' \| 'vuepress' \| 'mk-cute' \| 'smart-blue' \| 'cyanosis'` | 'default' | Theme of preview, can be customized |
|
||||
| style | `string \| CSSProperties` | {} | Inline style |
|
||||
| tableShape | `[number, number]` | [6, 4] | Preset the size of the table, [columns, rows] |
|
||||
| noMermaid | `boolean` | false | Use mermaid or not |
|
||||
| placeholder | `string` | '' | |
|
||||
| noKatex | `boolean` | false | Use katex or not |
|
||||
| codeTheme | `'atom' \| 'a11y' \| 'github' \| 'gradient' \| 'kimbie' \| 'paraiso' \| 'qtcreator' \| 'stackoverflow'` | 'atom' | Highlight code style, can be customized also |
|
||||
| markedHeadingId | `(text: string, level: number, index: number) => string` | (text) => text | H1-H6 `ID` generator |
|
||||
| sanitize | `(html: string) => string` | (html) => html | Sanitize the html, prevent XSS |
|
||||
| footers | `Array<'markdownTotal' \| '=' \| 'scrollSwitch' \| number>` | ['markdownTotal', '=', 'scrollSwitch'] | Show contents of footer, they are divided by `'='`. Set it to `[]` to hidden footer |
|
||||
| scrollAuto | `boolean` | true | Scroll default setting |
|
||||
| noIconfont | `boolean` | false | Not append iconfont script, [download](https://at.alicdn.com/t/c/font_2605852_gymddm8qwtd.js) and import it by yourself |
|
||||
| formatCopiedText | `(text: string) => string` | (text: string) => text | Format copied code |
|
||||
| noUploadImg | `boolean` | false | Not show the entrance to upload pictures |
|
||||
| codeStyleReverse | `boolean` | true | Code style will be reversed to dark while code block of the theme has a dark background |
|
||||
| codeStyleReverseList | `Array<string>` | ['default', 'mk-cute'] | Themes to be reversed |
|
||||
| autoFocus | `boolean` | false | same as `autofocus` in native textarea |
|
||||
| disabled | `boolean` | false | same as `disabled` in native textarea |
|
||||
| readOnly | `boolean` | false | same as `readonly` in native textarea |
|
||||
| maxLength | `number` | | same as `maxlength` in native textarea |
|
||||
| autoDetectCode | `boolean` | false | auto detect the type of pasted code, only support that copied from `vscode` |
|
||||
|
||||
<details>
|
||||
<summary>『toolbars』</summary>
|
||||
|
||||
```js
|
||||
[
|
||||
'bold',
|
||||
'underline',
|
||||
'italic',
|
||||
'-',
|
||||
'strikeThrough',
|
||||
'title',
|
||||
'sub',
|
||||
'sup',
|
||||
'quote',
|
||||
'unorderedList',
|
||||
'orderedList',
|
||||
'task', // ^2.4.0
|
||||
'-',
|
||||
'codeRow',
|
||||
'code',
|
||||
'link',
|
||||
'image',
|
||||
'table',
|
||||
'mermaid',
|
||||
'katex',
|
||||
'-',
|
||||
'revoke',
|
||||
'next',
|
||||
'save',
|
||||
'=',
|
||||
'pageFullscreen',
|
||||
'fullscreen',
|
||||
'preview',
|
||||
'htmlPreview',
|
||||
'catalog',
|
||||
'github'
|
||||
];
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
> After v1.6.0, You can sort the toolbar as you like, split tools by `'-'`, the left and right toolbars are divided by `'='`!
|
||||
|
||||
> After v1.10.0, you can customize the toolbar. To display them, put index of `defToolbars` into `toolbars`(this is not standard), for more usage, please refer to [docs](https://imzbf.github.io/md-editor-v3/docs).
|
||||
|
||||
<details>
|
||||
<summary>『StaticTextDefaultValue』</summary>
|
||||
|
||||
Expand language, you need to replace all the content here:
|
||||
|
||||
```ts
|
||||
export interface ToolbarTips {
|
||||
bold?: string;
|
||||
underline?: string;
|
||||
italic?: string;
|
||||
strikeThrough?: string;
|
||||
title?: string;
|
||||
sub?: string;
|
||||
sup?: string;
|
||||
quote?: string;
|
||||
unorderedList?: string;
|
||||
orderedList?: string;
|
||||
task?: string; // ^2.4.0
|
||||
codeRow?: string;
|
||||
code?: string;
|
||||
link?: string;
|
||||
image?: string;
|
||||
table?: string;
|
||||
mermaid?: string;
|
||||
katex?: string;
|
||||
revoke?: string;
|
||||
next?: string;
|
||||
save?: string;
|
||||
prettier?: string;
|
||||
pageFullscreen?: string;
|
||||
fullscreen?: string;
|
||||
catalog?: string;
|
||||
preview?: string;
|
||||
htmlPreview?: string;
|
||||
github?: string;
|
||||
'-'?: string;
|
||||
'='?: string;
|
||||
}
|
||||
|
||||
export interface StaticTextDefaultValue {
|
||||
// Toolbar hover tips(html title)
|
||||
toolbarTips?: ToolbarTips;
|
||||
// H1-H6 dropdown menu item
|
||||
titleItem?: {
|
||||
h1?: string;
|
||||
h2?: string;
|
||||
h3?: string;
|
||||
h4?: string;
|
||||
h5?: string;
|
||||
h6?: string;
|
||||
};
|
||||
imgTitleItem?: {
|
||||
link: string;
|
||||
upload: string;
|
||||
clip2upload: string;
|
||||
};
|
||||
// The modal tips of add link or upload picture
|
||||
linkModalTips?: {
|
||||
linkTitle?: string;
|
||||
imageTitle?: string;
|
||||
descLabel?: string;
|
||||
descLabelPlaceHolder?: string;
|
||||
urlLabel?: string;
|
||||
urlLabelPlaceHolder?: string;
|
||||
buttonOK?: string;
|
||||
};
|
||||
// The modal tips of clip the picture, v1.2.0
|
||||
clipModalTips?: {
|
||||
title?: string;
|
||||
buttonUpload?: string;
|
||||
};
|
||||
copyCode?: {
|
||||
text?: string;
|
||||
successTips?: string;
|
||||
failTips?: string;
|
||||
};
|
||||
mermaid?: {
|
||||
flow?: string;
|
||||
sequence?: string;
|
||||
gantt?: string;
|
||||
class?: string;
|
||||
state?: string;
|
||||
pie?: string;
|
||||
relationship?: string;
|
||||
journey?: string;
|
||||
};
|
||||
katex?: {
|
||||
// formula inline
|
||||
inline: string;
|
||||
// formula block
|
||||
block: string;
|
||||
};
|
||||
footer?: {
|
||||
markdownTotal: string;
|
||||
scrollAuto: string;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## 🤱🏼 Expose
|
||||
|
||||
After 2.5.0, Editor exposes several methods on the instance, used to get or change the internal status of the editor.
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<md-editor ref="editorRef" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import MdEditor from 'md-editor-v3';
|
||||
import type { ExposeParam } from 'md-editor-v3';
|
||||
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
|
||||
const editorRef = ref<ExposeParam>();
|
||||
|
||||
onMounted(() => {
|
||||
editorRef.value?.on('catalog', console.log);
|
||||
|
||||
editorRef.value?.toggleCatalog(true);
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
> Switched to the opposite status, if toggle without input parameter.
|
||||
|
||||
### 👂🏼 on
|
||||
|
||||
Get the internal state of the editor, including pageFullscreen, fullscreen, preview, htmlPreview, catalog, etc.
|
||||
|
||||
- pageFullscreen
|
||||
|
||||
```js
|
||||
editorRef.value?.on('pageFullscreen', (status) => console.log(status));
|
||||
```
|
||||
|
||||
- fullscreen
|
||||
|
||||
```js
|
||||
editorRef.value?.on('fullscreen', (status) => console.log(status));
|
||||
```
|
||||
|
||||
- preview
|
||||
|
||||
```js
|
||||
editorRef.value?.on('preview', (status) => console.log(status));
|
||||
```
|
||||
|
||||
- htmlPreview
|
||||
|
||||
```js
|
||||
editorRef.value?.on('htmlPreview', (status) => console.log(status));
|
||||
```
|
||||
|
||||
- catalog
|
||||
|
||||
```js
|
||||
editorRef.value?.on('catalog', (status) => console.log(status));
|
||||
```
|
||||
|
||||
### 💻 togglePageFullscreen
|
||||
|
||||
Toggle status of fullscreen within the page.
|
||||
|
||||
```js
|
||||
editorRef.value?.togglePageFullscreen(true);
|
||||
```
|
||||
|
||||
### 🖥 toggleFullscreen
|
||||
|
||||
Toggle status of fullscreen widthin browser.
|
||||
|
||||
```js
|
||||
editorRef.value?.toggleFullscreen(true);
|
||||
```
|
||||
|
||||
### 📖 togglePreview
|
||||
|
||||
Toggle status of preview.
|
||||
|
||||
```js
|
||||
editorRef.value?.togglePreview(true);
|
||||
```
|
||||
|
||||
### 📼 toggleHtmlPreview
|
||||
|
||||
Toggle status of htmlPreview.
|
||||
|
||||
```js
|
||||
editorRef.value?.toggleHtmlPreview(true);
|
||||
```
|
||||
|
||||
### 🧬 toggleCatalog
|
||||
|
||||
Toggle status of catalog.
|
||||
|
||||
```js
|
||||
editorRef.value?.toggleCatalog(true);
|
||||
```
|
||||
|
||||
### 💾 triggerSave
|
||||
|
||||
```js
|
||||
editorRef.value?.triggerSave();
|
||||
```
|
||||
|
||||
### 💉 insert
|
||||
|
||||
Manually insert content into textarea.
|
||||
|
||||
```js
|
||||
/**
|
||||
* @params selectedText
|
||||
*/
|
||||
editorRef.value?.insert((selectedText) => {
|
||||
/**
|
||||
* @return targetValue Content to be inserted
|
||||
* @return select Automatically select content
|
||||
* @return deviationStart Start position of the selected content
|
||||
* @return deviationEnd End position of the selected content
|
||||
*/
|
||||
return {
|
||||
targetValue: `${selectedText}`,
|
||||
select: true,
|
||||
deviationStart: 0,
|
||||
deviationEnd: 0
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
For more examples, refer to source code of [extension component](https://github.com/imzbf/md-editor-v3/blob/dev-docs/src/components/MarkExtension/index.vue)
|
||||
|
||||
### 🎯 focus
|
||||
|
||||
focus the textarea.
|
||||
|
||||
```js
|
||||
editorRef.value?.focus();
|
||||
```
|
||||
|
||||
### 🎍 Slots
|
||||
|
||||
| name | type | default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| defToolbars | `Array<DropdownToolbar \| NormalToolbar \| ModalToolbar>` | null | Custom toolbar in `DropdownToolbar`, `NormalToolbar` or `ModalToolbar` |
|
||||
| defFooters | `Array<string \| VNode \| JSX.Element>` | null | Custom footer |
|
||||
|
||||
`NormalToolbar` example:
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<md-editor>
|
||||
<template #defToolbars>
|
||||
<normal-toolbar title="mark" @onClick="handler">
|
||||
<template #trigger>
|
||||
<svg class="md-editor-icon" aria-hidden="true">
|
||||
<use xlink:href="#md-editor-icon-mark"></use>
|
||||
</svg>
|
||||
</template>
|
||||
</normal-toolbar>
|
||||
</template>
|
||||
</md-editor>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import MdEditor from 'md-editor-v3';
|
||||
|
||||
const NormalToolbar = MdEditor.NormalToolbar;
|
||||
|
||||
const handler = () => {
|
||||
console.log('NormalToolbar clicked!');
|
||||
};
|
||||
</script>
|
||||
```
|
||||
|
||||
### 🪢 Events
|
||||
|
||||
| name | param | description |
|
||||
| --- | --- | --- |
|
||||
| onChange | `value: string` | Content changed event(bind to `oninput` of `textarea`) |
|
||||
| onSave | `value: string, html: Promise<string>` | Save content event, `ctrl+s`and click button will be triggered also |
|
||||
| onUploadImg | `files: Array<File>, callback: (urls: Array<string>) => void` | Upload picture event, when picture is uploading the modal will not close, please provide right urls to the callback function |
|
||||
| onHtmlChanged | `html: string` | Compile markdown successful event, you can use it to get the html code |
|
||||
| onGetCatalog | `list: Array<HeadList>` | Get catalog of article |
|
||||
| onError | `err: { name: string; message: string }` | Catch run-time error, `Cropper`, `fullscreen` and `prettier` are used when they are not loaded |
|
||||
|
||||
## 💴 Config Editor
|
||||
|
||||
Use `MdEditor.config(option: ConfigOption)` to reconfigure `renderer`.
|
||||
|
||||
- markedRenderer: `(renderer: RewriteRenderer) => RewriteRenderer`
|
||||
|
||||
Open target page in a new browser window:
|
||||
|
||||
```js
|
||||
MdEditor.config({
|
||||
markedRenderer(renderer) {
|
||||
renderer.link = (href, title, text) => {
|
||||
return `<a href="${href}" title="${title}" target="_blank">${text}</a>`;
|
||||
};
|
||||
|
||||
return renderer;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
> Reference: https://marked.js.org/using_pro#renderer, RewriteRenderer extends Renderer and rewrites heading, now provides index as the fifth parameter.
|
||||
|
||||
- markedExtensions: `Array<marked.TokenizerExtension & marked.RendererExtension>`
|
||||
|
||||
```js
|
||||
import MdEditor from 'md-editor-v3';
|
||||
|
||||
MdEditor.config({
|
||||
markedExtensions: [your extension]
|
||||
});
|
||||
```
|
||||
|
||||
> Reference: https://marked.js.org/using_pro#extensions
|
||||
|
||||
- markedOptions: `marked.MarkedOptions`
|
||||
|
||||
Do not render `<br>` on a single line break:
|
||||
|
||||
```js
|
||||
import MdEditor from 'md-editor-v3';
|
||||
|
||||
MdEditor.config({
|
||||
markedOptions: { breaks: false }
|
||||
});
|
||||
```
|
||||
|
||||
> Reference: https://marked.js.org/using_advanced#options
|
||||
|
||||
- editorConfig: Add more languages, reset `mermaid` template or delay rendering time:
|
||||
|
||||
```js
|
||||
import MdEditor from 'md-editor-v3';
|
||||
|
||||
MdEditor.config({
|
||||
editorConfig: {
|
||||
languageUserDefined: { lang: StaticTextDefaultValue },
|
||||
mermaidTemplate: {
|
||||
flow: `flow tempalte`,
|
||||
...more
|
||||
},
|
||||
// Default 500ms. It is set to 0ms when preview only and not set.
|
||||
renderDelay: 500
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
- editorExtensions: Config some dependency libraries, like highlight..
|
||||
|
||||
```typescript
|
||||
import MdEditor from 'md-editor-v3';
|
||||
|
||||
MdEditor.config({
|
||||
editorExtensions: { iconfont: 'https://xxx.cc' }
|
||||
});
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>『EditorExtensions』</summary>
|
||||
|
||||
```ts
|
||||
import MdEditor from 'md-editor-v3';
|
||||
|
||||
interface EditorExtensions {
|
||||
highlight?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
css?: {
|
||||
[key: string]: {
|
||||
light: string;
|
||||
dark: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
prettier?: {
|
||||
standaloneJs?: string;
|
||||
parserMarkdownJs?: string;
|
||||
};
|
||||
cropper?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
css?: string;
|
||||
};
|
||||
iconfont?: string;
|
||||
screenfull?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
};
|
||||
mermaid?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
};
|
||||
katex?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
css?: string;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## 🪡 Shortcut Key
|
||||
|
||||
_Pay attention: shortcut keys are only available when the textarea is focused!_
|
||||
|
||||
| key | function | description |
|
||||
| --- | --- | --- |
|
||||
| TAB | insert space | Insert space, the length eq `tabWidth`, default: 2, support multiline |
|
||||
| SHIFT + TAB | delete space, setting is the same as Tab | |
|
||||
| CTRL + C | copy | When selected, copy the selected content. When not selected, copy the content of the current line |
|
||||
| CTRL + X | shear | When selected, cut the selected content. When not selected, cut the current line |
|
||||
| CTRL + D | delete | When selected, delete the selected content. When not selected, delete the current line |
|
||||
| CTRL + S | save | Trigger `onSave` event |
|
||||
| CTRL + B | bold text | `**bold**` |
|
||||
| CTRL + U | underline | `<u>underline</u>` |
|
||||
| CTRL + I | italic | `*italic*` |
|
||||
| CTRL + 1-6 | h1-h6 | `# title` |
|
||||
| CTRL + ↑ | superscript | `<sup>superscript</sup>` |
|
||||
| CTRL + ↓ | subscript | `<sub>subscript</sub>` |
|
||||
| CTRL + Q | quote | `> quote` |
|
||||
| CTRL + O | ordered list | `1. ordered list` |
|
||||
| CTRL + L | link | `[link](https://github.com/imzbf/md-editor-v3)` |
|
||||
| CTRL + Z | withdraw | Withdraw history in editor, not the function of system |
|
||||
| CTRL + SHIFT + S | line-through | `~line-through~` |
|
||||
| CTRL + SHIFT + U | unordered list | `- unordered list` |
|
||||
| CTRL + SHIFT + C | code block | |
|
||||
| CTRL + SHIFT + I | picture | `![picture](https://imzbf.cc)` |
|
||||
| CTRL + SHIFT + Z | forward | Forward history in editor, not the function of system |
|
||||
| CTRL + SHIFT + F | Beautify | |
|
||||
| CTRL + ALT + C | code row | |
|
||||
| CTRL + SHIFT + ALT + T | table | `\|table\|` |
|
||||
|
||||
## 🪤 Components
|
||||
|
||||
They are used as attributes of the editor component, eg: `Editor.DropdownToolbar`. For more examples, refer to [document](https://imzbf.github.io/md-editor-v3).
|
||||
|
||||
### 🐣 NormalToolbar
|
||||
|
||||
`Editor.NormalToolbar`
|
||||
|
||||
- **props**
|
||||
|
||||
- `title`: `string`, not necessary, title of toolbar.
|
||||
|
||||
- **events**
|
||||
|
||||
- `onClick`: `(e: MouseEvent) => void`, necessary.
|
||||
|
||||
- **slots**
|
||||
|
||||
- `trigger`: `string | JSX.Element`, necessary, it is usually an icon, which is displayed on the toolbar.
|
||||
|
||||
### 🐼 DropdownToolbar
|
||||
|
||||
`Editor.DropdownToolbar`
|
||||
|
||||
- **props**
|
||||
|
||||
- `title`: `string`, not necessary, title of toolbar.
|
||||
- `visible`: `boolean`, necessary.
|
||||
|
||||
- **events**
|
||||
|
||||
- `onChange`: `(visible: boolean) => void`, necessary.
|
||||
|
||||
- **slots**
|
||||
|
||||
- `trigger`: `string | JSX.Element`, necessary, it is usually an icon, which is displayed on the toolbar.
|
||||
- `overlay`: `string | JSX.Element`, necessary, content of dropdown box.
|
||||
|
||||
### 🦉 ModalToolbar
|
||||
|
||||
`Editor.ModalToolbar`
|
||||
|
||||
- **props**
|
||||
|
||||
- `title`: `string`, not necessary, title of toolbar.
|
||||
- `modalTitle`: `string`, not necessary, title of the Modal.
|
||||
- `visible`: `boolean`, necessary, visibility of Modal.
|
||||
- `width`: `string`, not necessary, width of Modal, default `auto`.
|
||||
- `height`: `string`, same as `width`.
|
||||
- `showAdjust`: `boolean`, not necessary, visibility of fullscreen button.
|
||||
- `isFullscreen`: `boolean`, necessary when `showAdjust = true`, status of fullscreen.
|
||||
|
||||
- **events**
|
||||
|
||||
- `onClick`: `() => void`, necessary.
|
||||
- `onClose`: `() => void`, necessary, close event.
|
||||
- `onAdjust`: `(val: boolean) => void`, fullscreen button click event.
|
||||
|
||||
- **slots**
|
||||
|
||||
- `trigger`: `string | JSX.Element`, necessary, it is usually an icon, which is displayed on the toolbar.
|
||||
- `overlay`: `string | JSX.Element`, necessary, content of Modal.
|
||||
|
||||
### 🐻 MdCatalog
|
||||
|
||||
`Editor.MdCatalog`
|
||||
|
||||
- **props**
|
||||
|
||||
- `editorId`: `string`, necessary, same as editor's `editorId`, used to register listening events.
|
||||
- `class`: `string`, not necessary.
|
||||
- `markedHeadingId`: `MarkedHeadingId`, not necessary, same as editor.
|
||||
- `scrollElement`: `string | HTMLElement`, not necessary, it is an element selector when its type is string. When `previewOnly` eq `true`, it is usually set to `document.documentElement`.
|
||||
- `theme`: `'light' | 'dark'`, not necessary, provide it when you want to change theme online, it is the same as Editor `theme`.
|
||||
- `offsetTop`: `number`, not necessary, highlight current item of catalogs when title is `offsetTop` pixels from the top, defalut 20.
|
||||
- `scrollElementOffsetTop`: `number`, not necessary, offsetTop of the scroll container,defalut 0.
|
||||
|
||||
- **events**
|
||||
|
||||
- `onClick`: `(e: MouseEvent, t: TocItem) => void`, not necessary.
|
||||
|
||||
## 🗂 Examples
|
||||
|
||||
### 🎸 Jsx Template
|
||||
|
||||
```js
|
||||
import { defineComponent, reactive } from 'vue';
|
||||
import MdEditor from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const md = reactive({
|
||||
text: '# Hello Editor'
|
||||
});
|
||||
return () => (
|
||||
<MdEditor modelValue={md.text} onChange={(value) => (md.text = value)} />
|
||||
);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### 🥹 Upload Picture
|
||||
|
||||
> Tips: When you paste and upload GIF, it will upload a static picture. So you should upload it by file system!
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<md-editor v-model="text" @onUploadImg="onUploadImg" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import MdEditor from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
|
||||
const text = ref('# Hello Editor');
|
||||
|
||||
const onUploadImg = async (files, callback) => {
|
||||
const res = await Promise.all(
|
||||
files.map((file) => {
|
||||
return new Promise((rev, rej) => {
|
||||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
|
||||
axios
|
||||
.post('/api/img/upload', form, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
.then((res) => rev(res))
|
||||
.catch((error) => rej(error));
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
callback(res.map((item) => item.data.url));
|
||||
};
|
||||
</script>
|
||||
```
|
||||
|
||||
### 🧙♂️ Change Styles
|
||||
|
||||
```less
|
||||
.css-vars(@isDark) {
|
||||
--md-color: if(@isDark, #999, #222);
|
||||
--md-hover-color: if(@isDark, #bbb, #000);
|
||||
--md-bk-color: if(@isDark, #000, #fff);
|
||||
--md-bk-color-outstand: if(@isDark, #111, #f6f6f6);
|
||||
--md-bk-hover-color: if(@isDark, #1b1a1a, #f5f7fa);
|
||||
--md-border-color: if(@isDark, #2d2d2d, #e6e6e6);
|
||||
--md-border-hover-color: if(@isDark, #636262, #b9b9b9);
|
||||
--md-border-active-color: if(@isDark, #777, #999);
|
||||
--md-modal-mask: #00000073;
|
||||
--md-scrollbar-bg-color: if(@isDark, #0f0f0f, #e2e2e2);
|
||||
--md-scrollbar-thumb-color: if(@isDark, #2d2d2d, #0000004d);
|
||||
--md-scrollbar-thumb-hover-color: if(@isDark, #3a3a3a, #00000059);
|
||||
--md-scrollbar-thumb-avtive-color: if(@isDark, #3a3a3a, #00000061);
|
||||
}
|
||||
|
||||
.md-editor {
|
||||
.css-vars(false);
|
||||
}
|
||||
|
||||
.md-editor-dark {
|
||||
.css-vars(true);
|
||||
}
|
||||
```
|
||||
|
||||
Change background color in dark mode:
|
||||
|
||||
```css
|
||||
.md-editor-dark {
|
||||
--md-bk-color: #333 !important;
|
||||
}
|
||||
```
|
356
node_modules/md-editor-v3/lib/MdEditor/Editor.d.ts
generated
vendored
356
node_modules/md-editor-v3/lib/MdEditor/Editor.d.ts
generated
vendored
@ -1,356 +0,0 @@
|
||||
declare const Editor: import("vue").DefineComponent<{
|
||||
modelValue: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
theme: {
|
||||
type: import("vue").PropType<import("./type").Themes>;
|
||||
default: string;
|
||||
};
|
||||
class: {
|
||||
type: StringConstructor;
|
||||
default: string;
|
||||
};
|
||||
historyLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
onChange: {
|
||||
type: import("vue").PropType<import("./type").ChangeEvent>;
|
||||
};
|
||||
onSave: {
|
||||
type: import("vue").PropType<import("./type").SaveEvent>;
|
||||
};
|
||||
onUploadImg: {
|
||||
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
||||
};
|
||||
pageFullscreen: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
preview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
htmlPreview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
language: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
toolbars: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: string[];
|
||||
};
|
||||
toolbarsExclude: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: never[];
|
||||
};
|
||||
noPrettier: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onHtmlChanged: {
|
||||
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
||||
};
|
||||
onGetCatalog: {
|
||||
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
||||
};
|
||||
editorId: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
tabWidth: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
showCodeRowNumber: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
style: {
|
||||
type: import("vue").PropType<string | import("vue").CSSProperties>;
|
||||
default: () => {};
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: import("vue").PropType<import("./type").MarkedHeadingId>;
|
||||
default: import("./type").MarkedHeadingId;
|
||||
};
|
||||
tableShape: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => number[];
|
||||
};
|
||||
noMermaid: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
sanitize: {
|
||||
type: import("vue").PropType<(html: string) => string>;
|
||||
default: (html: string) => string;
|
||||
};
|
||||
placeholder: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
noKatex: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defToolbars: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
onError: {
|
||||
type: import("vue").PropType<import("./type").ErrorEvent>;
|
||||
};
|
||||
codeTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
footers: {
|
||||
type: import("vue").PropType<import("./type").Footers[]>;
|
||||
default: import("./type").Footers[];
|
||||
};
|
||||
scrollAuto: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defFooters: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
noIconfont: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
formatCopiedText: {
|
||||
type: import("vue").PropType<(text: string) => string>;
|
||||
default: (text: string) => string;
|
||||
};
|
||||
noUploadImg: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
codeStyleReverse: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
codeStyleReverseList: {
|
||||
type: import("vue").PropType<string[]>;
|
||||
default: string[];
|
||||
};
|
||||
autoFocus: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
disabled: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
readOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
maxLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
};
|
||||
autoDetectCode: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
modelValue: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
theme: {
|
||||
type: import("vue").PropType<import("./type").Themes>;
|
||||
default: string;
|
||||
};
|
||||
class: {
|
||||
type: StringConstructor;
|
||||
default: string;
|
||||
};
|
||||
historyLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
onChange: {
|
||||
type: import("vue").PropType<import("./type").ChangeEvent>;
|
||||
};
|
||||
onSave: {
|
||||
type: import("vue").PropType<import("./type").SaveEvent>;
|
||||
};
|
||||
onUploadImg: {
|
||||
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
||||
};
|
||||
pageFullscreen: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
preview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
htmlPreview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
language: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
toolbars: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: string[];
|
||||
};
|
||||
toolbarsExclude: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: never[];
|
||||
};
|
||||
noPrettier: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onHtmlChanged: {
|
||||
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
||||
};
|
||||
onGetCatalog: {
|
||||
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
||||
};
|
||||
editorId: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
tabWidth: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
showCodeRowNumber: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
style: {
|
||||
type: import("vue").PropType<string | import("vue").CSSProperties>;
|
||||
default: () => {};
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: import("vue").PropType<import("./type").MarkedHeadingId>;
|
||||
default: import("./type").MarkedHeadingId;
|
||||
};
|
||||
tableShape: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => number[];
|
||||
};
|
||||
noMermaid: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
sanitize: {
|
||||
type: import("vue").PropType<(html: string) => string>;
|
||||
default: (html: string) => string;
|
||||
};
|
||||
placeholder: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
noKatex: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defToolbars: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
onError: {
|
||||
type: import("vue").PropType<import("./type").ErrorEvent>;
|
||||
};
|
||||
codeTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
footers: {
|
||||
type: import("vue").PropType<import("./type").Footers[]>;
|
||||
default: import("./type").Footers[];
|
||||
};
|
||||
scrollAuto: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defFooters: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
noIconfont: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
formatCopiedText: {
|
||||
type: import("vue").PropType<(text: string) => string>;
|
||||
default: (text: string) => string;
|
||||
};
|
||||
noUploadImg: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
codeStyleReverse: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
codeStyleReverseList: {
|
||||
type: import("vue").PropType<string[]>;
|
||||
default: string[];
|
||||
};
|
||||
autoFocus: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
disabled: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
readOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
maxLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
};
|
||||
autoDetectCode: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
}>>, {
|
||||
pageFullscreen: boolean;
|
||||
preview: boolean;
|
||||
htmlPreview: boolean;
|
||||
modelValue: string;
|
||||
theme: import("./type").Themes;
|
||||
class: string;
|
||||
historyLength: number;
|
||||
previewOnly: boolean;
|
||||
language: string;
|
||||
toolbars: import("./type").ToolbarNames[];
|
||||
toolbarsExclude: import("./type").ToolbarNames[];
|
||||
noPrettier: boolean;
|
||||
editorId: string;
|
||||
tabWidth: number;
|
||||
showCodeRowNumber: boolean;
|
||||
previewTheme: string;
|
||||
style: string | import("vue").CSSProperties;
|
||||
markedHeadingId: import("./type").MarkedHeadingId;
|
||||
tableShape: number[];
|
||||
noMermaid: boolean;
|
||||
sanitize: (html: string) => string;
|
||||
placeholder: string;
|
||||
noKatex: boolean;
|
||||
codeTheme: string;
|
||||
footers: import("./type").Footers[];
|
||||
scrollAuto: boolean;
|
||||
formatCopiedText: (text: string) => string;
|
||||
codeStyleReverse: boolean;
|
||||
codeStyleReverseList: string[];
|
||||
}>;
|
||||
export default Editor;
|
26
node_modules/md-editor-v3/lib/MdEditor/config.d.ts
generated
vendored
26
node_modules/md-editor-v3/lib/MdEditor/config.d.ts
generated
vendored
@ -1,26 +0,0 @@
|
||||
import { CodeCss, Config, ConfigOption, Footers, StaticTextDefault } from './type';
|
||||
export declare const prefix = "md-editor";
|
||||
export declare const defaultEditorId = "md-editor-v3";
|
||||
export declare const iconfontUrl = "https://at.alicdn.com/t/c/font_2605852_gymddm8qwtd.js";
|
||||
export declare const cdnBase = "https://cdnjs.cloudflare.com/ajax/libs";
|
||||
export declare const highlightUrl: string;
|
||||
export declare const prettierUrl: {
|
||||
main: string;
|
||||
markdown: string;
|
||||
};
|
||||
export declare const cropperUrl: {
|
||||
css: string;
|
||||
js: string;
|
||||
};
|
||||
export declare const screenfullUrl: string;
|
||||
export declare const allToolbar: string[];
|
||||
export declare const allFooter: Array<Footers>;
|
||||
export declare const staticTextDefault: StaticTextDefault;
|
||||
export declare const mermaidUrl: string;
|
||||
export declare const katexUrl: {
|
||||
js: string;
|
||||
css: string;
|
||||
};
|
||||
export declare const codeCss: CodeCss;
|
||||
export declare const configOption: ConfigOption;
|
||||
export declare const config: Config;
|
39
node_modules/md-editor-v3/lib/MdEditor/extensions/DropdownToolbar.d.ts
generated
vendored
39
node_modules/md-editor-v3/lib/MdEditor/extensions/DropdownToolbar.d.ts
generated
vendored
@ -1,39 +0,0 @@
|
||||
import { PropType, ExtractPropTypes } from 'vue';
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
title: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
visible: {
|
||||
type: PropType<boolean>;
|
||||
};
|
||||
trigger: {
|
||||
type: PropType<string | JSX.Element>;
|
||||
};
|
||||
onChange: {
|
||||
type: PropType<(visible: boolean) => void>;
|
||||
};
|
||||
overlay: {
|
||||
type: PropType<string | JSX.Element>;
|
||||
};
|
||||
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
||||
title: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
visible: {
|
||||
type: PropType<boolean>;
|
||||
};
|
||||
trigger: {
|
||||
type: PropType<string | JSX.Element>;
|
||||
};
|
||||
onChange: {
|
||||
type: PropType<(visible: boolean) => void>;
|
||||
};
|
||||
overlay: {
|
||||
type: PropType<string | JSX.Element>;
|
||||
};
|
||||
}>>, {
|
||||
title: string;
|
||||
}>;
|
||||
export default _default;
|
77
node_modules/md-editor-v3/lib/MdEditor/extensions/MdCatalog/CatalogLink.d.ts
generated
vendored
77
node_modules/md-editor-v3/lib/MdEditor/extensions/MdCatalog/CatalogLink.d.ts
generated
vendored
@ -1,77 +0,0 @@
|
||||
import { PropType, ExtractPropTypes } from 'vue';
|
||||
import { LooseRequired } from '@vue/shared';
|
||||
import { TocItem } from './index';
|
||||
import { MarkedHeadingId } from '../../type';
|
||||
declare const catalogLinkProps: () => {
|
||||
tocItem: {
|
||||
type: PropType<TocItem>;
|
||||
default: () => {};
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: PropType<MarkedHeadingId>;
|
||||
default: () => () => void;
|
||||
};
|
||||
scrollElement: {
|
||||
type: PropType<string | Element>;
|
||||
default: string;
|
||||
};
|
||||
onClick: {
|
||||
type: PropType<(e: MouseEvent, t: TocItem) => void>;
|
||||
default: () => () => void;
|
||||
};
|
||||
scrollElementOffsetTop: {
|
||||
type: PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
};
|
||||
export declare type CatalogLinkProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<ReturnType<typeof catalogLinkProps>>>>>;
|
||||
declare const CatalogLink: import("vue").DefineComponent<{
|
||||
tocItem: {
|
||||
type: PropType<TocItem>;
|
||||
default: () => {};
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: PropType<MarkedHeadingId>;
|
||||
default: () => () => void;
|
||||
};
|
||||
scrollElement: {
|
||||
type: PropType<string | Element>;
|
||||
default: string;
|
||||
};
|
||||
onClick: {
|
||||
type: PropType<(e: MouseEvent, t: TocItem) => void>;
|
||||
default: () => () => void;
|
||||
};
|
||||
scrollElementOffsetTop: {
|
||||
type: PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
||||
tocItem: {
|
||||
type: PropType<TocItem>;
|
||||
default: () => {};
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: PropType<MarkedHeadingId>;
|
||||
default: () => () => void;
|
||||
};
|
||||
scrollElement: {
|
||||
type: PropType<string | Element>;
|
||||
default: string;
|
||||
};
|
||||
onClick: {
|
||||
type: PropType<(e: MouseEvent, t: TocItem) => void>;
|
||||
default: () => () => void;
|
||||
};
|
||||
scrollElementOffsetTop: {
|
||||
type: PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
}>>, {
|
||||
markedHeadingId: MarkedHeadingId;
|
||||
onClick: (e: MouseEvent, t: TocItem) => void;
|
||||
scrollElement: string | Element;
|
||||
scrollElementOffsetTop: number;
|
||||
tocItem: TocItem;
|
||||
}>;
|
||||
export default CatalogLink;
|
111
node_modules/md-editor-v3/lib/MdEditor/extensions/MdCatalog/index.d.ts
generated
vendored
111
node_modules/md-editor-v3/lib/MdEditor/extensions/MdCatalog/index.d.ts
generated
vendored
@ -1,111 +0,0 @@
|
||||
import { PropType, ExtractPropTypes } from 'vue';
|
||||
import { MarkedHeadingId, Themes } from '../../type';
|
||||
export interface TocItem {
|
||||
text: string;
|
||||
level: number;
|
||||
index: number;
|
||||
active: boolean;
|
||||
children?: Array<TocItem>;
|
||||
}
|
||||
declare const MdCatalog: import("vue").DefineComponent<{
|
||||
/**
|
||||
* 编辑器的Id,务必与需要绑定的编辑器Id相同
|
||||
*/
|
||||
editorId: {
|
||||
type: PropType<string>;
|
||||
};
|
||||
class: {
|
||||
type: StringConstructor;
|
||||
default: string;
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: PropType<MarkedHeadingId>;
|
||||
default: (text: string) => string;
|
||||
};
|
||||
/**
|
||||
* 指定滚动的容器,选择器需带上对应的符号,默认预览框
|
||||
* 元素必须定位!!!!!!
|
||||
*
|
||||
* 默认:#md-editor-preview-wrapper
|
||||
*/
|
||||
scrollElement: {
|
||||
type: PropType<string | HTMLElement>;
|
||||
};
|
||||
theme: {
|
||||
type: PropType<Themes>;
|
||||
default: string;
|
||||
};
|
||||
/**
|
||||
* 高亮标题相对滚动容器顶部偏移量,即距离该值时,高亮当前目录菜单项
|
||||
*
|
||||
* 默认:20px
|
||||
*/
|
||||
offsetTop: {
|
||||
type: PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
/**
|
||||
* 滚动区域的固定顶部高度
|
||||
*
|
||||
* 默认:0
|
||||
*/
|
||||
scrollElementOffsetTop: {
|
||||
type: PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClick"[], "onClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
||||
/**
|
||||
* 编辑器的Id,务必与需要绑定的编辑器Id相同
|
||||
*/
|
||||
editorId: {
|
||||
type: PropType<string>;
|
||||
};
|
||||
class: {
|
||||
type: StringConstructor;
|
||||
default: string;
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: PropType<MarkedHeadingId>;
|
||||
default: (text: string) => string;
|
||||
};
|
||||
/**
|
||||
* 指定滚动的容器,选择器需带上对应的符号,默认预览框
|
||||
* 元素必须定位!!!!!!
|
||||
*
|
||||
* 默认:#md-editor-preview-wrapper
|
||||
*/
|
||||
scrollElement: {
|
||||
type: PropType<string | HTMLElement>;
|
||||
};
|
||||
theme: {
|
||||
type: PropType<Themes>;
|
||||
default: string;
|
||||
};
|
||||
/**
|
||||
* 高亮标题相对滚动容器顶部偏移量,即距离该值时,高亮当前目录菜单项
|
||||
*
|
||||
* 默认:20px
|
||||
*/
|
||||
offsetTop: {
|
||||
type: PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
/**
|
||||
* 滚动区域的固定顶部高度
|
||||
*
|
||||
* 默认:0
|
||||
*/
|
||||
scrollElementOffsetTop: {
|
||||
type: PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
}>> & {
|
||||
onOnClick?: ((...args: any[]) => any) | undefined;
|
||||
}, {
|
||||
theme: Themes;
|
||||
class: string;
|
||||
markedHeadingId: MarkedHeadingId;
|
||||
offsetTop: number;
|
||||
scrollElementOffsetTop: number;
|
||||
}>;
|
||||
export default MdCatalog;
|
96
node_modules/md-editor-v3/lib/MdEditor/extensions/ModalToolbar.d.ts
generated
vendored
96
node_modules/md-editor-v3/lib/MdEditor/extensions/ModalToolbar.d.ts
generated
vendored
@ -1,96 +0,0 @@
|
||||
import { PropType, ExtractPropTypes } from 'vue';
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
title: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
modalTitle: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
visible: {
|
||||
type: PropType<boolean>;
|
||||
};
|
||||
width: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
height: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
trigger: {
|
||||
type: PropType<string | JSX.Element>;
|
||||
};
|
||||
onClick: {
|
||||
type: PropType<() => void>;
|
||||
};
|
||||
onClose: {
|
||||
type: PropType<() => void>;
|
||||
};
|
||||
/**
|
||||
* 显示全屏按钮
|
||||
*/
|
||||
showAdjust: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isFullscreen: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onAdjust: {
|
||||
type: PropType<(val: boolean) => void>;
|
||||
};
|
||||
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onClick" | "onClose" | "onAdjust", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
||||
title: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
modalTitle: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
visible: {
|
||||
type: PropType<boolean>;
|
||||
};
|
||||
width: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
height: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
trigger: {
|
||||
type: PropType<string | JSX.Element>;
|
||||
};
|
||||
onClick: {
|
||||
type: PropType<() => void>;
|
||||
};
|
||||
onClose: {
|
||||
type: PropType<() => void>;
|
||||
};
|
||||
/**
|
||||
* 显示全屏按钮
|
||||
*/
|
||||
showAdjust: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
isFullscreen: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onAdjust: {
|
||||
type: PropType<(val: boolean) => void>;
|
||||
};
|
||||
}>>, {
|
||||
title: string;
|
||||
modalTitle: string;
|
||||
width: string;
|
||||
height: string;
|
||||
showAdjust: boolean;
|
||||
isFullscreen: boolean;
|
||||
}>;
|
||||
export default _default;
|
27
node_modules/md-editor-v3/lib/MdEditor/extensions/NormalToolbar.d.ts
generated
vendored
27
node_modules/md-editor-v3/lib/MdEditor/extensions/NormalToolbar.d.ts
generated
vendored
@ -1,27 +0,0 @@
|
||||
import { PropType, ExtractPropTypes } from 'vue';
|
||||
declare const _default: import("vue").DefineComponent<{
|
||||
title: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
trigger: {
|
||||
type: PropType<string | JSX.Element>;
|
||||
};
|
||||
onClick: {
|
||||
type: PropType<(e: MouseEvent) => void>;
|
||||
};
|
||||
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
||||
title: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
trigger: {
|
||||
type: PropType<string | JSX.Element>;
|
||||
};
|
||||
onClick: {
|
||||
type: PropType<(e: MouseEvent) => void>;
|
||||
};
|
||||
}>>, {
|
||||
title: string;
|
||||
}>;
|
||||
export default _default;
|
811
node_modules/md-editor-v3/lib/MdEditor/index.d.ts
generated
vendored
811
node_modules/md-editor-v3/lib/MdEditor/index.d.ts
generated
vendored
@ -1,811 +0,0 @@
|
||||
import { App } from 'vue';
|
||||
import NormalToolbar from './extensions/NormalToolbar';
|
||||
import DropdownToolbar from './extensions/DropdownToolbar';
|
||||
import MdCatalog from './extensions/MdCatalog';
|
||||
import ModalToolbar from './extensions/ModalToolbar';
|
||||
import { config } from './config';
|
||||
declare const _default: {
|
||||
new (...args: any[]): {
|
||||
$: import("vue").ComponentInternalInstance;
|
||||
$data: {};
|
||||
$props: Partial<{
|
||||
pageFullscreen: boolean;
|
||||
preview: boolean;
|
||||
htmlPreview: boolean;
|
||||
modelValue: string;
|
||||
theme: import("./type").Themes;
|
||||
class: string;
|
||||
historyLength: number;
|
||||
previewOnly: boolean;
|
||||
language: string;
|
||||
toolbars: import("./type").ToolbarNames[];
|
||||
toolbarsExclude: import("./type").ToolbarNames[];
|
||||
noPrettier: boolean;
|
||||
editorId: string;
|
||||
tabWidth: number;
|
||||
showCodeRowNumber: boolean;
|
||||
previewTheme: string;
|
||||
style: string | import("vue").CSSProperties;
|
||||
markedHeadingId: import("./type").MarkedHeadingId;
|
||||
tableShape: number[];
|
||||
noMermaid: boolean;
|
||||
sanitize: (html: string) => string;
|
||||
placeholder: string;
|
||||
noKatex: boolean;
|
||||
codeTheme: string;
|
||||
footers: import("./type").Footers[];
|
||||
scrollAuto: boolean;
|
||||
formatCopiedText: (text: string) => string;
|
||||
codeStyleReverse: boolean;
|
||||
codeStyleReverseList: string[];
|
||||
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
||||
modelValue: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
theme: {
|
||||
type: import("vue").PropType<import("./type").Themes>;
|
||||
default: string;
|
||||
};
|
||||
class: {
|
||||
type: StringConstructor;
|
||||
default: string;
|
||||
};
|
||||
historyLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
onChange: {
|
||||
type: import("vue").PropType<import("./type").ChangeEvent>;
|
||||
};
|
||||
onSave: {
|
||||
type: import("vue").PropType<import("./type").SaveEvent>;
|
||||
};
|
||||
onUploadImg: {
|
||||
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
||||
};
|
||||
pageFullscreen: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
preview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
htmlPreview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
language: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
toolbars: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: string[];
|
||||
};
|
||||
toolbarsExclude: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: never[];
|
||||
};
|
||||
noPrettier: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onHtmlChanged: {
|
||||
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
||||
};
|
||||
onGetCatalog: {
|
||||
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
||||
};
|
||||
editorId: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
tabWidth: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
showCodeRowNumber: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
style: {
|
||||
type: import("vue").PropType<string | import("vue").CSSProperties>;
|
||||
default: () => {};
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: import("vue").PropType<import("./type").MarkedHeadingId>;
|
||||
default: import("./type").MarkedHeadingId;
|
||||
};
|
||||
tableShape: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => number[];
|
||||
};
|
||||
noMermaid: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
sanitize: {
|
||||
type: import("vue").PropType<(html: string) => string>;
|
||||
default: (html: string) => string;
|
||||
};
|
||||
placeholder: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
noKatex: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defToolbars: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
onError: {
|
||||
type: import("vue").PropType<import("./type").ErrorEvent>;
|
||||
};
|
||||
codeTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
footers: {
|
||||
type: import("vue").PropType<import("./type").Footers[]>;
|
||||
default: import("./type").Footers[];
|
||||
};
|
||||
scrollAuto: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defFooters: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
noIconfont: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
formatCopiedText: {
|
||||
type: import("vue").PropType<(text: string) => string>;
|
||||
default: (text: string) => string;
|
||||
};
|
||||
noUploadImg: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
codeStyleReverse: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
codeStyleReverseList: {
|
||||
type: import("vue").PropType<string[]>;
|
||||
default: string[];
|
||||
};
|
||||
autoFocus: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
disabled: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
readOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
maxLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
};
|
||||
autoDetectCode: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "pageFullscreen" | "preview" | "htmlPreview" | "modelValue" | "theme" | "class" | "historyLength" | "previewOnly" | "language" | "toolbars" | "toolbarsExclude" | "noPrettier" | "editorId" | "tabWidth" | "showCodeRowNumber" | "previewTheme" | "style" | "markedHeadingId" | "tableShape" | "noMermaid" | "sanitize" | "placeholder" | "noKatex" | "codeTheme" | "footers" | "scrollAuto" | "formatCopiedText" | "codeStyleReverse" | "codeStyleReverseList">;
|
||||
$attrs: {
|
||||
[x: string]: unknown;
|
||||
};
|
||||
$refs: {
|
||||
[x: string]: unknown;
|
||||
};
|
||||
$slots: Readonly<{
|
||||
[name: string]: import("vue").Slot | undefined;
|
||||
}>;
|
||||
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
||||
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
||||
$emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
|
||||
$el: any;
|
||||
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
||||
modelValue: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
theme: {
|
||||
type: import("vue").PropType<import("./type").Themes>;
|
||||
default: string;
|
||||
};
|
||||
class: {
|
||||
type: StringConstructor;
|
||||
default: string;
|
||||
};
|
||||
historyLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
onChange: {
|
||||
type: import("vue").PropType<import("./type").ChangeEvent>;
|
||||
};
|
||||
onSave: {
|
||||
type: import("vue").PropType<import("./type").SaveEvent>;
|
||||
};
|
||||
onUploadImg: {
|
||||
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
||||
};
|
||||
pageFullscreen: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
preview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
htmlPreview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
language: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
toolbars: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: string[];
|
||||
};
|
||||
toolbarsExclude: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: never[];
|
||||
};
|
||||
noPrettier: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onHtmlChanged: {
|
||||
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
||||
};
|
||||
onGetCatalog: {
|
||||
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
||||
};
|
||||
editorId: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
tabWidth: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
showCodeRowNumber: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
style: {
|
||||
type: import("vue").PropType<string | import("vue").CSSProperties>;
|
||||
default: () => {};
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: import("vue").PropType<import("./type").MarkedHeadingId>;
|
||||
default: import("./type").MarkedHeadingId;
|
||||
};
|
||||
tableShape: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => number[];
|
||||
};
|
||||
noMermaid: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
sanitize: {
|
||||
type: import("vue").PropType<(html: string) => string>;
|
||||
default: (html: string) => string;
|
||||
};
|
||||
placeholder: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
noKatex: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defToolbars: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
onError: {
|
||||
type: import("vue").PropType<import("./type").ErrorEvent>;
|
||||
};
|
||||
codeTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
footers: {
|
||||
type: import("vue").PropType<import("./type").Footers[]>;
|
||||
default: import("./type").Footers[];
|
||||
};
|
||||
scrollAuto: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defFooters: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
noIconfont: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
formatCopiedText: {
|
||||
type: import("vue").PropType<(text: string) => string>;
|
||||
default: (text: string) => string;
|
||||
};
|
||||
noUploadImg: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
codeStyleReverse: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
codeStyleReverseList: {
|
||||
type: import("vue").PropType<string[]>;
|
||||
default: string[];
|
||||
};
|
||||
autoFocus: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
disabled: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
readOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
maxLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
};
|
||||
autoDetectCode: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
|
||||
pageFullscreen: boolean;
|
||||
preview: boolean;
|
||||
htmlPreview: boolean;
|
||||
modelValue: string;
|
||||
theme: import("./type").Themes;
|
||||
class: string;
|
||||
historyLength: number;
|
||||
previewOnly: boolean;
|
||||
language: string;
|
||||
toolbars: import("./type").ToolbarNames[];
|
||||
toolbarsExclude: import("./type").ToolbarNames[];
|
||||
noPrettier: boolean;
|
||||
editorId: string;
|
||||
tabWidth: number;
|
||||
showCodeRowNumber: boolean;
|
||||
previewTheme: string;
|
||||
style: string | import("vue").CSSProperties;
|
||||
markedHeadingId: import("./type").MarkedHeadingId;
|
||||
tableShape: number[];
|
||||
noMermaid: boolean;
|
||||
sanitize: (html: string) => string;
|
||||
placeholder: string;
|
||||
noKatex: boolean;
|
||||
codeTheme: string;
|
||||
footers: import("./type").Footers[];
|
||||
scrollAuto: boolean;
|
||||
formatCopiedText: (text: string) => string;
|
||||
codeStyleReverse: boolean;
|
||||
codeStyleReverseList: string[];
|
||||
}> & {
|
||||
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
||||
created?: ((() => void) | (() => void)[]) | undefined;
|
||||
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
||||
mounted?: ((() => void) | (() => void)[]) | undefined;
|
||||
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
||||
updated?: ((() => void) | (() => void)[]) | undefined;
|
||||
activated?: ((() => void) | (() => void)[]) | undefined;
|
||||
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
||||
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
||||
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
||||
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
||||
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
||||
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
||||
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
||||
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
||||
};
|
||||
$forceUpdate: () => void;
|
||||
$nextTick: typeof import("vue").nextTick;
|
||||
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
||||
} & Readonly<import("vue").ExtractPropTypes<{
|
||||
modelValue: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
theme: {
|
||||
type: import("vue").PropType<import("./type").Themes>;
|
||||
default: string;
|
||||
};
|
||||
class: {
|
||||
type: StringConstructor;
|
||||
default: string;
|
||||
};
|
||||
historyLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
onChange: {
|
||||
type: import("vue").PropType<import("./type").ChangeEvent>;
|
||||
};
|
||||
onSave: {
|
||||
type: import("vue").PropType<import("./type").SaveEvent>;
|
||||
};
|
||||
onUploadImg: {
|
||||
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
||||
};
|
||||
pageFullscreen: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
preview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
htmlPreview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
language: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
toolbars: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: string[];
|
||||
};
|
||||
toolbarsExclude: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: never[];
|
||||
};
|
||||
noPrettier: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onHtmlChanged: {
|
||||
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
||||
};
|
||||
onGetCatalog: {
|
||||
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
||||
};
|
||||
editorId: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
tabWidth: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
showCodeRowNumber: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
style: {
|
||||
type: import("vue").PropType<string | import("vue").CSSProperties>;
|
||||
default: () => {};
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: import("vue").PropType<import("./type").MarkedHeadingId>;
|
||||
default: import("./type").MarkedHeadingId;
|
||||
};
|
||||
tableShape: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => number[];
|
||||
};
|
||||
noMermaid: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
sanitize: {
|
||||
type: import("vue").PropType<(html: string) => string>;
|
||||
default: (html: string) => string;
|
||||
};
|
||||
placeholder: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
noKatex: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defToolbars: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
onError: {
|
||||
type: import("vue").PropType<import("./type").ErrorEvent>;
|
||||
};
|
||||
codeTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
footers: {
|
||||
type: import("vue").PropType<import("./type").Footers[]>;
|
||||
default: import("./type").Footers[];
|
||||
};
|
||||
scrollAuto: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defFooters: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
noIconfont: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
formatCopiedText: {
|
||||
type: import("vue").PropType<(text: string) => string>;
|
||||
default: (text: string) => string;
|
||||
};
|
||||
noUploadImg: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
codeStyleReverse: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
codeStyleReverseList: {
|
||||
type: import("vue").PropType<string[]>;
|
||||
default: string[];
|
||||
};
|
||||
autoFocus: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
disabled: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
readOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
maxLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
};
|
||||
autoDetectCode: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
}>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & {} & import("vue").ComponentCustomProperties;
|
||||
__isFragment?: undefined;
|
||||
__isTeleport?: undefined;
|
||||
__isSuspense?: undefined;
|
||||
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
||||
modelValue: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
theme: {
|
||||
type: import("vue").PropType<import("./type").Themes>;
|
||||
default: string;
|
||||
};
|
||||
class: {
|
||||
type: StringConstructor;
|
||||
default: string;
|
||||
};
|
||||
historyLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
onChange: {
|
||||
type: import("vue").PropType<import("./type").ChangeEvent>;
|
||||
};
|
||||
onSave: {
|
||||
type: import("vue").PropType<import("./type").SaveEvent>;
|
||||
};
|
||||
onUploadImg: {
|
||||
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
||||
};
|
||||
pageFullscreen: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
preview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
htmlPreview: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
language: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
toolbars: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: string[];
|
||||
};
|
||||
toolbarsExclude: {
|
||||
type: import("vue").PropType<import("./type").ToolbarNames[]>;
|
||||
default: never[];
|
||||
};
|
||||
noPrettier: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
onHtmlChanged: {
|
||||
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
||||
};
|
||||
onGetCatalog: {
|
||||
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
||||
};
|
||||
editorId: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
tabWidth: {
|
||||
type: import("vue").PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
showCodeRowNumber: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
previewTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
style: {
|
||||
type: import("vue").PropType<string | import("vue").CSSProperties>;
|
||||
default: () => {};
|
||||
};
|
||||
markedHeadingId: {
|
||||
type: import("vue").PropType<import("./type").MarkedHeadingId>;
|
||||
default: import("./type").MarkedHeadingId;
|
||||
};
|
||||
tableShape: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => number[];
|
||||
};
|
||||
noMermaid: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
sanitize: {
|
||||
type: import("vue").PropType<(html: string) => string>;
|
||||
default: (html: string) => string;
|
||||
};
|
||||
placeholder: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
noKatex: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defToolbars: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
onError: {
|
||||
type: import("vue").PropType<import("./type").ErrorEvent>;
|
||||
};
|
||||
codeTheme: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
footers: {
|
||||
type: import("vue").PropType<import("./type").Footers[]>;
|
||||
default: import("./type").Footers[];
|
||||
};
|
||||
scrollAuto: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
defFooters: {
|
||||
type: import("vue").PropType<string | JSX.Element>;
|
||||
};
|
||||
noIconfont: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
formatCopiedText: {
|
||||
type: import("vue").PropType<(text: string) => string>;
|
||||
default: (text: string) => string;
|
||||
};
|
||||
noUploadImg: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
codeStyleReverse: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
codeStyleReverseList: {
|
||||
type: import("vue").PropType<string[]>;
|
||||
default: string[];
|
||||
};
|
||||
autoFocus: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
disabled: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
readOnly: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
maxLength: {
|
||||
type: import("vue").PropType<number>;
|
||||
};
|
||||
autoDetectCode: {
|
||||
type: import("vue").PropType<boolean>;
|
||||
};
|
||||
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue", {
|
||||
pageFullscreen: boolean;
|
||||
preview: boolean;
|
||||
htmlPreview: boolean;
|
||||
modelValue: string;
|
||||
theme: import("./type").Themes;
|
||||
class: string;
|
||||
historyLength: number;
|
||||
previewOnly: boolean;
|
||||
language: string;
|
||||
toolbars: import("./type").ToolbarNames[];
|
||||
toolbarsExclude: import("./type").ToolbarNames[];
|
||||
noPrettier: boolean;
|
||||
editorId: string;
|
||||
tabWidth: number;
|
||||
showCodeRowNumber: boolean;
|
||||
previewTheme: string;
|
||||
style: string | import("vue").CSSProperties;
|
||||
markedHeadingId: import("./type").MarkedHeadingId;
|
||||
tableShape: number[];
|
||||
noMermaid: boolean;
|
||||
sanitize: (html: string) => string;
|
||||
placeholder: string;
|
||||
noKatex: boolean;
|
||||
codeTheme: string;
|
||||
footers: import("./type").Footers[];
|
||||
scrollAuto: boolean;
|
||||
formatCopiedText: (text: string) => string;
|
||||
codeStyleReverse: boolean;
|
||||
codeStyleReverseList: string[];
|
||||
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
||||
/**
|
||||
* 默认工具栏组件
|
||||
*/
|
||||
readonly NormalToolbar: typeof NormalToolbar;
|
||||
/**
|
||||
* 下拉菜单工具栏组件
|
||||
*/
|
||||
readonly DropdownToolbar: typeof DropdownToolbar;
|
||||
/**
|
||||
* 目录组件
|
||||
*/
|
||||
readonly MdCatalog: typeof MdCatalog;
|
||||
/**
|
||||
* 弹窗工具栏组件
|
||||
*/
|
||||
readonly ModalToolbar: typeof ModalToolbar;
|
||||
/**
|
||||
* 配置编辑器全局内容
|
||||
*/
|
||||
readonly config: typeof config;
|
||||
install: (app: App) => App;
|
||||
};
|
||||
export default _default;
|
||||
export * from './type';
|
328
node_modules/md-editor-v3/lib/MdEditor/type.d.ts
generated
vendored
328
node_modules/md-editor-v3/lib/MdEditor/type.d.ts
generated
vendored
@ -1,328 +0,0 @@
|
||||
import { marked, Renderer, Slugger } from 'marked';
|
||||
declare global {
|
||||
interface Window {
|
||||
hljs: any;
|
||||
prettier: any;
|
||||
prettierPlugins: any;
|
||||
Cropper: any;
|
||||
screenfull: any;
|
||||
mermaid: any;
|
||||
katex: any;
|
||||
}
|
||||
}
|
||||
export interface ToolbarTips {
|
||||
bold?: string;
|
||||
underline?: string;
|
||||
italic?: string;
|
||||
strikeThrough?: string;
|
||||
title?: string;
|
||||
sub?: string;
|
||||
sup?: string;
|
||||
quote?: string;
|
||||
unorderedList?: string;
|
||||
orderedList?: string;
|
||||
task?: string;
|
||||
codeRow?: string;
|
||||
code?: string;
|
||||
link?: string;
|
||||
image?: string;
|
||||
table?: string;
|
||||
mermaid?: string;
|
||||
katex?: string;
|
||||
revoke?: string;
|
||||
next?: string;
|
||||
save?: string;
|
||||
prettier?: string;
|
||||
pageFullscreen?: string;
|
||||
fullscreen?: string;
|
||||
preview?: string;
|
||||
htmlPreview?: string;
|
||||
catalog?: string;
|
||||
github?: string;
|
||||
'-'?: string;
|
||||
'='?: string;
|
||||
}
|
||||
export interface StaticTextDefaultValue {
|
||||
toolbarTips?: ToolbarTips;
|
||||
titleItem?: {
|
||||
h1?: string;
|
||||
h2?: string;
|
||||
h3?: string;
|
||||
h4?: string;
|
||||
h5?: string;
|
||||
h6?: string;
|
||||
};
|
||||
imgTitleItem?: {
|
||||
link: string;
|
||||
upload: string;
|
||||
clip2upload: string;
|
||||
};
|
||||
linkModalTips?: {
|
||||
linkTitle?: string;
|
||||
imageTitle?: string;
|
||||
descLabel?: string;
|
||||
descLabelPlaceHolder?: string;
|
||||
urlLabel?: string;
|
||||
urlLabelPlaceHolder?: string;
|
||||
buttonOK?: string;
|
||||
};
|
||||
clipModalTips?: {
|
||||
title?: string;
|
||||
buttonUpload?: string;
|
||||
};
|
||||
copyCode?: {
|
||||
text?: string;
|
||||
successTips?: string;
|
||||
failTips?: string;
|
||||
};
|
||||
mermaid?: {
|
||||
flow?: string;
|
||||
sequence?: string;
|
||||
gantt?: string;
|
||||
class?: string;
|
||||
state?: string;
|
||||
pie?: string;
|
||||
relationship?: string;
|
||||
journey?: string;
|
||||
};
|
||||
katex?: {
|
||||
inline: string;
|
||||
block: string;
|
||||
};
|
||||
footer?: {
|
||||
markdownTotal: string;
|
||||
scrollAuto: string;
|
||||
};
|
||||
}
|
||||
export interface StaticTextDefault {
|
||||
'zh-CN': StaticTextDefaultValue;
|
||||
'en-US': StaticTextDefaultValue;
|
||||
}
|
||||
export declare type StaticTextDefaultKey = keyof StaticTextDefault;
|
||||
export declare type ToolbarNames = keyof ToolbarTips | number;
|
||||
export declare type Footers = '=' | 'markdownTotal' | 'scrollSwitch' | number;
|
||||
export interface SettingType {
|
||||
pageFullscreen: boolean;
|
||||
fullscreen: boolean;
|
||||
preview: boolean;
|
||||
htmlPreview: boolean;
|
||||
}
|
||||
export declare type Themes = 'light' | 'dark';
|
||||
/**
|
||||
* 预览主题
|
||||
*
|
||||
* @list ['default', 'github', 'vuepress', 'mk-cute', 'smart-blue', 'cyanosis']
|
||||
*/
|
||||
export declare type PreviewThemes = string;
|
||||
export interface HeadList {
|
||||
text: string;
|
||||
level: 1 | 2 | 3 | 4 | 5 | 6;
|
||||
active?: boolean;
|
||||
}
|
||||
export declare type MarkedHeadingId = (text: string, level: number, index: number) => string;
|
||||
export interface MermaidTemplate {
|
||||
/**
|
||||
* 流程图
|
||||
*/
|
||||
flow?: string;
|
||||
/**
|
||||
* 时序图
|
||||
*/
|
||||
sequence?: string;
|
||||
/**
|
||||
* 甘特图
|
||||
*/
|
||||
gantt?: string;
|
||||
/**
|
||||
* 类图
|
||||
*/
|
||||
class?: string;
|
||||
/**
|
||||
* 状态图
|
||||
*/
|
||||
state?: string;
|
||||
/**
|
||||
* 饼图
|
||||
*/
|
||||
pie?: string;
|
||||
/**
|
||||
* 关系图
|
||||
*/
|
||||
relationship?: string;
|
||||
/**
|
||||
* 旅程图
|
||||
*/
|
||||
journey?: string;
|
||||
}
|
||||
export declare type RewriteHeading = (text: string, level: 1 | 2 | 3 | 4 | 5 | 6, raw: string, slugger: Slugger, index: number) => string;
|
||||
export interface RewriteRenderer extends Omit<Renderer, 'heading'> {
|
||||
heading: RewriteHeading;
|
||||
}
|
||||
export interface ConfigOption {
|
||||
/**
|
||||
* 覆盖编辑器默认的renderer属性
|
||||
* @see https://marked.js.org/using_pro#renderer
|
||||
*/
|
||||
markedRenderer?: (renderer: RewriteRenderer) => RewriteRenderer;
|
||||
/**
|
||||
* 自定义 marked 扩展
|
||||
* @see https://marked.js.org/using_pro#extensions
|
||||
*/
|
||||
markedExtensions?: Array<marked.TokenizerExtension & marked.RendererExtension>;
|
||||
/**
|
||||
* 自定义 marked option,不推荐在这么覆盖renderer,这会导致内部逻辑混乱!
|
||||
* @see https://marked.js.org/using_advanced#options
|
||||
*/
|
||||
markedOptions?: marked.MarkedOptions;
|
||||
/**
|
||||
* 编辑器内部依赖库
|
||||
*/
|
||||
editorExtensions?: {
|
||||
highlight?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
css?: CodeCss;
|
||||
};
|
||||
prettier?: {
|
||||
prettierInstance?: any;
|
||||
parserMarkdownInstance?: any;
|
||||
standaloneJs?: string;
|
||||
parserMarkdownJs?: string;
|
||||
};
|
||||
cropper?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
css?: string;
|
||||
};
|
||||
iconfont?: string;
|
||||
screenfull?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
};
|
||||
mermaid?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
};
|
||||
katex?: {
|
||||
instance?: any;
|
||||
js?: string;
|
||||
css?: string;
|
||||
};
|
||||
};
|
||||
editorConfig?: {
|
||||
/**
|
||||
* 自定义提示语言
|
||||
*/
|
||||
languageUserDefined?: {
|
||||
[key: string]: StaticTextDefaultValue;
|
||||
};
|
||||
/**
|
||||
* 自定义内部mermaid模块
|
||||
*/
|
||||
mermaidTemplate?: MermaidTemplate;
|
||||
/**
|
||||
* 输入渲染延迟(ms)
|
||||
*/
|
||||
renderDelay?: number;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* 扩展编辑器内部功能,包括marked和一些内部依赖实例,如highlight、cropper等
|
||||
*/
|
||||
export declare type Config = (options: ConfigOption) => void;
|
||||
/**
|
||||
* 编辑器操作潜在的错误
|
||||
*/
|
||||
export interface InnerError {
|
||||
name: string;
|
||||
message: string;
|
||||
}
|
||||
export interface CodeCss {
|
||||
[key: string]: {
|
||||
light: string;
|
||||
dark: string;
|
||||
};
|
||||
}
|
||||
export declare type UpdateSetting = (k: keyof SettingType, v?: boolean) => void;
|
||||
export declare type ChangeEvent = (v: string) => void;
|
||||
export declare type SaveEvent = (v: string, h: Promise<string>) => void;
|
||||
export declare type UploadImgEvent = (files: Array<File>, callBack: (urls: string[]) => void) => void;
|
||||
export declare type HtmlChangedEvent = (h: string) => void;
|
||||
export declare type GetCatalogEvent = (list: HeadList[]) => void;
|
||||
export declare type ErrorEvent = (err: InnerError) => void;
|
||||
export interface ExposeEvent {
|
||||
pageFullscreen(status: boolean): void;
|
||||
fullscreen(status: boolean): void;
|
||||
preview(status: boolean): void;
|
||||
htmlPreview(status: boolean): void;
|
||||
catalog(status: boolean): void;
|
||||
}
|
||||
export interface InsertParam {
|
||||
targetValue: string;
|
||||
select: boolean;
|
||||
deviationStart: number;
|
||||
deviationEnd: number;
|
||||
}
|
||||
export declare type InsertContentGenerator = (selectedText: string) => InsertParam;
|
||||
export interface ExposeParam {
|
||||
/**
|
||||
* 添加事件监听
|
||||
*
|
||||
* @param eventName 事件名称
|
||||
* @param callBack 事件回调函数
|
||||
*/
|
||||
on<E extends keyof ExposeEvent, C extends ExposeEvent[E]>(eventName: E, callBack: C): void;
|
||||
/**
|
||||
* 切换页面内全屏
|
||||
*
|
||||
* @param status 是否页面全屏
|
||||
*/
|
||||
togglePageFullscreen(status?: boolean): void;
|
||||
/**
|
||||
* 切换屏幕全屏
|
||||
*
|
||||
* @param status 是否屏幕全屏
|
||||
*/
|
||||
toggleFullscreen(status?: boolean): void;
|
||||
/**
|
||||
* 切换是否显示预览
|
||||
*
|
||||
* @param status 是否显示预览
|
||||
*/
|
||||
togglePreview(status?: boolean): void;
|
||||
/**
|
||||
* 切换是否显示html预览
|
||||
*
|
||||
* @param status html预览状态
|
||||
*/
|
||||
toggleHtmlPreview(status?: boolean): void;
|
||||
/**
|
||||
* 切换是否显示目录
|
||||
*
|
||||
* @param status 是否显示目录,不设置默认相反
|
||||
*/
|
||||
toggleCatalog(status?: boolean): void;
|
||||
/**
|
||||
* 触发保存
|
||||
*/
|
||||
triggerSave(): void;
|
||||
/**
|
||||
* 手动向文本框插入内容
|
||||
*
|
||||
* @param {Function} generate 构造插入内容方法
|
||||
* 构造方法提供「当前选中」的内容为入参
|
||||
* 返回「待插入内容」和插入的属性
|
||||
* 入参 selectedText 当前选中的内容
|
||||
*
|
||||
* targetValue 待插入内容
|
||||
* select 插入后是否自动选中内容
|
||||
* deviationStart 插入后选中位置的开始偏移量
|
||||
* deviationEnd 插入后选中位置的结束偏移量
|
||||
*
|
||||
*/
|
||||
insert(generate: InsertContentGenerator): void;
|
||||
/**
|
||||
* 手动聚焦
|
||||
*/
|
||||
focus(): void;
|
||||
}
|
7079
node_modules/md-editor-v3/lib/md-editor-v3.es.js
generated
vendored
7079
node_modules/md-editor-v3/lib/md-editor-v3.es.js
generated
vendored
File diff suppressed because it is too large
Load Diff
126
node_modules/md-editor-v3/lib/md-editor-v3.umd.js
generated
vendored
126
node_modules/md-editor-v3/lib/md-editor-v3.umd.js
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/md-editor-v3/lib/style.css
generated
vendored
1
node_modules/md-editor-v3/lib/style.css
generated
vendored
File diff suppressed because one or more lines are too long
124
node_modules/md-editor-v3/package.json
generated
vendored
124
node_modules/md-editor-v3/package.json
generated
vendored
@ -1,124 +0,0 @@
|
||||
{
|
||||
"name": "md-editor-v3",
|
||||
"version": "2.7.2",
|
||||
"keywords": [
|
||||
"vue",
|
||||
"vue3",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"jsx",
|
||||
"tsx",
|
||||
"markdown",
|
||||
"editor",
|
||||
"theme",
|
||||
"html"
|
||||
],
|
||||
"description": "Markdown editor for vue3, developed by jsx and typescript, dark theme、beautify content by prettier、render articles directly、paste or clip the picture and upload it...",
|
||||
"author": {
|
||||
"name": "zbf",
|
||||
"url": "https://imzbf.cc"
|
||||
},
|
||||
"homepage": "https://imzbf.github.io/md-editor-v3/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/imzbf/md-editor-v3.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/imzbf/md-editor-v3/issues"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"type": "module",
|
||||
"types": "./lib/MdEditor/index.d.ts",
|
||||
"main": "./lib/md-editor-v3.umd.js",
|
||||
"module": "./lib/md-editor-v3.es.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/md-editor-v3.es.js",
|
||||
"require": "./lib/md-editor-v3.umd.js"
|
||||
},
|
||||
"./lib/style.css": "./lib/style.css"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.10",
|
||||
"@babel/preset-env": "^7.17.10",
|
||||
"@types/katex": "^0.14.0",
|
||||
"@types/marked": "^4.0.7",
|
||||
"@types/node": "16",
|
||||
"@types/prettier": "^2.7.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
||||
"@typescript-eslint/parser": "^5.23.0",
|
||||
"@vavt/markdown-theme": "^1.1.0",
|
||||
"@vitejs/plugin-vue": "^2.3.2",
|
||||
"@vitejs/plugin-vue-jsx": "^1.3.10",
|
||||
"@vue/compiler-sfc": "^3.2.33",
|
||||
"axios": "^0.27.2",
|
||||
"copy-to-clipboard": "^3.3.1",
|
||||
"cropperjs": "^1.5.13",
|
||||
"eslint": "^8.15.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"highlight.js": "^11.7.0",
|
||||
"katex": "^0.16.3",
|
||||
"less": "^4.1.1",
|
||||
"marked": "^4.2.3",
|
||||
"medium-zoom": "^1.0.8",
|
||||
"mermaid": "^9.2.2",
|
||||
"multiparty": "^4.2.2",
|
||||
"prettier": "^2.8.0",
|
||||
"screenfull": "5.2.0",
|
||||
"ts-morph": "^14.0.0",
|
||||
"typescript": "^4.6.4",
|
||||
"vite": "^2.9.8",
|
||||
"vite-plugin-dts": "^0.9.2",
|
||||
"vue": "^3.2.33",
|
||||
"vue-tsc": "^0.34.12"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"prettier"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 12
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-empty-function": "off"
|
||||
}
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"semi": true,
|
||||
"printWidth": 90,
|
||||
"proseWrap": "never",
|
||||
"endOfLine": "auto"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user