@kg-ui/kg-ui-plus 0.2.1 → 0.2.3

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 (87) hide show
  1. package/README.md +3 -3
  2. package/dist/es/home/LFilter/FilterArea.vue.mjs +1 -1
  3. package/dist/es/home/LFilter/FilterArea.vue2.mjs +1 -1
  4. package/dist/es/home/LFilter/FilterArea.vue3.mjs +2 -2
  5. package/dist/es/home/LFilter/FilterItem.vue.mjs +1 -1
  6. package/dist/es/home/LFilter/FilterItem.vue2.mjs +1 -1
  7. package/dist/es/home/LFilter/FilterItem.vue3.mjs +2 -2
  8. package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +1 -1
  9. package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +1 -1
  10. package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +2 -2
  11. package/dist/es/home/LProject/index.vue.mjs +1 -1
  12. package/dist/es/home/LProject/index.vue3.mjs +2 -2
  13. package/dist/es/home/index.vue.mjs +1 -1
  14. package/dist/es/home/index.vue3.mjs +2 -2
  15. package/dist/es/kgCopilot/copilotCanvas/InitWrap.vue.mjs +1 -1
  16. package/dist/es/kgCopilot/copilotCanvas/InitWrap.vue2.mjs +1 -1
  17. package/dist/es/kgCopilot/copilotCanvas/InitWrap.vue3.mjs +2 -2
  18. package/dist/es/kgCopilot/copilotCanvas/codeViewer/CodeTypewriter.vue.mjs +154 -0
  19. package/dist/es/kgCopilot/copilotCanvas/codeViewer/CodeTypewriter.vue2.mjs +4 -0
  20. package/dist/es/kgCopilot/copilotCanvas/codeViewer/index.vue.mjs +27 -0
  21. package/dist/es/kgCopilot/copilotCanvas/codeViewer/index.vue2.mjs +4 -0
  22. package/dist/es/kgCopilot/copilotCanvas/docViewer/index.vue.mjs +2 -2
  23. package/dist/es/kgCopilot/copilotCanvas/docViewer/index.vue3.mjs +2 -2
  24. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsAi/AiBar.vue.mjs +1 -1
  25. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsAi/AiBar.vue2.mjs +1 -1
  26. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsAi/AiBar.vue3.mjs +2 -2
  27. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsAi/AiInput.vue.mjs +1 -1
  28. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsAi/AiInput.vue2.mjs +1 -1
  29. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsAi/AiInput.vue3.mjs +2 -2
  30. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsAi/index.vue.mjs +11 -6
  31. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsPanel.vue.mjs +1 -1
  32. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsPanel.vue2.mjs +1 -1
  33. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsPanel.vue3.mjs +2 -2
  34. package/dist/es/kgCopilot/copilotCanvas/index.vue.mjs +1 -1
  35. package/dist/es/kgCopilot/copilotCanvas/index.vue2.mjs +46 -6
  36. package/dist/es/kgCopilot/copilotCanvas/index.vue3.mjs +2 -2
  37. package/dist/es/kgCopilot/copilotDialog/CopiContent/AnswerHead.vue.mjs +1 -1
  38. package/dist/es/kgCopilot/copilotDialog/CopiContent/AnswerHead.vue2.mjs +1 -1
  39. package/dist/es/kgCopilot/copilotDialog/CopiContent/AnswerHead.vue3.mjs +2 -2
  40. package/dist/es/kgCopilot/copilotDialog/CopiContent/SuggestMessage.vue.mjs +1 -1
  41. package/dist/es/kgCopilot/copilotDialog/CopiContent/SuggestMessage.vue3.mjs +2 -2
  42. package/dist/es/kgCopilot/copilotDialog/CopiContent/UserHead.vue.mjs +2 -2
  43. package/dist/es/kgCopilot/copilotDialog/CopiContent/UserHead.vue2.mjs +2 -2
  44. package/dist/es/kgCopilot/copilotDialog/CopiContent/index.vue.mjs +1 -1
  45. package/dist/es/kgCopilot/copilotDialog/CopiContent/index.vue2.mjs +1 -1
  46. package/dist/es/kgCopilot/copilotDialog/CopiContent/index.vue3.mjs +2 -2
  47. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/codeBox.vue.mjs +102 -0
  48. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/codeBox.vue2.mjs +4 -0
  49. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/edit.vue.mjs +1 -1
  50. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/edit.vue3.mjs +2 -2
  51. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/fileBox.vue.mjs +1 -1
  52. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/fileBox.vue2.mjs +2 -2
  53. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/index.vue.mjs +1 -1
  54. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/index.vue2.mjs +47 -5
  55. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/index.vue3.mjs +2 -2
  56. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/readMd.vue.mjs +1 -1
  57. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/readMd.vue2.mjs +1 -1
  58. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/readMd.vue3.mjs +2 -2
  59. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/readStreamMd.vue.mjs +7 -0
  60. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/readStreamMd.vue2.mjs +114 -0
  61. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/readStreamMd.vue3.mjs +4 -0
  62. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/reportBox.vue.mjs +128 -0
  63. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/reportBox.vue2.mjs +4 -0
  64. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/InputFootTool.vue.mjs +1 -1
  65. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/InputFootTool.vue3.mjs +2 -2
  66. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/NewTheme.vue.mjs +1 -1
  67. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/NewTheme.vue2.mjs +1 -1
  68. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/NewTheme.vue3.mjs +2 -2
  69. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/SelectPluginByKey.vue.mjs +1 -1
  70. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/SelectPluginByKey.vue3.mjs +2 -2
  71. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/index.vue.mjs +1 -1
  72. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/index.vue2.mjs +1 -1
  73. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/index.vue3.mjs +2 -2
  74. package/dist/es/kgCopilot/copilotDialog/CopiFooter/index.vue.mjs +1 -1
  75. package/dist/es/kgCopilot/copilotDialog/CopiFooter/index.vue3.mjs +2 -2
  76. package/dist/es/kgCopilot/copilotHistory/index.vue.mjs +1 -1
  77. package/dist/es/kgCopilot/copilotHistory/index.vue2.mjs +1 -1
  78. package/dist/es/kgCopilot/copilotHistory/index.vue3.mjs +2 -2
  79. package/dist/es/kgCopilot/index.vue.mjs +1 -1
  80. package/dist/es/kgCopilot/index.vue3.mjs +2 -2
  81. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/loading.mjs +8 -0
  82. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/code-s-slash-fill.mjs +8 -0
  83. package/dist/es/node_modules/.pnpm/{dompurify@3.2.3 → dompurify@3.2.6}/node_modules/dompurify/dist/purify.es.mjs +36 -22
  84. package/dist/es/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/styles/github.css.mjs +4 -0
  85. package/dist/es/store/modules/copilot.mjs +128 -19
  86. package/dist/es/style.css +11 -1
  87. package/package.json +124 -124
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # 星光探索-组件库
2
-
3
- ## 基于vue3 elemet-plus封装的组件库
1
+ # 星光探索-组件库
2
+
3
+ ## 基于vue3 elemet-plus封装的组件库
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./FilterArea.vue2.mjs";
2
2
  import "./FilterArea.vue3.mjs";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const FilterArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-996410e5"]]);
4
+ const FilterArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4e04c24d"]]);
5
5
  export {
6
6
  FilterArea as default
7
7
  };
@@ -9,7 +9,7 @@ import data$2 from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_module
9
9
  import { checkFilterShow_xinyuan, checkFilterShow, checkFilterShow_letter } from "../../utils/home.mjs";
10
10
  import FilterItem from "./FilterItem.vue.mjs";
11
11
  import FilterItemIcon from "./FilterItemIcon.vue.mjs";
12
- const _withScopeId = (n) => (pushScopeId("data-v-996410e5"), n = n(), popScopeId(), n);
12
+ const _withScopeId = (n) => (pushScopeId("data-v-4e04c24d"), n = n(), popScopeId(), n);
13
13
  const _hoisted_1 = { id: "filterWrap" };
14
14
  const _hoisted_2 = { key: 0 };
15
15
  const _hoisted_3 = { class: "flex flex-1 align-middle justify-items-start flex-wrap" };
@@ -1,4 +1,4 @@
1
- const FilterArea_vue_vue_type_style_index_0_scoped_996410e5_lang = "";
1
+ const FilterArea_vue_vue_type_style_index_0_scoped_4e04c24d_lang = "";
2
2
  export {
3
- FilterArea_vue_vue_type_style_index_0_scoped_996410e5_lang as default
3
+ FilterArea_vue_vue_type_style_index_0_scoped_4e04c24d_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./FilterItem.vue2.mjs";
2
2
  import "./FilterItem.vue3.mjs";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const FilterItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-10722fd5"]]);
4
+ const FilterItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-be1d5ffc"]]);
5
5
  export {
6
6
  FilterItem as default
7
7
  };
@@ -4,7 +4,7 @@ import { useFilterStoreHook } from "../../store/modules/filters.mjs";
4
4
  import { EnumFilterKind } from "../../store/modules/types.mjs";
5
5
  import data from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs";
6
6
  import { getFilterRemark } from "../../utils/home.mjs";
7
- const _withScopeId = (n) => (pushScopeId("data-v-10722fd5"), n = n(), popScopeId(), n);
7
+ const _withScopeId = (n) => (pushScopeId("data-v-be1d5ffc"), n = n(), popScopeId(), n);
8
8
  const _hoisted_1 = { class: "p-2" };
9
9
  const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("line", null, null, -1));
10
10
  const _hoisted_3 = ["innerHTML"];
@@ -1,4 +1,4 @@
1
- const FilterItem_vue_vue_type_style_index_0_scoped_10722fd5_lang = "";
1
+ const FilterItem_vue_vue_type_style_index_0_scoped_be1d5ffc_lang = "";
2
2
  export {
3
- FilterItem_vue_vue_type_style_index_0_scoped_10722fd5_lang as default
3
+ FilterItem_vue_vue_type_style_index_0_scoped_be1d5ffc_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./FilterItemIcon.vue2.mjs";
2
2
  import "./FilterItemIcon.vue3.mjs";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const FilterItemIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a70be454"]]);
4
+ const FilterItemIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c55b8933"]]);
5
5
  export {
6
6
  FilterItemIcon as default
7
7
  };
@@ -4,7 +4,7 @@ import { useFilterStoreHook } from "../../store/modules/filters.mjs";
4
4
  import data from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs";
5
5
  import data$1 from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/check-fill.mjs";
6
6
  import { getFilterRemark } from "../../utils/home.mjs";
7
- const _withScopeId = (n) => (pushScopeId("data-v-a70be454"), n = n(), popScopeId(), n);
7
+ const _withScopeId = (n) => (pushScopeId("data-v-c55b8933"), n = n(), popScopeId(), n);
8
8
  const _hoisted_1 = {
9
9
  key: 0,
10
10
  class: "flex items-end"
@@ -1,4 +1,4 @@
1
- const FilterItemIcon_vue_vue_type_style_index_0_scoped_a70be454_lang = "";
1
+ const FilterItemIcon_vue_vue_type_style_index_0_scoped_c55b8933_lang = "";
2
2
  export {
3
- FilterItemIcon_vue_vue_type_style_index_0_scoped_a70be454_lang as default
3
+ FilterItemIcon_vue_vue_type_style_index_0_scoped_c55b8933_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./index.vue2.mjs";
2
2
  import "./index.vue3.mjs";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const LProject = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-75d82a2e"]]);
4
+ const LProject = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7a0e9ea7"]]);
5
5
  export {
6
6
  LProject as default
7
7
  };
@@ -1,4 +1,4 @@
1
- const index_vue_vue_type_style_index_0_scoped_75d82a2e_lang = "";
1
+ const index_vue_vue_type_style_index_0_scoped_7a0e9ea7_lang = "";
2
2
  export {
3
- index_vue_vue_type_style_index_0_scoped_75d82a2e_lang as default
3
+ index_vue_vue_type_style_index_0_scoped_7a0e9ea7_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./index.vue2.mjs";
2
2
  import "./index.vue3.mjs";
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.mjs";
4
- const Home = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ca075550"]]);
4
+ const Home = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c86d30a0"]]);
5
5
  export {
6
6
  Home as default
7
7
  };
@@ -1,4 +1,4 @@
1
- const index_vue_vue_type_style_index_0_scoped_ca075550_lang = "";
1
+ const index_vue_vue_type_style_index_0_scoped_c86d30a0_lang = "";
2
2
  export {
3
- index_vue_vue_type_style_index_0_scoped_ca075550_lang as default
3
+ index_vue_vue_type_style_index_0_scoped_c86d30a0_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./InitWrap.vue2.mjs";
2
2
  import "./InitWrap.vue3.mjs";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const InitWrap = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-97fef6d8"]]);
4
+ const InitWrap = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c5041311"]]);
5
5
  export {
6
6
  InitWrap as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, pushScopeId, popScopeId } from "vue";
2
2
  import _imports_0 from "../../assets/empty.png.mjs";
3
3
  import data from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/folder-opened.mjs";
4
- const _withScopeId = (n) => (pushScopeId("data-v-97fef6d8"), n = n(), popScopeId(), n);
4
+ const _withScopeId = (n) => (pushScopeId("data-v-c5041311"), n = n(), popScopeId(), n);
5
5
  const _hoisted_1 = { class: "flex flex-col justify-center flex-wrap items-center" };
6
6
  const _hoisted_2 = { class: "flex justify-center items-center folder" };
7
7
  const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("h2", null, "文件预览", -1));
@@ -1,4 +1,4 @@
1
- const InitWrap_vue_vue_type_style_index_0_scoped_97fef6d8_lang = "";
1
+ const InitWrap_vue_vue_type_style_index_0_scoped_c5041311_lang = "";
2
2
  export {
3
- InitWrap_vue_vue_type_style_index_0_scoped_97fef6d8_lang as default
3
+ InitWrap_vue_vue_type_style_index_0_scoped_c5041311_lang as default
4
4
  };
@@ -0,0 +1,154 @@
1
+ import { defineComponent, ref, watch, nextTick, onBeforeUnmount, openBlock, createElementBlock, createTextVNode, Fragment, renderList, createElementVNode, toDisplayString } from "vue";
2
+ import HighlightJS from "../../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.mjs";
3
+ import javascript from "../../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.mjs";
4
+ import typescript from "../../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.mjs";
5
+ import python from "../../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.mjs";
6
+ import css from "../../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.mjs";
7
+ import xml from "../../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.mjs";
8
+ import go from "../../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.mjs";
9
+ import java from "../../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.mjs";
10
+ import "../../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/styles/github.css.mjs";
11
+ const _hoisted_1 = { class: "text-sm font-mono p-4 m-0 whitespace-pre-wrap break-words" };
12
+ const _hoisted_2 = { class: "w-8 text-right select-none pr-4 text-gray-400" };
13
+ const _hoisted_3 = ["innerHTML"];
14
+ const _sfc_main = /* @__PURE__ */ defineComponent({
15
+ __name: "CodeTypewriter",
16
+ props: {
17
+ code: null,
18
+ language: null,
19
+ speed: null,
20
+ isPrint: { type: Boolean }
21
+ },
22
+ emits: ["done"],
23
+ setup(__props, { emit: emits }) {
24
+ const props = __props;
25
+ HighlightJS.registerLanguage("javascript", javascript);
26
+ HighlightJS.registerLanguage("typescript", typescript);
27
+ HighlightJS.registerLanguage("python", python);
28
+ HighlightJS.registerLanguage("css", css);
29
+ HighlightJS.registerLanguage("html", xml);
30
+ HighlightJS.registerLanguage("go", go);
31
+ HighlightJS.registerLanguage("java", java);
32
+ const speed = props.speed ?? 30;
33
+ const visibleLines = ref([]);
34
+ const printedLineCount = ref(0);
35
+ let fullTextLines = [];
36
+ let highlightedLines = [];
37
+ let lineIndex = 0;
38
+ let charIndex = 0;
39
+ let timerId;
40
+ function sliceByTextCount(htmlStr, count) {
41
+ const parser = new DOMParser();
42
+ const doc = parser.parseFromString(`<div>${htmlStr}</div>`, "text/html");
43
+ const root = doc.body.firstChild;
44
+ let currentCount = 0;
45
+ function traverse(node) {
46
+ if (currentCount >= count)
47
+ return null;
48
+ if (node.nodeType === Node.TEXT_NODE) {
49
+ const text = node.textContent || "";
50
+ if (currentCount + text.length > count) {
51
+ const truncated = text.slice(0, count - currentCount);
52
+ currentCount = count;
53
+ return document.createTextNode(truncated);
54
+ } else {
55
+ currentCount += text.length;
56
+ return document.createTextNode(text);
57
+ }
58
+ } else if (node.nodeType === Node.ELEMENT_NODE) {
59
+ const el = node;
60
+ const newEl = document.createElement(el.tagName);
61
+ for (const attr of el.attributes) {
62
+ newEl.setAttribute(attr.name, attr.value);
63
+ }
64
+ for (const child of el.childNodes) {
65
+ const result = traverse(child);
66
+ if (result)
67
+ newEl.appendChild(result);
68
+ if (currentCount >= count)
69
+ break;
70
+ }
71
+ return newEl;
72
+ }
73
+ return null;
74
+ }
75
+ const slicedNode = traverse(root);
76
+ const container = document.createElement("div");
77
+ if (slicedNode)
78
+ container.appendChild(slicedNode);
79
+ return container.innerHTML;
80
+ }
81
+ function startTyping(fromLine) {
82
+ lineIndex = fromLine;
83
+ charIndex = 0;
84
+ const type = () => {
85
+ const htmlLine = highlightedLines[lineIndex];
86
+ const textLine = fullTextLines[lineIndex];
87
+ if (!visibleLines.value[lineIndex])
88
+ visibleLines.value[lineIndex] = "";
89
+ charIndex++;
90
+ visibleLines.value[lineIndex] = sliceByTextCount(htmlLine, charIndex);
91
+ if (charIndex >= textLine.length) {
92
+ printedLineCount.value++;
93
+ lineIndex++;
94
+ charIndex = 0;
95
+ }
96
+ if (lineIndex < highlightedLines.length) {
97
+ timerId = window.setTimeout(type, speed);
98
+ } else {
99
+ emits("done");
100
+ }
101
+ };
102
+ type();
103
+ }
104
+ watch(
105
+ () => props.code,
106
+ async (newCode) => {
107
+ clearTimeout(timerId);
108
+ const lines = newCode.replace(/\r\n/g, "\n").split("\n");
109
+ const highlights = lines.map(
110
+ (line) => line.trim() ? HighlightJS.highlight(line, { language: props.language || "javascript" }).value : "&nbsp;"
111
+ );
112
+ fullTextLines = lines;
113
+ highlightedLines = highlights;
114
+ await nextTick();
115
+ visibleLines.value = [...visibleLines.value];
116
+ for (let i = visibleLines.value.length; i < highlights.length; i++) {
117
+ visibleLines.value[i] = "";
118
+ }
119
+ if (props.isPrint) {
120
+ startTyping(printedLineCount.value);
121
+ } else {
122
+ visibleLines.value = [...highlights];
123
+ printedLineCount.value = highlights.length;
124
+ }
125
+ },
126
+ { immediate: true }
127
+ );
128
+ onBeforeUnmount(() => clearTimeout(timerId));
129
+ return (_ctx, _cache) => {
130
+ return openBlock(), createElementBlock("pre", _hoisted_1, [
131
+ createTextVNode(" "),
132
+ (openBlock(true), createElementBlock(Fragment, null, renderList(visibleLines.value, (line, index) => {
133
+ return openBlock(), createElementBlock("div", {
134
+ key: index,
135
+ class: "flex items-start"
136
+ }, [
137
+ createTextVNode("\n "),
138
+ createElementVNode("span", _hoisted_2, toDisplayString(index + 1), 1),
139
+ createTextVNode("\n "),
140
+ createElementVNode("code", {
141
+ class: "flex-1",
142
+ innerHTML: line
143
+ }, null, 8, _hoisted_3),
144
+ createTextVNode("\n ")
145
+ ]);
146
+ }), 128)),
147
+ createTextVNode("\n ")
148
+ ]);
149
+ };
150
+ }
151
+ });
152
+ export {
153
+ _sfc_main as default
154
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./CodeTypewriter.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,27 @@
1
+ import { defineComponent, openBlock, createBlock } from "vue";
2
+ import _sfc_main$1 from "./CodeTypewriter.vue.mjs";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "index",
5
+ props: {
6
+ code: null,
7
+ needPrint: { type: Boolean }
8
+ },
9
+ emits: ["printOk"],
10
+ setup(__props, { emit: emits }) {
11
+ function onDone() {
12
+ emits("printOk");
13
+ }
14
+ return (_ctx, _cache) => {
15
+ return openBlock(), createBlock(_sfc_main$1, {
16
+ code: __props.code,
17
+ language: "javascript",
18
+ speed: 30,
19
+ isPrint: __props.needPrint,
20
+ onDone
21
+ }, null, 8, ["code", "isPrint"]);
22
+ };
23
+ }
24
+ });
25
+ export {
26
+ _sfc_main as default
27
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./index.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./index.vue2.mjs";
2
2
  import "./index.vue3.mjs";
3
3
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const wpsIndex = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-036d2425"]]);
4
+ const WpsIndex = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-044d1ce3"]]);
5
5
  export {
6
- wpsIndex as default
6
+ WpsIndex as default
7
7
  };
@@ -1,4 +1,4 @@
1
- const index_vue_vue_type_style_index_0_scoped_036d2425_lang = "";
1
+ const index_vue_vue_type_style_index_0_scoped_044d1ce3_lang = "";
2
2
  export {
3
- index_vue_vue_type_style_index_0_scoped_036d2425_lang as default
3
+ index_vue_vue_type_style_index_0_scoped_044d1ce3_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./AiBar.vue2.mjs";
2
2
  import "./AiBar.vue3.mjs";
3
3
  import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const AiBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5ca30f1d"]]);
4
+ const AiBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b054e852"]]);
5
5
  export {
6
6
  AiBar as default
7
7
  };
@@ -2,7 +2,7 @@ import { defineComponent, ref, computed, onMounted, openBlock, createElementBloc
2
2
  import { onClickOutside } from "../../../../../node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.2.45/node_modules/@vueuse/core/index.mjs";
3
3
  import { aiBarBtnType } from "../../../../../store/modules/copilot.mjs";
4
4
  import { message } from "../../../../../utils/message.mjs";
5
- const _withScopeId = (n) => (pushScopeId("data-v-5ca30f1d"), n = n(), popScopeId(), n);
5
+ const _withScopeId = (n) => (pushScopeId("data-v-b054e852"), n = n(), popScopeId(), n);
6
6
  const _hoisted_1 = { class: "ai-bar__buttons flex items-center" };
7
7
  const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "logo mr-2" }, "➤", -1));
8
8
  const _hoisted_3 = { class: "flex gap-2" };
@@ -1,4 +1,4 @@
1
- const AiBar_vue_vue_type_style_index_0_scoped_5ca30f1d_lang = "";
1
+ const AiBar_vue_vue_type_style_index_0_scoped_b054e852_lang = "";
2
2
  export {
3
- AiBar_vue_vue_type_style_index_0_scoped_5ca30f1d_lang as default
3
+ AiBar_vue_vue_type_style_index_0_scoped_b054e852_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./AiInput.vue2.mjs";
2
2
  import "./AiInput.vue3.mjs";
3
3
  import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const AiInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6e3feb38"]]);
4
+ const AiInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-be2025bf"]]);
5
5
  export {
6
6
  AiInput as default
7
7
  };
@@ -3,7 +3,7 @@ import { storeToRefs } from "pinia";
3
3
  import { onClickOutside } from "../../../../../node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.2.45/node_modules/@vueuse/core/index.mjs";
4
4
  import { useCopilotStoreHook, aiBarBtnType, wpsAiOpt } from "../../../../../store/modules/copilot.mjs";
5
5
  import data from "../../../../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/refresh.mjs";
6
- const _withScopeId = (n) => (pushScopeId("data-v-6e3feb38"), n = n(), popScopeId(), n);
6
+ const _withScopeId = (n) => (pushScopeId("data-v-be2025bf"), n = n(), popScopeId(), n);
7
7
  const _hoisted_1 = { class: "textarea overflow-y-auto text-gray-800 text-base border-2 border-blue-500 rounded-xl p-3 mb-2 font-serif select-text" };
8
8
  const _hoisted_2 = { class: "flex justify-between items-center mt-4" };
9
9
  const _hoisted_3 = { class: "flex items-center text-sm text-gray-500 mr-2" };
@@ -1,4 +1,4 @@
1
- const AiInput_vue_vue_type_style_index_0_scoped_6e3feb38_lang = "";
1
+ const AiInput_vue_vue_type_style_index_0_scoped_be2025bf_lang = "";
2
2
  export {
3
- AiInput_vue_vue_type_style_index_0_scoped_6e3feb38_lang as default
3
+ AiInput_vue_vue_type_style_index_0_scoped_be2025bf_lang as default
4
4
  };
@@ -13,7 +13,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  emits: ["opt"],
14
14
  setup(__props, { emit }) {
15
15
  const props = __props;
16
- const aiBarShow = computed(() => props.selectedText.length > 0 && !aiAreaInputShow.value);
16
+ const aiBarShow = computed(
17
+ () => props.selectedText.length > 0 && !aiAreaInputShow.value
18
+ );
17
19
  const aiAreaInputShow = ref(false);
18
20
  const aiAreaInputText = ref("");
19
21
  const aiAreaInputType = ref(aiBarBtnType.rewrite);
@@ -31,12 +33,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
33
  aiAreaInputText.value = "";
32
34
  aiAreaInputShow.value = false;
33
35
  };
34
- watch(() => props.selectedText, (newValue) => {
35
- if (!newValue || newValue.length === 0) {
36
- if (aiAreaInputShow.value)
37
- aiAreaInputShow.value = false;
36
+ watch(
37
+ () => props.selectedText,
38
+ (newValue) => {
39
+ if (!newValue || newValue.length === 0) {
40
+ if (aiAreaInputShow.value)
41
+ aiAreaInputShow.value = false;
42
+ }
38
43
  }
39
- });
44
+ );
40
45
  return (_ctx, _cache) => {
41
46
  return openBlock(), createElementBlock(Fragment, null, [
42
47
  unref(aiBarShow) ? (openBlock(), createBlock(AiBar, {
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./wpsPanel.vue2.mjs";
2
2
  import "./wpsPanel.vue3.mjs";
3
3
  import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const WpsPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-75b8d2bb"]]);
4
+ const WpsPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-60dd4890"]]);
5
5
  export {
6
6
  WpsPanel as default
7
7
  };
@@ -6,7 +6,7 @@ import { useCopilotStoreHook, wpsAiOpt } from "../../../../store/modules/copilot
6
6
  import { downloadByWps } from "../../../../api/copilot.mjs";
7
7
  import { urlDownload } from "../../../../utils/home.mjs";
8
8
  import { useThrottleFn } from "../../../../node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs";
9
- const _withScopeId = (n) => (pushScopeId("data-v-75b8d2bb"), n = n(), popScopeId(), n);
9
+ const _withScopeId = (n) => (pushScopeId("data-v-60dd4890"), n = n(), popScopeId(), n);
10
10
  const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", {
11
11
  id: "office-container",
12
12
  class: ""
@@ -1,4 +1,4 @@
1
- const wpsPanel_vue_vue_type_style_index_0_scoped_75b8d2bb_lang = "";
1
+ const wpsPanel_vue_vue_type_style_index_0_scoped_60dd4890_lang = "";
2
2
  export {
3
- wpsPanel_vue_vue_type_style_index_0_scoped_75b8d2bb_lang as default
3
+ wpsPanel_vue_vue_type_style_index_0_scoped_60dd4890_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./index.vue2.mjs";
2
2
  import "./index.vue3.mjs";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const CopiCanvas = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7b6aac5d"]]);
4
+ const CopiCanvas = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-42ae1e66"]]);
5
5
  export {
6
6
  CopiCanvas as default
7
7
  };
@@ -1,9 +1,10 @@
1
- import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, createVNode, toDisplayString, createCommentVNode, createBlock } from "vue";
1
+ import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, createVNode, toDisplayString, createCommentVNode, createBlock } from "vue";
2
2
  import { storeToRefs } from "pinia";
3
- import data from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/reading.mjs";
4
- import { useCopilotStoreHook } from "../../store/modules/copilot.mjs";
5
- import wpsIndex from "./docViewer/index.vue.mjs";
3
+ import WpsIndex from "./docViewer/index.vue.mjs";
4
+ import _sfc_main$1 from "./codeViewer/index.vue.mjs";
6
5
  import InitWrap from "./InitWrap.vue.mjs";
6
+ import data from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/reading.mjs";
7
+ import { useCopilotStoreHook, DataType } from "../../store/modules/copilot.mjs";
7
8
  import data$1 from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/share-forward-2-fill.mjs";
8
9
  import { getWpsShareCode } from "../../api/copilot.mjs";
9
10
  import { execCommand } from "../../utils/index.mjs";
@@ -27,7 +28,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
28
  },
28
29
  setup(__props) {
29
30
  const CopilotStore = useCopilotStoreHook();
30
- const { canvasVisible, previewFileUrl, successShowFile, fileId } = storeToRefs(CopilotStore);
31
+ const {
32
+ msgList,
33
+ canvasVisible,
34
+ canvasType,
35
+ canvasCodeMsgIndex,
36
+ previewFileUrl,
37
+ successShowFile,
38
+ fileId
39
+ } = storeToRefs(CopilotStore);
31
40
  const { changeCanvasVisible } = CopilotStore;
32
41
  const shareFile = async () => {
33
42
  const res = await getWpsShareCode(fileId.value);
@@ -39,6 +48,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
48
  message("获取分享码失败", { type: "error" });
40
49
  }
41
50
  };
51
+ const curCode = computed(() => {
52
+ let str = "";
53
+ const msgIndex = canvasCodeMsgIndex.value[0];
54
+ const subMsgIndex = canvasCodeMsgIndex.value[1];
55
+ if (msgIndex !== -1) {
56
+ str = msgList.value[msgIndex].msgs[subMsgIndex].content;
57
+ }
58
+ return str;
59
+ });
60
+ const needPrint = computed(() => {
61
+ let isNeed = true;
62
+ const msgIndex = canvasCodeMsgIndex.value[0];
63
+ const subMsgIndex = canvasCodeMsgIndex.value[1];
64
+ if (msgIndex !== -1) {
65
+ isNeed = msgList.value[msgIndex].msgs[subMsgIndex].needPrinting;
66
+ }
67
+ return isNeed;
68
+ });
69
+ const handleCodePrintOk = () => {
70
+ const msgIndex = canvasCodeMsgIndex.value[0];
71
+ const subMsgIndex = canvasCodeMsgIndex.value[1];
72
+ if (msgIndex !== -1) {
73
+ const obj = msgList.value[msgIndex].msgs[subMsgIndex];
74
+ obj.needPrinting = false;
75
+ }
76
+ };
42
77
  return (_ctx, _cache) => {
43
78
  const _component_IconifyIconOffline = resolveComponent("IconifyIconOffline");
44
79
  return openBlock(), createElementBlock("div", {
@@ -64,7 +99,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
64
99
  ])) : createCommentVNode("", true)
65
100
  ]),
66
101
  createElementVNode("div", _hoisted_6, [
67
- unref(previewFileUrl) ? (openBlock(), createBlock(wpsIndex, { key: 0 })) : (openBlock(), createBlock(InitWrap, { key: 1 }))
102
+ unref(canvasType) === unref(DataType).report && unref(previewFileUrl) ? (openBlock(), createBlock(WpsIndex, { key: 0 })) : unref(canvasType) === unref(DataType).report_code ? (openBlock(), createBlock(_sfc_main$1, {
103
+ key: 1,
104
+ code: unref(curCode),
105
+ needPrint: unref(needPrint),
106
+ onPrintOk: handleCodePrintOk
107
+ }, null, 8, ["code", "needPrint"])) : (openBlock(), createBlock(InitWrap, { key: 2 }))
68
108
  ])
69
109
  ])) : createCommentVNode("", true)
70
110
  ])
@@ -1,4 +1,4 @@
1
- const index_vue_vue_type_style_index_0_scoped_7b6aac5d_lang = "";
1
+ const index_vue_vue_type_style_index_0_scoped_42ae1e66_lang = "";
2
2
  export {
3
- index_vue_vue_type_style_index_0_scoped_7b6aac5d_lang as default
3
+ index_vue_vue_type_style_index_0_scoped_42ae1e66_lang as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./AnswerHead.vue2.mjs";
2
2
  import "./AnswerHead.vue3.mjs";
3
3
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const AnswerHead = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b8a8456d"]]);
4
+ const AnswerHead = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8fa8cfc7"]]);
5
5
  export {
6
6
  AnswerHead as default
7
7
  };