@matechat/core 1.8.0 → 1.9.0-alpha.0
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/Bubble/index.css +1 -1
- package/Bubble/index.js +141 -136
- package/Input/index.js +216 -116
- package/MarkdownCard/index.css +1 -1
- package/MarkdownCard/index.js +186 -182
- package/README.md +1 -1
- package/package.json +1 -1
package/MarkdownCard/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { defineComponent as oe, ref as x, computed as
|
|
2
|
+
import { defineComponent as oe, ref as x, computed as U, watch as A, nextTick as _, onMounted as re, createElementBlock as v, openBlock as C, normalizeClass as T, renderSlot as $, createVNode as pe, createElementVNode as y, toDisplayString as X, createCommentVNode as b, unref as L, Transition as ye, withCtx as fe, withDirectives as Me, vShow as Ce, isVNode as le, h as M, useSlots as we, Fragment as k, createBlock as ve, resolveDynamicComponent as Ne } from "vue";
|
|
3
3
|
import D from "highlight.js";
|
|
4
4
|
import Le from "markdown-it";
|
|
5
5
|
import { debounce as Ie } from "lodash-es";
|
|
6
6
|
import { getDefaultWhiteList as De, getDefaultCSSWhiteList as xe, filterXSS as Te } from "xss";
|
|
7
7
|
import { useMcI18n as Ae } from "@matechat/core/Locale";
|
|
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", 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%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", 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%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", Oe = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZnVuY3Rpb24gaWNvbi9jb3B5PC90aXRsZT4KICAgIDxnIGlkPSLpobXpnaItMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFQSS1zdGFydGVyLeWbvuagh+WFpeW6kyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTU5Mi4wMDAwMDAsIC0yMDQuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSLmlrnmoLzlpIfku70tMTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDU2MC4wMDAwMDAsIDE4MC4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDx0ZXh0IGlkPSLlm77moIciIGZvbnQtZmFtaWx5PSJQaW5nRmFuZ1NDLVJlZ3VsYXIsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0ibm9ybWFsIiBsaW5lLXNwYWNpbmc9IjE2IiBmaWxsPSIjNzE3NTdGIj4KICAgICAgICAgICAgICAgICAgICA8dHNwYW4geD0iMjcuMTM2IiB5PSI2MSI+5aSN5Yi2PC90c3Bhbj4KICAgICAgICAgICAgICAgIDwvdGV4dD4KICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8cGF0aCBkPSJNNjA0LjUsMjA2IEM2MDUuMjc5Njk2LDIwNiA2MDUuOTIwNDQ5LDIwNi41OTQ4ODggNjA1Ljk5MzEzMywyMDcuMzU1NTQgTDYwNiwyMDcuNSBMNjA2LDIxNC41IEM2MDYsMjE1LjI3OTY5NiA2MDUuNDA1MTEyLDIxNS45MjA0NDkgNjA0LjY0NDQ2LDIxNS45OTMxMzMgTDYwNC41LDIxNiBMNjA0LDIxNiBMNjA0LDIxNi41IEM2MDQsMjE3LjI3OTY5NiA2MDMuNDA1MTEyLDIxNy45MjA0NDkgNjAyLjY0NDQ2LDIxNy45OTMxMzMgTDYwMi41LDIxOCBMNTk1LjUsMjE4IEM1OTQuNjcxNTczLDIxOCA1OTQsMjE3LjMyODQyNyA1OTQsMjE2LjUgTDU5NCwyMTYuNSBMNTk0LDIwOS41IEM1OTQsMjA4LjY3MTU3MyA1OTQuNjcxNTczLDIwOCA1OTUuNSwyMDggTDU5NS41LDIwOCBMNTk2LDIwOCBMNTk2LDIwNy41IEM1OTYsMjA2LjcyMDMwNCA1OTYuNTk0ODg4LDIwNi4wNzk1NTEgNTk3LjM1NTU0LDIwNi4wMDY4NjcgTDU5Ny41LDIwNiBMNjA0LjUsMjA2IFogTTYwMi41LDIwOSBMNTk1LjUsMjA5IEM1OTUuMjIzODU4LDIwOSA1OTUsMjA5LjIyMzg1OCA1OTUsMjA5LjUgTDU5NSwyMDkuNSBMNTk1LDIxNi41IEM1OTUsMjE2Ljc3NjE0MiA1OTUuMjIzODU4LDIxNyA1OTUuNSwyMTcgTDU5NS41LDIxNyBMNjAyLjUsMjE3IEM2MDIuNzc2MTQyLDIxNyA2MDMsMjE2Ljc3NjE0MiA2MDMsMjE2LjUgTDYwMywyMTYuNSBMNjAzLDIwOS41IEM2MDMsMjA5LjIyMzg1OCA2MDIuNzc2MTQyLDIwOSA2MDIuNSwyMDkgTDYwMi41LDIwOSBaIE02MDQuNSwyMDcgTDU5Ny41LDIwNyBDNTk3LjI1NDU0LDIwNyA1OTcuMDUwMzkyLDIwNy4xNzY4NzUgNTk3LjAwODA1NiwyMDcuNDEwMTI0IEw1OTcsMjA3LjUgTDU5NywyMDggTDYwMi41LDIwOCBDNjAzLjI3OTY5NiwyMDggNjAzLjkyMDQ0OSwyMDguNTk0ODg4IDYwMy45OTMxMzMsMjA5LjM1NTU0IEw2MDQsMjA5LjUgTDYwNCwyMTUgTDYwNC41LDIxNSBDNjA0Ljc0NTQ2LDIxNSA2MDQuOTQ5NjA4LDIxNC44MjMxMjUgNjA0Ljk5MTk0NCwyMTQuNTg5ODc2IEw2MDUsMjE0LjUgTDYwNSwyMDcuNSBDNjA1LDIwNy4yNTQ1NCA2MDQuODIzMTI1LDIwNy4wNTAzOTIgNjA0LjU4OTg3NiwyMDcuMDA4MDU2IEw2MDQuNSwyMDcgWiIgaWQ9IuW9oueKtue7k+WQiCIgZmlsbD0iIzcxNzU3RiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=", Ee = "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";
|
|
8
|
+
const 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%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", 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%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", 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%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", 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%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", Oe = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZnVuY3Rpb24gaWNvbi9jb3B5PC90aXRsZT4KICAgIDxnIGlkPSLpobXpnaItMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFQSS1zdGFydGVyLeWbvuagh+WFpeW6kyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTU5Mi4wMDAwMDAsIC0yMDQuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSLmlrnmoLzlpIfku70tMTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDU2MC4wMDAwMDAsIDE4MC4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDx0ZXh0IGlkPSLlm77moIciIGZvbnQtZmFtaWx5PSJQaW5nRmFuZ1NDLVJlZ3VsYXIsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0ibm9ybWFsIiBsaW5lLXNwYWNpbmc9IjE2IiBmaWxsPSIjNzE3NTdGIj4KICAgICAgICAgICAgICAgICAgICA8dHNwYW4geD0iMjcuMTM2IiB5PSI2MSI+5aSN5Yi2PC90c3Bhbj4KICAgICAgICAgICAgICAgIDwvdGV4dD4KICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8cGF0aCBkPSJNNjA0LjUsMjA2IEM2MDUuMjc5Njk2LDIwNiA2MDUuOTIwNDQ5LDIwNi41OTQ4ODggNjA1Ljk5MzEzMywyMDcuMzU1NTQgTDYwNiwyMDcuNSBMNjA2LDIxNC41IEM2MDYsMjE1LjI3OTY5NiA2MDUuNDA1MTEyLDIxNS45MjA0NDkgNjA0LjY0NDQ2LDIxNS45OTMxMzMgTDYwNC41LDIxNiBMNjA0LDIxNiBMNjA0LDIxNi41IEM2MDQsMjE3LjI3OTY5NiA2MDMuNDA1MTEyLDIxNy45MjA0NDkgNjAyLjY0NDQ2LDIxNy45OTMxMzMgTDYwMi41LDIxOCBMNTk1LjUsMjE4IEM1OTQuNjcxNTczLDIxOCA1OTQsMjE3LjMyODQyNyA1OTQsMjE2LjUgTDU5NCwyMTYuNSBMNTk0LDIwOS41IEM1OTQsMjA4LjY3MTU3MyA1OTQuNjcxNTczLDIwOCA1OTUuNSwyMDggTDU5NS41LDIwOCBMNTk2LDIwOCBMNTk2LDIwNy41IEM1OTYsMjA2LjcyMDMwNCA1OTYuNTk0ODg4LDIwNi4wNzk1NTEgNTk3LjM1NTU0LDIwNi4wMDY4NjcgTDU5Ny41LDIwNiBMNjA0LjUsMjA2IFogTTYwMi41LDIwOSBMNTk1LjUsMjA5IEM1OTUuMjIzODU4LDIwOSA1OTUsMjA5LjIyMzg1OCA1OTUsMjA5LjUgTDU5NSwyMDkuNSBMNTk1LDIxNi41IEM1OTUsMjE2Ljc3NjE0MiA1OTUuMjIzODU4LDIxNyA1OTUuNSwyMTcgTDU5NS41LDIxNyBMNjAyLjUsMjE3IEM2MDIuNzc2MTQyLDIxNyA2MDMsMjE2Ljc3NjE0MiA2MDMsMjE2LjUgTDYwMywyMTYuNSBMNjAzLDIwOS41IEM2MDMsMjA5LjIyMzg1OCA2MDIuNzc2MTQyLDIwOSA2MDIuNSwyMDkgTDYwMi41LDIwOSBaIE02MDQuNSwyMDcgTDU5Ny41LDIwNyBDNTk3LjI1NDU0LDIwNyA1OTcuMDUwMzkyLDIwNy4xNzY4NzUgNTk3LjAwODA1NiwyMDcuNDEwMTI0IEw1OTcsMjA3LjUgTDU5NywyMDggTDYwMi41LDIwOCBDNjAzLjI3OTY5NiwyMDggNjAzLjkyMDQ0OSwyMDguNTk0ODg4IDYwMy45OTMxMzMsMjA5LjM1NTU0IEw2MDQsMjA5LjUgTDYwNCwyMTUgTDYwNC41LDIxNSBDNjA0Ljc0NTQ2LDIxNSA2MDQuOTQ5NjA4LDIxNC44MjMxMjUgNjA0Ljk5MTk0NCwyMTQuNTg5ODc2IEw2MDUsMjE0LjUgTDYwNSwyMDcuNSBDNjA1LDIwNy4yNTQ1NCA2MDQuODIzMTI1LDIwNy4wNTAzOTIgNjA0LjU4OTg3NiwyMDcuMDA4MDU2IEw2MDQuNSwyMDcgWiIgaWQ9IuW9oueKtue7k+WQiCIgZmlsbD0iIzcxNzU3RiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=", Ee = "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
9
|
class ce {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.xssWhiteList = De(), this.cssWhiteList = xe(), this.setDefaultXss();
|
|
@@ -13,8 +13,8 @@ class ce {
|
|
|
13
13
|
setDefaultXss() {
|
|
14
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"];
|
|
15
15
|
}
|
|
16
|
-
onIgnoreTagAttr(s, r, a,
|
|
17
|
-
if (!
|
|
16
|
+
onIgnoreTagAttr(s, r, a, n) {
|
|
17
|
+
if (!n && (r === "id" || s === "span" && r === "style"))
|
|
18
18
|
return r + "=" + a;
|
|
19
19
|
}
|
|
20
20
|
getXssWhiteList() {
|
|
@@ -30,8 +30,8 @@ class ce {
|
|
|
30
30
|
}
|
|
31
31
|
setMdPlugins(s, r) {
|
|
32
32
|
s && s.length && s.forEach((a) => {
|
|
33
|
-
const { plugin:
|
|
34
|
-
r.use(
|
|
33
|
+
const { plugin: n, opts: g } = a;
|
|
34
|
+
r.use(n, g);
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
filterHtml(s) {
|
|
@@ -52,7 +52,7 @@ class ce {
|
|
|
52
52
|
const Be = {
|
|
53
53
|
key: 0,
|
|
54
54
|
class: "mc-code-block-header"
|
|
55
|
-
}, Ue = { class: "mc-code-lang" },
|
|
55
|
+
}, Ue = { class: "mc-code-lang" }, _e = { class: "mc-code-block-actions" }, ze = {
|
|
56
56
|
key: 0,
|
|
57
57
|
style: { "margin-right": "8px" }
|
|
58
58
|
}, We = ["title"], Ze = ["title"], Ye = ["title"], Pe = ["title"], Qe = ["title"], Ge = {
|
|
@@ -64,7 +64,7 @@ const Be = {
|
|
|
64
64
|
}, Fe = {
|
|
65
65
|
key: 0,
|
|
66
66
|
class: "mc-mermaid-content"
|
|
67
|
-
},
|
|
67
|
+
}, $e = { key: 1 }, Xe = ["innerHTML"], Re = /* @__PURE__ */ oe({
|
|
68
68
|
__name: "CodeBlock",
|
|
69
69
|
props: {
|
|
70
70
|
code: {
|
|
@@ -92,55 +92,55 @@ const Be = {
|
|
|
92
92
|
default: () => ({})
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
|
-
setup(
|
|
96
|
-
const s =
|
|
97
|
-
let
|
|
95
|
+
setup(i) {
|
|
96
|
+
const s = i, { t: r } = Ae(), a = new ce();
|
|
97
|
+
let n = null;
|
|
98
98
|
const g = x(!0), d = x(!1);
|
|
99
99
|
x("");
|
|
100
|
-
const l = x(!0), c =
|
|
100
|
+
const l = x(!0), c = U(() => {
|
|
101
101
|
var t;
|
|
102
102
|
return s.enableMermaid && ((t = s.language) == null ? void 0 : t.toLowerCase()) === "mermaid";
|
|
103
|
-
}), p =
|
|
103
|
+
}), p = U(() => {
|
|
104
104
|
try {
|
|
105
105
|
const t = s.code.indexOf('<span class="mc-typewriter');
|
|
106
106
|
let e;
|
|
107
107
|
return s.language && D.getLanguage(s.language) ? t !== -1 ? e = D.highlight(s.code.slice(0, t), { language: s.language }).value + s.code.slice(t) : e = D.highlight(s.code, { language: s.language }).value : typeof D.highlightAuto !== void 0 ? t !== -1 ? e = D.highlightAuto(s.code.slice(0, t)).value + s.code.slice(t) : e = D.highlightAuto(s.code).value : e = a.filterHtml(s.code), e;
|
|
108
108
|
} catch {
|
|
109
109
|
}
|
|
110
|
-
}),
|
|
110
|
+
}), w = x(null), S = () => {
|
|
111
111
|
var e;
|
|
112
|
-
const t = (e =
|
|
113
|
-
t &&
|
|
112
|
+
const t = (e = w.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
|
|
113
|
+
t && n && n.zoomIn(t);
|
|
114
114
|
}, I = () => {
|
|
115
115
|
var e;
|
|
116
|
-
const t = (e =
|
|
117
|
-
t &&
|
|
118
|
-
},
|
|
116
|
+
const t = (e = w.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
|
|
117
|
+
t && n && n.zoomOut(t);
|
|
118
|
+
}, W = () => {
|
|
119
119
|
var e;
|
|
120
|
-
const t = (e =
|
|
121
|
-
t &&
|
|
120
|
+
const t = (e = w.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
|
|
121
|
+
t && n && n.download(t);
|
|
122
122
|
}, N = async () => {
|
|
123
123
|
if (!(!c.value || !s.code)) {
|
|
124
|
-
if (!
|
|
124
|
+
if (!n)
|
|
125
125
|
try {
|
|
126
126
|
const { MermaidService: t } = await import("./MermaidService-B6BcjbW_.js"), e = {
|
|
127
127
|
theme: s.theme === "dark" ? "dark" : "default",
|
|
128
128
|
...s.mermaidConfig
|
|
129
129
|
};
|
|
130
|
-
|
|
130
|
+
n = new t(e);
|
|
131
131
|
} catch (t) {
|
|
132
132
|
console.error("Failed to load MermaidService:", t);
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
_(async () => {
|
|
136
136
|
var e;
|
|
137
|
-
const t = (e =
|
|
138
|
-
t && await
|
|
137
|
+
const t = (e = w.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
|
|
138
|
+
t && await n.renderToContainer(t, s.code.replace(/<span[^>]*\bclass\s*=\s*['"]mc-typewriter[^>]*>([\s\S]*?)<\/span>/g, "$1"), s.theme);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
},
|
|
141
|
+
}, Z = () => {
|
|
142
142
|
g.value = !g.value;
|
|
143
|
-
},
|
|
143
|
+
}, O = Ie((t) => {
|
|
144
144
|
const e = t.target;
|
|
145
145
|
if (navigator.clipboard)
|
|
146
146
|
navigator.clipboard.writeText(s.code);
|
|
@@ -151,53 +151,53 @@ const Be = {
|
|
|
151
151
|
e.classList.remove("icon-copy-new"), d.value = !0, setTimeout(() => {
|
|
152
152
|
d.value = !1;
|
|
153
153
|
}, 1500);
|
|
154
|
-
}, 300),
|
|
154
|
+
}, 300), Y = (t) => {
|
|
155
155
|
t.dataset || (t.dataset = {}), t.style.height && (t.dataset.height = t.style.height), t.style.maxHeight = 0;
|
|
156
|
-
},
|
|
156
|
+
}, P = (t) => {
|
|
157
157
|
requestAnimationFrame(() => {
|
|
158
158
|
t.dataset.oldOverflow = t.style.overflow, t.dataset.height ? t.style.maxHeight = t.dataset.height : t.scrollHeight !== 0 ? t.style.maxHeight = `${t.scrollHeight}px` : t.style.maxHeight = 0, t.style.overflow = "hidden";
|
|
159
159
|
});
|
|
160
|
-
},
|
|
160
|
+
}, E = (t) => {
|
|
161
161
|
t.style.maxHeight = "", t.style.overflow = t.dataset.oldOverflow;
|
|
162
|
-
},
|
|
162
|
+
}, j = (t) => {
|
|
163
163
|
t.dataset || (t.dataset = {}), t.dataset.oldOverflow = t.style.overflow, t.style.maxHeight = `${t.scrollHeight}px`, t.style.overflow = "hidden";
|
|
164
|
-
}, P = (t) => {
|
|
165
|
-
t.scrollHeight !== 0 && (t.style.maxHeight = 0);
|
|
166
164
|
}, Q = (t) => {
|
|
165
|
+
t.scrollHeight !== 0 && (t.style.maxHeight = 0);
|
|
166
|
+
}, G = (t) => {
|
|
167
167
|
t.style.maxHeight = "", t.style.overflow = t.dataset.oldOverflow;
|
|
168
|
-
},
|
|
168
|
+
}, H = U(() => s.theme === "dark" ? "mc-code-block-dark" : "mc-code-block-light");
|
|
169
169
|
return A(() => [s.code, s.theme, s.enableMermaid], () => {
|
|
170
|
-
c.value &&
|
|
170
|
+
c.value && _(() => {
|
|
171
171
|
N();
|
|
172
172
|
});
|
|
173
173
|
}, { immediate: !0 }), A(
|
|
174
174
|
() => l.value,
|
|
175
175
|
(t) => {
|
|
176
|
-
t && c.value &&
|
|
176
|
+
t && c.value && _(() => {
|
|
177
177
|
N();
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
), re(() => {
|
|
181
181
|
c.value && N();
|
|
182
|
-
}), (t, e) => (
|
|
182
|
+
}), (t, e) => (C(), v(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
185
|
-
class: T(["mc-code-block",
|
|
185
|
+
class: T(["mc-code-block", H.value]),
|
|
186
186
|
ref_key: "rootRef",
|
|
187
|
-
ref:
|
|
187
|
+
ref: w
|
|
188
188
|
},
|
|
189
189
|
[
|
|
190
|
-
t.$slots.header ?
|
|
190
|
+
t.$slots.header ? $(t.$slots, "header", { key: 1 }, void 0, !0) : (C(), v("div", Be, [
|
|
191
191
|
y(
|
|
192
192
|
"span",
|
|
193
193
|
Ue,
|
|
194
|
-
X(
|
|
194
|
+
X(i.language),
|
|
195
195
|
1
|
|
196
196
|
/* TEXT */
|
|
197
197
|
),
|
|
198
|
-
|
|
199
|
-
y("div",
|
|
200
|
-
c.value ? (
|
|
198
|
+
$(t.$slots, "actions", {}, () => [
|
|
199
|
+
y("div", _e, [
|
|
200
|
+
c.value ? (C(), v("div", ze, [
|
|
201
201
|
y(
|
|
202
202
|
"ul",
|
|
203
203
|
{
|
|
@@ -228,22 +228,22 @@ const Be = {
|
|
|
228
228
|
2
|
|
229
229
|
/* CLASS */
|
|
230
230
|
)
|
|
231
|
-
])) :
|
|
232
|
-
c.value && l.value ? (
|
|
231
|
+
])) : b("v-if", !0),
|
|
232
|
+
c.value && l.value ? (C(), v("div", {
|
|
233
233
|
key: 1,
|
|
234
234
|
class: "mc-action-btn mc-toggle-btn",
|
|
235
235
|
title: L(r)("Md.zoomIn"),
|
|
236
|
-
onClick:
|
|
236
|
+
onClick: S
|
|
237
237
|
}, [...e[3] || (e[3] = [
|
|
238
238
|
y(
|
|
239
239
|
"img",
|
|
240
|
-
{ src:
|
|
240
|
+
{ src: je },
|
|
241
241
|
null,
|
|
242
242
|
-1
|
|
243
243
|
/* CACHED */
|
|
244
244
|
)
|
|
245
|
-
])], 8, We)) :
|
|
246
|
-
c.value && l.value ? (
|
|
245
|
+
])], 8, We)) : b("v-if", !0),
|
|
246
|
+
c.value && l.value ? (C(), v("div", {
|
|
247
247
|
key: 2,
|
|
248
248
|
class: "mc-action-btn mc-toggle-btn",
|
|
249
249
|
title: L(r)("Md.zoomOut"),
|
|
@@ -251,17 +251,17 @@ const Be = {
|
|
|
251
251
|
}, [...e[4] || (e[4] = [
|
|
252
252
|
y(
|
|
253
253
|
"img",
|
|
254
|
-
{ src:
|
|
254
|
+
{ src: ke },
|
|
255
255
|
null,
|
|
256
256
|
-1
|
|
257
257
|
/* CACHED */
|
|
258
258
|
)
|
|
259
|
-
])], 8, Ze)) :
|
|
260
|
-
c.value && l.value ? (
|
|
259
|
+
])], 8, Ze)) : b("v-if", !0),
|
|
260
|
+
c.value && l.value ? (C(), v("div", {
|
|
261
261
|
key: 3,
|
|
262
262
|
class: "mc-action-btn mc-toggle-btn",
|
|
263
263
|
title: L(r)("Md.downLoad"),
|
|
264
|
-
onClick:
|
|
264
|
+
onClick: W
|
|
265
265
|
}, [...e[5] || (e[5] = [
|
|
266
266
|
y(
|
|
267
267
|
"img",
|
|
@@ -270,11 +270,11 @@ const Be = {
|
|
|
270
270
|
-1
|
|
271
271
|
/* CACHED */
|
|
272
272
|
)
|
|
273
|
-
])], 8, Ye)) :
|
|
273
|
+
])], 8, Ye)) : b("v-if", !0),
|
|
274
274
|
y("div", {
|
|
275
275
|
class: "mc-action-btn mc-toggle-btn",
|
|
276
276
|
title: L(r)("Md.toggle"),
|
|
277
|
-
onClick:
|
|
277
|
+
onClick: Z
|
|
278
278
|
}, [...e[6] || (e[6] = [
|
|
279
279
|
y(
|
|
280
280
|
"img",
|
|
@@ -288,21 +288,21 @@ const Be = {
|
|
|
288
288
|
class: "mc-action-btn mc-copy-btn",
|
|
289
289
|
title: L(r)("Md.copy"),
|
|
290
290
|
onClick: e[2] || (e[2] = //@ts-ignore
|
|
291
|
-
(...o) => L(
|
|
291
|
+
(...o) => L(O) && L(O)(...o))
|
|
292
292
|
}, [
|
|
293
|
-
d.value ? (
|
|
293
|
+
d.value ? (C(), v("img", He)) : (C(), v("img", Ge))
|
|
294
294
|
], 8, Qe)
|
|
295
295
|
])
|
|
296
296
|
], !0)
|
|
297
297
|
])),
|
|
298
298
|
pe(ye, {
|
|
299
299
|
name: "collapse-transition",
|
|
300
|
-
onBeforeEnter:
|
|
301
|
-
onEnter:
|
|
302
|
-
onAfterEnter:
|
|
303
|
-
onBeforeLeave:
|
|
304
|
-
onLeave:
|
|
305
|
-
onAfterLeave:
|
|
300
|
+
onBeforeEnter: Y,
|
|
301
|
+
onEnter: P,
|
|
302
|
+
onAfterEnter: E,
|
|
303
|
+
onBeforeLeave: j,
|
|
304
|
+
onLeave: Q,
|
|
305
|
+
onAfterLeave: G,
|
|
306
306
|
persisted: ""
|
|
307
307
|
}, {
|
|
308
308
|
default: fe(() => [
|
|
@@ -310,11 +310,11 @@ const Be = {
|
|
|
310
310
|
"div",
|
|
311
311
|
null,
|
|
312
312
|
[
|
|
313
|
-
c.value && l.value && !t.$slots.content ? (
|
|
313
|
+
c.value && l.value && !t.$slots.content ? (C(), v("div", Fe)) : t.$slots.content ? $(t.$slots, "content", { key: 2 }, void 0, !0) : (C(), v("pre", $e, [
|
|
314
314
|
y("code", {
|
|
315
|
-
class: T(`hljs language-${
|
|
315
|
+
class: T(`hljs language-${i.language}`),
|
|
316
316
|
innerHTML: p.value
|
|
317
|
-
}, null, 10,
|
|
317
|
+
}, null, 10, Xe)
|
|
318
318
|
]))
|
|
319
319
|
],
|
|
320
320
|
512
|
|
@@ -331,12 +331,12 @@ const Be = {
|
|
|
331
331
|
/* CLASS */
|
|
332
332
|
));
|
|
333
333
|
}
|
|
334
|
-
}), ae = (
|
|
335
|
-
const r =
|
|
336
|
-
for (const [a,
|
|
337
|
-
r[a] =
|
|
334
|
+
}), ae = (i, s) => {
|
|
335
|
+
const r = i.__vccOpts || i;
|
|
336
|
+
for (const [a, n] of s)
|
|
337
|
+
r[a] = n;
|
|
338
338
|
return r;
|
|
339
|
-
}, Ke = /* @__PURE__ */ ae(Re, [["__scopeId", "data-v-6332bb90"]]),
|
|
339
|
+
}, Ke = /* @__PURE__ */ ae(Re, [["__scopeId", "data-v-6332bb90"]]), ne = {
|
|
340
340
|
step: 2,
|
|
341
341
|
interval: 50,
|
|
342
342
|
style: "normal"
|
|
@@ -397,16 +397,16 @@ const Be = {
|
|
|
397
397
|
type: Object,
|
|
398
398
|
default: () => ({})
|
|
399
399
|
}
|
|
400
|
-
}, Je = (
|
|
401
|
-
const r = (
|
|
402
|
-
return
|
|
403
|
-
}, qe = (
|
|
404
|
-
const s =
|
|
400
|
+
}, Je = (i, s) => {
|
|
401
|
+
const r = (i == null ? void 0 : i.content) || "", a = (s == null ? void 0 : s.content) || "", n = r.match(/<(\w+)/), g = a.match(/<\/(\w+)/);
|
|
402
|
+
return n && g ? n[1] === g[1] : !1;
|
|
403
|
+
}, qe = (i) => {
|
|
404
|
+
const s = i.content || "";
|
|
405
405
|
if (s.match(/<(\w+)[^>]*\/>/))
|
|
406
406
|
return !0;
|
|
407
|
-
const r = [], a = /<(\w+)[^>]*>/g,
|
|
407
|
+
const r = [], a = /<(\w+)[^>]*>/g, n = /<\/(\w+)>/g;
|
|
408
408
|
let g, d;
|
|
409
|
-
a.lastIndex = 0,
|
|
409
|
+
a.lastIndex = 0, n.lastIndex = 0;
|
|
410
410
|
const l = [];
|
|
411
411
|
for (; (g = a.exec(s)) !== null; )
|
|
412
412
|
l.push({
|
|
@@ -414,7 +414,7 @@ const Be = {
|
|
|
414
414
|
tagName: g[1],
|
|
415
415
|
index: g.index
|
|
416
416
|
});
|
|
417
|
-
for (; (d =
|
|
417
|
+
for (; (d = n.exec(s)) !== null; )
|
|
418
418
|
l.push({
|
|
419
419
|
type: "close",
|
|
420
420
|
tagName: d[1],
|
|
@@ -430,28 +430,28 @@ const Be = {
|
|
|
430
430
|
r.pop();
|
|
431
431
|
}
|
|
432
432
|
return r.length === 0;
|
|
433
|
-
},
|
|
434
|
-
nodeType:
|
|
435
|
-
openNode:
|
|
433
|
+
}, R = (i) => ({
|
|
434
|
+
nodeType: i ? i.type.replace("_open", "") : "root",
|
|
435
|
+
openNode: i,
|
|
436
436
|
closeNode: null,
|
|
437
437
|
children: [],
|
|
438
|
-
vNodeKey: (
|
|
439
|
-
}), et = (
|
|
440
|
-
const r =
|
|
438
|
+
vNodeKey: (i == null ? void 0 : i.vNodeKey) || ""
|
|
439
|
+
}), et = (i, s) => {
|
|
440
|
+
const r = i.content.startsWith("</");
|
|
441
441
|
if (!s.length) {
|
|
442
|
-
|
|
442
|
+
i.nesting = r ? 0 : 1, s.push(i);
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
445
445
|
const a = s[s.length - 1];
|
|
446
|
-
Je(a,
|
|
447
|
-
}, de = (
|
|
446
|
+
Je(a, i) ? (i.nesting = -1, s.pop()) : r ? i.nesting = 0 : (i.nesting = 1, s.push(i));
|
|
447
|
+
}, de = (i) => {
|
|
448
448
|
const s = (l) => {
|
|
449
|
-
const c =
|
|
449
|
+
const c = R(l);
|
|
450
450
|
return l.children && l.children.length > 0 && (c.children = de(l.children)), c;
|
|
451
|
-
}, r =
|
|
451
|
+
}, r = R(null);
|
|
452
452
|
let a = r;
|
|
453
|
-
const
|
|
454
|
-
return
|
|
453
|
+
const n = [], g = [], d = [];
|
|
454
|
+
return i.forEach((l, c) => {
|
|
455
455
|
if (l.vNodeKey = `mc-markdown-content-key-${c}`, l.tokenIndex = c, l.type.includes("html_")) {
|
|
456
456
|
if (qe(l)) {
|
|
457
457
|
l.nesting = 0;
|
|
@@ -460,48 +460,48 @@ const Be = {
|
|
|
460
460
|
const p = l.type === "html_block" ? d : g;
|
|
461
461
|
et(l, p);
|
|
462
462
|
}
|
|
463
|
-
}),
|
|
463
|
+
}), i.forEach((l, c) => {
|
|
464
464
|
let p;
|
|
465
465
|
if (l.nesting === 1)
|
|
466
|
-
p =
|
|
466
|
+
p = R(l), a.children.push(p), n.push(a), a = p;
|
|
467
467
|
else if (l.nesting === -1) {
|
|
468
|
-
if (a.closeNode = l, !
|
|
468
|
+
if (a.closeNode = l, !n.length)
|
|
469
469
|
throw new Error("AST stack underflow.");
|
|
470
|
-
p =
|
|
470
|
+
p = n.pop(), a = p;
|
|
471
471
|
} else if (l.nesting === 0)
|
|
472
472
|
if (l.type === "inline" && l.children && l.children.length > 0) {
|
|
473
|
-
const
|
|
474
|
-
a.children.push(
|
|
473
|
+
const w = s(l);
|
|
474
|
+
a.children.push(w);
|
|
475
475
|
} else
|
|
476
476
|
a.children.push(l);
|
|
477
477
|
else
|
|
478
478
|
throw new Error(`Invalid nesting level found in token index ${c}.`);
|
|
479
479
|
}), r.children;
|
|
480
|
-
},
|
|
481
|
-
if (!
|
|
480
|
+
}, B = (i) => {
|
|
481
|
+
if (!i || !i.trim()) return [];
|
|
482
482
|
if (typeof window > "u" || typeof DOMParser > "u")
|
|
483
|
-
return [
|
|
484
|
-
const r = new DOMParser().parseFromString(`<body>${
|
|
485
|
-
return r.body.childNodes.forEach((
|
|
486
|
-
const d = ge(
|
|
483
|
+
return [i];
|
|
484
|
+
const r = new DOMParser().parseFromString(`<body>${i}</body>`, "text/html"), a = [];
|
|
485
|
+
return r.body.childNodes.forEach((n, g) => {
|
|
486
|
+
const d = ge(n);
|
|
487
487
|
(le(d) || typeof d == "string") && (typeof d == "object" && (d.key = g), a.push(d));
|
|
488
488
|
}), a;
|
|
489
|
-
}, ge = (
|
|
490
|
-
if (
|
|
491
|
-
if (
|
|
492
|
-
const s =
|
|
489
|
+
}, ge = (i) => {
|
|
490
|
+
if (i.nodeType === Node.TEXT_NODE) return i.textContent;
|
|
491
|
+
if (i.nodeType !== Node.ELEMENT_NODE) return i.textContent || "";
|
|
492
|
+
const s = i, r = {};
|
|
493
493
|
if (s.hasAttributes() && s.attributes)
|
|
494
|
-
for (const
|
|
495
|
-
r[
|
|
494
|
+
for (const n of Array.from(s.attributes))
|
|
495
|
+
r[n.name] = n.value;
|
|
496
496
|
const a = [];
|
|
497
|
-
return s.childNodes.length > 0 && s.childNodes.forEach((
|
|
498
|
-
const g = ge(
|
|
497
|
+
return s.childNodes.length > 0 && s.childNodes.forEach((n) => {
|
|
498
|
+
const g = ge(n);
|
|
499
499
|
(le(g) || typeof g == "string") && a.push(g);
|
|
500
|
-
}), z(s.tagName) ?
|
|
501
|
-
}, z = (
|
|
502
|
-
if (!
|
|
500
|
+
}), z(s.tagName) ? M(s.tagName.toLowerCase(), r, a) : (i == null ? void 0 : i.textContent) || "";
|
|
501
|
+
}, z = (i) => {
|
|
502
|
+
if (!i) return !1;
|
|
503
503
|
try {
|
|
504
|
-
return document.createElement(
|
|
504
|
+
return document.createElement(i), !0;
|
|
505
505
|
} catch {
|
|
506
506
|
return !1;
|
|
507
507
|
}
|
|
@@ -509,8 +509,8 @@ const Be = {
|
|
|
509
509
|
__name: "mdCard",
|
|
510
510
|
props: Ve,
|
|
511
511
|
emits: ["afterMdtInit", "typingStart", "typing", "typingEnd"],
|
|
512
|
-
setup(
|
|
513
|
-
const a = new ce(),
|
|
512
|
+
setup(i, { expose: s, emit: r }) {
|
|
513
|
+
const a = new ce(), n = i, g = r, d = we();
|
|
514
514
|
let l = null;
|
|
515
515
|
const c = Le({
|
|
516
516
|
breaks: !0,
|
|
@@ -524,25 +524,25 @@ const Be = {
|
|
|
524
524
|
}
|
|
525
525
|
return "";
|
|
526
526
|
},
|
|
527
|
-
...
|
|
528
|
-
}), p = x(0),
|
|
527
|
+
...n.mdOptions
|
|
528
|
+
}), p = x(0), w = x(!1), S = x(), I = () => {
|
|
529
529
|
var m;
|
|
530
|
-
let e =
|
|
531
|
-
if (
|
|
532
|
-
e =
|
|
533
|
-
const f = { ...
|
|
530
|
+
let e = n.content || "";
|
|
531
|
+
if (n.typing && w.value) {
|
|
532
|
+
e = n.content.slice(0, p.value) || "";
|
|
533
|
+
const f = { ...ne, ...n == null ? void 0 : n.typingOptions };
|
|
534
534
|
f.style === "cursor" ? e += '<span class="mc-typewriter mc-typewriter-cursor">|</span>' : (f.style === "color" || f.style === "gradient") && (e = e.slice(0, -5) + `<span class="mc-typewriter mc-typewriter-${f.style}">${e.slice(-5)}</span>`);
|
|
535
535
|
}
|
|
536
|
-
if (
|
|
537
|
-
const f = ((m =
|
|
536
|
+
if (n.enableThink) {
|
|
537
|
+
const f = ((m = n.thinkOptions) == null ? void 0 : m.customClass) || "mc-think-block";
|
|
538
538
|
e = (e == null ? void 0 : e.replace("<think>", `<div class="${f}">`).replace("</think>", "</div>")) || "";
|
|
539
539
|
}
|
|
540
|
-
const o = c.parse(e, {}), u = de(o), h =
|
|
541
|
-
|
|
542
|
-
},
|
|
540
|
+
const o = c.parse(e, {}), u = de(o), h = W(u);
|
|
541
|
+
S.value = M(k, h);
|
|
542
|
+
}, W = (e) => e.map((o) => N(o)), N = (e) => {
|
|
543
543
|
var o, u;
|
|
544
544
|
if (e.nodeType === "html_inline" || e.nodeType === "html_block") {
|
|
545
|
-
const h =
|
|
545
|
+
const h = B(((o = e.openNode) == null ? void 0 : o.content) || "")[0];
|
|
546
546
|
if (h) {
|
|
547
547
|
const m = (h == null ? void 0 : h.children) || [];
|
|
548
548
|
return Array.isArray(m) ? h.children = [...m, ...e.children.map((f) => N(f))] : h.children = [m, ...e.children.map((f) => N(f))], h;
|
|
@@ -550,59 +550,63 @@ const Be = {
|
|
|
550
550
|
return ((u = e.openNode) == null ? void 0 : u.content) || "";
|
|
551
551
|
}
|
|
552
552
|
if (e.nodeType === "inline") {
|
|
553
|
-
const h = c.renderer.render([e.openNode], c.options, {}), m =
|
|
554
|
-
return
|
|
553
|
+
const h = c.renderer.render([e.openNode], c.options, {}), m = B(h);
|
|
554
|
+
return M(k, m);
|
|
555
555
|
}
|
|
556
|
-
return
|
|
557
|
-
},
|
|
556
|
+
return Z(e) ? O(e) : P(e);
|
|
557
|
+
}, Z = (e) => "type" in e && "content" in e, O = (e) => {
|
|
558
558
|
if (e.type === "text")
|
|
559
559
|
return e.content;
|
|
560
560
|
if (e.type === "inline")
|
|
561
|
-
return
|
|
561
|
+
return Y(e);
|
|
562
562
|
if (e.type === "fence")
|
|
563
|
-
return
|
|
563
|
+
return E(e);
|
|
564
564
|
if (e.type === "softbreak")
|
|
565
|
-
return c.options.breaks ?
|
|
565
|
+
return c.options.breaks ? M("br") : `
|
|
566
566
|
`;
|
|
567
567
|
if (e.type === "html_block" || e.type === "html_inline")
|
|
568
|
-
return e.type === "html_block" ?
|
|
568
|
+
return e.type === "html_block" ? M("div", { innerHTML: e.content }) : M("span", { innerHTML: e.content });
|
|
569
|
+
if (e.type === "math_block" && e.markup === "$$") {
|
|
570
|
+
const o = c.renderer.render([e], c.options, {}), u = B(o);
|
|
571
|
+
return M(k, u);
|
|
572
|
+
}
|
|
569
573
|
if (e.tag) {
|
|
570
|
-
const o = z(e.tag) ? e.tag : "div", u =
|
|
571
|
-
return
|
|
574
|
+
const o = z(e.tag) ? e.tag : "div", u = j(e.attrs || []);
|
|
575
|
+
return M(o, { ...u, key: e.vNodeKey }, e.content);
|
|
572
576
|
}
|
|
573
577
|
return e.content;
|
|
574
|
-
}, Z = (e) => {
|
|
575
|
-
const o = c.renderer.render([e], c.options, {}), u = R(o);
|
|
576
|
-
return v(E, u);
|
|
577
578
|
}, Y = (e) => {
|
|
579
|
+
const o = c.renderer.render([e], c.options, {}), u = B(o);
|
|
580
|
+
return M(k, u);
|
|
581
|
+
}, P = (e) => {
|
|
578
582
|
var m, f, K, V, J, q, ee, te, se;
|
|
579
583
|
let o = "div";
|
|
580
584
|
(m = e.openNode) != null && m.tag && z((f = e.openNode) == null ? void 0 : f.tag) && (o = (K = e.openNode) == null ? void 0 : K.tag);
|
|
581
|
-
const u =
|
|
585
|
+
const u = j(((V = e.openNode) == null ? void 0 : V.attrs) || []);
|
|
582
586
|
if (((J = e.openNode) == null ? void 0 : J.type) === "fence")
|
|
583
|
-
return
|
|
587
|
+
return E(e.openNode);
|
|
584
588
|
if ((q = e.openNode) != null && q.tag) {
|
|
585
|
-
let
|
|
586
|
-
const ue = e.children.map((me) => N(me)), he =
|
|
587
|
-
return
|
|
589
|
+
let F = z((ee = e.openNode) == null ? void 0 : ee.tag) ? (te = e.openNode) == null ? void 0 : te.tag : "div";
|
|
590
|
+
const ue = e.children.map((me) => N(me)), he = j(((se = e.openNode) == null ? void 0 : se.attrs) || []);
|
|
591
|
+
return M(F, { ...he, key: e.vNodeKey }, ue);
|
|
588
592
|
}
|
|
589
|
-
const h = e.children.map((
|
|
590
|
-
return
|
|
591
|
-
},
|
|
593
|
+
const h = e.children.map((F) => N(F));
|
|
594
|
+
return M(o, { ...u, key: e.vNodeKey }, h);
|
|
595
|
+
}, E = (e) => {
|
|
592
596
|
var h;
|
|
593
597
|
const o = ((h = e.info) == null ? void 0 : h.replace(/<span\b[^>]*>/i, "").replace("</span>", "")) || "", u = e.content;
|
|
594
|
-
return
|
|
595
|
-
},
|
|
598
|
+
return Q(o, u, e.tokenIndex);
|
|
599
|
+
}, j = (e) => e.reduce((o, [u, h]) => (o[u] = h, o), {});
|
|
596
600
|
A(
|
|
597
601
|
() => {
|
|
598
602
|
var e;
|
|
599
|
-
return [
|
|
603
|
+
return [n.enableThink, (e = n.thinkOptions) == null ? void 0 : e.customClass, n.theme];
|
|
600
604
|
},
|
|
601
605
|
() => {
|
|
602
606
|
I();
|
|
603
607
|
}
|
|
604
608
|
);
|
|
605
|
-
const
|
|
609
|
+
const Q = (e, o, u) => {
|
|
606
610
|
const h = {
|
|
607
611
|
actions: d.actions ? () => {
|
|
608
612
|
var m;
|
|
@@ -617,25 +621,25 @@ const Be = {
|
|
|
617
621
|
return ((m = d.content) == null ? void 0 : m.call(d, { codeBlockData: { code: o, language: e } })) || null;
|
|
618
622
|
} : void 0
|
|
619
623
|
};
|
|
620
|
-
return
|
|
624
|
+
return M(
|
|
621
625
|
Ke,
|
|
622
626
|
{
|
|
623
627
|
language: e,
|
|
624
628
|
code: o,
|
|
625
629
|
blockIndex: u,
|
|
626
|
-
theme:
|
|
627
|
-
enableMermaid:
|
|
628
|
-
mermaidConfig:
|
|
630
|
+
theme: n.theme,
|
|
631
|
+
enableMermaid: n.enableMermaid,
|
|
632
|
+
mermaidConfig: n.mermaidConfig,
|
|
629
633
|
key: `code-block-${u}`
|
|
630
634
|
},
|
|
631
635
|
h
|
|
632
636
|
);
|
|
633
|
-
},
|
|
634
|
-
clearTimeout(l),
|
|
635
|
-
const e = { ...
|
|
637
|
+
}, G = () => {
|
|
638
|
+
clearTimeout(l), w.value = !0, g("typingStart");
|
|
639
|
+
const e = { ...ne, ...n == null ? void 0 : n.typingOptions }, o = () => {
|
|
636
640
|
let u = e.step;
|
|
637
|
-
if (Array.isArray(e.step) && (u = e.step[0] + Math.floor(Math.random() * (e.step[1] - e.step[0]))), p.value += u, I(), g("typing"), p.value >=
|
|
638
|
-
|
|
641
|
+
if (Array.isArray(e.step) && (u = e.step[0] + Math.floor(Math.random() * (e.step[1] - e.step[0]))), p.value += u, I(), g("typing"), p.value >= n.content.length) {
|
|
642
|
+
H(), I();
|
|
639
643
|
return;
|
|
640
644
|
}
|
|
641
645
|
l = setTimeout(o, e.interval);
|
|
@@ -643,37 +647,37 @@ const Be = {
|
|
|
643
647
|
l = setTimeout(o);
|
|
644
648
|
};
|
|
645
649
|
A(
|
|
646
|
-
() =>
|
|
650
|
+
() => n.content,
|
|
647
651
|
(e, o) => {
|
|
648
|
-
if (!
|
|
652
|
+
if (!n.typing) {
|
|
649
653
|
p.value = (e == null ? void 0 : e.length) || 0, I();
|
|
650
654
|
return;
|
|
651
655
|
}
|
|
652
|
-
e.indexOf(o) === -1 && (p.value = 0),
|
|
656
|
+
e.indexOf(o) === -1 && (p.value = 0), _(() => G());
|
|
653
657
|
},
|
|
654
658
|
{ immediate: !0 }
|
|
655
659
|
);
|
|
656
|
-
const
|
|
657
|
-
|
|
660
|
+
const H = () => {
|
|
661
|
+
w.value = !1, g("typingEnd");
|
|
658
662
|
};
|
|
659
663
|
A(
|
|
660
|
-
() =>
|
|
664
|
+
() => n.customXssRules,
|
|
661
665
|
(e) => {
|
|
662
666
|
a.setCustomXssRules(e), I();
|
|
663
667
|
},
|
|
664
668
|
{ deep: !1 }
|
|
665
669
|
), A(
|
|
666
|
-
() =>
|
|
670
|
+
() => n.mdPlugins,
|
|
667
671
|
(e) => {
|
|
668
672
|
a.setMdPlugins(e, c), I();
|
|
669
673
|
},
|
|
670
674
|
{ immediate: !0, deep: !1 }
|
|
671
675
|
);
|
|
672
|
-
const t =
|
|
676
|
+
const t = U(() => n.theme === "dark" ? "mc-markdown-render-dark" : "mc-markdown-render-light");
|
|
673
677
|
return re(() => {
|
|
674
678
|
g("afterMdtInit", c);
|
|
675
|
-
}), s({ mdt: c }), (e, o) => (
|
|
676
|
-
|
|
679
|
+
}), s({ mdt: c }), (e, o) => (C(), v(
|
|
680
|
+
k,
|
|
677
681
|
null,
|
|
678
682
|
[
|
|
679
683
|
y(
|
|
@@ -682,21 +686,21 @@ const Be = {
|
|
|
682
686
|
class: T(["mc-markdown-render", t.value])
|
|
683
687
|
},
|
|
684
688
|
[
|
|
685
|
-
(
|
|
689
|
+
(C(), ve(Ne(S.value)))
|
|
686
690
|
],
|
|
687
691
|
2
|
|
688
692
|
/* CLASS */
|
|
689
693
|
),
|
|
690
|
-
|
|
694
|
+
b("v-if", !0)
|
|
691
695
|
],
|
|
692
696
|
64
|
|
693
697
|
/* STABLE_FRAGMENT */
|
|
694
698
|
));
|
|
695
699
|
}
|
|
696
|
-
}),
|
|
697
|
-
|
|
698
|
-
|
|
700
|
+
}), ie = /* @__PURE__ */ ae(tt, [["__scopeId", "data-v-9dfccde4"]]);
|
|
701
|
+
ie.install = (i) => {
|
|
702
|
+
i.component("McMarkdownCard", ie);
|
|
699
703
|
};
|
|
700
704
|
export {
|
|
701
|
-
|
|
705
|
+
ie as McMarkdownCard
|
|
702
706
|
};
|