@matechat/core 1.11.1 → 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.
- package/Attachment/Attachment.vue.d.ts +8 -8
- package/Attachment/attachment-types.d.ts +3 -35
- package/Attachment/index.css +1 -1
- package/Attachment/index.js +43 -45
- package/Bubble/index.css +1 -1
- package/Bubble/index.js +276 -146
- package/Bubble/useBubbleFoundation.d.ts +9 -0
- package/FileList/index.js +1 -1
- package/Header/index.css +1 -1
- package/Header/index.js +11 -11
- package/Input/components/EditableBlock.vue.d.ts +2 -2
- package/Input/index.css +1 -1
- package/Input/index.js +82 -57
- package/Introduction/index.css +1 -1
- package/Introduction/index.js +129 -39
- package/Layout/index.js +6 -6
- package/List/index.js +5 -5
- package/MarkdownCard/MDCardParser.d.ts +0 -10
- package/MarkdownCard/MermaidService-yeLQUW_e.js +142 -0
- package/MarkdownCard/index.css +1 -1
- package/MarkdownCard/index.js +542 -361
- package/MarkdownCard/mdCard.types.d.ts +2 -29
- package/MarkdownCard/mdCard.vue.d.ts +2 -2
- package/MarkdownCard/useMarkdownCardFoundation.d.ts +8 -0
- package/Mention/Mention.vue.d.ts +12 -3
- package/Mention/index.css +1 -1
- package/Mention/index.js +364 -110
- package/Mention/mention-types.d.ts +6 -4
- package/Mention/use-mention.d.ts +7 -0
- package/Prompt/index.js +1 -1
- package/Toolbar/index.css +1 -1
- package/Toolbar/index.d.ts +2 -1
- package/Toolbar/index.js +189 -198
- package/Toolbar/toolbar.types.d.ts +2 -26
- package/index.d.ts +2 -2
- package/mate-chat.js +2 -1
- package/package.json +1 -1
- package/Attachment/uploader.d.ts +0 -11
- package/MarkdownCard/MDCardService.d.ts +0 -14
- package/MarkdownCard/MermaidService-B6BcjbW_.js +0 -127
- package/MarkdownCard/MermaidService.d.ts +0 -22
- package/Mention/const.d.ts +0 -4
package/MarkdownCard/index.js
CHANGED
|
@@ -1,41 +1,46 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const ke = "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", je = "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", Se = "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", Oe = "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", Ee = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZnVuY3Rpb24gaWNvbi9jb3B5PC90aX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LDIwNy4wNTAzOTIgNjA0LjU4OTg3NiwyMDcuMDA4MDU2IEw2MDQuNSwyMDcgWiIgaWQ9IuW9oueKtue7k+WQiCIgZmlsbD0iIzcxNzU3RiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=", Be = "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";
|
|
9
|
-
|
|
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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZl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NC41LDIxNSBDNjA0Ljc0NTQ2LDIxNSA2MDQuOTQ5NjA4LDIxNC44MjMxMjUgNjA0Ljk5MTk0NCwyMTQuNTg5ODc2IEw2MDUsMjE0LjUgTDYwNSwyMDcuNSBDNjA1LDIwNy4yNTQ1NCA2MDQuODIzMTI1LDIwNy4wNTAzOTIgNjA0LjU4OTg3NiwyMDcuMDA4MDU2IEw2MDQuNSwyMDcgWiIgaWQ9IuW9oueKtue7k+WQiCIgZmlsbD0iIzcxNzU3RiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=", 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 {
|
|
10
13
|
constructor() {
|
|
11
|
-
this
|
|
14
|
+
N(this, "xssWhiteList", Ee());
|
|
15
|
+
N(this, "cssWhiteList", _e());
|
|
16
|
+
this.setDefaultXss();
|
|
12
17
|
}
|
|
13
18
|
setDefaultXss() {
|
|
14
|
-
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"];
|
|
15
20
|
}
|
|
16
|
-
onIgnoreTagAttr(
|
|
17
|
-
if (!n && (
|
|
18
|
-
return
|
|
21
|
+
onIgnoreTagAttr(t, s, a, n) {
|
|
22
|
+
if (!n && (s === "id" || t === "span" && s === "style"))
|
|
23
|
+
return s + "=" + a;
|
|
19
24
|
}
|
|
20
25
|
getXssWhiteList() {
|
|
21
26
|
return this.xssWhiteList;
|
|
22
27
|
}
|
|
23
|
-
setXssWhiteList(
|
|
24
|
-
this.xssWhiteList =
|
|
28
|
+
setXssWhiteList(t) {
|
|
29
|
+
this.xssWhiteList = t;
|
|
25
30
|
}
|
|
26
|
-
setCustomXssRules(
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
setCustomXssRules(t) {
|
|
32
|
+
t && t.forEach((s) => {
|
|
33
|
+
s.value === null ? delete this.xssWhiteList[s.key] : this.xssWhiteList[s.key] = s.value;
|
|
29
34
|
});
|
|
30
35
|
}
|
|
31
|
-
setMdPlugins(
|
|
32
|
-
|
|
33
|
-
const { plugin: n, opts:
|
|
34
|
-
|
|
36
|
+
setMdPlugins(t, s) {
|
|
37
|
+
t && t.length && t.forEach((a) => {
|
|
38
|
+
const { plugin: n, opts: c } = a;
|
|
39
|
+
s.use(n, c);
|
|
35
40
|
});
|
|
36
41
|
}
|
|
37
|
-
filterHtml(
|
|
38
|
-
return
|
|
42
|
+
filterHtml(t) {
|
|
43
|
+
return Be(t, {
|
|
39
44
|
whiteList: this.xssWhiteList,
|
|
40
45
|
onIgnoreTagAttr: this.onIgnoreTagAttr,
|
|
41
46
|
css: {
|
|
@@ -49,22 +54,22 @@ class de {
|
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
|
-
const
|
|
57
|
+
const Ye = {
|
|
53
58
|
key: 0,
|
|
54
59
|
class: "mc-code-block-header"
|
|
55
|
-
},
|
|
60
|
+
}, Qe = { class: "mc-code-lang" }, Fe = { class: "mc-code-block-actions" }, Ge = {
|
|
56
61
|
key: 0,
|
|
57
62
|
style: { "margin-right": "8px" }
|
|
58
|
-
},
|
|
63
|
+
}, $e = ["title"], Xe = ["title"], Re = ["title"], Ke = ["title"], Ve = ["title"], Je = {
|
|
59
64
|
key: 0,
|
|
60
|
-
src:
|
|
61
|
-
},
|
|
65
|
+
src: He
|
|
66
|
+
}, qe = {
|
|
62
67
|
key: 1,
|
|
63
|
-
src:
|
|
64
|
-
},
|
|
68
|
+
src: Ze
|
|
69
|
+
}, et = {
|
|
65
70
|
key: 0,
|
|
66
71
|
class: "mc-mermaid-content"
|
|
67
|
-
},
|
|
72
|
+
}, tt = { key: 1 }, st = ["innerHTML"], nt = /* @__PURE__ */ de({
|
|
68
73
|
__name: "CodeBlock",
|
|
69
74
|
props: {
|
|
70
75
|
code: {
|
|
@@ -92,135 +97,135 @@ const Ue = {
|
|
|
92
97
|
default: () => ({})
|
|
93
98
|
}
|
|
94
99
|
},
|
|
95
|
-
setup(
|
|
96
|
-
const
|
|
100
|
+
setup(o) {
|
|
101
|
+
const t = o, { t: s } = pe(), a = new he();
|
|
97
102
|
let n = null;
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
var
|
|
102
|
-
return
|
|
103
|
-
}),
|
|
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(() => {
|
|
104
109
|
try {
|
|
105
|
-
const
|
|
110
|
+
const i = t.code.indexOf('<span class="mc-typewriter');
|
|
106
111
|
let e;
|
|
107
|
-
return
|
|
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;
|
|
108
113
|
} catch {
|
|
109
114
|
}
|
|
110
|
-
}),
|
|
115
|
+
}), f = D(null), x = () => {
|
|
111
116
|
var e;
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
},
|
|
117
|
+
const i = (e = f.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
|
|
118
|
+
i && n && n.zoomIn(i);
|
|
119
|
+
}, k = () => {
|
|
115
120
|
var e;
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
},
|
|
121
|
+
const i = (e = f.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
|
|
122
|
+
i && n && n.zoomOut(i);
|
|
123
|
+
}, L = () => {
|
|
119
124
|
var e;
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
if (!(!
|
|
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)) {
|
|
124
129
|
if (!n)
|
|
125
130
|
try {
|
|
126
|
-
const { MermaidService:
|
|
127
|
-
theme:
|
|
128
|
-
...
|
|
131
|
+
const { MermaidService: i } = await import("./MermaidService-yeLQUW_e.js"), e = {
|
|
132
|
+
theme: t.theme === "dark" ? "dark" : "default",
|
|
133
|
+
...t.mermaidConfig
|
|
129
134
|
};
|
|
130
|
-
n = new
|
|
131
|
-
} catch (
|
|
132
|
-
console.error("Failed to load MermaidService:",
|
|
135
|
+
n = new i(e);
|
|
136
|
+
} catch (i) {
|
|
137
|
+
console.error("Failed to load MermaidService:", i);
|
|
133
138
|
return;
|
|
134
139
|
}
|
|
135
|
-
|
|
140
|
+
W(async () => {
|
|
136
141
|
var e;
|
|
137
|
-
const
|
|
138
|
-
|
|
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);
|
|
139
144
|
});
|
|
140
145
|
}
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
const e =
|
|
146
|
+
}, S = () => {
|
|
147
|
+
c.value = !c.value;
|
|
148
|
+
}, P = Oe((i) => {
|
|
149
|
+
const e = i.target;
|
|
145
150
|
if (navigator.clipboard)
|
|
146
|
-
navigator.clipboard.writeText(
|
|
151
|
+
navigator.clipboard.writeText(t.code);
|
|
147
152
|
else {
|
|
148
|
-
const
|
|
149
|
-
|
|
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);
|
|
150
155
|
}
|
|
151
156
|
e.classList.remove("icon-copy-new"), d.value = !0, setTimeout(() => {
|
|
152
157
|
d.value = !1;
|
|
153
158
|
}, 1500);
|
|
154
|
-
}, 300),
|
|
155
|
-
|
|
156
|
-
},
|
|
159
|
+
}, 300), $ = (i) => {
|
|
160
|
+
i.dataset || (i.dataset = {}), i.style.height && (i.dataset.height = i.style.height), i.style.maxHeight = 0;
|
|
161
|
+
}, X = (i) => {
|
|
157
162
|
requestAnimationFrame(() => {
|
|
158
|
-
|
|
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";
|
|
159
164
|
});
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
|
|
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
|
+
_();
|
|
172
177
|
});
|
|
173
|
-
}, { immediate: !0 }),
|
|
174
|
-
() =>
|
|
175
|
-
(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
}, { immediate: !0 }), E(
|
|
179
|
+
() => r.value,
|
|
180
|
+
(i) => {
|
|
181
|
+
i && g.value && W(() => {
|
|
182
|
+
_();
|
|
178
183
|
});
|
|
179
184
|
}
|
|
180
|
-
),
|
|
181
|
-
|
|
182
|
-
}), (
|
|
185
|
+
), ge(() => {
|
|
186
|
+
g.value && _();
|
|
187
|
+
}), (i, e) => (M(), I(
|
|
183
188
|
"div",
|
|
184
189
|
{
|
|
185
|
-
class:
|
|
190
|
+
class: O(["mc-code-block", V.value]),
|
|
186
191
|
ref_key: "rootRef",
|
|
187
|
-
ref:
|
|
192
|
+
ref: f
|
|
188
193
|
},
|
|
189
194
|
[
|
|
190
|
-
|
|
191
|
-
|
|
195
|
+
i.$slots.header ? q(i.$slots, "header", { key: 1 }, void 0, !0) : (M(), I("div", Ye, [
|
|
196
|
+
C(
|
|
192
197
|
"span",
|
|
193
|
-
|
|
194
|
-
|
|
198
|
+
Qe,
|
|
199
|
+
J(o.language),
|
|
195
200
|
1
|
|
196
201
|
/* TEXT */
|
|
197
202
|
),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
q(i.$slots, "actions", {}, () => [
|
|
204
|
+
C("div", Fe, [
|
|
205
|
+
g.value ? (M(), I("div", Ge, [
|
|
206
|
+
C(
|
|
202
207
|
"ul",
|
|
203
208
|
{
|
|
204
|
-
class:
|
|
209
|
+
class: O(["mc-diagram-switch", { "mc-show-code": !r.value }])
|
|
205
210
|
},
|
|
206
211
|
[
|
|
207
|
-
|
|
212
|
+
C(
|
|
208
213
|
"li",
|
|
209
214
|
{
|
|
210
|
-
onClick: e[0] || (e[0] = (
|
|
211
|
-
class:
|
|
215
|
+
onClick: e[0] || (e[0] = (l) => r.value = !0),
|
|
216
|
+
class: O({ "mc-diagram-switch-active": r.value })
|
|
212
217
|
},
|
|
213
|
-
|
|
218
|
+
J(T(s)("Md.diagram")),
|
|
214
219
|
3
|
|
215
220
|
/* TEXT, CLASS */
|
|
216
221
|
),
|
|
217
|
-
|
|
222
|
+
C(
|
|
218
223
|
"li",
|
|
219
224
|
{
|
|
220
|
-
onClick: e[1] || (e[1] = (
|
|
221
|
-
class:
|
|
225
|
+
onClick: e[1] || (e[1] = (l) => r.value = !1),
|
|
226
|
+
class: O({ "mc-diagram-switch-active": !r.value })
|
|
222
227
|
},
|
|
223
|
-
|
|
228
|
+
J(T(s)("Md.code")),
|
|
224
229
|
3
|
|
225
230
|
/* TEXT, CLASS */
|
|
226
231
|
)
|
|
@@ -228,99 +233,99 @@ const Ue = {
|
|
|
228
233
|
2
|
|
229
234
|
/* CLASS */
|
|
230
235
|
)
|
|
231
|
-
])) :
|
|
232
|
-
|
|
236
|
+
])) : z("v-if", !0),
|
|
237
|
+
g.value && r.value ? (M(), I("div", {
|
|
233
238
|
key: 1,
|
|
234
239
|
class: "mc-action-btn mc-toggle-btn",
|
|
235
|
-
title:
|
|
236
|
-
onClick:
|
|
240
|
+
title: T(s)("Md.zoomIn"),
|
|
241
|
+
onClick: x
|
|
237
242
|
}, e[3] || (e[3] = [
|
|
238
|
-
|
|
243
|
+
C(
|
|
239
244
|
"img",
|
|
240
|
-
{ src:
|
|
245
|
+
{ src: Ue },
|
|
241
246
|
null,
|
|
242
247
|
-1
|
|
243
248
|
/* HOISTED */
|
|
244
249
|
)
|
|
245
|
-
]), 8,
|
|
246
|
-
|
|
250
|
+
]), 8, $e)) : z("v-if", !0),
|
|
251
|
+
g.value && r.value ? (M(), I("div", {
|
|
247
252
|
key: 2,
|
|
248
253
|
class: "mc-action-btn mc-toggle-btn",
|
|
249
|
-
title:
|
|
250
|
-
onClick:
|
|
254
|
+
title: T(s)("Md.zoomOut"),
|
|
255
|
+
onClick: k
|
|
251
256
|
}, e[4] || (e[4] = [
|
|
252
|
-
|
|
257
|
+
C(
|
|
253
258
|
"img",
|
|
254
|
-
{ src:
|
|
259
|
+
{ src: ze },
|
|
255
260
|
null,
|
|
256
261
|
-1
|
|
257
262
|
/* HOISTED */
|
|
258
263
|
)
|
|
259
|
-
]), 8,
|
|
260
|
-
|
|
264
|
+
]), 8, Xe)) : z("v-if", !0),
|
|
265
|
+
g.value && r.value ? (M(), I("div", {
|
|
261
266
|
key: 3,
|
|
262
267
|
class: "mc-action-btn mc-toggle-btn",
|
|
263
|
-
title:
|
|
264
|
-
onClick:
|
|
268
|
+
title: T(s)("Md.downLoad"),
|
|
269
|
+
onClick: L
|
|
265
270
|
}, e[5] || (e[5] = [
|
|
266
|
-
|
|
271
|
+
C(
|
|
267
272
|
"img",
|
|
268
|
-
{ src:
|
|
273
|
+
{ src: We },
|
|
269
274
|
null,
|
|
270
275
|
-1
|
|
271
276
|
/* HOISTED */
|
|
272
277
|
)
|
|
273
|
-
]), 8,
|
|
274
|
-
|
|
278
|
+
]), 8, Re)) : z("v-if", !0),
|
|
279
|
+
C("div", {
|
|
275
280
|
class: "mc-action-btn mc-toggle-btn",
|
|
276
|
-
title:
|
|
277
|
-
onClick:
|
|
281
|
+
title: T(s)("Md.toggle"),
|
|
282
|
+
onClick: S
|
|
278
283
|
}, e[6] || (e[6] = [
|
|
279
|
-
|
|
284
|
+
C(
|
|
280
285
|
"img",
|
|
281
|
-
{ src:
|
|
286
|
+
{ src: Pe },
|
|
282
287
|
null,
|
|
283
288
|
-1
|
|
284
289
|
/* HOISTED */
|
|
285
290
|
)
|
|
286
|
-
]), 8,
|
|
287
|
-
|
|
291
|
+
]), 8, Ke),
|
|
292
|
+
C("div", {
|
|
288
293
|
class: "mc-action-btn mc-copy-btn",
|
|
289
|
-
title:
|
|
294
|
+
title: T(s)("Md.copy"),
|
|
290
295
|
onClick: e[2] || (e[2] = //@ts-ignore
|
|
291
|
-
(...
|
|
296
|
+
(...l) => T(P) && T(P)(...l))
|
|
292
297
|
}, [
|
|
293
|
-
d.value ? (
|
|
294
|
-
], 8,
|
|
298
|
+
d.value ? (M(), I("img", qe)) : (M(), I("img", Je))
|
|
299
|
+
], 8, Ve)
|
|
295
300
|
])
|
|
296
301
|
], !0)
|
|
297
302
|
])),
|
|
298
|
-
|
|
303
|
+
Ie(Le, {
|
|
299
304
|
name: "collapse-transition",
|
|
300
|
-
onBeforeEnter:
|
|
301
|
-
onEnter:
|
|
302
|
-
onAfterEnter:
|
|
303
|
-
onBeforeLeave:
|
|
304
|
-
onLeave:
|
|
305
|
-
onAfterLeave:
|
|
305
|
+
onBeforeEnter: $,
|
|
306
|
+
onEnter: X,
|
|
307
|
+
onAfterEnter: H,
|
|
308
|
+
onBeforeLeave: B,
|
|
309
|
+
onLeave: R,
|
|
310
|
+
onAfterLeave: K,
|
|
306
311
|
persisted: ""
|
|
307
312
|
}, {
|
|
308
|
-
default:
|
|
309
|
-
|
|
313
|
+
default: Ne(() => [
|
|
314
|
+
Te(C(
|
|
310
315
|
"div",
|
|
311
316
|
null,
|
|
312
317
|
[
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
class:
|
|
316
|
-
innerHTML:
|
|
317
|
-
}, null, 10,
|
|
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)
|
|
318
323
|
]))
|
|
319
324
|
],
|
|
320
325
|
512
|
|
321
326
|
/* NEED_PATCH */
|
|
322
327
|
), [
|
|
323
|
-
[
|
|
328
|
+
[De, c.value]
|
|
324
329
|
])
|
|
325
330
|
]),
|
|
326
331
|
_: 3
|
|
@@ -331,16 +336,12 @@ const Ue = {
|
|
|
331
336
|
/* CLASS */
|
|
332
337
|
));
|
|
333
338
|
}
|
|
334
|
-
}),
|
|
335
|
-
const
|
|
336
|
-
for (const [a, n] of
|
|
337
|
-
|
|
338
|
-
return
|
|
339
|
-
},
|
|
340
|
-
step: 2,
|
|
341
|
-
interval: 50,
|
|
342
|
-
style: "normal"
|
|
343
|
-
}, Je = {
|
|
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 = {
|
|
344
345
|
content: {
|
|
345
346
|
type: String,
|
|
346
347
|
default: ""
|
|
@@ -397,314 +398,494 @@ const Ue = {
|
|
|
397
398
|
type: Object,
|
|
398
399
|
default: () => ({})
|
|
399
400
|
}
|
|
400
|
-
},
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
401
|
+
}, G = {
|
|
402
|
+
step: 2,
|
|
403
|
+
interval: 50,
|
|
404
|
+
style: "normal"
|
|
405
|
+
}, rt = (o) => {
|
|
406
|
+
const t = o.content || "";
|
|
407
|
+
if (t.match(/<(\w+)[^>]*\/>/))
|
|
406
408
|
return !0;
|
|
407
|
-
const
|
|
408
|
-
let
|
|
409
|
+
const s = [], a = /<(\w+)[^>]*>/g, n = /<\/(\w+)>/g;
|
|
410
|
+
let c, d;
|
|
409
411
|
a.lastIndex = 0, n.lastIndex = 0;
|
|
410
|
-
const
|
|
411
|
-
for (; (
|
|
412
|
-
|
|
412
|
+
const r = [];
|
|
413
|
+
for (; (c = a.exec(t)) !== null; )
|
|
414
|
+
r.push({
|
|
413
415
|
type: "open",
|
|
414
|
-
tagName:
|
|
415
|
-
index:
|
|
416
|
+
tagName: c[1],
|
|
417
|
+
index: c.index
|
|
416
418
|
});
|
|
417
|
-
for (; (d = n.exec(
|
|
418
|
-
|
|
419
|
+
for (; (d = n.exec(t)) !== null; )
|
|
420
|
+
r.push({
|
|
419
421
|
type: "close",
|
|
420
422
|
tagName: d[1],
|
|
421
423
|
index: d.index
|
|
422
424
|
});
|
|
423
|
-
|
|
424
|
-
for (const
|
|
425
|
-
if (
|
|
426
|
-
|
|
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);
|
|
427
429
|
else {
|
|
428
|
-
if (
|
|
430
|
+
if (s.length === 0 || s[s.length - 1] !== g.tagName)
|
|
429
431
|
return !1;
|
|
430
|
-
|
|
432
|
+
s.pop();
|
|
431
433
|
}
|
|
432
|
-
return
|
|
433
|
-
},
|
|
434
|
-
|
|
435
|
-
|
|
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,
|
|
436
441
|
closeNode: null,
|
|
437
442
|
children: [],
|
|
438
|
-
vNodeKey: (
|
|
439
|
-
}),
|
|
440
|
-
const
|
|
441
|
-
if (!
|
|
442
|
-
|
|
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);
|
|
443
448
|
return;
|
|
444
449
|
}
|
|
445
|
-
const a =
|
|
446
|
-
|
|
447
|
-
},
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
return
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
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;
|
|
458
470
|
return;
|
|
459
471
|
}
|
|
460
|
-
const
|
|
461
|
-
|
|
472
|
+
const m = r.type === "html_block" ? d : c;
|
|
473
|
+
lt(r, m);
|
|
462
474
|
}
|
|
463
|
-
}),
|
|
464
|
-
let
|
|
465
|
-
if (
|
|
466
|
-
|
|
467
|
-
else if (
|
|
468
|
-
if (a.closeNode =
|
|
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)
|
|
469
481
|
throw new Error("AST stack underflow.");
|
|
470
|
-
|
|
471
|
-
} else if (
|
|
472
|
-
if (
|
|
473
|
-
const
|
|
474
|
-
a.children.push(
|
|
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);
|
|
475
487
|
} else
|
|
476
|
-
a.children.push(
|
|
488
|
+
a.children.push(r);
|
|
477
489
|
else
|
|
478
|
-
throw new Error(`Invalid nesting level found in token index ${
|
|
479
|
-
}),
|
|
480
|
-
},
|
|
481
|
-
if (!
|
|
490
|
+
throw new Error(`Invalid nesting level found in token index ${g}.`);
|
|
491
|
+
}), s.children;
|
|
492
|
+
}, Y = (o) => {
|
|
493
|
+
if (!o || !o.trim()) return [];
|
|
482
494
|
if (typeof window > "u" || typeof DOMParser > "u")
|
|
483
|
-
return [
|
|
484
|
-
const
|
|
485
|
-
return
|
|
486
|
-
const d =
|
|
487
|
-
(
|
|
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));
|
|
488
500
|
}), a;
|
|
489
|
-
},
|
|
490
|
-
if (
|
|
491
|
-
if (
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
494
|
-
for (const n of Array.from(
|
|
495
|
-
|
|
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;
|
|
496
508
|
const a = [];
|
|
497
|
-
return
|
|
498
|
-
const
|
|
499
|
-
(
|
|
500
|
-
}),
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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 };
|
|
545
|
+
}
|
|
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);
|
|
507
584
|
}
|
|
508
|
-
|
|
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({
|
|
509
689
|
__name: "mdCard",
|
|
510
|
-
props:
|
|
690
|
+
props: ot,
|
|
511
691
|
emits: ["afterMdtInit", "typingStart", "typing", "typingEnd"],
|
|
512
|
-
setup(
|
|
513
|
-
const a = new
|
|
514
|
-
let
|
|
515
|
-
const
|
|
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({
|
|
516
696
|
breaks: !0,
|
|
517
697
|
linkify: !0,
|
|
518
698
|
html: !0,
|
|
519
|
-
highlight: (e,
|
|
520
|
-
if (
|
|
699
|
+
highlight: (e, l) => {
|
|
700
|
+
if (l && A.getLanguage(l))
|
|
521
701
|
try {
|
|
522
|
-
return
|
|
702
|
+
return A.highlight(e, { language: l }).value;
|
|
523
703
|
} catch {
|
|
524
704
|
}
|
|
525
705
|
return "";
|
|
526
706
|
},
|
|
527
707
|
...n.mdOptions
|
|
528
|
-
}),
|
|
529
|
-
|
|
708
|
+
}), { foundation: m } = ut({
|
|
709
|
+
props: n,
|
|
710
|
+
emit: c
|
|
711
|
+
}), f = D(0), x = D(!1), k = D(), L = () => {
|
|
530
712
|
let e = n.content || "";
|
|
531
|
-
if (n.typing &&
|
|
532
|
-
e = n.content.slice(0,
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
}
|
|
536
|
-
if (n.enableThink) {
|
|
537
|
-
const p = ((m = n.thinkOptions) == null ? void 0 : m.customClass) || "mc-think-block";
|
|
538
|
-
e = (e == null ? void 0 : e.replace("<think>", `<div class="${p}">`).replace("</think>", "</div>")) || "";
|
|
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>`);
|
|
539
717
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
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;
|
|
544
723
|
if (e.nodeType === "html_inline" || e.nodeType === "html_block") {
|
|
545
|
-
const
|
|
546
|
-
if (!
|
|
547
|
-
return
|
|
548
|
-
const
|
|
549
|
-
if (typeof
|
|
550
|
-
return
|
|
551
|
-
const
|
|
552
|
-
return Array.isArray(
|
|
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;
|
|
553
732
|
});
|
|
554
|
-
return
|
|
733
|
+
return y(j, h);
|
|
555
734
|
}
|
|
556
735
|
if (e.nodeType === "inline") {
|
|
557
|
-
const
|
|
558
|
-
return
|
|
736
|
+
const u = g.renderer.render([e.openNode], g.options, {}), p = a.filterHtml(u), h = Y(p);
|
|
737
|
+
return y(j, h);
|
|
559
738
|
}
|
|
560
|
-
return
|
|
561
|
-
},
|
|
739
|
+
return m.isToken(e) ? P(e) : X(e);
|
|
740
|
+
}, P = (e) => {
|
|
562
741
|
if (e.type === "text")
|
|
563
742
|
return e.content;
|
|
564
743
|
if (e.type === "inline")
|
|
565
|
-
return
|
|
744
|
+
return $(e);
|
|
566
745
|
if (e.type === "fence")
|
|
567
|
-
return
|
|
746
|
+
return H(e);
|
|
568
747
|
if (e.type === "softbreak")
|
|
569
|
-
return
|
|
748
|
+
return g.options.breaks ? y("br") : `
|
|
570
749
|
`;
|
|
571
|
-
if (e.type === "html_block" || e.type === "html_inline")
|
|
572
|
-
|
|
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
|
+
}
|
|
573
754
|
if (e.type === "math_block" && e.markup === "$$") {
|
|
574
|
-
const
|
|
575
|
-
return
|
|
755
|
+
const l = g.renderer.render([e], g.options, {}), u = a.filterHtml(l), p = Y(u);
|
|
756
|
+
return y(j, p);
|
|
576
757
|
}
|
|
577
758
|
if (e.tag) {
|
|
578
|
-
const
|
|
579
|
-
return
|
|
759
|
+
const l = F(e.tag) ? e.tag : "div", u = B(e.attrs || []);
|
|
760
|
+
return y(l, { ...u, key: e.vNodeKey }, e.content);
|
|
580
761
|
}
|
|
581
762
|
return e.content;
|
|
582
|
-
},
|
|
583
|
-
const
|
|
584
|
-
return
|
|
585
|
-
},
|
|
586
|
-
var
|
|
587
|
-
let
|
|
588
|
-
(
|
|
589
|
-
const u =
|
|
590
|
-
if (((
|
|
591
|
-
return
|
|
592
|
-
if ((
|
|
593
|
-
let
|
|
594
|
-
const
|
|
595
|
-
return
|
|
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;
|
|
596
777
|
}
|
|
597
|
-
const
|
|
598
|
-
return
|
|
599
|
-
},
|
|
600
|
-
var
|
|
601
|
-
const
|
|
602
|
-
return
|
|
603
|
-
},
|
|
604
|
-
|
|
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(
|
|
605
786
|
() => {
|
|
606
787
|
var e;
|
|
607
788
|
return [n.enableThink, (e = n.thinkOptions) == null ? void 0 : e.customClass, n.theme];
|
|
608
789
|
},
|
|
609
790
|
() => {
|
|
610
|
-
|
|
791
|
+
L();
|
|
611
792
|
}
|
|
612
793
|
);
|
|
613
|
-
const
|
|
614
|
-
const
|
|
794
|
+
const R = (e, l, u) => {
|
|
795
|
+
const p = {
|
|
615
796
|
actions: d.actions ? () => {
|
|
616
|
-
var
|
|
617
|
-
return ((
|
|
797
|
+
var h;
|
|
798
|
+
return ((h = d.actions) == null ? void 0 : h.call(d, { codeBlockData: { code: l, language: e } })) || null;
|
|
618
799
|
} : void 0,
|
|
619
800
|
header: d.header ? () => {
|
|
620
|
-
var
|
|
621
|
-
return ((
|
|
801
|
+
var h;
|
|
802
|
+
return ((h = d.header) == null ? void 0 : h.call(d, { codeBlockData: { code: l, language: e } })) || null;
|
|
622
803
|
} : void 0,
|
|
623
804
|
content: d.content ? () => {
|
|
624
|
-
var
|
|
625
|
-
return ((
|
|
805
|
+
var h;
|
|
806
|
+
return ((h = d.content) == null ? void 0 : h.call(d, { codeBlockData: { code: l, language: e } })) || null;
|
|
626
807
|
} : void 0
|
|
627
808
|
};
|
|
628
|
-
return
|
|
629
|
-
|
|
809
|
+
return y(
|
|
810
|
+
it,
|
|
630
811
|
{
|
|
631
812
|
language: e,
|
|
632
|
-
code:
|
|
813
|
+
code: l,
|
|
633
814
|
blockIndex: u,
|
|
634
815
|
theme: n.theme,
|
|
635
816
|
enableMermaid: n.enableMermaid,
|
|
636
817
|
mermaidConfig: n.mermaidConfig,
|
|
637
818
|
key: `code-block-${u}`
|
|
638
819
|
},
|
|
639
|
-
|
|
820
|
+
p
|
|
640
821
|
);
|
|
641
|
-
},
|
|
642
|
-
clearTimeout(
|
|
643
|
-
const e = { ...
|
|
822
|
+
}, K = () => {
|
|
823
|
+
clearTimeout(r), x.value = !0, c("typingStart");
|
|
824
|
+
const e = { ...G, ...n == null ? void 0 : n.typingOptions }, l = () => {
|
|
644
825
|
let u = e.step;
|
|
645
|
-
if (Array.isArray(e.step) && (u = e.step[0] + Math.floor(Math.random() * (e.step[1] - e.step[0]))),
|
|
646
|
-
|
|
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();
|
|
647
828
|
return;
|
|
648
829
|
}
|
|
649
|
-
|
|
830
|
+
r = setTimeout(l, e.interval);
|
|
650
831
|
};
|
|
651
|
-
|
|
832
|
+
r = setTimeout(l);
|
|
652
833
|
};
|
|
653
|
-
|
|
834
|
+
E(
|
|
654
835
|
() => n.content,
|
|
655
|
-
(e,
|
|
836
|
+
(e, l) => {
|
|
656
837
|
if (!n.typing) {
|
|
657
|
-
|
|
838
|
+
f.value = (e == null ? void 0 : e.length) || 0, L();
|
|
658
839
|
return;
|
|
659
840
|
}
|
|
660
|
-
e.indexOf(
|
|
841
|
+
e.indexOf(l) === -1 && (f.value = 0), W(() => K());
|
|
661
842
|
},
|
|
662
843
|
{ immediate: !0 }
|
|
663
844
|
);
|
|
664
|
-
const
|
|
665
|
-
|
|
845
|
+
const V = () => {
|
|
846
|
+
x.value = !1, c("typingEnd");
|
|
666
847
|
};
|
|
667
|
-
|
|
848
|
+
E(
|
|
668
849
|
() => n.customXssRules,
|
|
669
850
|
(e) => {
|
|
670
|
-
a.setCustomXssRules(e),
|
|
851
|
+
a.setCustomXssRules(e), L();
|
|
671
852
|
},
|
|
672
|
-
{ deep: !1 }
|
|
673
|
-
),
|
|
853
|
+
{ deep: !1, immediate: !0 }
|
|
854
|
+
), E(
|
|
674
855
|
() => n.mdPlugins,
|
|
675
856
|
(e) => {
|
|
676
|
-
a.setMdPlugins(e,
|
|
857
|
+
a.setMdPlugins(e, g), L();
|
|
677
858
|
},
|
|
678
859
|
{ immediate: !0, deep: !1 }
|
|
679
860
|
);
|
|
680
|
-
const
|
|
681
|
-
return
|
|
682
|
-
|
|
683
|
-
}),
|
|
684
|
-
|
|
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,
|
|
685
866
|
null,
|
|
686
867
|
[
|
|
687
|
-
|
|
868
|
+
C(
|
|
688
869
|
"div",
|
|
689
870
|
{
|
|
690
|
-
class:
|
|
871
|
+
class: O(["mc-markdown-render", i.value])
|
|
691
872
|
},
|
|
692
873
|
[
|
|
693
|
-
(
|
|
874
|
+
(M(), Se(be(k.value)))
|
|
694
875
|
],
|
|
695
876
|
2
|
|
696
877
|
/* CLASS */
|
|
697
878
|
),
|
|
698
|
-
|
|
879
|
+
z("v-if", !0)
|
|
699
880
|
],
|
|
700
881
|
64
|
|
701
882
|
/* STABLE_FRAGMENT */
|
|
702
883
|
));
|
|
703
884
|
}
|
|
704
|
-
}),
|
|
705
|
-
|
|
706
|
-
|
|
885
|
+
}), ce = /* @__PURE__ */ me(pt, [["__scopeId", "data-v-8063b2f5"]]);
|
|
886
|
+
ce.install = (o) => {
|
|
887
|
+
o.component("McMarkdownCard", ce);
|
|
707
888
|
};
|
|
708
889
|
export {
|
|
709
|
-
|
|
890
|
+
ce as McMarkdownCard
|
|
710
891
|
};
|