1
0
mirror of synced 2025-12-12 09:23:21 +08:00

Compare commits

...

5 Commits

Author SHA1 Message Date
semantic-release-bot
51799f7dc1 chore(release): 5.3.4 [skip ci]
## [5.3.4](https://github.com/wickedest/Mergely/compare/v5.3.3...v5.3.4) (2024-10-11)

### Reverts

* Revert "build(deps-dev): bump webpack from 5.91.0 to 5.94.0 (#203)" ([c36d2a7](c36d2a7ba9)), closes [#203](https://github.com/wickedest/Mergely/issues/203)
2024-10-11 19:52:13 +00:00
Jamie Peabody
c36d2a7ba9 Revert "build(deps-dev): bump webpack from 5.91.0 to 5.94.0 (#203)"
This reverts commit 86593de7d0.
2024-10-11 20:51:13 +01:00
semantic-release-bot
b79ac30d4e chore(release): 5.3.3 [skip ci]
## [5.3.3](https://github.com/wickedest/Mergely/compare/v5.3.2...v5.3.3) (2024-10-11)

### Bug Fixes

* **#209:** Fixes issue with options not being preserved when individually set. ([#211](https://github.com/wickedest/Mergely/issues/211)) ([4cd8897](4cd8897c6b))
2024-10-11 19:49:03 +00:00
Jamie Peabody
4cd8897c6b fix(#209): Fixes issue with options not being preserved when individually set. (#211) 2024-10-11 20:47:58 +01:00
dependabot[bot]
86593de7d0 build(deps-dev): bump webpack from 5.91.0 to 5.94.0 (#203)
Bumps [webpack](https://github.com/webpack/webpack) from 5.91.0 to 5.94.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.91.0...v5.94.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-11 20:42:06 +01:00
7 changed files with 72 additions and 48 deletions

View File

@@ -1,3 +1,17 @@
## [5.3.4](https://github.com/wickedest/Mergely/compare/v5.3.3...v5.3.4) (2024-10-11)
### Reverts
* Revert "build(deps-dev): bump webpack from 5.91.0 to 5.94.0 (#203)" ([c36d2a7](https://github.com/wickedest/Mergely/commit/c36d2a7ba9ca895844126711aa00b9634814e1dc)), closes [#203](https://github.com/wickedest/Mergely/issues/203)
## [5.3.3](https://github.com/wickedest/Mergely/compare/v5.3.2...v5.3.3) (2024-10-11)
### Bug Fixes
* **#209:** Fixes issue with options not being preserved when individually set. ([#211](https://github.com/wickedest/Mergely/issues/211)) ([4cd8897](https://github.com/wickedest/Mergely/commit/4cd8897c6b157d506560bb09f508f9debe2a4211))
## [5.3.2](https://github.com/wickedest/Mergely/compare/v5.3.1...v5.3.2) (2024-07-31)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "mergely",
"version": "5.3.2",
"version": "5.3.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mergely",
"version": "5.3.2",
"version": "5.3.4",
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
"devDependencies": {
"@babel/core": "^7.1.6",

View File

@@ -1,6 +1,6 @@
{
"name": "mergely",
"version": "5.3.2",
"version": "5.3.4",
"description": "A javascript UI for diff/merge",
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
"author": {

View File

@@ -449,7 +449,6 @@ CodeMirrorDiffView.prototype.bind = function(container) {
ev.preventDefault();
return;
}
const ed = this.editor[side];
// See if the user clicked the line number of a difference:
let found = false;
for (let i = 0; i < this.changes.length; ++i) {

View File

@@ -122,13 +122,11 @@ class Mergely {
const colors = dom.getColors(this.el);
this._options = {
...defaultOptions,//lgpl
...this._initOptions,
...(this._options || this._initOptions),
...options//lgpl-separate-notice
};
this._viewOptions = {
...defaultOptions,
...this._initOptions,
...options,
...this._options,
_colors: colors
};
}

View File

@@ -340,7 +340,6 @@ describe('markup', () => {
name: 'Changes with non-letter chars',
lhs: '~# 00 == ! (dog) \n',
rhs: '~? 11 ++ ] (fox) .\n',
only: true,
check: (editor) => {
expect(editor.querySelectorAll(LHS_CHANGE_START_AND_END + '.cid-0')).to.have.length(1);
expect(editor.querySelectorAll(LHS_INLINE_TEXT + '.cid-0')).to.have.length(6);
@@ -355,8 +354,6 @@ describe('markup', () => {
for (const value of rhs_changes.values()) {
rhs_values.push(value.innerText);
}
console.log(lhs_values);
console.log(rhs_values);
expect(lhs_values).to.deep.equal(['#', '00', '==', '!', 'd', 'g']);
expect(rhs_values).to.deep.equal(['?', '11', '++', ']', 'f', 'x', '.']);
}

View File

@@ -62,19 +62,17 @@ describe('mergely', function () {
try {
const { children } = editor.el.children[0];
const items = Array.from(children).map(a => a.className);
expect(items[0] == 'mergely-margin');
expect(items[1] == 'mergely-column');
// NOTE: if running karma debug, these tests can fail because
// the debugger grabs the focus and the CodeMirror instance
// loses `CodeMirror-focused`
expect(items).to.deep.equal([
'mergely-margin',
'mergely-column',
'CodeMirror cm-s-default CodeMirror-focused',
'mergely-canvas',
'mergely-column',
'CodeMirror cm-s-default',
'mergely-margin',
'mergely-splash'
]);
expect(items[2].indexOf('CodeMirror cm-s-default' == 0));
expect(items[3] == 'mergely-margin');
expect(items[4] == 'mergely-column');
expect(items[5] == 'CodeMirror cm-s-default');
expect(items[6] == 'mergely-column');
expect(items[7] == 'mergely-splash');
expect(editor.get('lhs')).to.equal('');
expect(editor.get('rhs')).to.equal('');
done();
@@ -99,15 +97,17 @@ describe('mergely', function () {
// NOTE: if running karma debug, these tests can fail because
// the debugger grabs the focus and the CodeMirror instance
// loses `CodeMirror-focused`
expect(items).to.deep.equal([
'mergely-margin',
'mergely-column',
'CodeMirror cm-s-default CodeMirror-focused',
'mergely-canvas',
'mergely-column',
'CodeMirror cm-s-default',
'mergely-margin'
]);
expect(items[0] == 'mergely-margin');
expect(items[1] == 'mergely-column');
// NOTE: if running karma debug, these tests can fail because
// the debugger grabs the focus and the CodeMirror instance
// loses `CodeMirror-focused`
expect(items[2].indexOf('CodeMirror cm-s-default' == 0));
expect(items[3] == 'mergely-margin');
expect(items[4] == 'mergely-column');
expect(items[5] == 'CodeMirror cm-s-default');
expect(items[6] == 'mergely-column');
expect(items[7] == 'mergely-splash');
expect(editor.get('lhs')).to.equal('left-hand side text');
expect(editor.get('rhs')).to.equal('right-hand side text');
done();
@@ -129,18 +129,17 @@ describe('mergely', function () {
try {
const { children } = editor.el.children[0];
const items = Array.from(children).map(a => a.className);
expect(items[0] == 'mergely-margin');
expect(items[1] == 'mergely-column');
// NOTE: if running karma debug, these tests can fail because
// the debugger grabs the focus and the CodeMirror instance
// loses `CodeMirror-focused`
expect(items).to.deep.equal([
'mergely-margin',
'mergely-column',
'CodeMirror cm-s-default CodeMirror-focused',
'mergely-canvas',
'mergely-column',
'CodeMirror cm-s-default',
'mergely-margin'
]);
expect(items[2].indexOf('CodeMirror cm-s-default' == 0));
expect(items[3] == 'mergely-margin');
expect(items[4] == 'mergely-column');
expect(items[5] == 'CodeMirror cm-s-default');
expect(items[6] == 'mergely-column');
expect(items[7] == 'mergely-splash');
expect(editor.get('lhs')).to.equal('left-hand side text');
expect(editor.get('rhs')).to.equal('right-hand side text');
done();
@@ -161,18 +160,17 @@ describe('mergely', function () {
try {
const { children } = editor.el.children[0];
const items = Array.from(children).map(a => a.className);
expect(items[0] == 'mergely-margin');
expect(items[1] == 'mergely-column');
// NOTE: if running karma debug, these tests can fail because
// the debugger grabs the focus and the CodeMirror instance
// loses `CodeMirror-focused`
expect(items).to.deep.equal([
'mergely-margin',
'mergely-column',
'CodeMirror cm-s-default CodeMirror-focused',
'mergely-canvas',
'mergely-column',
'CodeMirror cm-s-default',
'mergely-margin'
]);
expect(items[2].indexOf('CodeMirror cm-s-default' == 0));
expect(items[3] == 'mergely-margin');
expect(items[4] == 'mergely-column');
expect(items[5] == 'CodeMirror cm-s-default');
expect(items[6] == 'mergely-column');
expect(items[7] == 'mergely-splash');
expect(children[0].style.visibility).to.equal('hidden');
expect(children[6].style.visibility).to.equal('hidden');
done();
@@ -503,6 +501,24 @@ describe('mergely', function () {
});
});
it('should preserve changed option', function (done) {
const editor = init({
change_timeout: 0,
license: 'lgpl-separate-notice',
lhs: 'left-hand side text',
rhs: 'right-hand side text'
});
editor.once('updated', () => {
editor.options({ sidebar: false });
expect(editor.options().wrap_lines).to.equal(false, 'wrap_lines');
expect(editor.options().sidebar).to.equal(false, 'sidebar');
editor.options({ wrap_lines: false });
expect(editor.options().wrap_lines).to.equal(false, 'wrap_lines-2');
expect(editor.options().sidebar).to.equal(false, 'sidebar-2');
done();
});
});
it('should ignore white-space', function (done) {
const editor = init({
height: 100,