vue-editify 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -3
- package/examples/App.vue +62 -61
- package/examples/main.ts +4 -4
- package/lib/components/button/button.vue.d.ts +11 -11
- package/lib/components/checkbox/checkbox.vue.d.ts +8 -8
- package/lib/components/colors/colors.vue.d.ts +4 -4
- package/lib/components/icon/icon.vue.d.ts +1 -1
- package/lib/components/insertImage/insertImage.vue.d.ts +9 -9
- package/lib/components/insertLink/insertLink.vue.d.ts +2 -2
- package/lib/components/insertTable/insertTable.vue.d.ts +2 -2
- package/lib/components/insertVideo/insertVideo.vue.d.ts +9 -9
- package/lib/components/layer/layer.vue.d.ts +9 -9
- package/lib/components/menu/menu.vue.d.ts +4 -4
- package/lib/components/toolbar/toolbar.vue.d.ts +9 -9
- package/lib/components/tooltip/tooltip.vue.d.ts +1 -1
- package/lib/components/triangle/triangle.vue.d.ts +4 -4
- package/lib/editify/editify.vue.d.ts +68 -68
- package/lib/editify.es.js +17 -17
- package/lib/editify.umd.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +45 -45
- package/src/components/button/button.less +145 -145
- package/src/components/button/button.vue +197 -197
- package/src/components/button/props.ts +95 -95
- package/src/components/checkbox/checkbox.less +84 -84
- package/src/components/checkbox/checkbox.vue +68 -68
- package/src/components/checkbox/props.ts +49 -49
- package/src/components/colors/colors.less +75 -75
- package/src/components/colors/colors.vue +36 -36
- package/src/components/colors/props.ts +29 -29
- package/src/components/icon/icon.less +14 -14
- package/src/components/icon/icon.vue +12 -12
- package/src/components/icon/props.ts +11 -11
- package/src/components/insertImage/insertImage.less +135 -135
- package/src/components/insertImage/insertImage.vue +146 -146
- package/src/components/insertImage/props.ts +43 -43
- package/src/components/insertLink/insertLink.less +64 -64
- package/src/components/insertLink/insertLink.vue +58 -58
- package/src/components/insertLink/props.ts +16 -16
- package/src/components/insertTable/insertTable.less +54 -54
- package/src/components/insertTable/insertTable.vue +85 -85
- package/src/components/insertTable/props.ts +27 -27
- package/src/components/insertVideo/insertVideo.less +135 -135
- package/src/components/insertVideo/insertVideo.vue +146 -146
- package/src/components/insertVideo/props.ts +43 -43
- package/src/components/layer/layer.less +49 -49
- package/src/components/layer/layer.vue +598 -598
- package/src/components/layer/props.ts +71 -71
- package/src/components/menu/menu.less +63 -63
- package/src/components/menu/menu.vue +1569 -1569
- package/src/components/menu/props.ts +17 -17
- package/src/components/toolbar/props.ts +35 -35
- package/src/components/toolbar/toolbar.less +89 -89
- package/src/components/toolbar/toolbar.vue +1101 -1101
- package/src/components/tooltip/props.ts +21 -21
- package/src/components/tooltip/tooltip.less +23 -23
- package/src/components/tooltip/tooltip.vue +37 -37
- package/src/components/triangle/props.ts +26 -26
- package/src/components/triangle/triangle.less +79 -79
- package/src/components/triangle/triangle.vue +65 -65
- package/src/core/function.ts +1144 -1144
- package/src/core/rule.ts +259 -259
- package/src/core/tool.ts +1137 -1137
- package/src/css/base.less +30 -30
- package/src/css/hljs.less +54 -54
- package/src/editify/editify.less +404 -403
- package/src/editify/editify.vue +803 -803
- package/src/editify/props.ts +156 -156
- package/src/hljs/index.ts +197 -197
- package/src/icon/iconfont.css +219 -219
- package/src/index.ts +32 -32
- package/src/locale/en_US.ts +88 -88
- package/src/locale/index.ts +12 -12
- package/src/locale/zh_CN.ts +88 -88
- package/tsconfig.json +27 -27
- package/tsconfig.node.json +11 -11
- package/vite-env.d.ts +1 -1
- package/vite.config.ts +42 -42
package/src/locale/index.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import { en_US } from './en_US'
|
2
|
-
import { zh_CN } from './zh_CN'
|
3
|
-
|
4
|
-
//语言类型
|
5
|
-
export type LocaleType = 'zh_CN' | 'en_US'
|
6
|
-
|
7
|
-
//翻译方法
|
8
|
-
export const trans = (locale: LocaleType) => {
|
9
|
-
return (key: string) => {
|
10
|
-
return { zh_CN, en_US }[locale][key]
|
11
|
-
}
|
12
|
-
}
|
1
|
+
import { en_US } from './en_US'
|
2
|
+
import { zh_CN } from './zh_CN'
|
3
|
+
|
4
|
+
//语言类型
|
5
|
+
export type LocaleType = 'zh_CN' | 'en_US'
|
6
|
+
|
7
|
+
//翻译方法
|
8
|
+
export const trans = (locale: LocaleType) => {
|
9
|
+
return (key: string) => {
|
10
|
+
return { zh_CN, en_US }[locale][key]
|
11
|
+
}
|
12
|
+
}
|
package/src/locale/zh_CN.ts
CHANGED
@@ -1,88 +1,88 @@
|
|
1
|
-
import { ObjectType } from '../core/tool'
|
2
|
-
|
3
|
-
export const zh_CN: ObjectType = {
|
4
|
-
textWrapUp: '向上换行',
|
5
|
-
textWrapDown: '向下换行',
|
6
|
-
insertRowTop: '向前插入行',
|
7
|
-
insertRowBottom: '向后插入行',
|
8
|
-
insertColumnLeft: '向前插入列',
|
9
|
-
insertColumnRight: '向后插入列',
|
10
|
-
deleteRow: '删除行',
|
11
|
-
deleteColumn: '删除列',
|
12
|
-
deleteTable: '删除表格',
|
13
|
-
selectLanguages: '选择语言',
|
14
|
-
autoRecognize: '自动识别',
|
15
|
-
linkAddress: '链接地址',
|
16
|
-
newWindowOpen: '新窗口打开',
|
17
|
-
removeLink: '移除链接',
|
18
|
-
viewLink: '查看链接',
|
19
|
-
linkUrlEnterPlaceholder: '请输入链接地址',
|
20
|
-
linkTextEnterPlaceholder: '请输入链接文本',
|
21
|
-
width30: '30%宽度',
|
22
|
-
width50: '50%宽度',
|
23
|
-
width100: '100%宽度',
|
24
|
-
deleteImage: '删除图片',
|
25
|
-
autoplay: '自动播放',
|
26
|
-
disabledAutoplay: '关闭自动播放',
|
27
|
-
loop: '循环播放',
|
28
|
-
disabledLoop: '关闭循环播放',
|
29
|
-
muted: '静音',
|
30
|
-
unmuted: '播放声音',
|
31
|
-
controls: '播放控制',
|
32
|
-
deleteVideo: '删除视频',
|
33
|
-
heading: '标题',
|
34
|
-
bold: '粗体',
|
35
|
-
h1: '一级标题',
|
36
|
-
h2: '二级标题',
|
37
|
-
h3: '三级标题',
|
38
|
-
h4: '四级标题',
|
39
|
-
h5: '五级标题',
|
40
|
-
h6: '六级标题',
|
41
|
-
text: '正文',
|
42
|
-
italic: '斜体',
|
43
|
-
orderList: '有序列表',
|
44
|
-
unorderList: '无序列表',
|
45
|
-
strikethrough: '删除线',
|
46
|
-
underline: '下划线',
|
47
|
-
code: '行内代码',
|
48
|
-
superscript: '上标',
|
49
|
-
subscript: '下标',
|
50
|
-
fontSize: '字号',
|
51
|
-
fontFamily: '字体',
|
52
|
-
defaultFontFamily: '默认字体',
|
53
|
-
foreColor: '前景色',
|
54
|
-
defaultColor: '默认颜色',
|
55
|
-
backColor: '背景色',
|
56
|
-
formatClear: '清除格式',
|
57
|
-
defaultSize: '默认字号',
|
58
|
-
totalWordCount: '总字数:',
|
59
|
-
align: '对齐方式',
|
60
|
-
undo: '撤销',
|
61
|
-
redo: '重做',
|
62
|
-
quote: '引用',
|
63
|
-
lineHeight: '行高',
|
64
|
-
indent: '缩进',
|
65
|
-
insertLink: '插入链接',
|
66
|
-
insertImage: '插入图片',
|
67
|
-
remoteImage: '网络图片',
|
68
|
-
uploadImage: '上传图片',
|
69
|
-
imageUrlPlaceholder: '请输入图片地址',
|
70
|
-
insert: '插入',
|
71
|
-
insertVideo: '插入视频',
|
72
|
-
remoteVideo: '网络视频',
|
73
|
-
uploadVideo: '上传视频',
|
74
|
-
videoUrlPlaceholder: '请输入视频地址',
|
75
|
-
insertTable: '插入表格',
|
76
|
-
inserCodeBlock: '插入代码块',
|
77
|
-
sourceView: '代码视图',
|
78
|
-
task: '待办',
|
79
|
-
indentIncrease: '增加缩进',
|
80
|
-
indentDecrease: '减少缩进',
|
81
|
-
alignLeft: '左对齐',
|
82
|
-
alignCenter: '居中对齐',
|
83
|
-
alignRight: '右对齐',
|
84
|
-
alignJustify: '两端对齐',
|
85
|
-
defaultLineHeight: '默认行高',
|
86
|
-
auto: '自适应',
|
87
|
-
fullScreen: '全屏'
|
88
|
-
}
|
1
|
+
import { ObjectType } from '../core/tool'
|
2
|
+
|
3
|
+
export const zh_CN: ObjectType = {
|
4
|
+
textWrapUp: '向上换行',
|
5
|
+
textWrapDown: '向下换行',
|
6
|
+
insertRowTop: '向前插入行',
|
7
|
+
insertRowBottom: '向后插入行',
|
8
|
+
insertColumnLeft: '向前插入列',
|
9
|
+
insertColumnRight: '向后插入列',
|
10
|
+
deleteRow: '删除行',
|
11
|
+
deleteColumn: '删除列',
|
12
|
+
deleteTable: '删除表格',
|
13
|
+
selectLanguages: '选择语言',
|
14
|
+
autoRecognize: '自动识别',
|
15
|
+
linkAddress: '链接地址',
|
16
|
+
newWindowOpen: '新窗口打开',
|
17
|
+
removeLink: '移除链接',
|
18
|
+
viewLink: '查看链接',
|
19
|
+
linkUrlEnterPlaceholder: '请输入链接地址',
|
20
|
+
linkTextEnterPlaceholder: '请输入链接文本',
|
21
|
+
width30: '30%宽度',
|
22
|
+
width50: '50%宽度',
|
23
|
+
width100: '100%宽度',
|
24
|
+
deleteImage: '删除图片',
|
25
|
+
autoplay: '自动播放',
|
26
|
+
disabledAutoplay: '关闭自动播放',
|
27
|
+
loop: '循环播放',
|
28
|
+
disabledLoop: '关闭循环播放',
|
29
|
+
muted: '静音',
|
30
|
+
unmuted: '播放声音',
|
31
|
+
controls: '播放控制',
|
32
|
+
deleteVideo: '删除视频',
|
33
|
+
heading: '标题',
|
34
|
+
bold: '粗体',
|
35
|
+
h1: '一级标题',
|
36
|
+
h2: '二级标题',
|
37
|
+
h3: '三级标题',
|
38
|
+
h4: '四级标题',
|
39
|
+
h5: '五级标题',
|
40
|
+
h6: '六级标题',
|
41
|
+
text: '正文',
|
42
|
+
italic: '斜体',
|
43
|
+
orderList: '有序列表',
|
44
|
+
unorderList: '无序列表',
|
45
|
+
strikethrough: '删除线',
|
46
|
+
underline: '下划线',
|
47
|
+
code: '行内代码',
|
48
|
+
superscript: '上标',
|
49
|
+
subscript: '下标',
|
50
|
+
fontSize: '字号',
|
51
|
+
fontFamily: '字体',
|
52
|
+
defaultFontFamily: '默认字体',
|
53
|
+
foreColor: '前景色',
|
54
|
+
defaultColor: '默认颜色',
|
55
|
+
backColor: '背景色',
|
56
|
+
formatClear: '清除格式',
|
57
|
+
defaultSize: '默认字号',
|
58
|
+
totalWordCount: '总字数:',
|
59
|
+
align: '对齐方式',
|
60
|
+
undo: '撤销',
|
61
|
+
redo: '重做',
|
62
|
+
quote: '引用',
|
63
|
+
lineHeight: '行高',
|
64
|
+
indent: '缩进',
|
65
|
+
insertLink: '插入链接',
|
66
|
+
insertImage: '插入图片',
|
67
|
+
remoteImage: '网络图片',
|
68
|
+
uploadImage: '上传图片',
|
69
|
+
imageUrlPlaceholder: '请输入图片地址',
|
70
|
+
insert: '插入',
|
71
|
+
insertVideo: '插入视频',
|
72
|
+
remoteVideo: '网络视频',
|
73
|
+
uploadVideo: '上传视频',
|
74
|
+
videoUrlPlaceholder: '请输入视频地址',
|
75
|
+
insertTable: '插入表格',
|
76
|
+
inserCodeBlock: '插入代码块',
|
77
|
+
sourceView: '代码视图',
|
78
|
+
task: '待办',
|
79
|
+
indentIncrease: '增加缩进',
|
80
|
+
indentDecrease: '减少缩进',
|
81
|
+
alignLeft: '左对齐',
|
82
|
+
alignCenter: '居中对齐',
|
83
|
+
alignRight: '右对齐',
|
84
|
+
alignJustify: '两端对齐',
|
85
|
+
defaultLineHeight: '默认行高',
|
86
|
+
auto: '自适应',
|
87
|
+
fullScreen: '全屏'
|
88
|
+
}
|
package/tsconfig.json
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"target": "ES2020",
|
4
|
-
"useDefineForClassFields": true,
|
5
|
-
"module": "ESNext",
|
6
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
7
|
-
"skipLibCheck": true,
|
8
|
-
"allowSyntheticDefaultImports": true,
|
9
|
-
"types": ["node"],
|
10
|
-
|
11
|
-
/* Bundler mode */
|
12
|
-
"moduleResolution": "bundler",
|
13
|
-
"allowImportingTsExtensions": true,
|
14
|
-
"resolveJsonModule": true,
|
15
|
-
"isolatedModules": true,
|
16
|
-
"noEmit": true,
|
17
|
-
"jsx": "preserve",
|
18
|
-
|
19
|
-
/* Linting */
|
20
|
-
"strict": true,
|
21
|
-
"noUnusedLocals": true,
|
22
|
-
"noUnusedParameters": true,
|
23
|
-
"noFallthroughCasesInSwitch": true
|
24
|
-
},
|
25
|
-
"include": ["src/**/*.ts", "src/**/*.vue", "vite-env.d.ts"],
|
26
|
-
"references": [{ "path": "./tsconfig.node.json" }]
|
27
|
-
}
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ES2020",
|
4
|
+
"useDefineForClassFields": true,
|
5
|
+
"module": "ESNext",
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
7
|
+
"skipLibCheck": true,
|
8
|
+
"allowSyntheticDefaultImports": true,
|
9
|
+
"types": ["node"],
|
10
|
+
|
11
|
+
/* Bundler mode */
|
12
|
+
"moduleResolution": "bundler",
|
13
|
+
"allowImportingTsExtensions": true,
|
14
|
+
"resolveJsonModule": true,
|
15
|
+
"isolatedModules": true,
|
16
|
+
"noEmit": true,
|
17
|
+
"jsx": "preserve",
|
18
|
+
|
19
|
+
/* Linting */
|
20
|
+
"strict": true,
|
21
|
+
"noUnusedLocals": true,
|
22
|
+
"noUnusedParameters": true,
|
23
|
+
"noFallthroughCasesInSwitch": true
|
24
|
+
},
|
25
|
+
"include": ["src/**/*.ts", "src/**/*.vue", "vite-env.d.ts"],
|
26
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
27
|
+
}
|
package/tsconfig.node.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"composite": true,
|
4
|
-
"skipLibCheck": true,
|
5
|
-
"module": "ESNext",
|
6
|
-
"moduleResolution": "bundler",
|
7
|
-
"allowSyntheticDefaultImports": true,
|
8
|
-
"strict": true
|
9
|
-
},
|
10
|
-
"include": ["vite.config.ts"]
|
11
|
-
}
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"composite": true,
|
4
|
+
"skipLibCheck": true,
|
5
|
+
"module": "ESNext",
|
6
|
+
"moduleResolution": "bundler",
|
7
|
+
"allowSyntheticDefaultImports": true,
|
8
|
+
"strict": true
|
9
|
+
},
|
10
|
+
"include": ["vite.config.ts"]
|
11
|
+
}
|
package/vite-env.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
/// <reference types="vite/client" />
|
1
|
+
/// <reference types="vite/client" />
|
package/vite.config.ts
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
import { defineConfig } from 'vite'
|
2
|
-
import vue from '@vitejs/plugin-vue'
|
3
|
-
import dts from 'vite-plugin-dts'
|
4
|
-
import path from 'path'
|
5
|
-
|
6
|
-
export default defineConfig({
|
7
|
-
plugins: [vue(), dts()],
|
8
|
-
build: {
|
9
|
-
//打包后的目录名称
|
10
|
-
outDir: 'lib',
|
11
|
-
minify: 'terser',
|
12
|
-
lib: {
|
13
|
-
entry: path.resolve(__dirname, 'src/index.ts'),
|
14
|
-
name: 'editify',
|
15
|
-
fileName: format => `editify.${format}.js`
|
16
|
-
},
|
17
|
-
rollupOptions: {
|
18
|
-
// 确保外部化处理那些你不想打包进库的依赖
|
19
|
-
external: ['vue'],
|
20
|
-
output: {
|
21
|
-
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
22
|
-
globals: {
|
23
|
-
vue: 'Vue'
|
24
|
-
},
|
25
|
-
exports: 'named'
|
26
|
-
}
|
27
|
-
},
|
28
|
-
sourcemap: false //是否构建source map 文件
|
29
|
-
},
|
30
|
-
css: {
|
31
|
-
preprocessorOptions: {
|
32
|
-
less: {
|
33
|
-
// 使用 less 编写样式的 UI 库(如 antd)时建议加入这个设置
|
34
|
-
javascriptEnabled: true,
|
35
|
-
additionalData: `@import "src/css/base.less";`
|
36
|
-
}
|
37
|
-
}
|
38
|
-
},
|
39
|
-
server: {
|
40
|
-
host: '0.0.0.0'
|
41
|
-
}
|
42
|
-
})
|
1
|
+
import { defineConfig } from 'vite'
|
2
|
+
import vue from '@vitejs/plugin-vue'
|
3
|
+
import dts from 'vite-plugin-dts'
|
4
|
+
import path from 'path'
|
5
|
+
|
6
|
+
export default defineConfig({
|
7
|
+
plugins: [vue(), dts()],
|
8
|
+
build: {
|
9
|
+
//打包后的目录名称
|
10
|
+
outDir: 'lib',
|
11
|
+
minify: 'terser',
|
12
|
+
lib: {
|
13
|
+
entry: path.resolve(__dirname, 'src/index.ts'),
|
14
|
+
name: 'editify',
|
15
|
+
fileName: format => `editify.${format}.js`
|
16
|
+
},
|
17
|
+
rollupOptions: {
|
18
|
+
// 确保外部化处理那些你不想打包进库的依赖
|
19
|
+
external: ['vue'],
|
20
|
+
output: {
|
21
|
+
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
22
|
+
globals: {
|
23
|
+
vue: 'Vue'
|
24
|
+
},
|
25
|
+
exports: 'named'
|
26
|
+
}
|
27
|
+
},
|
28
|
+
sourcemap: false //是否构建source map 文件
|
29
|
+
},
|
30
|
+
css: {
|
31
|
+
preprocessorOptions: {
|
32
|
+
less: {
|
33
|
+
// 使用 less 编写样式的 UI 库(如 antd)时建议加入这个设置
|
34
|
+
javascriptEnabled: true,
|
35
|
+
additionalData: `@import "src/css/base.less";`
|
36
|
+
}
|
37
|
+
}
|
38
|
+
},
|
39
|
+
server: {
|
40
|
+
host: '0.0.0.0'
|
41
|
+
}
|
42
|
+
})
|