@codingame/monaco-vscode-markdown-language-features-default-extension 1.81.8-next.1
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/extension.js +111102 -0
- package/extension.js.map +1 -0
- package/highlight.css +191 -0
- package/index.js +1 -0
- package/index2.js +17 -0
- package/markdown.css +261 -0
- package/package.json +22 -0
- package/package.schema.json +32 -0
- package/pre.js +1 -0
- package/preview-dark.svg +3 -0
- package/preview-light.svg +3 -0
- package/workerMain.js +26702 -0
- package/workerMain.js.map +1 -0
package/highlight.css
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/*
|
|
2
|
+
https://raw.githubusercontent.com/isagalaev/highlight.js/master/src/styles/vs2015.css
|
|
3
|
+
*/
|
|
4
|
+
/*
|
|
5
|
+
* Visual Studio 2015 dark style
|
|
6
|
+
* Author: Nicolas LLOBERA <nllobera@gmail.com>
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
.hljs-keyword,
|
|
11
|
+
.hljs-literal,
|
|
12
|
+
.hljs-symbol,
|
|
13
|
+
.hljs-name {
|
|
14
|
+
color: #569CD6;
|
|
15
|
+
}
|
|
16
|
+
.hljs-link {
|
|
17
|
+
color: #569CD6;
|
|
18
|
+
text-decoration: underline;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.hljs-built_in,
|
|
22
|
+
.hljs-type {
|
|
23
|
+
color: #4EC9B0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.hljs-number,
|
|
27
|
+
.hljs-class {
|
|
28
|
+
color: #B8D7A3;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.hljs-string,
|
|
32
|
+
.hljs-meta-string {
|
|
33
|
+
color: #D69D85;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.hljs-regexp,
|
|
37
|
+
.hljs-template-tag {
|
|
38
|
+
color: #9A5334;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.hljs-subst,
|
|
42
|
+
.hljs-function,
|
|
43
|
+
.hljs-title,
|
|
44
|
+
.hljs-params,
|
|
45
|
+
.hljs-formula {
|
|
46
|
+
color: #DCDCDC;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.hljs-comment,
|
|
50
|
+
.hljs-quote {
|
|
51
|
+
color: #57A64A;
|
|
52
|
+
font-style: italic;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hljs-doctag {
|
|
56
|
+
color: #608B4E;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.hljs-meta,
|
|
60
|
+
.hljs-meta-keyword,
|
|
61
|
+
.hljs-tag {
|
|
62
|
+
color: #9B9B9B;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.hljs-variable,
|
|
66
|
+
.hljs-template-variable {
|
|
67
|
+
color: #BD63C5;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.hljs-attr,
|
|
71
|
+
.hljs-attribute,
|
|
72
|
+
.hljs-builtin-name {
|
|
73
|
+
color: #9CDCFE;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.hljs-section {
|
|
77
|
+
color: gold;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.hljs-emphasis {
|
|
81
|
+
font-style: italic;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.hljs-strong {
|
|
85
|
+
font-weight: bold;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/*.hljs-code {
|
|
89
|
+
font-family:'Monospace';
|
|
90
|
+
}*/
|
|
91
|
+
|
|
92
|
+
.hljs-bullet,
|
|
93
|
+
.hljs-selector-tag,
|
|
94
|
+
.hljs-selector-id,
|
|
95
|
+
.hljs-selector-class,
|
|
96
|
+
.hljs-selector-attr,
|
|
97
|
+
.hljs-selector-pseudo {
|
|
98
|
+
color: #D7BA7D;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.hljs-addition {
|
|
102
|
+
background-color: var(--vscode-diffEditor-insertedTextBackground, rgba(155, 185, 85, 0.2));
|
|
103
|
+
color: rgb(155, 185, 85);
|
|
104
|
+
display: inline-block;
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.hljs-deletion {
|
|
109
|
+
background: var(--vscode-diffEditor-removedTextBackground, rgba(255, 0, 0, 0.2));
|
|
110
|
+
color: rgb(255, 0, 0);
|
|
111
|
+
display: inline-block;
|
|
112
|
+
width: 100%;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
/*
|
|
117
|
+
From https://raw.githubusercontent.com/isagalaev/highlight.js/master/src/styles/vs.css
|
|
118
|
+
*/
|
|
119
|
+
/*
|
|
120
|
+
|
|
121
|
+
Visual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name>
|
|
122
|
+
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
.vscode-light .hljs-function,
|
|
126
|
+
.vscode-light .hljs-params,
|
|
127
|
+
.vscode-light .hljs-number,
|
|
128
|
+
.vscode-light .hljs-class {
|
|
129
|
+
color: inherit;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.vscode-light .hljs-comment,
|
|
133
|
+
.vscode-light .hljs-quote,
|
|
134
|
+
.vscode-light .hljs-number,
|
|
135
|
+
.vscode-light .hljs-class,
|
|
136
|
+
.vscode-light .hljs-variable {
|
|
137
|
+
color: #008000;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.vscode-light .hljs-keyword,
|
|
141
|
+
.vscode-light .hljs-selector-tag,
|
|
142
|
+
.vscode-light .hljs-name,
|
|
143
|
+
.vscode-light .hljs-tag {
|
|
144
|
+
color: #00f;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.vscode-light .hljs-built_in,
|
|
148
|
+
.vscode-light .hljs-builtin-name {
|
|
149
|
+
color: #007acc;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.vscode-light .hljs-string,
|
|
153
|
+
.vscode-light .hljs-section,
|
|
154
|
+
.vscode-light .hljs-attribute,
|
|
155
|
+
.vscode-light .hljs-literal,
|
|
156
|
+
.vscode-light .hljs-template-tag,
|
|
157
|
+
.vscode-light .hljs-template-variable,
|
|
158
|
+
.vscode-light .hljs-type {
|
|
159
|
+
color: #a31515;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.vscode-light .hljs-selector-attr,
|
|
163
|
+
.vscode-light .hljs-selector-pseudo,
|
|
164
|
+
.vscode-light .hljs-meta,
|
|
165
|
+
.vscode-light .hljs-meta-keyword {
|
|
166
|
+
color: #2b91af;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.vscode-light .hljs-title,
|
|
170
|
+
.vscode-light .hljs-doctag {
|
|
171
|
+
color: #808080;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.vscode-light .hljs-attr {
|
|
175
|
+
color: #f00;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.vscode-light .hljs-symbol,
|
|
179
|
+
.vscode-light .hljs-bullet,
|
|
180
|
+
.vscode-light .hljs-link {
|
|
181
|
+
color: #00b0e8;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
.vscode-light .hljs-emphasis {
|
|
186
|
+
font-style: italic;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.vscode-light .hljs-strong {
|
|
190
|
+
font-weight: bold;
|
|
191
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Me=Be((Lt,Ne)=>{var xe="Expected a function",Ae=NaN,Qe="[object Symbol]",Ze=/^\s+|\s+$/g,et=/^[-+]0x[0-9a-f]+$/i,tt=/^0b[01]+$/i,nt=/^0o[0-7]+$/i,rt=parseInt,it=typeof global=="object"&&global&&global.Object===Object&&global,at=typeof self=="object"&&self&&self.Object===Object&&self,ot=it||at||Function("return this")(),st=Object.prototype,lt=st.toString,ct=Math.max,ut=Math.min,ue=function(){return ot.Date.now()};function dt(e,t,n){var r,i,a,s,u,m,d=0,p=!1,b=!1,T=!0;if(typeof e!="function")throw new TypeError(xe);t=Le(t)||0,te(n)&&(p=!!n.leading,b="maxWait"in n,a=b?ct(Le(n.maxWait)||0,t):a,T="trailing"in n?!!n.trailing:T);function E(v){var A=r,_=i;return r=i=void 0,d=v,s=e.apply(_,A),s}function N(v){return d=v,u=setTimeout(L,t),p?E(v):s}function g(v){var A=v-m,_=v-d,h=t-A;return b?ut(h,a-_):h}function S(v){var A=v-m,_=v-d;return m===void 0||A>=t||A<0||b&&_>=a}function L(){var v=ue();if(S(v))return U(v);u=setTimeout(L,g(v))}function U(v){return u=void 0,T&&r?E(v):(r=i=void 0,s)}function R(){u!==void 0&&clearTimeout(u),d=0,r=m=i=u=void 0}function Y(){return u===void 0?s:U(ue())}function I(){var v=ue(),A=S(v);if(r=arguments,i=this,m=v,A){if(u===void 0)return N(m);if(b)return u=setTimeout(L,t),E(m)}return u===void 0&&(u=setTimeout(L,t)),s}return I.cancel=R,I.flush=Y,I}function ft(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(xe);return te(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),dt(e,t,{leading:r,maxWait:t,trailing:i})}function te(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function mt(e){return!!e&&typeof e=="object"}function gt(e){return typeof e=="symbol"||mt(e)&<.call(e)==Qe}function Le(e){if(typeof e=="number")return e;if(gt(e))return Ae;if(te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Ze,"");var n=tt.test(e);return n||nt.test(e)?rt(e.slice(2),n?2:8):et.test(e)?Ae:+e}Ne.exports=ft});var pe="code-line",F=class{constructor(t,n,r){this.element=t;this.line=n;this.codeElement=r;this._detailParentElements=Array.from(Re(t,"DETAILS"))}get isVisible(){return!this._detailParentElements.some(t=>!t.open)}},ae=(()=>{let e,t=-1;return n=>{if(!e||n!==t){t=n,e=[new F(document.body,-1)];for(let r of document.getElementsByClassName(pe)){if(!(r instanceof HTMLElement))continue;let i=+r.getAttribute("data-line");isNaN(i)||(r.tagName==="CODE"&&r.parentElement&&r.parentElement.tagName==="PRE"?e.push(new F(r.parentElement,i,r)):r.tagName==="UL"||r.tagName==="OL"||e.push(new F(r,i)))}}return e}})();function oe(e,t){let n=Math.floor(e),r=ae(t),i=r[0]||null;for(let a of r){if(a.line===n)return{previous:a,next:void 0};if(a.line>n)return{previous:i,next:a};i=a}return{previous:i}}function He(e,t){let n=ae(t).filter(m=>m.isVisible),r=e-window.scrollY,i=-1,a=n.length-1;for(;i+1<a;){let m=Math.floor((i+a)/2),d=W(n[m]);d.top+d.height>=r?a=m:i=m}let s=n[a],u=W(s);return a>=1&&u.top>r?{previous:n[i],next:s}:a>1&&a<n.length&&u.top+u.height>r?{previous:s,next:n[a+1]}:{previous:s}}function W({element:e}){let t=e.getBoundingClientRect(),n=e.querySelector(`.${pe}`);if(n){let r=n.getBoundingClientRect(),i=Math.max(1,r.top-t.top);return{top:t.top,height:i}}return t}function K(e,t,n){if(!n.settings?.scrollPreviewWithEditor)return;if(e<=0){window.scroll(window.scrollX,0);return}let{previous:r,next:i}=oe(e,t);if(!r)return;let a=0,s=W(r),u=s.top;if(i&&i.line!==r.line){let m=(e-r.line)/(i.line-r.line),d=u+s.height,p=i.element.getBoundingClientRect().top-d;a=d+m*p}else{let m=e-Math.floor(e);a=u+s.height*m}a=Math.abs(a)<1?Math.sign(a):a,window.scroll(window.scrollX,Math.max(1,window.scrollY+a))}function se(e,t){let{previous:n,next:r}=He(e,t);if(n){if(n.line<0)return 0;let i=W(n),a=e-window.scrollY-i.top;if(r){let s=a/(W(r).top-i.top);return n.line+s*(r.line-n.line)}else{let s=a/i.height;return n.line+s}}return null}function ve(e,t){return ae(t).find(n=>n.element.id===e)}function*Re(e,t){for(let n=e.parentElement;n;n=n.parentElement)n.tagName===t&&(yield n)}var J=class{onDidChangeTextEditorSelection(t,n){let{previous:r}=oe(t,n);this._update(r&&(r.codeElement||r.element))}_update(t){this._unmarkActiveElement(this._current),this._markActiveElement(t),this._current=t}_unmarkActiveElement(t){t&&t.classList.toggle("code-active-line",!1)}_markActiveElement(t){t&&t.classList.toggle("code-active-line",!0)}};function he(e){document.readyState==="loading"||document.readyState==="uninitialized"?document.addEventListener("DOMContentLoaded",e):e()}var be=(e,t)=>({postMessage(n,r){e.postMessage({type:n,source:t.settings.source,...r})}});function le(e){let t=document.getElementById("vscode-markdown-preview-data");if(t){let n=t.getAttribute(e);if(n)return JSON.parse(n)}throw new Error(`Could not load data for ${e}`)}var Q=class{constructor(){this._settings=le("data-settings")}get settings(){return this._settings}updateSettings(t){this._settings=t}};var ye=11;function ke(e,t){var n=t.attributes,r,i,a,s,u;if(!(t.nodeType===ye||e.nodeType===ye)){for(var m=n.length-1;m>=0;m--)r=n[m],i=r.name,a=r.namespaceURI,s=r.value,a?(i=r.localName||i,u=e.getAttributeNS(a,i),u!==s&&(r.prefix==="xmlns"&&(i=r.name),e.setAttributeNS(a,i,s))):(u=e.getAttribute(i),u!==s&&e.setAttribute(i,s));for(var d=e.attributes,p=d.length-1;p>=0;p--)r=d[p],i=r.name,a=r.namespaceURI,a?(i=r.localName||i,t.hasAttributeNS(a,i)||e.removeAttributeNS(a,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var Z,Ue="http://www.w3.org/1999/xhtml",w=typeof document>"u"?void 0:document,Fe=!!w&&"content"in w.createElement("template"),We=!!w&&w.createRange&&"createContextualFragment"in w.createRange();function Ve(e){var t=w.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function je(e){Z||(Z=w.createRange(),Z.selectNode(w.body));var t=Z.createContextualFragment(e);return t.childNodes[0]}function qe(e){var t=w.createElement("body");return t.innerHTML=e,t.childNodes[0]}function Xe(e){return e=e.trim(),Fe?Ve(e):We?je(e):qe(e)}function ee(e,t){var n=e.nodeName,r=t.nodeName,i,a;return n===r?!0:(i=n.charCodeAt(0),a=r.charCodeAt(0),i<=90&&a>=97?n===r.toUpperCase():a<=90&&i>=97?r===n.toUpperCase():!1)}function Ye(e,t){return!t||t===Ue?w.createElement(e):w.createElementNS(t,e)}function ze(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function ce(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var Te={OPTION:function(e,t){var n=e.parentNode;if(n){var r=n.nodeName.toUpperCase();r==="OPTGROUP"&&(n=n.parentNode,r=n&&n.nodeName.toUpperCase()),r==="SELECT"&&!n.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}ce(e,t,"selected")},INPUT:function(e,t){ce(e,t,"checked"),ce(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var r=e.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==e.placeholder)return;r.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n=-1,r=0,i=e.firstChild,a,s;i;)if(s=i.nodeName&&i.nodeName.toUpperCase(),s==="OPTGROUP")a=i,i=a.firstChild;else{if(s==="OPTION"){if(i.hasAttribute("selected")){n=r;break}r++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}e.selectedIndex=n}}},V=1,Ge=11,we=3,Ee=8;function B(){}function $e(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function Ke(e){return function(n,r,i){if(i||(i={}),typeof r=="string")if(n.nodeName==="#document"||n.nodeName==="HTML"||n.nodeName==="BODY"){var a=r;r=w.createElement("html"),r.innerHTML=a}else r=Xe(r);var s=i.getNodeKey||$e,u=i.onBeforeNodeAdded||B,m=i.onNodeAdded||B,d=i.onBeforeElUpdated||B,p=i.onElUpdated||B,b=i.onBeforeNodeDiscarded||B,T=i.onNodeDiscarded||B,E=i.onBeforeElChildrenUpdated||B,N=i.childrenOnly===!0,g=Object.create(null),S=[];function L(c){S.push(c)}function U(c,l){if(c.nodeType===V)for(var o=c.firstChild;o;){var f=void 0;l&&(f=s(o))?L(f):(T(o),o.firstChild&&U(o,l)),o=o.nextSibling}}function R(c,l,o){b(c)!==!1&&(l&&l.removeChild(c),T(c),U(c,o))}function Y(c){if(c.nodeType===V||c.nodeType===Ge)for(var l=c.firstChild;l;){var o=s(l);o&&(g[o]=l),Y(l),l=l.nextSibling}}Y(n);function I(c){m(c);for(var l=c.firstChild;l;){var o=l.nextSibling,f=s(l);if(f){var x=g[f];x&&ee(l,x)?(l.parentNode.replaceChild(x,l),A(x,l)):I(l)}else I(l);l=o}}function v(c,l,o){for(;l;){var f=l.nextSibling;(o=s(l))?L(o):R(l,c,!0),l=f}}function A(c,l,o){var f=s(l);f&&delete g[f],!(!o&&(d(c,l)===!1||(e(c,l),p(c),E(c,l)===!1)))&&(c.nodeName!=="TEXTAREA"?_(c,l):Te.TEXTAREA(c,l))}function _(c,l){var o=l.firstChild,f=c.firstChild,x,P,k,G,O;e:for(;o;){for(G=o.nextSibling,x=s(o);f;){if(k=f.nextSibling,o.isSameNode&&o.isSameNode(f)){o=G,f=k;continue e}P=s(f);var $=f.nodeType,D=void 0;if($===o.nodeType&&($===V?(x?x!==P&&((O=g[x])?k===O?D=!1:(c.insertBefore(O,f),P?L(P):R(f,c,!0),f=O):D=!1):P&&(D=!1),D=D!==!1&&ee(f,o),D&&A(f,o)):($===we||$==Ee)&&(D=!0,f.nodeValue!==o.nodeValue&&(f.nodeValue=o.nodeValue))),D){o=G,f=k;continue e}P?L(P):R(f,c,!0),f=k}if(x&&(O=g[x])&&ee(O,o))c.appendChild(O),A(O,o);else{var ie=u(o);ie!==!1&&(ie&&(o=ie),o.actualize&&(o=o.actualize(c.ownerDocument||w)),c.appendChild(o),I(o))}o=G,f=k}v(c,f,P);var ge=Te[c.nodeName];ge&&ge(c,l)}var h=n,z=h.nodeType,me=r.nodeType;if(!N){if(z===V)me===V?ee(n,r)||(T(n),h=ze(n,Ye(r.nodeName,r.namespaceURI))):h=r;else if(z===we||z===Ee){if(me===z)return h.nodeValue!==r.nodeValue&&(h.nodeValue=r.nodeValue),h;h=r}}if(h===r)T(n);else{if(r.isSameNode&&r.isSameNode(h))return;if(A(h,r,N),S)for(var ne=0,_e=S.length;ne<_e;ne++){var re=g[S[ne]];re&&R(re,re.parentNode,!1)}}return!N&&h!==n&&n.parentNode&&(h.actualize&&(h=h.actualize(n.ownerDocument||w)),n.parentNode.replaceChild(h,n)),h}}var Je=Ke(ke),Se=Je;var Ce=Me(),H=0,Pe=new J,y=new Q,M=0,j=y.settings.source,q=acquireVsCodeApi(),de=q.getState()??{},C={...de,...le("data-state")};typeof de.scrollProgress<"u"&&de?.resource!==C.resource&&(C.scrollProgress=0);q.setState(C);var X=be(q,y);window.cspAlerter.setPoster(X);window.styleLoadingMonitor.setPoster(X);function fe(e){let t=document.getElementsByTagName("img");if(t.length>0){let n=Array.from(t,r=>r.complete?Promise.resolve():new Promise(i=>{r.addEventListener("load",()=>i()),r.addEventListener("error",()=>i())}));Promise.all(n).then(()=>setTimeout(e,0))}else setTimeout(e,0)}he(()=>{let e=C.scrollProgress;if(Oe(),typeof e=="number"&&!y.settings.fragment){fe(()=>{H+=1;let t=Math.max(1,e*document.body.clientHeight);window.scrollTo(0,t)});return}y.settings.scrollPreviewWithEditor&&fe(()=>{if(y.settings.fragment){let t;try{t=encodeURIComponent(y.settings.fragment)}catch{t=y.settings.fragment}C.fragment=void 0,q.setState(C);let n=ve(t,M);n&&(H+=1,K(n.line,M,y))}else isNaN(y.settings.line)||(H+=1,K(y.settings.line,M,y))}),typeof y.settings.selectedLine=="number"&&Pe.onDidChangeTextEditorSelection(y.settings.selectedLine,M)});var pt=(()=>{let e=Ce(t=>{H+=1,fe(()=>K(t,M,y))},50);return t=>{isNaN(t)||(C.line=t,e(t))}})();window.addEventListener("resize",()=>{H+=1,Ie()},!0);function Oe(){let e=document.getElementsByTagName("img"),t=0;for(let n of e)n.id="image-"+t,t+=1,n.setAttribute("data-vscode-context",JSON.stringify({webviewSection:"image",id:n.id,preventDefaultContextMenuItems:!0,resource:j}))}async function De(e,t=5){if(!document.hasFocus()&&t>0){setTimeout(()=>{De(e,t-1)},20);return}try{await navigator.clipboard.write([new ClipboardItem({"image/png":new Promise(n=>{let r=document.createElement("canvas");r!==null&&(r.width=e.naturalWidth,r.height=e.naturalHeight,r.getContext("2d")?.drawImage(e,0,0)),r.toBlob(i=>{i&&n(i),r.remove()},"image/png")})})])}catch(n){console.error(n)}}window.addEventListener("message",async e=>{let t=e.data;switch(t.type){case"copyImage":{let n=document.getElementById(t.id);n instanceof HTMLImageElement&&De(n);return}case"onDidChangeTextEditorSelection":t.source===j&&Pe.onDidChangeTextEditorSelection(t.line,M);return;case"updateView":t.source===j&&pt(t.line);return;case"updateContent":{let n=document.querySelector(".markdown-body"),i=new DOMParser().parseFromString(t.content,"text/html");for(let a of Array.from(i.querySelectorAll("meta")))a.hasAttribute("http-equiv")&&a.remove();if(t.source!==j)n.replaceWith(i.querySelector(".markdown-body")),j=t.source;else{let a=["open"],s=(d,p)=>{if(d.isEqualNode(p))return!0;if(d.tagName!==p.tagName||d.textContent!==p.textContent)return!1;let b=[...d.attributes].filter(g=>!a.includes(g.name)),T=[...p.attributes].filter(g=>!a.includes(g.name));if(b.length!==T.length)return!1;for(let g=0;g<b.length;++g){let S=b[g],L=T[g];if(S.name!==L.name||S.value!==L.value&&S.name!=="data-line")return!1}let E=Array.from(d.children),N=Array.from(p.children);return E.length===N.length&&E.every((g,S)=>s(g,N[S]))},u=i.querySelector(".markdown-body"),m=u.querySelectorAll("link");for(let d of m)d.remove();u.prepend(...m),Se(n,u,{childrenOnly:!0,onBeforeElUpdated:(d,p)=>{if(s(d,p)){let b=d.querySelectorAll("[data-line]"),T=p.querySelectorAll("[data-line]");b.length!==T.length&&console.log("unexpected line number change");for(let E=0;E<b.length;++E){let N=b[E],g=T[E];g&&N.setAttribute("data-line",g.getAttribute("data-line"))}return!1}return d.tagName==="DETAILS"&&p.tagName==="DETAILS"&&d.hasAttribute("open")&&p.setAttribute("open",""),!0}})}++M,window.dispatchEvent(new CustomEvent("vscode.markdown.updateContent")),Oe();break}}},!1);document.addEventListener("dblclick",e=>{if(!y.settings.doubleClickToSwitchToEditor)return;for(let r=e.target;r;r=r.parentNode)if(r.tagName==="A")return;let t=e.pageY,n=se(t,M);typeof n=="number"&&!isNaN(n)&&X.postMessage("didClick",{line:Math.floor(n)})});var vt=["http:","https:","mailto:","vscode:","vscode-insiders:"];document.addEventListener("click",e=>{if(!e)return;let t=e.target;for(;t;){if(t.tagName&&t.tagName==="A"&&t.href){if(t.getAttribute("href").startsWith("#"))return;let n=t.getAttribute("data-href");if(!n){if(vt.some(r=>t.href.startsWith(r)))return;n=t.getAttribute("href")}if(!/^[a-z\-]+:/i.test(n)){X.postMessage("openLink",{href:n}),e.preventDefault(),e.stopPropagation();return}return}t=t.parentNode}},!0);window.addEventListener("scroll",Ce(()=>{if(Ie(),H>0)H-=1;else{let e=se(window.scrollY,M);typeof e=="number"&&!isNaN(e)&&X.postMessage("revealLine",{line:e})}},50));function Ie(){C.scrollProgress=window.scrollY/document.body.clientHeight,q.setState(C)}
|
package/index2.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { registerExtension } from 'vscode/extensions';
|
|
2
|
+
|
|
3
|
+
var manifest = {name:"markdown-language-features",displayName:"Markdown Language Features",description:"Provides rich language support for Markdown.",version:"1.0.0",icon:"icon.png",publisher:"vscode",license:"MIT",aiKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",engines:{vscode:"^1.70.0"},main:undefined,browser:"./dist/browser/extension",categories:["Programming Languages"],enabledApiProposals:["documentPaste","dropMetadata"],activationEvents:["onLanguage:markdown","onCommand:markdown.api.render","onCommand:markdown.api.reloadPlugins","onWebviewPanel:markdown.preview"],capabilities:{virtualWorkspaces:true,untrustedWorkspaces:{supported:"limited",description:"Required for loading styles configured in the workspace.",restrictedConfigurations:["markdown.styles"]}},contributes:{notebookRenderer:[{id:"vscode.markdown-it-renderer",displayName:"Markdown it renderer",entrypoint:"./notebook-out/index.js",mimeTypes:["text/markdown","text/latex","text/x-css","text/x-html","text/x-json","text/x-typescript","text/x-abap","text/x-apex","text/x-azcli","text/x-bat","text/x-cameligo","text/x-clojure","text/x-coffee","text/x-cpp","text/x-csharp","text/x-csp","text/x-css","text/x-dart","text/x-dockerfile","text/x-ecl","text/x-fsharp","text/x-go","text/x-graphql","text/x-handlebars","text/x-hcl","text/x-html","text/x-ini","text/x-java","text/x-javascript","text/x-julia","text/x-kotlin","text/x-less","text/x-lexon","text/x-lua","text/x-m3","text/x-markdown","text/x-mips","text/x-msdax","text/x-mysql","text/x-objective-c/objective","text/x-pascal","text/x-pascaligo","text/x-perl","text/x-pgsql","text/x-php","text/x-postiats","text/x-powerquery","text/x-powershell","text/x-pug","text/x-python","text/x-r","text/x-razor","text/x-redis","text/x-redshift","text/x-restructuredtext","text/x-ruby","text/x-rust","text/x-sb","text/x-scala","text/x-scheme","text/x-scss","text/x-shell","text/x-solidity","text/x-sophia","text/x-sql","text/x-st","text/x-swift","text/x-systemverilog","text/x-tcl","text/x-twig","text/x-typescript","text/x-vb","text/x-xml","text/x-yaml","application/json"]}],commands:[{command:"_markdown.copyImage",title:"Copy Image"},{command:"markdown.showPreview",title:"Open Preview",category:"Markdown",icon:{light:"./media/preview-light.svg",dark:"./media/preview-dark.svg"}},{command:"markdown.showPreviewToSide",title:"Open Preview to the Side",category:"Markdown",icon:"$(open-preview)"},{command:"markdown.showLockedPreviewToSide",title:"Open Locked Preview to the Side",category:"Markdown",icon:"$(open-preview)"},{command:"markdown.showSource",title:"Show Source",category:"Markdown",icon:"$(go-to-file)"},{command:"markdown.showPreviewSecuritySelector",title:"Change Preview Security Settings",category:"Markdown"},{command:"markdown.preview.refresh",title:"Refresh Preview",category:"Markdown"},{command:"markdown.preview.toggleLock",title:"Toggle Preview Locking",category:"Markdown"},{command:"markdown.findAllFileReferences",title:"Find File References",category:"Markdown"},{command:"markdown.editor.insertLinkFromWorkspace",title:"Insert Link to File in Workspace",category:"Markdown",enablement:"editorLangId == markdown && !activeEditorIsReadonly"},{command:"markdown.editor.insertImageFromWorkspace",title:"Insert Image from Workspace",category:"Markdown",enablement:"editorLangId == markdown && !activeEditorIsReadonly"}],menus:{"webview/context":[{command:"_markdown.copyImage",when:"webviewId == 'markdown.preview' && webviewSection == 'image'"}],"editor/title":[{command:"markdown.showPreviewToSide",when:"editorLangId == markdown && !notebookEditorFocused && !hasCustomMarkdownPreview",alt:"markdown.showPreview",group:"navigation"},{command:"markdown.showSource",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"navigation"},{command:"markdown.preview.refresh",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"1_markdown"},{command:"markdown.preview.toggleLock",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"1_markdown"},{command:"markdown.showPreviewSecuritySelector",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"1_markdown"}],"explorer/context":[{command:"markdown.showPreview",when:"resourceLangId == markdown && !hasCustomMarkdownPreview",group:"navigation"},{command:"markdown.findAllFileReferences",when:"resourceLangId == markdown",group:"4_search"}],"editor/title/context":[{command:"markdown.showPreview",when:"resourceLangId == markdown && !hasCustomMarkdownPreview",group:"1_open"},{command:"markdown.findAllFileReferences",when:"resourceLangId == markdown"}],commandPalette:[{command:"markdown.showPreview",when:"editorLangId == markdown && !notebookEditorFocused",group:"navigation"},{command:"markdown.showPreviewToSide",when:"editorLangId == markdown && !notebookEditorFocused",group:"navigation"},{command:"markdown.showLockedPreviewToSide",when:"editorLangId == markdown && !notebookEditorFocused",group:"navigation"},{command:"markdown.showSource",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"navigation"},{command:"markdown.showPreviewSecuritySelector",when:"editorLangId == markdown && !notebookEditorFocused"},{command:"markdown.showPreviewSecuritySelector",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'"},{command:"markdown.preview.toggleLock",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'"},{command:"markdown.preview.refresh",when:"editorLangId == markdown && !notebookEditorFocused"},{command:"markdown.preview.refresh",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'"},{command:"markdown.findAllFileReferences",when:"editorLangId == markdown"}]},keybindings:[{command:"markdown.showPreview",key:"shift+ctrl+v",mac:"shift+cmd+v",when:"editorLangId == markdown && !notebookEditorFocused"},{command:"markdown.showPreviewToSide",key:"ctrl+k v",mac:"cmd+k v",when:"editorLangId == markdown && !notebookEditorFocused"}],configuration:{type:"object",title:"Markdown",order:20,properties:{"markdown.styles":{type:"array",items:{type:"string"},"default":[],description:"A list of URLs or local paths to CSS style sheets to use from the Markdown preview. Relative paths are interpreted relative to the folder open in the Explorer. If there is no open folder, they are interpreted relative to the location of the Markdown file. All '\\' need to be written as '\\\\'.",scope:"resource"},"markdown.preview.breaks":{type:"boolean","default":false,description:"Sets how line-breaks are rendered in the Markdown preview. Setting it to 'true' creates a <br> for newlines inside paragraphs.",scope:"resource"},"markdown.preview.linkify":{type:"boolean","default":true,description:"Convert URL-like text to links in the Markdown preview.",scope:"resource"},"markdown.preview.typographer":{type:"boolean","default":false,description:"Enable some language-neutral replacement and quotes beautification in the Markdown preview.",scope:"resource"},"markdown.preview.fontFamily":{type:"string","default":"-apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif",description:"Controls the font family used in the Markdown preview.",scope:"resource"},"markdown.preview.fontSize":{type:"number","default":14,description:"Controls the font size in pixels used in the Markdown preview.",scope:"resource"},"markdown.preview.lineHeight":{type:"number","default":1.6,description:"Controls the line height used in the Markdown preview. This number is relative to the font size.",scope:"resource"},"markdown.preview.scrollPreviewWithEditor":{type:"boolean","default":true,description:"When a Markdown editor is scrolled, update the view of the preview.",scope:"resource"},"markdown.preview.markEditorSelection":{type:"boolean","default":true,description:"Mark the current editor selection in the Markdown preview.",scope:"resource"},"markdown.preview.scrollEditorWithPreview":{type:"boolean","default":true,description:"When a Markdown preview is scrolled, update the view of the editor.",scope:"resource"},"markdown.preview.doubleClickToSwitchToEditor":{type:"boolean","default":true,description:"Double-click in the Markdown preview to switch to the editor.",scope:"resource"},"markdown.preview.openMarkdownLinks":{type:"string","default":"inPreview",description:"Controls how links to other Markdown files in the Markdown preview should be opened.",scope:"resource","enum":["inPreview","inEditor"],enumDescriptions:["Try to open links in the Markdown preview.","Try to open links in the editor."]},"markdown.links.openLocation":{type:"string","default":"currentGroup",description:"Controls where links in Markdown files should be opened.",scope:"resource","enum":["currentGroup","beside"],enumDescriptions:["Open links in the active editor group.","Open links beside the active editor."]},"markdown.suggest.paths.enabled":{type:"boolean","default":true,description:"Enable path suggestions while writing links in Markdown files.",scope:"resource"},"markdown.suggest.paths.includeWorkspaceHeaderCompletions":{type:"string","default":"onDoubleHash",scope:"resource",markdownDescription:"Enable suggestions for headers in other Markdown files in the current workspace. Accepting one of these suggestions inserts the full path to header in that file, for example: `[link text](/path/to/file.md#header)`.","enum":["never","onDoubleHash","onSingleOrDoubleHash"],markdownEnumDescriptions:["Disable workspace header suggestions.","Enable workspace header suggestions after typing `##` in a path, for example: `[link text](##`.","Enable workspace header suggestions after typing either `##` or `#` in a path, for example: `[link text](#` or `[link text](##`."]},"markdown.trace.extension":{type:"string","enum":["off","verbose"],"default":"off",description:"Enable debug logging for the Markdown extension.",scope:"window"},"markdown.trace.server":{type:"string",scope:"window","enum":["off","messages","verbose"],"default":"off",description:"Traces the communication between VS Code and the Markdown language server."},"markdown.server.log":{type:"string",scope:"window","enum":["off","debug","trace"],"default":"off",description:"Controls the logging level of the Markdown language server."},"markdown.editor.drop.enabled":{type:"boolean","default":true,markdownDescription:"Enable dropping files into a Markdown editor while holding Shift. Requires enabling `#editor.dropIntoEditor.enabled#`.",scope:"resource"},"markdown.editor.drop.copyIntoWorkspace":{type:"string",markdownDescription:"Controls if files outside of the workspace that are dropped into a Markdown editor should be copied into the workspace.\n\nUse `#markdown.copyFiles.destination#` to configure where copied dropped files should be created","default":"mediaFiles","enum":["mediaFiles","never"],markdownEnumDescriptions:["Try to copy external image and video files into the workspace.","Do not copy external files into the workspace."]},"markdown.editor.filePaste.enabled":{type:"boolean",scope:"resource",markdownDescription:"Enable pasting files into a Markdown editor to create Markdown links. Requires enabling `#editor.pasteAs.enabled#`.","default":true},"markdown.editor.filePaste.copyIntoWorkspace":{type:"string",markdownDescription:"Controls if files outside of the workspace that are pasted into a Markdown editor should be copied into the workspace.\n\nUse `#markdown.copyFiles.destination#` to configure where copied files should be created.","default":"mediaFiles","enum":["mediaFiles","never"],markdownEnumDescriptions:["Try to copy external image and video files into the workspace.","Do not copy external files into the workspace."]},"markdown.editor.pasteUrlAsFormattedLink.enabled":{type:"string",scope:"resource",markdownDescription:"Controls how a Markdown link is created when a URL is pasted into the Markdown editor. Requires enabling `#editor.pasteAs.enabled#`.","default":"never","enum":["always","smart","never"],markdownEnumDescriptions:["Always creates a Markdown link when a URL is pasted into the Markdown editor.","Smartly avoids creating a Markdown link in specific cases, such as within code brackets or inside an existing Markdown link.","Never creates a Markdown link when a URL is pasted into the Markdown editor."]},"markdown.validate.enabled":{type:"boolean",scope:"resource",description:"Enable all error reporting in Markdown files.","default":false},"markdown.validate.referenceLinks.enabled":{type:"string",scope:"resource",markdownDescription:"Validate reference links in Markdown files, for example: `[link][ref]`. Requires enabling `#markdown.validate.enabled#`.","default":"warning","enum":["ignore","warning","error"]},"markdown.validate.fragmentLinks.enabled":{type:"string",scope:"resource",markdownDescription:"Validate fragment links to headers in the current Markdown file, for example: `[link](#header)`. Requires enabling `#markdown.validate.enabled#`.","default":"warning","enum":["ignore","warning","error"]},"markdown.validate.fileLinks.enabled":{type:"string",scope:"resource",markdownDescription:"Validate links to other files in Markdown files, for example `[link](/path/to/file.md)`. This checks that the target files exists. Requires enabling `#markdown.validate.enabled#`.","default":"warning","enum":["ignore","warning","error"]},"markdown.validate.fileLinks.markdownFragmentLinks":{type:"string",scope:"resource",markdownDescription:"Validate the fragment part of links to headers in other files in Markdown files, for example: `[link](/path/to/file.md#header)`. Inherits the setting value from `#markdown.validate.fragmentLinks.enabled#` by default.","default":"inherit","enum":["inherit","ignore","warning","error"]},"markdown.validate.ignoredLinks":{type:"array",scope:"resource",markdownDescription:"Configure links that should not be validated. For example adding `/about` would not validate the link `[about](/about)`, while the glob `/assets/**/*.svg` would let you skip validation for any link to `.svg` files under the `assets` directory.",items:{type:"string"}},"markdown.validate.unusedLinkDefinitions.enabled":{type:"string",scope:"resource",markdownDescription:"Validate link definitions that are unused in the current file.","default":"hint","enum":["ignore","hint","warning","error"]},"markdown.validate.duplicateLinkDefinitions.enabled":{type:"string",scope:"resource",markdownDescription:"Validate duplicated definitions in the current file.","default":"warning","enum":["ignore","warning","error"]},"markdown.updateLinksOnFileMove.enabled":{type:"string","enum":["prompt","always","never"],markdownEnumDescriptions:["Prompt on each file move.","Always update links automatically.","Never try to update link and don't prompt."],"default":"never",markdownDescription:"Try to update links in Markdown files when a file is renamed/moved in the workspace. Use `#markdown.updateLinksOnFileMove.include#` to configure which files trigger link updates.",scope:"window"},"markdown.updateLinksOnFileMove.include":{type:"array",markdownDescription:"Glob patterns that specifies files that trigger automatic link updates. See `#markdown.updateLinksOnFileMove.enabled#` for details about this feature.",scope:"window",items:{type:"string",description:"The glob pattern to match file paths against. Set to true to enable the pattern."},"default":["**/*.{md,mkd,mdwn,mdown,markdown,markdn,mdtxt,mdtext,workbook}","**/*.{jpg,jpe,jpeg,png,bmp,gif,ico,webp,avif,tiff,svg,mp4}"]},"markdown.updateLinksOnFileMove.enableForDirectories":{type:"boolean","default":true,description:"Enable updating links when a directory is moved or renamed in the workspace.",scope:"window"},"markdown.occurrencesHighlight.enabled":{type:"boolean","default":false,description:"Enable highlighting link occurrences in the current document.",scope:"resource"},"markdown.copyFiles.destination":{type:"object",markdownDescription:"Defines where files copied created by drop or paste should be created. This is a map from globs that match on the Markdown document to destinations.\n\nThe destinations may use the following variables:\n\n- `${documentFileName}` — The full filename of the Markdown document, for example: `readme.md`.\n- `${documentBaseName}` — The basename of Markdown document, for example: `readme`.\n- `${documentExtName}` — The extension of the Markdown document, for example: `md`.\n- `${documentDirName}` — The name of the Markdown document's parent directory.\n- `${documentWorkspaceFolder}` — The workspace folder for the Markdown document, for example: `/Users/me/myProject`. This is the same as `${documentDirName}` if the file is not part of a workspace.\n- `${fileName}` — The file name of the dropped file, for example: `image.png`.",additionalProperties:{type:"string"}},"markdown.copyFiles.overwriteBehavior":{type:"string",markdownDescription:"Controls if files created by drop or paste should overwrite existing files.","default":"nameIncrementally","enum":["nameIncrementally","overwrite"],markdownEnumDescriptions:["If a file with the same name already exists, append a number to the file name, for example: `image.png` becomes `image-1.png`.","If a file with the same name already exists, overwrite it."]},"markdown.preferredMdPathExtensionStyle":{type:"string","default":"auto",markdownDescription:"Controls if file extensions (e.g. `.md`) are added or not for links to Markdown files. This setting is used when file paths are added by tooling such as path completions or file renames.","enum":["auto","includeExtension","removeExtension"],markdownEnumDescriptions:["For existing paths, try to maintain the file extension style. For new paths, add file extensions.","Prefer including the file extension. For example, path completions to a file named `file.md` will insert `file.md`.","Prefer removing the file extension. For example, path completions to a file named `file.md` will insert `file` without the `.md`."]}}},configurationDefaults:{"[markdown]":{"editor.wordWrap":"on","editor.quickSuggestions":{comments:"off",strings:"off",other:"off"}}},jsonValidation:[{fileMatch:"package.json",url:"./schemas/package.schema.json"}],"markdown.previewStyles":["./media/markdown.css","./media/highlight.css"],"markdown.previewScripts":["./media/index.js"],customEditors:[{viewType:"vscode.markdown.preview.editor",displayName:"Markdown Preview",priority:"option",selector:[{filenamePattern:"*.md"}]}]},scripts:{compile:"gulp compile-extension:markdown-language-features-languageService && gulp compile-extension:markdown-language-features-server && gulp compile-extension:markdown-language-features && npm run build-preview && npm run build-notebook",watch:"npm run build-preview && gulp watch-extension:markdown-language-features watch-extension:markdown-language-features-languageService watch-extension:markdown-language-features-server","vscode:prepublish":"npm run build-ext && npm run build-preview","build-ext":"node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown-language-features ./tsconfig.json","build-notebook":"node ./esbuild-notebook","build-preview":"node ./esbuild-preview","compile-web":"npx webpack-cli --config extension-browser.webpack.config --mode none","watch-web":"npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose"},dependencies:{"@vscode/extension-telemetry":"0.7.5",dompurify:"^2.4.1","highlight.js":"^11.8.0","markdown-it":"^12.3.2","markdown-it-front-matter":"^0.2.1",morphdom:"^2.6.1",picomatch:"^2.3.1","vscode-languageclient":"^8.0.2","vscode-uri":"^3.0.3"},devDependencies:{"@types/dompurify":"^2.3.1","@types/lodash.throttle":"^4.1.3","@types/markdown-it":"12.2.3","@types/picomatch":"^2.3.0","@types/vscode-notebook-renderer":"^1.60.0","@types/vscode-webview":"^1.57.0","lodash.throttle":"^4.1.1","vscode-languageserver-types":"^3.17.2","vscode-markdown-languageservice":"^0.3.0-alpha.3"},repository:{type:"git",url:"https://github.com/microsoft/vscode.git"}};
|
|
4
|
+
|
|
5
|
+
const { registerFileUrl } = registerExtension(manifest);
|
|
6
|
+
registerFileUrl('./media/preview-light.svg', new URL('./preview-light.svg', import.meta.url).toString(), 'image/svg+xml');
|
|
7
|
+
registerFileUrl('./media/preview-dark.svg', new URL('./preview-dark.svg', import.meta.url).toString(), 'image/svg+xml');
|
|
8
|
+
registerFileUrl('./schemas/package.schema.json', new URL('./package.schema.json', import.meta.url).toString(), 'application/json');
|
|
9
|
+
registerFileUrl('./media/markdown.css', new URL('./markdown.css', import.meta.url).toString(), 'text/css');
|
|
10
|
+
registerFileUrl('./media/highlight.css', new URL('./highlight.css', import.meta.url).toString(), 'text/css');
|
|
11
|
+
registerFileUrl('./media/index.js', new URL('./index.js', import.meta.url).toString(), 'text/javascript');
|
|
12
|
+
registerFileUrl('./dist/browser/extension', new URL('./extension.js', import.meta.url).toString(), 'text/javascript');
|
|
13
|
+
registerFileUrl('./dist/browser/extension.js', new URL('./extension.js', import.meta.url).toString(), 'text/javascript');
|
|
14
|
+
registerFileUrl('dist/browser/extension.js.map', new URL('./extension.js.map', import.meta.url).toString(), 'application/json');
|
|
15
|
+
registerFileUrl('server/dist/browser/workerMain.js', new URL('./workerMain.js', import.meta.url).toString(), 'application/javascript');
|
|
16
|
+
registerFileUrl('server/dist/browser/workerMain.js.map', new URL('./workerMain.js.map', import.meta.url).toString(), 'application/json');
|
|
17
|
+
registerFileUrl('./media/pre.js', new URL('./pre.js', import.meta.url).toString(), 'application/javascript');
|
package/markdown.css
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
html, body {
|
|
7
|
+
font-family: var(--markdown-font-family, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", system-ui, "Ubuntu", "Droid Sans", sans-serif);
|
|
8
|
+
font-size: var(--markdown-font-size, 14px);
|
|
9
|
+
padding: 0 26px;
|
|
10
|
+
line-height: var(--markdown-line-height, 22px);
|
|
11
|
+
word-wrap: break-word;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
padding-top: 1em;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Reset margin top for elements */
|
|
19
|
+
h1, h2, h3, h4, h5, h6,
|
|
20
|
+
p, ol, ul, pre {
|
|
21
|
+
margin-top: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
h1, h2, h3, h4, h5, h6 {
|
|
25
|
+
font-weight: 600;
|
|
26
|
+
margin-top: 24px;
|
|
27
|
+
margin-bottom: 16px;
|
|
28
|
+
line-height: 1.25;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#code-csp-warning {
|
|
32
|
+
position: fixed;
|
|
33
|
+
top: 0;
|
|
34
|
+
right: 0;
|
|
35
|
+
color: white;
|
|
36
|
+
margin: 16px;
|
|
37
|
+
text-align: center;
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
font-family: sans-serif;
|
|
40
|
+
background-color:#444444;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
padding: 6px;
|
|
43
|
+
box-shadow: 1px 1px 1px rgba(0,0,0,.25);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#code-csp-warning:hover {
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
background-color:#007acc;
|
|
49
|
+
box-shadow: 2px 2px 2px rgba(0,0,0,.25);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
body.scrollBeyondLastLine {
|
|
53
|
+
margin-bottom: calc(100vh - 22px);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
body.showEditorSelection .code-line {
|
|
57
|
+
position: relative;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
body.showEditorSelection :not(tr,ul,ol).code-active-line:before,
|
|
61
|
+
body.showEditorSelection :not(tr,ul,ol).code-line:hover:before {
|
|
62
|
+
content: "";
|
|
63
|
+
display: block;
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: 0;
|
|
66
|
+
left: -12px;
|
|
67
|
+
height: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.vscode-high-contrast.showEditorSelection :not(tr,ul,ol).code-line .code-line:hover:before {
|
|
71
|
+
border-left: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
body.showEditorSelection li.code-active-line:before,
|
|
75
|
+
body.showEditorSelection li.code-line:hover:before {
|
|
76
|
+
left: -30px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.vscode-light.showEditorSelection .code-active-line:before {
|
|
80
|
+
border-left: 3px solid rgba(0, 0, 0, 0.15);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.vscode-light.showEditorSelection .code-line:hover:before {
|
|
84
|
+
border-left: 3px solid rgba(0, 0, 0, 0.40);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.vscode-dark.showEditorSelection .code-active-line:before {
|
|
88
|
+
border-left: 3px solid rgba(255, 255, 255, 0.4);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.vscode-dark.showEditorSelection .code-line:hover:before {
|
|
92
|
+
border-left: 3px solid rgba(255, 255, 255, 0.60);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.vscode-high-contrast.showEditorSelection .code-active-line:before {
|
|
96
|
+
border-left: 3px solid rgba(255, 160, 0, 0.7);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.vscode-high-contrast.showEditorSelection .code-line:hover:before {
|
|
100
|
+
border-left: 3px solid rgba(255, 160, 0, 1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Prevent `sub` and `sup` elements from affecting line height */
|
|
104
|
+
sub,
|
|
105
|
+
sup {
|
|
106
|
+
line-height: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
ul ul,
|
|
110
|
+
ul ol,
|
|
111
|
+
ol ul,
|
|
112
|
+
ol ol {
|
|
113
|
+
margin-bottom: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
img, video {
|
|
117
|
+
max-width: 100%;
|
|
118
|
+
max-height: 100%;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
a {
|
|
122
|
+
text-decoration: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
a:hover {
|
|
126
|
+
text-decoration: underline;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
a:focus,
|
|
130
|
+
input:focus,
|
|
131
|
+
select:focus,
|
|
132
|
+
textarea:focus {
|
|
133
|
+
outline: 1px solid -webkit-focus-ring-color;
|
|
134
|
+
outline-offset: -1px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
p {
|
|
138
|
+
margin-bottom: 16px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
ul,
|
|
142
|
+
ol {
|
|
143
|
+
margin-bottom: 0.7em;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
hr {
|
|
147
|
+
border: 0;
|
|
148
|
+
height: 1px;
|
|
149
|
+
border-bottom: 1px solid;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
h1 {
|
|
153
|
+
font-size: 2em;
|
|
154
|
+
margin-top: 0;
|
|
155
|
+
padding-bottom: 0.3em;
|
|
156
|
+
border-bottom-width: 1px;
|
|
157
|
+
border-bottom-style: solid;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
h2 {
|
|
161
|
+
font-size: 1.5em;
|
|
162
|
+
padding-bottom: 0.3em;
|
|
163
|
+
border-bottom-width: 1px;
|
|
164
|
+
border-bottom-style: solid;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
h3 {
|
|
168
|
+
font-size: 1.25em;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
h4 {
|
|
172
|
+
font-size: 1em;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
h5 {
|
|
176
|
+
font-size: 0.875em;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
h6 {
|
|
180
|
+
font-size: 0.85em;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
table {
|
|
184
|
+
border-collapse: collapse;
|
|
185
|
+
margin-bottom: 0.7em;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
th {
|
|
189
|
+
text-align: left;
|
|
190
|
+
border-bottom: 1px solid;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
th,
|
|
194
|
+
td {
|
|
195
|
+
padding: 5px 10px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
table > tbody > tr + tr > td {
|
|
199
|
+
border-top: 1px solid;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
blockquote {
|
|
203
|
+
margin: 0 7px 0 5px;
|
|
204
|
+
padding: 0 16px 0 10px;
|
|
205
|
+
border-left-width: 5px;
|
|
206
|
+
border-left-style: solid;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
code {
|
|
210
|
+
font-family: var(--vscode-editor-font-family, "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace);
|
|
211
|
+
font-size: 1em;
|
|
212
|
+
line-height: 1.357em;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
body.wordWrap pre {
|
|
216
|
+
white-space: pre-wrap;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
pre:not(.hljs),
|
|
220
|
+
pre.hljs code > div {
|
|
221
|
+
padding: 16px;
|
|
222
|
+
border-radius: 3px;
|
|
223
|
+
overflow: auto;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
pre code {
|
|
227
|
+
color: var(--vscode-editor-foreground);
|
|
228
|
+
tab-size: 4;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** Theming */
|
|
232
|
+
|
|
233
|
+
pre {
|
|
234
|
+
background-color: var(--vscode-textCodeBlock-background);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.vscode-high-contrast h1 {
|
|
238
|
+
border-color: rgb(0, 0, 0);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.vscode-light th {
|
|
242
|
+
border-color: rgba(0, 0, 0, 0.69);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.vscode-dark th {
|
|
246
|
+
border-color: rgba(255, 255, 255, 0.69);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.vscode-light h1,
|
|
250
|
+
.vscode-light h2,
|
|
251
|
+
.vscode-light hr,
|
|
252
|
+
.vscode-light td {
|
|
253
|
+
border-color: rgba(0, 0, 0, 0.18);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.vscode-dark h1,
|
|
257
|
+
.vscode-dark h2,
|
|
258
|
+
.vscode-dark hr,
|
|
259
|
+
.vscode-dark td {
|
|
260
|
+
border-color: rgba(255, 255, 255, 0.18);
|
|
261
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codingame/monaco-vscode-markdown-language-features-default-extension",
|
|
3
|
+
"version": "1.81.8-next.1",
|
|
4
|
+
"keywords": [],
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "CodinGame",
|
|
7
|
+
"url": "http://www.codingame.com"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/CodinGame/monaco-vscode-api"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"private": false,
|
|
16
|
+
"description": "Default VSCode extension designed to be used with @codingame/monaco-vscode-api",
|
|
17
|
+
"main": "index2.js",
|
|
18
|
+
"module": "index2.js",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.81.8-next.1"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Markdown contributions to package.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"contributes": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"markdown.previewStyles": {
|
|
10
|
+
"type": "array",
|
|
11
|
+
"description": "Contributed CSS files that change the look or layout of the Markdown preview",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Extension relative path to a css file"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"markdown.previewScripts": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"description": "Contributed scripts that are executed in the Markdown preview",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Extension relative path to a JavaScript file"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"markdown.markdownItPlugins": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"description": "Does this extension contribute a markdown-it plugin?"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
package/pre.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(){let r=document.getElementById("vscode-markdown-preview-data");if(r){let e=r.getAttribute("data-strings");if(e)return JSON.parse(e)}throw new Error("Could not load strings")}var i=class{constructor(e){this.settingsManager=e;this.didShow=!1;this.didHaveCspWarning=!1;document.addEventListener("securitypolicyviolation",()=>{this.onCspWarning()}),window.addEventListener("message",t=>{t&&t.data&&t.data.name==="vscode-did-block-svg"&&this.onCspWarning()})}setPoster(e){this.messaging=e,this.didHaveCspWarning&&this.showCspWarning()}onCspWarning(){this.didHaveCspWarning=!0,this.showCspWarning()}showCspWarning(){let e=a(),t=this.settingsManager.settings;if(this.didShow||t.disableSecurityWarnings||!this.messaging)return;this.didShow=!0;let s=document.createElement("a");s.innerText=e.cspAlertMessageText,s.setAttribute("id","code-csp-warning"),s.setAttribute("title",e.cspAlertMessageTitle),s.setAttribute("role","button"),s.setAttribute("aria-label",e.cspAlertMessageLabel),s.onclick=()=>{this.messaging.postMessage("showPreviewSecuritySelector",{source:t.source})},document.body.appendChild(s)}};var n=class{constructor(){this.unloadedStyles=[];this.finishedLoading=!1;let e=t=>{let s=t.target.dataset.source;this.unloadedStyles.push(s)};window.addEventListener("DOMContentLoaded",()=>{for(let t of document.getElementsByClassName("code-user-style"))t.dataset.source&&(t.onerror=e)}),window.addEventListener("load",()=>{this.unloadedStyles.length&&(this.finishedLoading=!0,this.poster?.postMessage("previewStyleLoadError",{unloadedStyles:this.unloadedStyles}))})}setPoster(e){this.poster=e,this.finishedLoading&&e.postMessage("previewStyleLoadError",{unloadedStyles:this.unloadedStyles})}};function d(r){let e=document.getElementById("vscode-markdown-preview-data");if(e){let t=e.getAttribute(r);if(t)return JSON.parse(t)}throw new Error(`Could not load data for ${r}`)}var o=class{constructor(){this._settings=d("data-settings")}get settings(){return this._settings}updateSettings(e){this._settings=e}};window.cspAlerter=new i(new o);window.styleLoadingMonitor=new n;
|
package/preview-dark.svg
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V13L2 14H14L15 13V3L14 2H2ZM2 13V3H14V13H2ZM12 5H4V6H12V5ZM3 4V7H13V4H3ZM7 9H3V8H7V9ZM3 12H7V11H3V12ZM12 9H10V11H12V9ZM9 8V12H13V8H9Z" fill="#C5C5C5"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V13L2 14H14L15 13V3L14 2H2ZM2 13V3H14V13H2ZM12 5H4V6H12V5ZM3 4V7H13V4H3ZM7 9H3V8H7V9ZM3 12H7V11H3V12ZM12 9H10V11H12V9ZM9 8V12H13V8H9Z" fill="#424242"/>
|
|
3
|
+
</svg>
|