@blueking/ai-ui-sdk 0.2.0-beta.21 → 0.2.0-beta.23

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 (66) hide show
  1. package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
  2. package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
  3. package/dist/components/render-auto-refresh/index.vue.css +8 -8
  4. package/dist/components/render-auto-refresh/index.vue.js +1 -1
  5. package/dist/components/render-checkbox/index.vue.css +9 -9
  6. package/dist/components/render-checkbox/index.vue.js +1 -1
  7. package/dist/components/render-choose-tag/index.vue.css +7 -7
  8. package/dist/components/render-choose-tag/index.vue.js +1 -1
  9. package/dist/components/render-collapse/index.vue.css +2 -2
  10. package/dist/components/render-collapse/index.vue.js +1 -1
  11. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.css +3 -3
  12. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.js +1 -1
  13. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.css +1 -1
  14. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.js +1 -1
  15. package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
  16. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.css +1 -1
  17. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.js +1 -1
  18. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  19. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  20. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  21. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  22. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  23. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
  24. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  25. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  26. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
  27. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  28. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +2 -2
  29. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
  30. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  31. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  32. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
  33. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  34. package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
  35. package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
  36. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  37. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  38. package/dist/components/render-dataset-list/components/main.vue.css +3 -3
  39. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  40. package/dist/components/render-dataset-list/index.vue.css +2 -2
  41. package/dist/components/render-dataset-list/index.vue.js +1 -1
  42. package/dist/components/render-file-card/index.vue.css +11 -11
  43. package/dist/components/render-file-card/index.vue.js +1 -1
  44. package/dist/components/render-file-type-icon/index.vue.css +5 -5
  45. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  46. package/dist/components/render-header/index.vue.css +3 -3
  47. package/dist/components/render-header/index.vue.js +1 -1
  48. package/dist/components/render-like/index.vue.css +5 -5
  49. package/dist/components/render-like/index.vue.js +1 -1
  50. package/dist/components/render-markdown/common.d.ts +2 -2
  51. package/dist/components/render-markdown/common.ts.js +35 -2
  52. package/dist/components/render-markdown/edit.ts.js +7 -5
  53. package/dist/components/render-markdown/filter-css.d.ts +3 -0
  54. package/dist/components/render-markdown/filter-css.ts.js +119 -0
  55. package/dist/components/render-markdown/katex.d.ts +83 -0
  56. package/dist/components/render-markdown/katex.ts.js +309 -0
  57. package/dist/components/render-markdown/prism-atom-one-dark.postcss.css +192 -0
  58. package/dist/components/render-markdown/view.postcss.css +19 -11
  59. package/dist/components/render-markdown/view.ts.js +55 -4
  60. package/dist/components/render-router-tab/index.vue.css +3 -3
  61. package/dist/components/render-router-tab/index.vue.js +1 -1
  62. package/dist/components/render-t-table/index.vue.css +27 -27
  63. package/dist/components/render-t-table/index.vue.js +1 -1
  64. package/dist/components/render-tag-tree/index.vue.css +7 -7
  65. package/dist/components/render-tag-tree/index.vue.js +1 -1
  66. package/package.json +2 -1
@@ -0,0 +1,309 @@
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 katex from 'katex';
54
+ import 'katex/dist/katex.min.css';
55
+ const defaultKatexOptions = {
56
+ throwOnError: false,
57
+ strict: 'ignore',
58
+ trust: false,
59
+ output: 'html'
60
+ };
61
+ const CODE_NODE_TYPES = new Set([
62
+ 'code',
63
+ 'codeBlock',
64
+ 'htmlBlock',
65
+ 'htmlInline'
66
+ ]);
67
+ function isEscaped(value, index) {
68
+ let count = 0;
69
+ let i = index - 1;
70
+ while(i >= 0 && value[i] === '\\'){
71
+ count += 1;
72
+ i -= 1;
73
+ }
74
+ return count % 2 === 1;
75
+ }
76
+ function findUnescaped(value, search, fromIndex) {
77
+ let index = value.indexOf(search, fromIndex);
78
+ while(index !== -1){
79
+ if (!isEscaped(value, index)) return index;
80
+ index = value.indexOf(search, index + search.length);
81
+ }
82
+ return -1;
83
+ }
84
+ function isInCodeNode(node) {
85
+ let current = node;
86
+ while(current){
87
+ if (current.type && CODE_NODE_TYPES.has(current.type)) {
88
+ return true;
89
+ }
90
+ current = current.parent;
91
+ }
92
+ return false;
93
+ }
94
+ export function normalizeLatex(input, options = {}) {
95
+ let value = input.trim();
96
+ if (options.autoEscapePercent !== false) {
97
+ value = value.replace(/(^|[^\\])%/g, '$1\\%');
98
+ }
99
+ return value;
100
+ }
101
+ export function renderKatexToHtml(latex, displayMode = true, options = {}) {
102
+ return katex.renderToString(normalizeLatex(latex, options), _object_spread(_object_spread_props(_object_spread({}, defaultKatexOptions), {
103
+ displayMode
104
+ }), options.katexOptions || {}));
105
+ }
106
+ export function createTuiKatexCustomRenderer(options = {}) {
107
+ let mathState = null;
108
+ function toArray(value) {
109
+ return Array.isArray(value) ? value : [
110
+ value
111
+ ];
112
+ }
113
+ function findNextOpen(value, fromIndex) {
114
+ const candidates = [];
115
+ const dollarBlock = findUnescaped(value, '$$', fromIndex);
116
+ if (dollarBlock !== -1) {
117
+ candidates.push({
118
+ index: dollarBlock,
119
+ open: '$$',
120
+ close: '$$',
121
+ display: true
122
+ });
123
+ }
124
+ const bracketBlock = findUnescaped(value, '\\[', fromIndex);
125
+ if (bracketBlock !== -1) {
126
+ candidates.push({
127
+ index: bracketBlock,
128
+ open: '\\[',
129
+ close: '\\]',
130
+ display: true
131
+ });
132
+ }
133
+ const bracketInline = findUnescaped(value, '\\(', fromIndex);
134
+ if (bracketInline !== -1) {
135
+ candidates.push({
136
+ index: bracketInline,
137
+ open: '\\(',
138
+ close: '\\)',
139
+ display: false
140
+ });
141
+ }
142
+ if (options.enableSingleDollar !== false) {
143
+ let singleDollar = findUnescaped(value, '$', fromIndex);
144
+ while(singleDollar !== -1 && (value[singleDollar - 1] === '$' || value[singleDollar + 1] === '$')){
145
+ singleDollar = findUnescaped(value, '$', singleDollar + 1);
146
+ }
147
+ if (singleDollar !== -1) {
148
+ candidates.push({
149
+ index: singleDollar,
150
+ open: '$',
151
+ close: '$',
152
+ display: false
153
+ });
154
+ }
155
+ }
156
+ if (!candidates.length) return null;
157
+ return candidates.sort((a, b)=>{
158
+ if (a.index !== b.index) return a.index - b.index;
159
+ return b.open.length - a.open.length;
160
+ })[0];
161
+ }
162
+ function processText(value) {
163
+ let html = '';
164
+ let index = 0;
165
+ let hasMath = false;
166
+ while(index < value.length){
167
+ if (mathState) {
168
+ hasMath = true;
169
+ const closeIndex = findUnescaped(value, mathState.close, index);
170
+ if (closeIndex === -1) {
171
+ mathState.content += value.slice(index);
172
+ return {
173
+ html,
174
+ hasMath
175
+ };
176
+ }
177
+ mathState.content += value.slice(index, closeIndex);
178
+ try {
179
+ html += renderKatexToHtml(mathState.content, mathState.display, options);
180
+ } catch (e) {
181
+ html += `${mathState.open}${mathState.content}${mathState.close}`;
182
+ }
183
+ index = closeIndex + mathState.close.length;
184
+ mathState = null;
185
+ continue;
186
+ }
187
+ const nextOpen = findNextOpen(value, index);
188
+ if (!nextOpen) {
189
+ html += value.slice(index);
190
+ break;
191
+ }
192
+ hasMath = true;
193
+ html += value.slice(index, nextOpen.index);
194
+ mathState = {
195
+ open: nextOpen.open,
196
+ close: nextOpen.close,
197
+ display: nextOpen.display,
198
+ content: ''
199
+ };
200
+ index = nextOpen.index + nextOpen.open.length;
201
+ }
202
+ return {
203
+ html,
204
+ hasMath
205
+ };
206
+ }
207
+ function flushUnclosedMath() {
208
+ if (!mathState) return '';
209
+ const raw = `${mathState.open}${mathState.content}`;
210
+ mathState = null;
211
+ return raw;
212
+ }
213
+ function renderBlock(node) {
214
+ let html = '';
215
+ try {
216
+ html = renderKatexToHtml(node.literal || '', true, options);
217
+ } catch (error) {
218
+ html = `<pre><code>${String(error)}</code></pre>`;
219
+ }
220
+ return [
221
+ {
222
+ type: 'openTag',
223
+ tagName: 'div',
224
+ outerNewLine: true,
225
+ classNames: [
226
+ 'tui-katex-block'
227
+ ]
228
+ },
229
+ {
230
+ type: 'html',
231
+ content: html
232
+ },
233
+ {
234
+ type: 'closeTag',
235
+ tagName: 'div',
236
+ outerNewLine: true
237
+ }
238
+ ];
239
+ }
240
+ const renderer = {
241
+ paragraph (_node, context) {
242
+ if (context.entering) {
243
+ mathState = null;
244
+ return context.origin();
245
+ }
246
+ const pending = flushUnclosedMath();
247
+ const origin = context.origin();
248
+ if (!pending) return origin;
249
+ return [
250
+ {
251
+ type: 'html',
252
+ content: pending
253
+ },
254
+ ...toArray(origin)
255
+ ];
256
+ },
257
+ text (node) {
258
+ const value = node.literal || '';
259
+ if (isInCodeNode(node)) {
260
+ return {
261
+ type: 'text',
262
+ content: value
263
+ };
264
+ }
265
+ const result = processText(value);
266
+ if (!result.hasMath) {
267
+ return {
268
+ type: 'text',
269
+ content: value
270
+ };
271
+ }
272
+ return {
273
+ type: 'html',
274
+ content: result.html
275
+ };
276
+ },
277
+ softbreak (_node, context) {
278
+ if (mathState) {
279
+ mathState.content += '\n';
280
+ return {
281
+ type: 'text',
282
+ content: ''
283
+ };
284
+ }
285
+ return context.origin();
286
+ },
287
+ linebreak (_node, context) {
288
+ if (mathState) {
289
+ mathState.content += '\n';
290
+ return {
291
+ type: 'text',
292
+ content: ''
293
+ };
294
+ }
295
+ return context.origin();
296
+ },
297
+ /**
298
+ * 支持 TUI custom block:
299
+ *
300
+ * $$katex
301
+ * \frac{15}{5000}\times 100\%=0.3\%
302
+ * $$
303
+ */ katex: renderBlock,
304
+ /**
305
+ * 这里 latex 也按数学公式处理,不走 latex.js。
306
+ */ latex: renderBlock
307
+ };
308
+ return renderer;
309
+ }
@@ -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
+ }
@@ -25,10 +25,6 @@
25
25
  background-color: #979ba5;
26
26
  }
27
27
 
28
- .aidev-markdown-preview .toastui-editor-contents code, .toastui-editor .toastui-editor-contents code, .toastui-editor-md-preview .toastui-editor-contents code {
29
- font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace;
30
- }
31
-
32
28
  .aidev-markdown-preview .toastui-editor-contents p,
33
29
  .aidev-markdown-preview .toastui-editor-contents td,
34
30
  .toastui-editor .toastui-editor-contents p,
@@ -40,10 +36,12 @@
40
36
 
41
37
  .aidev-markdown-preview .toastui-editor-contents h1, .toastui-editor .toastui-editor-contents h1, .toastui-editor-md-preview .toastui-editor-contents h1 {
42
38
  margin: 32px 0 20px;
39
+ border-bottom: 2px solid #eaecef;
43
40
  }
44
41
 
45
42
  .aidev-markdown-preview .toastui-editor-contents h2, .toastui-editor .toastui-editor-contents h2, .toastui-editor-md-preview .toastui-editor-contents h2 {
46
43
  margin: 24px 0 16px;
44
+ border-bottom: 1px solid #eaecef;
47
45
  }
48
46
 
49
47
  .aidev-markdown-preview .toastui-editor-contents h3, .toastui-editor .toastui-editor-contents h3, .toastui-editor-md-preview .toastui-editor-contents h3 {
@@ -68,18 +66,28 @@
68
66
  }
69
67
 
70
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 {
71
- background-color: #f5f7fa;
72
- color: #4d4f56;
73
- }
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
+ }
74
81
 
75
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 {
76
83
  position: relative;
77
84
  }
78
85
 
79
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 {
80
- position: absolute;
81
- top: 4px;
82
- right: 8px;
87
+ position: sticky;
88
+ top: -16px;
89
+ float: right;
90
+ margin: -25px -12px 0 0;
83
91
  font-size: 14px;
84
92
  color: #979ba5;
85
93
  cursor: pointer;
@@ -87,5 +95,5 @@
87
95
  }
88
96
 
89
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 {
90
- color: #313238;
98
+ color: #3a84ff;
91
99
  }
@@ -30,6 +30,7 @@ import { defineComponent, h, onMounted, onUnmounted, ref, watch } from 'vue';
30
30
  import { filterXss } from '@blueking/xss-filter';
31
31
  import Viewer from '@toast-ui/editor/dist/toastui-editor-viewer';
32
32
  import { commonConfig } from './common.ts.js';
33
+ import { filterCSS } from './filter-css.ts.js';
33
34
  import '@toast-ui/editor/dist/toastui-editor-viewer.css';
34
35
  import './view.postcss.css';
35
36
  export default defineComponent({
@@ -53,13 +54,14 @@ export default defineComponent({
53
54
  viewer = new Viewer(_object_spread({
54
55
  el: viewerRef.value,
55
56
  initialValue: props.value,
56
- customHTMLSanitizer: (html)=>filterXss(html, {
57
+ customHTMLSanitizer: (html)=>filterCSS(filterXss(html, {
57
58
  whiteList: {
58
59
  a: [
59
60
  'href',
60
61
  'target',
61
62
  'class',
62
- 'title'
63
+ 'title',
64
+ 'rel'
63
65
  ],
64
66
  section: [
65
67
  'class'
@@ -69,7 +71,13 @@ export default defineComponent({
69
71
  ],
70
72
  span: [
71
73
  'class',
72
- 'data-variable-index'
74
+ 'style',
75
+ 'data-variable-index',
76
+ 'aria-hidden'
77
+ ],
78
+ div: [
79
+ 'class',
80
+ 'style'
73
81
  ],
74
82
  svg: [
75
83
  'class'
@@ -83,15 +91,58 @@ export default defineComponent({
83
91
  li: [
84
92
  'class',
85
93
  'title'
94
+ ],
95
+ p: [
96
+ 'class'
97
+ ],
98
+ br: [],
99
+ strong: [
100
+ 'class'
101
+ ],
102
+ b: [
103
+ 'class'
104
+ ],
105
+ em: [
106
+ 'class'
107
+ ],
108
+ code: [
109
+ 'class'
110
+ ],
111
+ pre: [
112
+ 'class'
113
+ ],
114
+ blockquote: [
115
+ 'class'
116
+ ],
117
+ table: [
118
+ 'class'
119
+ ],
120
+ thead: [
121
+ 'class'
122
+ ],
123
+ tbody: [
124
+ 'class'
125
+ ],
126
+ tr: [
127
+ 'class'
128
+ ],
129
+ th: [
130
+ 'class',
131
+ 'align'
132
+ ],
133
+ td: [
134
+ 'class',
135
+ 'align'
86
136
  ]
87
137
  },
138
+ css: false,
88
139
  onTagAttr: (_tag, name, value)=>{
89
140
  if (name === 'data-nodeid') {
90
141
  return `${name}="${value}"`;
91
142
  }
92
143
  return undefined;
93
144
  }
94
- })
145
+ }))
95
146
  }, commonConfig));
96
147
  };
97
148
  const handleDestroy = ()=>{
@@ -1,12 +1,12 @@
1
1
 
2
- .router-tab[data-v-or6whvdj] {
2
+ .router-tab[data-v-ojhdcext] {
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 24px;
8
8
  }
9
- .router-tab a[data-v-or6whvdj] {
9
+ .router-tab a[data-v-ojhdcext] {
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-or6whvdj] {
18
+ .router-tab a.router-link-exact-active[data-v-ojhdcext] {
19
19
  color: #3A84FF;
20
20
  border-bottom: 2px solid #3A84FF;
21
21
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-or6whvdj";
2
+ script.__scopeId = "data-v-ojhdcext";
3
3
  script.__file = "./src/components/render-router-tab/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;