@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,116 @@
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, onMounted, onUnmounted, ref, watch } from 'vue';
30
+ import { filterXss } from '@blueking/xss-filter';
31
+ import Viewer from '@toast-ui/editor/dist/toastui-editor-viewer';
32
+ import { commonConfig } from './common.ts.js';
33
+ import '@toast-ui/editor/dist/toastui-editor-viewer.css';
34
+ import './view.postcss.css';
35
+ export default defineComponent({
36
+ props: {
37
+ value: {
38
+ type: String
39
+ },
40
+ previewBackground: {
41
+ type: String,
42
+ default: '#fff'
43
+ },
44
+ padding: {
45
+ type: String,
46
+ default: '12px 16px'
47
+ }
48
+ },
49
+ setup (props) {
50
+ const viewerRef = ref();
51
+ let viewer;
52
+ const handleInit = ()=>{
53
+ viewer = new Viewer(_object_spread({
54
+ el: viewerRef.value,
55
+ initialValue: props.value,
56
+ customHTMLSanitizer: (html)=>filterXss(html, {
57
+ whiteList: {
58
+ a: [
59
+ 'href',
60
+ 'target',
61
+ 'class',
62
+ 'title'
63
+ ],
64
+ section: [
65
+ 'class'
66
+ ],
67
+ i: [
68
+ 'class'
69
+ ],
70
+ span: [
71
+ 'class',
72
+ 'data-variable-index'
73
+ ],
74
+ svg: [
75
+ 'class'
76
+ ],
77
+ use: [
78
+ 'href'
79
+ ],
80
+ ul: [
81
+ 'class'
82
+ ],
83
+ li: [
84
+ 'class',
85
+ 'title'
86
+ ]
87
+ },
88
+ onTagAttr: (_tag, name, value)=>{
89
+ if (name === 'data-nodeid') {
90
+ return `${name}="${value}"`;
91
+ }
92
+ return undefined;
93
+ }
94
+ })
95
+ }, commonConfig));
96
+ };
97
+ const handleDestroy = ()=>{
98
+ viewer.destroy();
99
+ viewer = null;
100
+ };
101
+ watch(()=>props.value, (value)=>{
102
+ if (!viewer) return;
103
+ viewer.setMarkdown(value || '');
104
+ });
105
+ onMounted(handleInit);
106
+ onUnmounted(handleDestroy);
107
+ return ()=>h('section', {
108
+ ref: viewerRef,
109
+ class: 'g-height-full g-scrollbar aidev-markdown-preview',
110
+ style: {
111
+ 'background-color': props.previewBackground,
112
+ padding: props.padding
113
+ }
114
+ });
115
+ }
116
+ });
@@ -1,12 +1,12 @@
1
1
 
2
- .router-tab[data-v-29xvcqpd] {
2
+ .router-tab[data-v-i9x5wla3] {
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-29xvcqpd] {
9
+ .router-tab a[data-v-i9x5wla3] {
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-29xvcqpd] {
18
+ .router-tab a.router-link-exact-active[data-v-i9x5wla3] {
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-29xvcqpd";
2
+ script.__scopeId = "data-v-i9x5wla3";
3
3
  script.__file = "./src/components/render-router-tab/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,12 +1,12 @@
1
1
 
2
- .t-t-pagination[data-v-jscjte99] {
2
+ .t-t-pagination[data-v-0m307x41] {
3
3
  position: relative;
4
4
  padding: 16px 16px 0 16px;
5
5
  }
6
- .t-t-pagination[data-v-jscjte99] .bk-pagination-list.is-last {
6
+ .t-t-pagination[data-v-0m307x41] .bk-pagination-list.is-last {
7
7
  margin-left: auto;
8
8
  }
9
- .pagination-loading[data-v-jscjte99]::after {
9
+ .pagination-loading[data-v-0m307x41]::after {
10
10
  content: '';
11
11
  position: absolute;
12
12
  top: 0;
@@ -16,93 +16,93 @@
16
16
  background-color: rgba(255, 255, 255, 0.6);
17
17
  z-index: 72;
18
18
  }
19
- .pagination-border[data-v-jscjte99] {
19
+ .pagination-border[data-v-0m307x41] {
20
20
  border-right: 1px solid #dcdee5;
21
21
  border-left: 1px solid #dcdee5;
22
22
  border-bottom: 1px solid #dcdee5;
23
23
  padding-bottom: 16px;
24
24
  }
25
- .t-t-table[data-v-jscjte99] {
25
+ .t-t-table[data-v-0m307x41] {
26
26
  display: inline;
27
27
  font-size: 12px;
28
28
  }
29
- .t-t-table[data-v-jscjte99] .t-table__th-cell-inner {
29
+ .t-t-table[data-v-0m307x41] .t-table__th-cell-inner {
30
30
  color: #313238;
31
31
  }
32
- .t-t-table[data-v-jscjte99] th {
32
+ .t-t-table[data-v-0m307x41] th {
33
33
  padding: 0 16px;
34
34
  height: 42px;
35
35
  background-color: #FAFBFD !important;
36
36
  }
37
- .t-t-table[data-v-jscjte99] .t-table__body tr {
37
+ .t-t-table[data-v-0m307x41] .t-table__body tr {
38
38
  color: #63656e;
39
39
  font-size: 12px;
40
40
  }
41
- .t-t-table[data-v-jscjte99] .t-table__body tr td {
41
+ .t-t-table[data-v-0m307x41] .t-table__body tr td {
42
42
  padding: 0 16px;
43
43
  height: 40px;
44
44
  background-color: #fff;
45
45
  }
46
- .t-t-table[data-v-jscjte99] .t-table__body tr:hover td {
46
+ .t-t-table[data-v-0m307x41] .t-table__body tr:hover td {
47
47
  background-color: #f5f7fa !important;
48
48
  color: #63656E;
49
49
  }
50
- .t-t-table[data-v-jscjte99] .t-table__content .t-table__body .t-table__empty-row {
50
+ .t-t-table[data-v-0m307x41] .t-table__content .t-table__body .t-table__empty-row {
51
51
  background-color: #fff !important;
52
52
  }
53
- .t-t-table[data-v-jscjte99] .t-table__content .t-table__body .t-table__empty-row >td {
53
+ .t-t-table[data-v-0m307x41] .t-table__content .t-table__body .t-table__empty-row >td {
54
54
  border: none;
55
55
  }
56
- .t-t-table[data-v-jscjte99] th .t-table__ellipsis {
56
+ .t-t-table[data-v-0m307x41] th .t-table__ellipsis {
57
57
  width: auto !important;
58
58
  }
59
- .t-t-table[data-v-jscjte99] .t-loading__gradient.t-icon-loading {
59
+ .t-t-table[data-v-0m307x41] .t-loading__gradient.t-icon-loading {
60
60
  display: none;
61
61
  }
62
- .t-t-table[data-v-jscjte99]:first-of-type .t-table__affixed-header-elm-wrap{
62
+ .t-t-table[data-v-0m307x41]:first-of-type .t-table__affixed-header-elm-wrap{
63
63
  width: calc(100% - 6px) !important;
64
64
  }
65
- .t-t-table[data-v-jscjte99] .t-table__affixed-header-elm-wrap>div {
65
+ .t-t-table[data-v-0m307x41] .t-table__affixed-header-elm-wrap>div {
66
66
  width: 100% !important;
67
67
  scrollbar-width: none;
68
68
  }
69
- .t-t-table[data-v-jscjte99] .t-table--layout-fixed{
69
+ .t-t-table[data-v-0m307x41] .t-table--layout-fixed{
70
70
  width: 100% !important;
71
71
  }
72
- .t-t-table[data-v-jscjte99] .bk-exception-description{
72
+ .t-t-table[data-v-0m307x41] .bk-exception-description{
73
73
  margin-bottom: 0;
74
74
  }
75
- .t-t-table[data-v-jscjte99] .t-table__content{
75
+ .t-t-table[data-v-0m307x41] .t-table__content{
76
76
  z-index: 2;
77
77
  max-height: 100%;
78
78
  overflow: auto;
79
79
  }
80
- .t-t-table[data-v-jscjte99] .t-table__content::-webkit-scrollbar {
80
+ .t-t-table[data-v-0m307x41] .t-table__content::-webkit-scrollbar {
81
81
  width: 6px;
82
82
  height: 6px;
83
83
  }
84
- .t-t-table[data-v-jscjte99] .t-table__content::-webkit-scrollbar-thumb {
84
+ .t-t-table[data-v-0m307x41] .t-table__content::-webkit-scrollbar-thumb {
85
85
  width: 6px;
86
86
  height: 6px;
87
87
  border-radius: 3px;
88
88
  background-color: #dcdee5;
89
89
  }
90
- .t-t-table[data-v-jscjte99] .t-table__content::-webkit-scrollbar-thumb:hover {
90
+ .t-t-table[data-v-0m307x41] .t-table__content::-webkit-scrollbar-thumb:hover {
91
91
  background-color: #979ba5;
92
92
  }
93
- .t-t-table[data-v-jscjte99] .t-table__ellipsis.t-text-ellipsis:has(.checkbox){
93
+ .t-t-table[data-v-0m307x41] .t-table__ellipsis.t-text-ellipsis:has(.checkbox){
94
94
  line-height: 100%;
95
95
  }
96
- .t-t-table[data-v-jscjte99] .t-table__cell--sort-trigger.t-table__double-icons{
96
+ .t-t-table[data-v-0m307x41] .t-table__cell--sort-trigger.t-table__double-icons{
97
97
  gap: 5px;
98
98
  }
99
- .t-t-table[data-v-jscjte99] .t-table__sort-icon--active>i{
99
+ .t-t-table[data-v-0m307x41] .t-table__sort-icon--active>i{
100
100
  color: #3a84ff !important;
101
101
  }
102
- .t-t-table[data-v-jscjte99] .t-table__cell--fixed-left:has(.checkbox){
102
+ .t-t-table[data-v-0m307x41] .t-table__cell--fixed-left:has(.checkbox){
103
103
  line-height: 100%;
104
104
  }
105
- .t-t-table[data-v-jscjte99] .t-table__filter-icon.t-is-focus>span{
105
+ .t-t-table[data-v-0m307x41] .t-table__filter-icon.t-is-focus>span{
106
106
  color: #3a84ff !important;
107
107
  }
108
108
 
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js';
2
- script.__scopeId = "data-v-jscjte99";
2
+ script.__scopeId = "data-v-0m307x41";
3
3
  script.__file = "./src/components/render-t-table/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,28 +1,28 @@
1
1
 
2
- .tag-tree[data-v-o0k1bin7] {
2
+ .tag-tree[data-v-hzalychi] {
3
3
  font-size: 12px;
4
4
  height: auto;
5
5
  max-height: calc(100% - 44px);
6
6
  }
7
- .tag-tree .manage-tree-item[data-v-o0k1bin7] {
7
+ .tag-tree .manage-tree-item[data-v-hzalychi] {
8
8
  height: 32px;
9
9
  flex: 1;
10
10
  }
11
- .tag-tree .quick-icon[data-v-o0k1bin7] {
11
+ .tag-tree .quick-icon[data-v-hzalychi] {
12
12
  margin-left: -24px;
13
13
  padding-left: 8px;
14
14
  }
15
- .tag-tree[data-v-o0k1bin7] .tree-item:has(.bottom-line) {
15
+ .tag-tree[data-v-hzalychi] .tree-item:has(.bottom-line) {
16
16
  border-bottom: 1px solid #F0F1F5;
17
17
  }
18
- .tag-tree[data-v-o0k1bin7] .tree-item.active .quick-icon {
18
+ .tag-tree[data-v-hzalychi] .tree-item.active .quick-icon {
19
19
  color: #3A84FF;
20
20
  }
21
- .tag-tree[data-v-o0k1bin7] .tree-item.active .tag-number {
21
+ .tag-tree[data-v-hzalychi] .tree-item.active .tag-number {
22
22
  background: #A3C5FD;
23
23
  color: #fff;
24
24
  }
25
- .tag-number[data-v-o0k1bin7] {
25
+ .tag-number[data-v-hzalychi] {
26
26
  line-height: 16px;
27
27
  padding: 0 4px;
28
28
  background-color: #F0F1F5;
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-o0k1bin7";
2
+ script.__scopeId = "data-v-hzalychi";
3
3
  script.__file = "./src/components/render-tag-tree/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -10,10 +10,11 @@ import RenderDatasetList from './components/render-dataset-list/index.vue';
10
10
  import RenderDropdown from './components/render-dropdown/index.vue';
11
11
  import RenderHeader from './components/render-header/index.vue';
12
12
  import RenderLike from './components/render-like/index.vue';
13
- import RenderMarkdown from './components/render-markdown/mark-down';
13
+ import RenderMarkdownEdit from './components/render-markdown/edit';
14
+ import RenderMarkdown from './components/render-markdown/view';
14
15
  import RenderSearchEmpty from './components/render-search-empty/index.vue';
15
16
  import RenderSearchSelect from './components/render-search-select/index.vue';
16
17
  import RenderTTable from './components/render-t-table/index.vue';
17
18
  import RenderTagTree from './components/render-tag-tree/index.vue';
18
19
  import RenderTree from './components/render-tree/index.vue';
19
- export { renderAuthDialog, RenderAutoRefresh, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderHeader, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderCheckbox, RenderChooseTag, RenderMarkdown, RenderSearchEmpty, RenderSearchSelect, RenderLike, RenderTree, RenderTagTree, RenderTTable, RenderDropdown, };
20
+ export { renderAuthDialog, RenderAutoRefresh, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderHeader, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderCheckbox, RenderChooseTag, RenderMarkdown, RenderMarkdownEdit, RenderSearchEmpty, RenderSearchSelect, RenderLike, RenderTree, RenderTagTree, RenderTTable, RenderDropdown, };
@@ -11,10 +11,11 @@ import RenderDatasetList from './components/render-dataset-list/index.vue.js';
11
11
  import RenderDropdown from './components/render-dropdown/index.vue.js';
12
12
  import RenderHeader from './components/render-header/index.vue.js';
13
13
  import RenderLike from './components/render-like/index.vue.js';
14
- import RenderMarkdown from './components/render-markdown/mark-down.ts.js';
14
+ import RenderMarkdownEdit from './components/render-markdown/edit.ts.js';
15
+ import RenderMarkdown from './components/render-markdown/view.ts.js';
15
16
  import RenderSearchEmpty from './components/render-search-empty/index.vue.js';
16
17
  import RenderSearchSelect from './components/render-search-select/index.vue.js';
17
18
  import RenderTTable from './components/render-t-table/index.vue.js';
18
19
  import RenderTagTree from './components/render-tag-tree/index.vue.js';
19
20
  import RenderTree from './components/render-tree/index.vue.js';
20
- export { renderAuthDialog, RenderAutoRefresh, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderHeader, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderCheckbox, RenderChooseTag, RenderMarkdown, RenderSearchEmpty, RenderSearchSelect, RenderLike, RenderTree, RenderTagTree, RenderTTable, RenderDropdown };
21
+ export { renderAuthDialog, RenderAutoRefresh, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderHeader, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderCheckbox, RenderChooseTag, RenderMarkdown, RenderMarkdownEdit, RenderSearchEmpty, RenderSearchSelect, RenderLike, RenderTree, RenderTagTree, RenderTTable, RenderDropdown };
@@ -706,10 +706,6 @@
706
706
  max-height: 600px;
707
707
  }
708
708
 
709
- .g-height-max-400 {
710
- max-height: 400px;
711
- }
712
-
713
709
  .g-height-full {
714
710
  height: 100% !important;
715
711
  }
@@ -1,10 +1,12 @@
1
1
  import { InfoBox } from 'bkui-vue';
2
+ import { hideTargetPopover } from '../util.ts.js';
2
3
  export const useFormLeaveConfirm = ()=>{
3
4
  let copyValue;
4
5
  const handleInitFormLeaveConfirm = (val)=>{
5
6
  copyValue = JSON.parse(JSON.stringify(val));
6
7
  };
7
8
  const handleFormLeaveConfirm = (leaveCallBack, val, noValidate)=>{
9
+ hideTargetPopover();
8
10
  if (!noValidate && copyValue && JSON.stringify(copyValue) !== JSON.stringify(val)) {
9
11
  InfoBox({
10
12
  title: '确认离开当前页?',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/ai-ui-sdk",
3
- "version": "0.2.0-beta.20",
3
+ "version": "0.2.0-beta.22",
4
4
  "description": "蓝鲸AI UI SDK",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -77,13 +77,16 @@
77
77
  "author": "",
78
78
  "license": "ISC",
79
79
  "peerDependencies": {
80
+ "@blueking/xss-filter": "^0.0.10",
81
+ "@toast-ui/editor": "^3.2.2",
82
+ "@toast-ui/editor-plugin-code-syntax-highlight": "^3.1.0",
80
83
  "bkui-vue": "*",
81
- "tdesign-vue-next": "^1.16.0",
82
84
  "dayjs": "^1.11.13",
85
+ "prismjs": "^1.30.0",
86
+ "tdesign-vue-next": "^1.16.0",
83
87
  "tippy.js": "^6.3.7",
84
88
  "vue": "^3.5.13",
85
- "vue-router": "^4.5.1",
86
- "x-mavon-editor": "0.0.20"
89
+ "vue-router": "^4.5.1"
87
90
  },
88
91
  "devDependencies": {
89
92
  "@blueking/babel-preset-bk": "2.1.0",
@@ -1,2 +0,0 @@
1
- import type MarkdownIt from 'markdown-it';
2
- export declare const MarkDownCodePlugin: (markdownIt: MarkdownIt) => void;
@@ -1,171 +0,0 @@
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
- };
@@ -1,2 +0,0 @@
1
- import type MarkdownIt from 'markdown-it';
2
- export declare const MarkDownEmojiPlugin: (markdownIt: MarkdownIt) => void;
@@ -1,4 +0,0 @@
1
- // 关闭emoji
2
- export const MarkDownEmojiPlugin = (markdownIt)=>{
3
- markdownIt.core.ruler.disable('emoji');
4
- };