Compare commits
7 Commits
v5.0.0-alp
...
v5.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6751b5957 | ||
|
|
a8b497bc9b | ||
|
|
166446c945 | ||
|
|
caff902c99 | ||
|
|
37fedd05c8 | ||
|
|
f3e90b7588 | ||
|
|
650daaff63 |
11
.releaserc.yaml
Normal file
11
.releaserc.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- name: alpha
|
||||||
|
prerelease: true
|
||||||
|
plugins:
|
||||||
|
- "@semantic-release/commit-analyzer"
|
||||||
|
- "@semantic-release/release-notes-generator"
|
||||||
|
- "@semantic-release/changelog"
|
||||||
|
- "@semantic-release/npm"
|
||||||
|
- "@semantic-release/git"
|
||||||
|
- "@semantic-release/github"
|
||||||
@@ -1,3 +1,10 @@
|
|||||||
|
## [5.0.1](https://github.com/wickedest/Mergely/compare/v5.0.0...v5.0.1) (2023-04-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* update release ([a8b497b](https://github.com/wickedest/Mergely/commit/a8b497bc9b68beb5d8265106d9f010aa9489dd17))
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|||||||
90
package-lock.json
generated
90
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "mergely",
|
"name": "mergely",
|
||||||
"version": "5.0.0-rc0",
|
"version": "5.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mergely",
|
"name": "mergely",
|
||||||
"version": "5.0.0-rc0",
|
"version": "5.0.1",
|
||||||
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
|
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.1.6",
|
"@babel/core": "^7.1.6",
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
"@commitlint/cli": "^17.6.1",
|
"@commitlint/cli": "^17.6.1",
|
||||||
"@commitlint/config-conventional": "^15.0.0",
|
"@commitlint/config-conventional": "^15.0.0",
|
||||||
"@commitlint/prompt-cli": "^15.0.0",
|
"@commitlint/prompt-cli": "^15.0.0",
|
||||||
|
"@semantic-release/changelog": "^6.0.3",
|
||||||
|
"@semantic-release/git": "^10.0.1",
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
@@ -3496,6 +3498,59 @@
|
|||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@semantic-release/changelog": {
|
||||||
|
"version": "6.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz",
|
||||||
|
"integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@semantic-release/error": "^3.0.0",
|
||||||
|
"aggregate-error": "^3.0.0",
|
||||||
|
"fs-extra": "^11.0.0",
|
||||||
|
"lodash": "^4.17.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"semantic-release": ">=18.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@semantic-release/changelog/node_modules/fs-extra": {
|
||||||
|
"version": "11.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz",
|
||||||
|
"integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"graceful-fs": "^4.2.0",
|
||||||
|
"jsonfile": "^6.0.1",
|
||||||
|
"universalify": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.14"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@semantic-release/changelog/node_modules/jsonfile": {
|
||||||
|
"version": "6.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||||
|
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"universalify": "^2.0.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"graceful-fs": "^4.1.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@semantic-release/changelog/node_modules/universalify": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@semantic-release/commit-analyzer": {
|
"node_modules/@semantic-release/commit-analyzer": {
|
||||||
"version": "9.0.2",
|
"version": "9.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-9.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-9.0.2.tgz",
|
||||||
@@ -3526,6 +3581,37 @@
|
|||||||
"node": ">=14.17"
|
"node": ">=14.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@semantic-release/git": {
|
||||||
|
"version": "10.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz",
|
||||||
|
"integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@semantic-release/error": "^3.0.0",
|
||||||
|
"aggregate-error": "^3.0.0",
|
||||||
|
"debug": "^4.0.0",
|
||||||
|
"dir-glob": "^3.0.0",
|
||||||
|
"execa": "^5.0.0",
|
||||||
|
"lodash": "^4.17.4",
|
||||||
|
"micromatch": "^4.0.0",
|
||||||
|
"p-reduce": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"semantic-release": ">=18.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@semantic-release/git/node_modules/p-reduce": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@semantic-release/github": {
|
"node_modules/@semantic-release/github": {
|
||||||
"version": "8.0.7",
|
"version": "8.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.0.7.tgz",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mergely",
|
"name": "mergely",
|
||||||
"version": "5.0.0-rc0",
|
"version": "5.0.1",
|
||||||
"description": "A javascript UI for diff/merge",
|
"description": "A javascript UI for diff/merge",
|
||||||
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
|
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
|
||||||
"author": {
|
"author": {
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/wickedest/Mergely.git"
|
"url": "git@github.com:wickedest/Mergely.git"
|
||||||
},
|
},
|
||||||
"main": "lib/mergely.js",
|
"main": "lib/mergely.js",
|
||||||
"files": [
|
"files": [
|
||||||
@@ -36,6 +36,8 @@
|
|||||||
"@commitlint/cli": "^17.6.1",
|
"@commitlint/cli": "^17.6.1",
|
||||||
"@commitlint/config-conventional": "^15.0.0",
|
"@commitlint/config-conventional": "^15.0.0",
|
||||||
"@commitlint/prompt-cli": "^15.0.0",
|
"@commitlint/prompt-cli": "^15.0.0",
|
||||||
|
"@semantic-release/changelog": "^6.0.3",
|
||||||
|
"@semantic-release/git": "^10.0.1",
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ CodeMirrorDiffView.prototype.init = function(el, options = {}) {
|
|||||||
lineNumbers: this.settings.line_numbers,
|
lineNumbers: this.settings.line_numbers,
|
||||||
gutters: (this.settings.line_numbers && [ 'merge', 'CodeMirror-linenumbers' ]) || [],
|
gutters: (this.settings.line_numbers && [ 'merge', 'CodeMirror-linenumbers' ]) || [],
|
||||||
};
|
};
|
||||||
this._vdoc = new VDoc();
|
this._vdoc = new VDoc({ _debug: this.settings._debug });
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeMirrorDiffView.prototype.unbind = function() {
|
CodeMirrorDiffView.prototype.unbind = function() {
|
||||||
@@ -561,7 +561,7 @@ CodeMirrorDiffView.prototype._clearMarkup = function () {
|
|||||||
traceTimeStart('draw#_clearMarkup');
|
traceTimeStart('draw#_clearMarkup');
|
||||||
}
|
}
|
||||||
this._vdoc.clear();
|
this._vdoc.clear();
|
||||||
this._vdoc = new VDoc();
|
this._vdoc = new VDoc({ _debug: this.settings._debug });
|
||||||
if (this.settings._debug) {
|
if (this.settings._debug) {
|
||||||
traceTimeEnd('draw#_clearMarkup');
|
traceTimeEnd('draw#_clearMarkup');
|
||||||
}
|
}
|
||||||
@@ -995,14 +995,10 @@ CodeMirrorDiffView.prototype._markupLineChanges = function (changes) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
led.operation(() => {
|
led.operation(() => {
|
||||||
for (let i = 0; i < changes.length; ++i) {
|
vdoc.update('lhs', led, lhsvp);
|
||||||
vdoc.update('lhs', i, led, lhsvp);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
red.operation(() => {
|
red.operation(() => {
|
||||||
for (let i = 0; i < changes.length; ++i) {
|
vdoc.update('rhs', red, rhsvp);
|
||||||
vdoc.update('rhs', i, red, rhsvp);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
if (this.settings._debug) {
|
if (this.settings._debug) {
|
||||||
traceTimeEnd('draw#_markupLineChanges');
|
traceTimeEnd('draw#_markupLineChanges');
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mergely-editor .CodeMirror-selected {
|
.mergely-editor .CodeMirror-selected {
|
||||||
background: #ffcb0f;
|
background: #0f73ff47;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mergely-splash {
|
.mergely-splash {
|
||||||
@@ -52,8 +52,6 @@
|
|||||||
.mergely-editor .merge-button {
|
.mergely-editor .merge-button {
|
||||||
height: 18px;
|
height: 18px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 26px;
|
|
||||||
padding-left: 3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* common stles */
|
/* common stles */
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class Mergely {
|
|||||||
|
|
||||||
_setOptions(options) {
|
_setOptions(options) {
|
||||||
if (this._options && this._options._debug) {
|
if (this._options && this._options._debug) {
|
||||||
trace('api#options', opts);
|
trace('api#options');
|
||||||
}
|
}
|
||||||
const colors = dom.getColors(this.el);
|
const colors = dom.getColors(this.el);
|
||||||
this._options = {
|
this._options = {
|
||||||
|
|||||||
26
src/vdoc.js
26
src/vdoc.js
@@ -1,7 +1,10 @@
|
|||||||
const diff = require('./diff');
|
const diff = require('./diff');
|
||||||
|
|
||||||
|
const trace = console.log;
|
||||||
|
|
||||||
class VDoc {
|
class VDoc {
|
||||||
constructor() {
|
constructor(options) {
|
||||||
|
this.options = options;
|
||||||
this._lines = {
|
this._lines = {
|
||||||
lhs: {},
|
lhs: {},
|
||||||
rhs: {}
|
rhs: {}
|
||||||
@@ -13,6 +16,9 @@ class VDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addRender(side, change, changeId, options) {
|
addRender(side, change, changeId, options) {
|
||||||
|
if (this.options._debug) {
|
||||||
|
trace('vdoc#addRender', side, changeId, change);
|
||||||
|
}
|
||||||
const {
|
const {
|
||||||
isCurrent,
|
isCurrent,
|
||||||
lineDiff,
|
lineDiff,
|
||||||
@@ -23,6 +29,9 @@ class VDoc {
|
|||||||
const alreadyRendered = !!this._rendered[side][changeId];
|
const alreadyRendered = !!this._rendered[side][changeId];
|
||||||
|
|
||||||
if (alreadyRendered) {
|
if (alreadyRendered) {
|
||||||
|
if (this.options._debug) {
|
||||||
|
trace('vdoc#addRender (already rendered)', side, changeId, change);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,6 +125,9 @@ class VDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addInlineDiff(change, changeId, { getText, ignorews, ignoreaccents, ignorecase }) {
|
addInlineDiff(change, changeId, { getText, ignorews, ignoreaccents, ignorecase }) {
|
||||||
|
if (this.options._debug) {
|
||||||
|
trace('vdoc#addInlineDiff', changeId, change);
|
||||||
|
}
|
||||||
const { lf, lt, olf, olt } = getExtents('lhs', change);
|
const { lf, lt, olf, olt } = getExtents('lhs', change);
|
||||||
const vdoc = this;
|
const vdoc = this;
|
||||||
|
|
||||||
@@ -169,6 +181,9 @@ class VDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setRenderedChange(side, changeId) {
|
_setRenderedChange(side, changeId) {
|
||||||
|
if (this.options._debug) {
|
||||||
|
trace('vdoc#_setRenderedChange', side, changeId);
|
||||||
|
}
|
||||||
return this._rendered[side][changeId] = true;
|
return this._rendered[side][changeId] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,8 +197,10 @@ class VDoc {
|
|||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
update(side, changeId, editor, viewport) {
|
update(side, editor, viewport) {
|
||||||
this._setRenderedChange(side, changeId);
|
if (this.options._debug) {
|
||||||
|
trace('vdoc#update', side, editor, viewport);
|
||||||
|
}
|
||||||
const lines = Object.keys(this._lines[side]);
|
const lines = Object.keys(this._lines[side]);
|
||||||
for (let i = 0; i < lines.length; ++i) {
|
for (let i = 0; i < lines.length; ++i) {
|
||||||
const id = lines[i];
|
const id = lines[i];
|
||||||
@@ -200,6 +217,9 @@ class VDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
|
if (this.options._debug) {
|
||||||
|
trace('vdoc#clear');
|
||||||
|
}
|
||||||
for (const lineId in this._lines.lhs) {
|
for (const lineId in this._lines.lhs) {
|
||||||
this._lines.lhs[lineId].clear();
|
this._lines.lhs[lineId].clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user