@kg-ui/kg-ui-plus 0.1.19 → 0.1.21

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 (63) hide show
  1. package/README.md +3 -3
  2. package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +1 -1
  3. package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +1 -1
  4. package/dist/es/KgCopilot/CopiContent/AnswerHead.vue3.mjs +2 -2
  5. package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +2 -2
  6. package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +2 -2
  7. package/dist/es/KgCopilot/CopiFooter/SearchInput/NewTheme.vue.mjs +1 -1
  8. package/dist/es/KgCopilot/CopiFooter/SearchInput/NewTheme.vue2.mjs +1 -1
  9. package/dist/es/KgCopilot/CopiFooter/SearchInput/NewTheme.vue3.mjs +2 -2
  10. package/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPluginByKey.vue.mjs +1 -1
  11. package/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPluginByKey.vue3.mjs +2 -2
  12. package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue.mjs +1 -1
  13. package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue2.mjs +107 -31
  14. package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue3.mjs +2 -2
  15. package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +1 -1
  16. package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +2 -2
  17. package/dist/es/KgCopilot/dialogue/index.vue.mjs +1 -1
  18. package/dist/es/KgCopilot/dialogue/index.vue2.mjs +3 -2
  19. package/dist/es/KgCopilot/dialogue/index.vue3.mjs +2 -2
  20. package/dist/es/KgCopilot/dialogue/messageParse/edit.vue.mjs +1 -1
  21. package/dist/es/KgCopilot/dialogue/messageParse/edit.vue3.mjs +2 -2
  22. package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue.mjs +1 -1
  23. package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue2.mjs +2 -2
  24. package/dist/es/KgCopilot/dialogue/messageParse/index.vue.mjs +1 -1
  25. package/dist/es/KgCopilot/dialogue/messageParse/index.vue2.mjs +52 -42
  26. package/dist/es/KgCopilot/dialogue/messageParse/index.vue3.mjs +2 -2
  27. package/dist/es/KgCopilot/dialogue/messageParse/readMd.vue.mjs +1 -1
  28. package/dist/es/KgCopilot/dialogue/messageParse/readMd.vue2.mjs +2 -2
  29. package/dist/es/KgCopilot/dialogue/messageParse/readMd.vue3.mjs +2 -2
  30. package/dist/es/KgCopilot/historyRecord/index.vue.mjs +7 -0
  31. package/dist/es/KgCopilot/historyRecord/index.vue2.mjs +142 -0
  32. package/dist/es/KgCopilot/historyRecord/index.vue3.mjs +4 -0
  33. package/dist/es/KgCopilot/index.vue.mjs +1 -1
  34. package/dist/es/KgCopilot/index.vue2.mjs +44 -9
  35. package/dist/es/KgCopilot/index.vue3.mjs +2 -2
  36. package/dist/es/api/copilot.mjs +55 -2
  37. package/dist/es/home/LFilter/FilterArea.vue.mjs +1 -1
  38. package/dist/es/home/LFilter/FilterArea.vue2.mjs +1 -1
  39. package/dist/es/home/LFilter/FilterArea.vue3.mjs +2 -2
  40. package/dist/es/home/LFilter/FilterItem.vue.mjs +1 -1
  41. package/dist/es/home/LFilter/FilterItem.vue2.mjs +1 -1
  42. package/dist/es/home/LFilter/FilterItem.vue3.mjs +2 -2
  43. package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +1 -1
  44. package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +1 -1
  45. package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +2 -2
  46. package/dist/es/home/LProject/index.vue.mjs +1 -1
  47. package/dist/es/home/LProject/index.vue3.mjs +2 -2
  48. package/dist/es/home/index.vue.mjs +1 -1
  49. package/dist/es/home/index.vue3.mjs +2 -2
  50. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/arrow-left.mjs +8 -0
  51. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/arrow-right.mjs +8 -0
  52. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/delete.mjs +8 -0
  53. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/search.mjs +8 -0
  54. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/braces-line.mjs +8 -0
  55. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/close-circle-line.mjs +8 -0
  56. package/dist/es/node_modules/.pnpm/{dompurify@3.0.10 → dompurify@3.1.5}/node_modules/dompurify/dist/purify.es.mjs +48 -11
  57. package/dist/es/node_modules/.pnpm/{marked@12.0.1 → marked@12.0.2}/node_modules/marked/lib/marked.esm.mjs +2 -1
  58. package/dist/es/store/modules/copilot.mjs +158 -5
  59. package/dist/es/style.css +1 -1
  60. package/dist/es/utils/copilot.mjs +25 -0
  61. package/dist/es/utils/home.mjs +1 -0
  62. package/dist/es/utils/http/index.mjs +7 -0
  63. package/package.json +123 -123
@@ -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
  };
@@ -0,0 +1,8 @@
1
+ const data = {
2
+ "width": 1024,
3
+ "height": 1024,
4
+ "body": '<path fill="currentColor" d="M609.408 149.376L277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0a30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688a29.12 29.12 0 0 0-41.728 0z"/>'
5
+ };
6
+ export {
7
+ data as default
8
+ };
@@ -0,0 +1,8 @@
1
+ const data = {
2
+ "width": 1024,
3
+ "height": 1024,
4
+ "body": '<path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512L340.864 831.872a30.592 30.592 0 0 0 0 42.752a29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"/>'
5
+ };
6
+ export {
7
+ data as default
8
+ };
@@ -0,0 +1,8 @@
1
+ const data = {
2
+ "width": 1024,
3
+ "height": 1024,
4
+ "body": '<path fill="currentColor" d="M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z"/>'
5
+ };
6
+ export {
7
+ data as default
8
+ };
@@ -0,0 +1,8 @@
1
+ const data = {
2
+ "width": 1024,
3
+ "height": 1024,
4
+ "body": '<path fill="currentColor" d="m795.904 750.72l124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704a352 352 0 0 0 0 704z"/>'
5
+ };
6
+ export {
7
+ data as default
8
+ };
@@ -0,0 +1,8 @@
1
+ const data = {
2
+ "width": 24,
3
+ "height": 24,
4
+ "body": '<path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3zm16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5z"/>'
5
+ };
6
+ export {
7
+ data as default
8
+ };
@@ -0,0 +1,8 @@
1
+ const data = {
2
+ "width": 24,
3
+ "height": 24,
4
+ "body": '<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm0-9.414l2.828-2.829l1.415 1.415L13.414 12l2.829 2.828l-1.415 1.415L12 13.414l-2.828 2.829l-1.415-1.415L10.586 12L7.757 9.172l1.415-1.415L12 10.586z"/>'
5
+ };
6
+ export {
7
+ data as default
8
+ };
@@ -1,4 +1,4 @@
1
- /*! @license DOMPurify 3.0.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.10/LICENSE */
1
+ /*! @license DOMPurify 3.1.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.5/LICENSE */
2
2
  const {
3
3
  entries,
4
4
  setPrototypeOf,
@@ -134,7 +134,7 @@ const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "
134
134
  const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
135
135
  const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
136
136
  const text = freeze(["#text"]);
137
- const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]);
137
+ const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]);
138
138
  const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
139
139
  const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
140
140
  const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
@@ -153,7 +153,7 @@ const ATTR_WHITESPACE = seal(
153
153
  // eslint-disable-line no-control-regex
154
154
  );
155
155
  const DOCTYPE_NAME = seal(/^html$/i);
156
- const CUSTOM_ELEMENT = seal(/^[a-z][a-z\d]*(-[a-z\d]+)+$/i);
156
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
157
157
  var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
158
158
  __proto__: null,
159
159
  MUSTACHE_EXPR,
@@ -167,6 +167,23 @@ var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
167
167
  DOCTYPE_NAME,
168
168
  CUSTOM_ELEMENT
169
169
  });
170
+ const NODE_TYPE = {
171
+ element: 1,
172
+ attribute: 2,
173
+ text: 3,
174
+ cdataSection: 4,
175
+ entityReference: 5,
176
+ // Deprecated
177
+ entityNode: 6,
178
+ // Deprecated
179
+ progressingInstruction: 7,
180
+ comment: 8,
181
+ document: 9,
182
+ documentType: 10,
183
+ documentFragment: 11,
184
+ notation: 12
185
+ // Deprecated
186
+ };
170
187
  const getGlobal = function getGlobal2() {
171
188
  return typeof window === "undefined" ? null : window;
172
189
  };
@@ -197,9 +214,9 @@ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTyp
197
214
  function createDOMPurify() {
198
215
  let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
199
216
  const DOMPurify = (root) => createDOMPurify(root);
200
- DOMPurify.version = "3.0.10";
217
+ DOMPurify.version = "3.1.5";
201
218
  DOMPurify.removed = [];
202
- if (!window2 || !window2.document || window2.document.nodeType !== 9) {
219
+ if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document) {
203
220
  DOMPurify.isSupported = false;
204
221
  return DOMPurify;
205
222
  }
@@ -287,6 +304,7 @@ function createDOMPurify() {
287
304
  let ALLOW_UNKNOWN_PROTOCOLS = false;
288
305
  let ALLOW_SELF_CLOSE_IN_ATTR = true;
289
306
  let SAFE_FOR_TEMPLATES = false;
307
+ let SAFE_FOR_XML = true;
290
308
  let WHOLE_DOCUMENT = false;
291
309
  let SET_CONFIG = false;
292
310
  let FORCE_BODY = false;
@@ -361,6 +379,7 @@ function createDOMPurify() {
361
379
  ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
362
380
  ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
363
381
  SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
382
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
364
383
  WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
365
384
  RETURN_DOM = cfg.RETURN_DOM || false;
366
385
  RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
@@ -465,7 +484,7 @@ function createDOMPurify() {
465
484
  CONFIG = cfg;
466
485
  };
467
486
  const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
468
- const HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]);
487
+ const HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "annotation-xml"]);
469
488
  const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
470
489
  const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
471
490
  const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
@@ -591,7 +610,7 @@ function createDOMPurify() {
591
610
  root.ownerDocument || root,
592
611
  root,
593
612
  // eslint-disable-next-line no-bitwise
594
- NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION,
613
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
595
614
  null
596
615
  );
597
616
  };
@@ -625,6 +644,14 @@ function createDOMPurify() {
625
644
  _forceRemove(currentNode);
626
645
  return true;
627
646
  }
647
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
648
+ _forceRemove(currentNode);
649
+ return true;
650
+ }
651
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
652
+ _forceRemove(currentNode);
653
+ return true;
654
+ }
628
655
  if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
629
656
  if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
630
657
  if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
@@ -640,7 +667,9 @@ function createDOMPurify() {
640
667
  if (childNodes && parentNode) {
641
668
  const childCount = childNodes.length;
642
669
  for (let i = childCount - 1; i >= 0; --i) {
643
- parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
670
+ const childClone = cloneNode(childNodes[i], true);
671
+ childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
672
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
644
673
  }
645
674
  }
646
675
  }
@@ -655,7 +684,7 @@ function createDOMPurify() {
655
684
  _forceRemove(currentNode);
656
685
  return true;
657
686
  }
658
- if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
687
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
659
688
  content = currentNode.textContent;
660
689
  arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
661
690
  content = stringReplace(content, expr, " ");
@@ -749,6 +778,10 @@ function createDOMPurify() {
749
778
  _removeAttribute(name, currentNode);
750
779
  continue;
751
780
  }
781
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
782
+ _removeAttribute(name, currentNode);
783
+ continue;
784
+ }
752
785
  if (SAFE_FOR_TEMPLATES) {
753
786
  arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
754
787
  value = stringReplace(value, expr, " ");
@@ -784,7 +817,11 @@ function createDOMPurify() {
784
817
  } else {
785
818
  currentNode.setAttribute(name, value);
786
819
  }
787
- arrayPop(DOMPurify.removed);
820
+ if (_isClobbered(currentNode)) {
821
+ _forceRemove(currentNode);
822
+ } else {
823
+ arrayPop(DOMPurify.removed);
824
+ }
788
825
  } catch (_) {
789
826
  }
790
827
  }
@@ -846,7 +883,7 @@ function createDOMPurify() {
846
883
  } else if (dirty instanceof Node) {
847
884
  body = _initDocument("<!---->");
848
885
  importedNode = body.ownerDocument.importNode(dirty, true);
849
- if (importedNode.nodeType === 1 && importedNode.nodeName === "BODY") {
886
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
850
887
  body = importedNode;
851
888
  } else if (importedNode.nodeName === "HTML") {
852
889
  body = importedNode;
@@ -286,7 +286,8 @@ class _Tokenizer {
286
286
  blockquote(src) {
287
287
  const cap = this.rules.block.blockquote.exec(src);
288
288
  if (cap) {
289
- const text = rtrim(cap[0].replace(/^ *>[ \t]?/gm, ""), "\n");
289
+ let text = cap[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, "\n $1");
290
+ text = rtrim(text.replace(/^ *>[ \t]?/gm, ""), "\n");
290
291
  const top = this.lexer.state.top;
291
292
  this.lexer.state.top = true;
292
293
  const tokens = this.lexer.blockTokens(text);
@@ -1,7 +1,10 @@
1
1
  import { rootStrore } from "../index.mjs";
2
2
  import { defineStore } from "pinia";
3
3
  import { http } from "../../utils/http/index.mjs";
4
- import { getReport } from "../../api/copilot.mjs";
4
+ import { updataHistoryRecord, deleteHistoryRecord, getHistoryRecordList, createHistoryRecord, getReport, createHistoryInfo, updataHistoryInfo, getHistoryInfo } from "../../api/copilot.mjs";
5
+ import { isAllEmpty as B } from "../../node_modules/.pnpm/@pureadmin_utils@1.8.5_vue@3.2.45/node_modules/@pureadmin/utils/dist/index.mjs";
6
+ import { plusParamToStr } from "../../utils/copilot.mjs";
7
+ import { message } from "../../utils/message.mjs";
5
8
  var DataType = /* @__PURE__ */ ((DataType2) => {
6
9
  DataType2[DataType2["text"] = 1] = "text";
7
10
  DataType2[DataType2["edit"] = 2] = "edit";
@@ -12,6 +15,10 @@ const useCopilotStore = defineStore({
12
15
  id: "kg-copilot",
13
16
  state: () => ({
14
17
  maxSendNum: 0,
18
+ useHistoryRecord: false,
19
+ knowledgeToken: "",
20
+ historyList: [],
21
+ currentHistoryRecord: {},
15
22
  intelligentAnalysisConfig: {},
16
23
  defaultDeal: {},
17
24
  placeholder: "输入“@”选择智能体,可通过上下键切换,回车选中",
@@ -31,9 +38,29 @@ const useCopilotStore = defineStore({
31
38
  cancleUrl: "",
32
39
  requestSseing: false,
33
40
  cancelsse: () => {
34
- }
41
+ },
42
+ pluginsPayload: {}
43
+ // 智能体负载(从外部设置)
35
44
  }),
36
- getters: {},
45
+ getters: {
46
+ // 选中插件的参数要求
47
+ selPluginParams(state) {
48
+ var _a, _b;
49
+ const param = !B(state.checkedPluginByBtn) ? (_b = (_a = state.checkedPluginByBtn) == null ? void 0 : _a.param_desc) == null ? void 0 : _b.properties : {};
50
+ return Object.keys(param);
51
+ },
52
+ pluginPayloadStr(state) {
53
+ let str = "";
54
+ for (const key in state.pluginsPayload) {
55
+ if (state.selPluginParams.includes(key) && state.pluginsPayload[key]) {
56
+ str += plusParamToStr(key.toString()) + ":";
57
+ str += state.pluginsPayload[key];
58
+ str += "&nbsp;&nbsp;";
59
+ }
60
+ }
61
+ return str;
62
+ }
63
+ },
37
64
  actions: {
38
65
  initCopilot({
39
66
  plugins,
@@ -42,7 +69,10 @@ const useCopilotStore = defineStore({
42
69
  maxSendNum,
43
70
  placeholder,
44
71
  intelligentAnalysisConfig,
45
- defaultDeal
72
+ defaultDeal,
73
+ pluginsPayload = {},
74
+ useHistoryRecord,
75
+ knowledgeToken
46
76
  }) {
47
77
  this.plugins = plugins;
48
78
  this.initText = initText;
@@ -51,18 +81,25 @@ const useCopilotStore = defineStore({
51
81
  this.maxSendNum = maxSendNum;
52
82
  this.intelligentAnalysisConfig = intelligentAnalysisConfig;
53
83
  this.defaultDeal = defaultDeal;
84
+ this.useHistoryRecord = useHistoryRecord;
54
85
  this.isInitCopilot = true;
86
+ this.knowledgeToken = knowledgeToken;
55
87
  this.checkedPluginByBtn = {};
56
88
  this.setSearchText("");
57
89
  this.isShowNewTheme = false;
58
90
  this.initDialogue();
59
91
  this.stopDialogue = false;
60
92
  this.setSendLonding(true);
93
+ this.pluginsPayload = pluginsPayload;
94
+ if (useHistoryRecord) {
95
+ this.getHistoryList();
96
+ }
61
97
  },
62
98
  setSearchText(str) {
63
99
  this.searchText = str;
64
100
  },
65
101
  resetCopilot() {
102
+ this.currentHistoryRecord = {};
66
103
  this.onlyCancelRequest();
67
104
  this.isInitCopilot = true;
68
105
  this.setSearchText("");
@@ -70,6 +107,7 @@ const useCopilotStore = defineStore({
70
107
  this.initDialogue();
71
108
  this.stopDialogue = false;
72
109
  this.setSendLonding(true);
110
+ this.checkedPluginByBtn = {};
73
111
  },
74
112
  initDialogue() {
75
113
  this.msgList = [
@@ -104,7 +142,60 @@ const useCopilotStore = defineStore({
104
142
  setShowNewTheme(show) {
105
143
  this.isShowNewTheme = show;
106
144
  },
145
+ async updataHistoryName(data) {
146
+ await updataHistoryRecord(data).then((res) => {
147
+ if (res.status === 200) {
148
+ this.getHistoryList();
149
+ } else {
150
+ message(res.message, { type: "error" });
151
+ }
152
+ });
153
+ },
154
+ delHistoryRecord({
155
+ sessionId = "xxx",
156
+ isAll
157
+ }) {
158
+ deleteHistoryRecord({ sessionId, isAll }).then((res) => {
159
+ if (res.status === 200) {
160
+ this.getHistoryList();
161
+ if (isAll && this.currentHistoryRecord.sessionId) {
162
+ this.currentHistoryRecord = {};
163
+ this.resetCopilot();
164
+ return;
165
+ }
166
+ if (this.currentHistoryRecord.sessionId === sessionId) {
167
+ this.currentHistoryRecord = {};
168
+ this.resetCopilot();
169
+ }
170
+ }
171
+ });
172
+ },
173
+ getHistoryList() {
174
+ getHistoryRecordList().then((res) => {
175
+ if (res.status === 200) {
176
+ this.historyList = res.data;
177
+ }
178
+ });
179
+ },
107
180
  async sendMsg(msg) {
181
+ if (this.msgList.length === 1 && this.useHistoryRecord) {
182
+ createHistoryRecord({ name: msg }).then((res) => {
183
+ if (res.status === 200) {
184
+ this.currentHistoryRecord = {
185
+ sessionId: res.data,
186
+ name: msg
187
+ };
188
+ this.getHistoryList();
189
+ this.updataCurrentHistoryInfo();
190
+ }
191
+ });
192
+ }
193
+ let message2 = msg;
194
+ if (this.pluginPayloadStr) {
195
+ if (message2)
196
+ message2 += "&nbsp;&nbsp;";
197
+ message2 += this.pluginPayloadStr;
198
+ }
108
199
  this.msgList.push({
109
200
  isSend: true,
110
201
  needPrinting: false,
@@ -116,7 +207,7 @@ const useCopilotStore = defineStore({
116
207
  1
117
208
  /* text */
118
209
  ],
119
- content: msg
210
+ content: message2
120
211
  }
121
212
  ],
122
213
  showOpt: false
@@ -332,6 +423,7 @@ const useCopilotStore = defineStore({
332
423
  lastMsg.isShrink = true;
333
424
  lastMsg.firstShrinked = true;
334
425
  }
426
+ this.updataCurrentHistoryInfo();
335
427
  return;
336
428
  }
337
429
  const plusName = this.currentUsePlugin && this.currentUsePlugin.name;
@@ -350,6 +442,61 @@ const useCopilotStore = defineStore({
350
442
  showOpt: true,
351
443
  plusName
352
444
  });
445
+ this.updataCurrentHistoryInfo();
446
+ },
447
+ updataCurrentHistoryInfo() {
448
+ if (!this.useHistoryRecord)
449
+ return;
450
+ if (!this.currentHistoryRecord.recordId) {
451
+ createHistoryInfo({
452
+ sessionId: this.currentHistoryRecord.sessionId,
453
+ info: JSON.stringify({
454
+ msgList: this.msgList,
455
+ checkedPlugKey: this.checkedPluginByBtn.key || ""
456
+ })
457
+ }).then((res) => {
458
+ if (res.status === 200) {
459
+ this.currentHistoryRecord.recordId = res.data;
460
+ }
461
+ });
462
+ return;
463
+ }
464
+ updataHistoryInfo({
465
+ id: this.currentHistoryRecord.recordId,
466
+ info: JSON.stringify({
467
+ msgList: this.msgList,
468
+ checkedPlugKey: this.checkedPluginByBtn.key || ""
469
+ })
470
+ });
471
+ },
472
+ changeCurrentRecord(item) {
473
+ if (this.currentHistoryRecord.sessionId === item.sessionId) {
474
+ return;
475
+ }
476
+ this.currentHistoryRecord = item;
477
+ this.cancelRequest();
478
+ getHistoryInfo({
479
+ sessionId: item.sessionId
480
+ }).then((res) => {
481
+ if (res.status === 200) {
482
+ const [msg] = res.data;
483
+ if (!msg)
484
+ return;
485
+ this.currentHistoryRecord.recordId = msg.id;
486
+ const { msgList, checkedPlugKey } = JSON.parse(msg.info);
487
+ this.checkedPluginByBtn = this.plugins.find((item2) => item2.key === checkedPlugKey) || {};
488
+ msgList.forEach((item2, index) => {
489
+ item2.isHistory = true;
490
+ if (index === msgList.length - 1) {
491
+ item2.needPrinting = false;
492
+ item2.msgs.forEach((msgItem) => {
493
+ msgItem.needPrinting = false;
494
+ });
495
+ }
496
+ });
497
+ this.setMsgList(msgList);
498
+ }
499
+ });
353
500
  },
354
501
  onlyCancelRequest() {
355
502
  this.cancelsse && this.cancelsse();
@@ -361,6 +508,12 @@ const useCopilotStore = defineStore({
361
508
  this.requestSseing = false;
362
509
  http.cancelByUrl(this.cancleUrl);
363
510
  this.setSendLonding(false);
511
+ },
512
+ setPluginsPayload(obj) {
513
+ this.pluginsPayload = obj;
514
+ },
515
+ clearPluginsPayload() {
516
+ this.pluginsPayload = {};
364
517
  }
365
518
  }
366
519
  });