@codingame/monaco-vscode-markdown-language-features-default-extension 15.0.3 → 16.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 +10 -10
- package/package.json +2 -2
- package/resources/index.js +1 -1
- package/resources/serverWorkerMain.js +1 -1
package/index.js
CHANGED
|
@@ -4,24 +4,24 @@ var manifest = {name:"markdown-language-features",displayName:"%displayName%",de
|
|
|
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":296});
|
|
7
|
-
registerFileUrl('dist/browser/extension', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"
|
|
8
|
-
registerFileUrl('dist/browser/extension.js', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"
|
|
7
|
+
registerFileUrl('dist/browser/extension', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":1653674});
|
|
8
|
+
registerFileUrl('dist/browser/extension.js', new URL('./resources/extension.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":1653674});
|
|
9
9
|
registerFileUrl('dist/browser/extension.js.LICENSE.txt', new URL('./resources/extension.js.LICENSE.txt', import.meta.url).toString(), {"mimeType":"text/plain","size":263});
|
|
10
10
|
registerFileUrl('dist/browser/extension.js.map', new URL('./resources/extension.js.map', import.meta.url).toString(), {"mimeType":"application/json","size":5304976});
|
|
11
|
-
registerFileUrl('dist/browser/serverWorkerMain', new URL('./resources/serverWorkerMain.js', import.meta.url).toString(), {"mimeType":"
|
|
12
|
-
registerFileUrl('dist/browser/serverWorkerMain.js', new URL('./resources/serverWorkerMain.js', import.meta.url).toString(), {"mimeType":"
|
|
11
|
+
registerFileUrl('dist/browser/serverWorkerMain', new URL('./resources/serverWorkerMain.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":556004});
|
|
12
|
+
registerFileUrl('dist/browser/serverWorkerMain.js', new URL('./resources/serverWorkerMain.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":556004});
|
|
13
13
|
registerFileUrl('dist/browser/serverWorkerMain.js.LICENSE.txt', new URL('./resources/serverWorkerMain.js.LICENSE.txt', import.meta.url).toString(), {"mimeType":"text/plain","size":68});
|
|
14
14
|
registerFileUrl('icon.png', new URL('./resources/icon.png', import.meta.url).toString(), {"mimeType":"image/png","size":903});
|
|
15
15
|
registerFileUrl('media/highlight.css', new URL('./resources/highlight.css.txt', import.meta.url).toString(), {"mimeType":"text/css","size":3016});
|
|
16
|
-
registerFileUrl('media/index', new URL('./resources/index.js', import.meta.url).toString(), {"mimeType":"
|
|
17
|
-
registerFileUrl('media/index.js', new URL('./resources/index.js', import.meta.url).toString(), {"mimeType":"
|
|
16
|
+
registerFileUrl('media/index', new URL('./resources/index.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":15952});
|
|
17
|
+
registerFileUrl('media/index.js', new URL('./resources/index.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":15952});
|
|
18
18
|
registerFileUrl('media/markdown.css', new URL('./resources/markdown.css.txt', import.meta.url).toString(), {"mimeType":"text/css","size":4822});
|
|
19
|
-
registerFileUrl('media/pre', new URL('./resources/pre.js', import.meta.url).toString(), {"mimeType":"
|
|
20
|
-
registerFileUrl('media/pre.js', new URL('./resources/pre.js', import.meta.url).toString(), {"mimeType":"
|
|
19
|
+
registerFileUrl('media/pre', new URL('./resources/pre.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":2135});
|
|
20
|
+
registerFileUrl('media/pre.js', new URL('./resources/pre.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":2135});
|
|
21
21
|
registerFileUrl('media/preview-dark.svg', new URL('./resources/preview-dark.svg', import.meta.url).toString(), {"mimeType":"image/svg+xml","size":312});
|
|
22
22
|
registerFileUrl('media/preview-light.svg', new URL('./resources/preview-light.svg', import.meta.url).toString(), {"mimeType":"image/svg+xml","size":312});
|
|
23
|
-
registerFileUrl('notebook-out/index', new URL('./resources/index2.js', import.meta.url).toString(), {"mimeType":"
|
|
24
|
-
registerFileUrl('notebook-out/index.js', new URL('./resources/index2.js', import.meta.url).toString(), {"mimeType":"
|
|
23
|
+
registerFileUrl('notebook-out/index', new URL('./resources/index2.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":131207});
|
|
24
|
+
registerFileUrl('notebook-out/index.js', new URL('./resources/index2.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":131207});
|
|
25
25
|
registerFileUrl('package.json', new URL('./resources/package.json', import.meta.url).toString(), {"mimeType":"application/json","size":17404});
|
|
26
26
|
registerFileUrl('package.nls.json', new URL('./resources/package.nls.json', import.meta.url).toString(), {"mimeType":"application/json","size":14307});
|
|
27
27
|
registerFileUrl('schemas/package.schema.json', new URL('./resources/package.schema.json', import.meta.url).toString(), {"mimeType":"application/json","size":671});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-markdown-language-features-default-extension",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -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": "16.0.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/resources/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Oe=Be((Ct,Pe)=>{var Ce="Expected a function",Ne=NaN,tt="[object Symbol]",nt=/^\s+|\s+$/g,rt=/^[-+]0x[0-9a-f]+$/i,it=/^0b[01]+$/i,at=/^0o[0-7]+$/i,ot=parseInt,st=typeof global=="object"&&global&&global.Object===Object&&global,lt=typeof self=="object"&&self&&self.Object===Object&&self,ct=st||lt||Function("return this")(),dt=Object.prototype,ut=dt.toString,ft=Math.max,mt=Math.min,me=function(){return ct.Date.now()};function gt(e,t,n){var r,i,a,s,d,m,u=0,p=!1,b=!1,T=!0;if(typeof e!="function")throw new TypeError(Ce);t=Me(t)||0,te(n)&&(p=!!n.leading,b="maxWait"in n,a=b?ft(Me(n.maxWait)||0,t):a,T="trailing"in n?!!n.trailing:T);function E(v){var A=r,k=i;return r=i=void 0,u=v,s=e.apply(k,A),s}function N(v){return u=v,d=setTimeout(L,t),p?E(v):s}function g(v){var A=v-m,k=v-u,h=t-A;return b?mt(h,a-k):h}function S(v){var A=v-m,k=v-u;return m===void 0||A>=t||A<0||b&&k>=a}function L(){var v=me();if(S(v))return F(v);d=setTimeout(L,g(v))}function F(v){return d=void 0,T&&r?E(v):(r=i=void 0,s)}function _(){d!==void 0&&clearTimeout(d),u=0,r=m=i=d=void 0}function X(){return d===void 0?s:F(me())}function I(){var v=me(),A=S(v);if(r=arguments,i=this,m=v,A){if(d===void 0)return N(m);if(b)return d=setTimeout(L,t),E(m)}return d===void 0&&(d=setTimeout(L,t)),s}return I.cancel=_,I.flush=X,I}function pt(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(Ce);return te(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),gt(e,t,{leading:r,maxWait:t,trailing:i})}function te(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function vt(e){return!!e&&typeof e=="object"}function ht(e){return typeof e=="symbol"||vt(e)&&ut.call(e)==tt}function Me(e){if(typeof e=="number")return e;if(ht(e))return Ne;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(nt,"");var n=it.test(e);return n||at.test(e)?ot(e.slice(2),n?2:8):rt.test(e)?Ne:+e}Pe.exports=pt});var be="code-line",U=class{constructor(t,n,r){this.element=t;this.line=n;this.codeElement=r;this._detailParentElements=Array.from(Ue(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 U(document.body,-1)];for(let r of document.getElementsByClassName(be)){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 U(r.parentElement,i,r)):r.tagName==="UL"||r.tagName==="OL"||e.push(new U(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 Fe(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),u=W(n[m]);u.top+u.height>=r?a=m:i=m}let s=n[a],d=W(s);return a>=1&&d.top>r?{previous:n[i],next:s}:a>1&&a<n.length&&d.top+d.height>r?{previous:s,next:n[a+1]}:{previous:s}}function W({element:e}){let t=e.getBoundingClientRect(),n=e.querySelector(`.${be}`);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),d=s.top;if(i&&i.line!==r.line){let m=(e-r.line)/(i.line-r.line),u=d+s.height,p=i.element.getBoundingClientRect().top-u;a=u+m*p}else{let m=e-Math.floor(e);a=d+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}=Fe(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 ye(e,t){return ae(t).find(n=>n.element.id===e)}function*Ue(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 Te(e){document.readyState==="loading"||document.readyState==="uninitialized"?document.addEventListener("DOMContentLoaded",e):e()}var we=(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 n}throw new Error(`Could not load data for ${e}`)}function ce(e){return JSON.parse(le(e))}var Q=class{constructor(){this._settings=ce("data-settings")}get settings(){return this._settings}updateSettings(t){this._settings=t}};var Ee=11;function We(e,t){var n=t.attributes,r,i,a,s,d;if(!(t.nodeType===Ee||e.nodeType===Ee)){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,d=e.getAttributeNS(a,i),d!==s&&(r.prefix==="xmlns"&&(i=r.name),e.setAttributeNS(a,i,s))):(d=e.getAttribute(i),d!==s&&e.setAttribute(i,s));for(var u=e.attributes,p=u.length-1;p>=0;p--)r=u[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,Ve="http://www.w3.org/1999/xhtml",w=typeof document>"u"?void 0:document,je=!!w&&"content"in w.createElement("template"),qe=!!w&&w.createRange&&"createContextualFragment"in w.createRange();function ze(e){var t=w.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function Xe(e){Z||(Z=w.createRange(),Z.selectNode(w.body));var t=Z.createContextualFragment(e);return t.childNodes[0]}function Ye(e){var t=w.createElement("body");return t.innerHTML=e,t.childNodes[0]}function Ge(e){return e=e.trim(),je?ze(e):qe?Xe(e):Ye(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 $e(e,t){return!t||t===Ve?w.createElement(e):w.createElementNS(t,e)}function Ke(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function de(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var Se={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)}de(e,t,"selected")},INPUT:function(e,t){de(e,t,"checked"),de(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,Je=11,Ae=3,Le=8;function R(){}function Qe(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function Ze(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=Ge(r);var s=i.getNodeKey||Qe,d=i.onBeforeNodeAdded||R,m=i.onNodeAdded||R,u=i.onBeforeElUpdated||R,p=i.onElUpdated||R,b=i.onBeforeNodeDiscarded||R,T=i.onNodeDiscarded||R,E=i.onBeforeElChildrenUpdated||R,N=i.childrenOnly===!0,g=Object.create(null),S=[];function L(c){S.push(c)}function F(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&&F(o,l)),o=o.nextSibling}}function _(c,l,o){b(c)!==!1&&(l&&l.removeChild(c),T(c),F(c,o))}function X(c){if(c.nodeType===V||c.nodeType===Je)for(var l=c.firstChild;l;){var o=s(l);o&&(g[o]=l),X(l),l=l.nextSibling}}X(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):_(l,c,!0),l=f}}function A(c,l,o){var f=s(l);f&&delete g[f],!(!o&&(u(c,l)===!1||(e(c,l),p(c),E(c,l)===!1)))&&(c.nodeName!=="TEXTAREA"?k(c,l):Se.TEXTAREA(c,l))}function k(c,l){var o=l.firstChild,f=c.firstChild,x,P,B,G,O;e:for(;o;){for(G=o.nextSibling,x=s(o);f;){if(B=f.nextSibling,o.isSameNode&&o.isSameNode(f)){o=G,f=B;continue e}P=s(f);var $=f.nodeType,D=void 0;if($===o.nodeType&&($===V?(x?x!==P&&((O=g[x])?B===O?D=!1:(c.insertBefore(O,f),P?L(P):_(f,c,!0),f=O):D=!1):P&&(D=!1),D=D!==!1&&ee(f,o),D&&A(f,o)):($===Ae||$==Le)&&(D=!0,f.nodeValue!==o.nodeValue&&(f.nodeValue=o.nodeValue))),D){o=G,f=B;continue e}P?L(P):_(f,c,!0),f=B}if(x&&(O=g[x])&&ee(O,o))c.appendChild(O),A(O,o);else{var ie=d(o);ie!==!1&&(ie&&(o=ie),o.actualize&&(o=o.actualize(c.ownerDocument||w)),c.appendChild(o),I(o))}o=G,f=B}v(c,f,P);var he=Se[c.nodeName];he&&he(c,l)}var h=n,Y=h.nodeType,ve=r.nodeType;if(!N){if(Y===V)ve===V?ee(n,r)||(T(n),h=Ke(n,$e(r.nodeName,r.namespaceURI))):h=r;else if(Y===Ae||Y===Le){if(ve===Y)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&&_(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 et=Ze(We),xe=et;var ue=Object.freeze({http:"http",https:"https",file:"file",untitled:"untitled",mailto:"mailto",vscode:"vscode","vscode-insiders":"vscode-insiders",notebookCell:"vscode-notebook-cell"});function fe(e,t){return t.toLowerCase().startsWith(e+":")}var De=Oe(),H=0,Ie=new J,y=new Q,M=0,j=y.settings.source,q=acquireVsCodeApi(),ge=q.getState()??{},C={...ge,...ce("data-state")};typeof ge.scrollProgress<"u"&&ge?.resource!==C.resource&&(C.scrollProgress=0);q.setState(C);var z=we(q,y);window.cspAlerter.setPoster(z);window.styleLoadingMonitor.setPoster(z);function pe(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)}Te(()=>{let t=new DOMParser().parseFromString(le("data-initial-md-content"),"text/html");document.body.appendChild(t.body);let n=C.scrollProgress;if(ke(),typeof n=="number"&&!y.settings.fragment){pe(()=>{H+=1;let r=Math.max(1,n*document.body.clientHeight);window.scrollTo(0,r)});return}y.settings.scrollPreviewWithEditor&&pe(()=>{if(y.settings.fragment){let r;try{r=encodeURIComponent(y.settings.fragment)}catch{r=y.settings.fragment}C.fragment=void 0,q.setState(C);let i=ye(r,M);i&&(H+=1,K(i.line,M,y))}else isNaN(y.settings.line)||(H+=1,K(y.settings.line,M,y))}),typeof y.settings.selectedLine=="number"&&Ie.onDidChangeTextEditorSelection(y.settings.selectedLine,M)});var bt=(()=>{let e=De(t=>{H+=1,pe(()=>K(t,M,y))},50);return t=>{isNaN(t)||(C.line=t,e(t))}})();window.addEventListener("resize",()=>{H+=1,He()},!0);function ke(){let e=document.getElementsByTagName("img"),t=0;for(let n of e){n.id="image-"+t,t+=1;let r=n.getAttribute("data-src"),a=r&&!(fe(ue.http,r)||fe(ue.https,r))?"localImage":"image";n.setAttribute("data-vscode-context",JSON.stringify({webviewSection:a,id:n.id,preventDefaultContextMenuItems:!0,resource:j,imageSource:r}))}}async function Re(e,t=5){if(!document.hasFocus()&&t>0){setTimeout(()=>{Re(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&&Re(n);return}case"onDidChangeTextEditorSelection":t.source===j&&Ie.onDidChangeTextEditorSelection(t.line,M);return;case"updateView":t.source===j&&bt(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=(u,p)=>{if(u.isEqualNode(p))return!0;if(u.tagName!==p.tagName||u.textContent!==p.textContent)return!1;let b=[...u.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(u.children),N=Array.from(p.children);return E.length===N.length&&E.every((g,S)=>s(g,N[S]))},d=i.querySelector(".markdown-body"),m=d.querySelectorAll("link");for(let u of m)u.remove();d.prepend(...m),xe(n,d,{childrenOnly:!0,onBeforeElUpdated:(u,p)=>{if(s(u,p)){let b=u.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 u.tagName==="DETAILS"&&p.tagName==="DETAILS"&&u.hasAttribute("open")&&p.setAttribute("open",""),!0}})}++M,window.dispatchEvent(new CustomEvent("vscode.markdown.updateContent")),ke();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)&&z.postMessage("didClick",{line:Math.floor(n)})});var yt=["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&&(n=t.getAttribute("href"),yt.some(r=>n.startsWith(r))))return;if(!/^[a-z\-]+:/i.test(n)){z.postMessage("openLink",{href:n}),e.preventDefault(),e.stopPropagation();return}return}t=t.parentNode}},!0);window.addEventListener("scroll",De(()=>{if(He(),H>0)H-=1;else{let e=se(window.scrollY,M);typeof e=="number"&&!isNaN(e)&&z.postMessage("revealLine",{line:e})}},50));function He(){C.scrollProgress=window.scrollY/document.body.clientHeight,q.setState(C)}
|
|
1
|
+
var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var He=qe((It,Ie)=>{var ke="Expected a function",Oe=NaN,ot="[object Symbol]",st=/^\s+|\s+$/g,lt=/^[-+]0x[0-9a-f]+$/i,ct=/^0b[01]+$/i,dt=/^0o[0-7]+$/i,ut=parseInt,ft=typeof global=="object"&&global&&global.Object===Object&&global,mt=typeof self=="object"&&self&&self.Object===Object&&self,gt=ft||mt||Function("return this")(),pt=Object.prototype,vt=pt.toString,ht=Math.max,bt=Math.min,pe=function(){return gt.Date.now()};function yt(e,t,n){var r,i,a,s,o,d,m=0,y=!1,T=!1,S=!0;if(typeof e!="function")throw new TypeError(ke);t=De(t)||0,ne(n)&&(y=!!n.leading,T="maxWait"in n,a=T?ht(De(n.maxWait)||0,t):a,S="trailing"in n?!!n.trailing:S);function M(g){var w=r,k=i;return r=i=void 0,m=g,s=e.apply(k,w),s}function re(g){return m=g,o=setTimeout(E,t),y?M(g):s}function X(g){var w=g-d,k=g-m,I=t-w;return T?bt(I,a-k):I}function R(g){var w=g-d,k=g-m;return d===void 0||w>=t||w<0||T&&k>=a}function E(){var g=pe();if(R(g))return D(g);o=setTimeout(E,X(g))}function D(g){return o=void 0,S&&r?M(g):(r=i=void 0,s)}function B(){o!==void 0&&clearTimeout(o),m=0,r=d=i=o=void 0}function Y(){return o===void 0?s:D(pe())}function N(){var g=pe(),w=R(g);if(r=arguments,i=this,d=g,w){if(o===void 0)return re(d);if(T)return o=setTimeout(E,t),M(d)}return o===void 0&&(o=setTimeout(E,t)),s}return N.cancel=B,N.flush=Y,N}function Tt(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(ke);return ne(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),yt(e,t,{leading:r,maxWait:t,trailing:i})}function ne(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function wt(e){return!!e&&typeof e=="object"}function Et(e){return typeof e=="symbol"||wt(e)&&vt.call(e)==ot}function De(e){if(typeof e=="number")return e;if(Et(e))return Oe;if(ne(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ne(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(st,"");var n=ct.test(e);return n||dt.test(e)?ut(e.slice(2),n?2:8):lt.test(e)?Oe:+e}Ie.exports=Tt});var we="code-line",U=class{constructor(t,n,r){this.element=t;this.line=n;this.codeElement=r;this._detailParentElements=Array.from(Xe(t,"DETAILS"))}get isVisible(){return!this._detailParentElements.some(t=>!t.open)}},se=(()=>{let e,t=-1;return n=>{if(!e||n!==t){t=n,e=[new U(document.body,-1)];for(let r of document.getElementsByClassName(we)){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 U(r.parentElement,i,r)):r.tagName==="UL"||r.tagName==="OL"||e.push(new U(r,i)))}}return e}})();function le(e,t){let n=Math.floor(e),r=se(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 ze(e,t){let n=se(t).filter(d=>d.isVisible),r=e-window.scrollY,i=-1,a=n.length-1;for(;i+1<a;){let d=Math.floor((i+a)/2),m=W(n[d]);m.top+m.height>=r?a=d:i=d}let s=n[a],o=W(s);return a>=1&&o.top>r?{previous:n[i],next:s}:a>1&&a<n.length&&o.top+o.height>r?{previous:s,next:n[a+1]}:{previous:s}}function W({element:e}){let t=e.getBoundingClientRect(),n=e.querySelector(`.${we}`);if(n){let r=n.getBoundingClientRect(),i=Math.max(1,r.top-t.top);return{top:t.top,height:i}}return t}function J(e,t,n){if(!n.settings?.scrollPreviewWithEditor)return;if(e<=0){window.scroll(window.scrollX,0);return}let{previous:r,next:i}=le(e,t);if(!r)return;let a=0,s=W(r),o=s.top;if(i&&i.line!==r.line){let d=(e-r.line)/(i.line-r.line),m=o+s.height,y=i.element.getBoundingClientRect().top-m;a=m+d*y}else{let d=e-Math.floor(e);a=o+s.height*d}a=Math.abs(a)<1?Math.sign(a):a,window.scroll(window.scrollX,Math.max(1,window.scrollY+a))}function ce(e,t){let{previous:n,next:r}=ze(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 Ee(e,t){return se(t).find(n=>n.element.id===e)}function*Xe(e,t){for(let n=e.parentElement;n;n=n.parentElement)n.tagName===t&&(yield n)}var Q=class{onDidChangeTextEditorSelection(t,n){let{previous:r}=le(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 Se(e){document.readyState==="loading"||document.readyState==="uninitialized"?document.addEventListener("DOMContentLoaded",e):e()}var Ae=(e,t)=>({postMessage(n,r){e.postMessage({type:n,source:t.settings.source,...r})}});function de(e){let t=document.getElementById("vscode-markdown-preview-data");if(t){let n=t.getAttribute(e);if(n)return n}throw new Error(`Could not load data for ${e}`)}function ue(e){return JSON.parse(de(e))}var Z=class{constructor(){this._settings=ue("data-settings")}get settings(){return this._settings}updateSettings(t){this._settings=t}};var Le=11;function Ye(e,t){var n=t.attributes,r,i,a,s,o;if(!(t.nodeType===Le||e.nodeType===Le)){for(var d=n.length-1;d>=0;d--)r=n[d],i=r.name,a=r.namespaceURI,s=r.value,a?(i=r.localName||i,o=e.getAttributeNS(a,i),o!==s&&(r.prefix==="xmlns"&&(i=r.name),e.setAttributeNS(a,i,s))):(o=e.getAttribute(i),o!==s&&e.setAttribute(i,s));for(var m=e.attributes,y=m.length-1;y>=0;y--)r=m[y],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 ee,Ge="http://www.w3.org/1999/xhtml",b=typeof document>"u"?void 0:document,$e=!!b&&"content"in b.createElement("template"),Ke=!!b&&b.createRange&&"createContextualFragment"in b.createRange();function Je(e){var t=b.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function Qe(e){ee||(ee=b.createRange(),ee.selectNode(b.body));var t=ee.createContextualFragment(e);return t.childNodes[0]}function Ze(e){var t=b.createElement("body");return t.innerHTML=e,t.childNodes[0]}function et(e){return e=e.trim(),$e?Je(e):Ke?Qe(e):Ze(e)}function te(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 tt(e,t){return!t||t===Ge?b.createElement(e):b.createElementNS(t,e)}function nt(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function fe(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var xe={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)}fe(e,t,"selected")},INPUT:function(e,t){fe(e,t,"checked"),fe(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,Me=11,Ne=3,Ce=8;function O(){}function rt(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function it(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=b.createElement("html"),r.innerHTML=a}else r=et(r);else r.nodeType===Me&&(r=r.firstElementChild);var s=i.getNodeKey||rt,o=i.onBeforeNodeAdded||O,d=i.onNodeAdded||O,m=i.onBeforeElUpdated||O,y=i.onElUpdated||O,T=i.onBeforeNodeDiscarded||O,S=i.onNodeDiscarded||O,M=i.onBeforeElChildrenUpdated||O,re=i.skipFromChildren||O,X=i.addChild||function(l,c){return l.appendChild(c)},R=i.childrenOnly===!0,E=Object.create(null),D=[];function B(l){D.push(l)}function Y(l,c){if(l.nodeType===V)for(var p=l.firstChild;p;){var u=void 0;c&&(u=s(p))?B(u):(S(p),p.firstChild&&Y(p,c)),p=p.nextSibling}}function N(l,c,p){T(l)!==!1&&(c&&c.removeChild(l),S(l),Y(l,p))}function g(l){if(l.nodeType===V||l.nodeType===Me)for(var c=l.firstChild;c;){var p=s(c);p&&(E[p]=c),g(c),c=c.nextSibling}}g(n);function w(l){d(l);for(var c=l.firstChild;c;){var p=c.nextSibling,u=s(c);if(u){var f=E[u];f&&te(c,f)?(c.parentNode.replaceChild(f,c),I(f,c)):w(c)}else w(c);c=p}}function k(l,c,p){for(;c;){var u=c.nextSibling;(p=s(c))?B(p):N(c,l,!0),c=u}}function I(l,c,p){var u=s(c);if(u&&delete E[u],!p){var f=m(l,c);if(f===!1||(f instanceof HTMLElement&&(l=f,g(l)),e(l,c),y(l),M(l,c)===!1))return}l.nodeName!=="TEXTAREA"?Ve(l,c):xe.TEXTAREA(l,c)}function Ve(l,c){var p=re(l,c),u=c.firstChild,f=l.firstChild,F,A,_,$,C;e:for(;u;){for($=u.nextSibling,F=s(u);!p&&f;){if(_=f.nextSibling,u.isSameNode&&u.isSameNode(f)){u=$,f=_;continue e}A=s(f);var K=f.nodeType,P=void 0;if(K===u.nodeType&&(K===V?(F?F!==A&&((C=E[F])?_===C?P=!1:(l.insertBefore(C,f),A?B(A):N(f,l,!0),f=C,A=s(f)):P=!1):A&&(P=!1),P=P!==!1&&te(f,u),P&&I(f,u)):(K===Ne||K==Ce)&&(P=!0,f.nodeValue!==u.nodeValue&&(f.nodeValue=u.nodeValue))),P){u=$,f=_;continue e}A?B(A):N(f,l,!0),f=_}if(F&&(C=E[F])&&te(C,u))p||X(l,C),I(C,u);else{var oe=o(u);oe!==!1&&(oe&&(u=oe),u.actualize&&(u=u.actualize(l.ownerDocument||b)),X(l,u),w(u))}u=$,f=_}k(l,f,A);var Te=xe[l.nodeName];Te&&Te(l,c)}var v=n,G=v.nodeType,ye=r.nodeType;if(!R){if(G===V)ye===V?te(n,r)||(S(n),v=nt(n,tt(r.nodeName,r.namespaceURI))):v=r;else if(G===Ne||G===Ce){if(ye===G)return v.nodeValue!==r.nodeValue&&(v.nodeValue=r.nodeValue),v;v=r}}if(v===r)S(n);else{if(r.isSameNode&&r.isSameNode(v))return;if(I(v,r,R),D)for(var ie=0,je=D.length;ie<je;ie++){var ae=E[D[ie]];ae&&N(ae,ae.parentNode,!1)}}return!R&&v!==n&&n.parentNode&&(v.actualize&&(v=v.actualize(n.ownerDocument||b)),n.parentNode.replaceChild(v,n)),v}}var at=it(Ye),Pe=at;var me=Object.freeze({http:"http",https:"https",file:"file",untitled:"untitled",mailto:"mailto",vscode:"vscode","vscode-insiders":"vscode-insiders",notebookCell:"vscode-notebook-cell"});function ge(e,t){return t.toLowerCase().startsWith(e+":")}var Re=He(),H=0,Be=new Q,h=new Z,L=0,j=h.settings.source,q=acquireVsCodeApi(),ve=q.getState()??{},x={...ve,...ue("data-state")};typeof ve.scrollProgress<"u"&&ve?.resource!==x.resource&&(x.scrollProgress=0);q.setState(x);var z=Ae(q,h);window.cspAlerter.setPoster(z);window.styleLoadingMonitor.setPoster(z);function he(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)}Se(()=>{let n=[...new DOMParser().parseFromString(de("data-initial-md-content"),"text/html").body.children];document.body.append(...n);for(let i of n)i instanceof HTMLElement&&be(i);let r=x.scrollProgress;if(Fe(),typeof r=="number"&&!h.settings.fragment){he(()=>{H+=1;let i=Math.max(1,r*document.body.clientHeight);window.scrollTo(0,i)});return}h.settings.scrollPreviewWithEditor&&he(()=>{if(h.settings.fragment){let i;try{i=encodeURIComponent(h.settings.fragment)}catch{i=h.settings.fragment}x.fragment=void 0,q.setState(x);let a=Ee(i,L);a&&(H+=1,J(a.line,L,h))}else isNaN(h.settings.line)||(H+=1,J(h.settings.line,L,h))}),typeof h.settings.selectedLine=="number"&&Be.onDidChangeTextEditorSelection(h.settings.selectedLine,L)});var St=(()=>{let e=Re(t=>{H+=1,he(()=>J(t,L,h))},50);return t=>{isNaN(t)||(x.line=t,e(t))}})();window.addEventListener("resize",()=>{H+=1,Ue()},!0);function Fe(){let e=document.getElementsByTagName("img"),t=0;for(let n of e){n.id="image-"+t,t+=1;let r=n.getAttribute("data-src"),a=r&&!(ge(me.http,r)||ge(me.https,r))?"localImage":"image";n.setAttribute("data-vscode-context",JSON.stringify({webviewSection:a,id:n.id,preventDefaultContextMenuItems:!0,resource:j,imageSource:r}))}}async function _e(e,t=5){if(!document.hasFocus()&&t>0){setTimeout(()=>{_e(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);let r=window.getSelection();if(!r){await navigator.clipboard.writeText(e.getAttribute("data-src")??e.src);return}r.removeAllRanges();let i=document.createRange();i.selectNode(e),r.addRange(i),document.execCommand("copy"),r.removeAllRanges()}}window.addEventListener("message",async e=>{let t=e.data;switch(t.type){case"copyImage":{let n=document.getElementById(t.id);n instanceof HTMLImageElement&&_e(n);return}case"onDidChangeTextEditorSelection":t.source===j&&Be.onDidChangeTextEditorSelection(t.line,L);return;case"updateView":t.source===j&&St(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){j=t.source;let a=i.querySelector(".markdown-body");n.replaceWith(a),be(a)}else{let a=i.querySelector(".markdown-body"),s=a.querySelectorAll("link");for(let o of s)o.remove();a.prepend(...s),Pe(n,a,{childrenOnly:!0,onBeforeElUpdated:(o,d)=>{if(We(o,d)){let m=o.querySelectorAll("[data-line]"),y=d.querySelectorAll("[data-line]");m.length!==y.length&&console.log("unexpected line number change");for(let T=0;T<m.length;++T){let S=m[T],M=y[T];M&&S.setAttribute("data-line",M.getAttribute("data-line"))}return!1}return o.tagName==="DETAILS"&&d.tagName==="DETAILS"&&o.hasAttribute("open")&&d.setAttribute("open",""),!0},addChild:(o,d)=>{o.appendChild(d),d instanceof HTMLElement&&be(d)}})}++L,window.dispatchEvent(new CustomEvent("vscode.markdown.updateContent")),Fe();break}}},!1);document.addEventListener("dblclick",e=>{if(!h.settings.doubleClickToSwitchToEditor)return;for(let r=e.target;r;r=r.parentNode)if(r.tagName==="A")return;let t=e.pageY,n=ce(t,L);typeof n=="number"&&!isNaN(n)&&z.postMessage("didClick",{line:Math.floor(n)})});var At=["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&&(n=t.getAttribute("href"),At.some(r=>n.startsWith(r))))return;if(!/^[a-z\-]+:/i.test(n)){z.postMessage("openLink",{href:n}),e.preventDefault(),e.stopPropagation();return}return}t=t.parentNode}},!0);window.addEventListener("scroll",Re(()=>{if(Ue(),H>0)H-=1;else{let e=ce(window.scrollY,L);typeof e=="number"&&!isNaN(e)&&z.postMessage("revealLine",{line:e})}},50));function Ue(){x.scrollProgress=window.scrollY/document.body.clientHeight,q.setState(x)}function We(e,t){let n=["open"];if(e.isEqualNode(t))return!0;if(e.tagName!==t.tagName||e.textContent!==t.textContent)return!1;let r=[...e.attributes].filter(o=>!n.includes(o.name)),i=[...t.attributes].filter(o=>!n.includes(o.name));if(r.length!==i.length)return!1;for(let o=0;o<r.length;++o){let d=r[o],m=i[o];if(d.name!==m.name||d.value!==m.value&&d.name!=="data-line")return!1}let a=Array.from(e.children),s=Array.from(t.children);return a.length===s.length&&a.every((o,d)=>We(o,s[d]))}function be(e){let t=["type","src","nonce","noModule","async"],n=e.tagName==="SCRIPT"?[e]:Array.from(e.getElementsByTagName("script"));for(let r of n){if(!(r instanceof HTMLElement))continue;let i=document.createElement("script"),a=r.innerText;i.text=a;for(let s of t){let o=r.getAttribute&&r.getAttribute(s);o&&i.setAttribute(s,o)}r.insertAdjacentElement("afterend",i),r.remove()}}
|