azs-markdown 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +547 -27
  2. package/dist/{_basePickBy-BoNhky5_.js → _basePickBy-CodpxYMm.js} +2 -2
  3. package/dist/{_baseUniq-CwgXSVUs.js → _baseUniq-KDeHsuJJ.js} +1 -1
  4. package/dist/{arc-BDaMZnNe.js → arc-DLRUPS9O.js} +1 -1
  5. package/dist/{architecture-O4VJ6CD3-vs684nmx.js → architecture-O4VJ6CD3-CTqWl6CG.js} +1 -1
  6. package/dist/{architectureDiagram-W76B3OCA-QSgHBKBf.js → architectureDiagram-W76B3OCA-BjD9CIdZ.js} +3 -3
  7. package/dist/azs-markdown.js +5 -0
  8. package/dist/{azs-markdown.umd.js → azs-markdown.umd.cjs} +279 -277
  9. package/dist/{blockDiagram-QIGZ2CNN-CFwbDZq1.js → blockDiagram-QIGZ2CNN-CChdJ_XF.js} +5 -5
  10. package/dist/{c4Diagram-FPNF74CW-DN1nqHpM.js → c4Diagram-FPNF74CW-Bk7OYntZ.js} +2 -2
  11. package/dist/{channel-iVx7CL3u.js → channel-BSXPEktK.js} +1 -1
  12. package/dist/{chunk-4BX2VUAB-Caa0BGDX.js → chunk-4BX2VUAB-hWMmxFrf.js} +1 -1
  13. package/dist/{chunk-55IACEB6-Dp3mPK51.js → chunk-55IACEB6-BmqXA9UE.js} +1 -1
  14. package/dist/{chunk-FMBD7UC4-BUFhb8YY.js → chunk-FMBD7UC4-BtNm3ko2.js} +1 -1
  15. package/dist/{chunk-K7UQS3LO-Dc1MCGS-.js → chunk-K7UQS3LO-DwdDWNPB.js} +4 -4
  16. package/dist/{chunk-QN33PNHL-rtk8AfAe.js → chunk-QN33PNHL-KdJgTa82.js} +1 -1
  17. package/dist/{chunk-QZHKN3VN-CMMyqXcj.js → chunk-QZHKN3VN-DAxoHvQI.js} +1 -1
  18. package/dist/{chunk-TVAH2DTR-Vc8Owhc3.js → chunk-TVAH2DTR-DaoLvcWg.js} +3 -3
  19. package/dist/{chunk-TZMSLE5B-Bm03bA2C.js → chunk-TZMSLE5B-C3iiv99H.js} +1 -1
  20. package/dist/{classDiagram-v2-RKCZMP56-DVmn8pnT.js → classDiagram-KNZD7YFC-QjPODZci.js} +2 -2
  21. package/dist/{classDiagram-KNZD7YFC-DVmn8pnT.js → classDiagram-v2-RKCZMP56-QjPODZci.js} +2 -2
  22. package/dist/{clone-BDznloAW.js → clone-D2FU25UE.js} +1 -1
  23. package/dist/{cose-bilkent-S5V4N54A-DyIpo8-z.js → cose-bilkent-S5V4N54A-DNXf1b8E.js} +1 -1
  24. package/dist/{dagre-5GWH7T2D-DpJu8Ofq.js → dagre-5GWH7T2D-z2LdT-We.js} +6 -6
  25. package/dist/{diagram-N5W7TBWH-BAXIRnFp.js → diagram-N5W7TBWH-BzdkTbRN.js} +4 -4
  26. package/dist/{diagram-QEK2KX5R-8468bThS.js → diagram-QEK2KX5R-CD5Gg4Me.js} +3 -3
  27. package/dist/{diagram-S2PKOQOG-B-zheMff.js → diagram-S2PKOQOG-B7Fqi3Bx.js} +3 -3
  28. package/dist/{erDiagram-AWTI2OKA-D90-iNAv.js → erDiagram-AWTI2OKA-DaOFStSf.js} +4 -4
  29. package/dist/{flowDiagram-PVAE7QVJ-DvUsR4DX.js → flowDiagram-PVAE7QVJ-Dcduiouw.js} +5 -5
  30. package/dist/{ganttDiagram-OWAHRB6G-CG1rEuNH.js → ganttDiagram-OWAHRB6G-CxBYHLG7.js} +2 -2
  31. package/dist/{gitGraph-ZV4HHKMB-t7wsk99p.js → gitGraph-ZV4HHKMB-CH6QJRaI.js} +1 -1
  32. package/dist/{gitGraphDiagram-NY62KEGX-BAq5Xvts.js → gitGraphDiagram-NY62KEGX-DmRlWZQF.js} +4 -4
  33. package/dist/{graph-BZ1O1u_J.js → graph-DG6rmJih.js} +2 -2
  34. package/dist/{index-Cc5Vj81T.js → index-D-9RvHe2.js} +22000 -21633
  35. package/dist/info-63CPKGFF-Cl0QcZvf.js +5 -0
  36. package/dist/{infoDiagram-STP46IZ2-CpHPtkx5.js → infoDiagram-STP46IZ2-ZNiU4F2h.js} +2 -2
  37. package/dist/{journeyDiagram-BIP6EPQ6-D3xLQBE7.js → journeyDiagram-BIP6EPQ6-qSndGy3m.js} +4 -4
  38. package/dist/{kanban-definition-6OIFK2YF-DgE_SK2f.js → kanban-definition-6OIFK2YF-Clj2YJqC.js} +2 -2
  39. package/dist/{layout-CKIOihIG.js → layout-B3ZDGCM0.js} +4 -4
  40. package/dist/{linear-DYGXzUK2.js → linear-DWUlRWlz.js} +1 -1
  41. package/dist/{mermaid-parser.core-CBX7YYAI.js → mermaid-parser.core-DZnb6wFE.js} +11 -11
  42. package/dist/{mindmap-definition-Q6HEUPPD-CT77gEfG.js → mindmap-definition-Q6HEUPPD-Don1nN2I.js} +3 -3
  43. package/dist/{packet-HUATNLJX-BvnN-ZMj.js → packet-HUATNLJX-7RzrPMXy.js} +1 -1
  44. package/dist/pie-WTHONI2E-Ch9-F_P3.js +5 -0
  45. package/dist/{pieDiagram-ADFJNKIX-Beegh6AK.js → pieDiagram-ADFJNKIX-DCV3fRau.js} +4 -4
  46. package/dist/{quadrantDiagram-LMRXKWRM-VwuOfKS2.js → quadrantDiagram-LMRXKWRM-CbDHF_Hk.js} +2 -2
  47. package/dist/radar-NJJJXTRR-xPFGk7JS.js +5 -0
  48. package/dist/{requirementDiagram-4UW4RH46-CyGxJGHA.js → requirementDiagram-4UW4RH46-DImXgwsy.js} +3 -3
  49. package/dist/{sankeyDiagram-GR3RE2ED-BTDv7Ojc.js → sankeyDiagram-GR3RE2ED-DFJynoMw.js} +1 -1
  50. package/dist/{sequenceDiagram-C3RYC4MD-BE4rMtH8.js → sequenceDiagram-C3RYC4MD-B9AVlYEc.js} +3 -3
  51. package/dist/{stateDiagram-KXAO66HF-B4wtAMl8.js → stateDiagram-KXAO66HF-Bf0EYemQ.js} +4 -4
  52. package/dist/{stateDiagram-v2-UMBNRL4Z-DcTPID3t.js → stateDiagram-v2-UMBNRL4Z-BCnWiZxa.js} +2 -2
  53. package/dist/{timeline-definition-XQNQX7LJ-CHF1Z_a1.js → timeline-definition-XQNQX7LJ-D1zIgwrs.js} +2 -2
  54. package/dist/{treemap-75Q7IDZK-DDfn7BQt.js → treemap-75Q7IDZK-Bx2H2_tR.js} +1 -1
  55. package/dist/{xychartDiagram-6GGTOJPD-D-ugUMX6.js → xychartDiagram-6GGTOJPD-DLJjVC89.js} +2 -2
  56. package/package.json +2 -1
  57. package/dist/azs-markdown.es.js +0 -4
  58. package/dist/info-63CPKGFF-DezHrG8a.js +0 -5
  59. package/dist/pie-WTHONI2E-Bdz8AGHu.js +0 -5
  60. package/dist/radar-NJJJXTRR-p2SBA9n9.js +0 -5
  61. package/dist/style.css +0 -1
package/README.md CHANGED
@@ -1,39 +1,559 @@
1
- # azs-markdown
1
+ cd D:\azs\azs-markdown && echo "# AzsMarkdown 组件文档
2
2
 
3
- #### 介绍
4
- {**以下是 Gitee 平台说明,您可以替换此简介**
5
- Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
6
- 无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
3
+ ## 简介
7
4
 
8
- #### 软件架构
9
- 软件架构说明
5
+ \`AzsMarkdown\` 是一个基于 Vue3 的 Markdown 渲染组件,支持数学公式、表格、图片自定义渲染、引用自定义插槽等扩展功能,适用于需要高度自定义 Markdown 展示的场景。
10
6
 
7
+ ---
11
8
 
12
- #### 安装教程
9
+ ## 主要特性
13
10
 
14
- 1. xxxx
15
- 2. xxxx
16
- 3. xxxx
11
+ - 支持标准 Markdown 语法
12
+ - 支持 GFM 表格、任务列表等扩展
13
+ - 支持数学公式(KaTeX 渲染)
14
+ - 支持自定义图片渲染(插槽)
15
+ - 支持自定义引用/引源渲染(插槽)
16
+ - 支持自定义正则扩展语法
17
+ - 支持 mermaid 流程图(如有集成)
17
18
 
18
- #### 使用说明
19
+ ---
19
20
 
20
- 1. xxxx
21
- 2. xxxx
22
- 3. xxxx
21
+ ## 快速开始
23
22
 
24
- #### 参与贡献
23
+ ### 1. 引入组件
25
24
 
26
- 1. Fork 本仓库
27
- 2. 新建 Feat_xxx 分支
28
- 3. 提交代码
29
- 4. 新建 Pull Request
25
+ \`\`\`vue
26
+ <template>
27
+ <AzsMarkdown :markdown-value=\"markdownContent\" />
28
+ </template>
30
29
 
30
+ <script setup>
31
+ import { AzsMarkdown } from 'azs-markdown'
32
+ </script>
33
+ \`\`\`
31
34
 
32
- #### 特技
35
+ ### 2. 基本使用
33
36
 
34
- 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
35
- 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
36
- 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
37
- 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
38
- 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
39
- 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
37
+ \`\`\`vue
38
+ <template>
39
+ <div>
40
+ <AzsMarkdown
41
+ :markdown-value=\"markdownText\"
42
+ :is-view-html=\"false\"
43
+ :custom-regex=\"/\\[\\[(\\d+)\\]\\]/g\"
44
+ />
45
+ </div>
46
+ </template>
47
+
48
+ <script setup>
49
+ import { ref } from 'vue'
50
+ import { AzsMarkdown } from 'azs-markdown'
51
+
52
+ const markdownText = ref(\`# 标题
53
+ 这是一段 **粗体** 文本和 *斜体* 文本。
54
+
55
+ ## 表格示例
56
+ | 列1 | 列2 | 列3 |
57
+ |-----|-----|-----|
58
+ | 数据1 | 数据2 | 数据3 |
59
+ | 数据4 | 数据5 | 数据6 |
60
+
61
+ ## 数学公式
62
+ 行内公式:$E = mc^2$
63
+
64
+ 块级公式:
65
+ $$
66
+ \\sum_{i=1}^{n} x_i = x_1 + x_2 + \\cdots + x_n
67
+ $$
68
+
69
+ ## 自定义引用
70
+ 这里有一个引用 [[1]] 和另一个引用 [[2]]。
71
+ \`)
72
+ </script>
73
+ \`\`\`
74
+
75
+ ---
76
+
77
+ ## Props 参数
78
+
79
+ ### markdownValue
80
+ - **类型**: \`string\`
81
+ - **默认值**: \`\"\"\`
82
+ - **必需**: 是
83
+ - **描述**: 要渲染的 Markdown 内容
84
+
85
+ \`\`\`vue
86
+ <AzsMarkdown :markdown-value=\"'# Hello World'\" />
87
+ \`\`\`
88
+
89
+ ### isViewHtml
90
+ - **类型**: \`boolean\`
91
+ - **默认值**: \`undefined\`
92
+ - **必需**: 否
93
+ - **描述**: 是否预览 HTML 内容(调试用)
94
+
95
+ \`\`\`vue
96
+ <AzsMarkdown
97
+ :markdown-value=\"content\"
98
+ :is-view-html=\"true\"
99
+ />
100
+ \`\`\`
101
+
102
+ ### customRegex
103
+ - **类型**: \`RegExp\`
104
+ - **默认值**: \`/\\[\\[(\\d+)\\]\\]/g\`
105
+ - **必需**: 否
106
+ - **描述**: 自定义正则表达式,用于匹配特殊格式的引用
107
+
108
+ \`\`\`vue
109
+ <AzsMarkdown
110
+ :markdown-value=\"content\"
111
+ :custom-regex=\"/\\[\\[ref-(\\d+)\\]\\]/g\"
112
+ />
113
+ \`\`\`
114
+
115
+ ---
116
+
117
+ ## 插槽 (Slots)
118
+
119
+ ### image 插槽
120
+ 用于自定义图片渲染
121
+
122
+ \`\`\`vue
123
+ <template>
124
+ <AzsMarkdown :markdown-value=\"content\">
125
+ <template #image=\"{ src, alt, title }\">
126
+ <div class=\"custom-image-container\">
127
+ <img
128
+ :src=\"src\"
129
+ :alt=\"alt\"
130
+ :title=\"title\"
131
+ class=\"custom-image\"
132
+ @click=\"handleImageClick(src)\"
133
+ />
134
+ <div class=\"image-caption\">{{ title || alt }}</div>
135
+ </div>
136
+ </template>
137
+ </AzsMarkdown>
138
+ </template>
139
+
140
+ <script setup>
141
+ const handleImageClick = (src) => {
142
+ // 自定义图片点击处理
143
+ console.log('点击了图片:', src)
144
+ }
145
+ </script>
146
+
147
+ <style>
148
+ .custom-image-container {
149
+ text-align: center;
150
+ margin: 16px 0;
151
+ }
152
+
153
+ .custom-image {
154
+ max-width: 100%;
155
+ border-radius: 8px;
156
+ box-shadow: 0 4px 12px rgba(0,0,0,0.1);
157
+ }
158
+
159
+ .image-caption {
160
+ margin-top: 8px;
161
+ font-size: 14px;
162
+ color: #666;
163
+ font-style: italic;
164
+ }
165
+ </style>
166
+ \`\`\`
167
+
168
+ ### source 插槽
169
+ 用于自定义引用/引源渲染
170
+
171
+ \`\`\`vue
172
+ <template>
173
+ <AzsMarkdown
174
+ :markdown-value=\"content\"
175
+ :custom-regex=\"/\\[\\[(\\d+)\\]\\]/g\"
176
+ >
177
+ <template #source=\"{ refId, displayText }\">
178
+ <span
179
+ class=\"custom-source-ref\"
180
+ @click=\"handleSourceClick(refId)\"
181
+ >
182
+ [引用 {{ refId }}]
183
+ </span>
184
+ </template>
185
+ </AzsMarkdown>
186
+ </template>
187
+
188
+ <script setup>
189
+ const handleSourceClick = (refId) => {
190
+ // 自定义引用点击处理
191
+ console.log('点击了引用:', refId)
192
+ // 可以跳转到对应的引用详情页面
193
+ }
194
+ </script>
195
+
196
+ <style>
197
+ .custom-source-ref {
198
+ background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
199
+ color: white;
200
+ padding: 2px 8px;
201
+ border-radius: 12px;
202
+ font-size: 12px;
203
+ cursor: pointer;
204
+ transition: all 0.3s ease;
205
+ }
206
+
207
+ .custom-source-ref:hover {
208
+ transform: scale(1.05);
209
+ box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
210
+ }
211
+ </style>
212
+ \`\`\`
213
+
214
+ ---
215
+
216
+ ## 高级用法
217
+
218
+ ### 自定义正则表达式
219
+ 组件支持通过 \`customRegex\` 参数自定义匹配模式:
220
+
221
+ \`\`\`vue
222
+ <template>
223
+ <AzsMarkdown
224
+ :markdown-value=\"content\"
225
+ :custom-regex=\"/\\{\\{ref:(\\d+)\\}\\}/g\"
226
+ >
227
+ <template #source=\"{ refId }\">
228
+ <span class=\"ref-tag\">参考文献 {{ refId }}</span>
229
+ </template>
230
+ </AzsMarkdown>
231
+ </template>
232
+
233
+ <script setup>
234
+ const content = \`这是一段文本,包含自定义引用格式 {{ref:1}} 和 {{ref:2}}。\`
235
+ </script>
236
+ \`\`\`
237
+
238
+ ### 组合使用多个插槽
239
+ \`\`\`vue
240
+ <template>
241
+ <AzsMarkdown :markdown-value=\"content\">
242
+ <!-- 自定义图片渲染 -->
243
+ <template #image=\"{ src, alt, title }\">
244
+ <div class=\"image-wrapper\">
245
+ <img :src=\"src\" :alt=\"alt\" />
246
+ <div class=\"image-overlay\">
247
+ <button @click=\"downloadImage(src)\">下载</button>
248
+ </div>
249
+ </div>
250
+ </template>
251
+
252
+ <!-- 自定义引用渲染 -->
253
+ <template #source=\"{ refId }\">
254
+ <span
255
+ class=\"reference-link\"
256
+ @click=\"showReference(refId)\"
257
+ >
258
+ [{{ refId }}]
259
+ </span>
260
+ </template>
261
+ </AzsMarkdown>
262
+ </template>
263
+
264
+ <script setup>
265
+ const downloadImage = (src) => {
266
+ // 下载图片逻辑
267
+ }
268
+
269
+ const showReference = (refId) => {
270
+ // 显示引用详情逻辑
271
+ }
272
+ </script>
273
+ \`\`\`
274
+
275
+ ---
276
+
277
+ ## 样式定制
278
+
279
+ 组件提供了丰富的 CSS 类名,方便自定义样式:
280
+
281
+ ### 表格样式
282
+ \`\`\`css
283
+ /* 表格容器 */
284
+ .azs-table-container {
285
+ overflow-x: auto;
286
+ margin: 1rem 0;
287
+ border-radius: 6px;
288
+ border: 1px solid #e1e4e8;
289
+ }
290
+
291
+ /* 表格 */
292
+ .azs-table {
293
+ width: 100%;
294
+ border-collapse: collapse;
295
+ border-spacing: 0;
296
+ font-size: 14px;
297
+ background-color: #fff;
298
+ }
299
+
300
+ /* 表头 */
301
+ .azs-table th {
302
+ background-color: #f6f8fa;
303
+ font-weight: 600;
304
+ color: #24292e;
305
+ border: 1px solid #e1e4e8;
306
+ padding: 8px 12px;
307
+ }
308
+
309
+ /* 表格单元格 */
310
+ .azs-table td {
311
+ border: 1px solid #e1e4e8;
312
+ padding: 8px 12px;
313
+ text-align: left;
314
+ vertical-align: top;
315
+ }
316
+
317
+ /* 表格行悬停效果 */
318
+ .azs-table tbody tr:hover {
319
+ background-color: #f1f8ff;
320
+ }
321
+ \`\`\`
322
+
323
+ ### 引用样式
324
+ \`\`\`css
325
+ /* 默认引用样式 */
326
+ ._azs-source-ref {
327
+ background-color: #e3f2fd;
328
+ color: #1976d2;
329
+ padding: 2px 6px;
330
+ border-radius: 4px;
331
+ font-size: 0.9em;
332
+ border: 1px solid #bbdefb;
333
+ }
334
+
335
+ /* 可点击引用 */
336
+ .azs-custom-ref--clickable {
337
+ cursor: pointer;
338
+ transition: all 0.2s ease;
339
+ }
340
+
341
+ .azs-custom-ref--clickable:hover {
342
+ background-color: #bbdefb;
343
+ transform: translateY(-1px);
344
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
345
+ }
346
+ \`\`\`
347
+
348
+ ---
349
+
350
+ ## 完整示例
351
+
352
+ \`\`\`vue
353
+ <template>
354
+ <div class=\"markdown-demo\">
355
+ <h2>AzsMarkdown 完整示例</h2>
356
+
357
+ <AzsMarkdown
358
+ :markdown-value=\"demoContent\"
359
+ :custom-regex=\"/\\[\\[(\\d+)\\]\\]/g\"
360
+ >
361
+ <!-- 自定义图片渲染 -->
362
+ <template #image=\"{ src, alt, title }\">
363
+ <div class=\"custom-image-wrapper\">
364
+ <img
365
+ :src=\"src\"
366
+ :alt=\"alt\"
367
+ :title=\"title\"
368
+ class=\"demo-image\"
369
+ @click=\"previewImage(src)\"
370
+ />
371
+ <div class=\"image-actions\">
372
+ <button @click=\"previewImage(src)\">预览</button>
373
+ <button @click=\"downloadImage(src)\">下载</button>
374
+ </div>
375
+ </div>
376
+ </template>
377
+
378
+ <!-- 自定义引用渲染 -->
379
+ <template #source=\"{ refId }\">
380
+ <span
381
+ class=\"demo-reference\"
382
+ @click=\"showReferenceDetail(refId)\"
383
+ >
384
+ [{{ refId }}]
385
+ </span>
386
+ </template>
387
+ </AzsMarkdown>
388
+ </div>
389
+ </template>
390
+
391
+ <script setup>
392
+ import { ref } from 'vue'
393
+ import { AzsMarkdown } from 'azs-markdown'
394
+
395
+ const demoContent = ref(\`# AzsMarkdown 演示
396
+
397
+ ## 基础功能
398
+
399
+ 这是一个 **粗体** 文本和 *斜体* 文本的示例。
400
+
401
+ ### 列表
402
+ - 项目 1
403
+ - 项目 2
404
+ - 子项目 2.1
405
+ - 子项目 2.2
406
+
407
+ ### 代码块
408
+ \`\`\`javascript
409
+ function hello() {
410
+ console.log('Hello, AzsMarkdown!')
411
+ }
412
+ \`\`\`
413
+
414
+ ## 表格示例
415
+ | 功能 | 状态 | 描述 |
416
+ |------|------|------|
417
+ | 基础 Markdown | ✅ | 支持标准语法 |
418
+ | 表格 | ✅ | GFM 表格支持 |
419
+ | 数学公式 | ✅ | KaTeX 渲染 |
420
+ | 自定义插槽 | ✅ | 图片和引用插槽 |
421
+
422
+ ## 数学公式
423
+ 行内公式:$E = mc^2$
424
+
425
+ 块级公式:
426
+ $$
427
+ \\int_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}
428
+ $$
429
+
430
+ ## 自定义引用
431
+ 这里有一些引用 [[1]] 和 [[2]],点击可以查看详情。
432
+
433
+ ## 图片示例
434
+ ![示例图片](https://via.placeholder.com/400x200/667eea/ffffff?text=AzsMarkdown)
435
+ \`)
436
+
437
+ // 事件处理函数
438
+ const previewImage = (src) => {
439
+ console.log('预览图片:', src)
440
+ // 实现图片预览逻辑
441
+ }
442
+
443
+ const downloadImage = (src) => {
444
+ console.log('下载图片:', src)
445
+ // 实现图片下载逻辑
446
+ }
447
+
448
+ const showReferenceDetail = (refId) => {
449
+ console.log('显示引用详情:', refId)
450
+ // 实现引用详情显示逻辑
451
+ }
452
+ </script>
453
+
454
+ <style scoped>
455
+ .markdown-demo {
456
+ max-width: 800px;
457
+ margin: 0 auto;
458
+ padding: 20px;
459
+ }
460
+
461
+ .custom-image-wrapper {
462
+ position: relative;
463
+ display: inline-block;
464
+ margin: 16px 0;
465
+ }
466
+
467
+ .demo-image {
468
+ max-width: 100%;
469
+ border-radius: 8px;
470
+ box-shadow: 0 4px 12px rgba(0,0,0,0.1);
471
+ transition: transform 0.3s ease;
472
+ }
473
+
474
+ .demo-image:hover {
475
+ transform: scale(1.02);
476
+ }
477
+
478
+ .image-actions {
479
+ position: absolute;
480
+ top: 8px;
481
+ right: 8px;
482
+ display: flex;
483
+ gap: 8px;
484
+ opacity: 0;
485
+ transition: opacity 0.3s ease;
486
+ }
487
+
488
+ .custom-image-wrapper:hover .image-actions {
489
+ opacity: 1;
490
+ }
491
+
492
+ .image-actions button {
493
+ background: rgba(0,0,0,0.7);
494
+ color: white;
495
+ border: none;
496
+ padding: 4px 8px;
497
+ border-radius: 4px;
498
+ font-size: 12px;
499
+ cursor: pointer;
500
+ }
501
+
502
+ .demo-reference {
503
+ background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
504
+ color: white;
505
+ padding: 2px 8px;
506
+ border-radius: 12px;
507
+ font-size: 12px;
508
+ cursor: pointer;
509
+ transition: all 0.3s ease;
510
+ margin: 0 2px;
511
+ }
512
+
513
+ .demo-reference:hover {
514
+ transform: scale(1.1);
515
+ box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
516
+ }
517
+ </style>
518
+ \`\`\`
519
+
520
+ ---
521
+
522
+ ## API 参考
523
+
524
+ ### Props
525
+ | 参数 | 类型 | 默认值 | 描述 |
526
+ |------|------|--------|------|
527
+ | markdownValue | string | \"\" | 要渲染的 Markdown 内容 |
528
+ | isViewHtml | boolean | undefined | 是否预览 HTML 内容 |
529
+ | customRegex | RegExp | /\\[\\[(\\d+)\\]\\]/g | 自定义正则表达式 |
530
+
531
+ ### Slots
532
+ | 插槽名 | 参数 | 描述 |
533
+ |--------|------|------|
534
+ | image | { src, alt, title } | 自定义图片渲染 |
535
+ | source | { refId, displayText } | 自定义引用渲染 |
536
+
537
+ ### 事件
538
+ 组件本身不直接发出事件,但可以通过插槽中的组件发出自定义事件。
539
+
540
+ ---
541
+
542
+ ## 注意事项
543
+
544
+ 1. **正则表达式**: 确保 \`customRegex\` 参数包含捕获组,用于提取引用 ID
545
+ 2. **图片处理**: 使用 \`image\` 插槽时,需要处理图片加载失败的情况
546
+ 3. **引用点击**: 引用插槽中的点击事件需要自行实现跳转或弹窗逻辑
547
+ 4. **样式覆盖**: 使用 \`:deep()\` 选择器来覆盖组件内部样式
548
+ 5. **性能优化**: 对于大量 Markdown 内容,建议使用虚拟滚动或分页
549
+
550
+ ---
551
+
552
+ ## 更新日志
553
+
554
+ ### v1.0.0
555
+ - 初始版本发布
556
+ - 支持基础 Markdown 渲染
557
+ - 支持自定义图片和引用插槽
558
+ - 支持自定义正则表达式
559
+ - 支持表格和数学公式渲染" > README.md
@@ -1,5 +1,5 @@
1
- import { e as x, c as O, g as m, k as P, h as p, j as w, l as A, m as c, n as I, t as N, o as _ } from "./_baseUniq-CwgXSVUs.js";
2
- import { aS as g, aA as E, aT as F, aU as M, aV as T, aW as l, aX as $, aY as B, aZ as S, a_ as y } from "./index-Cc5Vj81T.js";
1
+ import { e as x, c as O, g as m, k as P, h as p, j as w, l as A, m as c, n as I, t as N, o as _ } from "./_baseUniq-KDeHsuJJ.js";
2
+ import { aS as g, aA as E, aT as F, aU as M, aV as T, aW as l, aX as $, aY as B, aZ as S, a_ as y } from "./index-D-9RvHe2.js";
3
3
  var G = /\s/;
4
4
  function H(n) {
5
5
  for (var r = n.length; r-- && G.test(n.charAt(r)); )
@@ -1,4 +1,4 @@
1
- import { bf as S, bg as Rn, aX as T, bh as w, bi as xn, bj as mn, aW as sn, bk as Mn, bl as un, bm as x, aU as U, bn as Cn, bo as on, bp as Fn, bq as E, bd as gn, br as R, aS as ln, bs as Dn, bt as D, bu as Gn, bv as Un, bw as $, a_ as Bn, bx as Nn, aV as Kn, by as X, bz as jn, bA as Hn, aZ as qn, aY as cn, bb as Yn, bB as M } from "./index-Cc5Vj81T.js";
1
+ import { bf as S, bg as Rn, aX as T, bh as w, bi as xn, bj as mn, aW as sn, bk as Mn, bl as un, bm as x, aU as U, bn as Cn, bo as on, bp as Fn, bq as E, bd as gn, br as R, aS as ln, bs as Dn, bt as D, bu as Gn, bv as Un, bw as $, a_ as Bn, bx as Nn, aV as Kn, by as X, bz as jn, bA as Hn, aZ as qn, aY as cn, bb as Yn, bB as M } from "./index-D-9RvHe2.js";
2
2
  var Zn = "[object Symbol]";
3
3
  function B(n) {
4
4
  return typeof n == "symbol" || S(n) && Rn(n) == Zn;
@@ -1,4 +1,4 @@
1
- import { a0 as ln, a1 as an, a2 as y, a3 as tn, a4 as H, a5 as q, a6 as _, a7 as un, a8 as B, a9 as rn, aa as L, ab as o, ac as sn, ad as on, ae as fn } from "./index-Cc5Vj81T.js";
1
+ import { a0 as ln, a1 as an, a2 as y, a3 as tn, a4 as H, a5 as q, a6 as _, a7 as un, a8 as B, a9 as rn, aa as L, ab as o, ac as sn, ad as on, ae as fn } from "./index-D-9RvHe2.js";
2
2
  function cn(l) {
3
3
  return l.innerRadius;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { A as c, e as t } from "./mermaid-parser.core-CBX7YYAI.js";
1
+ import { A as c, e as t } from "./mermaid-parser.core-DZnb6wFE.js";
2
2
  export {
3
3
  c as ArchitectureModule,
4
4
  t as createArchitectureServices
@@ -1,6 +1,6 @@
1
- import { aI as ye, aJ as ke, _ as dt, H as Ze, V as qe, l as Re, b as Qe, a as Je, p as Ke, q as je, g as _e, s as tr, y as er, D as rr, E as ir, F as ar, c as Ee, ak as me, aK as ve, i as nr, d as or, aL as sr, aM as hr } from "./index-Cc5Vj81T.js";
2
- import { p as lr } from "./chunk-4BX2VUAB-Caa0BGDX.js";
3
- import { p as fr } from "./mermaid-parser.core-CBX7YYAI.js";
1
+ import { aI as ye, aJ as ke, _ as dt, H as Ze, V as qe, l as Re, b as Qe, a as Je, p as Ke, q as je, g as _e, s as tr, y as er, D as rr, E as ir, F as ar, c as Ee, ak as me, aK as ve, i as nr, d as or, aL as sr, aM as hr } from "./index-D-9RvHe2.js";
2
+ import { p as lr } from "./chunk-4BX2VUAB-hWMmxFrf.js";
3
+ import { p as fr } from "./mermaid-parser.core-DZnb6wFE.js";
4
4
  import { c as Se } from "./cytoscape.esm-ZmItrg9y.js";
5
5
  var Fe = { exports: {} }, ue = { exports: {} }, de = { exports: {} }, we;
6
6
  function cr() {
@@ -0,0 +1,5 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode('@charset "UTF-8";._azs-source-ref[data-v-aa980286]{background-color:#e3f2fd;color:#1976d2;padding:2px 6px;border-radius:4px;font-size:.9em;border:1px solid #bbdefb}.azs-custom-ref--clickable[data-v-aa980286]{cursor:pointer;transition:all .2s ease}.azs-custom-ref--clickable[data-v-aa980286]:hover{background-color:#bbdefb;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.azs-custom-ref--disabled[data-v-aa980286]{opacity:.6;cursor:default}.azs-table-container[data-v-7c720df9]{width:100%;overflow-x:auto;margin:16px 0}.azs-table[data-v-7c720df9]{width:100%;border-collapse:collapse;border-spacing:0;background-color:#fff;border-radius:8px;overflow:hidden;box-shadow:0 2px 8px #0000001a}.azs-table th[data-v-7c720df9],.azs-table td[data-v-7c720df9]{padding:12px 16px;text-align:left;border-bottom:1px solid #e5e7eb;vertical-align:middle}.azs-table th[data-v-7c720df9]{background-color:#f9fafb;font-weight:600;color:#374151;font-size:14px;text-transform:none;letter-spacing:0}.azs-table td[data-v-7c720df9]{color:#4b5563;font-size:14px}.azs-table tbody tr[data-v-7c720df9]{transition:background-color .2s ease}.azs-table tbody tr[data-v-7c720df9]:hover{background-color:#f9fafb}.azs-table tbody tr:last-child td[data-v-7c720df9]{border-bottom:none}.azs-table .text-left[data-v-7c720df9]{text-align:left}.azs-table .text-center[data-v-7c720df9]{text-align:center}.azs-table .text-right[data-v-7c720df9]{text-align:right}@media (max-width: 768px){.azs-table[data-v-7c720df9]{font-size:12px}.azs-table th[data-v-7c720df9],.azs-table td[data-v-7c720df9]{padding:8px 12px}}.image-preview-overlay[data-v-3c35f524]{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#000000e6;z-index:9999;display:flex;align-items:center;justify-content:center;outline:none}.image-preview-container[data-v-3c35f524]{position:relative;max-width:90vw;max-height:90vh;display:flex;align-items:center;justify-content:center}.close-btn[data-v-3c35f524]{position:absolute;top:-50px;right:0;background:#ffffff1a;border:none;color:#fff;width:40px;height:40px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color .2s;z-index:10001}.close-btn[data-v-3c35f524]:hover{background:#fff3}.toolbar[data-v-3c35f524]{position:absolute;bottom:-60px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:10px;background:#000000b3;padding:10px 15px;border-radius:25px;z-index:10001}.toolbar button[data-v-3c35f524]{background:#ffffff1a;border:none;color:#fff;width:35px;height:35px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color .2s}.toolbar button[data-v-3c35f524]:hover{background:#fff3}.zoom-level[data-v-3c35f524]{color:#fff;font-size:14px;min-width:50px;text-align:center}.image-container[data-v-3c35f524]{position:relative;overflow:hidden;max-width:100%;max-height:100%}.image-container img[data-v-3c35f524]{max-width:100%;max-height:100%;object-fit:contain;-webkit-user-select:none;user-select:none}.loading[data-v-3c35f524]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;display:flex;flex-direction:column;align-items:center;gap:10px}.spinner[data-v-3c35f524]{width:40px;height:40px;border:3px solid rgba(255,255,255,.3);border-top:3px solid white;border-radius:50%;animation:spin-3c35f524 1s linear infinite}@keyframes spin-3c35f524{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (max-width: 768px){.image-preview-container[data-v-3c35f524]{max-width:95vw;max-height:95vh}.toolbar[data-v-3c35f524]{bottom:-50px;padding:8px 12px}.toolbar button[data-v-3c35f524]{width:30px;height:30px}.close-btn[data-v-3c35f524]{top:-40px;width:35px;height:35px}}[data-v-1dba529f] .azs-table-container{overflow-x:auto;margin:1rem 0;border-radius:6px;border:1px solid #e1e4e8}[data-v-1dba529f] .azs-table{width:100%;border-collapse:collapse;border-spacing:0;font-size:14px;background-color:#fff}[data-v-1dba529f] .azs-table th,[data-v-1dba529f] .azs-table td{border:1px solid #e1e4e8;padding:8px 12px;text-align:left;vertical-align:top}[data-v-1dba529f] .azs-table th{background-color:#f6f8fa;font-weight:600;color:#24292e}[data-v-1dba529f] .azs-table tbody tr:nth-child(2n){background-color:#f6f8fa}[data-v-1dba529f] .azs-table tbody tr:hover,[data-v-1dba529f] .azs-table tbody tr:hover td{background-color:#f1f8ff}@media (max-width: 768px){[data-v-1dba529f] .azs-table-container{font-size:12px}[data-v-1dba529f] .azs-table th,[data-v-1dba529f] .azs-table td{padding:6px 8px}}')),document.head.appendChild(a)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ import { bE as f } from "./index-D-9RvHe2.js";
3
+ export {
4
+ f as default
5
+ };