@blueking/ai-ui-sdk 0.0.14 → 0.0.15-beta.10
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/assets/images/ai.png +0 -0
- package/dist/assets/images/user.png +0 -0
- package/dist/assets/svg/picture-fail.svg +1 -0
- package/dist/common/chart-helper.d.ts +1 -1
- package/dist/common/chart-helper.js +173 -0
- package/dist/common/util.d.ts +31 -0
- package/dist/common/util.js +177 -0
- package/dist/component/render-image/index.script.vue.js +37 -0
- package/dist/component/render-image/index.vue.d.ts +6 -0
- package/dist/component/render-image/index.vue.js +3 -0
- package/dist/component/render-input/index.script.vue.js +205 -0
- package/dist/component/render-input/index.vue.css +134 -0
- package/dist/component/render-input/index.vue.d.ts +18 -0
- package/dist/component/render-input/index.vue.js +5 -0
- package/dist/component/render-input/render-drag.script.vue.js +61 -0
- package/dist/component/render-input/render-drag.vue.css +32 -0
- package/dist/component/render-input/render-drag.vue.d.ts +13 -0
- package/dist/component/render-input/render-drag.vue.js +5 -0
- package/dist/component/render-input/render-quill.script.vue.js +197 -0
- package/dist/component/render-input/render-quill.vue.css +27 -0
- package/dist/component/render-input/render-quill.vue.d.ts +24 -0
- package/dist/component/render-input/render-quill.vue.js +4 -0
- package/dist/component/render-knowledge-icon/index.script.vue.js +40 -0
- package/dist/component/render-knowledge-icon/index.vue.css +4 -0
- package/dist/component/render-knowledge-icon/index.vue.d.ts +14 -0
- package/dist/component/render-knowledge-icon/index.vue.js +5 -0
- package/dist/component/render-markdown/mark-down-code.d.ts +2 -0
- package/dist/component/render-markdown/mark-down-code.js +171 -0
- package/dist/component/render-markdown/mark-down-emoji.d.ts +2 -0
- package/dist/component/render-markdown/mark-down-emoji.js +4 -0
- package/dist/component/render-markdown/mark-down.d.ts +74 -0
- package/dist/component/render-markdown/mark-down.js +147 -0
- package/dist/component/render-markdown/mark-down.postcss.css +131 -0
- package/dist/component/render-message/image-not-supported-message.script.vue.js +99 -0
- package/dist/component/render-message/image-not-supported-message.vue.css +66 -0
- package/dist/component/render-message/image-not-supported-message.vue.d.ts +21 -0
- package/dist/component/render-message/image-not-supported-message.vue.js +5 -0
- package/dist/component/render-message/index.script.vue.js +104 -0
- package/dist/component/render-message/index.vue.d.ts +13 -0
- package/dist/component/render-message/index.vue.js +3 -0
- package/dist/component/render-message/openai-message.script.vue.js +215 -0
- package/dist/component/render-message/openai-message.vue.css +98 -0
- package/dist/component/render-message/openai-message.vue.d.ts +15 -0
- package/dist/component/render-message/openai-message.vue.js +5 -0
- package/dist/component/render-message/skeleton-message.script.vue.js +7 -0
- package/dist/component/render-message/skeleton-message.vue.css +7 -0
- package/dist/component/render-message/skeleton-message.vue.d.ts +2 -0
- package/dist/component/render-message/skeleton-message.vue.js +6 -0
- package/dist/component/render-message/system-message.script.vue.js +17 -0
- package/dist/component/render-message/system-message.vue.css +20 -0
- package/dist/component/render-message/system-message.vue.d.ts +6 -0
- package/dist/component/render-message/system-message.vue.js +5 -0
- package/dist/component/render-message/time-message.script.vue.js +41 -0
- package/dist/component/render-message/time-message.vue.css +14 -0
- package/dist/component/render-message/time-message.vue.d.ts +6 -0
- package/dist/component/render-message/time-message.vue.js +5 -0
- package/dist/component/render-message/token-expired-message.script.vue.js +78 -0
- package/dist/component/render-message/token-expired-message.vue.css +60 -0
- package/dist/component/render-message/token-expired-message.vue.d.ts +15 -0
- package/dist/component/render-message/token-expired-message.vue.js +5 -0
- package/dist/component/render-message/user-message.script.vue.js +241 -0
- package/dist/component/render-message/user-message.vue.css +100 -0
- package/dist/component/render-message/user-message.vue.d.ts +21 -0
- package/dist/component/render-message/user-message.vue.js +5 -0
- package/dist/css/fonts/iconcool.eot +0 -0
- package/dist/css/fonts/iconcool.svg +53 -0
- package/dist/css/fonts/iconcool.ttf +0 -0
- package/dist/css/fonts/iconcool.woff +0 -0
- package/dist/css/iconcool.js +10 -0
- package/dist/css/style.css +43 -0
- package/dist/event/index.d.ts +4 -0
- package/dist/event/index.js +18 -0
- package/dist/hooks/use-chat.d.ts +844 -20
- package/dist/hooks/use-chat.js +565 -0
- package/dist/hooks/use-click-proxy.js +77 -0
- package/dist/hooks/use-http.d.ts +15 -0
- package/dist/hooks/use-http.js +48 -0
- package/dist/hooks/use-mouse-drag.d.ts +13 -0
- package/dist/hooks/use-mouse-drag.js +59 -0
- package/dist/hooks/use-reference-doc.d.ts +1 -1
- package/dist/hooks/use-reference-doc.js +185 -0
- package/dist/hooks/use-style.js +11 -0
- package/dist/hooks/use-summary.d.ts +1 -1
- package/dist/hooks/use-summary.js +55 -0
- package/dist/hooks/use-think.js +135 -0
- package/dist/http/fetch/error-interceptor.d.ts +3 -0
- package/dist/http/fetch/error-interceptor.js +28 -0
- package/dist/http/fetch/index.d.ts +25 -0
- package/dist/http/fetch/index.js +182 -0
- package/dist/http/fetch/request-error.d.ts +6 -0
- package/dist/http/fetch/request-error.js +25 -0
- package/dist/http/fetch/success-interceptor.d.ts +3 -0
- package/dist/http/fetch/success-interceptor.js +92 -0
- package/dist/http/helper/knowledge.d.ts +43 -0
- package/dist/http/helper/knowledge.js +227 -0
- package/dist/http/helper/permission.d.ts +7 -0
- package/dist/http/helper/permission.js +28 -0
- package/dist/http/helper/session.d.ts +31 -0
- package/dist/http/helper/session.js +147 -0
- package/dist/http/helper/tool.d.ts +13 -0
- package/dist/http/helper/tool.js +49 -0
- package/dist/main.d.ts +17 -2
- package/dist/main.js +29 -239
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-down-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-left-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-left.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-right-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-right.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-up-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-down-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-down-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-down.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-left.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-right.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-up-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-up.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/archive-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/arrows-left.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/arrows-right.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/assistant.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/audio-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/bk.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/circle.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/close-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/close.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/code.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/cog-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/collapse-left.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/copy-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/copy.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/data-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/del.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/doc-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/done.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/down-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/down-small.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/edit-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/ellipsis.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/enlarge-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/error.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/excel-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/exclamation-circle-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/eye.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/filliscreen-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/fix-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/fix-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/folder-open.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/folder-shape-open.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/folder-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/folder.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/funnel.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/grag-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/help-document-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/help-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/help.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/image-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/img-error.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/img-placehoulder.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/index.js +113 -0
- package/dist/node_modules/bkui-vue/lib/icon/info-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/info.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/left-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/left-turn-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/loading.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/narrow-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/original.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/pdf-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/play-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/plus.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/ppt-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/qq.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/right-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/right-turn-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/search.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/share.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/spinner.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/success.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/switcher-loading.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/text-all.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/text-file.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/text-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/transfer.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/tree-application-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/unfull-screen.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/unvisible.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/up-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/upload.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/video-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/warn.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/weixin-pro.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/weixin.js +191 -0
- package/dist/node_modules/bkui-vue/lib/styles/reset.css +439 -0
- package/dist/node_modules/call-bind/index.js +24 -0
- package/dist/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/dist/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/dist/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/dist/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/dist/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/dist/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/dist/node_modules/call-bound/index.js +19 -0
- package/dist/node_modules/deep-equal/index.js +112 -0
- package/dist/node_modules/define-data-property/index.js +56 -0
- package/dist/node_modules/define-properties/index.js +47 -0
- package/dist/node_modules/dunder-proto/get.js +30 -0
- package/dist/node_modules/es-define-property/index.js +14 -0
- package/dist/node_modules/es-errors/eval.js +4 -0
- package/dist/node_modules/es-errors/index.js +4 -0
- package/dist/node_modules/es-errors/range.js +4 -0
- package/dist/node_modules/es-errors/ref.js +4 -0
- package/dist/node_modules/es-errors/syntax.js +4 -0
- package/dist/node_modules/es-errors/type.js +4 -0
- package/dist/node_modules/es-errors/uri.js +4 -0
- package/dist/node_modules/es-object-atoms/index.js +4 -0
- package/dist/node_modules/extend/index.js +117 -0
- package/dist/node_modules/fast-diff/diff.js +738 -0
- package/dist/node_modules/function-bind/implementation.js +84 -0
- package/dist/node_modules/function-bind/index.js +5 -0
- package/dist/node_modules/functions-have-names/index.js +31 -0
- package/dist/node_modules/get-intrinsic/index.js +378 -0
- package/dist/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/dist/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/dist/node_modules/get-proto/index.js +27 -0
- package/dist/node_modules/gopd/gOPD.js +4 -0
- package/dist/node_modules/gopd/index.js +15 -0
- package/dist/node_modules/has-property-descriptors/index.js +22 -0
- package/dist/node_modules/has-symbols/index.js +14 -0
- package/dist/node_modules/has-symbols/shams.js +45 -0
- package/dist/node_modules/has-tostringtag/shams.js +8 -0
- package/dist/node_modules/hasown/index.js +8 -0
- package/dist/node_modules/is-arguments/index.js +44 -0
- package/dist/node_modules/is-date-object/index.js +27 -0
- package/dist/node_modules/is-regex/index.js +69 -0
- package/dist/node_modules/math-intrinsics/abs.js +4 -0
- package/dist/node_modules/math-intrinsics/floor.js +4 -0
- package/dist/node_modules/math-intrinsics/isNaN.js +6 -0
- package/dist/node_modules/math-intrinsics/max.js +4 -0
- package/dist/node_modules/math-intrinsics/min.js +4 -0
- package/dist/node_modules/math-intrinsics/pow.js +4 -0
- package/dist/node_modules/math-intrinsics/round.js +4 -0
- package/dist/node_modules/math-intrinsics/sign.js +11 -0
- package/dist/node_modules/object-is/implementation.js +19 -0
- package/dist/node_modules/object-is/index.js +18 -0
- package/dist/node_modules/object-is/polyfill.js +7 -0
- package/dist/node_modules/object-is/shim.js +14 -0
- package/dist/node_modules/object-keys/implementation.js +122 -0
- package/dist/node_modules/object-keys/index.js +32 -0
- package/dist/node_modules/object-keys/isArguments.js +17 -0
- package/dist/node_modules/quill/dist/quill.js +11562 -0
- package/dist/node_modules/quill/dist/quill.snow.css +945 -0
- package/dist/node_modules/quill-delta/lib/delta.js +344 -0
- package/dist/node_modules/quill-delta/lib/op.js +155 -0
- package/dist/node_modules/regexp.prototype.flags/implementation.js +39 -0
- package/dist/node_modules/regexp.prototype.flags/index.js +18 -0
- package/dist/node_modules/regexp.prototype.flags/polyfill.js +39 -0
- package/dist/node_modules/regexp.prototype.flags/shim.js +26 -0
- package/dist/node_modules/set-function-length/index.js +42 -0
- package/dist/node_modules/set-function-name/index.js +23 -0
- package/dist/node_modules/x-mavon-editor/dist/css/index.css +1 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.eot +0 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.svg +72 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/highlight.min.js +1150 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/bash.min.js +20 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/css.min.js +31 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/go.min.js +14 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/java.min.js +37 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/javascript.min.js +76 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/json.min.js +7 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/markdown.min.js +31 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/perl.min.js +36 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/php.min.js +37 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/python.min.js +42 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/ruby.min.js +48 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/sql.min.js +17 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/swift.min.js +60 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/typescript.min.js +92 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/xml.min.js +28 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/styles/atom-one-dark.min.css +1 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/katex.min.css +1 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/katex.min.js +1 -0
- package/dist/node_modules/x-mavon-editor/dist/markdown/github-markdown.min.css +2 -0
- package/dist/node_modules/x-mavon-editor/dist/mavon-editor.js +31 -0
- package/dist/types/enum.d.ts +44 -0
- package/dist/types/enum.js +111 -0
- package/dist/types/file.d.ts +13 -0
- package/dist/types/file.js +1 -0
- package/dist/types/knowledge.d.ts +133 -0
- package/dist/types/knowledge.js +1 -0
- package/dist/types/model.d.ts +14 -0
- package/dist/types/permission.d.ts +48 -0
- package/dist/types/permission.js +1 -0
- package/dist/types/{type.d.ts → session.d.ts} +84 -23
- package/dist/types/session.js +1 -0
- package/dist/types/tool.d.ts +60 -0
- package/dist/types/tool.js +1 -0
- package/package.json +10 -4
- package/dist/common/type-transform.d.ts +0 -7
@@ -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="bkaidev-icon bkaidev-un-full-screen click-un-full-screen"></i>
|
142
|
+
<i class="bkaidev-icon bkaidev-full-screen click-full-screen"></i>
|
143
|
+
<i class="bkaidev-icon bkaidev-copy click-copy" data-clipboard-text="${encodeCode}"></i>
|
144
|
+
<i class="bkaidev-icon bkaidev-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,74 @@
|
|
1
|
+
import type MarkdownIt from 'markdown-it';
|
2
|
+
import 'x-mavon-editor/dist/css/index.css';
|
3
|
+
import 'x-mavon-editor/dist/markdown/github-markdown.min.css';
|
4
|
+
import 'x-mavon-editor/dist/highlightjs/styles/atom-one-dark.min.css';
|
5
|
+
import 'x-mavon-editor/dist/highlightjs/highlight.min.js';
|
6
|
+
import 'x-mavon-editor/dist/highlightjs/languages/javascript.min.js';
|
7
|
+
import 'x-mavon-editor/dist/highlightjs/languages/css.min.js';
|
8
|
+
import 'x-mavon-editor/dist/highlightjs/languages/python.min.js';
|
9
|
+
import 'x-mavon-editor/dist/highlightjs/languages/java.min.js';
|
10
|
+
import 'x-mavon-editor/dist/highlightjs/languages/php.min.js';
|
11
|
+
import 'x-mavon-editor/dist/highlightjs/languages/ruby.min.js';
|
12
|
+
import 'x-mavon-editor/dist/highlightjs/languages/swift.min.js';
|
13
|
+
import 'x-mavon-editor/dist/highlightjs/languages/go.min.js';
|
14
|
+
import 'x-mavon-editor/dist/highlightjs/languages/perl.min.js';
|
15
|
+
import 'x-mavon-editor/dist/highlightjs/languages/sql.min.js';
|
16
|
+
import 'x-mavon-editor/dist/highlightjs/languages/xml.min.js';
|
17
|
+
import 'x-mavon-editor/dist/highlightjs/languages/json.min.js';
|
18
|
+
import 'x-mavon-editor/dist/highlightjs/languages/typescript.min.js';
|
19
|
+
import 'x-mavon-editor/dist/highlightjs/languages/bash.min.js';
|
20
|
+
import 'x-mavon-editor/dist/highlightjs/languages/markdown.min.js';
|
21
|
+
import 'x-mavon-editor/dist/katex/katex.min.css';
|
22
|
+
import 'x-mavon-editor/dist/katex/katex.min.js';
|
23
|
+
import './mark-down.postcss';
|
24
|
+
export type MdProp = {
|
25
|
+
modelValue?: string;
|
26
|
+
codeStyle?: string;
|
27
|
+
previewBackground?: string;
|
28
|
+
defaultOpen: string;
|
29
|
+
editable: boolean;
|
30
|
+
subfield: boolean;
|
31
|
+
toolbarsFlag: boolean;
|
32
|
+
boxShadow: boolean;
|
33
|
+
ref?: (elm: MdRef) => void;
|
34
|
+
xssOptions: {
|
35
|
+
whiteList: {
|
36
|
+
[key: string]: string[];
|
37
|
+
};
|
38
|
+
};
|
39
|
+
};
|
40
|
+
type MdRef = {
|
41
|
+
$paste: () => void;
|
42
|
+
markdownIt: MarkdownIt;
|
43
|
+
};
|
44
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
45
|
+
value: {
|
46
|
+
type: StringConstructor;
|
47
|
+
};
|
48
|
+
isCode: {
|
49
|
+
type: BooleanConstructor;
|
50
|
+
default: boolean;
|
51
|
+
};
|
52
|
+
previewBackground: {
|
53
|
+
type: StringConstructor;
|
54
|
+
default: string;
|
55
|
+
};
|
56
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
57
|
+
[key: string]: any;
|
58
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
59
|
+
value: {
|
60
|
+
type: StringConstructor;
|
61
|
+
};
|
62
|
+
isCode: {
|
63
|
+
type: BooleanConstructor;
|
64
|
+
default: boolean;
|
65
|
+
};
|
66
|
+
previewBackground: {
|
67
|
+
type: StringConstructor;
|
68
|
+
default: string;
|
69
|
+
};
|
70
|
+
}>> & Readonly<{}>, {
|
71
|
+
isCode: boolean;
|
72
|
+
previewBackground: string;
|
73
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
74
|
+
export default _default;
|
@@ -0,0 +1,147 @@
|
|
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 '../../../dist/node_modules/x-mavon-editor/dist/mavon-editor.js';
|
55
|
+
import { MarkDownCodePlugin } from './mark-down-code.js';
|
56
|
+
import { MarkDownEmojiPlugin } from './mark-down-emoji.js';
|
57
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/css/index.css';
|
58
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/markdown/github-markdown.min.css';
|
59
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/styles/atom-one-dark.min.css';
|
60
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/highlight.min.js';
|
61
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/javascript.min.js';
|
62
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/css.min.js';
|
63
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/python.min.js';
|
64
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/java.min.js';
|
65
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/php.min.js';
|
66
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/ruby.min.js';
|
67
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/swift.min.js';
|
68
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/go.min.js';
|
69
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/perl.min.js';
|
70
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/sql.min.js';
|
71
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/xml.min.js';
|
72
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/json.min.js';
|
73
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/typescript.min.js';
|
74
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/bash.min.js';
|
75
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/highlightjs/languages/markdown.min.js';
|
76
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/katex/katex.min.css';
|
77
|
+
import '../../../dist/node_modules/x-mavon-editor/dist/katex/katex.min.js';
|
78
|
+
import './mark-down.postcss.css';
|
79
|
+
const defaultMDProps = {
|
80
|
+
defaultOpen: 'preview',
|
81
|
+
editable: false,
|
82
|
+
subfield: false,
|
83
|
+
toolbarsFlag: false,
|
84
|
+
boxShadow: false,
|
85
|
+
xssOptions: {
|
86
|
+
whiteList: {
|
87
|
+
a: [
|
88
|
+
'href',
|
89
|
+
'target',
|
90
|
+
'class',
|
91
|
+
'title'
|
92
|
+
],
|
93
|
+
section: [
|
94
|
+
'class'
|
95
|
+
],
|
96
|
+
i: [
|
97
|
+
'class'
|
98
|
+
],
|
99
|
+
span: [
|
100
|
+
'class'
|
101
|
+
],
|
102
|
+
svg: [
|
103
|
+
'class'
|
104
|
+
],
|
105
|
+
use: [
|
106
|
+
'href'
|
107
|
+
],
|
108
|
+
ul: [
|
109
|
+
'class'
|
110
|
+
],
|
111
|
+
li: [
|
112
|
+
'class',
|
113
|
+
'title'
|
114
|
+
]
|
115
|
+
}
|
116
|
+
}
|
117
|
+
};
|
118
|
+
export default defineComponent({
|
119
|
+
props: {
|
120
|
+
value: {
|
121
|
+
type: String
|
122
|
+
},
|
123
|
+
isCode: {
|
124
|
+
type: Boolean,
|
125
|
+
default: false
|
126
|
+
},
|
127
|
+
previewBackground: {
|
128
|
+
type: String,
|
129
|
+
default: '#fff'
|
130
|
+
}
|
131
|
+
},
|
132
|
+
setup (props) {
|
133
|
+
const mdRef = (md)=>{
|
134
|
+
if (!md) return;
|
135
|
+
// 注册代码块插件
|
136
|
+
MarkDownCodePlugin(md.markdownIt);
|
137
|
+
// 注册表情插件
|
138
|
+
MarkDownEmojiPlugin(md.markdownIt);
|
139
|
+
};
|
140
|
+
return ()=>h(Mavon.mavonEditor, _object_spread_props(_object_spread({}, defaultMDProps), {
|
141
|
+
previewBackground: props.previewBackground,
|
142
|
+
modelValue: props.value,
|
143
|
+
codeStyle: 'atom-one-dark',
|
144
|
+
ref: mdRef
|
145
|
+
}));
|
146
|
+
}
|
147
|
+
});
|
@@ -0,0 +1,131 @@
|
|
1
|
+
.v-note-wrapper.markdown-body {
|
2
|
+
border: none !important;
|
3
|
+
min-height: auto;
|
4
|
+
background: transparent;
|
5
|
+
}
|
6
|
+
|
7
|
+
.v-show-content {
|
8
|
+
height: auto !important;
|
9
|
+
font-size: 14px !important;
|
10
|
+
padding: 8px 25px !important;
|
11
|
+
min-height: 37px !important;
|
12
|
+
|
13
|
+
p {
|
14
|
+
margin-bottom: 0 !important;
|
15
|
+
|
16
|
+
& + p {
|
17
|
+
margin-top: 16px;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
.full-screen-wrap.markdown-body {
|
23
|
+
.code-header {
|
24
|
+
height: 40px;
|
25
|
+
justify-content: space-between;
|
26
|
+
background: #2e2e2e;
|
27
|
+
border-radius: 2px 2px 0 0;
|
28
|
+
padding: 0 18px;
|
29
|
+
color: #c4c6cc;
|
30
|
+
|
31
|
+
.bkaidev-un-full-screen,
|
32
|
+
.bkaidev-full-screen,
|
33
|
+
.bkaidev-copy {
|
34
|
+
margin-right: 12px;
|
35
|
+
}
|
36
|
+
|
37
|
+
.bkaidev-icon {
|
38
|
+
color: #979ba5;
|
39
|
+
cursor: pointer;
|
40
|
+
|
41
|
+
&:hover {
|
42
|
+
color: #3a84ff;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
& + pre {
|
47
|
+
max-height: 500px;
|
48
|
+
overflow-y: auto;
|
49
|
+
color: #abb2bf !important;
|
50
|
+
background: #1a1a1a !important;
|
51
|
+
border-radius: 0 0 2px 2px !important;
|
52
|
+
font-size: 14px !important;
|
53
|
+
padding: 16px;
|
54
|
+
line-height: 1.45;
|
55
|
+
|
56
|
+
code {
|
57
|
+
font-size: 14px !important;
|
58
|
+
}
|
59
|
+
|
60
|
+
.hljs-comment {
|
61
|
+
color: #6a9954;
|
62
|
+
font-style: inherit;
|
63
|
+
}
|
64
|
+
|
65
|
+
.hljs {
|
66
|
+
overflow: initial;
|
67
|
+
background: #1a1a1a !important;
|
68
|
+
}
|
69
|
+
|
70
|
+
&::-webkit-scrollbar-track {
|
71
|
+
background: #2e2e2e;
|
72
|
+
border-left: 1px solid #3d3d3d;
|
73
|
+
border-top: 1px solid #3d3d3d;
|
74
|
+
}
|
75
|
+
|
76
|
+
&::-webkit-scrollbar {
|
77
|
+
width: 14px;
|
78
|
+
height: 14px;
|
79
|
+
}
|
80
|
+
|
81
|
+
&::-webkit-scrollbar-corner {
|
82
|
+
background: #2e2e2e !important;
|
83
|
+
}
|
84
|
+
|
85
|
+
&::-webkit-scrollbar-thumb {
|
86
|
+
height: 5px;
|
87
|
+
border-radius: 1px;
|
88
|
+
background: rgb(121 121 121 / 40%);
|
89
|
+
border: 1px solid #63656e;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
&:not(:first-child) {
|
95
|
+
margin-top: 8px !important;
|
96
|
+
}
|
97
|
+
|
98
|
+
&:not(:last-child) {
|
99
|
+
margin-bottom: 8px !important;
|
100
|
+
}
|
101
|
+
|
102
|
+
&.full-screen {
|
103
|
+
margin-top: 0 !important;
|
104
|
+
|
105
|
+
.code-header {
|
106
|
+
margin: 0;
|
107
|
+
}
|
108
|
+
|
109
|
+
pre {
|
110
|
+
max-height: calc(100vh - 40px);
|
111
|
+
height: calc(100vh - 40px);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
.full-screen-wrap.full-screen {
|
116
|
+
margin-top: 0 !important;
|
117
|
+
|
118
|
+
.code-header {
|
119
|
+
margin: 0;
|
120
|
+
}
|
121
|
+
|
122
|
+
pre {
|
123
|
+
max-height: calc(100vh - 40px);
|
124
|
+
height: calc(100vh - 40px);
|
125
|
+
}
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
.v-note-img-wrapper {
|
130
|
+
display: none !important;
|
131
|
+
}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
2
|
+
import { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withModifiers as _withModifiers, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, createTextVNode as _createTextVNode, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass } from "vue";
|
3
|
+
import _imports_0 from '../../assets/images/ai.png';
|
4
|
+
const _hoisted_1 = {
|
5
|
+
class: "ai-message-home g-flex-row"
|
6
|
+
};
|
7
|
+
const _hoisted_2 = [
|
8
|
+
"onClick"
|
9
|
+
];
|
10
|
+
import SkeletonMessage from './skeleton-message.vue.js';
|
11
|
+
export default /*@__PURE__*/ _defineComponent({
|
12
|
+
props: {
|
13
|
+
sessionContent: {},
|
14
|
+
isOperateHistory: {
|
15
|
+
type: Boolean
|
16
|
+
},
|
17
|
+
selected: {
|
18
|
+
type: Boolean
|
19
|
+
},
|
20
|
+
visible: {
|
21
|
+
type: Boolean
|
22
|
+
},
|
23
|
+
supportImageModels: {},
|
24
|
+
sessionLoadingMap: {},
|
25
|
+
currentSession: {}
|
26
|
+
},
|
27
|
+
emits: [
|
28
|
+
"select",
|
29
|
+
"update-session-list",
|
30
|
+
"change-model"
|
31
|
+
],
|
32
|
+
setup (__props, { emit: __emit }) {
|
33
|
+
const emits = __emit;
|
34
|
+
const handelCheck = (selected)=>{
|
35
|
+
emits('select', selected);
|
36
|
+
};
|
37
|
+
const handleChangeModel = (llmCode)=>{
|
38
|
+
emits('change-model', llmCode);
|
39
|
+
};
|
40
|
+
return (_ctx, _cache)=>{
|
41
|
+
const _component_bk_checkbox = _resolveComponent("bk-checkbox");
|
42
|
+
return _openBlock(), _createElementBlock("section", _hoisted_1, [
|
43
|
+
_cache[5] || (_cache[5] = _createElementVNode("span", {
|
44
|
+
class: "message-photo"
|
45
|
+
}, [
|
46
|
+
_createElementVNode("img", {
|
47
|
+
src: _imports_0
|
48
|
+
})
|
49
|
+
], -1 /* HOISTED */ )),
|
50
|
+
_ctx.visible ? (_openBlock(), _createElementBlock("p", {
|
51
|
+
key: 0,
|
52
|
+
class: _normalizeClass([
|
53
|
+
'ai-content',
|
54
|
+
_ctx.sessionContent.status
|
55
|
+
]),
|
56
|
+
onClick: _cache[1] || (_cache[1] = ($event)=>handelCheck(!_ctx.selected))
|
57
|
+
}, [
|
58
|
+
_cache[2] || (_cache[2] = _createElementVNode("i", {
|
59
|
+
class: "bkaidev-icon bkaidev-warning-circle-fill"
|
60
|
+
}, null, -1 /* HOISTED */ )),
|
61
|
+
_ctx.isOperateHistory ? (_openBlock(), _createBlock(_component_bk_checkbox, {
|
62
|
+
key: 0,
|
63
|
+
class: "message-check",
|
64
|
+
"model-value": _ctx.selected,
|
65
|
+
onChange: handelCheck,
|
66
|
+
onClick: _cache[0] || (_cache[0] = _withModifiers(()=>{}, [
|
67
|
+
"stop"
|
68
|
+
]))
|
69
|
+
}, null, 8 /* PROPS */ , [
|
70
|
+
"model-value"
|
71
|
+
])) : _createCommentVNode("v-if", true),
|
72
|
+
_cache[3] || (_cache[3] = _createTextVNode(" 抱歉,当前模型不支持图片,请先切换至 ")),
|
73
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.supportImageModels, (model, index)=>{
|
74
|
+
var _ctx_currentSession;
|
75
|
+
return _openBlock(), _createElementBlock("span", {
|
76
|
+
key: index
|
77
|
+
}, [
|
78
|
+
index > 0 ? (_openBlock(), _createElementBlock(_Fragment, {
|
79
|
+
key: 0
|
80
|
+
}, [
|
81
|
+
_createTextVNode(" 、 ")
|
82
|
+
], 64 /* STABLE_FRAGMENT */ )) : _createCommentVNode("v-if", true),
|
83
|
+
_createElementVNode("span", {
|
84
|
+
class: _normalizeClass({
|
85
|
+
disabled: _ctx.sessionLoadingMap[(_ctx_currentSession = _ctx.currentSession) === null || _ctx_currentSession === void 0 ? void 0 : _ctx_currentSession.sessionCode],
|
86
|
+
'model-message': true
|
87
|
+
}),
|
88
|
+
onClick: ($event)=>handleChangeModel(model.llmCode)
|
89
|
+
}, _toDisplayString(model.llmName), 11 /* TEXT, CLASS, PROPS */ , _hoisted_2)
|
90
|
+
]);
|
91
|
+
}), 128 /* KEYED_FRAGMENT */ )),
|
92
|
+
_cache[4] || (_cache[4] = _createTextVNode(" 模型 "))
|
93
|
+
], 2 /* CLASS */ )) : (_openBlock(), _createBlock(SkeletonMessage, {
|
94
|
+
key: 1
|
95
|
+
}))
|
96
|
+
]);
|
97
|
+
};
|
98
|
+
}
|
99
|
+
});
|