v-code-diff
Advanced tools
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue-demi"),t=require("diff2html"),n=require("diff");require("highlight.js/styles/googlecode.css"),require("diff2html/bundles/css/diff2html.min.css");var r=require("highlight.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=d(t),a=i(r);const l=(t,n={},r)=>{if(e.isVue2)return e.h(t,n,r);const{props:i,domProps:d,on:o,...a}=n;const l={...a,...i,...d,...(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):null)(o)};return e.h(t,l,r)};var s=[],p=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,d="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var o=s.indexOf(d);-1===o&&(o=s.push(d)-1,p[o]={}),n=p[o]&&p[o][r]?p[o][r]:p[o][r]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var o="prepend"===r?"afterbegin":"beforeend";return d.insertAdjacentElement(o,e),e}}(".hljs {\n display: inline-block;\n padding: 0;\n background: transparent;\n vertical-align: middle;\n}\n\n.d2h-wrapper {\n position: relative;\n}\n.d2h-wrapper .d2h-files-diff {\n position: relative;\n}\n.d2h-wrapper .d2h-files-diff > .d2h-file-side-diff ~ .d2h-file-side-diff {\n position: absolute;\n}\n.d2h-wrapper .d2h-file-side-diff {\n margin-bottom: -5px;\n}\n.d2h-wrapper .d2h-code-side-emptyplaceholder {\n max-height: 19px;\n}\n.d2h-wrapper .d2h-code-side-line,\n.d2h-wrapper .d2h-code-line {\n width: auto;\n}\n.d2h-wrapper .d2h-code-side-line .d2h-info {\n height: 18px;\n}\n.d2h-wrapper .d2h-code-linenumber,\n.d2h-wrapper .d2h-code-side-linenumber {\n height: 19px;\n}",{});var u=e.defineComponent({name:"CodeDiff",props:{oldString:{type:String,default:""},newString:{type:String,default:""},context:{type:Number,default:5},outputFormat:{type:String,default:"line-by-line"},drawFileList:{type:Boolean,default:!1},renderNothingWhenEmpty:{type:Boolean,default:!1},fileName:{type:String,default:""},isShowNoChange:{type:Boolean,default:!1}},setup(t){const r=e.computed((()=>((e,t,r,i,d,a,l,s)=>{s&&(e="File Without Change\tOldString: ======================== \n"+e,t="File Without Change\tNewString: ======================== \n"+t);const p=n.createPatch(l,e,t,"","",{context:r}),u=o.parse(p,{outputFormat:i,drawFileList:d,matching:"lines",renderNothingWhenEmpty:a});return function(e){return e.replace(/<span class="d2h-code-line-ctn">(.+?)<\/span>/g,'<span class="d2h-code-line-ctn"><code>$1</code></span>')}(o.html(u,{outputFormat:i,drawFileList:d,matching:"lines",renderNothingWhenEmpty:a}))})(t.oldString,t.newString,t.context,t.outputFormat,t.drawFileList,t.renderNothingWhenEmpty,t.fileName,t.isShowNoChange)));return e.onMounted((()=>{document.querySelectorAll(".d2h-wrapper code").forEach((e=>{a.default.highlightElement(e)}))})),{html:r}},render(){return l("div",{domProps:{innerHTML:this.html}})}});u.install=e=>{e.component(u.name,u)};const h=[u],c=e=>{h.forEach((t=>{e.component(t.name,t)}))};var f={install:c};exports.CodeDiff=u,exports.default=f,exports.install=c; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue-demi"),t=require("diff2html"),n=require("diff");require("highlight.js/styles/googlecode.css"),require("diff2html/bundles/css/diff2html.min.css");var r=require("highlight.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=d(t),a=i(r);const l=(t,n={},r)=>{if(e.isVue2)return e.h(t,n,r);const{props:i,domProps:d,on:o,...a}=n;const l={...a,...i,...d,...(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):null)(o)};return e.h(t,l,r)};var s=[],p=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,d="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var o=s.indexOf(d);-1===o&&(o=s.push(d)-1,p[o]={}),n=p[o]&&p[o][r]?p[o][r]:p[o][r]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var o="prepend"===r?"afterbegin":"beforeend";return d.insertAdjacentElement(o,e),e}}(".hljs {\n display: inline-block;\n padding: 0;\n background: transparent;\n vertical-align: middle;\n}\n\n.d2h-wrapper {\n position: relative;\n line-height: normal;\n}\n.d2h-wrapper .d2h-files-diff {\n position: relative;\n}\n.d2h-wrapper .d2h-files-diff > .d2h-file-side-diff ~ .d2h-file-side-diff {\n position: absolute;\n}\n.d2h-wrapper .d2h-file-side-diff {\n margin-bottom: -5px;\n}\n.d2h-wrapper .d2h-code-side-emptyplaceholder {\n max-height: 19px;\n}\n.d2h-wrapper .d2h-code-side-line,\n.d2h-wrapper .d2h-code-line {\n width: auto;\n}\n.d2h-wrapper .d2h-code-side-line .d2h-info {\n height: 18px;\n}\n.d2h-wrapper .d2h-code-linenumber,\n.d2h-wrapper .d2h-code-side-linenumber {\n height: 19px;\n}",{});var h=e.defineComponent({name:"CodeDiff",props:{oldString:{type:String,default:""},newString:{type:String,default:""},context:{type:Number,default:10},outputFormat:{type:String,default:"line-by-line"},drawFileList:{type:Boolean,default:!1},renderNothingWhenEmpty:{type:Boolean,default:!1},fileName:{type:String,default:""},isShowNoChange:{type:Boolean,default:!1}},setup(t){const r=e.computed((()=>((e,t,r,i,d,a,l,s)=>{s&&(e="File Without Change\tOldString: ======================== \n"+e,t="File Without Change\tNewString: ======================== \n"+t);const p=n.createPatch(l,e,t,"","",{context:r}),h=o.parse(p,{outputFormat:i,drawFileList:d,matching:"lines",renderNothingWhenEmpty:a});return function(e){return e.replace(/<span class="d2h-code-line-ctn">(.+?)<\/span>/g,'<span class="d2h-code-line-ctn"><code>$1</code></span>')}(o.html(h,{outputFormat:i,drawFileList:d,matching:"lines",renderNothingWhenEmpty:a}))})(t.oldString,t.newString,t.context,t.outputFormat,t.drawFileList,t.renderNothingWhenEmpty,t.fileName,t.isShowNoChange)));return e.onMounted((()=>{document.querySelectorAll(".d2h-wrapper code").forEach((e=>{a.default.highlightElement(e)}))})),{html:r}},render(){return l("div",{domProps:{innerHTML:this.html}})}});h.install=e=>{e.component(h.name,h)};const u=[h],c=e=>{u.forEach((t=>{e.component(t.name,t)}))};var f={install:c};exports.CodeDiff=h,exports.default=f,exports.install=c; |
@@ -1,1 +0,1 @@ | ||
import{isVue2 as e,h as t,defineComponent as n,computed as r,onMounted as i}from"vue-demi";import*as o from"diff2html";import{createPatch as d}from"diff";import"highlight.js/styles/googlecode.css";import"diff2html/bundles/css/diff2html.min.css";import a from"highlight.js";const p=(n,r={},i)=>{if(e)return t(n,r,i);const{props:o,domProps:d,on:a,...p}=r;const l={...p,...o,...d,...(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):null)(a)};return t(n,l,i)};var l=[],s=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,o="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var d=l.indexOf(o);-1===d&&(d=l.push(o)-1,s[d]={}),n=s[d]&&s[d][r]?s[d][r]:s[d][r]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var d="prepend"===r?"afterbegin":"beforeend";return o.insertAdjacentElement(d,e),e}}(".hljs {\n display: inline-block;\n padding: 0;\n background: transparent;\n vertical-align: middle;\n}\n\n.d2h-wrapper {\n position: relative;\n}\n.d2h-wrapper .d2h-files-diff {\n position: relative;\n}\n.d2h-wrapper .d2h-files-diff > .d2h-file-side-diff ~ .d2h-file-side-diff {\n position: absolute;\n}\n.d2h-wrapper .d2h-file-side-diff {\n margin-bottom: -5px;\n}\n.d2h-wrapper .d2h-code-side-emptyplaceholder {\n max-height: 19px;\n}\n.d2h-wrapper .d2h-code-side-line,\n.d2h-wrapper .d2h-code-line {\n width: auto;\n}\n.d2h-wrapper .d2h-code-side-line .d2h-info {\n height: 18px;\n}\n.d2h-wrapper .d2h-code-linenumber,\n.d2h-wrapper .d2h-code-side-linenumber {\n height: 19px;\n}",{});var h=n({name:"CodeDiff",props:{oldString:{type:String,default:""},newString:{type:String,default:""},context:{type:Number,default:5},outputFormat:{type:String,default:"line-by-line"},drawFileList:{type:Boolean,default:!1},renderNothingWhenEmpty:{type:Boolean,default:!1},fileName:{type:String,default:""},isShowNoChange:{type:Boolean,default:!1}},setup(e){const t=r((()=>((e,t,n,r,i,a,p,l)=>{l&&(e="File Without Change\tOldString: ======================== \n"+e,t="File Without Change\tNewString: ======================== \n"+t);const s=d(p,e,t,"","",{context:n}),h=o.parse(s,{outputFormat:r,drawFileList:i,matching:"lines",renderNothingWhenEmpty:a});return function(e){return e.replace(/<span class="d2h-code-line-ctn">(.+?)<\/span>/g,'<span class="d2h-code-line-ctn"><code>$1</code></span>')}(o.html(h,{outputFormat:r,drawFileList:i,matching:"lines",renderNothingWhenEmpty:a}))})(e.oldString,e.newString,e.context,e.outputFormat,e.drawFileList,e.renderNothingWhenEmpty,e.fileName,e.isShowNoChange)));return i((()=>{document.querySelectorAll(".d2h-wrapper code").forEach((e=>{a.highlightElement(e)}))})),{html:t}},render(){return p("div",{domProps:{innerHTML:this.html}})}});h.install=e=>{e.component(h.name,h)};const c=[h],f=e=>{c.forEach((t=>{e.component(t.name,t)}))};var m={install:f};export default m;export{h as CodeDiff,f as install}; | ||
import{isVue2 as e,h as t,defineComponent as n,computed as r,onMounted as i}from"vue-demi";import*as o from"diff2html";import{createPatch as d}from"diff";import"highlight.js/styles/googlecode.css";import"diff2html/bundles/css/diff2html.min.css";import a from"highlight.js";const l=(n,r={},i)=>{if(e)return t(n,r,i);const{props:o,domProps:d,on:a,...l}=r;const p={...l,...o,...d,...(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):null)(a)};return t(n,p,i)};var p=[],s=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,o="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var d=p.indexOf(o);-1===d&&(d=p.push(o)-1,s[d]={}),n=s[d]&&s[d][r]?s[d][r]:s[d][r]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var d="prepend"===r?"afterbegin":"beforeend";return o.insertAdjacentElement(d,e),e}}(".hljs {\n display: inline-block;\n padding: 0;\n background: transparent;\n vertical-align: middle;\n}\n\n.d2h-wrapper {\n position: relative;\n line-height: normal;\n}\n.d2h-wrapper .d2h-files-diff {\n position: relative;\n}\n.d2h-wrapper .d2h-files-diff > .d2h-file-side-diff ~ .d2h-file-side-diff {\n position: absolute;\n}\n.d2h-wrapper .d2h-file-side-diff {\n margin-bottom: -5px;\n}\n.d2h-wrapper .d2h-code-side-emptyplaceholder {\n max-height: 19px;\n}\n.d2h-wrapper .d2h-code-side-line,\n.d2h-wrapper .d2h-code-line {\n width: auto;\n}\n.d2h-wrapper .d2h-code-side-line .d2h-info {\n height: 18px;\n}\n.d2h-wrapper .d2h-code-linenumber,\n.d2h-wrapper .d2h-code-side-linenumber {\n height: 19px;\n}",{});var h=n({name:"CodeDiff",props:{oldString:{type:String,default:""},newString:{type:String,default:""},context:{type:Number,default:10},outputFormat:{type:String,default:"line-by-line"},drawFileList:{type:Boolean,default:!1},renderNothingWhenEmpty:{type:Boolean,default:!1},fileName:{type:String,default:""},isShowNoChange:{type:Boolean,default:!1}},setup(e){const t=r((()=>((e,t,n,r,i,a,l,p)=>{p&&(e="File Without Change\tOldString: ======================== \n"+e,t="File Without Change\tNewString: ======================== \n"+t);const s=d(l,e,t,"","",{context:n}),h=o.parse(s,{outputFormat:r,drawFileList:i,matching:"lines",renderNothingWhenEmpty:a});return function(e){return e.replace(/<span class="d2h-code-line-ctn">(.+?)<\/span>/g,'<span class="d2h-code-line-ctn"><code>$1</code></span>')}(o.html(h,{outputFormat:r,drawFileList:i,matching:"lines",renderNothingWhenEmpty:a}))})(e.oldString,e.newString,e.context,e.outputFormat,e.drawFileList,e.renderNothingWhenEmpty,e.fileName,e.isShowNoChange)));return i((()=>{document.querySelectorAll(".d2h-wrapper code").forEach((e=>{a.highlightElement(e)}))})),{html:t}},render(){return l("div",{domProps:{innerHTML:this.html}})}});h.install=e=>{e.component(h.name,h)};const c=[h],f=e=>{c.forEach((t=>{e.component(t.name,t)}))};var m={install:f};export default m;export{h as CodeDiff,f as install}; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue-demi"),require("diff2html"),require("diff"),require("highlight.js/styles/googlecode.css"),require("diff2html/bundles/css/diff2html.min.css"),require("highlight.js")):"function"==typeof define&&define.amd?define(["exports","vue-demi","diff2html","diff","highlight.js/styles/googlecode.css","diff2html/bundles/css/diff2html.min.css","highlight.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["v-code-diff"]={},e.VueDemi,e.Diff2Html,e.diff,null,null,e.hljs)}(this,(function(e,t,n,i,r,d,o){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var s=a(n),f=l(o);const h=(e,n={},i)=>{if(t.isVue2)return t.h(e,n,i);const{props:r,domProps:d,on:o,...l}=n;const a={...l,...r,...d,...(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):null)(o)};return t.h(e,a,i)};var p=[],u=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,i=!0===t.prepend?"prepend":"append",r=!0===t.singleTag,d="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(r){var o=p.indexOf(d);-1===o&&(o=p.push(d)-1,u[o]={}),n=u[o]&&u[o][i]?u[o][i]:u[o][i]=l()}else n=l();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),r=0;r<n.length;r++)e.setAttribute(n[r],t.attributes[n[r]]);var o="prepend"===i?"afterbegin":"beforeend";return d.insertAdjacentElement(o,e),e}}(".hljs {\n display: inline-block;\n padding: 0;\n background: transparent;\n vertical-align: middle;\n}\n\n.d2h-wrapper {\n position: relative;\n}\n.d2h-wrapper .d2h-files-diff {\n position: relative;\n}\n.d2h-wrapper .d2h-files-diff > .d2h-file-side-diff ~ .d2h-file-side-diff {\n position: absolute;\n}\n.d2h-wrapper .d2h-file-side-diff {\n margin-bottom: -5px;\n}\n.d2h-wrapper .d2h-code-side-emptyplaceholder {\n max-height: 19px;\n}\n.d2h-wrapper .d2h-code-side-line,\n.d2h-wrapper .d2h-code-line {\n width: auto;\n}\n.d2h-wrapper .d2h-code-side-line .d2h-info {\n height: 18px;\n}\n.d2h-wrapper .d2h-code-linenumber,\n.d2h-wrapper .d2h-code-side-linenumber {\n height: 19px;\n}",{});var c=t.defineComponent({name:"CodeDiff",props:{oldString:{type:String,default:""},newString:{type:String,default:""},context:{type:Number,default:5},outputFormat:{type:String,default:"line-by-line"},drawFileList:{type:Boolean,default:!1},renderNothingWhenEmpty:{type:Boolean,default:!1},fileName:{type:String,default:""},isShowNoChange:{type:Boolean,default:!1}},setup(e){const n=t.computed((()=>((e,t,n,r,d,o,l,a)=>{a&&(e="File Without Change\tOldString: ======================== \n"+e,t="File Without Change\tNewString: ======================== \n"+t);const f=i.createPatch(l,e,t,"","",{context:n}),h=s.parse(f,{outputFormat:r,drawFileList:d,matching:"lines",renderNothingWhenEmpty:o});return function(e){return e.replace(/<span class="d2h-code-line-ctn">(.+?)<\/span>/g,'<span class="d2h-code-line-ctn"><code>$1</code></span>')}(s.html(h,{outputFormat:r,drawFileList:d,matching:"lines",renderNothingWhenEmpty:o}))})(e.oldString,e.newString,e.context,e.outputFormat,e.drawFileList,e.renderNothingWhenEmpty,e.fileName,e.isShowNoChange)));return t.onMounted((()=>{document.querySelectorAll(".d2h-wrapper code").forEach((e=>{f.default.highlightElement(e)}))})),{html:n}},render(){return h("div",{domProps:{innerHTML:this.html}})}});c.install=e=>{e.component(c.name,c)};const m=[c],g=e=>{m.forEach((t=>{e.component(t.name,t)}))};var y={install:g};e.CodeDiff=c,e.default=y,e.install=g,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue-demi"),require("diff2html"),require("diff"),require("highlight.js/styles/googlecode.css"),require("diff2html/bundles/css/diff2html.min.css"),require("highlight.js")):"function"==typeof define&&define.amd?define(["exports","vue-demi","diff2html","diff","highlight.js/styles/googlecode.css","diff2html/bundles/css/diff2html.min.css","highlight.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["v-code-diff"]={},e.VueDemi,e.Diff2Html,e.diff,null,null,e.hljs)}(this,(function(e,t,n,i,r,d,o){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var s=a(n),f=l(o);const h=(e,n={},i)=>{if(t.isVue2)return t.h(e,n,i);const{props:r,domProps:d,on:o,...l}=n;const a={...l,...r,...d,...(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):null)(o)};return t.h(e,a,i)};var p=[],u=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,i=!0===t.prepend?"prepend":"append",r=!0===t.singleTag,d="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(r){var o=p.indexOf(d);-1===o&&(o=p.push(d)-1,u[o]={}),n=u[o]&&u[o][i]?u[o][i]:u[o][i]=l()}else n=l();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),r=0;r<n.length;r++)e.setAttribute(n[r],t.attributes[n[r]]);var o="prepend"===i?"afterbegin":"beforeend";return d.insertAdjacentElement(o,e),e}}(".hljs {\n display: inline-block;\n padding: 0;\n background: transparent;\n vertical-align: middle;\n}\n\n.d2h-wrapper {\n position: relative;\n line-height: normal;\n}\n.d2h-wrapper .d2h-files-diff {\n position: relative;\n}\n.d2h-wrapper .d2h-files-diff > .d2h-file-side-diff ~ .d2h-file-side-diff {\n position: absolute;\n}\n.d2h-wrapper .d2h-file-side-diff {\n margin-bottom: -5px;\n}\n.d2h-wrapper .d2h-code-side-emptyplaceholder {\n max-height: 19px;\n}\n.d2h-wrapper .d2h-code-side-line,\n.d2h-wrapper .d2h-code-line {\n width: auto;\n}\n.d2h-wrapper .d2h-code-side-line .d2h-info {\n height: 18px;\n}\n.d2h-wrapper .d2h-code-linenumber,\n.d2h-wrapper .d2h-code-side-linenumber {\n height: 19px;\n}",{});var c=t.defineComponent({name:"CodeDiff",props:{oldString:{type:String,default:""},newString:{type:String,default:""},context:{type:Number,default:10},outputFormat:{type:String,default:"line-by-line"},drawFileList:{type:Boolean,default:!1},renderNothingWhenEmpty:{type:Boolean,default:!1},fileName:{type:String,default:""},isShowNoChange:{type:Boolean,default:!1}},setup(e){const n=t.computed((()=>((e,t,n,r,d,o,l,a)=>{a&&(e="File Without Change\tOldString: ======================== \n"+e,t="File Without Change\tNewString: ======================== \n"+t);const f=i.createPatch(l,e,t,"","",{context:n}),h=s.parse(f,{outputFormat:r,drawFileList:d,matching:"lines",renderNothingWhenEmpty:o});return function(e){return e.replace(/<span class="d2h-code-line-ctn">(.+?)<\/span>/g,'<span class="d2h-code-line-ctn"><code>$1</code></span>')}(s.html(h,{outputFormat:r,drawFileList:d,matching:"lines",renderNothingWhenEmpty:o}))})(e.oldString,e.newString,e.context,e.outputFormat,e.drawFileList,e.renderNothingWhenEmpty,e.fileName,e.isShowNoChange)));return t.onMounted((()=>{document.querySelectorAll(".d2h-wrapper code").forEach((e=>{f.default.highlightElement(e)}))})),{html:n}},render(){return h("div",{domProps:{innerHTML:this.html}})}});c.install=e=>{e.component(c.name,c)};const m=[c],g=e=>{m.forEach((t=>{e.component(t.name,t)}))};var y={install:g};e.CodeDiff=c,e.default=y,e.install=g,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "v-code-diff", | ||
"description": "A diff plugin of vue, support vue2 and vue3", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "dev": "vite", |
@@ -134,5 +134,5 @@ # VCodeDiff | ||
### 0.0.2 | ||
### 0.0.3 | ||
1. context default value changed from 5 to 10 | ||
2. fix possible line-height conflict(such as [antd-vue](https://github.com/vueComponent/ant-design-vue)) | ||
2. fix possible line-height conflict(such as `antd.css` in [antd-vue](https://github.com/vueComponent/ant-design-vue)) | ||
### 0.0.1 | ||
@@ -139,0 +139,0 @@ First Version. |
26423
0.33%