@matechat/core 1.11.0 → 1.12.0-alpha

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 (45) hide show
  1. package/Attachment/Attachment.vue.d.ts +8 -8
  2. package/Attachment/attachment-types.d.ts +3 -35
  3. package/Attachment/index.css +1 -1
  4. package/Attachment/index.js +43 -45
  5. package/Bubble/index.css +1 -1
  6. package/Bubble/index.js +322 -186
  7. package/Bubble/useBubbleFoundation.d.ts +9 -0
  8. package/FileList/index.js +1 -1
  9. package/Header/index.css +1 -1
  10. package/Header/index.js +12 -11
  11. package/Input/components/EditableBlock.vue.d.ts +2 -2
  12. package/Input/index.css +1 -1
  13. package/Input/index.js +699 -108
  14. package/Introduction/index.css +1 -1
  15. package/Introduction/index.js +138 -38
  16. package/Layout/index.js +7 -6
  17. package/List/index.css +1 -1
  18. package/List/index.js +54 -51
  19. package/Locale/index.js +85 -35
  20. package/MarkdownCard/MDCardParser.d.ts +0 -10
  21. package/MarkdownCard/MermaidService-yeLQUW_e.js +142 -0
  22. package/MarkdownCard/index.css +1 -1
  23. package/MarkdownCard/index.js +735 -200
  24. package/MarkdownCard/mdCard.types.d.ts +2 -29
  25. package/MarkdownCard/mdCard.vue.d.ts +2 -2
  26. package/MarkdownCard/useMarkdownCardFoundation.d.ts +8 -0
  27. package/Mention/Mention.vue.d.ts +12 -3
  28. package/Mention/index.css +1 -1
  29. package/Mention/index.js +365 -110
  30. package/Mention/mention-types.d.ts +6 -4
  31. package/Mention/use-mention.d.ts +7 -0
  32. package/Prompt/index.js +1 -1
  33. package/README.md +8 -12
  34. package/Toolbar/index.css +1 -1
  35. package/Toolbar/index.d.ts +2 -1
  36. package/Toolbar/index.js +189 -198
  37. package/Toolbar/toolbar.types.d.ts +2 -26
  38. package/index.d.ts +18 -6
  39. package/mate-chat.js +17 -2
  40. package/package.json +1 -4
  41. package/Attachment/uploader.d.ts +0 -11
  42. package/MarkdownCard/MDCardService.d.ts +0 -14
  43. package/MarkdownCard/MermaidService-B6BcjbW_.js +0 -127
  44. package/MarkdownCard/MermaidService.d.ts +0 -22
  45. package/Mention/const.d.ts +0 -4
@@ -1,19 +1,26 @@
1
- import { defineComponent as E, ref as O, computed as y, createElementBlock as u, openBlock as I, normalizeClass as x, renderSlot as T, createVNode as Q, createElementVNode as D, toDisplayString as P, unref as b, Transition as G, withCtx as H, createCommentVNode as U, useSlots as Z, h as w, watch as S, onMounted as X, Fragment as R, createBlock as F, resolveDynamicComponent as V } from "vue";
2
- import C from "highlight.js";
3
- import K from "markdown-it";
4
- import { debounce as J } from "lodash-es";
5
- import { getDefaultWhiteList as $, getDefaultCSSWhiteList as q, filterXSS as ee } from "xss";
6
- const te = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e全部收起%3c/title%3e%3cg%20id='全部收起'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M4.715694,14.4114091%20C4.910563,14.5464051%205.179987,14.5271201%205.353553,14.3535531%20L5.353553,14.3535531%20L7.99999988,11.7070001%20L10.646447,14.3535531%20L10.715694,14.4114091%20C10.910563,14.5464051%2011.179987,14.5271201%2011.353553,14.3535531%20C11.548816,14.1582911%2011.548816,13.8417091%2011.353553,13.6464471%20L11.353553,13.6464471%20L8.353553,10.6464471%20L8.284306,10.5885911%20C8.089437,10.4535951%207.820013,10.4728801%207.646447,10.6464471%20L7.646447,10.6464471%20L4.646447,13.6464471%20L4.588591,13.7156941%20C4.453595,13.9105631%204.47288,14.1799871%204.646447,14.3535531%20L4.646447,14.3535531%20L4.715694,14.4114091%20Z%20M14.5,7.50000012%20C14.776142,7.50000012%2015,7.72385812%2015,8.00000012%20C15,8.27614212%2014.776142,8.50000012%2014.5,8.50000012%20L1.5,8.50000012%20C1.223858,8.50000012%201,8.27614212%201,8.00000012%20C1,7.72385812%201.223858,7.50000012%201.5,7.50000012%20L14.5,7.50000012%20Z%20M8.284306,5.41140912%20L8.353553,5.35355312%20L11.353553,2.35355312%20C11.548816,2.15829112%2011.548816,1.84170912%2011.353553,1.64644712%20C11.179987,1.47288012%2010.910563,1.45359512%2010.715694,1.58859112%20L10.646447,1.64644712%20L7.99999988,4.29300012%20L5.353553,1.64644712%20C5.179987,1.47288012%204.910563,1.45359512%204.715694,1.58859112%20L4.646447,1.64644712%20C4.47288,1.82001312%204.453595,2.08943712%204.588591,2.28430612%20L4.646447,2.35355312%20L7.646447,5.35355312%20C7.820013,5.52712012%208.089437,5.54640512%208.284306,5.41140912%20Z'%20id='形状结合'%20fill='%2371757F'%20fill-rule='nonzero'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", se = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZnVuY3Rpb24gaWNvbi9jb3B5PC90aXRsZT4KICAgIDxnIGlkPSLpobXpnaItMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFQSS1zdGFydGVyLeWbvuagh+WFpeW6kyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTU5Mi4wMDAwMDAsIC0yMDQuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSLmlrnmoLzlpIfku70tMTYiIHRy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.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3estatus/whiteBG/correct%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3cpolygon%20id='path-1'%20points='6.53553391%209.77817459%2012.1923882%204.12132034%2013.6066017%205.53553391%206.53553391%2012.6066017%203%209.07106781%204.41421356%207.65685425%206.53553391%209.77817459'%3e%3c/polygon%3e%3c/defs%3e%3cg%20id='status/whiteBG/correct'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cmask%20id='mask-2'%20fill='white'%3e%3cuse%20xlink:href='%23path-1'%3e%3c/use%3e%3c/mask%3e%3cuse%20id='Mask'%20fill='%233DCCA6'%20xlink:href='%23path-1'%3e%3c/use%3e%3c/g%3e%3c/svg%3e";
7
- class W {
1
+ import "./index.css";
2
+ var we = Object.defineProperty;
3
+ var ve = (o, t, s) => t in o ? we(o, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[t] = s;
4
+ var N = (o, t, s) => ve(o, typeof t != "symbol" ? t + "" : t, s);
5
+ import { defineComponent as de, ref as D, computed as Q, watch as E, nextTick as W, onMounted as ge, openBlock as M, createElementBlock as I, normalizeClass as O, createElementVNode as C, toDisplayString as J, renderSlot as q, unref as T, createCommentVNode as z, createVNode as Ie, Transition as Le, withCtx as Ne, withDirectives as Te, vShow as De, isVNode as ue, h as y, reactive as xe, onBeforeUnmount as Ae, useSlots as ke, Fragment as j, createBlock as Se, resolveDynamicComponent as be } from "vue";
6
+ import A from "highlight.js";
7
+ import je from "markdown-it";
8
+ import { debounce as Oe } from "lodash-es";
9
+ import { getDefaultWhiteList as Ee, getDefaultCSSWhiteList as _e, filterXSS as Be } from "xss";
10
+ import { useMcI18n as pe } from "@matechat/core/Locale";
11
+ const Ue = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eenlarge%3c/title%3e%3cg%20id='enlarge'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M7.16666667,1%20C10.572409,1%2013.3333333,3.76092429%2013.3333333,7.16666667%20C13.3333333,8.68984984%2012.781084,10.0840543%2011.8658888,11.1599767%20L14.4225201,13.7154466%20C14.6177822,13.9107088%2014.6177822,14.2272912%2014.4225201,14.4225534%20C14.2489537,14.5961197%2013.9795293,14.6154049%2013.7846612,14.4804088%20L13.7154133,14.4225534%20L11.158968,11.8667467%20C10.083183,12.7814291%208.68937384,13.3333333%207.16666667,13.3333333%20C3.76092429,13.3333333%201,10.572409%201,7.16666667%20C1,3.76092429%203.76092429,1%207.16666667,1%20Z%20M7.16666667,2%20C4.31320904,2%202,4.31320904%202,7.16666667%20C2,10.0201243%204.31320904,12.3333333%207.16666667,12.3333333%20C10.0201243,12.3333333%2012.3333333,10.0201243%2012.3333333,7.16666667%20C12.3333333,4.31320904%2010.0201243,2%207.16666667,2%20Z%20M7.16666667,4.66666667%20C7.41212656,4.66666667%207.61627504,4.84354183%207.658611,5.07679103%20L7.66666667,5.16666667%20L7.666,6.668%20L9.16601582,6.66666666%20C9.44215796,6.66630764%209.66630679,6.88987368%209.66666668,7.16601582%20C9.66698576,7.4114755%209.49037648,7.61585405%209.25718258,7.65849359%20L9.16731751,7.66666666%20L7.666,7.668%20L7.66666667,9.16666667%20C7.66666667,9.44280904%207.44280904,9.66666667%207.16666667,9.66666667%20C6.92120678,9.66666667%206.7170583,9.48979151%206.67472234,9.2565423%20L6.66666667,9.16666667%20L6.666,7.669%20L5.17251751,7.67186668%20C4.89637537,7.6722257%204.67222654,7.44865965%204.67186666,7.17251751%20C4.67154758,6.92705783%204.84815685,6.72267929%205.08135075,6.68003974%20L5.17121582,6.67186709%20L6.666,6.669%20L6.66666667,5.16666667%20C6.66666667,4.89052429%206.89052429,4.66666667%207.16666667,4.66666667%20Z'%20id='形状结合'%20fill='%2371757F'%20fill-rule='nonzero'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", ze = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3ezoom-out%3c/title%3e%3cg%20id='zoom-out'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M7.16666667,1%20C10.572409,1%2013.3333333,3.76092429%2013.3333333,7.16666667%20C13.3333333,8.68984984%2012.781084,10.0840543%2011.8658888,11.1599767%20L14.4225201,13.7154466%20C14.6177822,13.9107088%2014.6177822,14.2272912%2014.4225201,14.4225534%20C14.2489537,14.5961197%2013.9795293,14.6154049%2013.7846612,14.4804088%20L13.7154133,14.4225534%20L11.158968,11.8667467%20C10.083183,12.7814291%208.68937384,13.3333333%207.16666667,13.3333333%20C3.76092429,13.3333333%201,10.572409%201,7.16666667%20C1,3.76092429%203.76092429,1%207.16666667,1%20Z%20M7.16666667,2%20C4.31320904,2%202,4.31320904%202,7.16666667%20C2,10.0201243%204.31320904,12.3333333%207.16666667,12.3333333%20C10.0201243,12.3333333%2012.3333333,10.0201243%2012.3333333,7.16666667%20C12.3333333,4.31320904%2010.0201243,2%207.16666667,2%20Z%20M9.16601582,6.66666666%20C9.44215796,6.66630764%209.66630679,6.88987368%209.66666668,7.16601582%20C9.66698576,7.4114755%209.49037648,7.61585405%209.25718258,7.65849359%20L9.16731751,7.66666666%20L5.17251751,7.67186668%20C4.89637537,7.6722257%204.67222654,7.44865965%204.67186666,7.17251751%20C4.67154758,6.92705783%204.84815685,6.72267929%205.08135075,6.68003974%20L5.17121582,6.67186709%20L9.16601582,6.66666666%20Z'%20id='形状结合'%20fill='%2371757F'%20fill-rule='nonzero'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", We = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3ei下载%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='i下载'%3e%3cpath%20d='M14.5,14%20C14.7761424,14%2015,14.2238576%2015,14.5%20C15,14.7761424%2014.7761424,15%2014.5,15%20L1.5,15%20C1.22385763,15%201,14.7761424%201,14.5%20C1,14.2238576%201.22385763,14%201.5,14%20L14.5,14%20Z%20M8,1%20C8.24545989,1%208.44960837,1.17687516%208.49194433,1.41012437%20L8.5,1.5%20L8.5,10.793%20L11.6464466,7.64644661%20C11.820013,7.47288026%2012.0894374,7.45359511%2012.2843055,7.58859116%20L12.3535534,7.64644661%20C12.5271197,7.82001296%2012.5464049,8.08943736%2012.4114088,8.2843055%20L12.3535534,8.35355339%20L8.35355339,12.3535534%20L8.34128643,12.3654113%20C8.32881868,12.3770608%208.31575424,12.3880797%208.30214392,12.3984173%20L8.35355339,12.3535534%20C8.32671912,12.3803877%208.29759357,12.4035342%208.26680652,12.422993%20C8.25568247,12.4299807%208.24404667,12.4367067%208.23212724,12.4429657%20C8.21827569,12.4502504%208.20453886,12.4566485%208.1905951,12.4623894%20C8.17802507,12.4675915%208.16473685,12.4724419%208.15119917,12.4767316%20C8.13583471,12.481552%208.12047425,12.4856039%208.10498705,12.4889143%20C8.09430622,12.4912471%208.08325248,12.4932298%208.07207924,12.494843%20C8.05487076,12.4972949%208.03773477,12.498877%208.02056948,12.4995793%20C8.01375728,12.4998604%208.00689494,12.5%208,12.5%20L7.98043349,12.4996194%20C7.96293275,12.4989382%207.94546098,12.4973429%207.92809589,12.4948333%20L8,12.5%20C7.96390296,12.5%207.92869933,12.4961748%207.89477235,12.4889078%20C7.87952575,12.4856039%207.86416529,12.481552%207.84898836,12.4767587%20C7.83526315,12.4724419%207.82197493,12.4675915%207.80896344,12.4622078%20C7.79546114,12.4566485%207.78172431,12.4502504%207.76824181,12.443195%20C7.75595333,12.4367067%207.74431753,12.4299807%207.73298968,12.422812%20C7.72729809,12.4192668%207.72146362,12.4154054%207.7156945,12.4114088%20L7.69785608,12.3984173%20C7.68424576,12.3880797%207.67118132,12.3770608%207.65871357,12.3654113%20L7.64644661,12.3535534%20L3.64644661,8.35355339%20C3.45118446,8.15829124%203.45118446,7.84170876%203.64644661,7.64644661%20C3.82001296,7.47288026%204.08943736,7.45359511%204.2843055,7.58859116%20L4.35355339,7.64644661%20L7.5,10.793%20L7.5,1.5%20C7.5,1.22385763%207.72385763,1%208,1%20Z'%20id='形状结合'%20fill='%2371757F'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Pe = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e全部收起%3c/title%3e%3cg%20id='全部收起'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M4.715694,14.4114091%20C4.910563,14.5464051%205.179987,14.5271201%205.353553,14.3535531%20L5.353553,14.3535531%20L7.99999988,11.7070001%20L10.646447,14.3535531%20L10.715694,14.4114091%20C10.910563,14.5464051%2011.179987,14.5271201%2011.353553,14.3535531%20C11.548816,14.1582911%2011.548816,13.8417091%2011.353553,13.6464471%20L11.353553,13.6464471%20L8.353553,10.6464471%20L8.284306,10.5885911%20C8.089437,10.4535951%207.820013,10.4728801%207.646447,10.6464471%20L7.646447,10.6464471%20L4.646447,13.6464471%20L4.588591,13.7156941%20C4.453595,13.9105631%204.47288,14.1799871%204.646447,14.3535531%20L4.646447,14.3535531%20L4.715694,14.4114091%20Z%20M14.5,7.50000012%20C14.776142,7.50000012%2015,7.72385812%2015,8.00000012%20C15,8.27614212%2014.776142,8.50000012%2014.5,8.50000012%20L1.5,8.50000012%20C1.223858,8.50000012%201,8.27614212%201,8.00000012%20C1,7.72385812%201.223858,7.50000012%201.5,7.50000012%20L14.5,7.50000012%20Z%20M8.284306,5.41140912%20L8.353553,5.35355312%20L11.353553,2.35355312%20C11.548816,2.15829112%2011.548816,1.84170912%2011.353553,1.64644712%20C11.179987,1.47288012%2010.910563,1.45359512%2010.715694,1.58859112%20L10.646447,1.64644712%20L7.99999988,4.29300012%20L5.353553,1.64644712%20C5.179987,1.47288012%204.910563,1.45359512%204.715694,1.58859112%20L4.646447,1.64644712%20C4.47288,1.82001312%204.453595,2.08943712%204.588591,2.28430612%20L4.646447,2.35355312%20L7.646447,5.35355312%20C7.820013,5.52712012%208.089437,5.54640512%208.284306,5.41140912%20Z'%20id='形状结合'%20fill='%2371757F'%20fill-rule='nonzero'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", He = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZnVuY3Rpb24gaWNvbi9jb3B5PC90aXRsZT4KICAgIDxnIGlkPSLpobXpnaItMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFQSS1zdGFydGVyLeWbvuagh+WFpeW6kyIgdHJhbnNmb3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=", Ze = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3estatus/whiteBG/correct%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3cpolygon%20id='path-1'%20points='6.53553391%209.77817459%2012.1923882%204.12132034%2013.6066017%205.53553391%206.53553391%2012.6066017%203%209.07106781%204.41421356%207.65685425%206.53553391%209.77817459'%3e%3c/polygon%3e%3c/defs%3e%3cg%20id='status/whiteBG/correct'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cmask%20id='mask-2'%20fill='white'%3e%3cuse%20xlink:href='%23path-1'%3e%3c/use%3e%3c/mask%3e%3cuse%20id='Mask'%20fill='%233DCCA6'%20xlink:href='%23path-1'%3e%3c/use%3e%3c/g%3e%3c/svg%3e";
12
+ class he {
8
13
  constructor() {
9
- this.xssWhiteList = $(), this.cssWhiteList = q(), this.setDefaultXss();
14
+ N(this, "xssWhiteList", Ee());
15
+ N(this, "cssWhiteList", _e());
16
+ this.setDefaultXss();
10
17
  }
11
18
  setDefaultXss() {
12
- this.xssWhiteList.input = ["type", "checked", "disabled", "class"], this.xssWhiteList.label = ["for"], this.xssWhiteList.ul = ["class"], this.xssWhiteList.div = ["class"], this.xssWhiteList.a = ["href", "class", "target", "name"], this.xssWhiteList.ol = ["start"], this.xssWhiteList.p = ["class"], this.xssWhiteList.span = ["style", "class", "title", "id"], this.xssWhiteList.svg = ["style", "class", "width", "height", "viewbox", "preserveaspectratio", "id", "fill", "stroke"], this.xssWhiteList.path = ["style", "class", "d", "id", "fill", "stroke"], this.xssWhiteList.th = ["style"], this.xssWhiteList.td = ["style"];
19
+ this.xssWhiteList.input = ["type", "checked", "disabled", "class"], this.xssWhiteList.label = ["for"], this.xssWhiteList.ul = ["class"], this.xssWhiteList.div = ["class", "key"], this.xssWhiteList.a = ["href", "class", "target", "name"], this.xssWhiteList.ol = ["start"], this.xssWhiteList.p = ["class"], this.xssWhiteList.span = ["style", "class", "title", "id"], this.xssWhiteList.svg = ["style", "class", "width", "height", "viewbox", "preserveaspectratio", "id", "fill", "stroke"], this.xssWhiteList.path = ["style", "class", "d", "id", "fill", "stroke"], this.xssWhiteList.th = ["style"], this.xssWhiteList.td = ["style"];
13
20
  }
14
- onIgnoreTagAttr(t, o, r, s) {
15
- if (!s && (o === "id" || t === "span" && o === "style"))
16
- return o + "=" + r;
21
+ onIgnoreTagAttr(t, s, a, n) {
22
+ if (!n && (s === "id" || t === "span" && s === "style"))
23
+ return s + "=" + a;
17
24
  }
18
25
  getXssWhiteList() {
19
26
  return this.xssWhiteList;
@@ -22,18 +29,18 @@ class W {
22
29
  this.xssWhiteList = t;
23
30
  }
24
31
  setCustomXssRules(t) {
25
- t && t.forEach((o) => {
26
- o.value === null ? delete this.xssWhiteList[o.key] : this.xssWhiteList[o.key] = o.value;
32
+ t && t.forEach((s) => {
33
+ s.value === null ? delete this.xssWhiteList[s.key] : this.xssWhiteList[s.key] = s.value;
27
34
  });
28
35
  }
29
- setMdPlugins(t, o) {
30
- t && t.length && t.forEach((r) => {
31
- const { plugin: s, opts: m } = r;
32
- o.use(s, m);
36
+ setMdPlugins(t, s) {
37
+ t && t.length && t.forEach((a) => {
38
+ const { plugin: n, opts: c } = a;
39
+ s.use(n, c);
33
40
  });
34
41
  }
35
42
  filterHtml(t) {
36
- return ee(t, {
43
+ return Be(t, {
37
44
  whiteList: this.xssWhiteList,
38
45
  onIgnoreTagAttr: this.onIgnoreTagAttr,
39
46
  css: {
@@ -47,16 +54,22 @@ class W {
47
54
  });
48
55
  }
49
56
  }
50
- const oe = {
57
+ const Ye = {
51
58
  key: 0,
52
59
  class: "mc-code-block-header"
53
- }, ne = { class: "mc-code-lang" }, ce = { class: "mc-code-block-actions" }, ae = {
60
+ }, Qe = { class: "mc-code-lang" }, Fe = { class: "mc-code-block-actions" }, Ge = {
54
61
  key: 0,
55
- src: se
56
- }, re = {
62
+ style: { "margin-right": "8px" }
63
+ }, $e = ["title"], Xe = ["title"], Re = ["title"], Ke = ["title"], Ve = ["title"], Je = {
64
+ key: 0,
65
+ src: He
66
+ }, qe = {
57
67
  key: 1,
58
- src: ie
59
- }, le = { key: 0 }, de = { key: 0 }, ge = ["innerHTML"], Me = /* @__PURE__ */ E({
68
+ src: Ze
69
+ }, et = {
70
+ key: 0,
71
+ class: "mc-mermaid-content"
72
+ }, tt = { key: 1 }, st = ["innerHTML"], nt = /* @__PURE__ */ de({
60
73
  __name: "CodeBlock",
61
74
  props: {
62
75
  code: {
@@ -74,100 +87,246 @@ const oe = {
74
87
  theme: {
75
88
  type: String,
76
89
  default: "light"
90
+ },
91
+ enableMermaid: {
92
+ type: Boolean,
93
+ default: !1
94
+ },
95
+ mermaidConfig: {
96
+ type: Object,
97
+ default: () => ({})
77
98
  }
78
99
  },
79
- setup(l) {
80
- const t = l, o = new W(), r = O(!0), s = O(!1), m = y(() => {
81
- if (t.language && C.getLanguage(t.language))
82
- try {
83
- return C.highlight(t.code, { language: t.language }).value;
84
- } catch {
85
- }
86
- return o.filterHtml(t.code);
87
- }), a = () => {
88
- r.value = !r.value;
89
- }, M = J((e) => {
90
- const g = e.target;
100
+ setup(o) {
101
+ const t = o, { t: s } = pe(), a = new he();
102
+ let n = null;
103
+ const c = D(!0), d = D(!1);
104
+ D("");
105
+ const r = D(!0), g = Q(() => {
106
+ var i;
107
+ return t.enableMermaid && ((i = t.language) == null ? void 0 : i.toLowerCase()) === "mermaid";
108
+ }), m = Q(() => {
109
+ try {
110
+ const i = t.code.indexOf('<span class="mc-typewriter');
111
+ let e;
112
+ return t.language && A.getLanguage(t.language) ? i !== -1 ? e = A.highlight(t.code.slice(0, i), { language: t.language }).value + t.code.slice(i) : e = A.highlight(t.code, { language: t.language }).value : typeof A.highlightAuto !== void 0 ? i !== -1 ? e = A.highlightAuto(t.code.slice(0, i)).value + t.code.slice(i) : e = A.highlightAuto(t.code).value : e = a.filterHtml(t.code), e;
113
+ } catch {
114
+ }
115
+ }), f = D(null), x = () => {
116
+ var e;
117
+ const i = (e = f.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
118
+ i && n && n.zoomIn(i);
119
+ }, k = () => {
120
+ var e;
121
+ const i = (e = f.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
122
+ i && n && n.zoomOut(i);
123
+ }, L = () => {
124
+ var e;
125
+ const i = (e = f.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
126
+ i && n && n.download(i);
127
+ }, _ = async () => {
128
+ if (!(!g.value || !t.code)) {
129
+ if (!n)
130
+ try {
131
+ const { MermaidService: i } = await import("./MermaidService-yeLQUW_e.js"), e = {
132
+ theme: t.theme === "dark" ? "dark" : "default",
133
+ ...t.mermaidConfig
134
+ };
135
+ n = new i(e);
136
+ } catch (i) {
137
+ console.error("Failed to load MermaidService:", i);
138
+ return;
139
+ }
140
+ W(async () => {
141
+ var e;
142
+ const i = (e = f.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
143
+ i && await n.renderToContainer(i, t.code.replace(/<span[^>]*\bclass\s*=\s*['"]mc-typewriter[^>]*>([\s\S]*?)<\/span>/g, "$1"), t.theme);
144
+ });
145
+ }
146
+ }, S = () => {
147
+ c.value = !c.value;
148
+ }, P = Oe((i) => {
149
+ const e = i.target;
91
150
  if (navigator.clipboard)
92
151
  navigator.clipboard.writeText(t.code);
93
152
  else {
94
- const c = document.createElement("textarea");
95
- c.style.position = "fixed", c.style.top = "-9999px", c.style.left = "-9999px", c.style.zIndex = "-1", c.value = t.code, document.body.appendChild(c), c.select(), document.execCommand("copy"), document.body.removeChild(c);
153
+ const l = document.createElement("textarea");
154
+ l.style.position = "fixed", l.style.top = "-9999px", l.style.left = "-9999px", l.style.zIndex = "-1", l.value = t.code, document.body.appendChild(l), l.select(), document.execCommand("copy"), document.body.removeChild(l);
96
155
  }
97
- g.classList.remove("icon-copy-new"), s.value = !0, setTimeout(() => {
98
- s.value = !1;
156
+ e.classList.remove("icon-copy-new"), d.value = !0, setTimeout(() => {
157
+ d.value = !1;
99
158
  }, 1500);
100
- }, 300), A = (e) => {
101
- e.dataset || (e.dataset = {}), e.style.height && (e.dataset.height = e.style.height), e.style.maxHeight = 0;
102
- }, p = (e) => {
159
+ }, 300), $ = (i) => {
160
+ i.dataset || (i.dataset = {}), i.style.height && (i.dataset.height = i.style.height), i.style.maxHeight = 0;
161
+ }, X = (i) => {
103
162
  requestAnimationFrame(() => {
104
- e.dataset.oldOverflow = e.style.overflow, e.dataset.height ? e.style.maxHeight = e.dataset.height : e.scrollHeight !== 0 ? e.style.maxHeight = `${e.scrollHeight}px` : e.style.maxHeight = 0, e.style.overflow = "hidden";
163
+ i.dataset.oldOverflow = i.style.overflow, i.dataset.height ? i.style.maxHeight = i.dataset.height : i.scrollHeight !== 0 ? i.style.maxHeight = `${i.scrollHeight}px` : i.style.maxHeight = 0, i.style.overflow = "hidden";
105
164
  });
106
- }, k = (e) => {
107
- e.style.maxHeight = "", e.style.overflow = e.dataset.oldOverflow;
108
- }, i = (e) => {
109
- e.dataset || (e.dataset = {}), e.dataset.oldOverflow = e.style.overflow, e.style.maxHeight = `${e.scrollHeight}px`, e.style.overflow = "hidden";
110
- }, n = (e) => {
111
- e.scrollHeight !== 0 && (e.style.maxHeight = 0);
112
- }, d = (e) => {
113
- e.style.maxHeight = "", e.style.overflow = e.dataset.oldOverflow;
114
- }, h = y(() => t.theme === "dark" ? "mc-code-block-dark" : "mc-code-block-light");
115
- return (e, g) => (I(), u(
165
+ }, H = (i) => {
166
+ i.style.maxHeight = "", i.style.overflow = i.dataset.oldOverflow;
167
+ }, B = (i) => {
168
+ i.dataset || (i.dataset = {}), i.dataset.oldOverflow = i.style.overflow, i.style.maxHeight = `${i.scrollHeight}px`, i.style.overflow = "hidden";
169
+ }, R = (i) => {
170
+ i.scrollHeight !== 0 && (i.style.maxHeight = 0);
171
+ }, K = (i) => {
172
+ i.style.maxHeight = "", i.style.overflow = i.dataset.oldOverflow;
173
+ }, V = Q(() => t.theme === "dark" ? "mc-code-block-dark" : "mc-code-block-light");
174
+ return E(() => [t.code, t.theme, t.enableMermaid], () => {
175
+ g.value && W(() => {
176
+ _();
177
+ });
178
+ }, { immediate: !0 }), E(
179
+ () => r.value,
180
+ (i) => {
181
+ i && g.value && W(() => {
182
+ _();
183
+ });
184
+ }
185
+ ), ge(() => {
186
+ g.value && _();
187
+ }), (i, e) => (M(), I(
116
188
  "div",
117
189
  {
118
- class: x(["mc-code-block", h.value])
190
+ class: O(["mc-code-block", V.value]),
191
+ ref_key: "rootRef",
192
+ ref: f
119
193
  },
120
194
  [
121
- e.$slots.header ? T(e.$slots, "header", { key: 1 }, void 0, !0) : (I(), u("div", oe, [
122
- D(
195
+ i.$slots.header ? q(i.$slots, "header", { key: 1 }, void 0, !0) : (M(), I("div", Ye, [
196
+ C(
123
197
  "span",
124
- ne,
125
- P(l.language),
198
+ Qe,
199
+ J(o.language),
126
200
  1
127
201
  /* TEXT */
128
202
  ),
129
- T(e.$slots, "actions", {}, () => [
130
- D("div", ce, [
131
- D("div", {
203
+ q(i.$slots, "actions", {}, () => [
204
+ C("div", Fe, [
205
+ g.value ? (M(), I("div", Ge, [
206
+ C(
207
+ "ul",
208
+ {
209
+ class: O(["mc-diagram-switch", { "mc-show-code": !r.value }])
210
+ },
211
+ [
212
+ C(
213
+ "li",
214
+ {
215
+ onClick: e[0] || (e[0] = (l) => r.value = !0),
216
+ class: O({ "mc-diagram-switch-active": r.value })
217
+ },
218
+ J(T(s)("Md.diagram")),
219
+ 3
220
+ /* TEXT, CLASS */
221
+ ),
222
+ C(
223
+ "li",
224
+ {
225
+ onClick: e[1] || (e[1] = (l) => r.value = !1),
226
+ class: O({ "mc-diagram-switch-active": !r.value })
227
+ },
228
+ J(T(s)("Md.code")),
229
+ 3
230
+ /* TEXT, CLASS */
231
+ )
232
+ ],
233
+ 2
234
+ /* CLASS */
235
+ )
236
+ ])) : z("v-if", !0),
237
+ g.value && r.value ? (M(), I("div", {
238
+ key: 1,
239
+ class: "mc-action-btn mc-toggle-btn",
240
+ title: T(s)("Md.zoomIn"),
241
+ onClick: x
242
+ }, e[3] || (e[3] = [
243
+ C(
244
+ "img",
245
+ { src: Ue },
246
+ null,
247
+ -1
248
+ /* HOISTED */
249
+ )
250
+ ]), 8, $e)) : z("v-if", !0),
251
+ g.value && r.value ? (M(), I("div", {
252
+ key: 2,
253
+ class: "mc-action-btn mc-toggle-btn",
254
+ title: T(s)("Md.zoomOut"),
255
+ onClick: k
256
+ }, e[4] || (e[4] = [
257
+ C(
258
+ "img",
259
+ { src: ze },
260
+ null,
261
+ -1
262
+ /* HOISTED */
263
+ )
264
+ ]), 8, Xe)) : z("v-if", !0),
265
+ g.value && r.value ? (M(), I("div", {
266
+ key: 3,
267
+ class: "mc-action-btn mc-toggle-btn",
268
+ title: T(s)("Md.downLoad"),
269
+ onClick: L
270
+ }, e[5] || (e[5] = [
271
+ C(
272
+ "img",
273
+ { src: We },
274
+ null,
275
+ -1
276
+ /* HOISTED */
277
+ )
278
+ ]), 8, Re)) : z("v-if", !0),
279
+ C("div", {
132
280
  class: "mc-action-btn mc-toggle-btn",
133
- onClick: a
134
- }, g[1] || (g[1] = [
135
- D(
281
+ title: T(s)("Md.toggle"),
282
+ onClick: S
283
+ }, e[6] || (e[6] = [
284
+ C(
136
285
  "img",
137
- { src: te },
286
+ { src: Pe },
138
287
  null,
139
288
  -1
140
289
  /* HOISTED */
141
290
  )
142
- ])),
143
- D("div", {
291
+ ]), 8, Ke),
292
+ C("div", {
144
293
  class: "mc-action-btn mc-copy-btn",
145
- onClick: g[0] || (g[0] = //@ts-ignore
146
- (...c) => b(M) && b(M)(...c))
294
+ title: T(s)("Md.copy"),
295
+ onClick: e[2] || (e[2] = //@ts-ignore
296
+ (...l) => T(P) && T(P)(...l))
147
297
  }, [
148
- s.value ? (I(), u("img", re)) : (I(), u("img", ae))
149
- ])
298
+ d.value ? (M(), I("img", qe)) : (M(), I("img", Je))
299
+ ], 8, Ve)
150
300
  ])
151
301
  ], !0)
152
302
  ])),
153
- Q(G, {
303
+ Ie(Le, {
154
304
  name: "collapse-transition",
155
- onBeforeEnter: A,
156
- onEnter: p,
157
- onAfterEnter: k,
158
- onBeforeLeave: i,
159
- onLeave: n,
160
- onAfterLeave: d
305
+ onBeforeEnter: $,
306
+ onEnter: X,
307
+ onAfterEnter: H,
308
+ onBeforeLeave: B,
309
+ onLeave: R,
310
+ onAfterLeave: K,
311
+ persisted: ""
161
312
  }, {
162
- default: H(() => [
163
- r.value ? (I(), u("div", le, [
164
- e.$slots.content ? T(e.$slots, "content", { key: 1 }, void 0, !0) : (I(), u("pre", de, [
165
- D("code", {
166
- class: x(`hljs language-${l.language}`),
167
- innerHTML: m.value
168
- }, null, 10, ge)
169
- ]))
170
- ])) : U("v-if", !0)
313
+ default: Ne(() => [
314
+ Te(C(
315
+ "div",
316
+ null,
317
+ [
318
+ g.value && r.value && !i.$slots.content ? (M(), I("div", et)) : i.$slots.content ? q(i.$slots, "content", { key: 2 }, void 0, !0) : (M(), I("pre", tt, [
319
+ C("code", {
320
+ class: O(`hljs language-${o.language}`),
321
+ innerHTML: m.value
322
+ }, null, 10, st)
323
+ ]))
324
+ ],
325
+ 512
326
+ /* NEED_PATCH */
327
+ ), [
328
+ [De, c.value]
329
+ ])
171
330
  ]),
172
331
  _: 3
173
332
  /* FORWARDED */
@@ -177,20 +336,38 @@ const oe = {
177
336
  /* CLASS */
178
337
  ));
179
338
  }
180
- }), z = (l, t) => {
181
- const o = l.__vccOpts || l;
182
- for (const [r, s] of t)
183
- o[r] = s;
184
- return o;
185
- }, he = /* @__PURE__ */ z(Me, [["__scopeId", "data-v-675aa633"]]), Ie = {
339
+ }), me = (o, t) => {
340
+ const s = o.__vccOpts || o;
341
+ for (const [a, n] of t)
342
+ s[a] = n;
343
+ return s;
344
+ }, it = /* @__PURE__ */ me(nt, [["__scopeId", "data-v-871cb018"]]), ot = {
186
345
  content: {
187
346
  type: String,
188
347
  default: ""
189
348
  },
349
+ typing: {
350
+ type: Boolean,
351
+ default: !1
352
+ },
190
353
  enableThink: {
191
354
  type: Boolean,
192
355
  default: !1
193
356
  },
357
+ typingOptions: {
358
+ step: {
359
+ type: Number,
360
+ default: 2
361
+ },
362
+ interval: {
363
+ type: [Number, Array],
364
+ default: 60
365
+ },
366
+ style: {
367
+ type: String,
368
+ default: "normal"
369
+ }
370
+ },
194
371
  thinkOptions: {
195
372
  customClass: {
196
373
  type: String,
@@ -212,145 +389,503 @@ const oe = {
212
389
  theme: {
213
390
  type: String,
214
391
  default: "light"
392
+ },
393
+ enableMermaid: {
394
+ type: Boolean,
395
+ default: !1
396
+ },
397
+ mermaidConfig: {
398
+ type: Object,
399
+ default: () => ({})
400
+ }
401
+ }, G = {
402
+ step: 2,
403
+ interval: 50,
404
+ style: "normal"
405
+ }, rt = (o) => {
406
+ const t = o.content || "";
407
+ if (t.match(/<(\w+)[^>]*\/>/))
408
+ return !0;
409
+ const s = [], a = /<(\w+)[^>]*>/g, n = /<\/(\w+)>/g;
410
+ let c, d;
411
+ a.lastIndex = 0, n.lastIndex = 0;
412
+ const r = [];
413
+ for (; (c = a.exec(t)) !== null; )
414
+ r.push({
415
+ type: "open",
416
+ tagName: c[1],
417
+ index: c.index
418
+ });
419
+ for (; (d = n.exec(t)) !== null; )
420
+ r.push({
421
+ type: "close",
422
+ tagName: d[1],
423
+ index: d.index
424
+ });
425
+ r.sort((g, m) => g.index - m.index);
426
+ for (const g of r)
427
+ if (g.type === "open")
428
+ s.push(g.tagName);
429
+ else {
430
+ if (s.length === 0 || s[s.length - 1] !== g.tagName)
431
+ return !1;
432
+ s.pop();
433
+ }
434
+ return s.length === 0;
435
+ }, at = (o, t) => {
436
+ const s = (o == null ? void 0 : o.content) || "", a = (t == null ? void 0 : t.content) || "", n = s.match(/<(\w+)/), c = a.match(/<\/(\w+)/);
437
+ return n && c ? n[1] === c[1] : !1;
438
+ }, ee = (o) => ({
439
+ nodeType: o ? o.type.replace("_open", "") : "root",
440
+ openNode: o,
441
+ closeNode: null,
442
+ children: [],
443
+ vNodeKey: (o == null ? void 0 : o.vNodeKey) || ""
444
+ }), lt = (o, t) => {
445
+ const s = o.content.startsWith("</");
446
+ if (!t.length) {
447
+ o.nesting = s ? 0 : 1, t.push(o);
448
+ return;
449
+ }
450
+ const a = t[t.length - 1];
451
+ at(a, o) ? (o.nesting = -1, t.pop()) : s ? o.nesting = 0 : (o.nesting = 1, t.push(o));
452
+ }, F = (o) => {
453
+ if (!o) return !1;
454
+ try {
455
+ return document.createElement(o), !0;
456
+ } catch {
457
+ return !1;
458
+ }
459
+ }, ye = (o) => {
460
+ const t = (r) => {
461
+ const g = ee(r);
462
+ return r.children && r.children.length > 0 && (g.children = ye(r.children)), g;
463
+ }, s = ee(null);
464
+ let a = s;
465
+ const n = [], c = [], d = [];
466
+ return o.forEach((r, g) => {
467
+ if (r.vNodeKey = `mc-markdown-content-key-${g}`, r.tokenIndex = g, r.type.includes("html_")) {
468
+ if (rt(r)) {
469
+ r.nesting = 0;
470
+ return;
471
+ }
472
+ const m = r.type === "html_block" ? d : c;
473
+ lt(r, m);
474
+ }
475
+ }), o.forEach((r, g) => {
476
+ let m;
477
+ if (r.nesting === 1)
478
+ m = ee(r), a.children.push(m), n.push(a), a = m;
479
+ else if (r.nesting === -1) {
480
+ if (a.closeNode = r, !n.length)
481
+ throw new Error("AST stack underflow.");
482
+ m = n.pop(), a = m;
483
+ } else if (r.nesting === 0)
484
+ if (r.type === "inline" && r.children && r.children.length > 0) {
485
+ const f = t(r);
486
+ a.children.push(f);
487
+ } else
488
+ a.children.push(r);
489
+ else
490
+ throw new Error(`Invalid nesting level found in token index ${g}.`);
491
+ }), s.children;
492
+ }, Y = (o) => {
493
+ if (!o || !o.trim()) return [];
494
+ if (typeof window > "u" || typeof DOMParser > "u")
495
+ return [o];
496
+ const s = new DOMParser().parseFromString(`<body>${o}</body>`, "text/html"), a = [];
497
+ return s.body.childNodes.forEach((n, c) => {
498
+ const d = fe(n);
499
+ (ue(d) || typeof d == "string") && (typeof d == "object" && (d.key = c), a.push(d));
500
+ }), a;
501
+ }, fe = (o) => {
502
+ if (o.nodeType === Node.TEXT_NODE) return o.textContent;
503
+ if (o.nodeType !== Node.ELEMENT_NODE) return o.textContent || "";
504
+ const t = o, s = {};
505
+ if (t.hasAttributes() && t.attributes)
506
+ for (const n of Array.from(t.attributes))
507
+ s[n.name] = n.value;
508
+ const a = [];
509
+ return t.childNodes.length > 0 && t.childNodes.forEach((n) => {
510
+ const c = fe(n);
511
+ (ue(c) || typeof c == "string") && a.push(c);
512
+ }), F(t.tagName) ? y(t.tagName.toLowerCase(), s, a) : (o == null ? void 0 : o.textContent) || "";
513
+ };
514
+ function ct() {
515
+ const o = xe({});
516
+ return {
517
+ getCache: (t) => o[t],
518
+ getCaches: () => ({ ...o }),
519
+ setCache: (t, s) => {
520
+ o[t] = s;
521
+ },
522
+ nextTick: W
523
+ };
524
+ }
525
+ function dt({
526
+ adapter: o,
527
+ foundationClass: t
528
+ }) {
529
+ const s = D(null), a = () => (s.value || (s.value = new t(o), typeof s.value.init == "function" && s.value.init()), s.value), n = () => {
530
+ s.value && (typeof s.value.destroy == "function" && s.value.destroy(), s.value = null);
531
+ };
532
+ return Ae(() => {
533
+ n();
534
+ }), {
535
+ foundation: a(),
536
+ destroyFoundation: n
537
+ };
538
+ }
539
+ const v = () => {
540
+ };
541
+ class te {
542
+ constructor(t) {
543
+ N(this, "_adapter");
544
+ this._adapter = { ...te.defaultAdapter, ...t };
215
545
  }
216
- }, ue = /* @__PURE__ */ E({
546
+ static get cssClasses() {
547
+ return {};
548
+ }
549
+ static get strings() {
550
+ return {};
551
+ }
552
+ static get numbers() {
553
+ return {};
554
+ }
555
+ static get defaultAdapter() {
556
+ return {
557
+ getProp: v,
558
+ getProps: v,
559
+ getState: v,
560
+ getStates: v,
561
+ setState: v,
562
+ getContext: v,
563
+ getContexts: v,
564
+ getCache: v,
565
+ setCache: v,
566
+ getCaches: v,
567
+ stopPropagation: v
568
+ };
569
+ }
570
+ getProp(t) {
571
+ return this._adapter.getProp(t);
572
+ }
573
+ getProps() {
574
+ return this._adapter.getProps();
575
+ }
576
+ getState(t) {
577
+ return this._adapter.getState(t);
578
+ }
579
+ getStates() {
580
+ return this._adapter.getStates();
581
+ }
582
+ setState(t, s) {
583
+ return this._adapter.setState({ ...t }, s);
584
+ }
585
+ /* istanbul ignore next */
586
+ getCaches() {
587
+ return this._adapter.getCaches();
588
+ }
589
+ getCache(t) {
590
+ return this._adapter.getCache(t);
591
+ }
592
+ setCache(t, s) {
593
+ return t && this._adapter.setCache(t, s);
594
+ }
595
+ nextTick(t) {
596
+ return this._adapter.nextTick(t);
597
+ }
598
+ _isInProps(t) {
599
+ const s = this.getProps();
600
+ return t in s;
601
+ }
602
+ init(t) {
603
+ }
604
+ destroy() {
605
+ }
606
+ }
607
+ class gt extends te {
608
+ constructor(s) {
609
+ super({ ...s });
610
+ N(this, "isToken", (s) => "type" in s && "content" in s);
611
+ N(this, "typewriterEnd", () => {
612
+ var s, a;
613
+ this.setState({ isTyping: !1 }), (a = (s = this._adapter).typingEnd) == null || a.call(s);
614
+ });
615
+ N(this, "getThinkContent", (s, a) => {
616
+ var c;
617
+ const n = (a == null ? void 0 : a.customClass) || "mc-think-block";
618
+ return ((c = s == null ? void 0 : s.replace("<think>", `<div class="${n}">`)) == null ? void 0 : c.replace("</think>", `
619
+ </div>`)) || "";
620
+ });
621
+ N(this, "parseTypingContent", (s) => {
622
+ const { typingOptions: a } = this.getProps(), { typingIndex: n } = this.getStates();
623
+ s = s.slice(0, n) || "";
624
+ const c = { ...G, ...a };
625
+ return c.style === "cursor" ? s += '<span class="mc-typewriter mc-typewriter-cursor">|</span>' : (c.style === "color" || c.style === "gradient") && (s = s.slice(0, -5) + `<span class="mc-typewriter mc-typewriter-${c.style}">${s.slice(-5)}</span>`), s || "";
626
+ });
627
+ N(this, "parseContent", () => {
628
+ const { content: s, thinkOptions: a, enableThink: n } = this.getProps(), { typing: c, isTyping: d } = this.getStates();
629
+ let r = s || "";
630
+ c && d && (r = this.parseTypingContent(s)), n && (r = this.getThinkContent(s, a)), r = this._adapter.parseContent(r);
631
+ });
632
+ N(this, "typewriterStart", () => {
633
+ var r, g;
634
+ const { typingOptions: s } = this.getProps(), { timer: a } = this.getStates();
635
+ a && clearTimeout(a), this.setState({ isTyping: !0 }), (g = (r = this._adapter).typingStart) == null || g.call(r);
636
+ const n = { ...G, ...s }, c = () => {
637
+ const { typingIndex: m, content: f } = this.getStates();
638
+ let x = n.step || 2;
639
+ Array.isArray(n.step) && (x = n.step[0] + Math.floor(Math.random() * (n.step[1] - n.step[0])));
640
+ let k = m + x;
641
+ if (this.setState({ typingIndex: k }), this.parseContent(), this._adapter.typingEvent(), k >= f.length) {
642
+ this.typewriterEnd(), this.parseContent();
643
+ return;
644
+ }
645
+ let L = setTimeout(
646
+ c,
647
+ typeof n.interval == "number" ? n.interval : 50
648
+ );
649
+ this.setState({
650
+ timer: L
651
+ });
652
+ };
653
+ let d = setTimeout(c);
654
+ this.setState({
655
+ timer: d
656
+ });
657
+ });
658
+ }
659
+ }
660
+ function ut({
661
+ props: o,
662
+ emit: t
663
+ }) {
664
+ const { t: s } = pe(), n = {
665
+ ...ct(),
666
+ getProps: () => o,
667
+ getProp: (d) => o[d],
668
+ getStates: () => ({}),
669
+ getState: (d) => {
670
+ },
671
+ setState: (d, r) => {
672
+ },
673
+ locale: (d, r) => s(d, r),
674
+ typingStart: () => t("typingStart"),
675
+ typingEnd: () => t("typingEnd"),
676
+ typingEvent: () => t("typingEvent"),
677
+ parseContent: (d) => {
678
+ }
679
+ // todo
680
+ }, { foundation: c } = dt({
681
+ adapter: n,
682
+ foundationClass: gt
683
+ });
684
+ return {
685
+ foundation: c
686
+ };
687
+ }
688
+ const pt = /* @__PURE__ */ de({
217
689
  __name: "mdCard",
218
- props: Ie,
219
- emits: ["afterMdtInit"],
220
- setup(l, { expose: t, emit: o }) {
221
- const r = new W(), s = l, m = o, a = Z(), M = K({
690
+ props: ot,
691
+ emits: ["afterMdtInit", "typingStart", "typing", "typingEnd"],
692
+ setup(o, { expose: t, emit: s }) {
693
+ const a = new he(), n = o, c = s, d = ke();
694
+ let r = null;
695
+ const g = je({
222
696
  breaks: !0,
223
697
  linkify: !0,
224
698
  html: !0,
225
- highlight: (i, n) => {
226
- if (n && C.getLanguage(n))
699
+ highlight: (e, l) => {
700
+ if (l && A.getLanguage(l))
227
701
  try {
228
- return C.highlight(i, { language: n }).value;
702
+ return A.highlight(e, { language: l }).value;
229
703
  } catch {
230
704
  }
231
705
  return "";
232
706
  },
233
- ...s.mdOptions
234
- });
235
- M.renderer.rules.fence = (i, n) => `<!----MC_MARKDOWN_CODE_BLOCK_${n}---->`;
236
- const A = (i, n, d) => {
237
- const h = {
238
- actions: () => {
239
- var e;
240
- return (e = a.actions) == null ? void 0 : e.call(a, {
241
- codeBlockData: {
242
- code: n,
243
- language: i
244
- }
245
- });
246
- }
247
- };
248
- return a.header && (h.header = () => {
249
- var e;
250
- return (e = a.header) == null ? void 0 : e.call(a, {
251
- codeBlockData: {
252
- code: n,
253
- language: i
254
- }
707
+ ...n.mdOptions
708
+ }), { foundation: m } = ut({
709
+ props: n,
710
+ emit: c
711
+ }), f = D(0), x = D(!1), k = D(), L = () => {
712
+ let e = n.content || "";
713
+ if (n.typing && x.value) {
714
+ e = n.content.slice(0, f.value) || "";
715
+ const h = { ...G, ...n == null ? void 0 : n.typingOptions };
716
+ h.style === "cursor" ? e += '<span class="mc-typewriter mc-typewriter-cursor">|</span>' : (h.style === "color" || h.style === "gradient") && (e = e.slice(0, -5) + `<span class="mc-typewriter mc-typewriter-${h.style}">${e.slice(-5)}</span>`);
717
+ }
718
+ n.enableThink && (e = m.getThinkContent(e, n.thinkOptions));
719
+ const l = g.parse(e, {}), u = ye(l), p = _(u);
720
+ k.value = y(j, p);
721
+ }, _ = (e) => e.map((l) => S(l)), S = (e) => {
722
+ var l;
723
+ if (e.nodeType === "html_inline" || e.nodeType === "html_block") {
724
+ const u = a.filterHtml(((l = e.openNode) == null ? void 0 : l.content) || ""), p = Y(u);
725
+ if (!p || p.length === 0)
726
+ return y("span", u);
727
+ const h = p.map((w) => {
728
+ if (typeof w == "string")
729
+ return y("span", w);
730
+ const U = e.children.map((b) => S(b));
731
+ return Array.isArray(w.children) ? w.children = [...w.children, ...U] : w.children = [w.children, ...U].filter((b) => b), w;
255
732
  });
256
- }), a.content && (h.content = () => {
733
+ return y(j, h);
734
+ }
735
+ if (e.nodeType === "inline") {
736
+ const u = g.renderer.render([e.openNode], g.options, {}), p = a.filterHtml(u), h = Y(p);
737
+ return y(j, h);
738
+ }
739
+ return m.isToken(e) ? P(e) : X(e);
740
+ }, P = (e) => {
741
+ if (e.type === "text")
742
+ return e.content;
743
+ if (e.type === "inline")
744
+ return $(e);
745
+ if (e.type === "fence")
746
+ return H(e);
747
+ if (e.type === "softbreak")
748
+ return g.options.breaks ? y("br") : `
749
+ `;
750
+ if (e.type === "html_block" || e.type === "html_inline") {
751
+ const l = a.filterHtml(e.content);
752
+ return e.type === "html_block" ? y("div", { innerHTML: l }) : y("span", { innerHTML: l });
753
+ }
754
+ if (e.type === "math_block" && e.markup === "$$") {
755
+ const l = g.renderer.render([e], g.options, {}), u = a.filterHtml(l), p = Y(u);
756
+ return y(j, p);
757
+ }
758
+ if (e.tag) {
759
+ const l = F(e.tag) ? e.tag : "div", u = B(e.attrs || []);
760
+ return y(l, { ...u, key: e.vNodeKey }, e.content);
761
+ }
762
+ return e.content;
763
+ }, $ = (e) => {
764
+ const l = g.renderer.render([e], g.options, {}), u = a.filterHtml(l), p = Y(u);
765
+ return y(j, p);
766
+ }, X = (e) => {
767
+ var h, w, U, b, se, ne, ie, oe, re;
768
+ let l = "div";
769
+ (h = e.openNode) != null && h.tag && F((w = e.openNode) == null ? void 0 : w.tag) && (l = (U = e.openNode) == null ? void 0 : U.tag);
770
+ const u = B(((b = e.openNode) == null ? void 0 : b.attrs) || []);
771
+ if (((se = e.openNode) == null ? void 0 : se.type) === "fence")
772
+ return H(e.openNode);
773
+ if ((ne = e.openNode) != null && ne.tag) {
774
+ let Z = F((ie = e.openNode) == null ? void 0 : ie.tag) ? (oe = e.openNode) == null ? void 0 : oe.tag : "div";
775
+ const Ce = e.children.map((le) => S(le)), Me = B(((re = e.openNode) == null ? void 0 : re.attrs) || []), ae = y(Z, { ...Me, key: e.vNodeKey }, Ce);
776
+ return Z === "table" ? y("div", { className: "mc-table-container", key: `${e.vNodeKey}-table-container` }, [ae]) : ae;
777
+ }
778
+ const p = e.children.map((Z) => S(Z));
779
+ return y(l, { ...u, key: e.vNodeKey }, p);
780
+ }, H = (e) => {
781
+ var p;
782
+ const l = ((p = e.info) == null ? void 0 : p.replace(/<span\b[^>]*>/i, "").replace("</span>", "")) || "", u = e.content;
783
+ return R(l, u, e.tokenIndex);
784
+ }, B = (e) => e.reduce((l, [u, p]) => (l[u] = p, l), {});
785
+ E(
786
+ () => {
257
787
  var e;
258
- return (e = a.content) == null ? void 0 : e.call(a, {
259
- codeBlockData: {
260
- code: n,
261
- language: i
262
- }
263
- });
264
- }), w(
265
- he,
788
+ return [n.enableThink, (e = n.thinkOptions) == null ? void 0 : e.customClass, n.theme];
789
+ },
790
+ () => {
791
+ L();
792
+ }
793
+ );
794
+ const R = (e, l, u) => {
795
+ const p = {
796
+ actions: d.actions ? () => {
797
+ var h;
798
+ return ((h = d.actions) == null ? void 0 : h.call(d, { codeBlockData: { code: l, language: e } })) || null;
799
+ } : void 0,
800
+ header: d.header ? () => {
801
+ var h;
802
+ return ((h = d.header) == null ? void 0 : h.call(d, { codeBlockData: { code: l, language: e } })) || null;
803
+ } : void 0,
804
+ content: d.content ? () => {
805
+ var h;
806
+ return ((h = d.content) == null ? void 0 : h.call(d, { codeBlockData: { code: l, language: e } })) || null;
807
+ } : void 0
808
+ };
809
+ return y(
810
+ it,
266
811
  {
267
- language: i,
268
- code: n,
269
- blockIndex: d,
270
- theme: s.theme
812
+ language: e,
813
+ code: l,
814
+ blockIndex: u,
815
+ theme: n.theme,
816
+ enableMermaid: n.enableMermaid,
817
+ mermaidConfig: n.mermaidConfig,
818
+ key: `code-block-${u}`
271
819
  },
272
- h
820
+ p
273
821
  );
274
- }, p = y(() => {
275
- var h, e;
276
- let i = s.content || "";
277
- if (s.enableThink) {
278
- const g = ((h = s.thinkOptions) == null ? void 0 : h.customClass) || "mc-think-block";
279
- i = ((e = s.content) == null ? void 0 : e.replace("<think>", `<div class="${g}">`).replace("</think>", "</div>")) || "";
280
- }
281
- const n = M.parse(i, {}), d = M.render(i);
282
- return {
283
- name: "MarkdownRenderer",
284
- render() {
285
- if (typeof document > "u")
286
- return;
287
- const g = document.createElement("div");
288
- g.innerHTML = d;
289
- const c = [];
290
- let L = 0, N;
291
- const f = /<!----MC_MARKDOWN_CODE_BLOCK_(\d+)---->/g;
292
- let j = 0;
293
- for (; N = f.exec(d), !!N; ) {
294
- N.index > L && c.push(
295
- w("div", {
296
- innerHTML: d.slice(L, N.index)
297
- })
298
- );
299
- const v = n[Number.parseInt(N[1])], _ = v.info || "", Y = v.content;
300
- c.push(A(_, Y, j)), j++, L = f.lastIndex;
301
- }
302
- return L < d.length && c.push(
303
- w("div", {
304
- innerHTML: d.slice(L)
305
- })
306
- ), w("div", c);
822
+ }, K = () => {
823
+ clearTimeout(r), x.value = !0, c("typingStart");
824
+ const e = { ...G, ...n == null ? void 0 : n.typingOptions }, l = () => {
825
+ let u = e.step;
826
+ if (Array.isArray(e.step) && (u = e.step[0] + Math.floor(Math.random() * (e.step[1] - e.step[0]))), f.value += u, L(), c("typing"), f.value >= n.content.length) {
827
+ V(), L();
828
+ return;
307
829
  }
830
+ r = setTimeout(l, e.interval);
308
831
  };
309
- });
310
- S(
311
- () => s.customXssRules,
312
- (i) => {
313
- r.setCustomXssRules(i);
314
- }
315
- ), S(
316
- () => s.mdPlugins,
317
- (i) => {
318
- r.setMdPlugins(i, M);
832
+ r = setTimeout(l);
833
+ };
834
+ E(
835
+ () => n.content,
836
+ (e, l) => {
837
+ if (!n.typing) {
838
+ f.value = (e == null ? void 0 : e.length) || 0, L();
839
+ return;
840
+ }
841
+ e.indexOf(l) === -1 && (f.value = 0), W(() => K());
319
842
  },
320
- {
321
- immediate: !0
322
- }
843
+ { immediate: !0 }
844
+ );
845
+ const V = () => {
846
+ x.value = !1, c("typingEnd");
847
+ };
848
+ E(
849
+ () => n.customXssRules,
850
+ (e) => {
851
+ a.setCustomXssRules(e), L();
852
+ },
853
+ { deep: !1, immediate: !0 }
854
+ ), E(
855
+ () => n.mdPlugins,
856
+ (e) => {
857
+ a.setMdPlugins(e, g), L();
858
+ },
859
+ { immediate: !0, deep: !1 }
323
860
  );
324
- const k = y(() => s.theme === "dark" ? "mc-markdown-render-dark" : "mc-markdown-render-light");
325
- return X(() => {
326
- m("afterMdtInit", M);
327
- }), t({
328
- mdt: M
329
- }), (i, n) => (I(), u(
330
- R,
861
+ const i = Q(() => n.theme === "dark" ? "mc-markdown-render-dark" : "mc-markdown-render-light");
862
+ return ge(() => {
863
+ c("afterMdtInit", g);
864
+ }), t({ mdt: g }), (e, l) => (M(), I(
865
+ j,
331
866
  null,
332
867
  [
333
- D(
868
+ C(
334
869
  "div",
335
870
  {
336
- class: x(["mc-markdown-render", k.value])
871
+ class: O(["mc-markdown-render", i.value])
337
872
  },
338
873
  [
339
- (I(), F(V(p.value)))
874
+ (M(), Se(be(k.value)))
340
875
  ],
341
876
  2
342
877
  /* CLASS */
343
878
  ),
344
- U("v-if", !0)
879
+ z("v-if", !0)
345
880
  ],
346
881
  64
347
882
  /* STABLE_FRAGMENT */
348
883
  ));
349
884
  }
350
- }), B = /* @__PURE__ */ z(ue, [["__scopeId", "data-v-0183c1e8"]]);
351
- B.install = (l) => {
352
- l.component("McMarkdownCard", B);
885
+ }), ce = /* @__PURE__ */ me(pt, [["__scopeId", "data-v-8063b2f5"]]);
886
+ ce.install = (o) => {
887
+ o.component("McMarkdownCard", ce);
353
888
  };
354
889
  export {
355
- B as McMarkdownCard
890
+ ce as McMarkdownCard
356
891
  };