@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,134 @@
|
|
1
|
+
|
2
|
+
.send-prompt-container {
|
3
|
+
&[data-v-kk5zgskn] {
|
4
|
+
width: 800px;
|
5
|
+
z-index: 1501;
|
6
|
+
overflow: visible;
|
7
|
+
position: relative;
|
8
|
+
}
|
9
|
+
[data-v-kk5zgskn] .textarea-list {
|
10
|
+
bottom: var(--textarea-bottom);
|
11
|
+
}
|
12
|
+
&:hover {
|
13
|
+
.clear-icon[data-v-kk5zgskn] {
|
14
|
+
display: inline-flex !important;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
.quill-container {
|
19
|
+
&[data-v-kk5zgskn] {
|
20
|
+
background: #fff;
|
21
|
+
box-shadow: 0 0 6px 0 #0000001a;
|
22
|
+
border-radius: 4px;
|
23
|
+
box-sizing: border-box !important;
|
24
|
+
border: 1px solid transparent;
|
25
|
+
}
|
26
|
+
&.active[data-v-kk5zgskn] {
|
27
|
+
border: 1px solid #3A84FF !important;
|
28
|
+
}
|
29
|
+
&[data-v-kk5zgskn]:has(.ql-editor:focus) {
|
30
|
+
border: 1px solid #3A84FF !important;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
.send-prompt {
|
34
|
+
&[data-v-kk5zgskn] {
|
35
|
+
width: 800px;
|
36
|
+
border: 1px solid transparent;
|
37
|
+
flex-direction: row;
|
38
|
+
height: var(--default-height);
|
39
|
+
min-height: 50px;
|
40
|
+
position: relative;
|
41
|
+
border-radius: 4px;
|
42
|
+
border: 1px solid transparent !important;
|
43
|
+
}
|
44
|
+
[data-v-kk5zgskn] .content-input-wrapper {
|
45
|
+
padding: 0 !important;
|
46
|
+
height: 100% !important;
|
47
|
+
}
|
48
|
+
[data-v-kk5zgskn] .auto-textarea-wrapper {
|
49
|
+
height: 100% !important;
|
50
|
+
}
|
51
|
+
[data-v-kk5zgskn] .v-note-panel {
|
52
|
+
border-radius: 4px;
|
53
|
+
}
|
54
|
+
[data-v-kk5zgskn] .scroll-style {
|
55
|
+
overflow-y: hidden !important;
|
56
|
+
}
|
57
|
+
[data-v-kk5zgskn] .auto-textarea-block {
|
58
|
+
display: none;
|
59
|
+
}
|
60
|
+
&[data-v-kk5zgskn]:has(.ql-editor:focus) {
|
61
|
+
height: var(--text-height);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
.bkaidev-fasong {
|
65
|
+
&[data-v-kk5zgskn] {
|
66
|
+
width: 28px;
|
67
|
+
height: 28px;
|
68
|
+
line-height: 28px;
|
69
|
+
border-radius: 2px;
|
70
|
+
font-size: 20px;
|
71
|
+
cursor: pointer;
|
72
|
+
color: #979BA5;
|
73
|
+
position: absolute;
|
74
|
+
right: 6px;
|
75
|
+
bottom: 35px;
|
76
|
+
text-align: center;
|
77
|
+
z-index: 1501;
|
78
|
+
}
|
79
|
+
&[data-v-kk5zgskn]:hover {
|
80
|
+
background: #F0F5FF;
|
81
|
+
color: #3a84ff;
|
82
|
+
}
|
83
|
+
&.disable[data-v-kk5zgskn] {
|
84
|
+
color: #dcdee5;
|
85
|
+
cursor: not-allowed;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
.clear-icon[data-v-kk5zgskn] {
|
89
|
+
display: none !important;
|
90
|
+
position: absolute;
|
91
|
+
bottom: 42px;
|
92
|
+
right: 28px;
|
93
|
+
height: 14px;
|
94
|
+
z-index: 1501;
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
.input-search {
|
99
|
+
margin: 8px 12px 0;
|
100
|
+
width: calc(100% - 24px);
|
101
|
+
position: relative;
|
102
|
+
border-bottom: 1px solid #eaebf0 !important;
|
103
|
+
&:before {
|
104
|
+
content: '';
|
105
|
+
position: absolute;
|
106
|
+
left: -13px;
|
107
|
+
top: -9px;
|
108
|
+
height: 42px;
|
109
|
+
width: 1px;
|
110
|
+
background-color: #DCDEE5;
|
111
|
+
}
|
112
|
+
&::after {
|
113
|
+
content: '';
|
114
|
+
position: absolute;
|
115
|
+
right: -13px;
|
116
|
+
top: -9px;
|
117
|
+
height: 42px;
|
118
|
+
width: 1px;
|
119
|
+
background-color: #DCDEE5;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
.input-search.is-focused, .input-search:hover {
|
123
|
+
background-color: transparent !important;
|
124
|
+
.bk-input--text {
|
125
|
+
background-color: transparent !important;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
.search-icon {
|
129
|
+
font-size: 18px;
|
130
|
+
color: #979BA5;
|
131
|
+
}
|
132
|
+
.prompt-tips {
|
133
|
+
max-width: 300px;
|
134
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import type { ISessionContent } from '@/types/session';
|
2
|
+
interface IProps {
|
3
|
+
isChatting: boolean;
|
4
|
+
width: number | string;
|
5
|
+
dragPosition?: string;
|
6
|
+
id: number | string;
|
7
|
+
supportTools: boolean;
|
8
|
+
supportImage: boolean;
|
9
|
+
sessionId: string;
|
10
|
+
placeholder?: string;
|
11
|
+
sessionContents?: ISessionContent[];
|
12
|
+
}
|
13
|
+
declare const _default: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
14
|
+
send: (prompt: string) => any;
|
15
|
+
}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{
|
16
|
+
onSend?: ((prompt: string) => any) | undefined;
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
18
|
+
export default _default;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
2
|
+
import { unref as _unref, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
3
|
+
import { useMouseDrag } from '../../hooks/use-mouse-drag.js';
|
4
|
+
export default /*@__PURE__*/ _defineComponent({
|
5
|
+
props: {
|
6
|
+
defaultHeight: {},
|
7
|
+
textHeight: {},
|
8
|
+
position: {}
|
9
|
+
},
|
10
|
+
emits: [
|
11
|
+
"update:defaultHeight",
|
12
|
+
"update:textHeight"
|
13
|
+
],
|
14
|
+
setup (__props, { emit: __emit }) {
|
15
|
+
const props = __props;
|
16
|
+
const emits = __emit;
|
17
|
+
const handleMouseDrag = (positionInfo)=>{
|
18
|
+
let defaultHeight = props.position === 'bottom' ? props.defaultHeight + positionInfo.singleMoveDistance.y : props.defaultHeight - positionInfo.singleMoveDistance.y;
|
19
|
+
if (defaultHeight >= 400) {
|
20
|
+
defaultHeight = 400;
|
21
|
+
}
|
22
|
+
if (defaultHeight <= 84) {
|
23
|
+
defaultHeight = 84;
|
24
|
+
}
|
25
|
+
emits('update:defaultHeight', defaultHeight);
|
26
|
+
emits('update:textHeight', defaultHeight);
|
27
|
+
};
|
28
|
+
const { isDragging } = useMouseDrag([
|
29
|
+
'send-tool-container',
|
30
|
+
'bkaidev-gengduo'
|
31
|
+
], handleMouseDrag);
|
32
|
+
return (_ctx, _cache)=>{
|
33
|
+
return _ctx.position === 'bottom' ? (_openBlock(), _createElementBlock("span", {
|
34
|
+
key: 0,
|
35
|
+
class: _normalizeClass([
|
36
|
+
'send-tool-container',
|
37
|
+
'bottom',
|
38
|
+
{
|
39
|
+
'is-dragging': _unref(isDragging)
|
40
|
+
}
|
41
|
+
])
|
42
|
+
}, _cache[0] || (_cache[0] = [
|
43
|
+
_createElementVNode("i", {
|
44
|
+
class: "bkaidev-icon bkaidev-gengduo"
|
45
|
+
}, null, -1 /* HOISTED */ )
|
46
|
+
]), 2 /* CLASS */ )) : (_openBlock(), _createElementBlock("span", {
|
47
|
+
key: 1,
|
48
|
+
class: _normalizeClass([
|
49
|
+
'send-tool-container',
|
50
|
+
{
|
51
|
+
'is-dragging': _unref(isDragging)
|
52
|
+
}
|
53
|
+
])
|
54
|
+
}, _cache[1] || (_cache[1] = [
|
55
|
+
_createElementVNode("i", {
|
56
|
+
class: "bkaidev-icon bkaidev-gengduo"
|
57
|
+
}, null, -1 /* HOISTED */ )
|
58
|
+
]), 2 /* CLASS */ ));
|
59
|
+
};
|
60
|
+
}
|
61
|
+
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
.send-tool-container {
|
3
|
+
&[data-v-e2ejujm6] {
|
4
|
+
position: absolute;
|
5
|
+
left: 50%;
|
6
|
+
top: 16px;
|
7
|
+
transform: translateX(-50%);
|
8
|
+
height: 1.5px;
|
9
|
+
width: 100%;
|
10
|
+
display: flex;
|
11
|
+
justify-content: center;
|
12
|
+
font-size: 14px;
|
13
|
+
cursor: row-resize;
|
14
|
+
z-index: 15001;
|
15
|
+
}
|
16
|
+
&.bottom {
|
17
|
+
&[data-v-e2ejujm6] {
|
18
|
+
bottom: 0;
|
19
|
+
top: auto;
|
20
|
+
}
|
21
|
+
.bkaidev-gengduo[data-v-e2ejujm6] {
|
22
|
+
margin-top: -10px;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
&[data-v-e2ejujm6]:hover, &.is-dragging[data-v-e2ejujm6] {
|
26
|
+
background: #3A84FF;
|
27
|
+
}
|
28
|
+
.bkaidev-gengduo[data-v-e2ejujm6] {
|
29
|
+
margin-top: -2px;
|
30
|
+
color: #63656E;
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
interface IProps {
|
2
|
+
defaultHeight: number;
|
3
|
+
textHeight: number;
|
4
|
+
position?: string;
|
5
|
+
}
|
6
|
+
declare const _default: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
7
|
+
"update:defaultHeight": (defaultHeight: number) => any;
|
8
|
+
"update:textHeight": (textHeight: number) => any;
|
9
|
+
}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{
|
10
|
+
"onUpdate:defaultHeight"?: ((defaultHeight: number) => any) | undefined;
|
11
|
+
"onUpdate:textHeight"?: ((textHeight: number) => any) | undefined;
|
12
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
13
|
+
export default _default;
|
@@ -0,0 +1,197 @@
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
2
|
+
import { openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
3
|
+
import Quill from '../../../dist/node_modules/quill/dist/quill.js';
|
4
|
+
import Delta from '../../../dist/node_modules/quill-delta/lib/delta.js';
|
5
|
+
import { getCurrentInstance, onMounted, watch } from 'vue';
|
6
|
+
import '../../../dist/node_modules/quill/dist/quill.snow.css';
|
7
|
+
export default /*@__PURE__*/ _defineComponent({
|
8
|
+
props: {
|
9
|
+
placeholder: {},
|
10
|
+
value: {},
|
11
|
+
sessionId: {},
|
12
|
+
supportImage: {
|
13
|
+
type: Boolean
|
14
|
+
},
|
15
|
+
isUploadingImage: {
|
16
|
+
type: Boolean
|
17
|
+
}
|
18
|
+
},
|
19
|
+
emits: [
|
20
|
+
"change",
|
21
|
+
"update:isUploadingImage"
|
22
|
+
],
|
23
|
+
setup (__props, { expose: __expose, emit: __emit }) {
|
24
|
+
const props = __props;
|
25
|
+
const emits = __emit;
|
26
|
+
const vm = getCurrentInstance();
|
27
|
+
let quill;
|
28
|
+
const allowedImageType = [
|
29
|
+
'image/jpeg',
|
30
|
+
'image/gif',
|
31
|
+
'image/png',
|
32
|
+
'image/webp',
|
33
|
+
'image/bmp',
|
34
|
+
'image/svg+xml',
|
35
|
+
'image/apng',
|
36
|
+
'image/avif'
|
37
|
+
];
|
38
|
+
// 更新 placeholder
|
39
|
+
const updatePlaceholder = ()=>{
|
40
|
+
var _vm_proxy;
|
41
|
+
const el = vm === null || vm === void 0 ? void 0 : (_vm_proxy = vm.proxy) === null || _vm_proxy === void 0 ? void 0 : _vm_proxy.$el.querySelector('.ql-editor');
|
42
|
+
el.dataset.placeholder = props.placeholder;
|
43
|
+
};
|
44
|
+
// 值变化事件
|
45
|
+
const handleChange = ()=>{
|
46
|
+
let value = '';
|
47
|
+
const { ops } = quill.getContents();
|
48
|
+
ops === null || ops === void 0 ? void 0 : ops.forEach((op, index)=>{
|
49
|
+
var _op_insert;
|
50
|
+
if (typeof (op === null || op === void 0 ? void 0 : op.insert) === 'object' && (op === null || op === void 0 ? void 0 : (_op_insert = op.insert) === null || _op_insert === void 0 ? void 0 : _op_insert.image)) {
|
51
|
+
value += ``;
|
52
|
+
}
|
53
|
+
if (typeof (op === null || op === void 0 ? void 0 : op.insert) === 'string') {
|
54
|
+
// 去掉最后一行的换行符
|
55
|
+
value += index === ops.length - 1 ? op.insert.replace(/\n$/, '') : op.insert;
|
56
|
+
}
|
57
|
+
});
|
58
|
+
// 触发值更新
|
59
|
+
emits('change', value);
|
60
|
+
};
|
61
|
+
// 覆盖粘贴事件,只复制纯文本
|
62
|
+
const handlePaste = (event)=>{
|
63
|
+
event.preventDefault();
|
64
|
+
// 聚焦
|
65
|
+
focus();
|
66
|
+
// 获取当前状态
|
67
|
+
const range = getSelection();
|
68
|
+
if (range) {
|
69
|
+
var _event_clipboardData;
|
70
|
+
const delta = new Delta().retain(range.index);
|
71
|
+
// 获取粘贴板的数据
|
72
|
+
const copyText = (_event_clipboardData = event.clipboardData) === null || _event_clipboardData === void 0 ? void 0 : _event_clipboardData.getData('text');
|
73
|
+
setTimeout(()=>{
|
74
|
+
var _copyText_replaceAll;
|
75
|
+
// 更新内容
|
76
|
+
const copyDelta = new Delta([
|
77
|
+
{
|
78
|
+
insert: copyText
|
79
|
+
}
|
80
|
+
]);
|
81
|
+
const finalDelta = delta.concat(copyDelta).delete(range.length);
|
82
|
+
quill.updateContents(finalDelta, 'user');
|
83
|
+
// 设置光标位置
|
84
|
+
setSelection(range.index + ((copyText === null || copyText === void 0 ? void 0 : (_copyText_replaceAll = copyText.replaceAll('\r', '')) === null || _copyText_replaceAll === void 0 ? void 0 : _copyText_replaceAll.length) || 0), 0, 'silent');
|
85
|
+
}, 1);
|
86
|
+
}
|
87
|
+
};
|
88
|
+
// 复制选中html元素的内容
|
89
|
+
const handleCopySelection = (event)=>{
|
90
|
+
event.preventDefault();
|
91
|
+
// 获取选中内容的范围
|
92
|
+
const selection = window.getSelection();
|
93
|
+
if (selection) {
|
94
|
+
var // 覆盖原生的复制 or 剪切数据
|
95
|
+
_event_clipboardData;
|
96
|
+
const range = selection.getRangeAt(0);
|
97
|
+
const selectedHTML = range.cloneContents();
|
98
|
+
// 循环拼接复制的文本
|
99
|
+
const copyTexts = [];
|
100
|
+
Array.from(selectedHTML.childNodes).forEach((node)=>{
|
101
|
+
var _node_childNodes;
|
102
|
+
const childNode = (_node_childNodes = node.childNodes) === null || _node_childNodes === void 0 ? void 0 : _node_childNodes[0];
|
103
|
+
if (childNode instanceof HTMLImageElement) {
|
104
|
+
// 图片
|
105
|
+
copyTexts.push(``);
|
106
|
+
} else if (childNode) {
|
107
|
+
// 完整行
|
108
|
+
copyTexts.push(childNode.textContent || '');
|
109
|
+
} else if (node.textContent) {
|
110
|
+
// 部分行
|
111
|
+
copyTexts.push(node.textContent || '');
|
112
|
+
}
|
113
|
+
});
|
114
|
+
(_event_clipboardData = event.clipboardData) === null || _event_clipboardData === void 0 ? void 0 : _event_clipboardData.setData('text/plain', copyTexts.join('\n'));
|
115
|
+
}
|
116
|
+
};
|
117
|
+
// 删除选中内容
|
118
|
+
const handleDeleteSelection = ()=>{
|
119
|
+
const range = quill.getSelection();
|
120
|
+
if (range) {
|
121
|
+
quill.deleteText(range.index, range.length);
|
122
|
+
}
|
123
|
+
};
|
124
|
+
// 覆盖复制事件
|
125
|
+
const handleCopy = (event)=>{
|
126
|
+
handleCopySelection(event);
|
127
|
+
};
|
128
|
+
// 覆盖剪切事件
|
129
|
+
const handleCut = (event)=>{
|
130
|
+
handleCopySelection(event);
|
131
|
+
handleDeleteSelection();
|
132
|
+
};
|
133
|
+
const handleInit = ()=>{
|
134
|
+
var _vm_proxy;
|
135
|
+
// 初始化
|
136
|
+
quill = new Quill(vm === null || vm === void 0 ? void 0 : (_vm_proxy = vm.proxy) === null || _vm_proxy === void 0 ? void 0 : _vm_proxy.$el, {
|
137
|
+
modules: {
|
138
|
+
toolbar: false
|
139
|
+
},
|
140
|
+
placeholder: props.placeholder,
|
141
|
+
theme: 'snow'
|
142
|
+
});
|
143
|
+
// listen change
|
144
|
+
quill.on('text-change', handleChange);
|
145
|
+
// listen paste
|
146
|
+
quill.root.addEventListener('paste', handlePaste);
|
147
|
+
// listen copy
|
148
|
+
quill.root.addEventListener('copy', handleCopy);
|
149
|
+
// listen cut
|
150
|
+
quill.root.addEventListener('cut', handleCut);
|
151
|
+
// set value & selection
|
152
|
+
if (props.value) {
|
153
|
+
setText(props.value);
|
154
|
+
setSelection(props.value.length);
|
155
|
+
}
|
156
|
+
// focus
|
157
|
+
quill.focus();
|
158
|
+
};
|
159
|
+
/**
|
160
|
+
* api 驱动设置,否则容易破坏图片的显示
|
161
|
+
* @param text 文本
|
162
|
+
*/ const setText = (text)=>{
|
163
|
+
quill.setText(text);
|
164
|
+
};
|
165
|
+
// 聚焦
|
166
|
+
const focus = ()=>{
|
167
|
+
quill.focus();
|
168
|
+
};
|
169
|
+
// 删除
|
170
|
+
const deleteText = (index, length)=>{
|
171
|
+
quill.deleteText(index, length);
|
172
|
+
};
|
173
|
+
// 新增
|
174
|
+
const insertText = (index, text)=>{
|
175
|
+
quill.insertText(index, text);
|
176
|
+
};
|
177
|
+
// 获取当前光标位置
|
178
|
+
const getSelection = ()=>quill.getSelection();
|
179
|
+
// 设置光标位置
|
180
|
+
const setSelection = (index, length = 0, source)=>{
|
181
|
+
quill.setSelection(index, length, source);
|
182
|
+
};
|
183
|
+
watch(()=>props.placeholder, updatePlaceholder);
|
184
|
+
onMounted(handleInit);
|
185
|
+
__expose({
|
186
|
+
focus,
|
187
|
+
setText,
|
188
|
+
deleteText,
|
189
|
+
insertText,
|
190
|
+
getSelection,
|
191
|
+
setSelection
|
192
|
+
});
|
193
|
+
return (_ctx, _cache)=>{
|
194
|
+
return _openBlock(), _createElementBlock("section");
|
195
|
+
};
|
196
|
+
}
|
197
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
.ql-editor {
|
3
|
+
overflow-y: auto;
|
4
|
+
font-family: -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
|
5
|
+
img {
|
6
|
+
max-width: 250px !important;
|
7
|
+
max-height: 250px !important;
|
8
|
+
}
|
9
|
+
&::-webkit-scrollbar {
|
10
|
+
width: 6px;
|
11
|
+
height: 6px;
|
12
|
+
}
|
13
|
+
&::-webkit-scrollbar-thumb {
|
14
|
+
width: 6px;
|
15
|
+
height: 6px;
|
16
|
+
border-radius: 3px;
|
17
|
+
background-color: #dcdee5;
|
18
|
+
&:hover {
|
19
|
+
background-color: #979ba5;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
&::before {
|
23
|
+
line-height: 16px;
|
24
|
+
color: #DCDEE5 !important;
|
25
|
+
font-style: normal !important;
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { RangeStatic } from 'quill';
|
2
|
+
import 'quill/dist/quill.snow.css';
|
3
|
+
interface IProps {
|
4
|
+
placeholder: string;
|
5
|
+
value?: string;
|
6
|
+
sessionId: string;
|
7
|
+
supportImage: boolean;
|
8
|
+
isUploadingImage: boolean;
|
9
|
+
}
|
10
|
+
declare const _default: import("vue").DefineComponent<IProps, {
|
11
|
+
focus: () => void;
|
12
|
+
setText: (text: string) => void;
|
13
|
+
deleteText: (index: number, length: number) => void;
|
14
|
+
insertText: (index: number, text: string) => void;
|
15
|
+
getSelection: () => RangeStatic | null;
|
16
|
+
setSelection: (index: number, length?: number) => void;
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
18
|
+
change: (value: string) => any;
|
19
|
+
"update:isUploadingImage": (value: boolean) => any;
|
20
|
+
}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{
|
21
|
+
onChange?: ((value: string) => any) | undefined;
|
22
|
+
"onUpdate:isUploadingImage"?: ((value: boolean) => any) | undefined;
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
24
|
+
export default _default;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
2
|
+
import { normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, unref as _unref, createElementVNode as _createElementVNode, Fragment as _Fragment } from "vue";
|
3
|
+
import { KnowledgePathType } from '../../types/enum.js';
|
4
|
+
export default /*@__PURE__*/ _defineComponent({
|
5
|
+
props: {
|
6
|
+
data: {},
|
7
|
+
size: {
|
8
|
+
default: '12'
|
9
|
+
}
|
10
|
+
},
|
11
|
+
setup (__props) {
|
12
|
+
// import FileTypeIcon from '@/components/file-type-icon.vue';
|
13
|
+
return (_ctx, _cache)=>{
|
14
|
+
var _ctx_data, _ctx_data1;
|
15
|
+
return !((_ctx_data = _ctx.data) === null || _ctx_data === void 0 ? void 0 : _ctx_data.id) ? (_openBlock(), _createElementBlock("i", {
|
16
|
+
key: 0,
|
17
|
+
style: _normalizeStyle({
|
18
|
+
fontSize: `${_ctx.size}px`
|
19
|
+
}),
|
20
|
+
class: "bkaidev-icon bkaidev-zonghe2"
|
21
|
+
}, null, 4 /* STYLE */ )) : ((_ctx_data1 = _ctx.data) === null || _ctx_data1 === void 0 ? void 0 : _ctx_data1.pathType) === _unref(KnowledgePathType).Folder ? (_openBlock(), _createElementBlock("i", {
|
22
|
+
key: 1,
|
23
|
+
style: _normalizeStyle({
|
24
|
+
fontSize: `${_ctx.size}px`
|
25
|
+
}),
|
26
|
+
class: "bkaidev-icon bkaidev-folder-fill"
|
27
|
+
}, null, 4 /* STYLE */ )) : (_openBlock(), _createElementBlock(_Fragment, {
|
28
|
+
key: 2
|
29
|
+
}, [
|
30
|
+
_createCommentVNode(" <file-type-icon\n v-else-if=\"data.pathType === KnowledgePathType.File\"\n :type=\"data.fileType\"\n :style=\"{\n fontSize: `${size}px`\n }\"\n /> "),
|
31
|
+
_createElementVNode("i", {
|
32
|
+
class: "bkaidev-icon bkaidev-zhishikufenlei",
|
33
|
+
style: _normalizeStyle({
|
34
|
+
fontSize: `${_ctx.size}px`
|
35
|
+
})
|
36
|
+
}, null, 4 /* STYLE */ )
|
37
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */ ));
|
38
|
+
};
|
39
|
+
}
|
40
|
+
});
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { KnowledgePathType } from '@/types/enum';
|
2
|
+
interface IData {
|
3
|
+
id?: number;
|
4
|
+
pathType?: KnowledgePathType;
|
5
|
+
fileType?: string;
|
6
|
+
}
|
7
|
+
interface IProps {
|
8
|
+
data?: IData;
|
9
|
+
size?: string;
|
10
|
+
}
|
11
|
+
declare const _default: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{}>, {
|
12
|
+
size: string;
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
14
|
+
export default _default;
|