From 9ba02bdfbad377770e402d601064f260669cae16 Mon Sep 17 00:00:00 2001 From: Shimada666 <649940882@qq.com> Date: Sun, 23 May 2021 18:25:05 +0800 Subject: [PATCH 1/5] fix: resolve missing postcss dependencies --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index f3cc125..562f0a7 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,9 @@ "ora": "^5.3.0", "portfinder": "^1.0.28", "postcss": "^8.2.8", + "postcss-import": "^14.0.2", "postcss-loader": "^4.2.0", + "postcss-url": "^10.1.3", "progress": "^2.0.3", "progress-bar-webpack-plugin": "^2.1.0", "sass": "^1.32.8", From 8138f5a0694fa6d50e10afa1b652258c48a2e448 Mon Sep 17 00:00:00 2001 From: Shimada666 <649940882@qq.com> Date: Sun, 23 May 2021 18:26:47 +0800 Subject: [PATCH 2/5] feat: support types --- package.json | 1 + types/index.d.ts | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 types/index.d.ts diff --git a/package.json b/package.json index f3cc125..eac17b8 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "author": "ddchef>", "private": false, "main": "/dist/vue-code-diff.js", + "typings": "types/index.d.ts", "keywords": [ "vue", "diff", diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..dda93e1 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,11 @@ +export interface CodeDiffInterface { + oldString: string + newString: string + context: number + outputFormat: 'side-by-side' | 'line-by-line' + drawFileList: boolean + renderNothingWhenEmpty: boolean + diffStyle: 'word' | 'char' + fileName: string + isShowNoChange: boolean +} From a67b47f3038a6b8b3ed9388bd1340a1fde955e97 Mon Sep 17 00:00:00 2001 From: ddchef Date: Sun, 30 May 2021 13:27:06 +0800 Subject: [PATCH 3/5] =?UTF-8?q?build:=20=E4=BF=AE=E6=94=B9webpack=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/config/webpack.base.js | 3 +-- example/build/config/webpack.base.js | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build/config/webpack.base.js b/build/config/webpack.base.js index bb01f41..f35bad2 100755 --- a/build/config/webpack.base.js +++ b/build/config/webpack.base.js @@ -32,8 +32,7 @@ module.exports = () => ({ ], exclude (filePath) { return ( - /node_modules/.test(filePath) && - !/@ailpha(\\|\/)ml/.test(filePath) + /node_modules/.test(filePath) ) } }, diff --git a/example/build/config/webpack.base.js b/example/build/config/webpack.base.js index e2d2ff8..254cbfd 100755 --- a/example/build/config/webpack.base.js +++ b/example/build/config/webpack.base.js @@ -12,7 +12,7 @@ module.exports = () => ({ }, output: { path: path.join(basePath, 'dist'), - filename: `static/js/[name].js` + filename: 'static/js/[name].js' }, module: { rules: [ @@ -31,8 +31,7 @@ module.exports = () => ({ ], exclude (filePath) { return ( - /node_modules/.test(filePath) && - !/@ailpha(\\|\/)ml/.test(filePath) + /node_modules/.test(filePath) ) } }, From 3c313e552fcaa6b16fa8670d40ab8069e820ad9e Mon Sep 17 00:00:00 2001 From: ddchef Date: Sun, 30 May 2021 13:31:07 +0800 Subject: [PATCH 4/5] fix: [#45][#48]different height --- example/src/corners.vue | 39 ++++++++++++++++++------------------- src/lib/code-diff/index.vue | 2 +- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/example/src/corners.vue b/example/src/corners.vue index bae3805..b39193c 100644 --- a/example/src/corners.vue +++ b/example/src/corners.vue @@ -3,26 +3,25 @@ href="https://github.com/ddchef/vue-code-diff" class="github-corner" aria-label="View source on GitHub" - > + > \n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ __webpack_exports__["Z"] = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ 7239: +/***/ (function(module) { + +"use strict"; + + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +// eslint-disable-next-line func-names +module.exports = function (cssWithMappingToString) { + var list = []; // return the list of modules as css string + + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item); + + if (item[2]) { + return "@media ".concat(item[2], " {").concat(content, "}"); + } + + return content; + }).join(""); + }; // import a list of modules into the list + // eslint-disable-next-line func-names + + + list.i = function (modules, mediaQuery, dedupe) { + if (typeof modules === "string") { + // eslint-disable-next-line no-param-reassign + modules = [[null, modules, ""]]; + } + + var alreadyImportedModules = {}; + + if (dedupe) { + for (var i = 0; i < this.length; i++) { + // eslint-disable-next-line prefer-destructuring + var id = this[i][0]; + + if (id != null) { + alreadyImportedModules[id] = true; + } + } + } + + for (var _i = 0; _i < modules.length; _i++) { + var item = [].concat(modules[_i]); + + if (dedupe && alreadyImportedModules[item[0]]) { + // eslint-disable-next-line no-continue + continue; + } + + if (mediaQuery) { + if (!item[2]) { + item[2] = mediaQuery; + } else { + item[2] = "".concat(mediaQuery, " and ").concat(item[2]); + } + } + + list.push(item); + } + }; + + return list; +}; + +/***/ }), + +/***/ 4309: +/***/ (function(module) { + +"use strict"; + + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +module.exports = function cssWithMappingToString(item) { + var _item = _slicedToArray(item, 4), + content = _item[1], + cssMapping = _item[3]; + + if (typeof btoa === "function") { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping)))); + var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64); + var sourceMapping = "/*# ".concat(data, " */"); + var sourceURLs = cssMapping.sources.map(function (source) { + return "/*# sourceURL=".concat(cssMapping.sourceRoot || "").concat(source, " */"); + }); + return [content].concat(sourceURLs).concat([sourceMapping]).join("\n"); + } + + return [content].join("\n"); +}; + +/***/ }), + +/***/ 8390: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var isOldIE = function isOldIE() { + var memo; + return function memorize() { + if (typeof memo === 'undefined') { + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + memo = Boolean(window && document && document.all && !window.atob); + } + + return memo; + }; +}(); + +var getTarget = function getTarget() { + var memo = {}; + return function memorize(target) { + if (typeof memo[target] === 'undefined') { + var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself + + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { + try { + // This will throw an exception if access to iframe is blocked + // due to cross-origin restrictions + styleTarget = styleTarget.contentDocument.head; + } catch (e) { + // istanbul ignore next + styleTarget = null; + } + } + + memo[target] = styleTarget; + } + + return memo[target]; + }; +}(); + +var stylesInDom = []; + +function getIndexByIdentifier(identifier) { + var result = -1; + + for (var i = 0; i < stylesInDom.length; i++) { + if (stylesInDom[i].identifier === identifier) { + result = i; + break; + } + } + + return result; +} + +function modulesToDom(list, options) { + var idCountMap = {}; + var identifiers = []; + + for (var i = 0; i < list.length; i++) { + var item = list[i]; + var id = options.base ? item[0] + options.base : item[0]; + var count = idCountMap[id] || 0; + var identifier = "".concat(id, " ").concat(count); + idCountMap[id] = count + 1; + var index = getIndexByIdentifier(identifier); + var obj = { + css: item[1], + media: item[2], + sourceMap: item[3] + }; + + if (index !== -1) { + stylesInDom[index].references++; + stylesInDom[index].updater(obj); + } else { + stylesInDom.push({ + identifier: identifier, + updater: addStyle(obj, options), + references: 1 + }); + } + + identifiers.push(identifier); + } + + return identifiers; +} + +function insertStyleElement(options) { + var style = document.createElement('style'); + var attributes = options.attributes || {}; + + if (typeof attributes.nonce === 'undefined') { + var nonce = true ? __webpack_require__.nc : 0; + + if (nonce) { + attributes.nonce = nonce; + } + } + + Object.keys(attributes).forEach(function (key) { + style.setAttribute(key, attributes[key]); + }); + + if (typeof options.insert === 'function') { + options.insert(style); + } else { + var target = getTarget(options.insert || 'head'); + + if (!target) { + throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); + } + + target.appendChild(style); + } + + return style; +} + +function removeStyleElement(style) { + // istanbul ignore if + if (style.parentNode === null) { + return false; + } + + style.parentNode.removeChild(style); +} +/* istanbul ignore next */ + + +var replaceText = function replaceText() { + var textStore = []; + return function replace(index, replacement) { + textStore[index] = replacement; + return textStore.filter(Boolean).join('\n'); + }; +}(); + +function applyToSingletonTag(style, index, remove, obj) { + var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE + + /* istanbul ignore if */ + + if (style.styleSheet) { + style.styleSheet.cssText = replaceText(index, css); + } else { + var cssNode = document.createTextNode(css); + var childNodes = style.childNodes; + + if (childNodes[index]) { + style.removeChild(childNodes[index]); + } + + if (childNodes.length) { + style.insertBefore(cssNode, childNodes[index]); + } else { + style.appendChild(cssNode); + } + } +} + +function applyToTag(style, options, obj) { + var css = obj.css; + var media = obj.media; + var sourceMap = obj.sourceMap; + + if (media) { + style.setAttribute('media', media); + } else { + style.removeAttribute('media'); + } + + if (sourceMap && typeof btoa !== 'undefined') { + css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); + } // For old IE + + /* istanbul ignore if */ + + + if (style.styleSheet) { + style.styleSheet.cssText = css; + } else { + while (style.firstChild) { + style.removeChild(style.firstChild); + } + + style.appendChild(document.createTextNode(css)); + } +} + +var singleton = null; +var singletonCounter = 0; + +function addStyle(obj, options) { + var style; + var update; + var remove; + + if (options.singleton) { + var styleIndex = singletonCounter++; + style = singleton || (singleton = insertStyleElement(options)); + update = applyToSingletonTag.bind(null, style, styleIndex, false); + remove = applyToSingletonTag.bind(null, style, styleIndex, true); + } else { + style = insertStyleElement(options); + update = applyToTag.bind(null, style, options); + + remove = function remove() { + removeStyleElement(style); + }; + } + + update(obj); + return function updateStyle(newObj) { + if (newObj) { + if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) { + return; + } + + update(obj = newObj); + } else { + remove(); + } + }; +} + +module.exports = function (list, options) { + options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of \\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nmodule.exports = function cssWithMappingToString(item) {\n var _item = _slicedToArray(item, 4),\n content = _item[1],\n cssMapping = _item[3];\n\n if (typeof btoa === \"function\") {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || \"\").concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join(\"\\n\");\n }\n\n return [content].join(\"\\n\");\n};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of \n","import mod from \"-!../../../node_modules/.pnpm/babel-loader@8.2.2_40e1cddd39669110b7315b4c77f03327/node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/.pnpm/vue-loader@15.9.6_63153c0995d7402effb965957e9f9dd9/node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/.pnpm/babel-loader@8.2.2_40e1cddd39669110b7315b4c77f03327/node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/.pnpm/vue-loader@15.9.6_63153c0995d7402effb965957e9f9dd9/node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import api from \"!../../../node_modules/.pnpm/style-loader@2.0.0_webpack@5.24.4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../node_modules/.pnpm/css-loader@5.1.2_webpack@5.24.4/node_modules/css-loader/dist/cjs.js!../../../node_modules/.pnpm/vue-loader@15.9.6_63153c0995d7402effb965957e9f9dd9/node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/.pnpm/postcss-loader@4.2.0_postcss@8.2.8+webpack@5.24.4/node_modules/postcss-loader/dist/cjs.js!../../../node_modules/.pnpm/vue-loader@15.9.6_63153c0995d7402effb965957e9f9dd9/node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&lang=postcss&\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=08d8f955&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&lang=postcss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/.pnpm/vue-loader@15.9.6_63153c0995d7402effb965957e9f9dd9/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"/Users/nash/Codes/vue-code-diff/node_modules/.pnpm/vue-hot-reload-api@2.3.4/node_modules/vue-hot-reload-api/dist/index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('08d8f955')) {\n api.createRecord('08d8f955', component.options)\n } else {\n api.reload('08d8f955', component.options)\n }\n module.hot.accept(\"./index.vue?vue&type=template&id=08d8f955&\", function () {\n api.rerender('08d8f955', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/lib/code-diff/index.vue\"\nexport default component.exports","import codeDiff from './code-diff'\n\n/* istanbul ignore next */\ncodeDiff.install = function (Vue) {\n Vue.component(codeDiff.name, codeDiff)\n}\n\nexport default codeDiff\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 62d38fa..3a63e7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-code-diff", - "version": "1.1.0", + "version": "1.2.0", "description": "代码比对展示(Code comparison display)", "author": "ddchef>", "private": false, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ee838f..3f59b86 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,7 +52,9 @@ devDependencies: ora: 5.3.0 portfinder: 1.0.28 postcss: 8.2.8 + postcss-import: 14.0.2_postcss@8.2.8 postcss-loader: 4.2.0_postcss@8.2.8+webpack@5.24.4 + postcss-url: 10.1.3_postcss@8.2.8 progress: 2.0.3 progress-bar-webpack-plugin: 2.1.0_webpack@5.24.4 sass: 1.32.8 @@ -3778,6 +3780,10 @@ packages: resolution: integrity: sha1-N3QZGZA7hoVl4cCep0dEXNGJg+4= tarball: cssesc/download/cssesc-3.0.0.tgz + /cuint/0.2.2: + dev: true + resolution: + integrity: sha1-QICG1AlVDCYxFVYZ6fp7ytw7mRs= /cyclist/1.0.1: dev: true resolution: @@ -5182,10 +5188,17 @@ packages: resolution: integrity: sha1-jdfYc6G6vCB9lOrQwuDkQnbr8ug= tarball: flush-write-stream/download/flush-write-stream-1.1.1.tgz - /follow-redirects/1.13.3: + /follow-redirects/1.13.3_debug@4.3.1: + dependencies: + debug: 4.3.1_supports-color@6.1.0 dev: true engines: node: '>=4.0' + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true resolution: integrity: sha1-5VmK1QF0wbxOhyMB6CrCzZf5Amc= tarball: follow-redirects/download/follow-redirects-1.13.3.tgz @@ -5307,6 +5320,8 @@ packages: engines: node: '>= 4.0' optional: true + os: + - darwin requiresBuild: true resolution: integrity: sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg= @@ -5316,6 +5331,8 @@ packages: engines: node: ^8.16.0 || ^10.6.0 || >=11.0.0 optional: true + os: + - darwin resolution: integrity: sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro= tarball: fsevents/download/fsevents-2.3.2.tgz?cache=0&sync_timestamp=1612537044236&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffsevents%2Fdownload%2Ffsevents-2.3.2.tgz @@ -5847,26 +5864,30 @@ packages: resolution: integrity: sha1-AdJwnHnUFpi7AdTezF6dpOSgM9k= tarball: http-parser-js/download/http-parser-js-0.5.3.tgz - /http-proxy-middleware/0.19.1: + /http-proxy-middleware/0.19.1_debug@4.3.1: dependencies: - http-proxy: 1.18.1 + http-proxy: 1.18.1_debug@4.3.1 is-glob: 4.0.1 lodash: 4.17.21 micromatch: 3.1.10 dev: true engines: node: '>=4.0.0' + peerDependencies: + debug: '*' resolution: integrity: sha1-GDx9xKoUeRUDBkmMIQza+WCApDo= tarball: http-proxy-middleware/download/http-proxy-middleware-0.19.1.tgz - /http-proxy/1.18.1: + /http-proxy/1.18.1_debug@4.3.1: dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.13.3 + follow-redirects: 1.13.3_debug@4.3.1 requires-port: 1.0.0 dev: true engines: node: '>=8.0.0' + peerDependencies: + debug: '*' resolution: integrity: sha1-QBVB8FNIhLv5UmAzTnL4juOXZUk= tarball: http-proxy/download/http-proxy-1.18.1.tgz @@ -7011,8 +7032,7 @@ packages: engines: node: '>=8' resolution: - integrity: sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8= - tarball: make-dir/download/make-dir-3.1.0.tgz + integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== /map-cache/0.2.2: dev: true engines: @@ -7263,8 +7283,7 @@ packages: node: '>=4.0.0' hasBin: true resolution: - integrity: sha1-bj3GzCuVEGQ4MOXxnVy3U9pe6r4= - tarball: mime/download/mime-2.5.2.tgz + integrity: sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== /mimic-fn/1.2.0: dev: true engines: @@ -8183,7 +8202,6 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - tarball: pify/download/pify-2.3.0.tgz /pify/4.0.1: dev: true engines: @@ -8280,6 +8298,19 @@ packages: resolution: integrity: sha1-tAkT+U6qzCRT/TChMnrW7h+IsgQ= tarball: postcss-html/download/postcss-html-0.36.0.tgz + /postcss-import/14.0.2_postcss@8.2.8: + dependencies: + postcss: 8.2.8 + postcss-value-parser: 4.1.0 + read-cache: 1.0.0 + resolve: 1.20.0 + dev: true + engines: + node: '>=10.0.0' + peerDependencies: + postcss: ^8.0.0 + resolution: + integrity: sha512-BJ2pVK4KhUyMcqjuKs9RijV5tatNzNa73e/32aBVE/ejYPe37iH+6vAu9WvqUkB5OAYgLHzbSvzHnorybJCm9g== /postcss-less/3.1.4: dependencies: postcss: 7.0.35 @@ -8413,6 +8444,20 @@ packages: resolution: integrity: sha1-8IV4x9lYNFdOVZOoLfv6ivrjtRw= tarball: postcss-syntax/download/postcss-syntax-0.36.2.tgz + /postcss-url/10.1.3_postcss@8.2.8: + dependencies: + make-dir: 3.1.0 + mime: 2.5.2 + minimatch: 3.0.4 + postcss: 8.2.8 + xxhashjs: 0.2.2 + dev: true + engines: + node: '>=10' + peerDependencies: + postcss: ^8.0.0 + resolution: + integrity: sha512-FUzyxfI5l2tKmXdYc6VTu3TWZsInayEKPbiyW+P6vmmIrrb4I6CGX0BFoewgYHLK+oIL5FECEK02REYRpBvUCw== /postcss-value-parser/4.1.0: dev: true resolution: @@ -8687,6 +8732,12 @@ packages: resolution: integrity: sha1-eJcppNw23imZ3BVt1sHZwYzqVqQ= tarball: react-is/download/react-is-16.13.1.tgz?cache=0&sync_timestamp=1615516695710&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freact-is%2Fdownload%2Freact-is-16.13.1.tgz + /read-cache/1.0.0: + dependencies: + pify: 2.3.0 + dev: true + resolution: + integrity: sha1-5mTvMRYRZsl1HNvo28+GtftY93Q= /read-pkg-up/2.0.0: dependencies: find-up: 2.1.0 @@ -10925,7 +10976,7 @@ packages: del: 4.1.1 express: 4.17.1 html-entities: 1.4.0 - http-proxy-middleware: 0.19.1 + http-proxy-middleware: 0.19.1_debug@4.3.1 import-local: 2.0.0 internal-ip: 4.3.0 ip: 1.1.5 @@ -11223,6 +11274,12 @@ packages: resolution: integrity: sha1-u3J3n1+kZRhrH0OPZ0+jR/2121Q= tarball: xtend/download/xtend-4.0.2.tgz + /xxhashjs/0.2.2: + dependencies: + cuint: 0.2.2 + dev: true + resolution: + integrity: sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw== /y18n/4.0.1: dev: true resolution: @@ -11374,7 +11431,9 @@ specifiers: ora: ^5.3.0 portfinder: ^1.0.28 postcss: ^8.2.8 + postcss-import: ^14.0.2 postcss-loader: ^4.2.0 + postcss-url: ^10.1.3 progress: ^2.0.3 progress-bar-webpack-plugin: ^2.1.0 sass: ^1.32.8