vue-devui 1.6.21 → 1.6.22
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/code-review/index.es.js +1 -0
- package/code-review/index.umd.js +1 -1
- package/editor-md/index.es.js +5 -9
- package/editor-md/index.umd.js +19 -23
- package/package.json +1 -1
- package/types/editor-md/src/icons-config.d.ts +1 -1
- package/vue-devui.es.js +7 -10
- package/vue-devui.umd.js +7 -11
package/code-review/index.es.js
CHANGED
|
@@ -6535,6 +6535,7 @@ function parseDiffCode(container, code, outputFormat, isAddCode = false) {
|
|
|
6535
6535
|
matching: "lines",
|
|
6536
6536
|
outputFormat,
|
|
6537
6537
|
highlight: true,
|
|
6538
|
+
diffStyle: "char",
|
|
6538
6539
|
rawTemplates: TemplateMap[outputFormat]
|
|
6539
6540
|
});
|
|
6540
6541
|
if (outputFormat === "side-by-side") {
|
package/code-review/index.umd.js
CHANGED
|
@@ -117,7 +117,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
117
117
|
</div>
|
|
118
118
|
</div>
|
|
119
119
|
</div>
|
|
120
|
-
</div>`,hu={"generic-empty-diff":""},Uf={"line-by-line":{"line-by-line-file-diff":Ff,...hu},"side-by-side":{"side-by-side-file-diff":Wf,...hu}};function pt(a){const v=a.classList;return!v.contains("d2h-info")&&!v.contains("d2h-emptyplaceholder")&&!v.contains("comment-cell")}function pu(a,v,u){if(u==="up"){const h=a.nextElementSibling;v.forEach(L=>{var y;(y=a.parentNode)==null||y.insertBefore(L,h)})}else v.forEach(h=>{var L;(L=a.parentNode)==null||L.insertBefore(h,a)})}function Df(a,v,u){var A,S,M,B,_,N,E,W;const h=v.children[1].innerText.trim().match(Te);if(!h)return!0;const L=parseInt(h[1]),y=parseInt(h[2]),b=parseInt(h[3]);if(u==="up"){const O=a.previousElementSibling;if(O){const R=parseInt((S=(A=O.children)==null?void 0:A[0])==null?void 0:S.innerText),T=parseInt((B=(M=O.children)==null?void 0:M[2])==null?void 0:B.innerText);if(L===R+1&&b===T+1)return a.remove(),!0}else if(L===1&&b===1)return a==null||a.remove(),!0}else{const O=a.nextElementSibling;if(O){const R=parseInt((N=(_=O==null?void 0:O.children)==null?void 0:_[0])==null?void 0:N.innerText),T=parseInt((W=(E=O==null?void 0:O.children)==null?void 0:E[2])==null?void 0:W.innerText);if(L+y===R&&b+y===T)return a.remove(),!0}}return!1}function Vf(a,v,u){var A,S,M,B,_,N,E,W,O,R,T,$;const h=v.children[1].innerText.trim().match(Te);if(!h)return!0;const L=parseInt(h[1]),y=parseInt(h[2]),b=parseInt(h[3]);if(u==="up"){const k=a.previousElementSibling;if(k){const Q=parseInt((M=(S=(A=k.children)==null?void 0:A[0].children)==null?void 0:S[0])==null?void 0:M.innerText),z=parseInt((N=(_=(B=k.children)==null?void 0:B[0].children)==null?void 0:_[1])==null?void 0:N.innerText);if(L===Q+1&&b===z+1)return a.remove(),!0}else if(L===1&&b===1)return a==null||a.remove(),!0}else{const k=a.nextElementSibling;if(k){const Q=parseInt((O=(W=(E=k==null?void 0:k.children)==null?void 0:E[0].children)==null?void 0:W[0])==null?void 0:O.innerText),z=parseInt(($=(T=(R=k==null?void 0:k.children)==null?void 0:R[0].children)==null?void 0:T[1])==null?void 0:$.innerText);if(L+y===Q&&b+y===z)return a.remove(),!0}}return!1}function gu(a,v){if(!a.nextElementSibling)return;const u=a.children[1].innerText.trim().match(Te),h=v.children[1].innerText.trim().match(Te),L=parseInt((u==null?void 0:u[2])||"")+parseInt((h==null?void 0:h[2])||""),y=parseInt((u==null?void 0:u[4])||"")+parseInt((h==null?void 0:h[4])||"");a.children[1].children[0].innerText=`@@ -${(h==null?void 0:h[1])||0},${L} +${(h==null?void 0:h[3])||0},${y} @@`}function vu(a,v){return!a||a.length===0?null:a.map(h=>{const L=h==null?void 0:h.match(/class="([^"]+)"/)[1].split(" ");return L.push(v),h.replace(/class="([^"]+)"/,`class="${L.join(" ")}"`)})}function Rr(a,v,u,h=!1){var y;const L=new nf.Diff2HtmlUI(a,v,{drawFileList:!1,matching:"lines",outputFormat:u,highlight:!0,rawTemplates:Uf[u]});if(u==="side-by-side"){let b=L.diffHtml;b.match(du)&&h&&(b=b.replace(du,""));const A=b.match(Bf),S=A.length;let M="";const B=S/2;for(let O=0;O<S/2;O++){let R=A[O].match(cu),T=A[O+B].match(cu);R=vu(R,"d-code-left"),T=vu(T,"d-code-right"),M+=`<tr>${R==null?void 0:R.join("")}${T==null?void 0:T.join("")}</tr>`}const _=((y=b.match(Mf))==null?void 0:y[1])||"",N=b.replace(Pf,`<tbody${_}></tbody>`),E=N.indexOf(`<tbody${_}>`),W=N.slice(0,E)+M+N.slice(E);L.diffHtml=W}L.draw()}function mu(a,v,u,h,L){a&&(a.classList.add("expand-line"),a.dataset.prevL=String(v),a.dataset.prevR=String(u),a.dataset.nextL=String(h),a.dataset.nextR=String(L))}function _u(a){a.children[0].children[0].remove(),a.children[0].children[0].classList.remove("up-expand"),a.children[0].children[0].classList.add("all-expand"),a.children[0].children[0].innerHTML=fu()}function We(a,v,u,h=!1){var S,M;let L,y,b,A;if(u==="top"){const B=a.nextElementSibling;L=parseInt(B.children[0].innerText)-1,y=Math.max(L-v+1,1),b=parseInt(B.children[2].innerText)-1,A=Math.max(b-v+1,1)}else if(u==="bottom"){const B=a.previousElementSibling;y=parseInt((S=B==null?void 0:B.children[0])==null?void 0:S.innerText)+1,L=y+v-1,A=parseInt((M=B==null?void 0:B.children[2])==null?void 0:M.innerText)+1,b=A+v-1}else{const B=a.previousElementSibling,_=a.nextElementSibling,N=parseInt(B.children[0].innerText),E=parseInt(_.children[0].innerText);y=N+1,A=parseInt(B.children[2].innerText)+1,L=E-1,b=parseInt(_.children[2].innerText)-1,E-N<=v&&h&&_u(a)}return isNaN(y)||isNaN(A)||isNaN(L)||isNaN(b)?!1:(mu(a,y,A,L,b),!0)}function Ue(a,v,u,h=!1){var S,M,B,_;let L,y,b,A;if(u==="top"){const N=a.nextElementSibling;L=parseInt(N.children[0].children[0].innerText)-1,y=Math.max(L-v+1,1),b=parseInt(N.children[0].children[1].innerText)-1,A=Math.max(b-v+1,1)}else if(u==="bottom"){const N=a.previousElementSibling;y=parseInt((M=(S=N==null?void 0:N.children[0].children)==null?void 0:S[0])==null?void 0:M.innerText)+1,L=y+v-1,A=parseInt((_=(B=N==null?void 0:N.children[0].children)==null?void 0:B[1])==null?void 0:_.innerText)+1,b=A+v-1}else{const N=a.previousElementSibling,E=a.nextElementSibling,W=parseInt(N.children[0].children[0].innerText),O=parseInt(E.children[0].children[0].innerText);y=W+1,A=parseInt(N.children[0].children[1].innerText)+1,L=O-1,b=parseInt(E.children[0].children[1].innerText)-1,O-W<=v&&h&&_u(a)}return isNaN(y)||isNaN(A)||isNaN(L)||isNaN(b)?!1:(mu(a,y,A,L,b),!0)}function Hf(a,v){var _,N,E;const u=(N=(_=a.parentElement)==null?void 0:_.parentElement)==null?void 0:N.dataset,h=Number(u==null?void 0:u.prevL),L=Number(u==null?void 0:u.nextL),y=Number(u==null?void 0:u.prevR),b=Number(u==null?void 0:u.nextR);let A,S,M,B;if(h&&L&&y&&b){const O=(E=Array.from(a.classList).find(R=>R.endsWith("expand")))==null?void 0:E.split("-")[0];O==="up"?(S=L,A=Math.max(S-v+1,h),B=b,M=Math.max(B-v+1,y)):O==="down"?(A=h,S=Math.min(A+v-1,L),M=y,B=Math.min(M+v-1,b)):(A=h,S=L,M=y,B=b)}return[A,S,M,B]}function $f(a,v){a.firstChild?a.insertBefore(v,a.firstChild):a.appendChild(v)}function Nr(a,v,u){const h=document.createElement("div");h.innerHTML=u,h.classList.add("expand-icon"),h.classList.add(v),$f(a,h)}function ze(a,v){var L;const u={up:"up-expand",down:"down-expand",all:"all-expand"},h={up:ou,down:lu,all:fu};a.classList.add("expand-icon-wrapper"),v==="updown"?(Nr(a,"up-expand",ou()),Nr(a,"down-expand",lu())):Nr(a,u[v],(L=h[v])==null?void 0:L.call(h))}function kf(a,v,u){var y,b;const h=document.createElement("tr"),L=document.createElement("td");L.classList.add("comment-cell"),L.style.width="100%",L.setAttribute("colspan","2"),L.appendChild(v),h.classList.add("comment-block"),h.classList.add(u),h.appendChild(L),a.nextElementSibling?(y=a.parentElement)==null||y.insertBefore(h,a.nextElementSibling):(b=a.parentElement)==null||b.appendChild(h)}function Gf(a,v,u){var L,y,b;const h=a.nextElementSibling;if(h&&((L=h.classList)==null?void 0:L.contains("comment-block"))){const A=u==="left"?h.children[0]:h.children[1];A.classList.add("comment-cell"),A.appendChild(v)}else{const A=document.createElement("tr"),S=document.createElement("td"),M=document.createElement("td");S.style.width="50%",S.setAttribute("colspan","2"),M.style.width="50%",M.setAttribute("colspan","2"),u==="left"?(S.classList.add("comment-cell"),S.appendChild(v)):(M.classList.add("comment-cell"),M.appendChild(v)),A.classList.add("comment-block"),A.classList.add(u),A.appendChild(S),A.appendChild(M),a.nextElementSibling?(y=a.parentElement)==null||y.insertBefore(A,a.nextElementSibling):(b=a.parentElement)==null||b.appendChild(A)}}function wu(a,v,u){var L,y,b,A;const h=Array.from(a.querySelectorAll("tr"));for(const S in h){const M=parseInt(S),B=Array.from(h[M].children)[0];if(pt(B)){const _=parseInt((y=(L=B.children[0])==null?void 0:L.innerText)!=null?y:-1),N=parseInt((A=(b=B.children[1])==null?void 0:b.innerText)!=null?A:-1);if(u==="left"&&_===v||u==="right"&&N===v)return h[M]}}}function xu(a,v,u){const h=Array.from(a.querySelectorAll("tr"));for(const L in h){const y=parseInt(L);let b;if(u==="left"?b=h[y].children[0]:b=h[y].children[2],b&&pt(b)&&parseInt(b.innerText)===v)return h[y]}}function qf(a,v){const{outputFormat:u,expandThreshold:h,expandLoader:L}=p.toRefs(v),y=()=>{var O;const _=Array.from(a.value.querySelectorAll("tr")),N=_.length;for(const R in _){const T=parseInt(R),$=Array.from(_[T].children),k=$[0],Q=$[1],z=Q.innerText,an=Q.classList;if(z.match(Te)&&!au.test(z)&&an&&an.contains("d2h-info")){const pn=T+1,Ln=T-1;if(T===0&&pn in _)We(_[T],h.value,"top"),ze(k,"up");else if(T>0&&T<N-1&&pn in _&&Ln in _){const qn=parseInt(_[Ln].children[0].innerText),Zn=parseInt(_[pn].children[0].innerText)-qn-1<h.value;We(_[T],h.value,"middle"),ze(k,Zn?"all":"updown")}}}const E=_[0].cloneNode(!0);if(E.children[0].children[0]&&E.children[0].removeChild(E.children[0].children[0]),E.children[1].innerText="",(O=_[0].parentElement)==null||O.appendChild(E),!We(E,h.value,"bottom")){E.remove();return}ze(E.children[0],"down")},b=(_,N,E)=>{if(!E)return;if(!_)return E==null?void 0:E.remove();const W=`--- updated_at Jan 1, 2019, 0:0:0 AM
|
|
120
|
+
</div>`,hu={"generic-empty-diff":""},Uf={"line-by-line":{"line-by-line-file-diff":Ff,...hu},"side-by-side":{"side-by-side-file-diff":Wf,...hu}};function pt(a){const v=a.classList;return!v.contains("d2h-info")&&!v.contains("d2h-emptyplaceholder")&&!v.contains("comment-cell")}function pu(a,v,u){if(u==="up"){const h=a.nextElementSibling;v.forEach(L=>{var y;(y=a.parentNode)==null||y.insertBefore(L,h)})}else v.forEach(h=>{var L;(L=a.parentNode)==null||L.insertBefore(h,a)})}function Df(a,v,u){var A,S,M,B,_,N,E,W;const h=v.children[1].innerText.trim().match(Te);if(!h)return!0;const L=parseInt(h[1]),y=parseInt(h[2]),b=parseInt(h[3]);if(u==="up"){const O=a.previousElementSibling;if(O){const R=parseInt((S=(A=O.children)==null?void 0:A[0])==null?void 0:S.innerText),T=parseInt((B=(M=O.children)==null?void 0:M[2])==null?void 0:B.innerText);if(L===R+1&&b===T+1)return a.remove(),!0}else if(L===1&&b===1)return a==null||a.remove(),!0}else{const O=a.nextElementSibling;if(O){const R=parseInt((N=(_=O==null?void 0:O.children)==null?void 0:_[0])==null?void 0:N.innerText),T=parseInt((W=(E=O==null?void 0:O.children)==null?void 0:E[2])==null?void 0:W.innerText);if(L+y===R&&b+y===T)return a.remove(),!0}}return!1}function Vf(a,v,u){var A,S,M,B,_,N,E,W,O,R,T,$;const h=v.children[1].innerText.trim().match(Te);if(!h)return!0;const L=parseInt(h[1]),y=parseInt(h[2]),b=parseInt(h[3]);if(u==="up"){const k=a.previousElementSibling;if(k){const Q=parseInt((M=(S=(A=k.children)==null?void 0:A[0].children)==null?void 0:S[0])==null?void 0:M.innerText),z=parseInt((N=(_=(B=k.children)==null?void 0:B[0].children)==null?void 0:_[1])==null?void 0:N.innerText);if(L===Q+1&&b===z+1)return a.remove(),!0}else if(L===1&&b===1)return a==null||a.remove(),!0}else{const k=a.nextElementSibling;if(k){const Q=parseInt((O=(W=(E=k==null?void 0:k.children)==null?void 0:E[0].children)==null?void 0:W[0])==null?void 0:O.innerText),z=parseInt(($=(T=(R=k==null?void 0:k.children)==null?void 0:R[0].children)==null?void 0:T[1])==null?void 0:$.innerText);if(L+y===Q&&b+y===z)return a.remove(),!0}}return!1}function gu(a,v){if(!a.nextElementSibling)return;const u=a.children[1].innerText.trim().match(Te),h=v.children[1].innerText.trim().match(Te),L=parseInt((u==null?void 0:u[2])||"")+parseInt((h==null?void 0:h[2])||""),y=parseInt((u==null?void 0:u[4])||"")+parseInt((h==null?void 0:h[4])||"");a.children[1].children[0].innerText=`@@ -${(h==null?void 0:h[1])||0},${L} +${(h==null?void 0:h[3])||0},${y} @@`}function vu(a,v){return!a||a.length===0?null:a.map(h=>{const L=h==null?void 0:h.match(/class="([^"]+)"/)[1].split(" ");return L.push(v),h.replace(/class="([^"]+)"/,`class="${L.join(" ")}"`)})}function Rr(a,v,u,h=!1){var y;const L=new nf.Diff2HtmlUI(a,v,{drawFileList:!1,matching:"lines",outputFormat:u,highlight:!0,diffStyle:"char",rawTemplates:Uf[u]});if(u==="side-by-side"){let b=L.diffHtml;b.match(du)&&h&&(b=b.replace(du,""));const A=b.match(Bf),S=A.length;let M="";const B=S/2;for(let O=0;O<S/2;O++){let R=A[O].match(cu),T=A[O+B].match(cu);R=vu(R,"d-code-left"),T=vu(T,"d-code-right"),M+=`<tr>${R==null?void 0:R.join("")}${T==null?void 0:T.join("")}</tr>`}const _=((y=b.match(Mf))==null?void 0:y[1])||"",N=b.replace(Pf,`<tbody${_}></tbody>`),E=N.indexOf(`<tbody${_}>`),W=N.slice(0,E)+M+N.slice(E);L.diffHtml=W}L.draw()}function mu(a,v,u,h,L){a&&(a.classList.add("expand-line"),a.dataset.prevL=String(v),a.dataset.prevR=String(u),a.dataset.nextL=String(h),a.dataset.nextR=String(L))}function _u(a){a.children[0].children[0].remove(),a.children[0].children[0].classList.remove("up-expand"),a.children[0].children[0].classList.add("all-expand"),a.children[0].children[0].innerHTML=fu()}function We(a,v,u,h=!1){var S,M;let L,y,b,A;if(u==="top"){const B=a.nextElementSibling;L=parseInt(B.children[0].innerText)-1,y=Math.max(L-v+1,1),b=parseInt(B.children[2].innerText)-1,A=Math.max(b-v+1,1)}else if(u==="bottom"){const B=a.previousElementSibling;y=parseInt((S=B==null?void 0:B.children[0])==null?void 0:S.innerText)+1,L=y+v-1,A=parseInt((M=B==null?void 0:B.children[2])==null?void 0:M.innerText)+1,b=A+v-1}else{const B=a.previousElementSibling,_=a.nextElementSibling,N=parseInt(B.children[0].innerText),E=parseInt(_.children[0].innerText);y=N+1,A=parseInt(B.children[2].innerText)+1,L=E-1,b=parseInt(_.children[2].innerText)-1,E-N<=v&&h&&_u(a)}return isNaN(y)||isNaN(A)||isNaN(L)||isNaN(b)?!1:(mu(a,y,A,L,b),!0)}function Ue(a,v,u,h=!1){var S,M,B,_;let L,y,b,A;if(u==="top"){const N=a.nextElementSibling;L=parseInt(N.children[0].children[0].innerText)-1,y=Math.max(L-v+1,1),b=parseInt(N.children[0].children[1].innerText)-1,A=Math.max(b-v+1,1)}else if(u==="bottom"){const N=a.previousElementSibling;y=parseInt((M=(S=N==null?void 0:N.children[0].children)==null?void 0:S[0])==null?void 0:M.innerText)+1,L=y+v-1,A=parseInt((_=(B=N==null?void 0:N.children[0].children)==null?void 0:B[1])==null?void 0:_.innerText)+1,b=A+v-1}else{const N=a.previousElementSibling,E=a.nextElementSibling,W=parseInt(N.children[0].children[0].innerText),O=parseInt(E.children[0].children[0].innerText);y=W+1,A=parseInt(N.children[0].children[1].innerText)+1,L=O-1,b=parseInt(E.children[0].children[1].innerText)-1,O-W<=v&&h&&_u(a)}return isNaN(y)||isNaN(A)||isNaN(L)||isNaN(b)?!1:(mu(a,y,A,L,b),!0)}function Hf(a,v){var _,N,E;const u=(N=(_=a.parentElement)==null?void 0:_.parentElement)==null?void 0:N.dataset,h=Number(u==null?void 0:u.prevL),L=Number(u==null?void 0:u.nextL),y=Number(u==null?void 0:u.prevR),b=Number(u==null?void 0:u.nextR);let A,S,M,B;if(h&&L&&y&&b){const O=(E=Array.from(a.classList).find(R=>R.endsWith("expand")))==null?void 0:E.split("-")[0];O==="up"?(S=L,A=Math.max(S-v+1,h),B=b,M=Math.max(B-v+1,y)):O==="down"?(A=h,S=Math.min(A+v-1,L),M=y,B=Math.min(M+v-1,b)):(A=h,S=L,M=y,B=b)}return[A,S,M,B]}function $f(a,v){a.firstChild?a.insertBefore(v,a.firstChild):a.appendChild(v)}function Nr(a,v,u){const h=document.createElement("div");h.innerHTML=u,h.classList.add("expand-icon"),h.classList.add(v),$f(a,h)}function ze(a,v){var L;const u={up:"up-expand",down:"down-expand",all:"all-expand"},h={up:ou,down:lu,all:fu};a.classList.add("expand-icon-wrapper"),v==="updown"?(Nr(a,"up-expand",ou()),Nr(a,"down-expand",lu())):Nr(a,u[v],(L=h[v])==null?void 0:L.call(h))}function kf(a,v,u){var y,b;const h=document.createElement("tr"),L=document.createElement("td");L.classList.add("comment-cell"),L.style.width="100%",L.setAttribute("colspan","2"),L.appendChild(v),h.classList.add("comment-block"),h.classList.add(u),h.appendChild(L),a.nextElementSibling?(y=a.parentElement)==null||y.insertBefore(h,a.nextElementSibling):(b=a.parentElement)==null||b.appendChild(h)}function Gf(a,v,u){var L,y,b;const h=a.nextElementSibling;if(h&&((L=h.classList)==null?void 0:L.contains("comment-block"))){const A=u==="left"?h.children[0]:h.children[1];A.classList.add("comment-cell"),A.appendChild(v)}else{const A=document.createElement("tr"),S=document.createElement("td"),M=document.createElement("td");S.style.width="50%",S.setAttribute("colspan","2"),M.style.width="50%",M.setAttribute("colspan","2"),u==="left"?(S.classList.add("comment-cell"),S.appendChild(v)):(M.classList.add("comment-cell"),M.appendChild(v)),A.classList.add("comment-block"),A.classList.add(u),A.appendChild(S),A.appendChild(M),a.nextElementSibling?(y=a.parentElement)==null||y.insertBefore(A,a.nextElementSibling):(b=a.parentElement)==null||b.appendChild(A)}}function wu(a,v,u){var L,y,b,A;const h=Array.from(a.querySelectorAll("tr"));for(const S in h){const M=parseInt(S),B=Array.from(h[M].children)[0];if(pt(B)){const _=parseInt((y=(L=B.children[0])==null?void 0:L.innerText)!=null?y:-1),N=parseInt((A=(b=B.children[1])==null?void 0:b.innerText)!=null?A:-1);if(u==="left"&&_===v||u==="right"&&N===v)return h[M]}}}function xu(a,v,u){const h=Array.from(a.querySelectorAll("tr"));for(const L in h){const y=parseInt(L);let b;if(u==="left"?b=h[y].children[0]:b=h[y].children[2],b&&pt(b)&&parseInt(b.innerText)===v)return h[y]}}function qf(a,v){const{outputFormat:u,expandThreshold:h,expandLoader:L}=p.toRefs(v),y=()=>{var O;const _=Array.from(a.value.querySelectorAll("tr")),N=_.length;for(const R in _){const T=parseInt(R),$=Array.from(_[T].children),k=$[0],Q=$[1],z=Q.innerText,an=Q.classList;if(z.match(Te)&&!au.test(z)&&an&&an.contains("d2h-info")){const pn=T+1,Ln=T-1;if(T===0&&pn in _)We(_[T],h.value,"top"),ze(k,"up");else if(T>0&&T<N-1&&pn in _&&Ln in _){const qn=parseInt(_[Ln].children[0].innerText),Zn=parseInt(_[pn].children[0].innerText)-qn-1<h.value;We(_[T],h.value,"middle"),ze(k,Zn?"all":"updown")}}}const E=_[0].cloneNode(!0);if(E.children[0].children[0]&&E.children[0].removeChild(E.children[0].children[0]),E.children[1].innerText="",(O=_[0].parentElement)==null||O.appendChild(E),!We(E,h.value,"bottom")){E.remove();return}ze(E.children[0],"down")},b=(_,N,E)=>{if(!E)return;if(!_)return E==null?void 0:E.remove();const W=`--- updated_at Jan 1, 2019, 0:0:0 AM
|
|
121
121
|
+++ updated_at Jan 1, 2019, 0:0:0 AM
|
|
122
122
|
`,O=document.createElement("div");Rr(O,W+_,u.value,!0);const R=Array.from(O.querySelectorAll("tr")),T=R.find(Q=>{var z;return(z=Q.children[1])==null?void 0:z.innerText.trim().match(Te)});if(!T)return;const $=R.filter(Q=>Q!==T);pu(E,$,N),!Df(E,T,N)&&(gu(E,T),N==="up"?E.previousElementSibling?We(E,h.value,"middle",!0):We(E,h.value,"top"):E.nextElementSibling?We(E,h.value,"middle",!0):We(E,h.value,"bottom"))},A=()=>{var O;const _=Array.from(a.value.querySelectorAll("tr")),N=_.length;for(const R in _){const T=parseInt(R),$=Array.from(_[T].children),k=$[0],Q=$[1];if(!Q)continue;const z=Q.classList.value,an=Q.innerText.trim();if(an.match(Te)&&!au.test(an)&&z&&z.includes("d2h-info")){const pn=T+1,Ln=T-1;if(T===0&&pn in _)Ue(_[T],h.value,"top"),ze(k,"up");else if(T>0&&T<N-1&&pn in _&&Ln in _){const qn=Array.from(_[Ln].children),pe=parseInt(qn[0].children[0].innerText),Zn=Array.from(_[pn].children),gt=parseInt(Zn[0].children[0].innerText);Ue(_[T],h.value,"middle");const vt=gt-pe<=h.value;ze(k,vt?"all":"updown")}}}const E=_[0].cloneNode(!0);if(E.children[0].children[0]&&E.children[0].removeChild(E.children[0].children[0]),E.children[1].innerText="",(O=_[0].parentElement)==null||O.appendChild(E),!Ue(E,h.value,"bottom")){E.remove();return}ze(E.children[0],"down")},S=(_,N,E)=>{if(!E)return;if(!_)return E==null?void 0:E.remove();const W=`--- updated_at Jan 1, 2019, 0:0:0 AM
|
|
123
123
|
+++ updated_at Jan 1, 2019, 0:0:0 AM
|
package/editor-md/index.es.js
CHANGED
|
@@ -1225,14 +1225,9 @@ const STRIKE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
|
|
|
1225
1225
|
</g>
|
|
1226
1226
|
</g>
|
|
1227
1227
|
</svg>`;
|
|
1228
|
-
const COLOR_ICON = `<svg width="
|
|
1229
|
-
<
|
|
1230
|
-
<
|
|
1231
|
-
<g>
|
|
1232
|
-
<path d="M10.4761905,8 L5.52380952,8 L4,12 L3,12 L7.5,-3.84581256e-13 L8.5,-3.84581256e-13 L13,12 L12,12 L10.4761905,8 L10.4761905,8 Z M10.0952381,7 L8,1.5 L5.9047619,7 L10.0952381,7 Z M2,14 L14,14 L14,16 L2,16 L2,14 Z" id="\u5F62\u72B6"></path>
|
|
1233
|
-
</g>
|
|
1234
|
-
</g>
|
|
1235
|
-
</g>
|
|
1228
|
+
const COLOR_ICON = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
1229
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.05597 9.5L4.05895 12H2.94092L7.55273 0.776367H8.44716L13.059 12H11.9409L10.9439 9.5H5.05597ZM5.45477 8.5H10.5451L7.99995 2.11801L5.45477 8.5Z" fill="#3B3E55"/>
|
|
1230
|
+
<path d="M1 13H15V16H1V13Z" fill="#3B3E55"/>
|
|
1236
1231
|
</svg>`;
|
|
1237
1232
|
const LIST_UNORDERED_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
|
|
1238
1233
|
<g id="edit-icon/unordered-list" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
@@ -1503,7 +1498,8 @@ ToolBarHandler.code = (editor) => {
|
|
|
1503
1498
|
}
|
|
1504
1499
|
};
|
|
1505
1500
|
ToolBarHandler.table = (editor) => {
|
|
1506
|
-
const table =
|
|
1501
|
+
const table = `
|
|
1502
|
+
| | | |
|
|
1507
1503
|
|--|--|--|
|
|
1508
1504
|
| | | |`;
|
|
1509
1505
|
editor.replaceSelection(table);
|