@codingame/monaco-vscode-mermaid-markdown-features-default-extension 33.0.9 → 34.0.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/index.js +15 -14
- package/package.json +2 -2
- package/resources/ThirdPartyNotices.txt +277 -0
- package/resources/extension.js +12 -10
- package/resources/extension.js.map +4 -4
- package/resources/index-editor.js +1253 -1226
- package/resources/index.js +1253 -1226
- package/resources/index2.js +618 -274
- package/resources/index3.js +617 -278
- package/resources/package.json +1 -1
- package/resources/package.nls.json +1 -1
package/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { registerExtension } from '@codingame/monaco-vscode-api/extensions';
|
|
2
2
|
|
|
3
|
-
var manifest = {name:"mermaid-markdown-features",displayName:"%displayName%",description:"%description%",version:"10.0.0",publisher:"vscode",license:"MIT",repository:{type:"git",url:"https://github.com/microsoft/vscode.git"},aiKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",engines:{vscode:"^1.104.0"},enabledApiProposals:["chatOutputRenderer"],capabilities:{virtualWorkspaces:true,untrustedWorkspaces:{supported:true}},main:undefined,browser:"./dist/browser/extension",activationEvents:["onWebviewPanel:vscode.mermaid-markdown-features.preview"],contributes:{commands:[{command:"_mermaid-markdown.resetPanZoom",title:"%command.resetPanZoom.title%"},{command:"_mermaid-markdown.openInEditor",title:"%command.openInEditor.title%"},{command:"_mermaid-markdown.copySource",title:"%command.copySource.title%"}],menus:{commandPalette:[{command:"_mermaid-markdown.resetPanZoom",when:"false"},{command:"_mermaid-markdown.openInEditor",when:"false"},{command:"_mermaid-markdown.copySource",when:"false"}],"webview/context":[{command:"_mermaid-markdown.openInEditor",when:"webviewId == 'vscode.mermaid-markdown-features.chatOutputItem' || ((webviewId == 'markdown.preview' || webviewId == 'vscode.markdown.preview.editor' || webviewId == 'notebook.output')
|
|
3
|
+
var manifest = {name:"mermaid-markdown-features",displayName:"%displayName%",description:"%description%",version:"10.0.0",publisher:"vscode",license:"MIT",repository:{type:"git",url:"https://github.com/microsoft/vscode.git"},aiKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",engines:{vscode:"^1.104.0"},enabledApiProposals:["chatOutputRenderer"],capabilities:{virtualWorkspaces:true,untrustedWorkspaces:{supported:true}},main:undefined,browser:"./dist/browser/extension",activationEvents:["onWebviewPanel:vscode.mermaid-markdown-features.preview"],contributes:{commands:[{command:"_mermaid-markdown.resetPanZoom",title:"%command.resetPanZoom.title%"},{command:"_mermaid-markdown.openInEditor",title:"%command.openInEditor.title%"},{command:"_mermaid-markdown.copySource",title:"%command.copySource.title%"}],menus:{commandPalette:[{command:"_mermaid-markdown.resetPanZoom",when:"false"},{command:"_mermaid-markdown.openInEditor",when:"false"},{command:"_mermaid-markdown.copySource",when:"false"}],"webview/context":[{command:"_mermaid-markdown.openInEditor",when:"webviewId == 'vscode.mermaid-markdown-features.chatOutputItem' || (webviewSection == 'mermaid' && (webviewId == 'markdown.preview' || webviewId == 'vscode.markdown.preview.editor' || webviewId == 'notebook.output'))",group:"navigation@1"},{command:"_mermaid-markdown.copySource",when:"webviewId == 'vscode.mermaid-markdown-features.chatOutputItem' || webviewId == 'vscode.mermaid-markdown-features.preview' || (webviewSection == 'mermaid' && (webviewId == 'markdown.preview' || webviewId == 'vscode.markdown.preview.editor' || webviewId == 'notebook.output'))",group:"navigation@2"},{command:"_mermaid-markdown.resetPanZoom",when:"!mermaidError && (webviewId == 'vscode.mermaid-markdown-features.chatOutputItem' || webviewId == 'vscode.mermaid-markdown-features.preview')",group:"navigation@3"}]},configuration:{title:"%config.title%",properties:{"markdown-mermaid.lightModeTheme":{order:0,type:"string","enum":["vscode","base","forest","dark","default","neutral"],enumDescriptions:["%config.markdown-mermaid.theme.vscode.description%","%config.markdown-mermaid.theme.base.description%","%config.markdown-mermaid.theme.forest.description%","%config.markdown-mermaid.theme.dark.description%","%config.markdown-mermaid.theme.default.description%","%config.markdown-mermaid.theme.neutral.description%"],"default":"vscode",description:"%config.markdown-mermaid.lightModeTheme.description%"},"markdown-mermaid.darkModeTheme":{order:1,type:"string","enum":["vscode","base","forest","dark","default","neutral"],enumDescriptions:["%config.markdown-mermaid.theme.vscode.description%","%config.markdown-mermaid.theme.base.description%","%config.markdown-mermaid.theme.forest.description%","%config.markdown-mermaid.theme.dark.description%","%config.markdown-mermaid.theme.default.description%","%config.markdown-mermaid.theme.neutral.description%"],"default":"vscode",description:"%config.markdown-mermaid.darkModeTheme.description%"},"markdown-mermaid.languages":{order:2,type:"array","default":["mermaid"],description:"%config.markdown-mermaid.languages.description%"},"markdown-mermaid.maxTextSize":{order:3,type:"number","default":50000,description:"%config.markdown-mermaid.maxTextSize.description%"},"markdown-mermaid.mouseNavigation.enabled":{type:"string",description:"%config.markdown-mermaid.mouseNavigation.enabled.description%","enum":["always","alt","never"],"default":"alt",markdownEnumDescriptions:["%config.markdown-mermaid.mouseNavigation.enabled.always%","%config.markdown-mermaid.mouseNavigation.enabled.alt%","%config.markdown-mermaid.mouseNavigation.enabled.never%"]},"markdown-mermaid.controls.show":{type:"string",description:"%config.markdown-mermaid.controls.show.description%","enum":["never","onHoverOrFocus","always"],enumDescriptions:["%config.markdown-mermaid.controls.show.never%","%config.markdown-mermaid.controls.show.onHoverOrFocus%","%config.markdown-mermaid.controls.show.always%"],"default":"onHoverOrFocus"},"markdown-mermaid.resizable":{type:"boolean","default":true,description:"%config.markdown-mermaid.resizable.description%"},"markdown-mermaid.maxHeight":{type:"string","default":"",markdownDescription:"%config.markdown-mermaid.maxHeight.markdownDescription%"}}},"markdown.previewScripts":[{path:"./markdown-preview-out/index.js",type:"module"}],notebookRenderer:[{id:"vscode.markdown-it.mermaid-extension",displayName:"Markdown-It Mermaid Renderer",requiresMessaging:"optional",entrypoint:{"extends":"vscode.markdown-it-renderer",path:"./notebook-out/index.js"}}],"markdown.markdownItPlugins":true,chatOutputRenderers:[{viewType:"vscode.mermaid-markdown-features.chatOutputItem",mimeTypes:["text/vnd.mermaid"],codeBlockLanguageIdentifiers:["mermaid"]}],languageModelTools:[{name:"renderMermaidDiagram",displayName:"Mermaid Renderer",toolReferenceName:"renderMermaidDiagram",legacyToolReferenceFullNames:["vscode.mermaid-chat-features/renderMermaidDiagram"],canBeReferencedInPrompt:true,modelDescription:"Renders a Mermaid diagram from Mermaid.js markup.",userDescription:"Render a Mermaid.js diagram from markup.",when:"chatSessionType == local",inputSchema:{type:"object",properties:{markup:{type:"string",description:"The mermaid diagram markup to render as a Mermaid diagram. This should only be the markup of the diagram. Do not include a wrapping code block."},title:{type:"string",description:"A short title that describes the diagram."}}}}]},overrides:{"lodash-es":"4.18.1"}};
|
|
4
4
|
|
|
5
5
|
const { registerFileUrl, whenReady } = registerExtension(manifest, undefined, {"system":true,"readmePath":"README.md"});
|
|
6
6
|
registerFileUrl('README.md', new URL('./resources/README.md', import.meta.url).toString(), {"mimeType":"text/markdown","size":245});
|
|
7
|
+
registerFileUrl('ThirdPartyNotices.txt', new URL('./resources/ThirdPartyNotices.txt', import.meta.url).toString(), {"mimeType":"text/plain","size":15300});
|
|
7
8
|
registerFileUrl('chat-webview-out/codicon.css', new URL('./resources/codicon.css.txt', import.meta.url).toString(), {"mimeType":"text/css","size":133000});
|
|
8
|
-
registerFileUrl('chat-webview-out/index', new URL('./resources/index.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
9
|
-
registerFileUrl('chat-webview-out/index-editor', new URL('./resources/index-editor.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
10
|
-
registerFileUrl('chat-webview-out/index-editor.js', new URL('./resources/index-editor.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
11
|
-
registerFileUrl('chat-webview-out/index.js', new URL('./resources/index.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
12
|
-
registerFileUrl('dist/browser/extension', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
13
|
-
registerFileUrl('dist/browser/extension.js', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
14
|
-
registerFileUrl('dist/browser/extension.js.map', new URL('./resources/extension.js.map', import.meta.url).toString(), {"mimeType":"application/json","size":
|
|
15
|
-
registerFileUrl('markdown-preview-out/index', new URL('./resources/index2.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
16
|
-
registerFileUrl('markdown-preview-out/index.js', new URL('./resources/index2.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
17
|
-
registerFileUrl('notebook-out/index', new URL('./resources/index3.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
18
|
-
registerFileUrl('notebook-out/index.js', new URL('./resources/index3.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
19
|
-
registerFileUrl('package.json', new URL('./resources/package.json', import.meta.url).toString(), {"mimeType":"application/json","size":
|
|
20
|
-
registerFileUrl('package.nls.json', new URL('./resources/package.nls.json', import.meta.url).toString(), {"mimeType":"application/json","size":
|
|
9
|
+
registerFileUrl('chat-webview-out/index', new URL('./resources/index.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":4730788});
|
|
10
|
+
registerFileUrl('chat-webview-out/index-editor', new URL('./resources/index-editor.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":4731212});
|
|
11
|
+
registerFileUrl('chat-webview-out/index-editor.js', new URL('./resources/index-editor.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":4731212});
|
|
12
|
+
registerFileUrl('chat-webview-out/index.js', new URL('./resources/index.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":4730788});
|
|
13
|
+
registerFileUrl('dist/browser/extension', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":14922});
|
|
14
|
+
registerFileUrl('dist/browser/extension.js', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":14922});
|
|
15
|
+
registerFileUrl('dist/browser/extension.js.map', new URL('./resources/extension.js.map', import.meta.url).toString(), {"mimeType":"application/json","size":50212});
|
|
16
|
+
registerFileUrl('markdown-preview-out/index', new URL('./resources/index2.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":25832523});
|
|
17
|
+
registerFileUrl('markdown-preview-out/index.js', new URL('./resources/index2.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":25832523});
|
|
18
|
+
registerFileUrl('notebook-out/index', new URL('./resources/index3.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":25836934});
|
|
19
|
+
registerFileUrl('notebook-out/index.js', new URL('./resources/index3.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":25836934});
|
|
20
|
+
registerFileUrl('package.json', new URL('./resources/package.json', import.meta.url).toString(), {"mimeType":"application/json","size":5716});
|
|
21
|
+
registerFileUrl('package.nls.json', new URL('./resources/package.nls.json', import.meta.url).toString(), {"mimeType":"application/json","size":2633});
|
|
21
22
|
|
|
22
23
|
export { whenReady };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-mermaid-markdown-features-default-extension",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "34.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@codingame/monaco-vscode-api": "
|
|
21
|
+
"@codingame/monaco-vscode-api": "34.0.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
|
2
|
+
Do Not Translate or Localize
|
|
3
|
+
|
|
4
|
+
This project incorporates components from the projects listed below. The original copyright notices and the licenses
|
|
5
|
+
under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted
|
|
6
|
+
herein, whether by implication, estoppel or otherwise.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
%% elkjs NOTICES AND INFORMATION BEGIN HERE
|
|
11
|
+
=========================================
|
|
12
|
+
# Eclipse Public License - v 2.0
|
|
13
|
+
|
|
14
|
+
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
|
|
15
|
+
PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF
|
|
16
|
+
THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
|
17
|
+
|
|
18
|
+
## 1. DEFINITIONS
|
|
19
|
+
|
|
20
|
+
“Contribution” means:
|
|
21
|
+
|
|
22
|
+
- a\) in the case of the initial Contributor, the initial content
|
|
23
|
+
Distributed under this Agreement, and
|
|
24
|
+
- b\) in the case of each subsequent Contributor:
|
|
25
|
+
- i\) changes to the Program, and
|
|
26
|
+
- ii\) additions to the Program;
|
|
27
|
+
|
|
28
|
+
where such changes and/or additions to the Program originate from
|
|
29
|
+
and are Distributed by that particular Contributor. A Contribution
|
|
30
|
+
“originates” from a Contributor if it was added to the Program by
|
|
31
|
+
such Contributor itself or anyone acting on such Contributor's
|
|
32
|
+
behalf. Contributions do not include changes or additions to the
|
|
33
|
+
Program that are not Modified Works.
|
|
34
|
+
|
|
35
|
+
“Contributor” means any person or entity that Distributes the Program.
|
|
36
|
+
|
|
37
|
+
“Licensed Patents” mean patent claims licensable by a Contributor which
|
|
38
|
+
are necessarily infringed by the use or sale of its Contribution alone
|
|
39
|
+
or when combined with the Program.
|
|
40
|
+
|
|
41
|
+
“Program” means the Contributions Distributed in accordance with this
|
|
42
|
+
Agreement.
|
|
43
|
+
|
|
44
|
+
“Recipient” means anyone who receives the Program under this Agreement
|
|
45
|
+
or any Secondary License (as applicable), including Contributors.
|
|
46
|
+
|
|
47
|
+
“Derivative Works” shall mean any work, whether in Source Code or other
|
|
48
|
+
form, that is based on (or derived from) the Program and for which the
|
|
49
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
50
|
+
represent, as a whole, an original work of authorship.
|
|
51
|
+
|
|
52
|
+
“Modified Works” shall mean any work in Source Code or other form that
|
|
53
|
+
results from an addition to, deletion from, or modification of the
|
|
54
|
+
contents of the Program, including, for purposes of clarity any new file
|
|
55
|
+
in Source Code form that contains any contents of the Program. Modified
|
|
56
|
+
Works shall not include works that contain only declarations,
|
|
57
|
+
interfaces, types, classes, structures, or files of the Program solely
|
|
58
|
+
in each case in order to link to, bind by name, or subclass the Program
|
|
59
|
+
or Modified Works thereof.
|
|
60
|
+
|
|
61
|
+
“Distribute” means the acts of a) distributing or b) making available in
|
|
62
|
+
any manner that enables the transfer of a copy.
|
|
63
|
+
|
|
64
|
+
“Source Code” means the form of a Program preferred for making
|
|
65
|
+
modifications, including but not limited to software source code,
|
|
66
|
+
documentation source, and configuration files.
|
|
67
|
+
|
|
68
|
+
“Secondary License” means either the GNU General Public License, Version
|
|
69
|
+
2.0, or any later versions of that license, including any exceptions or
|
|
70
|
+
additional permissions as identified by the initial Contributor.
|
|
71
|
+
|
|
72
|
+
## 2. GRANT OF RIGHTS
|
|
73
|
+
|
|
74
|
+
- a\) Subject to the terms of this Agreement, each Contributor hereby
|
|
75
|
+
grants Recipient a non-exclusive, worldwide, royalty-free copyright
|
|
76
|
+
license to reproduce, prepare Derivative Works of, publicly display,
|
|
77
|
+
publicly perform, Distribute and sublicense the Contribution of such
|
|
78
|
+
Contributor, if any, and such Derivative Works.
|
|
79
|
+
- b\) Subject to the terms of this Agreement, each Contributor hereby
|
|
80
|
+
grants Recipient a non-exclusive, worldwide, royalty-free patent license
|
|
81
|
+
under Licensed Patents to make, use, sell, offer to sell, import and
|
|
82
|
+
otherwise transfer the Contribution of such Contributor, if any, in
|
|
83
|
+
Source Code or other form. This patent license shall apply to the
|
|
84
|
+
combination of the Contribution and the Program if, at the time the
|
|
85
|
+
Contribution is added by the Contributor, such addition of the
|
|
86
|
+
Contribution causes such combination to be covered by the
|
|
87
|
+
Licensed Patents. The patent license shall not apply to any other
|
|
88
|
+
combinations which include the Contribution. No hardware per se is
|
|
89
|
+
licensed hereunder.
|
|
90
|
+
- c\) Recipient understands that although each Contributor grants the
|
|
91
|
+
licenses to its Contributions set forth herein, no assurances are
|
|
92
|
+
provided by any Contributor that the Program does not infringe the
|
|
93
|
+
patent or other intellectual property rights of any other entity. Each
|
|
94
|
+
Contributor disclaims any liability to Recipient for claims brought by
|
|
95
|
+
any other entity based on infringement of intellectual property rights
|
|
96
|
+
or otherwise. As a condition to exercising the rights and licenses
|
|
97
|
+
granted hereunder, each Recipient hereby assumes sole responsibility to
|
|
98
|
+
secure any other intellectual property rights needed, if any. For
|
|
99
|
+
example, if a third party patent license is required to allow Recipient
|
|
100
|
+
to Distribute the Program, it is Recipient's responsibility to acquire
|
|
101
|
+
that license before distributing the Program.
|
|
102
|
+
- d\) Each Contributor represents that to its knowledge it has sufficient
|
|
103
|
+
copyright rights in its Contribution, if any, to grant the copyright
|
|
104
|
+
license set forth in this Agreement.
|
|
105
|
+
- e\) Notwithstanding the terms of any Secondary License, no Contributor
|
|
106
|
+
makes additional grants to any Recipient (other than those set forth in
|
|
107
|
+
this Agreement) as a result of such Recipient's receipt of the Program
|
|
108
|
+
under the terms of a Secondary License (if permitted under the terms of
|
|
109
|
+
Section 3).
|
|
110
|
+
|
|
111
|
+
## 3. REQUIREMENTS
|
|
112
|
+
|
|
113
|
+
3.1 If a Contributor Distributes the Program in any form, then:
|
|
114
|
+
|
|
115
|
+
- a\) the Program must also be made available as Source Code, in accordance
|
|
116
|
+
with section 3.2, and the Contributor must accompany the Program with a
|
|
117
|
+
statement that the Source Code for the Program is available under this
|
|
118
|
+
Agreement, and informs Recipients how to obtain it in a reasonable
|
|
119
|
+
manner on or through a medium customarily used for software exchange;
|
|
120
|
+
and
|
|
121
|
+
- b\) the Contributor may Distribute the Program under a license different
|
|
122
|
+
than this Agreement, provided that such license:
|
|
123
|
+
- i\) effectively disclaims on behalf of all other Contributors all
|
|
124
|
+
warranties and conditions, express and implied, including warranties or
|
|
125
|
+
conditions of title and non-infringement, and implied warranties or
|
|
126
|
+
conditions of merchantability and fitness for a particular purpose;
|
|
127
|
+
- ii\) effectively excludes on behalf of all other Contributors all
|
|
128
|
+
liability for damages, including direct, indirect, special, incidental
|
|
129
|
+
and consequential damages, such as lost profits;
|
|
130
|
+
- iii\) does not attempt to limit or alter the recipients' rights in the
|
|
131
|
+
Source Code under section 3.2; and
|
|
132
|
+
- iv\) requires any subsequent distribution of the Program by any party to
|
|
133
|
+
be under a license that satisfies the requirements of this section 3.
|
|
134
|
+
|
|
135
|
+
3.2 When the Program is Distributed as Source Code:
|
|
136
|
+
|
|
137
|
+
- a\) it must be made available under this Agreement, or if the Program (i)
|
|
138
|
+
is combined with other material in a separate file or files made
|
|
139
|
+
available under a Secondary License, and (ii) the initial Contributor
|
|
140
|
+
attached to the Source Code the notice described in Exhibit A of this
|
|
141
|
+
Agreement, then the Program may be made available under the terms of
|
|
142
|
+
such Secondary Licenses, and
|
|
143
|
+
- b\) a copy of this Agreement must be included with each copy of
|
|
144
|
+
the Program.
|
|
145
|
+
|
|
146
|
+
3.3 Contributors may not remove or alter any copyright, patent,
|
|
147
|
+
trademark, attribution notices, disclaimers of warranty, or limitations
|
|
148
|
+
of liability (‘notices’) contained within the Program from any copy of
|
|
149
|
+
the Program which they Distribute, provided that Contributors may add
|
|
150
|
+
their own appropriate notices.
|
|
151
|
+
|
|
152
|
+
## 4. COMMERCIAL DISTRIBUTION
|
|
153
|
+
|
|
154
|
+
Commercial distributors of software may accept certain responsibilities
|
|
155
|
+
with respect to end users, business partners and the like. While this
|
|
156
|
+
license is intended to facilitate the commercial use of the Program, the
|
|
157
|
+
Contributor who includes the Program in a commercial product offering
|
|
158
|
+
should do so in a manner which does not create potential liability for
|
|
159
|
+
other Contributors. Therefore, if a Contributor includes the Program in
|
|
160
|
+
a commercial product offering, such Contributor (“Commercial
|
|
161
|
+
Contributor”) hereby agrees to defend and indemnify every other
|
|
162
|
+
Contributor (“Indemnified Contributor”) against any losses, damages and
|
|
163
|
+
costs (collectively “Losses”) arising from claims, lawsuits and other
|
|
164
|
+
legal actions brought by a third party against the Indemnified
|
|
165
|
+
Contributor to the extent caused by the acts or omissions of such
|
|
166
|
+
Commercial Contributor in connection with its distribution of the
|
|
167
|
+
Program in a commercial product offering. The obligations in this
|
|
168
|
+
section do not apply to any claims or Losses relating to any actual or
|
|
169
|
+
alleged intellectual property infringement. In order to qualify, an
|
|
170
|
+
Indemnified Contributor must: a) promptly notify the Commercial
|
|
171
|
+
Contributor in writing of such claim, and b) allow the Commercial
|
|
172
|
+
Contributor to control, and cooperate with the Commercial Contributor
|
|
173
|
+
in, the defense and any related settlement negotiations. The Indemnified
|
|
174
|
+
Contributor may participate in any such claim at its own expense.
|
|
175
|
+
|
|
176
|
+
For example, a Contributor might include the Program in a commercial
|
|
177
|
+
product offering, Product X. That Contributor is then a Commercial
|
|
178
|
+
Contributor. If that Commercial Contributor then makes performance
|
|
179
|
+
claims, or offers warranties related to Product X, those performance
|
|
180
|
+
claims and warranties are such Commercial Contributor's responsibility
|
|
181
|
+
alone. Under this section, the Commercial Contributor would have to
|
|
182
|
+
defend claims against the other Contributors related to those
|
|
183
|
+
performance claims and warranties, and if a court requires any other
|
|
184
|
+
Contributor to pay any damages as a result, the Commercial Contributor
|
|
185
|
+
must pay those damages.
|
|
186
|
+
|
|
187
|
+
## 5. NO WARRANTY {#warranty}
|
|
188
|
+
|
|
189
|
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
|
|
190
|
+
PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS”
|
|
191
|
+
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
|
|
192
|
+
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
|
|
193
|
+
TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
|
|
194
|
+
PURPOSE. Each Recipient is solely responsible for determining the
|
|
195
|
+
appropriateness of using and distributing the Program and assumes all
|
|
196
|
+
risks associated with its exercise of rights under this Agreement,
|
|
197
|
+
including but not limited to the risks and costs of program errors,
|
|
198
|
+
compliance with applicable laws, damage to or loss of data, programs or
|
|
199
|
+
equipment, and unavailability or interruption of operations.
|
|
200
|
+
|
|
201
|
+
## 6. DISCLAIMER OF LIABILITY {#disclaimer}
|
|
202
|
+
|
|
203
|
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
|
|
204
|
+
PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
|
|
205
|
+
SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
206
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
|
|
207
|
+
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
208
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
209
|
+
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
|
|
210
|
+
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
|
|
211
|
+
POSSIBILITY OF SUCH DAMAGES.
|
|
212
|
+
|
|
213
|
+
## 7. GENERAL
|
|
214
|
+
|
|
215
|
+
If any provision of this Agreement is invalid or unenforceable under
|
|
216
|
+
applicable law, it shall not affect the validity or enforceability of
|
|
217
|
+
the remainder of the terms of this Agreement, and without further action
|
|
218
|
+
by the parties hereto, such provision shall be reformed to the minimum
|
|
219
|
+
extent necessary to make such provision valid and enforceable.
|
|
220
|
+
|
|
221
|
+
If Recipient institutes patent litigation against any entity (including
|
|
222
|
+
a cross-claim or counterclaim in a lawsuit) alleging that the Program
|
|
223
|
+
itself (excluding combinations of the Program with other software or
|
|
224
|
+
hardware) infringes such Recipient's patent(s), then such Recipient's
|
|
225
|
+
rights granted under Section 2(b) shall terminate as of the date such
|
|
226
|
+
litigation is filed.
|
|
227
|
+
|
|
228
|
+
All Recipient's rights under this Agreement shall terminate if it fails
|
|
229
|
+
to comply with any of the material terms or conditions of this Agreement
|
|
230
|
+
and does not cure such failure in a reasonable period of time after
|
|
231
|
+
becoming aware of such noncompliance. If all Recipient's rights under
|
|
232
|
+
this Agreement terminate, Recipient agrees to cease use and distribution
|
|
233
|
+
of the Program as soon as reasonably practicable. However, Recipient's
|
|
234
|
+
obligations under this Agreement and any licenses granted by Recipient
|
|
235
|
+
relating to the Program shall continue and survive.
|
|
236
|
+
|
|
237
|
+
Everyone is permitted to copy and distribute copies of this Agreement,
|
|
238
|
+
but in order to avoid inconsistency the Agreement is copyrighted and may
|
|
239
|
+
only be modified in the following manner. The Agreement Steward reserves
|
|
240
|
+
the right to publish new versions (including revisions) of this
|
|
241
|
+
Agreement from time to time. No one other than the Agreement Steward has
|
|
242
|
+
the right to modify this Agreement. The Eclipse Foundation is the
|
|
243
|
+
initial Agreement Steward. The Eclipse Foundation may assign the
|
|
244
|
+
responsibility to serve as the Agreement Steward to a suitable separate
|
|
245
|
+
entity. Each new version of the Agreement will be given a distinguishing
|
|
246
|
+
version number. The Program (including Contributions) may always be
|
|
247
|
+
Distributed subject to the version of the Agreement under which it was
|
|
248
|
+
received. In addition, after a new version of the Agreement is
|
|
249
|
+
published, Contributor may elect to Distribute the Program (including
|
|
250
|
+
its Contributions) under the new version.
|
|
251
|
+
|
|
252
|
+
Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
|
|
253
|
+
receives no rights or licenses to the intellectual property of any
|
|
254
|
+
Contributor under this Agreement, whether expressly, by implication,
|
|
255
|
+
estoppel or otherwise. All rights in the Program not expressly granted
|
|
256
|
+
under this Agreement are reserved. Nothing in this Agreement is intended
|
|
257
|
+
to be enforceable by any entity that is not a Contributor or Recipient.
|
|
258
|
+
No third-party beneficiary rights are created under this Agreement.
|
|
259
|
+
|
|
260
|
+
## Exhibit A – Form of Secondary Licenses Notice {#exhibit-a}
|
|
261
|
+
|
|
262
|
+
“This Source Code may also be made available under the following
|
|
263
|
+
Secondary Licenses when the conditions for such availability set forth
|
|
264
|
+
in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
|
|
265
|
+
version(s), and exceptions or additional permissions here}.”
|
|
266
|
+
|
|
267
|
+
> Simply including a copy of this Agreement, including this Exhibit A is
|
|
268
|
+
> not sufficient to license the Source Code under Secondary Licenses.
|
|
269
|
+
>
|
|
270
|
+
> If it is not possible or desirable to put the notice in a particular
|
|
271
|
+
> file, then You may include the notice in a location (such as a LICENSE
|
|
272
|
+
> file in a relevant directory) where a recipient would be likely to
|
|
273
|
+
> look for such a notice.
|
|
274
|
+
>
|
|
275
|
+
> You may add additional accurate notices of copyright ownership.
|
|
276
|
+
=========================================
|
|
277
|
+
END OF elkjs library NOTICES AND INFORMATION
|
package/resources/extension.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var J=Object.create;var I=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var Q=(e,i)=>{for(var r in i)I(e,r,{get:i[r],enumerable:!0})},O=(e,i,r,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of Y(i))!K.call(e,n)&&n!==r&&I(e,n,{get:()=>i[n],enumerable:!(t=V(i,n))||t.enumerable});return e};var C=(e,i,r)=>(r=e!=null?J(G(e)):{},O(i||!e||!e.__esModule?I(r,"default",{value:e,enumerable:!0}):r,e)),X=e=>O(I({},"__esModule",{value:!0}),e);var le={};Q(le,{activate:()=>me});module.exports=X(le);var u=C(require("vscode"));var c=C(require("vscode"));function W(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function M(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto)();let e=new Uint8Array(16),i=[];for(let n=0;n<256;n++)i.push(n.toString(16).padStart(2,"0"));crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=0,t="";return t+=i[e[r++]],t+=i[e[r++]],t+=i[e[r++]],t+=i[e[r++]],t+="-",t+=i[e[r++]],t+=i[e[r++]],t+="-",t+=i[e[r++]],t+=i[e[r++]],t+="-",t+=i[e[r++]],t+=i[e[r++]],t+="-",t+=i[e[r++]],t+=i[e[r++]],t+=i[e[r++]],t+=i[e[r++]],t+=i[e[r++]],t+=i[e[r++]],t}function $(e){for(;e.length;)e.pop()?.dispose()}var k=class{_isDisposed=!1;_disposables=[];dispose(){this._isDisposed||(this._isDisposed=!0,$(this._disposables))}_register(i){return this._isDisposed?i.dispose():this._disposables.push(i),i}get isDisposed(){return this._isDisposed}};var j=C(require("vscode")),h="markdown-mermaid";var ee="vscode",ie=["vscode","base","forest","dark","default","neutral"];function A(e){return typeof e=="string"&&ie.includes(e)?e:ee}function re(){let e=j.workspace.getConfiguration(h);return{darkModeTheme:A(e.get("darkModeTheme")),lightModeTheme:A(e.get("lightModeTheme")),maxTextSize:e.get("maxTextSize"),clickDrag:e.get("mouseNavigation.enabled","alt"),showControls:e.get("controls.show","onHoverOrFocus"),resizable:e.get("resizable",!0),maxHeight:e.get("maxHeight","")}}function L(e){let i=e.renderer.render;return e.renderer.render=function(...r){return`${x()}
|
|
2
|
+
${i.apply(e.renderer,r)}`},e}function x(){let e=te(JSON.stringify(re()));return`<span id="${h}" aria-hidden="true" data-config="${e}"></span>`}function te(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}var oe="text/vnd.mermaid",ne="vscode.mermaid-markdown-features.chatOutputItem",U=class{constructor(i,r){this._extensionUri=i;this._webviewManager=r}async renderChatOutput({value:i},r,t,n){let o=r.webview,s=de(i),l=s.source,v=s.title,a=M(),b=[];b.push(this._webviewManager.registerWebview(a,o,l,v,"chat")),b.push(o.onDidReceiveMessage(p=>{p.type==="openInEditor"&&c.commands.executeCommand("_mermaid-markdown.openInEditor",{mermaidWebviewId:a})})),r.onDidDispose(()=>{$(b)});let m=c.Uri.joinPath(this._extensionUri,"chat-webview-out");o.options={enableScripts:!0,localResourceRoots:[m]};let g=M(),_=c.Uri.joinPath(m,"index.js"),T=o.asWebviewUri(c.Uri.joinPath(m,"codicon.css")),f=c.l10n.t("Open Diagram in Editor");o.html=`
|
|
2
3
|
<!DOCTYPE html>
|
|
3
4
|
<html lang="en">
|
|
4
5
|
|
|
@@ -6,8 +7,8 @@
|
|
|
6
7
|
<meta charset="UTF-8">
|
|
7
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
9
|
<title>Mermaid Diagram</title>
|
|
9
|
-
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'nonce-${g}'; style-src ${o.cspSource} 'unsafe-inline'; font-src data:;" />
|
|
10
|
-
<link rel="stylesheet" type="text/css" href="${
|
|
10
|
+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; script-src 'nonce-${g}'; style-src ${o.cspSource} 'unsafe-inline'; font-src data:;" />
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="${T}" crossorigin="anonymous">
|
|
11
12
|
|
|
12
13
|
<style>
|
|
13
14
|
body {
|
|
@@ -49,16 +50,17 @@
|
|
|
49
50
|
</head>
|
|
50
51
|
|
|
51
52
|
<body data-vscode-context='${JSON.stringify({preventDefaultContextMenuItems:!0,mermaidWebviewId:a})}' data-vscode-mermaid-webview-id="${a}">
|
|
53
|
+
${x()}
|
|
52
54
|
<button class="open-in-editor-btn" title="${f}" aria-label="${f}"><i class="codicon codicon-open-preview" aria-hidden="true"></i></button>
|
|
53
55
|
<pre class="mermaid">
|
|
54
56
|
${W(l)}
|
|
55
57
|
</pre>
|
|
56
58
|
|
|
57
|
-
<script type="module" nonce="${g}" src="${o.asWebviewUri(
|
|
59
|
+
<script type="module" nonce="${g}" src="${o.asWebviewUri(_)}"><\/script>
|
|
58
60
|
</body>
|
|
59
|
-
</html>`}};function
|
|
61
|
+
</html>`}};function R(e,i,r){let t=[];t.push(c.commands.registerCommand("_mermaid-markdown.openInEditor",o=>{if(typeof o?.mermaidSource=="string"){r.openPreview(o.mermaidSource,typeof o.title=="string"?o.title:void 0);return}let s=o?.mermaidWebviewId?i.getWebview(o.mermaidWebviewId):i.activeWebview;s&&r.openPreview(s.mermaidSource,s.title)})),t.push(c.lm.registerTool("renderMermaidDiagram",{invoke:async(o,s)=>{let l=o.input.markup,v=o.input.title;return se(l,v)}}));let n=new U(e.extensionUri,i);return t.push(c.chat.registerChatOutputRenderer(ne,n)),c.Disposable.from(...t)}function se(e,i){let r=ae(e),t=new c.LanguageModelToolResult([new c.LanguageModelTextPart(`${r}mermaid
|
|
60
62
|
${e}
|
|
61
|
-
${r}`)]),n=JSON.stringify({source:e,title:i});return t.toolResultDetails2={mime:
|
|
63
|
+
${r}`)]),n=JSON.stringify({source:e,title:i});return t.toolResultDetails2={mime:oe,value:new TextEncoder().encode(n)},t}function ae(e){let i=e.matchAll(/`+/g);if(!i)return"```";let r=Math.max(...Array.from(i,t=>t[0].length));return"`".repeat(Math.max(3,r+1))}function de(e){let i=new TextDecoder().decode(e);try{let r=JSON.parse(i);if(typeof r=="object"&&typeof r.source=="string")return{title:r.title,source:r.source}}catch{}return{title:void 0,source:i}}var d=C(require("vscode"));var F="vscode.mermaid-markdown-features.preview",P=class extends k{constructor(r,t){super();this._extensionUri=r;this._webviewManager=t;this._register(d.window.registerWebviewPanelSerializer(F,this))}_previews=new Map;openPreview(r,t){let n=H(r),o=this._previews.get(n);if(o){o.reveal();return}let s=S.create(n,r,t,this._extensionUri,this._webviewManager,d.ViewColumn.Active);this._registerPreview(s)}async deserializeWebviewPanel(r,t){if(!t?.mermaidSource){r.webview.html=this._getErrorHtml();return}let n=H(t.mermaidSource),o=S.revive(r,n,t.mermaidSource,this._extensionUri,this._webviewManager);this._registerPreview(o)}_registerPreview(r){this._previews.set(r.diagramId,r),r.onDispose(()=>{this._previews.delete(r.diagramId)})}_getErrorHtml(){return`<!DOCTYPE html>
|
|
62
64
|
<html lang="en">
|
|
63
65
|
<head>
|
|
64
66
|
<meta charset="UTF-8">
|
|
@@ -78,13 +80,13 @@ ${r}`)]),n=JSON.stringify({source:e,title:i});return t.toolResultDetails2={mime:
|
|
|
78
80
|
<body>
|
|
79
81
|
<p>An unexpected error occurred while restoring the Mermaid preview.</p>
|
|
80
82
|
</body>
|
|
81
|
-
</html>`}dispose(){super.dispose();for(let r of this._previews.values())r.dispose();this._previews.clear()}},
|
|
83
|
+
</html>`}dispose(){super.dispose();for(let r of this._previews.values())r.dispose();this._previews.clear()}},S=class e extends k{constructor(r,t,n,o,s){super();this._webviewPanel=r;this.diagramId=t;this._mermaidSource=n;this._extensionUri=o;this._webviewManager=s;this._webviewPanel.iconPath=new d.ThemeIcon("graph"),this._webviewPanel.webview.options={enableScripts:!0,localResourceRoots:[d.Uri.joinPath(this._extensionUri,"chat-webview-out")]},this._webviewPanel.webview.html=this._getHtml(),this._register(this._webviewManager.registerWebview(this.diagramId,this._webviewPanel.webview,this._mermaidSource,void 0,"editor")),this._register(this._webviewPanel.onDidChangeViewState(l=>{l.webviewPanel.active&&this._webviewManager.setActiveWebview(this.diagramId)})),this._register(this._webviewPanel.onDidDispose(()=>{this._onDisposeEmitter.fire(),this.dispose()}))}_onDisposeEmitter=this._register(new d.EventEmitter);onDispose=this._onDisposeEmitter.event;static create(r,t,n,o,s,l){let v=d.window.createWebviewPanel(F,n??d.l10n.t("Mermaid Diagram"),l,{retainContextWhenHidden:!1});return new e(v,r,t,o,s)}static revive(r,t,n,o,s){return new e(r,t,n,o,s)}reveal(){this._webviewPanel.reveal()}dispose(){this._onDisposeEmitter.fire(),super.dispose(),this._webviewPanel.dispose()}_getHtml(){let r=M(),t=d.Uri.joinPath(this._extensionUri,"chat-webview-out"),n=this._webviewPanel.webview.asWebviewUri(d.Uri.joinPath(t,"index-editor.js")),o=this._webviewPanel.webview.asWebviewUri(d.Uri.joinPath(t,"codicon.css")),s=d.l10n.t("Toggle Pan Mode"),l=d.l10n.t("Zoom Out"),v=d.l10n.t("Zoom In"),a=d.l10n.t("Reset Pan and Zoom");return`<!DOCTYPE html>
|
|
82
84
|
<html lang="en">
|
|
83
85
|
<head>
|
|
84
86
|
<meta charset="UTF-8">
|
|
85
87
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
86
88
|
<title>Mermaid Diagram</title>
|
|
87
|
-
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'nonce-${r}'; style-src ${this._webviewPanel.webview.cspSource} 'unsafe-inline'; font-src data:;" />
|
|
89
|
+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; script-src 'nonce-${r}'; style-src ${this._webviewPanel.webview.cspSource} 'unsafe-inline'; font-src data:;" />
|
|
88
90
|
<link rel="stylesheet" type="text/css" href="${o}" crossorigin="anonymous">
|
|
89
91
|
<style>
|
|
90
92
|
html, body {
|
|
@@ -138,6 +140,7 @@ ${r}`)]),n=JSON.stringify({source:e,title:i});return t.toolResultDetails2={mime:
|
|
|
138
140
|
</style>
|
|
139
141
|
</head>
|
|
140
142
|
<body data-vscode-context='${JSON.stringify({preventDefaultContextMenuItems:!0,mermaidWebviewId:this.diagramId})}' data-vscode-mermaid-webview-id="${this.diagramId}">
|
|
143
|
+
${x()}
|
|
141
144
|
<div class="zoom-controls">
|
|
142
145
|
<button class="pan-mode-btn" title="${s}" aria-label="${s}" aria-pressed="false"><i class="codicon codicon-move" aria-hidden="true"></i></button>
|
|
143
146
|
<button class="zoom-out-btn" title="${l}" aria-label="${l}"><i class="codicon codicon-zoom-out" aria-hidden="true"></i></button>
|
|
@@ -149,6 +152,5 @@ ${r}`)]),n=JSON.stringify({source:e,title:i});return t.toolResultDetails2={mime:
|
|
|
149
152
|
</pre>
|
|
150
153
|
<script type="module" nonce="${r}" src="${n}"><\/script>
|
|
151
154
|
</body>
|
|
152
|
-
</html>`}};function
|
|
153
|
-
${i.apply(e.renderer,r)}`},e}function se(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}var $="mermaid",E="mermaidContainer";function Z(e,i){e.use(t=>{function n(o,s,l,v){let a,b=!1,m=o.bMarks[s]+o.tShift[s],g=o.eMarks[s];if(o.src.charCodeAt(m)!==58)return!1;for(a=m+1;a<=g&&":"[(a-m)%1]===o.src[a];a++);let x=Math.floor((a-m)/1);if(x<3)return!1;a-=(a-m)%1;let D=o.src.slice(m,a),f=o.src.slice(a,g);if(f.trim().split(" ")[0].toLowerCase()!==$)return!1;if(v)return!0;let p=s;for(;p++,!(p>=l||(m=o.bMarks[p]+o.tShift[p],g=o.eMarks[p],m<g&&o.sCount[p]<o.blkIndent));)if(o.src.charCodeAt(m)===58&&!(o.sCount[p]-o.blkIndent>=4)){for(a=m+1;a<=g&&":"[(a-m)%1]===o.src[a];a++);if(!(Math.floor((a-m)/1)<x)&&(a-=(a-m)%1,a=o.skipSpaces(a),!(a<g))){b=!0;break}}let B=o.parentType,N=o.lineMax;o.parentType="container",o.lineMax=p;let y=o.push(E,"div",1);return y.markup=D,y.block=!0,y.info=f,y.map=[s,p],y.content=o.getLines(s+1,p,o.blkIndent,!0),o.parentType=B,o.lineMax=N,o.line=p+(b?1:0),!0}t.block.ruler.before("fence",E,n,{alt:["paragraph","reference","blockquote","list"]}),t.renderer.rules[E]=(o,s)=>{let v=o[s].content;return`<div class="${$}">${F(v)}</div>`}});let r=e.options.highlight;return e.options.highlight=(t,n,o)=>{let s=new RegExp("\\b("+i.languageIds().map(ae).join("|")+")\\b","i");return n&&s.test(n)?`<pre class="${$}" style="all: unset;">${F(t)}</pre>`:r?.(t,n,o)??t},e}function F(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n+$/,"").trimStart()}function ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var S=class{_activeWebviewId;_webviews=new Map;get activeWebview(){return this._activeWebviewId?this._webviews.get(this._activeWebviewId):void 0}registerWebview(i,r,t,n,o){if(this._webviews.has(i))throw new Error(`Webview with id ${i} is already registered.`);let s={id:i,webview:r,mermaidSource:t,title:n,type:o};return this._webviews.set(i,s),{dispose:()=>this.unregisterWebview(i)}}unregisterWebview(i){this._webviews.delete(i),this._activeWebviewId===i&&(this._activeWebviewId=void 0)}setActiveWebview(i){this._webviews.has(i)&&(this._activeWebviewId=i)}getWebview(i){return this._webviews.get(i)}resetPanZoom(i){(i?this._webviews.get(i):this.activeWebview)?.webview.postMessage({type:"resetPanZoom"})}};function de(e){let i=new S,r=new P(e.extensionUri,i);return e.subscriptions.push(r),e.subscriptions.push(O(e,i,r)),e.subscriptions.push(u.commands.registerCommand("_mermaid-markdown.resetPanZoom",t=>{i.resetPanZoom(t?.mermaidWebviewId)})),e.subscriptions.push(u.commands.registerCommand("_mermaid-markdown.copySource",t=>{if(typeof t?.mermaidSource=="string"){u.env.clipboard.writeText(t.mermaidSource);return}let n=t?.mermaidWebviewId?i.getWebview(t.mermaidWebviewId):i.activeWebview;n&&u.env.clipboard.writeText(n.mermaidSource)})),e.subscriptions.push(u.workspace.onDidChangeConfiguration(t=>{t.affectsConfiguration(`${h}.languages`)&&u.commands.executeCommand("markdown.api.reloadPlugins"),(t.affectsConfiguration(h)||t.affectsConfiguration("workbench.colorTheme"))&&u.commands.executeCommand("markdown.preview.refresh")})),{extendMarkdownIt(t){return Z(t,{languageIds:()=>u.workspace.getConfiguration(h).get("languages",["mermaid"])}),t.use(H),t}}}
|
|
155
|
+
</html>`}};function H(e){let i=0;for(let r=0;r<e.length;r++){let t=e.charCodeAt(r);i=(i<<5)-i+t,i=i&i}return Math.abs(i).toString(16)}var E="mermaid",z="mermaidContainer";function B(e,i){e.use(t=>{function n(o,s,l,v){let a,b=!1,m=o.bMarks[s]+o.tShift[s],g=o.eMarks[s];if(o.src.charCodeAt(m)!==58)return!1;for(a=m+1;a<=g&&":"[(a-m)%1]===o.src[a];a++);let _=Math.floor((a-m)/1);if(_<3)return!1;a-=(a-m)%1;let T=o.src.slice(m,a),f=o.src.slice(a,g);if(f.trim().split(" ")[0].toLowerCase()!==E)return!1;if(v)return!0;let p=s;for(;p++,!(p>=l||(m=o.bMarks[p]+o.tShift[p],g=o.eMarks[p],m<g&&o.sCount[p]<o.blkIndent));)if(o.src.charCodeAt(m)===58&&!(o.sCount[p]-o.blkIndent>=4)){for(a=m+1;a<=g&&":"[(a-m)%1]===o.src[a];a++);if(!(Math.floor((a-m)/1)<_)&&(a-=(a-m)%1,a=o.skipSpaces(a),!(a<g))){b=!0;break}}let N=o.parentType,q=o.lineMax;o.parentType="container",o.lineMax=p;let y=o.push(z,"div",1);return y.markup=T,y.block=!0,y.info=f,y.map=[s,p],y.content=o.getLines(s+1,p,o.blkIndent,!0),o.parentType=N,o.lineMax=q,o.line=p+(b?1:0),!0}t.block.ruler.before("fence",z,n,{alt:["paragraph","reference","blockquote","list"]}),t.renderer.rules[z]=(o,s)=>{let v=o[s].content;return`<div class="${E}">${Z(v)}</div>`}});let r=e.options.highlight;return e.options.highlight=(t,n,o)=>{let s=new RegExp("\\b("+i.languageIds().map(ce).join("|")+")\\b","i");return n&&s.test(n)?`<pre class="${E}" style="all: unset;">${Z(t)}</pre>`:r?.(t,n,o)??t},e}function Z(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n+$/,"").trimStart()}function ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var D=class{_activeWebviewId;_webviews=new Map;get activeWebview(){return this._activeWebviewId?this._webviews.get(this._activeWebviewId):void 0}registerWebview(i,r,t,n,o){if(this._webviews.has(i))throw new Error(`Webview with id ${i} is already registered.`);let s={id:i,webview:r,mermaidSource:t,title:n,type:o};return this._webviews.set(i,s),{dispose:()=>this.unregisterWebview(i)}}unregisterWebview(i){this._webviews.delete(i),this._activeWebviewId===i&&(this._activeWebviewId=void 0)}setActiveWebview(i){this._webviews.has(i)&&(this._activeWebviewId=i)}getWebview(i){return this._webviews.get(i)}resetPanZoom(i){(i?this._webviews.get(i):this.activeWebview)?.webview.postMessage({type:"resetPanZoom"})}};function me(e){let i=new D,r=new P(e.extensionUri,i);return e.subscriptions.push(r),e.subscriptions.push(R(e,i,r)),e.subscriptions.push(u.commands.registerCommand("_mermaid-markdown.resetPanZoom",t=>{i.resetPanZoom(t?.mermaidWebviewId)})),e.subscriptions.push(u.commands.registerCommand("_mermaid-markdown.copySource",t=>{if(typeof t?.mermaidSource=="string"){u.env.clipboard.writeText(t.mermaidSource);return}let n=t?.mermaidWebviewId?i.getWebview(t.mermaidWebviewId):i.activeWebview;n&&u.env.clipboard.writeText(n.mermaidSource)})),e.subscriptions.push(u.workspace.onDidChangeConfiguration(t=>{t.affectsConfiguration(`${h}.languages`)&&u.commands.executeCommand("markdown.api.reloadPlugins"),(t.affectsConfiguration(h)||t.affectsConfiguration("workbench.colorTheme"))&&u.commands.executeCommand("markdown.preview.refresh")})),{extendMarkdownIt(t){return B(t,{languageIds:()=>u.workspace.getConfiguration(h).get("languages",["mermaid"])}),t.use(L),t}}}
|
|
154
156
|
//# sourceMappingURL=extension.js.map
|