@blueking/ai-ui-sdk 0.1.12-beta.37 → 0.1.12-beta.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/render-aside/index.vue.css +9 -9
- package/dist/components/render-aside/index.vue.js +1 -1
- package/dist/components/render-auth/auth-dialog.script.vue.js.js +8 -2
- package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
- package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
- package/dist/components/render-auto-refresh/index.vue.css +8 -8
- package/dist/components/render-auto-refresh/index.vue.js +1 -1
- package/dist/components/render-checkbox/index.vue.css +9 -9
- package/dist/components/render-checkbox/index.vue.js +1 -1
- package/dist/components/render-choose-tag/index.vue.css +7 -7
- package/dist/components/render-choose-tag/index.vue.js +1 -1
- package/dist/components/render-collapse/index.vue.css +2 -2
- package/dist/components/render-collapse/index.vue.js +1 -1
- package/dist/components/render-dataset/components/batch-review-dataset-data/index.script.vue.js.js +24 -6
- package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
- package/dist/components/render-dataset/components/edit-dataset-data/index.script.vue.js.js +13 -3
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
- package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js.js +4 -1
- package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset/dataset-footer.script.vue.js.js +8 -2
- package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.script.vue.js.js +137 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +10 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.d.ts +8 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +5 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/category.script.vue.js.js +10 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/category.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/file.script.vue.js.js +12 -3
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.script.vue.js.js +8 -2
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.script.vue.js.js +27 -14
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/manual.script.vue.js.js +9 -3
- package/dist/components/render-dataset/components/plus-dataset-data/index.script.vue.js.js +4 -1
- package/dist/components/render-dataset/components/review-dataset-data/index.script.vue.js.js +21 -5
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/source-type-icon/index.script.vue.js.js +3 -0
- package/dist/components/render-dataset/index.vue.css +1 -1
- package/dist/components/render-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset-detail/components/header.script.vue.js.js +5 -1
- package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.script.vue.js.js +4 -1
- package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +20 -5
- package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +8 -2
- package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
- package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
- package/dist/components/render-dataset-list/components/main.script.vue.js.js +9 -1
- package/dist/components/render-dataset-list/components/main.vue.css +3 -3
- package/dist/components/render-dataset-list/components/main.vue.d.ts +1 -0
- package/dist/components/render-dataset-list/components/main.vue.js +1 -1
- package/dist/components/render-dataset-list/components/table.script.vue.js.js +31 -22
- package/dist/components/render-dataset-list/components/table.vue.d.ts +1 -0
- package/dist/components/render-dataset-list/index.script.vue.js.js +5 -0
- package/dist/components/render-dataset-list/index.vue.d.ts +1 -0
- package/dist/components/render-expand-collapse/index.vue.css +3 -3
- package/dist/components/render-expand-collapse/index.vue.js +1 -1
- package/dist/components/render-file-card/index.vue.css +11 -11
- package/dist/components/render-file-card/index.vue.js +1 -1
- package/dist/components/render-file-type-icon/index.vue.css +5 -5
- package/dist/components/render-file-type-icon/index.vue.js +1 -1
- package/dist/components/render-header/index.vue.css +5 -5
- package/dist/components/render-header/index.vue.js +1 -1
- package/dist/components/render-markdown/mark-down-code.d.ts +2 -0
- package/dist/components/render-markdown/mark-down-code.ts.js +171 -0
- package/dist/components/render-markdown/mark-down-emoji.d.ts +2 -0
- package/dist/components/render-markdown/mark-down-emoji.ts.js +4 -0
- package/dist/components/render-markdown/mark-down.d.ts +49 -0
- package/dist/components/render-markdown/mark-down.postcss.css +148 -0
- package/dist/components/render-markdown/mark-down.ts.js +145 -0
- package/dist/components/render-router-tab/index.vue.css +3 -3
- package/dist/components/render-router-tab/index.vue.js +1 -1
- package/dist/components.d.ts +2 -1
- package/dist/components.ts.js +2 -1
- package/dist/css/fonts/iconcool.eot +0 -0
- package/dist/css/fonts/iconcool.svg +3 -0
- package/dist/css/fonts/iconcool.ttf +0 -0
- package/dist/css/fonts/iconcool.woff +0 -0
- package/dist/css/iconcool.js +2 -2
- package/dist/css/style.css +3 -0
- package/dist/hooks/use-chat.d.ts +4 -0
- package/dist/hooks/use-dataset-http.d.ts +1 -0
- package/dist/hooks/use-dataset-http.ts.js +8 -1
- package/dist/http/helper/agent.ts.js +3 -27
- package/dist/http/helper/dataset.d.ts +7 -1
- package/dist/http/helper/dataset.ts.js +17 -0
- package/dist/http/helper/knowledge.ts.js +4 -1
- package/dist/types/agent.d.ts +0 -52
- package/dist/types/dataset.d.ts +22 -0
- package/dist/types/enum.d.ts +4 -0
- package/dist/types/enum.ts.js +5 -0
- package/dist/types/knowledge.d.ts +3 -1
- package/package.json +6 -4
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
const languageSuffixMap = {
|
|
2
|
+
c: '.c',
|
|
3
|
+
'c++': '.cpp',
|
|
4
|
+
java: '.java',
|
|
5
|
+
python: '.py',
|
|
6
|
+
html: '.html',
|
|
7
|
+
css: '.css',
|
|
8
|
+
javascript: '.js',
|
|
9
|
+
js: '.js',
|
|
10
|
+
php: '.php',
|
|
11
|
+
ruby: '.rb',
|
|
12
|
+
swift: '.swift',
|
|
13
|
+
go: '.go',
|
|
14
|
+
perl: '.pl',
|
|
15
|
+
sql: '.sql',
|
|
16
|
+
xml: '.xml',
|
|
17
|
+
json: '.json',
|
|
18
|
+
vue: '.vue',
|
|
19
|
+
rust: '.rs',
|
|
20
|
+
jsx: '.jsx',
|
|
21
|
+
tsx: '.tsx',
|
|
22
|
+
typescript: '.ts',
|
|
23
|
+
ts: '.ts',
|
|
24
|
+
bash: '.sh'
|
|
25
|
+
};
|
|
26
|
+
const getLanguageSuffix = (name)=>languageSuffixMap[name.toLowerCase()] || '.txt';
|
|
27
|
+
let originalFence;
|
|
28
|
+
// 自定义代码块
|
|
29
|
+
export const MarkDownCodePlugin = (markdownIt)=>{
|
|
30
|
+
// 如果 originalFence 不存在,则获取原始的 fence 函数,防止嵌套调用
|
|
31
|
+
if (!originalFence) {
|
|
32
|
+
originalFence = markdownIt.renderer.rules.fence;
|
|
33
|
+
}
|
|
34
|
+
// 重写 fence 规则
|
|
35
|
+
markdownIt.block.ruler.at('fence', (state, startLine, endLine, silent)=>{
|
|
36
|
+
let pos = state.bMarks[startLine] + state.tShift[startLine];
|
|
37
|
+
let max = state.eMarks[startLine];
|
|
38
|
+
// 检查是否缩进过多
|
|
39
|
+
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
// 检查是否有足够的字符
|
|
43
|
+
if (pos + 3 > max) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
const marker = state.src.charCodeAt(pos);
|
|
47
|
+
// 检查是否是有效的标记字符
|
|
48
|
+
if (marker !== 0x7E /* ~ */ && marker !== 0x60 /* ` */ ) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
// 获取标记的长度
|
|
52
|
+
let mem = pos;
|
|
53
|
+
pos = state.skipChars(pos, marker);
|
|
54
|
+
const len = pos - mem;
|
|
55
|
+
if (len < 3) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
const markup = state.src.slice(mem, pos);
|
|
59
|
+
const params = state.src.slice(pos, max);
|
|
60
|
+
// 检查参数中是否包含标记字符
|
|
61
|
+
if (marker === 0x60 /* ` */ ) {
|
|
62
|
+
if (params.indexOf(String.fromCharCode(marker)) >= 0) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// 验证模式直接返回
|
|
67
|
+
if (silent) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
// 寻找结束标记
|
|
71
|
+
let nextLine = startLine;
|
|
72
|
+
let haveEndMarker = false;
|
|
73
|
+
for(;;){
|
|
74
|
+
nextLine += 1;
|
|
75
|
+
if (nextLine >= endLine) {
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
79
|
+
mem = pos;
|
|
80
|
+
max = state.eMarks[nextLine];
|
|
81
|
+
if (pos < max && state.sCount[nextLine] < state.blkIndent) {
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
// 如果不是标记字符,继续
|
|
85
|
+
if (state.src.charCodeAt(pos) !== marker) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
// 检查标记长度
|
|
89
|
+
if (state.sCount[nextLine] - state.blkIndent >= 4) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
pos = state.skipChars(pos, marker);
|
|
93
|
+
// 结束标记必须至少和开始标记一样长
|
|
94
|
+
if (pos - mem < len) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
// 检查标记后是否只有空格
|
|
98
|
+
pos = state.skipSpaces(pos);
|
|
99
|
+
if (pos < max) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
haveEndMarker = true;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
// 设置结束行
|
|
106
|
+
state.line = nextLine + (haveEndMarker ? 1 : 0);
|
|
107
|
+
// 创建 token
|
|
108
|
+
const token = state.push('fence', 'code', 0);
|
|
109
|
+
token.info = params;
|
|
110
|
+
token.content = state.getLines(startLine + 1, nextLine, state.sCount[startLine], true);
|
|
111
|
+
token.markup = markup;
|
|
112
|
+
token.map = [
|
|
113
|
+
startLine,
|
|
114
|
+
state.line
|
|
115
|
+
];
|
|
116
|
+
token.haveEndMarker = haveEndMarker;
|
|
117
|
+
return true;
|
|
118
|
+
}, {
|
|
119
|
+
alt: [
|
|
120
|
+
'paragraph',
|
|
121
|
+
'reference',
|
|
122
|
+
'blockquote',
|
|
123
|
+
'list'
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
// 自定义代码块渲染
|
|
127
|
+
markdownIt.renderer.rules.fence = (tokens, idx, options, env, self)=>{
|
|
128
|
+
const token = tokens[idx];
|
|
129
|
+
const hasEndBlock = token.haveEndMarker;
|
|
130
|
+
let language = token.info.trim();
|
|
131
|
+
let code = token.content;
|
|
132
|
+
// 原始渲染
|
|
133
|
+
const originalCode = originalFence(tokens, idx, options, env, self);
|
|
134
|
+
// 1. 如果代码块和语言不为空,则渲染代码块
|
|
135
|
+
if (code.trim() && language && hasEndBlock) {
|
|
136
|
+
const encodeCode = encodeURIComponent(code);
|
|
137
|
+
return `<section class="full-screen-wrap markdown-body" style="background-color: #2e2e2e;">
|
|
138
|
+
<section class="code-header g-flex-row">
|
|
139
|
+
<span>${language}</span>
|
|
140
|
+
<span class="g-flex-row">
|
|
141
|
+
<i class="ai-ui-sdk-icon ai-ui-sdk-un-full-screen click-un-full-screen"></i>
|
|
142
|
+
<i class="ai-ui-sdk-icon ai-ui-sdk-full-screen click-full-screen"></i>
|
|
143
|
+
<i class="ai-ui-sdk-icon ai-ui-sdk-copy click-copy" data-clipboard-text="${encodeCode}"></i>
|
|
144
|
+
<i class="ai-ui-sdk-icon ai-ui-sdk-dongzuo-xiazai click-download" data-clipboard-text="${encodeCode}" data-file-name="ai${getLanguageSuffix(language)}"></i>
|
|
145
|
+
</span>
|
|
146
|
+
</section>
|
|
147
|
+
${originalCode}
|
|
148
|
+
</section>`;
|
|
149
|
+
}
|
|
150
|
+
// 2. 如果有结束标记并且有代码内容,则返回原始代码块
|
|
151
|
+
if (code.trim() && hasEndBlock) {
|
|
152
|
+
return originalCode;
|
|
153
|
+
}
|
|
154
|
+
// 3. 否则返回原始内容
|
|
155
|
+
// 开始标记
|
|
156
|
+
const start = token.markup;
|
|
157
|
+
// 结束标记
|
|
158
|
+
let end = '';
|
|
159
|
+
// 如果代码块长度大于行数,则添加结束标记(markdown不封闭语法)
|
|
160
|
+
if (hasEndBlock) {
|
|
161
|
+
end = '```';
|
|
162
|
+
}
|
|
163
|
+
// 如果代码块不为空,则添加换行符
|
|
164
|
+
if (code) {
|
|
165
|
+
code = code.replace(/\n/g, '<br>');
|
|
166
|
+
}
|
|
167
|
+
language = `${language}<br>`;
|
|
168
|
+
// 返回原始字符串
|
|
169
|
+
return `${start}${language}${code}${end}`;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type MarkdownIt from 'markdown-it';
|
|
2
|
+
import 'x-mavon-editor/dist/css/index.css';
|
|
3
|
+
import 'x-mavon-editor/dist/highlightjs/styles/atom-one-dark.min.css';
|
|
4
|
+
import './mark-down.postcss';
|
|
5
|
+
export type MdProp = {
|
|
6
|
+
modelValue?: string;
|
|
7
|
+
codeStyle?: string;
|
|
8
|
+
previewBackground?: string;
|
|
9
|
+
defaultOpen: string;
|
|
10
|
+
editable: boolean;
|
|
11
|
+
subfield: boolean;
|
|
12
|
+
toolbarsFlag: boolean;
|
|
13
|
+
boxShadow: boolean;
|
|
14
|
+
ref?: (elm: MdRef) => void;
|
|
15
|
+
xssOptions: {
|
|
16
|
+
whiteList: {
|
|
17
|
+
[key: string]: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
externalLink: {
|
|
21
|
+
[key: string]: (param?: string) => string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type MdRef = {
|
|
25
|
+
$paste: () => void;
|
|
26
|
+
markdownIt: MarkdownIt;
|
|
27
|
+
};
|
|
28
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
29
|
+
value: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
};
|
|
32
|
+
previewBackground: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
39
|
+
value: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
};
|
|
42
|
+
previewBackground: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
}>> & Readonly<{}>, {
|
|
47
|
+
previewBackground: string;
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
.v-note-wrapper.markdown-body {
|
|
2
|
+
border: none !important;
|
|
3
|
+
min-height: auto;
|
|
4
|
+
background: transparent;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.v-note-wrapper.markdown-body li {
|
|
8
|
+
list-style: inherit !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.v-note-show::-webkit-scrollbar {
|
|
12
|
+
width: 8px;
|
|
13
|
+
height: 8px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.v-note-show::-webkit-scrollbar-thumb {
|
|
17
|
+
width: 8px;
|
|
18
|
+
height: 8px;
|
|
19
|
+
border-radius: 3px;
|
|
20
|
+
background-color: #dcdee5;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.v-note-show::-webkit-scrollbar-thumb:hover {
|
|
24
|
+
background-color: #979ba5;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.v-show-content {
|
|
28
|
+
height: auto !important;
|
|
29
|
+
font-size: 14px !important;
|
|
30
|
+
padding: 8px 25px !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.v-show-content p {
|
|
34
|
+
margin-bottom: 0 !important;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.v-show-content p + p {
|
|
38
|
+
margin-top: 16px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.full-screen-wrap.markdown-body .code-header {
|
|
42
|
+
height: 40px;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
background: #2e2e2e;
|
|
45
|
+
border-radius: 2px 2px 0 0;
|
|
46
|
+
padding: 0 18px;
|
|
47
|
+
color: #c4c6cc;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.full-screen-wrap.markdown-body .code-header .ai-ui-sdk-un-full-screen,
|
|
51
|
+
.full-screen-wrap.markdown-body .code-header .ai-ui-sdk-full-screen,
|
|
52
|
+
.full-screen-wrap.markdown-body .code-header .ai-ui-sdk-copy {
|
|
53
|
+
margin-right: 12px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.full-screen-wrap.markdown-body .code-header .ai-ui-sdk-icon {
|
|
57
|
+
color: #979ba5;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.full-screen-wrap.markdown-body .code-header .ai-ui-sdk-icon:hover {
|
|
62
|
+
color: #3a84ff;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.full-screen-wrap.markdown-body .code-header + pre {
|
|
66
|
+
max-height: 500px;
|
|
67
|
+
overflow-y: auto;
|
|
68
|
+
color: #abb2bf !important;
|
|
69
|
+
background: #1a1a1a !important;
|
|
70
|
+
border-radius: 0 0 2px 2px !important;
|
|
71
|
+
font-size: 14px !important;
|
|
72
|
+
padding: 16px;
|
|
73
|
+
line-height: 1.45;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.full-screen-wrap.markdown-body .code-header + pre code {
|
|
77
|
+
font-size: 14px !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.full-screen-wrap.markdown-body .code-header + pre .hljs-comment {
|
|
81
|
+
color: #6a9954;
|
|
82
|
+
font-style: inherit;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.full-screen-wrap.markdown-body .code-header + pre .hljs {
|
|
86
|
+
overflow: initial;
|
|
87
|
+
background: #1a1a1a !important;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.full-screen-wrap.markdown-body .code-header + pre::-webkit-scrollbar-track {
|
|
91
|
+
background: #2e2e2e;
|
|
92
|
+
border-left: 1px solid #3d3d3d;
|
|
93
|
+
border-top: 1px solid #3d3d3d;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.full-screen-wrap.markdown-body .code-header + pre::-webkit-scrollbar {
|
|
97
|
+
width: 14px;
|
|
98
|
+
height: 14px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.full-screen-wrap.markdown-body .code-header + pre::-webkit-scrollbar-corner {
|
|
102
|
+
background: #2e2e2e !important;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.full-screen-wrap.markdown-body .code-header + pre::-webkit-scrollbar-thumb {
|
|
106
|
+
height: 5px;
|
|
107
|
+
border-radius: 1px;
|
|
108
|
+
background: rgb(121 121 121 / 40%);
|
|
109
|
+
border: 1px solid #4d4f56;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.full-screen-wrap.markdown-body:not(:first-child) {
|
|
113
|
+
margin-top: 8px !important;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.full-screen-wrap.markdown-body:not(:last-child) {
|
|
117
|
+
margin-bottom: 8px !important;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.full-screen-wrap.markdown-body.full-screen {
|
|
121
|
+
margin-top: 0 !important;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.full-screen-wrap.markdown-body.full-screen .code-header {
|
|
125
|
+
margin: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.full-screen-wrap.markdown-body.full-screen pre {
|
|
129
|
+
max-height: calc(100vh - 40px);
|
|
130
|
+
height: calc(100vh - 40px);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.full-screen-wrap.markdown-body .full-screen-wrap.full-screen {
|
|
134
|
+
margin-top: 0 !important;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.full-screen-wrap.markdown-body .full-screen-wrap.full-screen .code-header {
|
|
138
|
+
margin: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.full-screen-wrap.markdown-body .full-screen-wrap.full-screen pre {
|
|
142
|
+
max-height: calc(100vh - 40px);
|
|
143
|
+
height: calc(100vh - 40px);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.v-note-img-wrapper {
|
|
147
|
+
display: none !important;
|
|
148
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
import { defineComponent, h } from 'vue';
|
|
54
|
+
import Mavon from 'x-mavon-editor';
|
|
55
|
+
import { MarkDownCodePlugin } from './mark-down-code.ts.js';
|
|
56
|
+
import { MarkDownEmojiPlugin } from './mark-down-emoji.ts.js';
|
|
57
|
+
import 'x-mavon-editor/dist/css/index.css';
|
|
58
|
+
import 'x-mavon-editor/dist/highlightjs/styles/atom-one-dark.min.css';
|
|
59
|
+
import './mark-down.postcss.css';
|
|
60
|
+
const defaultMDProps = {
|
|
61
|
+
defaultOpen: 'preview',
|
|
62
|
+
editable: false,
|
|
63
|
+
subfield: false,
|
|
64
|
+
toolbarsFlag: false,
|
|
65
|
+
boxShadow: false,
|
|
66
|
+
xssOptions: {
|
|
67
|
+
whiteList: {
|
|
68
|
+
a: [
|
|
69
|
+
'href',
|
|
70
|
+
'target',
|
|
71
|
+
'class',
|
|
72
|
+
'title'
|
|
73
|
+
],
|
|
74
|
+
section: [
|
|
75
|
+
'class'
|
|
76
|
+
],
|
|
77
|
+
i: [
|
|
78
|
+
'class'
|
|
79
|
+
],
|
|
80
|
+
span: [
|
|
81
|
+
'class',
|
|
82
|
+
'data-variable-index'
|
|
83
|
+
],
|
|
84
|
+
svg: [
|
|
85
|
+
'class'
|
|
86
|
+
],
|
|
87
|
+
use: [
|
|
88
|
+
'href'
|
|
89
|
+
],
|
|
90
|
+
ul: [
|
|
91
|
+
'class'
|
|
92
|
+
],
|
|
93
|
+
li: [
|
|
94
|
+
'class',
|
|
95
|
+
'title'
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
externalLink: {
|
|
100
|
+
markdown_css () {
|
|
101
|
+
return `${window.SITE_URL}/static/markdown/github-markdown.min.css`;
|
|
102
|
+
},
|
|
103
|
+
hljs_js () {
|
|
104
|
+
return `${window.SITE_URL}/static/highlightjs/highlight.min.js`;
|
|
105
|
+
},
|
|
106
|
+
hljs_css (css) {
|
|
107
|
+
return `${window.SITE_URL}/static/highlightjs/styles/${css}.min.css`;
|
|
108
|
+
},
|
|
109
|
+
hljs_lang (lang) {
|
|
110
|
+
return `${window.SITE_URL}/static/highlightjs/languages/${lang}.min.js`;
|
|
111
|
+
},
|
|
112
|
+
katex_css () {
|
|
113
|
+
return `${window.SITE_URL}/static/katex/katex.min.css`;
|
|
114
|
+
},
|
|
115
|
+
katex_js () {
|
|
116
|
+
return `${window.SITE_URL}/static/katex/katex.min.js`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
export default defineComponent({
|
|
121
|
+
props: {
|
|
122
|
+
value: {
|
|
123
|
+
type: String
|
|
124
|
+
},
|
|
125
|
+
previewBackground: {
|
|
126
|
+
type: String,
|
|
127
|
+
default: '#fff'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
setup (props) {
|
|
131
|
+
const mdRef = (md)=>{
|
|
132
|
+
if (!md) return;
|
|
133
|
+
// 注册代码块插件
|
|
134
|
+
MarkDownCodePlugin(md.markdownIt);
|
|
135
|
+
// 注册表情插件
|
|
136
|
+
MarkDownEmojiPlugin(md.markdownIt);
|
|
137
|
+
};
|
|
138
|
+
return ()=>h(Mavon.mavonEditor, _object_spread_props(_object_spread({}, defaultMDProps), {
|
|
139
|
+
previewBackground: props.previewBackground,
|
|
140
|
+
modelValue: props.value,
|
|
141
|
+
codeStyle: 'atom-one-dark',
|
|
142
|
+
ref: mdRef
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
.router-tab[data-v-
|
|
2
|
+
.router-tab[data-v-yr4un346] {
|
|
3
3
|
margin-top: 2px;
|
|
4
4
|
height: 42px;
|
|
5
5
|
background: #FFFFFF;
|
|
6
6
|
box-shadow: 0 2px 4px 0 #1919290d;
|
|
7
7
|
padding: 0 45px;
|
|
8
8
|
}
|
|
9
|
-
.router-tab a[data-v-
|
|
9
|
+
.router-tab a[data-v-yr4un346] {
|
|
10
10
|
padding: 0 8px;
|
|
11
11
|
margin-right: 24px;
|
|
12
12
|
font-size: 14px;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
color: #4D4F56;
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
}
|
|
18
|
-
.router-tab a.router-link-exact-active[data-v-
|
|
18
|
+
.router-tab a.router-link-exact-active[data-v-yr4un346] {
|
|
19
19
|
color: #3A84FF;
|
|
20
20
|
border-bottom: 2px solid #3A84FF;
|
|
21
21
|
}
|
package/dist/components.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ import RenderDatasetDetail from './components/render-dataset-detail/index.vue';
|
|
|
8
8
|
import RenderDatasetDetailOriginData from './components/render-dataset-detail-origin-data/index.vue';
|
|
9
9
|
import RenderDatasetList from './components/render-dataset-list/index.vue';
|
|
10
10
|
import RenderHeader from './components/render-header/index.vue';
|
|
11
|
+
import RenderMarkdown from './components/render-markdown/mark-down';
|
|
11
12
|
import RenderSearchSelect from './components/render-search-select/index.vue';
|
|
12
|
-
export { renderAuthDialog, RenderAutoRefresh, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderHeader, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderCheckbox, RenderChooseTag, RenderSearchSelect, };
|
|
13
|
+
export { renderAuthDialog, RenderAutoRefresh, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderHeader, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderCheckbox, RenderChooseTag, RenderMarkdown, RenderSearchSelect, };
|
package/dist/components.ts.js
CHANGED
|
@@ -9,5 +9,6 @@ import RenderDatasetDetail from './components/render-dataset-detail/index.vue.js
|
|
|
9
9
|
import RenderDatasetDetailOriginData from './components/render-dataset-detail-origin-data/index.vue.js';
|
|
10
10
|
import RenderDatasetList from './components/render-dataset-list/index.vue.js';
|
|
11
11
|
import RenderHeader from './components/render-header/index.vue.js';
|
|
12
|
+
import RenderMarkdown from './components/render-markdown/mark-down.ts.js';
|
|
12
13
|
import RenderSearchSelect from './components/render-search-select/index.vue.js';
|
|
13
|
-
export { renderAuthDialog, RenderAutoRefresh, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderHeader, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderCheckbox, RenderChooseTag, RenderSearchSelect };
|
|
14
|
+
export { renderAuthDialog, RenderAutoRefresh, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderHeader, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderCheckbox, RenderChooseTag, RenderMarkdown, RenderSearchSelect };
|
|
Binary file
|
|
@@ -95,6 +95,9 @@
|
|
|
95
95
|
<glyph glyph-name="uniE11A" unicode="" d="M144 300L214.4 229.6 428.8 15.2 499.2 87.2 336 250.4 880 250.4 880 349.6 336 349.6 499.2 512.8 428.8 584.8 428.8 584.8 214.4 370.4Z" horiz-adv-x="1024" vert-adv-y="1024" />
|
|
96
96
|
|
|
97
97
|
|
|
98
|
+
<glyph glyph-name="uniE127" unicode="" d="M451.3721 108.0122L366.5777 108.0122 332.8708 195.2312 178.5545 195.2312 146.6861 108.0122 64 108.0122 214.3696 492 296.7983 492 451.3721 108.0122ZM307.8542 259.9322L254.6585 402.428 202.517 259.9322 307.8542 259.9322ZM492.7151 108.0122L492.7151 492 617.7984 492C665.1964 492 696.0965 490.0737 710.4985 486.2334 732.6225 480.4667 751.1429 467.9459 766.0598 448.6465 780.9766 429.3472 788.4411 404.4275 788.4411 373.863 788.4411 350.2844 784.1389 330.473 775.5345 314.4044 766.93 298.3358 756.009 285.7175 742.7468 276.5494 729.497 267.3813 716.0142 261.3098 702.3231 258.3473 683.7168 254.6776 656.7636 252.8488 621.4755 252.8488L570.6455 252.8488 570.6455 108 492.7029 108 492.7151 108.0122ZM570.6577 427.043L570.6577 318.0741 613.3123 318.0741C644.0407 318.0741 664.5713 320.0857 674.9285 324.0968 685.2857 328.1078 693.4122 334.3987 699.2833 342.9572 705.1667 351.5158 708.1084 361.4641 708.1084 372.8146 708.1084 386.7862 703.9778 398.3073 695.7288 407.39 687.4798 416.4728 677.0367 422.1419 664.3875 424.4096 655.0844 426.153 636.3801 427.0308 608.2992 427.0308L570.6455 427.0308 570.6577 427.043ZM850.0574 108.0122L850.0574 492 928 492 928 108.0122 850.0574 108.0122Z" horiz-adv-x="1024" vert-adv-y="1024" />
|
|
99
|
+
|
|
100
|
+
|
|
98
101
|
<glyph glyph-name="uniE107" unicode="" d="M924.5501 698.6351C924.5501 698.7248 924.4617 698.7248 924.4617 698.8145 922.6054 702.4909 919.9536 705.8086 916.6829 708.4986 913.5007 711.1887 909.8765 713.1614 906.0756 714.4167 905.9872 714.4167 905.8988 714.5064 905.8104 714.5064 904.3077 715.0444 902.7165 715.3134 901.1254 715.5824 900.6835 715.6721 900.2415 715.8514 899.7111 715.8514 898.2084 716.0308 896.7941 716.0308 895.2914 715.9411 894.6726 715.9411 894.1422 716.0308 893.5235 715.9411 889.2805 715.6721 885.0376 714.4167 881.1482 712.444L113.7917 326.4227C106.2782 322.7463 100.5325 316.1108 97.8807 308.0407 97.0851 305.799 96.7315 303.3779 96.4663 301.0466 95.6708 296.2942 95.8476 291.3624 97.3503 286.6997 99.8253 278.5399 105.3942 271.8148 112.9078 267.959L307.6418 164.1233C312.3268 161.6126 317.4537 160.3572 322.7574 160.3572 334.5139 160.2676 345.2981 166.7237 351.0437 177.1252 359.4413 192.6378 353.5188 211.9164 337.9613 220.2556L195.6454 296.1148 768.0027 584.1289 418.9311 177.4839C418.6659 177.2149 418.5775 176.8562 418.3123 176.5872 409.6496 170.8484 403.9923 161.1643 403.9923 150.0454L403.9923-84.0781C404.0807-92.5966 407.5281-100.7564 413.539-106.7642 419.5498-112.7719 427.6822-116 436.0797-115.9103L436.0797-116C453.7587-116 468.0786-101.7428 468.0786-84.1678L468.0786 136.5952 849.1492 580.7215 769.9474-5.0805 569.0257 92.8371C553.203 100.5486 534.1981 94.0925 526.1541 78.3109 522.4415 70.6891 521.9112 61.9016 524.6514 53.8315 527.3916 45.7613 533.2257 39.2156 540.8277 35.6288L779.5824-80.8501C784.0021-83.0021 788.7755-84.0781 793.7256-84.0781 793.9024-84.0781 794.0792-83.9885 794.256-83.9885 794.7863-83.9885 795.4051-84.1678 795.9355-84.1678 811.8466-84.2575 825.371-72.5109 827.6692-56.55L926.6716 675.2318C928.8814 682.7639 928.4395 691.103 924.5501 698.6351Z" horiz-adv-x="1024" vert-adv-y="1024" />
|
|
99
102
|
|
|
100
103
|
|
|
Binary file
|
|
Binary file
|