dsh-md-studio 0.0.0-stage → 1.2.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.
@@ -0,0 +1,370 @@
1
+ # Third-party notices
2
+
3
+ The implementation uses the following bundled libraries. Full bundled code notices are in lib/client.js.LEGAL.txt.
4
+
5
+ Design inspiration: https://github.com/MrmoLabs/dsh-mermaid and https://github.com/nirvanaslash/dsh-artifact-preview (MIT). The 1.1 native preview integration is a new implementation.
6
+
7
+ ## mermaid 11.17.0 (MIT)
8
+
9
+
10
+ The MIT License (MIT)
11
+
12
+ Copyright (c) 2014 - 2022 Knut Sveidqvist
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+
32
+
33
+ ## markdown-it 15.0.2 (MIT)
34
+
35
+
36
+ Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin.
37
+
38
+ Permission is hereby granted, free of charge, to any person
39
+ obtaining a copy of this software and associated documentation
40
+ files (the "Software"), to deal in the Software without
41
+ restriction, including without limitation the rights to use,
42
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
43
+ copies of the Software, and to permit persons to whom the
44
+ Software is furnished to do so, subject to the following
45
+ conditions:
46
+
47
+ The above copyright notice and this permission notice shall be
48
+ included in all copies or substantial portions of the Software.
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
51
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
52
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
53
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
54
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
55
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
56
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
57
+ OTHER DEALINGS IN THE SOFTWARE.
58
+
59
+
60
+ ## markdown-it-footnote 4.0.0 (MIT)
61
+
62
+
63
+ Copyright (c) 2014-2015 Vitaly Puzrin, Alex Kocharin.
64
+
65
+ Permission is hereby granted, free of charge, to any person
66
+ obtaining a copy of this software and associated documentation
67
+ files (the "Software"), to deal in the Software without
68
+ restriction, including without limitation the rights to use,
69
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
70
+ copies of the Software, and to permit persons to whom the
71
+ Software is furnished to do so, subject to the following
72
+ conditions:
73
+
74
+ The above copyright notice and this permission notice shall be
75
+ included in all copies or substantial portions of the Software.
76
+
77
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
78
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
79
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
80
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
81
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
82
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
83
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
84
+ OTHER DEALINGS IN THE SOFTWARE.
85
+
86
+
87
+ ## markdown-it-task-lists 2.1.1 (ISC)
88
+
89
+
90
+ Copyright (c) 2016, Revin Guillen
91
+
92
+ Permission to use, copy, modify, and/or distribute this software for any
93
+ purpose with or without fee is hereby granted, provided that the above
94
+ copyright notice and this permission notice appear in all copies.
95
+
96
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
97
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
98
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
99
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
100
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
101
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
102
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
103
+
104
+
105
+ ## dompurify 3.4.16 ((MPL-2.0 OR Apache-2.0))
106
+
107
+
108
+
109
+ Apache License
110
+ Version 2.0, January 2004
111
+ http://www.apache.org/licenses/
112
+
113
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
114
+
115
+ 1. Definitions.
116
+
117
+ "License" shall mean the terms and conditions for use, reproduction,
118
+ and distribution as defined by Sections 1 through 9 of this document.
119
+
120
+ "Licensor" shall mean the copyright owner or entity authorized by
121
+ the copyright owner that is granting the License.
122
+
123
+ "Legal Entity" shall mean the union of the acting entity and all
124
+ other entities that control, are controlled by, or are under common
125
+ control with that entity. For the purposes of this definition,
126
+ "control" means (i) the power, direct or indirect, to cause the
127
+ direction or management of such entity, whether by contract or
128
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
129
+ outstanding shares, or (iii) beneficial ownership of such entity.
130
+
131
+ "You" (or "Your") shall mean an individual or Legal Entity
132
+ exercising permissions granted by this License.
133
+
134
+ "Source" form shall mean the preferred form for making modifications,
135
+ including but not limited to software source code, documentation
136
+ source, and configuration files.
137
+
138
+ "Object" form shall mean any form resulting from mechanical
139
+ transformation or translation of a Source form, including but
140
+ not limited to compiled object code, generated documentation,
141
+ and conversions to other media types.
142
+
143
+ "Work" shall mean the work of authorship, whether in Source or
144
+ Object form, made available under the License, as indicated by a
145
+ copyright notice that is included in or attached to the work
146
+ (an example is provided in the Appendix below).
147
+
148
+ "Derivative Works" shall mean any work, whether in Source or Object
149
+ form, that is based on (or derived from) the Work and for which the
150
+ editorial revisions, annotations, elaborations, or other modifications
151
+ represent, as a whole, an original work of authorship. For the purposes
152
+ of this License, Derivative Works shall not include works that remain
153
+ separable from, or merely link (or bind by name) to the interfaces of,
154
+ the Work and Derivative Works thereof.
155
+
156
+ "Contribution" shall mean any work of authorship, including
157
+ the original version of the Work and any modifications or additions
158
+ to that Work or Derivative Works thereof, that is intentionally
159
+ submitted to Licensor for inclusion in the Work by the copyright owner
160
+ or by an individual or Legal Entity authorized to submit on behalf of
161
+ the copyright owner. For the purposes of this definition, "submitted"
162
+ means any form of electronic, verbal, or written communication sent
163
+ to the Licensor or its representatives, including but not limited to
164
+ communication on electronic mailing lists, source code control systems,
165
+ and issue tracking systems that are managed by, or on behalf of, the
166
+ Licensor for the purpose of discussing and improving the Work, but
167
+ excluding communication that is conspicuously marked or otherwise
168
+ designated in writing by the copyright owner as "Not a Contribution."
169
+
170
+ "Contributor" shall mean Licensor and any individual or Legal Entity
171
+ on behalf of whom a Contribution has been received by Licensor and
172
+ subsequently incorporated within the Work.
173
+
174
+ 2. Grant of Copyright License. Subject to the terms and conditions of
175
+ this License, each Contributor hereby grants to You a perpetual,
176
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
177
+ copyright license to reproduce, prepare Derivative Works of,
178
+ publicly display, publicly perform, sublicense, and distribute the
179
+ Work and such Derivative Works in Source or Object form.
180
+
181
+ 3. Grant of Patent License. Subject to the terms and conditions of
182
+ this License, each Contributor hereby grants to You a perpetual,
183
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
184
+ (except as stated in this section) patent license to make, have made,
185
+ use, offer to sell, sell, import, and otherwise transfer the Work,
186
+ where such license applies only to those patent claims licensable
187
+ by such Contributor that are necessarily infringed by their
188
+ Contribution(s) alone or by combination of their Contribution(s)
189
+ with the Work to which such Contribution(s) was submitted. If You
190
+ institute patent litigation against any entity (including a
191
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
192
+ or a Contribution incorporated within the Work constitutes direct
193
+ or contributory patent infringement, then any patent licenses
194
+ granted to You under this License for that Work shall terminate
195
+ as of the date such litigation is filed.
196
+
197
+ 4. Redistribution. You may reproduce and distribute copies of the
198
+ Work or Derivative Works thereof in any medium, with or without
199
+ modifications, and in Source or Object form, provided that You
200
+ meet the following conditions:
201
+
202
+ (a) You must give any other recipients of the Work or
203
+ Derivative Works a copy of this License; and
204
+
205
+ (b) You must cause any modified files to carry prominent notices
206
+ stating that You changed the files; and
207
+
208
+ (c) You must retain, in the Source form of any Derivative Works
209
+ that You distribute, all copyright, patent, trademark, and
210
+ attribution notices from the Source form of the Work,
211
+ excluding those notices that do not pertain to any part of
212
+ the Derivative Works; and
213
+
214
+ (d) If the Work includes a "NOTICE" text file as part of its
215
+ distribution, then any Derivative Works that You distribute must
216
+ include a readable copy of the attribution notices contained
217
+ within such NOTICE file, excluding those notices that do not
218
+ pertain to any part of the Derivative Works, in at least one
219
+ of the following places: within a NOTICE text file distributed
220
+ as part of the Derivative Works; within the Source form or
221
+ documentation, if provided along with the Derivative Works; or,
222
+ within a display generated by the Derivative Works, if and
223
+ wherever such third-party notices normally appear. The contents
224
+ of the NOTICE file are for informational purposes only and
225
+ do not modify the License. You may add Your own attribution
226
+ notices within Derivative Works that You distribute, alongside
227
+ or as an addendum to the NOTICE text from the Work, provided
228
+ that such additional attribution notices cannot be construed
229
+ as modifying the License.
230
+
231
+ You may add Your own copyright statement to Your modifications and
232
+ may provide additional or different license terms and conditions
233
+ for use, reproduction, or distribution of Your modifications, or
234
+ for any such Derivative Works as a whole, provided Your use,
235
+ reproduction, and distribution of the Work otherwise complies with
236
+ the conditions stated in this License.
237
+
238
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
239
+ any Contribution intentionally submitted for inclusion in the Work
240
+ by You to the Licensor shall be under the terms and conditions of
241
+ this License, without any additional terms or conditions.
242
+ Notwithstanding the above, nothing herein shall supersede or modify
243
+ the terms of any separate license agreement you may have executed
244
+ with Licensor regarding such Contributions.
245
+
246
+ 6. Trademarks. This License does not grant permission to use the trade
247
+ names, trademarks, service marks, or product names of the Licensor,
248
+ except as required for reasonable and customary use in describing the
249
+ origin of the Work and reproducing the content of the NOTICE file.
250
+
251
+ 7. Disclaimer of Warranty. Unless required by applicable law or
252
+ agreed to in writing, Licensor provides the Work (and each
253
+ Contributor provides its Contributions) on an "AS IS" BASIS,
254
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
255
+ implied, including, without limitation, any warranties or conditions
256
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
257
+ PARTICULAR PURPOSE. You are solely responsible for determining the
258
+ appropriateness of using or redistributing the Work and assume any
259
+ risks associated with Your exercise of permissions under this License.
260
+
261
+ 8. Limitation of Liability. In no event and under no legal theory,
262
+ whether in tort (including negligence), contract, or otherwise,
263
+ unless required by applicable law (such as deliberate and grossly
264
+ negligent acts) or agreed to in writing, shall any Contributor be
265
+ liable to You for damages, including any direct, indirect, special,
266
+ incidental, or consequential damages of any character arising as a
267
+ result of this License or out of the use or inability to use the
268
+ Work (including but not limited to damages for loss of goodwill,
269
+ work stoppage, computer failure or malfunction, or any and all
270
+ other commercial damages or losses), even if such Contributor
271
+ has been advised of the possibility of such damages.
272
+
273
+ 9. Accepting Warranty or Additional Liability. While redistributing
274
+ the Work or Derivative Works thereof, You may choose to offer,
275
+ and charge a fee for, acceptance of support, warranty, indemnity,
276
+ or other liability obligations and/or rights consistent with this
277
+ License. However, in accepting such obligations, You may act only
278
+ on Your own behalf and on Your sole responsibility, not on behalf
279
+ of any other Contributor, and only if You agree to indemnify,
280
+ defend, and hold each Contributor harmless for any liability
281
+ incurred by, or claims asserted against, such Contributor by reason
282
+ of your accepting any such warranty or additional liability.
283
+
284
+ END OF TERMS AND CONDITIONS
285
+
286
+ APPENDIX: How to apply the Apache License to your work.
287
+
288
+ To apply the Apache License to your work, attach the following
289
+ boilerplate notice, with the fields enclosed by brackets "[]"
290
+ replaced with your own identifying information. (Don't include
291
+ the brackets!) The text should be enclosed in the appropriate
292
+ comment syntax for the file format. We also recommend that a
293
+ file or class name and description of purpose be included on the
294
+ same "printed page" as the copyright notice for easier
295
+ identification within third-party archives.
296
+
297
+ Copyright [yyyy] [name of copyright owner]
298
+
299
+ Licensed under the Apache License, Version 2.0 (the "License");
300
+ you may not use this file except in compliance with the License.
301
+ You may obtain a copy of the License at
302
+
303
+ http://www.apache.org/licenses/LICENSE-2.0
304
+
305
+ Unless required by applicable law or agreed to in writing, software
306
+ distributed under the License is distributed on an "AS IS" BASIS,
307
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
308
+ See the License for the specific language governing permissions and
309
+ limitations under the License.
310
+
311
+
312
+ ## highlight.js 11.12.0 (BSD-3-Clause)
313
+
314
+
315
+ BSD 3-Clause License
316
+
317
+ Copyright (c) 2006, Ivan Sagalaev.
318
+ All rights reserved.
319
+
320
+ Redistribution and use in source and binary forms, with or without
321
+ modification, are permitted provided that the following conditions are met:
322
+
323
+ * Redistributions of source code must retain the above copyright notice, this
324
+ list of conditions and the following disclaimer.
325
+
326
+ * Redistributions in binary form must reproduce the above copyright notice,
327
+ this list of conditions and the following disclaimer in the documentation
328
+ and/or other materials provided with the distribution.
329
+
330
+ * Neither the name of the copyright holder nor the names of its
331
+ contributors may be used to endorse or promote products derived from
332
+ this software without specific prior written permission.
333
+
334
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
335
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
336
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
337
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
338
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
339
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
340
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
341
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
342
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
343
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
344
+
345
+
346
+ ## katex 0.19.0 (MIT)
347
+
348
+
349
+ The MIT License (MIT)
350
+
351
+ Copyright (c) 2013-2020 Khan Academy and other contributors
352
+
353
+ Permission is hereby granted, free of charge, to any person obtaining a copy
354
+ of this software and associated documentation files (the "Software"), to deal
355
+ in the Software without restriction, including without limitation the rights
356
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
357
+ copies of the Software, and to permit persons to whom the Software is
358
+ furnished to do so, subject to the following conditions:
359
+
360
+ The above copyright notice and this permission notice shall be included in all
361
+ copies or substantial portions of the Software.
362
+
363
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
364
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
365
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
366
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
367
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
368
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
369
+ SOFTWARE.
370
+
@@ -0,0 +1,4 @@
1
+ # Single bundle registration. The package main resolves to lib/index.js.
2
+ - insert:
3
+ - id: md-studio
4
+ name: dsh-md-studio
package/docs/demo.md ADDED
@@ -0,0 +1,94 @@
1
+ # Markdown Studio · 右侧文件预览验证
2
+
3
+ 在 **DSH 原生右侧文件预览**打开本文件即可查看。文档上方应出现 **Markdown Studio** 和“查看源码”按钮,下面的 Mermaid 代码应直接显示为图表。
4
+
5
+ 版本 1.1.0 的渲染库和公式字体随插件提供,查看本页不依赖 CDN。图表工具栏提供“图形 / 源码 / 全屏 / 下载 SVG”。
6
+
7
+ ## 1. 流程图
8
+
9
+ ```mermaid
10
+ flowchart LR
11
+ A[打开 Markdown 文件] --> B[DSH 右侧预览]
12
+ B --> C[Markdown Studio]
13
+ C --> D[图表与正文]
14
+ ```
15
+
16
+ ## 2. 时序图
17
+
18
+ ```mermaid
19
+ sequenceDiagram
20
+ participant U as 用户
21
+ participant D as DSH 文件预览
22
+ participant M as 图表引擎
23
+ U->>D: 打开 Markdown 文档
24
+ D->>M: 绘制 Mermaid 图表
25
+ M-->>D: SVG 图形
26
+ D-->>U: 正文、图表、公式
27
+ ```
28
+
29
+ ## 3. 甘特图
30
+
31
+ ```mermaid
32
+ gantt
33
+ title 文档预览验证计划
34
+ dateFormat YYYY-MM-DD
35
+ section 验证
36
+ 原生侧栏接入 :done, a1, 2026-10-08, 1d
37
+ 本地渲染验证 :done, a2, after a1, 1d
38
+ 文档阅读 :active, a3, after a2, 2d
39
+ ```
40
+
41
+ ## 4. 饼图
42
+
43
+ ```mermaid
44
+ pie showData
45
+ title 文档内容示例
46
+ "正文" : 50
47
+ "图表" : 30
48
+ "公式与代码" : 20
49
+ ```
50
+
51
+ ## 5. 表格和任务列表
52
+
53
+ | 内容 | 渲染引擎 | 需要 CDN |
54
+ |:-----|:--------:|:--------:|
55
+ | Markdown 与脚注 | markdown-it | 否 |
56
+ | 图表 | Mermaid | 否 |
57
+ | 数学公式 | KaTeX | 否 |
58
+ | 代码高亮 | highlight.js | 否 |
59
+
60
+ - [x] 原生右侧文档预览
61
+ - [x] 随包提供渲染依赖
62
+ - [x] 浏览器自动化验证图表、公式和高亮
63
+ - [ ] 阅读本页并试用图表工具栏
64
+
65
+ ## 6. 数学公式
66
+
67
+ 质能关系 $E = mc^2$,欧拉公式:
68
+
69
+ $$
70
+ e^{i\pi} + 1 = 0
71
+ $$
72
+
73
+ ## 7. 代码高亮
74
+
75
+ ```python
76
+ def greet(name: str) -> str:
77
+ """返回问候语。"""
78
+ return f"Hello, {name}!"
79
+ ```
80
+
81
+ ```js
82
+ const documentPreview = {
83
+ location: "DSH 右侧文件预览",
84
+ rendering: "local",
85
+ };
86
+ ```
87
+
88
+ ## 8. 脚注、引用与目录锚点
89
+
90
+ 查看版本说明[^version],或[返回流程图](#1-流程图)。
91
+
92
+ > 停用 Markdown Studio 后,DSH 会恢复默认的 Markdown 预览器。
93
+
94
+ [^version]: 本演示针对 1.1.0 原生右侧预览实现,不再使用旧版的独立面板或产物卡片接入。
Binary file
Binary file
Binary file
Binary file