mirror of https://github.com/1Panel-dev/1Panel
ssongliu
2 years ago
committed by
ssongliu
56 changed files with 12363 additions and 293 deletions
@ -1,41 +1,38 @@
|
||||
base_dir: /opt |
||||
|
||||
system: |
||||
port: 9999 |
||||
db_type: sqlite |
||||
level: debug |
||||
data_dir: /opt/1Panel/data |
||||
app_oss: "https://1panel.oss-cn-hangzhou.aliyuncs.com/apps.json" |
||||
|
||||
data_dir: ${base_dir}/1Panel/data |
||||
cache: ${base_dir}/1Panel/data/cache |
||||
backup: ${base_dir}/1Panel/data/backup |
||||
app_oss: "https://1panel.oss-cn-hangzhou.aliyuncs.com/apps/list.json" |
||||
|
||||
sqlite: |
||||
path: /opt/1Panel/data/db |
||||
path: ${base_dir}/1Panel/data/db |
||||
db_file: 1Panel.db |
||||
|
||||
log: |
||||
level: info |
||||
level: debug |
||||
time_zone: Asia/Shanghai |
||||
path: /opt/1Panel/log |
||||
path: ${base_dir}/1Panel/log |
||||
log_name: 1Panel |
||||
log_suffix: .log |
||||
log_backup: 10 #最大日志保留个数 |
||||
|
||||
cache: |
||||
path: /opt/1Panel/data/cache |
||||
log_backup: 10 |
||||
|
||||
# 跨域配置 |
||||
cors: |
||||
mode: whitelist # 放行模式: allow-all, 放行全部; whitelist, 白名单模式, 来自白名单内域名的请求添加 cors 头; strict-whitelist 严格白名单模式, 白名单外的请求一律拒绝 |
||||
mode: whitelist |
||||
whitelist: |
||||
- allow-origin: example1.com |
||||
allow-headers: content-type |
||||
allow-methods: GET, POST |
||||
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type |
||||
allow-credentials: true # 布尔值 |
||||
allow-credentials: true |
||||
- allow-origin: example2.com |
||||
allow-headers: content-type |
||||
allow-methods: GET, POST |
||||
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type |
||||
allow-credentials: true # 布尔值 |
||||
allow-credentials: true |
||||
|
||||
# 加密设置 |
||||
encrypt: |
||||
key: 1Panel123@2022!! |
||||
key: 1Panel_key@2023! |
@ -0,0 +1,34 @@
|
||||
package v1 |
||||
|
||||
import ( |
||||
"context" |
||||
|
||||
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper" |
||||
"github.com/1Panel-dev/1Panel/backend/app/dto" |
||||
"github.com/1Panel-dev/1Panel/backend/constant" |
||||
"github.com/gin-gonic/gin" |
||||
"github.com/google/go-github/github" |
||||
) |
||||
|
||||
// @Tags System Setting
|
||||
// @Summary Load upgrade info
|
||||
// @Description 加载系统更新信息
|
||||
// @Success 200 {object} dto.UpgradeInfo
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /settings/upgrade [get]
|
||||
func (b *BaseApi) GetUpgradeInfo(c *gin.Context) { |
||||
client := github.NewClient(nil) |
||||
stats, _, err := client.Repositories.GetLatestRelease(context.Background(), "KubeOperator", "KubeOperator") |
||||
if err != nil { |
||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) |
||||
return |
||||
} |
||||
info := dto.UpgradeInfo{ |
||||
NewVersion: string(*stats.Name), |
||||
Tag: string(*stats.TagName), |
||||
ReleaseNote: string(*stats.Body), |
||||
CreatedAt: github.Timestamp(*stats.CreatedAt).Format("2006-01-02 15:04:05"), |
||||
PublishedAt: github.Timestamp(*stats.PublishedAt).Format("2006-01-02 15:04:05"), |
||||
} |
||||
helper.SuccessWithData(c, info) |
||||
} |
@ -1,34 +1,60 @@
|
||||
package service |
||||
|
||||
import ( |
||||
"context" |
||||
"fmt" |
||||
"io/ioutil" |
||||
"strings" |
||||
"testing" |
||||
|
||||
"github.com/1Panel-dev/1Panel/backend/app/model" |
||||
"github.com/1Panel-dev/1Panel/backend/global" |
||||
"github.com/1Panel-dev/1Panel/backend/init/db" |
||||
"github.com/1Panel-dev/1Panel/backend/init/viper" |
||||
"github.com/1Panel-dev/1Panel/backend/utils/files" |
||||
"github.com/google/go-github/github" |
||||
) |
||||
|
||||
func TestSnaa(t *testing.T) { |
||||
fileOp := files.NewFileOp() |
||||
|
||||
fmt.Println(fileOp.CopyFile("/Users/slooop/Documents/编码规范.pdf", "/Users/slooop/Downloads")) |
||||
// fmt.Println(fileOp.Compress([]string{"/Users/slooop/Documents/编码规范.pdf", "/Users/slooop/Downloads/1Panel.db"}, "/Users/slooop/Downloads/", "test.tar.gz", files.TarGz))
|
||||
} |
||||
|
||||
func TestOss(t *testing.T) { |
||||
func TestDw(t *testing.T) { |
||||
viper.Init() |
||||
db.Init() |
||||
|
||||
var backup model.BackupAccount |
||||
if err := global.DB.Where("id = ?", 6).First(&backup).Error; err != nil { |
||||
backup, err := backupRepo.Get(commonRepo.WithByType("OSS")) |
||||
if err != nil { |
||||
fmt.Println(err) |
||||
} |
||||
backupAccont, err := NewIBackupService().NewClient(&backup) |
||||
client, err := NewIBackupService().NewClient(&backup) |
||||
if err != nil { |
||||
fmt.Println(err) |
||||
} |
||||
fmt.Println(backupAccont.Upload("/Users/slooop/Downloads/1Panel.db", "database/1Panel.db")) |
||||
fmt.Println(client.Download("system_snapshot/1panel_snapshot_20230112135640.tar.gz", "/opt/1Panel/data/backup/system/test.tar.gz")) |
||||
} |
||||
|
||||
func TestDi(t *testing.T) { |
||||
docker := "var/lib/docker" |
||||
fmt.Println(docker[strings.LastIndex(docker, "/"):]) |
||||
fmt.Println(docker[:strings.LastIndex(docker, "/")]) |
||||
} |
||||
|
||||
func TestGit(t *testing.T) { |
||||
client := github.NewClient(nil) |
||||
stats, _, err := client.Repositories.GetLatestRelease(context.Background(), "KubeOperator", "KubeOperator") |
||||
fmt.Println(github.Timestamp(*stats.PublishedAt), err) |
||||
} |
||||
|
||||
func TestSdasd(t *testing.T) { |
||||
u := NewISnapshotService() |
||||
var snapjson SnapshotJson |
||||
snapjson, _ = u.readFromJson("/Users/slooop/Downloads/snapshot.json") |
||||
fmt.Println(111, snapjson) |
||||
// if err := ioutil.WriteFile("/Users/slooop/Downloads/snapshot.json", []byte("111xxxxx"), 0640); err != nil {
|
||||
// fmt.Println(err)
|
||||
// }
|
||||
} |
||||
|
||||
func TestCp(t *testing.T) { |
||||
_, err := ioutil.ReadFile("/Users/slooop/Downloads/test/main") |
||||
if err != nil { |
||||
fmt.Println(err) |
||||
} |
||||
if err := ioutil.WriteFile("/Users/slooop/Downloads/test/main", []byte("sdadasd"), 0640); err != nil { |
||||
fmt.Println(err) |
||||
} |
||||
} |
||||
|
@ -1,5 +0,0 @@
|
||||
package configs |
||||
|
||||
type Cache struct { |
||||
Path string `mapstructure:"path"` |
||||
} |
@ -1,11 +1,10 @@
|
||||
package configs |
||||
|
||||
type ServerConfig struct { |
||||
Sqlite Sqlite `mapstructure:"sqlite"` |
||||
BaseDir string `mapstructure:"base_dir"` |
||||
System System `mapstructure:"system"` |
||||
Sqlite Sqlite `mapstructure:"sqlite"` |
||||
LogConfig LogConfig `mapstructure:"log"` |
||||
CORS CORS `mapstructure:"cors"` |
||||
Encrypt Encrypt `mapstructure:"encrypt"` |
||||
Csrf Csrf `mapstructure:"csrf"` |
||||
Cache Cache `mapstructure:"cache"` |
||||
} |
||||
|
@ -1,5 +0,0 @@
|
||||
package configs |
||||
|
||||
type Csrf struct { |
||||
Key string `mapstructure:"key" json:"key" yaml:"key"` |
||||
} |
@ -1,29 +0,0 @@
|
||||
package middleware |
||||
|
||||
import ( |
||||
"net/http" |
||||
|
||||
"github.com/1Panel-dev/1Panel/backend/global" |
||||
"github.com/gin-gonic/gin" |
||||
"github.com/gorilla/csrf" |
||||
adapter "github.com/gwatts/gin-adapter" |
||||
) |
||||
|
||||
func CSRF() gin.HandlerFunc { |
||||
csrfMd := csrf.Protect( |
||||
[]byte(global.CONF.Csrf.Key), |
||||
csrf.Path("/api"), |
||||
csrf.ErrorHandler(http.HandlerFunc( |
||||
func(w http.ResponseWriter, r *http.Request) { |
||||
w.WriteHeader(http.StatusForbidden) |
||||
_, _ = w.Write([]byte("csrf token invalid")) |
||||
})), |
||||
) |
||||
return adapter.Wrap(csrfMd) |
||||
} |
||||
|
||||
func LoadCsrfToken() gin.HandlerFunc { |
||||
return func(c *gin.Context) { |
||||
c.Header("X-CSRF-TOKEN", csrf.Token(c.Request)) |
||||
} |
||||
} |
@ -0,0 +1,242 @@
|
||||
<template> |
||||
<div v-loading="loading"> |
||||
<el-drawer v-model="drawerVisiable" :title="$t('setting.recoverDetail')"> |
||||
<el-form label-width="120px"> |
||||
<el-card> |
||||
<template #header> |
||||
<div class="card-header"> |
||||
<span>{{ $t('setting.recover') }}</span> |
||||
</div> |
||||
</template> |
||||
<div v-if="!snapInfo.recoverStatus"> |
||||
<div v-if="snapInfo.lastRecoveredAt"> |
||||
<el-form-item :label="$t('commons.table.status')"> |
||||
<el-tag type="success"> |
||||
{{ $t('commons.table.statusSuccess') }} |
||||
</el-tag> |
||||
<el-button @click="recoverSnapshot(true)" style="margin-left: 10px" type="primary"> |
||||
{{ $t('setting.recover') }} |
||||
</el-button> |
||||
</el-form-item> |
||||
<el-form-item :label="$t('setting.lastRecoverAt')"> |
||||
{{ snapInfo.lastRecoveredAt }} |
||||
</el-form-item> |
||||
</div> |
||||
<div v-else> |
||||
<el-form-item> |
||||
<el-tag type="info"> |
||||
{{ $t('setting.noRecoverRecord') }} |
||||
</el-tag> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button @click="recoverSnapshot(true)" type="primary"> |
||||
{{ $t('setting.recover') }} |
||||
</el-button> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
<div v-else> |
||||
<el-form-item :label="$t('commons.table.status')"> |
||||
<el-tag type="danger" v-if="snapInfo.recoverStatus === 'Failed'"> |
||||
{{ $t('commons.table.statusFailed') }} |
||||
</el-tag> |
||||
<el-tag type="success" v-if="snapInfo.recoverStatus === 'Success'"> |
||||
{{ $t('commons.table.statusSuccess') }} |
||||
</el-tag> |
||||
<el-tag type="info" v-if="snapInfo.recoverStatus === 'Waiting'"> |
||||
{{ $t('commons.table.statusWaiting') }} |
||||
</el-tag> |
||||
<el-button |
||||
style="margin-left: 15px" |
||||
@click="recoverSnapshot(true)" |
||||
:disabled="snapInfo.recoverStatus !== 'Success'" |
||||
> |
||||
{{ $t('setting.recover') }} |
||||
</el-button> |
||||
</el-form-item> |
||||
<el-form-item :label="$t('setting.lastRecoverAt')" v-if="snapInfo.recoverStatus !== 'Waiting'"> |
||||
{{ snapInfo.lastRecoveredAt }} |
||||
</el-form-item> |
||||
<div v-if="snapInfo.recoverStatus === 'Failed'"> |
||||
<el-form-item :label="$t('commons.button.log')"> |
||||
<span style="word-break: break-all; flex-wrap: wrap; word-wrap: break-word"> |
||||
{{ snapInfo.recoverMessage }} |
||||
</span> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button @click="dialogVisiable = true" type="primary"> |
||||
{{ $t('commons.button.retry') }} |
||||
</el-button> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card style="margin-top: 20px" v-if="snapInfo.recoverStatus === 'Failed'"> |
||||
<template #header> |
||||
<div class="card-header"> |
||||
<span>{{ $t('setting.rollback') }}</span> |
||||
</div> |
||||
</template> |
||||
<div v-if="!snapInfo.rollbackStatus"> |
||||
<div v-if="snapInfo.lastRollbackedAt"> |
||||
<el-form-item :label="$t('commons.table.status')"> |
||||
<el-tag type="success"> |
||||
{{ $t('commons.table.statusSuccess') }} |
||||
</el-tag> |
||||
<el-button @click="rollbackSnapshot" style="margin-left: 10px" type="primary"> |
||||
{{ $t('setting.recover') }} |
||||
</el-button> |
||||
</el-form-item> |
||||
<el-form-item :label="$t('setting.lastRollbackAt')"> |
||||
{{ snapInfo.lastRollbackedAt }} |
||||
</el-form-item> |
||||
</div> |
||||
<div v-else> |
||||
<el-form-item> |
||||
<el-tag type="info"> |
||||
{{ $t('setting.noRollbackRecord') }} |
||||
</el-tag> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button @click="rollbackSnapshot" type="primary"> |
||||
{{ $t('setting.rollback') }} |
||||
</el-button> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
<div v-else> |
||||
<el-form-item :label="$t('commons.table.status')"> |
||||
<el-tag type="success" v-if="snapInfo.rollbackStatus === 'Success'"> |
||||
{{ $t('commons.table.statusSuccess') }} |
||||
</el-tag> |
||||
<el-tag type="danger" v-if="snapInfo.rollbackStatus === 'Failed'"> |
||||
{{ $t('commons.table.statusFailed') }} |
||||
</el-tag> |
||||
<el-tag type="info" v-if="snapInfo.rollbackStatus === 'Waiting'"> |
||||
{{ $t('commons.table.statusWaiting') }} |
||||
</el-tag> |
||||
<el-button |
||||
style="margin-left: 15px" |
||||
:disabled="snapInfo.rollbackStatus !== 'Success'" |
||||
@click="rollbackSnapshot" |
||||
> |
||||
{{ $t('setting.rollback') }} |
||||
</el-button> |
||||
</el-form-item> |
||||
<el-form-item |
||||
:label="$t('setting.lastRollbackAt')" |
||||
v-if="snapInfo.rollbackStatus !== 'Waiting'" |
||||
> |
||||
{{ snapInfo.lastRollbackedAt }} |
||||
</el-form-item> |
||||
<div v-if="snapInfo.rollbackStatus === 'Failed'"> |
||||
<el-form-item :label="$t('commons.button.log')"> |
||||
<span style="word-break: break-all; flex-wrap: wrap; word-wrap: break-word"> |
||||
{{ snapInfo.rollbackMessage }} |
||||
</span> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button @click="rollbackSnapshot()" type="primary"> |
||||
{{ $t('commons.button.retry') }} |
||||
</el-button> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
</el-form> |
||||
</el-drawer> |
||||
<el-dialog v-model="dialogVisiable" :destroy-on-close="true" :close-on-click-modal="false" width="30%"> |
||||
<template #header> |
||||
<div class="card-header"> |
||||
<span>{{ $t('commons.button.retry') }}</span> |
||||
</div> |
||||
</template> |
||||
<div> |
||||
<span>{{ $t('setting.reDownload') }}</span> |
||||
<el-switch style="margin-left: 15px" v-model="reDownload" /> |
||||
</div> |
||||
<div style="margin-top: 15px"> |
||||
<span>{{ $t('setting.recoverHelper', [snapInfo.name]) }}</span> |
||||
</div> |
||||
<template #footer> |
||||
<span class="dialog-footer"> |
||||
<el-button :disabled="loading" @click="dialogVisiable = false"> |
||||
{{ $t('commons.button.cancel') }} |
||||
</el-button> |
||||
<el-button :disabled="loading" type="primary" @click="doRecover(false)"> |
||||
{{ $t('commons.button.confirm') }} |
||||
</el-button> |
||||
</span> |
||||
</template> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup lang="ts"> |
||||
import { ref } from 'vue'; |
||||
import { Setting } from '@/api/interface/setting'; |
||||
import { ElMessage, ElMessageBox } from 'element-plus'; |
||||
import i18n from '@/lang'; |
||||
import { snapshotRecover, snapshotRollback } from '@/api/modules/setting'; |
||||
|
||||
const drawerVisiable = ref(false); |
||||
const snapInfo = ref(); |
||||
const loading = ref(); |
||||
|
||||
const dialogVisiable = ref(); |
||||
const reDownload = ref(); |
||||
|
||||
interface DialogProps { |
||||
snapInfo: Setting.SnapshotInfo; |
||||
} |
||||
const acceptParams = (params: DialogProps): void => { |
||||
snapInfo.value = params.snapInfo; |
||||
drawerVisiable.value = true; |
||||
}; |
||||
|
||||
const doRecover = async (isNew: boolean) => { |
||||
loading.value = true; |
||||
await snapshotRecover({ id: snapInfo.value.id, isNew: isNew, reDownload: reDownload.value }) |
||||
.then(() => { |
||||
loading.value = false; |
||||
dialogVisiable.value = false; |
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess')); |
||||
}) |
||||
.catch(() => { |
||||
loading.value = false; |
||||
}); |
||||
}; |
||||
|
||||
const recoverSnapshot = async (isNew: boolean) => { |
||||
ElMessageBox.confirm(i18n.global.t('setting.recoverHelper', [snapInfo.value.name]), { |
||||
confirmButtonText: i18n.global.t('commons.button.confirm'), |
||||
cancelButtonText: i18n.global.t('commons.button.cancel'), |
||||
type: 'info', |
||||
}).then(async () => { |
||||
doRecover(isNew); |
||||
}); |
||||
}; |
||||
|
||||
const rollbackSnapshot = async () => { |
||||
ElMessageBox.confirm(i18n.global.t('setting.rollbackHelper'), { |
||||
confirmButtonText: i18n.global.t('commons.button.confirm'), |
||||
cancelButtonText: i18n.global.t('commons.button.cancel'), |
||||
type: 'info', |
||||
}).then(async () => { |
||||
loading.value = true; |
||||
await snapshotRollback({ id: snapInfo.value.id, isNew: false, reDownload: false }) |
||||
.then(() => { |
||||
loading.value = false; |
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess')); |
||||
}) |
||||
.catch(() => { |
||||
loading.value = false; |
||||
}); |
||||
}); |
||||
}; |
||||
|
||||
defineExpose({ |
||||
acceptParams, |
||||
}); |
||||
</script> |
@ -0,0 +1,15 @@
|
||||
{ |
||||
"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" |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,21 @@
|
||||
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. |
@ -0,0 +1,356 @@
|
||||
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; |
@ -0,0 +1,26 @@
|
||||
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; |
@ -0,0 +1,39 @@
|
||||
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; |
@ -0,0 +1,77 @@
|
||||
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; |
@ -0,0 +1,111 @@
|
||||
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; |
@ -0,0 +1,96 @@
|
||||
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; |
@ -0,0 +1,27 @@
|
||||
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; |
@ -0,0 +1,811 @@
|
||||
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'; |
@ -0,0 +1,328 @@
|
||||
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; |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,124 @@
|
||||
{ |
||||
"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…
Reference in new issue