@blueking/ai-ui-sdk 0.2.0-beta.20 → 0.2.0-beta.22

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.
Files changed (83) hide show
  1. package/dist/common/util.d.ts +5 -0
  2. package/dist/common/util.ts.js +8 -0
  3. package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
  4. package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
  5. package/dist/components/render-auto-refresh/index.vue.css +8 -8
  6. package/dist/components/render-auto-refresh/index.vue.js +1 -1
  7. package/dist/components/render-checkbox/index.vue.css +9 -9
  8. package/dist/components/render-checkbox/index.vue.js +1 -1
  9. package/dist/components/render-choose-tag/index.script.vue.js.js +62 -1
  10. package/dist/components/render-choose-tag/index.vue.css +7 -7
  11. package/dist/components/render-choose-tag/index.vue.d.ts +1 -0
  12. package/dist/components/render-choose-tag/index.vue.js +1 -1
  13. package/dist/components/render-collapse/index.vue.css +2 -2
  14. package/dist/components/render-collapse/index.vue.js +1 -1
  15. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.css +3 -3
  16. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.js +1 -1
  17. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.css +1 -1
  18. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.js +1 -1
  19. package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
  20. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.css +1 -1
  21. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.js +1 -1
  22. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  23. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  24. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  25. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  26. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  27. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
  28. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  29. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  30. package/dist/components/render-dataset/components/plus-dataset/index.script.vue.js.js +1 -3
  31. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
  32. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  33. package/dist/components/render-dataset/components/plus-dataset-data/form/api.script.vue.js.js +1 -1
  34. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +2 -2
  35. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
  36. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  37. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  38. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
  39. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  40. package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
  41. package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
  42. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  43. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  44. package/dist/components/render-dataset-list/components/main.vue.css +3 -3
  45. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  46. package/dist/components/render-dataset-list/index.vue.css +2 -2
  47. package/dist/components/render-dataset-list/index.vue.js +1 -1
  48. package/dist/components/render-file-card/index.vue.css +11 -11
  49. package/dist/components/render-file-card/index.vue.js +1 -1
  50. package/dist/components/render-file-type-icon/index.vue.css +5 -5
  51. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  52. package/dist/components/render-header/index.vue.css +3 -3
  53. package/dist/components/render-header/index.vue.js +1 -1
  54. package/dist/components/render-like/index.vue.css +5 -5
  55. package/dist/components/render-like/index.vue.js +1 -1
  56. package/dist/components/render-markdown/common.d.ts +19 -0
  57. package/dist/components/render-markdown/common.ts.js +41 -0
  58. package/dist/components/render-markdown/edit.d.ts +82 -0
  59. package/dist/components/render-markdown/edit.postcss.css +92 -0
  60. package/dist/components/render-markdown/edit.ts.js +228 -0
  61. package/dist/components/render-markdown/mark-down-code-copy.d.ts +7 -0
  62. package/dist/components/render-markdown/mark-down-code-copy.ts.js +73 -0
  63. package/dist/components/render-markdown/prism-atom-one-dark.postcss.css +192 -0
  64. package/dist/components/render-markdown/{mark-down.d.ts → view.d.ts} +2 -27
  65. package/dist/components/render-markdown/view.postcss.css +99 -0
  66. package/dist/components/render-markdown/view.ts.js +116 -0
  67. package/dist/components/render-router-tab/index.vue.css +3 -3
  68. package/dist/components/render-router-tab/index.vue.js +1 -1
  69. package/dist/components/render-t-table/index.vue.css +27 -27
  70. package/dist/components/render-t-table/index.vue.js +1 -1
  71. package/dist/components/render-tag-tree/index.vue.css +7 -7
  72. package/dist/components/render-tag-tree/index.vue.js +1 -1
  73. package/dist/components.d.ts +3 -2
  74. package/dist/components.ts.js +3 -2
  75. package/dist/css/tailwind.css +0 -4
  76. package/dist/hooks/use-form-leave-confirm.ts.js +2 -0
  77. package/package.json +7 -4
  78. package/dist/components/render-markdown/mark-down-code.d.ts +0 -2
  79. package/dist/components/render-markdown/mark-down-code.ts.js +0 -171
  80. package/dist/components/render-markdown/mark-down-emoji.d.ts +0 -2
  81. package/dist/components/render-markdown/mark-down-emoji.ts.js +0 -4
  82. package/dist/components/render-markdown/mark-down.postcss.css +0 -154
  83. package/dist/components/render-markdown/mark-down.ts.js +0 -152
@@ -0,0 +1,228 @@
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
+ import { defineComponent, h, onBeforeUnmount, onMounted, ref, watch } from 'vue';
30
+ import Editor from '@toast-ui/editor';
31
+ import { commonConfig } from './common.ts.js';
32
+ import '@toast-ui/editor/dist/toastui-editor.css';
33
+ import './edit.postcss.css';
34
+ var EditorMode;
35
+ (function(EditorMode) {
36
+ EditorMode["Markdown"] = "markdown";
37
+ EditorMode["Wysiwyg"] = "wysiwyg";
38
+ })(EditorMode || (EditorMode = {}));
39
+ export default defineComponent({
40
+ props: {
41
+ modelValue: {
42
+ type: String
43
+ },
44
+ placeholder: {
45
+ type: String
46
+ },
47
+ height: {
48
+ type: String,
49
+ default: '500px'
50
+ },
51
+ disabled: {
52
+ type: Boolean
53
+ },
54
+ fontSize: {
55
+ type: String,
56
+ default: '14px'
57
+ },
58
+ backgroundColor: {
59
+ type: String,
60
+ default: '#fff'
61
+ },
62
+ mode: {
63
+ type: String,
64
+ default: "wysiwyg"
65
+ },
66
+ isSimpleToolbar: {
67
+ type: Boolean,
68
+ default: false
69
+ }
70
+ },
71
+ emits: {
72
+ 'update:modelValue': (value)=>value
73
+ },
74
+ setup (props, { emit }) {
75
+ const editorRef = ref();
76
+ let editor;
77
+ const handleChange = ()=>{
78
+ const value = (editor === null || editor === void 0 ? void 0 : editor.getMarkdown()) || '';
79
+ emit('update:modelValue', value);
80
+ };
81
+ const handleInit = ()=>{
82
+ const defaultMode = props.mode || "wysiwyg";
83
+ // 切换模式按钮
84
+ const modeSwitchEl = document.createElement('section');
85
+ modeSwitchEl.className = 'toastui-editor-toolbar-custom-button g-cursor-pointer g-ml-4';
86
+ modeSwitchEl.innerHTML = '<i class="bkaidev-icon bkaidev-qiehuan g-mr-4 g-text-16"></i>切换代码模式';
87
+ modeSwitchEl.dataset.mode = defaultMode;
88
+ modeSwitchEl.addEventListener('click', ()=>{
89
+ const mode = modeSwitchEl.dataset.mode;
90
+ if (mode === "markdown") {
91
+ editor.changeMode("wysiwyg");
92
+ modeSwitchEl.dataset.mode = "wysiwyg";
93
+ modeSwitchEl.innerHTML = '<i class="bkaidev-icon bkaidev-qiehuan g-mr-4 g-text-16"></i>切换代码模式';
94
+ } else {
95
+ editor.changeMode("markdown");
96
+ modeSwitchEl.dataset.mode = "markdown";
97
+ modeSwitchEl.innerHTML = '<i class="bkaidev-icon bkaidev-qiehuan g-mr-4 g-text-16"></i>切换富文本模式';
98
+ }
99
+ });
100
+ // 全屏按钮复用 use-click-proxy 的全局 full-screen 代理。
101
+ const fullScreenEl = document.createElement('section');
102
+ fullScreenEl.className = 'toastui-editor-toolbar-custom-button g-cursor-pointer g-ml-12';
103
+ fullScreenEl.innerHTML = [
104
+ '<span class="click-full-screen">',
105
+ '<i class="ai-ui-sdk-icon ai-ui-sdk-full-screen g-mr-4 g-text-14"></i>全屏',
106
+ '</span>',
107
+ '<span class="click-un-full-screen">',
108
+ '<i class="ai-ui-sdk-icon ai-ui-sdk-un-full-screen g-mr-4 g-text-14"></i>取消全屏',
109
+ '</span>'
110
+ ].join('');
111
+ // 初始化编辑器
112
+ editor = new Editor(_object_spread({
113
+ el: editorRef.value,
114
+ initialEditType: defaultMode,
115
+ previewStyle: 'vertical',
116
+ hideModeSwitch: true,
117
+ autofocus: false,
118
+ toolbarItems: [
119
+ [
120
+ 'heading',
121
+ 'bold',
122
+ 'italic',
123
+ 'strike'
124
+ ],
125
+ ...props.isSimpleToolbar ? [] : [
126
+ [
127
+ 'hr',
128
+ 'quote'
129
+ ],
130
+ [
131
+ 'ul',
132
+ 'ol',
133
+ 'task',
134
+ 'indent',
135
+ 'outdent'
136
+ ],
137
+ [
138
+ 'table',
139
+ 'image',
140
+ 'link'
141
+ ],
142
+ [
143
+ 'code',
144
+ 'codeblock'
145
+ ]
146
+ ],
147
+ [
148
+ ...props.isSimpleToolbar ? [] : [
149
+ {
150
+ name: 'modeSwitch',
151
+ el: modeSwitchEl
152
+ }
153
+ ],
154
+ {
155
+ name: 'fullScreen',
156
+ el: fullScreenEl
157
+ }
158
+ ]
159
+ ],
160
+ placeholder: props.placeholder,
161
+ initialValue: props.modelValue || '',
162
+ height: props.height,
163
+ events: {
164
+ change: handleChange
165
+ }
166
+ }, commonConfig));
167
+ };
168
+ const handleDestroy = ()=>{
169
+ editor.destroy();
170
+ editor = null;
171
+ };
172
+ const handleDisabled = ()=>{
173
+ const root = editorRef.value;
174
+ const editContent = root.querySelector('.ww-mode [contenteditable]');
175
+ const toolbar = root.querySelector('.toastui-editor-toolbar');
176
+ // 禁用事件
177
+ if (root) {
178
+ const stopEvent = (event)=>{
179
+ event.preventDefault();
180
+ event.stopPropagation();
181
+ event.stopImmediatePropagation();
182
+ };
183
+ if (props.disabled) {
184
+ root.addEventListener('beforeinput', stopEvent, true);
185
+ root.addEventListener('input', stopEvent, true);
186
+ root.addEventListener('paste', stopEvent, true);
187
+ root.addEventListener('cut', stopEvent, true);
188
+ root.addEventListener('drop', stopEvent, true);
189
+ root.addEventListener('compositionstart', stopEvent, true);
190
+ } else {
191
+ root.removeEventListener('beforeinput', stopEvent, true);
192
+ root.removeEventListener('input', stopEvent, true);
193
+ root.removeEventListener('paste', stopEvent, true);
194
+ root.removeEventListener('cut', stopEvent, true);
195
+ root.removeEventListener('drop', stopEvent, true);
196
+ root.removeEventListener('compositionstart', stopEvent, true);
197
+ }
198
+ }
199
+ if (editContent) {
200
+ // 设置样式
201
+ editContent.setAttribute('contenteditable', String(!props.disabled));
202
+ editContent.style.cursor = props.disabled ? 'not-allowed' : 'auto';
203
+ }
204
+ if (toolbar) {
205
+ toolbar.style.pointerEvents = props.disabled ? 'none' : 'auto';
206
+ }
207
+ };
208
+ watch(()=>props.modelValue, (value)=>{
209
+ if (!editor) return;
210
+ if (value !== editor.getMarkdown()) {
211
+ editor.setMarkdown(value || '');
212
+ }
213
+ });
214
+ onMounted(()=>{
215
+ handleInit();
216
+ handleDisabled();
217
+ });
218
+ onBeforeUnmount(handleDestroy);
219
+ watch(()=>props.disabled, handleDisabled);
220
+ return ()=>h('section', {
221
+ ref: editorRef,
222
+ class: `full-screen-wrap ${props.disabled ? 'is-disabled' : ''}`,
223
+ style: {
224
+ backgroundColor: props.backgroundColor
225
+ }
226
+ });
227
+ }
228
+ });
@@ -0,0 +1,7 @@
1
+ import type Prism from 'prismjs';
2
+ import type { PluginContext, PluginInfo } from '@toast-ui/editor';
3
+ export type PrismHighlighter = typeof Prism;
4
+ export interface MarkDownCodeCopyPluginOptions {
5
+ highlighter?: PrismHighlighter;
6
+ }
7
+ export declare const MarkDownCodeCopyPlugin: (_context: PluginContext, options?: MarkDownCodeCopyPluginOptions) => PluginInfo;
@@ -0,0 +1,73 @@
1
+ const BACKTICK_COUNT = 3;
2
+ // 给块级代码增加右上角复制按钮,同时保留 Prism 语法高亮。
3
+ export const MarkDownCodeCopyPlugin = (_context, options = {})=>({
4
+ toHTMLRenderers: {
5
+ codeBlock (markdownNode) {
6
+ const node = markdownNode;
7
+ const infoWords = node.info ? node.info.split(/\s+/) : [];
8
+ const language = infoWords[0];
9
+ const preClasses = [];
10
+ const codeAttrs = {};
11
+ const tokens = [];
12
+ if (node.fenceLength > BACKTICK_COUNT) {
13
+ codeAttrs['data-backticks'] = node.fenceLength;
14
+ }
15
+ if (language) {
16
+ preClasses.push(`lang-${language}`);
17
+ codeAttrs['data-language'] = language;
18
+ }
19
+ var _node_literal;
20
+ tokens.push({
21
+ type: 'openTag',
22
+ tagName: 'pre',
23
+ classNames: [
24
+ ...preClasses,
25
+ 'markdown-code-copy-wrap'
26
+ ]
27
+ }, {
28
+ type: 'openTag',
29
+ tagName: 'i',
30
+ classNames: [
31
+ 'ai-ui-sdk-icon',
32
+ 'ai-ui-sdk-copy',
33
+ 'markdown-code-copy-button',
34
+ 'click-copy'
35
+ ],
36
+ attributes: {
37
+ 'data-clipboard-text': encodeURIComponent((_node_literal = node.literal) !== null && _node_literal !== void 0 ? _node_literal : ''),
38
+ title: '复制代码'
39
+ }
40
+ }, {
41
+ type: 'closeTag',
42
+ tagName: 'i'
43
+ }, {
44
+ type: 'openTag',
45
+ tagName: 'code',
46
+ attributes: codeAttrs
47
+ });
48
+ const highlighter = options.highlighter;
49
+ const registeredLang = language && (highlighter === null || highlighter === void 0 ? void 0 : highlighter.languages[language]);
50
+ if (language && registeredLang) {
51
+ var _node_literal1;
52
+ tokens.push({
53
+ type: 'html',
54
+ content: highlighter.highlight((_node_literal1 = node.literal) !== null && _node_literal1 !== void 0 ? _node_literal1 : '', registeredLang, language)
55
+ });
56
+ } else {
57
+ var _node_literal2;
58
+ tokens.push({
59
+ type: 'text',
60
+ content: (_node_literal2 = node.literal) !== null && _node_literal2 !== void 0 ? _node_literal2 : ''
61
+ });
62
+ }
63
+ tokens.push({
64
+ type: 'closeTag',
65
+ tagName: 'code'
66
+ }, {
67
+ type: 'closeTag',
68
+ tagName: 'pre'
69
+ });
70
+ return tokens;
71
+ }
72
+ }
73
+ });
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Prism.js theme like highlight.js atom-one-dark
3
+ * Background: #282c34
4
+ * Foreground: #abb2bf
5
+ */
6
+
7
+ code[class*='language-'],
8
+ pre[class*='language-'] {
9
+ color: #abb2bf;
10
+ background: none;
11
+ font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
12
+ font-size: 14px;
13
+ line-height: 1.6;
14
+ text-align: left;
15
+ white-space: pre;
16
+ word-spacing: normal;
17
+ word-break: normal;
18
+ word-wrap: normal;
19
+ tab-size: 2;
20
+ hyphens: none;
21
+ text-shadow: none;
22
+ }
23
+
24
+ pre[class*='language-'] {
25
+ margin: 12px 0;
26
+ padding: 16px;
27
+ overflow: auto;
28
+ border-radius: 8px;
29
+ background: #282c34;
30
+ }
31
+
32
+ :not(pre) > code[class*='language-'],
33
+ pre[class*='language-'] {
34
+ background: #282c34;
35
+ }
36
+
37
+ :not(pre) > code[class*='language-'] {
38
+ padding: 2px 6px;
39
+ border-radius: 4px;
40
+ color: #e06c75;
41
+ }
42
+
43
+ /* Toast UI Editor preview / viewer 兜底 */
44
+ .toastui-editor-contents pre,
45
+ .tui-editor-contents pre {
46
+ background: #282c34 !important;
47
+ color: #abb2bf !important;
48
+ border-radius: 8px;
49
+ padding: 16px;
50
+ overflow-x: auto;
51
+ }
52
+
53
+ .toastui-editor-contents pre code,
54
+ .tui-editor-contents pre code {
55
+ background: transparent !important;
56
+ color: #abb2bf !important;
57
+ text-shadow: none !important;
58
+ font-family: Consolas,
59
+ Monaco,
60
+ 'Andale Mono',
61
+ 'Ubuntu Mono',
62
+ monospace;
63
+ font-size: 14px;
64
+ line-height: 1.6;
65
+ }
66
+
67
+ .toastui-editor-contents pre code span,
68
+ .tui-editor-contents pre code span,
69
+ .toastui-editor-contents .token,
70
+ .tui-editor-contents .token {
71
+ text-shadow: none !important;
72
+ }
73
+
74
+ /* 注释 */
75
+ .token.comment,
76
+ .token.prolog,
77
+ .token.doctype,
78
+ .token.cdata {
79
+ color: #5c6370;
80
+ font-style: italic;
81
+ }
82
+
83
+ /* 标点 */
84
+ .token.punctuation {
85
+ color: #abb2bf;
86
+ }
87
+
88
+ /* 命名空间 */
89
+ .token.namespace {
90
+ opacity: .7;
91
+ }
92
+
93
+ /* 标签、属性、选择器 */
94
+ .token.tag,
95
+ .token.selector {
96
+ color: #e06c75;
97
+ }
98
+
99
+ .token.attr-name {
100
+ color: #d19a66;
101
+ }
102
+
103
+ .token.attr-value,
104
+ .token.string,
105
+ .token.char,
106
+ .token.inserted {
107
+ color: #98c379;
108
+ }
109
+
110
+ /* 关键字 */
111
+ .token.keyword,
112
+ .token.atrule {
113
+ color: #c678dd;
114
+ }
115
+
116
+ /* 布尔、数字、常量 */
117
+ .token.boolean,
118
+ .token.number,
119
+ .token.constant,
120
+ .token.symbol {
121
+ color: #d19a66;
122
+ }
123
+
124
+ /* 函数 */
125
+ .token.function {
126
+ color: #61afef;
127
+ }
128
+
129
+ /* 类名、类型 */
130
+ .token.class-name,
131
+ .token.builtin {
132
+ color: #e5c07b;
133
+ }
134
+
135
+ /* 属性、变量 */
136
+ .token.property,
137
+ .token.variable {
138
+ color: #e06c75;
139
+ }
140
+
141
+ /* 操作符 */
142
+ .token.operator {
143
+ color: #56b6c2;
144
+ }
145
+
146
+ /* 正则、重要内容 */
147
+ .token.regex,
148
+ .token.important {
149
+ color: #c678dd;
150
+ }
151
+
152
+ /* URL / 实体 */
153
+ .token.url,
154
+ .token.entity {
155
+ color: #56b6c2;
156
+ }
157
+
158
+ /* 删除 */
159
+ .token.deleted {
160
+ color: #e06c75;
161
+ }
162
+
163
+ /* bold / italic */
164
+ .token.bold {
165
+ font-weight: 700;
166
+ }
167
+
168
+ .token.italic {
169
+ font-style: italic;
170
+ }
171
+
172
+ /* Prism line numbers 插件兼容 */
173
+ pre[class*='language-'].line-numbers {
174
+ position: relative;
175
+ padding-left: 3.8em;
176
+ counter-reset: linenumber;
177
+ }
178
+
179
+ .line-numbers .line-numbers-rows {
180
+ border-right: 1px solid #3e4451;
181
+ }
182
+
183
+ .line-numbers-rows > span::before {
184
+ color: #636d83;
185
+ }
186
+
187
+ /* 选中文本 */
188
+ pre[class*='language-'] ::selection,
189
+ code[class*='language-'] ::selection {
190
+ background: #3e4451;
191
+ color: inherit;
192
+ }
@@ -1,30 +1,5 @@
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
- };
1
+ import '@toast-ui/editor/dist/toastui-editor-viewer.css';
2
+ import './view.postcss';
28
3
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
29
4
  value: {
30
5
  type: StringConstructor;
@@ -0,0 +1,99 @@
1
+ .aidev-markdown-preview .toastui-editor-contents,
2
+ .toastui-editor .toastui-editor-contents,
3
+ .toastui-editor-md-preview .toastui-editor-contents {
4
+ font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
5
+ }
6
+
7
+ .aidev-markdown-preview .toastui-editor-contents pre, .toastui-editor .toastui-editor-contents pre, .toastui-editor-md-preview .toastui-editor-contents pre {
8
+ max-height: 500px;
9
+ overflow-y: auto;
10
+ }
11
+
12
+ .aidev-markdown-preview .toastui-editor-contents pre::-webkit-scrollbar, .toastui-editor .toastui-editor-contents pre::-webkit-scrollbar, .toastui-editor-md-preview .toastui-editor-contents pre::-webkit-scrollbar {
13
+ width: 6px;
14
+ height: 6px;
15
+ }
16
+
17
+ .aidev-markdown-preview .toastui-editor-contents pre::-webkit-scrollbar-thumb, .toastui-editor .toastui-editor-contents pre::-webkit-scrollbar-thumb, .toastui-editor-md-preview .toastui-editor-contents pre::-webkit-scrollbar-thumb {
18
+ width: 6px;
19
+ height: 6px;
20
+ border-radius: 3px;
21
+ background-color: #dcdee5;
22
+ }
23
+
24
+ .aidev-markdown-preview .toastui-editor-contents pre::-webkit-scrollbar-thumb:hover, .toastui-editor .toastui-editor-contents pre::-webkit-scrollbar-thumb:hover, .toastui-editor-md-preview .toastui-editor-contents pre::-webkit-scrollbar-thumb:hover {
25
+ background-color: #979ba5;
26
+ }
27
+
28
+ .aidev-markdown-preview .toastui-editor-contents p,
29
+ .aidev-markdown-preview .toastui-editor-contents td,
30
+ .toastui-editor .toastui-editor-contents p,
31
+ .toastui-editor .toastui-editor-contents td,
32
+ .toastui-editor-md-preview .toastui-editor-contents p,
33
+ .toastui-editor-md-preview .toastui-editor-contents td {
34
+ color: #4d4f56;
35
+ }
36
+
37
+ .aidev-markdown-preview .toastui-editor-contents h1, .toastui-editor .toastui-editor-contents h1, .toastui-editor-md-preview .toastui-editor-contents h1 {
38
+ margin: 32px 0 20px;
39
+ border-bottom: 2px solid #eaecef;
40
+ }
41
+
42
+ .aidev-markdown-preview .toastui-editor-contents h2, .toastui-editor .toastui-editor-contents h2, .toastui-editor-md-preview .toastui-editor-contents h2 {
43
+ margin: 24px 0 16px;
44
+ border-bottom: 1px solid #eaecef;
45
+ }
46
+
47
+ .aidev-markdown-preview .toastui-editor-contents h3, .toastui-editor .toastui-editor-contents h3, .toastui-editor-md-preview .toastui-editor-contents h3 {
48
+ margin: 18px 0 12px;
49
+ }
50
+
51
+ .aidev-markdown-preview .toastui-editor-contents h4, .toastui-editor .toastui-editor-contents h4, .toastui-editor-md-preview .toastui-editor-contents h4 {
52
+ margin: 14px 0 8px;
53
+ }
54
+
55
+ .aidev-markdown-preview .toastui-editor-contents h5,
56
+ .aidev-markdown-preview .toastui-editor-contents h6,
57
+ .toastui-editor .toastui-editor-contents h5,
58
+ .toastui-editor .toastui-editor-contents h6,
59
+ .toastui-editor-md-preview .toastui-editor-contents h5,
60
+ .toastui-editor-md-preview .toastui-editor-contents h6 {
61
+ margin: 10px 0 4px;
62
+ }
63
+
64
+ .aidev-markdown-preview .toastui-editor-contents i, .toastui-editor .toastui-editor-contents i, .toastui-editor-md-preview .toastui-editor-contents i {
65
+ font-style: normal;
66
+ }
67
+
68
+ .aidev-markdown-preview .toastui-editor-contents table th, .toastui-editor .toastui-editor-contents table th, .toastui-editor-md-preview .toastui-editor-contents table th {
69
+ background-color: #fff;
70
+ color: #4d4f56;
71
+ font-weight: bold;
72
+ }
73
+
74
+ .aidev-markdown-preview .toastui-editor-contents table tr:nth-of-type(odd), .toastui-editor .toastui-editor-contents table tr:nth-of-type(odd), .toastui-editor-md-preview .toastui-editor-contents table tr:nth-of-type(odd) {
75
+ background-color: #f6f8fa;
76
+ }
77
+
78
+ .aidev-markdown-preview .toastui-editor-contents table tr:nth-of-type(even), .toastui-editor .toastui-editor-contents table tr:nth-of-type(even), .toastui-editor-md-preview .toastui-editor-contents table tr:nth-of-type(even) {
79
+ background-color: #fff;
80
+ }
81
+
82
+ .aidev-markdown-preview .toastui-editor-contents .markdown-code-copy-wrap, .toastui-editor .toastui-editor-contents .markdown-code-copy-wrap, .toastui-editor-md-preview .toastui-editor-contents .markdown-code-copy-wrap {
83
+ position: relative;
84
+ }
85
+
86
+ .aidev-markdown-preview .toastui-editor-contents .markdown-code-copy-button, .toastui-editor .toastui-editor-contents .markdown-code-copy-button, .toastui-editor-md-preview .toastui-editor-contents .markdown-code-copy-button {
87
+ position: sticky;
88
+ top: -16px;
89
+ float: right;
90
+ margin: -25px -12px 0 0;
91
+ font-size: 14px;
92
+ color: #979ba5;
93
+ cursor: pointer;
94
+ user-select: none;
95
+ }
96
+
97
+ .aidev-markdown-preview .toastui-editor-contents .markdown-code-copy-button:hover, .toastui-editor .toastui-editor-contents .markdown-code-copy-button:hover, .toastui-editor-md-preview .toastui-editor-contents .markdown-code-copy-button:hover {
98
+ color: #3a84ff;
99
+ }