react-monaco-json-merge 1.1.14 → 1.1.16
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/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +464 -442
- package/dist/index.mjs.map +1 -1
- package/dist/utils/editorDecorations.d.ts.map +1 -1
- package/dist/utils/jsonPatchDiff.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -130,7 +130,7 @@ function Xt(e) {
|
|
|
130
130
|
}
|
|
131
131
|
return e;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Rn() {
|
|
134
134
|
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
135
135
|
t[r] = arguments[r];
|
|
136
136
|
return function(n) {
|
|
@@ -139,7 +139,7 @@ function jn() {
|
|
|
139
139
|
}, n);
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Ce(e) {
|
|
143
143
|
return function t() {
|
|
144
144
|
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
145
145
|
o[i] = arguments[i];
|
|
@@ -153,30 +153,30 @@ function Ke(e) {
|
|
|
153
153
|
function lt(e) {
|
|
154
154
|
return {}.toString.call(e).includes("Object");
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function jn(e) {
|
|
157
157
|
return !Object.keys(e).length;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Ke(e) {
|
|
160
160
|
return typeof e == "function";
|
|
161
161
|
}
|
|
162
162
|
function Dn(e, t) {
|
|
163
163
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
164
164
|
}
|
|
165
165
|
function Mn(e, t) {
|
|
166
|
-
return lt(t) ||
|
|
166
|
+
return lt(t) || Re("changeType"), Object.keys(t).some(function(r) {
|
|
167
167
|
return !Dn(e, r);
|
|
168
|
-
}) &&
|
|
168
|
+
}) && Re("changeField"), t;
|
|
169
169
|
}
|
|
170
170
|
function xn(e) {
|
|
171
|
-
|
|
171
|
+
Ke(e) || Re("selectorType");
|
|
172
172
|
}
|
|
173
173
|
function $n(e) {
|
|
174
|
-
|
|
175
|
-
return !
|
|
176
|
-
}) &&
|
|
174
|
+
Ke(e) || lt(e) || Re("handlerType"), lt(e) && Object.values(e).some(function(t) {
|
|
175
|
+
return !Ke(t);
|
|
176
|
+
}) && Re("handlersType");
|
|
177
177
|
}
|
|
178
178
|
function Bn(e) {
|
|
179
|
-
e ||
|
|
179
|
+
e || Re("initialIsRequired"), lt(e) || Re("initialType"), jn(e) && Re("initialContent");
|
|
180
180
|
}
|
|
181
181
|
function Fn(e, t) {
|
|
182
182
|
throw new Error(e[t] || e.default);
|
|
@@ -191,7 +191,7 @@ var Un = {
|
|
|
191
191
|
changeType: "provided value of changes should be an object",
|
|
192
192
|
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
193
193
|
default: "an unknown error accured in `state-local` package"
|
|
194
|
-
},
|
|
194
|
+
}, Re = Ce(Fn)(Un), it = {
|
|
195
195
|
changes: Mn,
|
|
196
196
|
selector: xn,
|
|
197
197
|
handler: $n,
|
|
@@ -202,7 +202,7 @@ function Vn(e) {
|
|
|
202
202
|
it.initial(e), it.handler(t);
|
|
203
203
|
var r = {
|
|
204
204
|
current: e
|
|
205
|
-
}, n =
|
|
205
|
+
}, n = Ce(Gn)(r, t), o = Ce(Hn)(r), i = Ce(it.changes)(e), s = Ce(Jn)(r);
|
|
206
206
|
function c() {
|
|
207
207
|
var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(l) {
|
|
208
208
|
return l;
|
|
@@ -210,18 +210,18 @@ function Vn(e) {
|
|
|
210
210
|
return it.selector(u), u(r.current);
|
|
211
211
|
}
|
|
212
212
|
function a(u) {
|
|
213
|
-
|
|
213
|
+
Rn(n, o, i, s)(u);
|
|
214
214
|
}
|
|
215
215
|
return [c, a];
|
|
216
216
|
}
|
|
217
217
|
function Jn(e, t) {
|
|
218
|
-
return
|
|
218
|
+
return Ke(t) ? t(e.current) : t;
|
|
219
219
|
}
|
|
220
220
|
function Hn(e, t) {
|
|
221
221
|
return e.current = Xt(Xt({}, e.current), t), t;
|
|
222
222
|
}
|
|
223
223
|
function Gn(e, t, r) {
|
|
224
|
-
return
|
|
224
|
+
return Ke(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
|
|
225
225
|
var o;
|
|
226
226
|
return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
|
|
227
227
|
}), r;
|
|
@@ -274,9 +274,9 @@ var on = {
|
|
|
274
274
|
|
|
275
275
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
276
276
|
`
|
|
277
|
-
}, Qt = Yn(Zn)(on),
|
|
277
|
+
}, Qt = Yn(Zn)(on), Cn = {
|
|
278
278
|
config: Xn
|
|
279
|
-
},
|
|
279
|
+
}, Kn = function() {
|
|
280
280
|
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
281
281
|
r[n] = arguments[n];
|
|
282
282
|
return function(o) {
|
|
@@ -312,7 +312,7 @@ var tr = ["monaco"], nr = Wn.create({
|
|
|
312
312
|
monaco: null
|
|
313
313
|
}), cn = Ln(nr, 2), tt = cn[0], dt = cn[1];
|
|
314
314
|
function rr(e) {
|
|
315
|
-
var t =
|
|
315
|
+
var t = Cn.config(e), r = t.monaco, n = Tn(t, tr);
|
|
316
316
|
dt(function(o) {
|
|
317
317
|
return {
|
|
318
318
|
config: sn(o.config, n),
|
|
@@ -336,7 +336,7 @@ function or() {
|
|
|
336
336
|
return e.resolve(e.monaco), vt(bt);
|
|
337
337
|
if (window.monaco && window.monaco.editor)
|
|
338
338
|
return an(window.monaco), e.resolve(window.monaco), vt(bt);
|
|
339
|
-
|
|
339
|
+
Kn(ir, cr)(ar);
|
|
340
340
|
}
|
|
341
341
|
return vt(bt);
|
|
342
342
|
}
|
|
@@ -395,13 +395,13 @@ var bt = new Promise(function(e, t) {
|
|
|
395
395
|
config: rr,
|
|
396
396
|
init: or,
|
|
397
397
|
__getMonacoInstance: lr
|
|
398
|
-
}, te = /* @__PURE__ */ ((e) => (e[e.excluded = 0] = "excluded", e[e.first = 1] = "first", e[e.second = 2] = "second", e))(te || {}),
|
|
398
|
+
}, te = /* @__PURE__ */ ((e) => (e[e.excluded = 0] = "excluded", e[e.first = 1] = "first", e[e.second = 2] = "second", e))(te || {}), D = /* @__PURE__ */ ((e) => (e.SAME_CHANGE = "same_change", e.INPUT1_ONLY = "input1_only", e.INPUT2_ONLY = "input2_only", e.TRUE_CONFLICT = "true_conflict", e))(D || {});
|
|
399
399
|
function fr(e, t = !1) {
|
|
400
400
|
const r = e.length;
|
|
401
401
|
let n = 0, o = "", i = 0, s = 16, c = 0, a = 0, u = 0, l = 0, y = 0;
|
|
402
|
-
function p(f,
|
|
403
|
-
let
|
|
404
|
-
for (;
|
|
402
|
+
function p(f, E) {
|
|
403
|
+
let S = 0, g = 0;
|
|
404
|
+
for (; S < f; ) {
|
|
405
405
|
let b = e.charCodeAt(n);
|
|
406
406
|
if (b >= 48 && b <= 57)
|
|
407
407
|
g = g * 16 + b - 48;
|
|
@@ -411,9 +411,9 @@ function fr(e, t = !1) {
|
|
|
411
411
|
g = g * 16 + b - 97 + 10;
|
|
412
412
|
else
|
|
413
413
|
break;
|
|
414
|
-
n++,
|
|
414
|
+
n++, S++;
|
|
415
415
|
}
|
|
416
|
-
return
|
|
416
|
+
return S < f && (g = -1), g;
|
|
417
417
|
}
|
|
418
418
|
function d(f) {
|
|
419
419
|
n = f, o = "", i = 0, s = 16, y = 0;
|
|
@@ -431,30 +431,30 @@ function fr(e, t = !1) {
|
|
|
431
431
|
n++;
|
|
432
432
|
else
|
|
433
433
|
return y = 3, e.substring(f, n);
|
|
434
|
-
let
|
|
434
|
+
let E = n;
|
|
435
435
|
if (n < e.length && (e.charCodeAt(n) === 69 || e.charCodeAt(n) === 101))
|
|
436
436
|
if (n++, (n < e.length && e.charCodeAt(n) === 43 || e.charCodeAt(n) === 45) && n++, n < e.length && Je(e.charCodeAt(n))) {
|
|
437
437
|
for (n++; n < e.length && Je(e.charCodeAt(n)); )
|
|
438
438
|
n++;
|
|
439
|
-
|
|
439
|
+
E = n;
|
|
440
440
|
} else
|
|
441
441
|
y = 3;
|
|
442
|
-
return e.substring(f,
|
|
442
|
+
return e.substring(f, E);
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
let f = "",
|
|
444
|
+
function N() {
|
|
445
|
+
let f = "", E = n;
|
|
446
446
|
for (; ; ) {
|
|
447
447
|
if (n >= r) {
|
|
448
|
-
f += e.substring(
|
|
448
|
+
f += e.substring(E, n), y = 2;
|
|
449
449
|
break;
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
if (
|
|
453
|
-
f += e.substring(
|
|
451
|
+
const S = e.charCodeAt(n);
|
|
452
|
+
if (S === 34) {
|
|
453
|
+
f += e.substring(E, n), n++;
|
|
454
454
|
break;
|
|
455
455
|
}
|
|
456
|
-
if (
|
|
457
|
-
if (f += e.substring(
|
|
456
|
+
if (S === 92) {
|
|
457
|
+
if (f += e.substring(E, n), n++, n >= r) {
|
|
458
458
|
y = 2;
|
|
459
459
|
break;
|
|
460
460
|
}
|
|
@@ -491,12 +491,12 @@ function fr(e, t = !1) {
|
|
|
491
491
|
default:
|
|
492
492
|
y = 5;
|
|
493
493
|
}
|
|
494
|
-
|
|
494
|
+
E = n;
|
|
495
495
|
continue;
|
|
496
496
|
}
|
|
497
|
-
if (
|
|
498
|
-
if (Qe(
|
|
499
|
-
f += e.substring(
|
|
497
|
+
if (S >= 0 && S <= 31)
|
|
498
|
+
if (Qe(S)) {
|
|
499
|
+
f += e.substring(E, n), y = 2;
|
|
500
500
|
break;
|
|
501
501
|
} else
|
|
502
502
|
y = 6;
|
|
@@ -533,20 +533,20 @@ function fr(e, t = !1) {
|
|
|
533
533
|
return n++, s = 5;
|
|
534
534
|
// strings
|
|
535
535
|
case 34:
|
|
536
|
-
return n++, o =
|
|
536
|
+
return n++, o = N(), s = 10;
|
|
537
537
|
// comments
|
|
538
538
|
case 47:
|
|
539
|
-
const
|
|
539
|
+
const E = n - 1;
|
|
540
540
|
if (e.charCodeAt(n + 1) === 47) {
|
|
541
541
|
for (n += 2; n < r && !Qe(e.charCodeAt(n)); )
|
|
542
542
|
n++;
|
|
543
|
-
return o = e.substring(
|
|
543
|
+
return o = e.substring(E, n), s = 12;
|
|
544
544
|
}
|
|
545
545
|
if (e.charCodeAt(n + 1) === 42) {
|
|
546
546
|
n += 2;
|
|
547
|
-
const
|
|
547
|
+
const S = r - 1;
|
|
548
548
|
let g = !1;
|
|
549
|
-
for (; n <
|
|
549
|
+
for (; n < S; ) {
|
|
550
550
|
const b = e.charCodeAt(n);
|
|
551
551
|
if (b === 42 && e.charCodeAt(n + 1) === 47) {
|
|
552
552
|
n += 2, g = !0;
|
|
@@ -554,7 +554,7 @@ function fr(e, t = !1) {
|
|
|
554
554
|
}
|
|
555
555
|
n++, Qe(b) && (b === 13 && e.charCodeAt(n) === 10 && n++, c++, u = n);
|
|
556
556
|
}
|
|
557
|
-
return g || (n++, y = 1), o = e.substring(
|
|
557
|
+
return g || (n++, y = 1), o = e.substring(E, n), s = 13;
|
|
558
558
|
}
|
|
559
559
|
return o += String.fromCharCode(f), n++, s = 16;
|
|
560
560
|
// numbers
|
|
@@ -738,7 +738,7 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
738
738
|
i > 0 && i--, i === 0 && A(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
|
|
739
739
|
} : () => !0;
|
|
740
740
|
}
|
|
741
|
-
const y = u(t.onObjectBegin), p = a(t.onObjectProperty), d = l(t.onObjectEnd), L = u(t.onArrayBegin),
|
|
741
|
+
const y = u(t.onObjectBegin), p = a(t.onObjectProperty), d = l(t.onObjectEnd), L = u(t.onArrayBegin), N = l(t.onArrayEnd), v = a(t.onLiteralValue), h = c(t.onSeparator), m = s(t.onComment), f = c(t.onError), E = r && r.disallowComments, S = r && r.allowTrailingComma;
|
|
742
742
|
function g() {
|
|
743
743
|
for (; ; ) {
|
|
744
744
|
const A = n.scan();
|
|
@@ -762,7 +762,7 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
762
762
|
);
|
|
763
763
|
break;
|
|
764
764
|
case 1:
|
|
765
|
-
|
|
765
|
+
E || b(
|
|
766
766
|
11
|
|
767
767
|
/* ParseErrorCode.UnexpectedEndOfComment */
|
|
768
768
|
);
|
|
@@ -783,7 +783,7 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
783
783
|
switch (A) {
|
|
784
784
|
case 12:
|
|
785
785
|
case 13:
|
|
786
|
-
|
|
786
|
+
E ? b(
|
|
787
787
|
10
|
|
788
788
|
/* ParseErrorCode.InvalidCommentToken */
|
|
789
789
|
) : m();
|
|
@@ -802,24 +802,24 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
function b(A, w = [],
|
|
806
|
-
if (f(A), w.length +
|
|
805
|
+
function b(A, w = [], R = []) {
|
|
806
|
+
if (f(A), w.length + R.length > 0) {
|
|
807
807
|
let X = n.getToken();
|
|
808
808
|
for (; X !== 17; ) {
|
|
809
809
|
if (w.indexOf(X) !== -1) {
|
|
810
810
|
g();
|
|
811
811
|
break;
|
|
812
|
-
} else if (
|
|
812
|
+
} else if (R.indexOf(X) !== -1)
|
|
813
813
|
break;
|
|
814
814
|
X = g();
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function j(A) {
|
|
819
819
|
const w = n.getTokenValue();
|
|
820
820
|
return A ? v(w) : (p(w), o.push(w)), g(), !0;
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function T() {
|
|
823
823
|
switch (n.getToken()) {
|
|
824
824
|
case 11:
|
|
825
825
|
const A = n.getTokenValue();
|
|
@@ -848,7 +848,7 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
848
848
|
2,
|
|
849
849
|
5
|
|
850
850
|
/* SyntaxKind.CommaToken */
|
|
851
|
-
]), !1) : (
|
|
851
|
+
]), !1) : (j(!1), n.getToken() === 6 ? (h(":"), g(), V() || b(4, [], [
|
|
852
852
|
2,
|
|
853
853
|
5
|
|
854
854
|
/* SyntaxKind.CommaToken */
|
|
@@ -858,12 +858,12 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
858
858
|
/* SyntaxKind.CommaToken */
|
|
859
859
|
]), o.pop(), !0);
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function M() {
|
|
862
862
|
y(), g();
|
|
863
863
|
let A = !1;
|
|
864
864
|
for (; n.getToken() !== 2 && n.getToken() !== 17; ) {
|
|
865
865
|
if (n.getToken() === 5) {
|
|
866
|
-
if (A || b(4, [], []), h(","), g(), n.getToken() === 2 &&
|
|
866
|
+
if (A || b(4, [], []), h(","), g(), n.getToken() === 2 && S)
|
|
867
867
|
break;
|
|
868
868
|
} else A && b(6, [], []);
|
|
869
869
|
B() || b(4, [], [
|
|
@@ -882,7 +882,7 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
882
882
|
let A = !0, w = !1;
|
|
883
883
|
for (; n.getToken() !== 4 && n.getToken() !== 17; ) {
|
|
884
884
|
if (n.getToken() === 5) {
|
|
885
|
-
if (w || b(4, [], []), h(","), g(), n.getToken() === 4 &&
|
|
885
|
+
if (w || b(4, [], []), h(","), g(), n.getToken() === 4 && S)
|
|
886
886
|
break;
|
|
887
887
|
} else w && b(6, [], []);
|
|
888
888
|
A ? (o.push(0), A = !1) : o[o.length - 1]++, V() || b(4, [], [
|
|
@@ -891,7 +891,7 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
891
891
|
/* SyntaxKind.CommaToken */
|
|
892
892
|
]), w = !0;
|
|
893
893
|
}
|
|
894
|
-
return
|
|
894
|
+
return N(), A || o.pop(), n.getToken() !== 4 ? b(8, [
|
|
895
895
|
4
|
|
896
896
|
/* SyntaxKind.CloseBracketToken */
|
|
897
897
|
], []) : g(), !0;
|
|
@@ -901,11 +901,11 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
901
901
|
case 3:
|
|
902
902
|
return x();
|
|
903
903
|
case 1:
|
|
904
|
-
return
|
|
904
|
+
return M();
|
|
905
905
|
case 10:
|
|
906
|
-
return
|
|
906
|
+
return j(!0);
|
|
907
907
|
default:
|
|
908
|
-
return
|
|
908
|
+
return T();
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
return g(), n.getToken() === 17 ? r.allowEmptyContent ? !0 : (b(4, [], []), !1) : V() ? (n.getToken() !== 17 && b(9, [], []), !0) : (b(4, [], []), !1);
|
|
@@ -929,14 +929,14 @@ function gr(e) {
|
|
|
929
929
|
return "null";
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
|
-
var
|
|
932
|
+
var Ct;
|
|
933
933
|
(function(e) {
|
|
934
934
|
e[e.None = 0] = "None", e[e.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 4] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 6] = "InvalidCharacter";
|
|
935
|
-
})(
|
|
936
|
-
var
|
|
935
|
+
})(Ct || (Ct = {}));
|
|
936
|
+
var Kt;
|
|
937
937
|
(function(e) {
|
|
938
938
|
e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
|
|
939
|
-
})(
|
|
939
|
+
})(Kt || (Kt = {}));
|
|
940
940
|
const ln = pr, un = dr;
|
|
941
941
|
var en;
|
|
942
942
|
(function(e) {
|
|
@@ -974,7 +974,7 @@ function yr() {
|
|
|
974
974
|
}), wt;
|
|
975
975
|
}
|
|
976
976
|
var vr = yr();
|
|
977
|
-
const
|
|
977
|
+
const de = /* @__PURE__ */ mr(vr), W = (e, t) => {
|
|
978
978
|
if (!e) return;
|
|
979
979
|
const r = t.replace(/^\//, "").replace(/\[/g, ".").replace(/\]/g, "").split(/[./#]/).filter(Boolean);
|
|
980
980
|
let n = e;
|
|
@@ -1360,18 +1360,18 @@ function Pr(e, t) {
|
|
|
1360
1360
|
function St(e, t) {
|
|
1361
1361
|
t === void 0 && (t = !1);
|
|
1362
1362
|
var r = Pt.get(e.object);
|
|
1363
|
-
|
|
1363
|
+
Rt(r.value, e.object, e.patches, "", t), e.patches.length && _t(r.value, e.patches);
|
|
1364
1364
|
var n = e.patches;
|
|
1365
1365
|
return n.length > 0 && (e.patches = [], e.callback && e.callback(n)), n;
|
|
1366
1366
|
}
|
|
1367
|
-
function
|
|
1367
|
+
function Rt(e, t, r, n, o) {
|
|
1368
1368
|
if (t !== e) {
|
|
1369
1369
|
typeof t.toJSON == "function" && (t = t.toJSON());
|
|
1370
1370
|
for (var i = Tt(t), s = Tt(e), c = !1, a = s.length - 1; a >= 0; a--) {
|
|
1371
1371
|
var u = s[a], l = e[u];
|
|
1372
1372
|
if (Et(t, u) && !(t[u] === void 0 && l !== void 0 && Array.isArray(t) === !1)) {
|
|
1373
1373
|
var y = t[u];
|
|
1374
|
-
typeof l == "object" && l != null && typeof y == "object" && y != null && Array.isArray(l) === Array.isArray(y) ?
|
|
1374
|
+
typeof l == "object" && l != null && typeof y == "object" && y != null && Array.isArray(l) === Array.isArray(y) ? Rt(l, y, r, n + "/" + Me(u), o) : l !== y && (o && r.push({ op: "test", path: n + "/" + Me(u), value: we(l) }), r.push({ op: "replace", path: n + "/" + Me(u), value: we(y) }));
|
|
1375
1375
|
} else Array.isArray(e) === Array.isArray(t) ? (o && r.push({ op: "test", path: n + "/" + Me(u), value: we(l) }), r.push({ op: "remove", path: n + "/" + Me(u) }), c = !0) : (o && r.push({ op: "test", path: n, value: e }), r.push({ op: "replace", path: n, value: t }));
|
|
1376
1376
|
}
|
|
1377
1377
|
if (!(!c && i.length == s.length))
|
|
@@ -1384,33 +1384,33 @@ function jt(e, t, r, n, o) {
|
|
|
1384
1384
|
function We(e, t, r) {
|
|
1385
1385
|
r === void 0 && (r = !1);
|
|
1386
1386
|
var n = [];
|
|
1387
|
-
return
|
|
1387
|
+
return Rt(e, t, n, "", r), n;
|
|
1388
1388
|
}
|
|
1389
|
-
const
|
|
1389
|
+
const Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1390
1390
|
__proto__: null,
|
|
1391
1391
|
compare: We,
|
|
1392
1392
|
generate: St,
|
|
1393
1393
|
observe: Pr,
|
|
1394
1394
|
unobserve: _r
|
|
1395
1395
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1396
|
-
Object.assign({}, Er,
|
|
1396
|
+
Object.assign({}, Er, Rr, {
|
|
1397
1397
|
JsonPatchError: pn,
|
|
1398
1398
|
deepClone: we,
|
|
1399
1399
|
escapePathComponent: Me,
|
|
1400
1400
|
unescapePathComponent: fn
|
|
1401
1401
|
});
|
|
1402
|
-
const ht = "oneOf",
|
|
1402
|
+
const ht = "oneOf", jt = "anyOf", Dt = "allOf";
|
|
1403
1403
|
function Mt(e) {
|
|
1404
|
-
return !!(e[ht] || e[
|
|
1404
|
+
return !!(e[ht] || e[jt] || e[Dt]);
|
|
1405
1405
|
}
|
|
1406
1406
|
function hn(e) {
|
|
1407
|
-
const t = e[ht] || e[
|
|
1407
|
+
const t = e[ht] || e[jt] || e[Dt];
|
|
1408
1408
|
return Array.isArray(t) ? t : void 0;
|
|
1409
1409
|
}
|
|
1410
1410
|
function ct(e) {
|
|
1411
|
-
return e.oneOf ? ht : e.anyOf ?
|
|
1411
|
+
return e.oneOf ? ht : e.anyOf ? jt : e.allOf ? Dt : "";
|
|
1412
1412
|
}
|
|
1413
|
-
function
|
|
1413
|
+
function jr(e, t) {
|
|
1414
1414
|
if (typeof t != "object" || t === null || Array.isArray(t))
|
|
1415
1415
|
return null;
|
|
1416
1416
|
const r = t, n = /* @__PURE__ */ new Set();
|
|
@@ -1436,7 +1436,7 @@ function at(e, t, r = ht) {
|
|
|
1436
1436
|
return { selectedIndex: o, schema: i };
|
|
1437
1437
|
}
|
|
1438
1438
|
if (typeof e == "object" && e !== null && !Array.isArray(e)) {
|
|
1439
|
-
const o = e, i =
|
|
1439
|
+
const o = e, i = jr(t, e);
|
|
1440
1440
|
if (i)
|
|
1441
1441
|
for (let s = 0; s < t.length; s++) {
|
|
1442
1442
|
const c = t[s], a = (n = c.properties) == null ? void 0 : n[i.field];
|
|
@@ -1479,8 +1479,8 @@ function at(e, t, r = ht) {
|
|
|
1479
1479
|
return { selectedIndex: 0, schema: t[0] };
|
|
1480
1480
|
}
|
|
1481
1481
|
function kt(e, t, r) {
|
|
1482
|
-
const n = !
|
|
1483
|
-
return n && o ?
|
|
1482
|
+
const n = !de(e, t), o = !de(e, r);
|
|
1483
|
+
return n && o ? de(t, r) ? D.SAME_CHANGE : D.TRUE_CONFLICT : n ? D.INPUT1_ONLY : o ? D.INPUT2_ONLY : D.SAME_CHANGE;
|
|
1484
1484
|
}
|
|
1485
1485
|
function Pe(e, t) {
|
|
1486
1486
|
try {
|
|
@@ -1548,79 +1548,79 @@ function Mr(e, t, r, n, o, i) {
|
|
|
1548
1548
|
for (const v of y) {
|
|
1549
1549
|
const h = W(r, v), m = W(n, v), f = W(o, v);
|
|
1550
1550
|
if (!Array.isArray(h) || !Array.isArray(m) || !Array.isArray(f)) {
|
|
1551
|
-
const
|
|
1552
|
-
for (const
|
|
1553
|
-
const x =
|
|
1551
|
+
const T = c.get(v) || [], B = a.get(v) || [];
|
|
1552
|
+
for (const M of T) {
|
|
1553
|
+
const x = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1554
1554
|
if (x) {
|
|
1555
1555
|
const V = x[1];
|
|
1556
1556
|
s.has(V) || s.set(V, { patches1: [], patches2: [] });
|
|
1557
1557
|
const A = s.get(V);
|
|
1558
|
-
A && A.patches1.push(
|
|
1558
|
+
A && A.patches1.push(M);
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
|
-
for (const
|
|
1562
|
-
const x =
|
|
1561
|
+
for (const M of B) {
|
|
1562
|
+
const x = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1563
1563
|
if (x) {
|
|
1564
1564
|
const V = x[1];
|
|
1565
1565
|
s.has(V) || s.set(V, { patches1: [], patches2: [] });
|
|
1566
1566
|
const A = s.get(V);
|
|
1567
|
-
A && A.patches2.push(
|
|
1567
|
+
A && A.patches2.push(M);
|
|
1568
1568
|
}
|
|
1569
1569
|
}
|
|
1570
1570
|
continue;
|
|
1571
1571
|
}
|
|
1572
|
-
const
|
|
1572
|
+
const E = qe(i, v, r), S = E != null && E.items ? Array.isArray(E.items) && E.items[0] ? E.items[0] : Array.isArray(E.items) ? null : E.items : null, g = S && typeof S == "object" ? S : null;
|
|
1573
1573
|
if (g) {
|
|
1574
|
-
const
|
|
1575
|
-
if (
|
|
1576
|
-
const B = /* @__PURE__ */ new Map(),
|
|
1577
|
-
for (const [w,
|
|
1578
|
-
|
|
1574
|
+
const T = Br(h, m, f, g);
|
|
1575
|
+
if (T.size > 0) {
|
|
1576
|
+
const B = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
1577
|
+
for (const [w, R] of T.entries())
|
|
1578
|
+
R.base !== void 0 && B.set(R.base, w), R.input1 !== void 0 && M.set(R.input1, w), R.input2 !== void 0 && x.set(R.input2, w);
|
|
1579
1579
|
const V = c.get(v) || [], A = a.get(v) || [];
|
|
1580
1580
|
for (const w of V) {
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1583
|
-
const X = Number.parseInt(
|
|
1581
|
+
const R = w.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
|
|
1582
|
+
if (R) {
|
|
1583
|
+
const X = Number.parseInt(R[1], 10), ne = M.get(X);
|
|
1584
1584
|
if (ne !== void 0) {
|
|
1585
1585
|
const ae = `${v}#${ne}`;
|
|
1586
1586
|
s.has(ae) || s.set(ae, { patches1: [], patches2: [] });
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1587
|
+
const me = s.get(ae);
|
|
1588
|
+
me && me.patches1.push(w);
|
|
1589
1589
|
}
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
1592
|
for (const w of A) {
|
|
1593
|
-
const
|
|
1594
|
-
if (
|
|
1595
|
-
const X = Number.parseInt(
|
|
1593
|
+
const R = w.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
|
|
1594
|
+
if (R) {
|
|
1595
|
+
const X = Number.parseInt(R[1], 10), ne = x.get(X);
|
|
1596
1596
|
if (ne !== void 0) {
|
|
1597
1597
|
const ae = `${v}#${ne}`;
|
|
1598
1598
|
s.has(ae) || s.set(ae, { patches1: [], patches2: [] });
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1599
|
+
const me = s.get(ae);
|
|
1600
|
+
me && me.patches2.push(w);
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
1603
1603
|
}
|
|
1604
1604
|
continue;
|
|
1605
1605
|
}
|
|
1606
1606
|
}
|
|
1607
|
-
const b = c.get(v) || [],
|
|
1608
|
-
for (const
|
|
1609
|
-
const B =
|
|
1607
|
+
const b = c.get(v) || [], j = a.get(v) || [];
|
|
1608
|
+
for (const T of b) {
|
|
1609
|
+
const B = T.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1610
1610
|
if (B) {
|
|
1611
|
-
const
|
|
1612
|
-
s.has(
|
|
1613
|
-
const x = s.get(
|
|
1614
|
-
x && x.patches1.push(
|
|
1611
|
+
const M = B[1];
|
|
1612
|
+
s.has(M) || s.set(M, { patches1: [], patches2: [] });
|
|
1613
|
+
const x = s.get(M);
|
|
1614
|
+
x && x.patches1.push(T);
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
|
-
for (const
|
|
1618
|
-
const B =
|
|
1617
|
+
for (const T of j) {
|
|
1618
|
+
const B = T.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1619
1619
|
if (B) {
|
|
1620
|
-
const
|
|
1621
|
-
s.has(
|
|
1622
|
-
const x = s.get(
|
|
1623
|
-
x && x.patches2.push(
|
|
1620
|
+
const M = B[1];
|
|
1621
|
+
s.has(M) || s.set(M, { patches1: [], patches2: [] });
|
|
1622
|
+
const x = s.get(M);
|
|
1623
|
+
x && x.patches2.push(T);
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
1626
|
}
|
|
@@ -1628,18 +1628,18 @@ function Mr(e, t, r, n, o, i) {
|
|
|
1628
1628
|
if (!h) return null;
|
|
1629
1629
|
const m = v.split("/").filter(Boolean);
|
|
1630
1630
|
if (m.length < 2) return null;
|
|
1631
|
-
const f = `/${m[0]}`,
|
|
1632
|
-
return
|
|
1633
|
-
}, d = [...u], L = [...l],
|
|
1631
|
+
const f = `/${m[0]}`, E = qe(h, f);
|
|
1632
|
+
return E && Mt(E) ? f : null;
|
|
1633
|
+
}, d = [...u], L = [...l], N = /* @__PURE__ */ new Set();
|
|
1634
1634
|
for (const v of d) {
|
|
1635
1635
|
const h = p(v.path, i);
|
|
1636
|
-
h &&
|
|
1636
|
+
h && N.add(h);
|
|
1637
1637
|
}
|
|
1638
1638
|
for (const v of L) {
|
|
1639
1639
|
const h = p(v.path, i);
|
|
1640
|
-
h &&
|
|
1640
|
+
h && N.add(h);
|
|
1641
1641
|
}
|
|
1642
|
-
for (const v of
|
|
1642
|
+
for (const v of N)
|
|
1643
1643
|
s.has(v) || s.set(v, { patches1: [], patches2: [] });
|
|
1644
1644
|
for (const v of d) {
|
|
1645
1645
|
const h = v.path, m = p(h, i);
|
|
@@ -1779,65 +1779,65 @@ function Fr(e, t, r, n) {
|
|
|
1779
1779
|
const o = typeof e == "object" && e !== null || Array.isArray(e) ? e : {}, i = typeof t == "object" && t !== null || Array.isArray(t) ? t : {}, s = typeof r == "object" && r !== null || Array.isArray(r) ? r : {}, c = We(o, i), a = We(o, s);
|
|
1780
1780
|
let u = Dr(c, a);
|
|
1781
1781
|
n && (u = Mr(c, a, e, t, r, n));
|
|
1782
|
-
const l = [], y = /* @__PURE__ */ new Set(), p = (d, L,
|
|
1783
|
-
if (!n || typeof L != "object" || L === null || Array.isArray(L) || typeof
|
|
1782
|
+
const l = [], y = /* @__PURE__ */ new Set(), p = (d, L, N, v) => {
|
|
1783
|
+
if (!n || typeof L != "object" || L === null || Array.isArray(L) || typeof N != "object" || N === null || Array.isArray(N) || typeof v != "object" || v === null || Array.isArray(v)) return !1;
|
|
1784
1784
|
const h = qe(n, d, L);
|
|
1785
1785
|
if (!h || !Mt(h)) return !1;
|
|
1786
1786
|
const m = hn(h);
|
|
1787
1787
|
if (!m || m.length < 2) return !1;
|
|
1788
|
-
const f = at(L, m, ct(h)),
|
|
1789
|
-
return
|
|
1788
|
+
const f = at(L, m, ct(h)), E = at(N, m, ct(h)), S = at(v, m, ct(h));
|
|
1789
|
+
return E.selectedIndex !== S.selectedIndex && (f.selectedIndex !== E.selectedIndex || f.selectedIndex !== S.selectedIndex);
|
|
1790
1790
|
};
|
|
1791
|
-
for (const [d, { patches1: L, patches2:
|
|
1791
|
+
for (const [d, { patches1: L, patches2: N }] of u) {
|
|
1792
1792
|
y.add(d);
|
|
1793
1793
|
let v = d;
|
|
1794
|
-
L.length > 0 ? v = L[0].path :
|
|
1794
|
+
L.length > 0 ? v = L[0].path : N.length > 0 ? v = N[0].path : d.includes("#") && (v = d.split("#")[0]);
|
|
1795
1795
|
let h = d;
|
|
1796
1796
|
if (d.includes("#"))
|
|
1797
1797
|
h = d.split("#")[0];
|
|
1798
1798
|
else {
|
|
1799
|
-
const
|
|
1800
|
-
|
|
1801
|
-
}
|
|
1802
|
-
if ([...L, ...
|
|
1803
|
-
const
|
|
1804
|
-
if (p(h,
|
|
1805
|
-
const w =
|
|
1806
|
-
let ne = kt(w,
|
|
1807
|
-
!
|
|
1808
|
-
const ae = [...L, ...
|
|
1799
|
+
const M = d.split("/").filter(Boolean);
|
|
1800
|
+
M.length > 1 && (h = `/${M[0]}`);
|
|
1801
|
+
}
|
|
1802
|
+
if ([...L, ...N].every((M) => (M.path.split("/").slice(0, 2).join("/") || `/${M.path.split("/")[1]}`) === h) && h !== v) {
|
|
1803
|
+
const M = W(e, h), x = W(t, h), V = W(r, h);
|
|
1804
|
+
if (p(h, M, x, V)) {
|
|
1805
|
+
const w = M, R = x, X = V;
|
|
1806
|
+
let ne = kt(w, R, X);
|
|
1807
|
+
!de(w, R) && !de(w, X) && !de(R, X) && (ne = D.TRUE_CONFLICT);
|
|
1808
|
+
const ae = [...L, ...N].filter(
|
|
1809
1809
|
(Te) => Te.path.startsWith(`${h}/`) || Te.path === h
|
|
1810
|
-
),
|
|
1810
|
+
), me = [], je = [];
|
|
1811
1811
|
for (const Te of ae) {
|
|
1812
|
-
const
|
|
1812
|
+
const C = Te.path, ie = e !== void 0 ? W(e, C) : void 0, ee = W(t, C), F = W(r, C);
|
|
1813
1813
|
let fe = !1, Ie = !1;
|
|
1814
|
-
Te.op === "replace" ? ie !== void 0 && (fe = !
|
|
1814
|
+
Te.op === "replace" ? ie !== void 0 && (fe = !de(ie, ee), Ie = !de(ie, F)) : Te.op === "add" ? (fe = ie === void 0 && ee !== void 0, Ie = ie === void 0 && F !== void 0) : Te.op === "remove" && (fe = ie !== void 0 && ee === void 0, Ie = ie !== void 0 && F === void 0), ie !== void 0 && (ee !== void 0 && de(ie, ee) && (fe = !1), F !== void 0 && de(ie, F) && (Ie = !1)), fe && me.push(Te), Ie && je.push(Te);
|
|
1815
1815
|
}
|
|
1816
1816
|
l.push({
|
|
1817
1817
|
path: h,
|
|
1818
1818
|
baseValue: w,
|
|
1819
|
-
input1Value:
|
|
1819
|
+
input1Value: R,
|
|
1820
1820
|
input2Value: X,
|
|
1821
1821
|
conflictType: ne,
|
|
1822
|
-
patches1:
|
|
1823
|
-
patches2:
|
|
1822
|
+
patches1: me,
|
|
1823
|
+
patches2: je
|
|
1824
1824
|
});
|
|
1825
1825
|
continue;
|
|
1826
1826
|
}
|
|
1827
1827
|
}
|
|
1828
|
-
const f = W(e, v),
|
|
1829
|
-
let g = kt(f,
|
|
1830
|
-
const b = f != null,
|
|
1831
|
-
!b &&
|
|
1828
|
+
const f = W(e, v), E = W(t, v), S = W(r, v);
|
|
1829
|
+
let g = kt(f, E, S);
|
|
1830
|
+
const b = f != null, j = E != null, T = S != null;
|
|
1831
|
+
!b && j && T && g !== D.SAME_CHANGE && (g = D.TRUE_CONFLICT), b && de(f, E) && de(f, S) || l.push({
|
|
1832
1832
|
path: v,
|
|
1833
1833
|
// Use representative path for conflict (actual patch paths are in patches1/patches2)
|
|
1834
1834
|
baseValue: f,
|
|
1835
|
-
input1Value:
|
|
1836
|
-
input2Value:
|
|
1835
|
+
input1Value: E,
|
|
1836
|
+
input2Value: S,
|
|
1837
1837
|
conflictType: g,
|
|
1838
1838
|
patches1: L,
|
|
1839
1839
|
// JSON Patch operations for base?input1 (contain actual paths with indices)
|
|
1840
|
-
patches2:
|
|
1840
|
+
patches2: N
|
|
1841
1841
|
// JSON Patch operations for base?input2 (contain actual paths with indices)
|
|
1842
1842
|
});
|
|
1843
1843
|
}
|
|
@@ -1849,99 +1849,99 @@ function Ur(e, t, r) {
|
|
|
1849
1849
|
if (i.length === 0)
|
|
1850
1850
|
return [];
|
|
1851
1851
|
const s = [], c = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), u = [];
|
|
1852
|
-
for (const
|
|
1853
|
-
const v =
|
|
1852
|
+
for (const N of i) {
|
|
1853
|
+
const v = N.path.match(/^(\/[^/]+(?:\/[^/]+)*)\/(\d+)(?:\/|$)/);
|
|
1854
1854
|
if (v) {
|
|
1855
1855
|
const h = v[1];
|
|
1856
1856
|
a.has(h) || a.set(h, []);
|
|
1857
1857
|
const m = a.get(h);
|
|
1858
|
-
m && m.push(
|
|
1858
|
+
m && m.push(N);
|
|
1859
1859
|
} else
|
|
1860
|
-
u.push(
|
|
1860
|
+
u.push(N);
|
|
1861
1861
|
}
|
|
1862
|
-
for (const [
|
|
1863
|
-
const h = W(e,
|
|
1862
|
+
for (const [N, v] of a) {
|
|
1863
|
+
const h = W(e, N), m = W(t, N);
|
|
1864
1864
|
if (!Array.isArray(h) || !Array.isArray(m)) {
|
|
1865
1865
|
const g = /* @__PURE__ */ new Map();
|
|
1866
1866
|
for (const b of v) {
|
|
1867
|
-
const
|
|
1868
|
-
if (
|
|
1869
|
-
const
|
|
1870
|
-
g.has(
|
|
1867
|
+
const j = b.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1868
|
+
if (j) {
|
|
1869
|
+
const T = j[1];
|
|
1870
|
+
g.has(T) || g.set(T, []), (y = g.get(T)) == null || y.push(b);
|
|
1871
1871
|
}
|
|
1872
1872
|
}
|
|
1873
|
-
for (const [b,
|
|
1874
|
-
s.push(...Ze(b,
|
|
1873
|
+
for (const [b, j] of g)
|
|
1874
|
+
s.push(...Ze(b, j, e, t, void 0)), c.add(b);
|
|
1875
1875
|
continue;
|
|
1876
1876
|
}
|
|
1877
|
-
const f = r ? qe(r,
|
|
1878
|
-
if (
|
|
1879
|
-
const g = $r(h, m,
|
|
1877
|
+
const f = r ? qe(r, N, e) : null, E = f != null && f.items ? Array.isArray(f.items) && f.items[0] ? f.items[0] : Array.isArray(f.items) ? null : f.items : null, S = E && typeof E == "object" ? E : null;
|
|
1878
|
+
if (S) {
|
|
1879
|
+
const g = $r(h, m, S), b = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map();
|
|
1880
1880
|
for (const [x, V] of g.entries())
|
|
1881
|
-
V.input1 !== void 0 && b.set(V.input1, x), V.input2 !== void 0 &&
|
|
1882
|
-
const
|
|
1881
|
+
V.input1 !== void 0 && b.set(V.input1, x), V.input2 !== void 0 && j.set(V.input2, x);
|
|
1882
|
+
const T = /* @__PURE__ */ new Map(), B = [];
|
|
1883
1883
|
for (const x of v) {
|
|
1884
1884
|
const V = x.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
|
|
1885
1885
|
if (V) {
|
|
1886
1886
|
const A = Number.parseInt(V[1], 10);
|
|
1887
1887
|
let w;
|
|
1888
|
-
if (x.op === "add" ? w =
|
|
1889
|
-
|
|
1890
|
-
const
|
|
1891
|
-
|
|
1888
|
+
if (x.op === "add" ? w = j.get(A) : w = b.get(A), w) {
|
|
1889
|
+
T.has(w) || T.set(w, []);
|
|
1890
|
+
const R = T.get(w);
|
|
1891
|
+
R && R.push(x);
|
|
1892
1892
|
} else
|
|
1893
1893
|
B.push(x);
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
|
-
for (const [x, V] of
|
|
1896
|
+
for (const [x, V] of T) {
|
|
1897
1897
|
const A = g.get(x);
|
|
1898
1898
|
if (!A) continue;
|
|
1899
|
-
const w = A.input1 !== void 0 ? `${
|
|
1899
|
+
const w = A.input1 !== void 0 ? `${N}/${A.input1}` : `${N}/${A.input2}`;
|
|
1900
1900
|
s.push(...Ze(w, V, e, t, void 0)), c.add(w);
|
|
1901
1901
|
}
|
|
1902
|
-
const
|
|
1902
|
+
const M = /* @__PURE__ */ new Map();
|
|
1903
1903
|
for (const x of B) {
|
|
1904
1904
|
const V = x.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1905
1905
|
if (V) {
|
|
1906
1906
|
const A = V[1];
|
|
1907
|
-
|
|
1907
|
+
M.has(A) || M.set(A, []), (p = M.get(A)) == null || p.push(x);
|
|
1908
1908
|
}
|
|
1909
1909
|
}
|
|
1910
|
-
for (const [x, V] of
|
|
1910
|
+
for (const [x, V] of M)
|
|
1911
1911
|
c.has(x) || (s.push(...Ze(x, V, e, t, void 0)), c.add(x));
|
|
1912
1912
|
} else {
|
|
1913
1913
|
const g = /* @__PURE__ */ new Map();
|
|
1914
1914
|
for (const b of v) {
|
|
1915
|
-
const
|
|
1916
|
-
if (
|
|
1917
|
-
const
|
|
1918
|
-
g.has(
|
|
1915
|
+
const j = b.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1916
|
+
if (j) {
|
|
1917
|
+
const T = j[1];
|
|
1918
|
+
g.has(T) || g.set(T, []), (d = g.get(T)) == null || d.push(b);
|
|
1919
1919
|
}
|
|
1920
1920
|
}
|
|
1921
|
-
for (const [b,
|
|
1922
|
-
s.push(...Ze(b,
|
|
1921
|
+
for (const [b, j] of g)
|
|
1922
|
+
s.push(...Ze(b, j, e, t, void 0)), c.add(b);
|
|
1923
1923
|
}
|
|
1924
1924
|
}
|
|
1925
1925
|
const l = /* @__PURE__ */ new Map();
|
|
1926
|
-
for (const
|
|
1927
|
-
const v =
|
|
1928
|
-
l.has(h) || l.set(h, []), (L = l.get(h)) == null || L.push(
|
|
1926
|
+
for (const N of u) {
|
|
1927
|
+
const v = N.path.split("/").filter(Boolean), h = v.length > 0 ? `/${v[0]}` : "/";
|
|
1928
|
+
l.has(h) || l.set(h, []), (L = l.get(h)) == null || L.push(N);
|
|
1929
1929
|
}
|
|
1930
|
-
for (const [
|
|
1931
|
-
s.push(...Ze(
|
|
1930
|
+
for (const [N, v] of l)
|
|
1931
|
+
s.push(...Ze(N, v, e, t, void 0));
|
|
1932
1932
|
return s;
|
|
1933
1933
|
}
|
|
1934
1934
|
function Ze(e, t, r, n, o) {
|
|
1935
1935
|
const i = o !== void 0 ? W(o, e) : void 0, s = W(r, e), c = W(n, e), a = [], u = [];
|
|
1936
1936
|
for (const f of t) {
|
|
1937
|
-
const
|
|
1938
|
-
let
|
|
1939
|
-
f.op === "add" ? (
|
|
1937
|
+
const E = f.path, S = W(r, E), g = W(n, E);
|
|
1938
|
+
let b = !1, j = !1;
|
|
1939
|
+
f.op === "add" ? (b = !1, j = g !== void 0) : f.op === "remove" ? (b = S !== void 0, j = !1) : f.op === "replace" && (b = S !== void 0 && !de(S, g), j = g !== void 0 && !de(S, g)), E === e && (b = !0, j = !0), b && a.push(f), j && u.push(f);
|
|
1940
1940
|
}
|
|
1941
|
-
if (a.length === 0 && u.length === 0 && i !== void 0 && s !== void 0 && c !== void 0 &&
|
|
1941
|
+
if (a.length === 0 && u.length === 0 && i !== void 0 && s !== void 0 && c !== void 0 && de(i, s) && de(i, c))
|
|
1942
1942
|
return [];
|
|
1943
|
-
const l = a.length > 0 ? a : t, y = u.length > 0 ? u : t, p = [...l, ...y], d = p.some((f) => f.op === "add"), L = p.some((f) => f.op === "remove"),
|
|
1944
|
-
if (d && !
|
|
1943
|
+
const l = a.length > 0 ? a : t, y = u.length > 0 ? u : t, p = [...l, ...y], d = p.some((f) => f.op === "add"), L = p.some((f) => f.op === "remove"), N = p.some((f) => f.op === "replace");
|
|
1944
|
+
if (d && !N && !L) {
|
|
1945
1945
|
if (s !== void 0 && c === void 0)
|
|
1946
1946
|
return [
|
|
1947
1947
|
{
|
|
@@ -1949,7 +1949,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1949
1949
|
baseValue: void 0,
|
|
1950
1950
|
input1Value: s,
|
|
1951
1951
|
input2Value: void 0,
|
|
1952
|
-
conflictType:
|
|
1952
|
+
conflictType: D.INPUT1_ONLY,
|
|
1953
1953
|
patches1: l,
|
|
1954
1954
|
// Highlight on input1 (new content) - use filtered patches1
|
|
1955
1955
|
patches2: []
|
|
@@ -1963,7 +1963,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1963
1963
|
baseValue: void 0,
|
|
1964
1964
|
input1Value: void 0,
|
|
1965
1965
|
input2Value: c,
|
|
1966
|
-
conflictType:
|
|
1966
|
+
conflictType: D.INPUT2_ONLY,
|
|
1967
1967
|
patches1: [],
|
|
1968
1968
|
// No highlighting on input1 (doesn't exist there)
|
|
1969
1969
|
patches2: y
|
|
@@ -1971,7 +1971,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
];
|
|
1973
1973
|
}
|
|
1974
|
-
if (L && !d && !
|
|
1974
|
+
if (L && !d && !N) {
|
|
1975
1975
|
if (s !== void 0 && c === void 0)
|
|
1976
1976
|
return [
|
|
1977
1977
|
{
|
|
@@ -1979,7 +1979,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1979
1979
|
baseValue: s,
|
|
1980
1980
|
input1Value: s,
|
|
1981
1981
|
input2Value: void 0,
|
|
1982
|
-
conflictType:
|
|
1982
|
+
conflictType: D.INPUT1_ONLY,
|
|
1983
1983
|
patches1: l,
|
|
1984
1984
|
// Highlight on input1 (removed content) - use filtered patches1
|
|
1985
1985
|
patches2: []
|
|
@@ -1993,7 +1993,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1993
1993
|
baseValue: c,
|
|
1994
1994
|
input1Value: void 0,
|
|
1995
1995
|
input2Value: c,
|
|
1996
|
-
conflictType:
|
|
1996
|
+
conflictType: D.INPUT2_ONLY,
|
|
1997
1997
|
patches1: [],
|
|
1998
1998
|
// No highlighting on input1 (doesn't exist there)
|
|
1999
1999
|
patches2: y
|
|
@@ -2004,16 +2004,16 @@ function Ze(e, t, r, n, o) {
|
|
|
2004
2004
|
const v = kt(i, s, c);
|
|
2005
2005
|
let h = [], m = [];
|
|
2006
2006
|
switch (v) {
|
|
2007
|
-
case
|
|
2007
|
+
case D.INPUT1_ONLY:
|
|
2008
2008
|
h = l, m = [];
|
|
2009
2009
|
break;
|
|
2010
|
-
case
|
|
2010
|
+
case D.INPUT2_ONLY:
|
|
2011
2011
|
h = [], m = y;
|
|
2012
2012
|
break;
|
|
2013
|
-
case
|
|
2013
|
+
case D.SAME_CHANGE:
|
|
2014
2014
|
h = l, m = y;
|
|
2015
2015
|
break;
|
|
2016
|
-
case
|
|
2016
|
+
case D.TRUE_CONFLICT:
|
|
2017
2017
|
h = l, m = y;
|
|
2018
2018
|
break;
|
|
2019
2019
|
}
|
|
@@ -2044,33 +2044,34 @@ function Vr(e, t, r, n) {
|
|
|
2044
2044
|
const o = [];
|
|
2045
2045
|
for (let y = 0; y < e.length; y++) {
|
|
2046
2046
|
const p = e[y];
|
|
2047
|
-
let d, L,
|
|
2048
|
-
(((i = p.patches1) == null ? void 0 : i.length) ?? 0) === 0 && (((s = p.patches2) == null ? void 0 : s.length) ?? 0) === 0 ? (d = t ? Pe(t, p.path) : { start: 1, end: 1 }, L = Pe(r, p.path),
|
|
2049
|
-
const v = p.conflictType ===
|
|
2047
|
+
let d, L, N;
|
|
2048
|
+
(((i = p.patches1) == null ? void 0 : i.length) ?? 0) === 0 && (((s = p.patches2) == null ? void 0 : s.length) ?? 0) === 0 ? (d = t ? Pe(t, p.path) : { start: 1, end: 1 }, L = Pe(r, p.path), N = Pe(n, p.path)) : (d = At(t, [...p.patches1 || [], ...p.patches2 || []]), L = At(r, p.patches1 || []), N = At(n, p.patches2 || []));
|
|
2049
|
+
const v = p.conflictType === D.TRUE_CONFLICT;
|
|
2050
2050
|
let h = te.excluded, m = te.excluded;
|
|
2051
2051
|
switch (p.conflictType) {
|
|
2052
|
-
case
|
|
2052
|
+
case D.SAME_CHANGE:
|
|
2053
2053
|
h = te.first, m = te.first;
|
|
2054
2054
|
break;
|
|
2055
|
-
case
|
|
2055
|
+
case D.INPUT1_ONLY:
|
|
2056
2056
|
h = te.first;
|
|
2057
2057
|
break;
|
|
2058
|
-
case
|
|
2058
|
+
case D.INPUT2_ONLY:
|
|
2059
2059
|
m = te.first;
|
|
2060
2060
|
break;
|
|
2061
|
-
case
|
|
2061
|
+
case D.TRUE_CONFLICT:
|
|
2062
2062
|
m = te.first;
|
|
2063
2063
|
break;
|
|
2064
2064
|
}
|
|
2065
|
-
const f = [],
|
|
2065
|
+
const f = [], E = [];
|
|
2066
2066
|
if (p.patches1 && (p.patches1.length ?? 0) > 0)
|
|
2067
2067
|
for (const g of p.patches1) {
|
|
2068
|
-
|
|
2068
|
+
const b = !t || t.trim() === "";
|
|
2069
|
+
if (g.op === "remove" && !b)
|
|
2069
2070
|
continue;
|
|
2070
|
-
const
|
|
2071
|
-
if (
|
|
2072
|
-
for (let
|
|
2073
|
-
f.push({ line:
|
|
2071
|
+
const j = Pe(r, g.path);
|
|
2072
|
+
if (j.start !== 1 || j.end !== 1)
|
|
2073
|
+
for (let T = j.start; T <= j.end; T++)
|
|
2074
|
+
f.push({ line: T });
|
|
2074
2075
|
}
|
|
2075
2076
|
else if ((((c = p.patches1) == null ? void 0 : c.length) ?? 0) === 0 && (((a = p.patches2) == null ? void 0 : a.length) ?? 0) === 0) {
|
|
2076
2077
|
const g = Pe(r, p.path);
|
|
@@ -2082,14 +2083,14 @@ function Vr(e, t, r, n) {
|
|
|
2082
2083
|
continue;
|
|
2083
2084
|
const b = Pe(n, g.path);
|
|
2084
2085
|
if (b.start !== 1 || b.end !== 1)
|
|
2085
|
-
for (let
|
|
2086
|
-
|
|
2086
|
+
for (let j = b.start; j <= b.end; j++)
|
|
2087
|
+
E.push({ line: j });
|
|
2087
2088
|
}
|
|
2088
2089
|
else if ((((u = p.patches1) == null ? void 0 : u.length) ?? 0) === 0 && (((l = p.patches2) == null ? void 0 : l.length) ?? 0) === 0) {
|
|
2089
2090
|
const g = Pe(n, p.path);
|
|
2090
|
-
(g.start !== 1 || g.end !== 1) &&
|
|
2091
|
+
(g.start !== 1 || g.end !== 1) && E.push({ line: g.start });
|
|
2091
2092
|
}
|
|
2092
|
-
const
|
|
2093
|
+
const S = {
|
|
2093
2094
|
id: `conflict-${y}`,
|
|
2094
2095
|
path: p.path,
|
|
2095
2096
|
// Include path for value extraction during resolution
|
|
@@ -2102,19 +2103,19 @@ function Vr(e, t, r, n) {
|
|
|
2102
2103
|
endLineNumberExclusive: L.end + 1
|
|
2103
2104
|
},
|
|
2104
2105
|
input2Range: {
|
|
2105
|
-
startLineNumber:
|
|
2106
|
-
endLineNumberExclusive:
|
|
2106
|
+
startLineNumber: N.start,
|
|
2107
|
+
endLineNumberExclusive: N.end + 1
|
|
2107
2108
|
},
|
|
2108
2109
|
input1Diffs: f,
|
|
2109
|
-
input2Diffs:
|
|
2110
|
+
input2Diffs: E,
|
|
2110
2111
|
isConflicting: v,
|
|
2111
2112
|
conflictType: p.conflictType,
|
|
2112
2113
|
input1State: h,
|
|
2113
2114
|
input2State: m,
|
|
2114
|
-
handled: p.conflictType ===
|
|
2115
|
+
handled: p.conflictType === D.SAME_CHANGE,
|
|
2115
2116
|
focused: !1
|
|
2116
2117
|
};
|
|
2117
|
-
o.push(
|
|
2118
|
+
o.push(S);
|
|
2118
2119
|
}
|
|
2119
2120
|
return o;
|
|
2120
2121
|
}
|
|
@@ -2136,12 +2137,12 @@ function Jr(e, t, r, n = {}) {
|
|
|
2136
2137
|
}), y.forEach((d) => {
|
|
2137
2138
|
p.add(d.path);
|
|
2138
2139
|
}), u = Array.from(p).map((d) => {
|
|
2139
|
-
const L = W(s, d),
|
|
2140
|
+
const L = W(s, d), N = W(c, d), v = W(a, d), h = !de(L, N), m = !de(N, v);
|
|
2140
2141
|
let f;
|
|
2141
|
-
return h && m ? f =
|
|
2142
|
+
return h && m ? f = D.TRUE_CONFLICT : h ? f = D.INPUT1_ONLY : m ? f = D.INPUT2_ONLY : f = D.SAME_CHANGE, {
|
|
2142
2143
|
path: d,
|
|
2143
2144
|
baseValue: L,
|
|
2144
|
-
input1Value:
|
|
2145
|
+
input1Value: N,
|
|
2145
2146
|
input2Value: v,
|
|
2146
2147
|
conflictType: f
|
|
2147
2148
|
};
|
|
@@ -2156,20 +2157,20 @@ function Jr(e, t, r, n = {}) {
|
|
|
2156
2157
|
function Hr(e, t, r) {
|
|
2157
2158
|
const n = e !== t, o = e !== r;
|
|
2158
2159
|
let i;
|
|
2159
|
-
return n && o ? t === r ? i =
|
|
2160
|
+
return n && o ? t === r ? i = D.SAME_CHANGE : i = D.TRUE_CONFLICT : n ? i = D.INPUT1_ONLY : i = D.INPUT2_ONLY, { conflictType: i, input1Changed: n, input2Changed: o };
|
|
2160
2161
|
}
|
|
2161
2162
|
function no(e, t, r) {
|
|
2162
2163
|
var u, l, y;
|
|
2163
2164
|
const n = [], o = [];
|
|
2164
2165
|
for (let p = 0; p < Math.max(e.length, t.length, r.length); p++) {
|
|
2165
|
-
const d = e[p] !== void 0 ? e[p] : "", L = t[p] !== void 0 ? t[p] : "",
|
|
2166
|
+
const d = e[p] !== void 0 ? e[p] : "", L = t[p] !== void 0 ? t[p] : "", N = r[p] !== void 0 ? r[p] : "", { conflictType: v, input1Changed: h, input2Changed: m } = Hr(d, L, N);
|
|
2166
2167
|
(h || m) && o.push({
|
|
2167
2168
|
line: p + 1,
|
|
2168
2169
|
input1Changed: h,
|
|
2169
2170
|
input2Changed: m,
|
|
2170
2171
|
baseLine: d,
|
|
2171
2172
|
input1Line: L,
|
|
2172
|
-
input2Line:
|
|
2173
|
+
input2Line: N,
|
|
2173
2174
|
conflictType: v
|
|
2174
2175
|
});
|
|
2175
2176
|
}
|
|
@@ -2177,9 +2178,9 @@ function no(e, t, r) {
|
|
|
2177
2178
|
return [];
|
|
2178
2179
|
let i = ((u = o[0]) == null ? void 0 : u.line) ?? 1, s = (l = o[0]) == null ? void 0 : l.conflictType, c = [], a = [];
|
|
2179
2180
|
for (let p = 0; p <= o.length; p++) {
|
|
2180
|
-
const d = o[p], L = p === o.length,
|
|
2181
|
-
if (L ||
|
|
2182
|
-
const h = o[p - 1], m = h ? h.line + 1 : i + 1, f = c.length > 0,
|
|
2181
|
+
const d = o[p], L = p === o.length, N = !L && d && o[p - 1] && d.line > (((y = o[p - 1]) == null ? void 0 : y.line) ?? 0) + 1, v = !L && d && d.conflictType !== s;
|
|
2182
|
+
if (L || N || v) {
|
|
2183
|
+
const h = o[p - 1], m = h ? h.line + 1 : i + 1, f = c.length > 0, E = a.length > 0, S = s === D.TRUE_CONFLICT, g = {
|
|
2183
2184
|
id: `conflict-${n.length}`,
|
|
2184
2185
|
baseRange: {
|
|
2185
2186
|
startLineNumber: i,
|
|
@@ -2195,12 +2196,12 @@ function no(e, t, r) {
|
|
|
2195
2196
|
},
|
|
2196
2197
|
input1Diffs: c,
|
|
2197
2198
|
input2Diffs: a,
|
|
2198
|
-
isConflicting:
|
|
2199
|
+
isConflicting: S,
|
|
2199
2200
|
conflictType: s,
|
|
2200
2201
|
// Default: accept input2 (ours) by default, or both if same change
|
|
2201
|
-
input1State: s ===
|
|
2202
|
-
input2State:
|
|
2203
|
-
handled: s ===
|
|
2202
|
+
input1State: s === D.SAME_CHANGE && f ? te.first : te.excluded,
|
|
2203
|
+
input2State: E ? te.first : te.excluded,
|
|
2204
|
+
handled: s === D.SAME_CHANGE,
|
|
2204
2205
|
focused: !1
|
|
2205
2206
|
};
|
|
2206
2207
|
n.push(g), !L && d && (i = d.line, s = d.conflictType, c = [], a = []);
|
|
@@ -2289,7 +2290,7 @@ function mn(e, t, r, n = "") {
|
|
|
2289
2290
|
return null;
|
|
2290
2291
|
}
|
|
2291
2292
|
function qr(e, t, r, n, o) {
|
|
2292
|
-
var
|
|
2293
|
+
var S;
|
|
2293
2294
|
const i = [], s = [], c = e.join(`
|
|
2294
2295
|
`), a = t.join(`
|
|
2295
2296
|
`), u = r.join(`
|
|
@@ -2307,98 +2308,98 @@ function qr(e, t, r, n, o) {
|
|
|
2307
2308
|
}
|
|
2308
2309
|
let d;
|
|
2309
2310
|
!l || typeof l == "object" && l !== null && Object.keys(l).length === 0 ? d = JSON.parse(JSON.stringify(p)) : d = JSON.parse(JSON.stringify(l));
|
|
2310
|
-
const L = /* @__PURE__ */ new Set(),
|
|
2311
|
+
const L = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set(), h = (g, b, j) => null;
|
|
2311
2312
|
for (const g of n) {
|
|
2312
|
-
const b = g.input1State === te.first || g.input1State === te.second,
|
|
2313
|
-
let
|
|
2314
|
-
if (!
|
|
2315
|
-
g.conflictType ===
|
|
2313
|
+
const b = g.input1State === te.first || g.input1State === te.second, j = g.input2State === te.first || g.input2State === te.second;
|
|
2314
|
+
let T = g.path;
|
|
2315
|
+
if (!T && (T = h(g.baseRange.startLineNumber, g.baseRange.endLineNumberExclusive) || void 0, !T)) {
|
|
2316
|
+
g.conflictType === D.INPUT2_ONLY && j ? d = JSON.parse(JSON.stringify(p)) : g.conflictType === D.INPUT1_ONLY && b ? d = JSON.parse(JSON.stringify(y)) : g.conflictType === D.SAME_CHANGE && (b || j) || j ? d = JSON.parse(JSON.stringify(p)) : b && (d = JSON.parse(JSON.stringify(y)));
|
|
2316
2317
|
continue;
|
|
2317
2318
|
}
|
|
2318
2319
|
try {
|
|
2319
|
-
let B,
|
|
2320
|
-
const x = (
|
|
2320
|
+
let B, M = T;
|
|
2321
|
+
const x = (S = g.path) == null ? void 0 : S.match(/^(.*\/\d+)(?:\/.*)?$/);
|
|
2321
2322
|
let V = !1, A = "";
|
|
2322
2323
|
if (x) {
|
|
2323
|
-
const
|
|
2324
|
-
if (
|
|
2325
|
-
const X =
|
|
2326
|
-
/^\d+$/.test(X) && (V = !0, A = `/${
|
|
2324
|
+
const R = x[1].split("/").filter((X) => X !== "");
|
|
2325
|
+
if (R.length >= 2) {
|
|
2326
|
+
const X = R[R.length - 1];
|
|
2327
|
+
/^\d+$/.test(X) && (V = !0, A = `/${R.slice(0, -1).join("/")}`);
|
|
2327
2328
|
}
|
|
2328
2329
|
}
|
|
2329
|
-
if (b &&
|
|
2330
|
-
if (g.conflictType ===
|
|
2331
|
-
V ? (B = W(p, A),
|
|
2330
|
+
if (b && j)
|
|
2331
|
+
if (g.conflictType === D.SAME_CHANGE)
|
|
2332
|
+
V ? (B = W(p, A), M = A) : B = W(p, T);
|
|
2332
2333
|
else {
|
|
2333
|
-
const w = V ? A :
|
|
2334
|
-
ae !== null ? (B = ae,
|
|
2334
|
+
const w = V ? A : T, R = W(y, w), X = W(p, w), ne = o && l && typeof l == "object" && qe(o, w, l) || void 0, ae = mn(R, X, ne, w);
|
|
2335
|
+
ae !== null ? (B = ae, M = w, i.push(`Smart-merged conflict at path ${w}`)) : (B = X, M = w, i.push(`Merge failed at path ${w}, using input2 value`));
|
|
2335
2336
|
}
|
|
2336
2337
|
else if (b)
|
|
2337
2338
|
if (V)
|
|
2338
|
-
B = W(y, A),
|
|
2339
|
+
B = W(y, A), M = A;
|
|
2339
2340
|
else {
|
|
2340
|
-
const w =
|
|
2341
|
+
const w = T.split("/").filter(Boolean);
|
|
2341
2342
|
if (w.length > 1) {
|
|
2342
|
-
const
|
|
2343
|
-
if (!v.has(
|
|
2344
|
-
const X = W(y,
|
|
2343
|
+
const R = `/${w.slice(0, -1).join("/")}`;
|
|
2344
|
+
if (!v.has(R)) {
|
|
2345
|
+
const X = W(y, R);
|
|
2345
2346
|
if (typeof X == "object" && X !== null && !Array.isArray(X)) {
|
|
2346
|
-
const ne = W(d,
|
|
2347
|
+
const ne = W(d, R);
|
|
2347
2348
|
if (typeof ne == "object" && ne !== null && !Array.isArray(ne)) {
|
|
2348
|
-
for (const [ae,
|
|
2349
|
-
const
|
|
2350
|
-
|
|
2349
|
+
for (const [ae, me] of Object.entries(X)) {
|
|
2350
|
+
const je = `${R}/${ae}`;
|
|
2351
|
+
N.has(je) || (ne[ae] = me);
|
|
2351
2352
|
}
|
|
2352
|
-
v.add(
|
|
2353
|
+
v.add(R);
|
|
2353
2354
|
}
|
|
2354
2355
|
}
|
|
2355
2356
|
}
|
|
2356
|
-
B = W(y,
|
|
2357
|
+
B = W(y, T);
|
|
2357
2358
|
} else
|
|
2358
|
-
B = W(y,
|
|
2359
|
+
B = W(y, T);
|
|
2359
2360
|
}
|
|
2360
|
-
else if (
|
|
2361
|
+
else if (j)
|
|
2361
2362
|
if (V)
|
|
2362
|
-
B = W(p, A),
|
|
2363
|
+
B = W(p, A), M = A;
|
|
2363
2364
|
else {
|
|
2364
|
-
const w =
|
|
2365
|
+
const w = T.split("/").filter(Boolean);
|
|
2365
2366
|
if (w.length > 1) {
|
|
2366
|
-
const
|
|
2367
|
-
if (!v.has(
|
|
2368
|
-
const X = W(p,
|
|
2367
|
+
const R = `/${w.slice(0, -1).join("/")}`;
|
|
2368
|
+
if (!v.has(R)) {
|
|
2369
|
+
const X = W(p, R);
|
|
2369
2370
|
if (typeof X == "object" && X !== null && !Array.isArray(X)) {
|
|
2370
|
-
const ne = W(d,
|
|
2371
|
+
const ne = W(d, R);
|
|
2371
2372
|
if (typeof ne == "object" && ne !== null && !Array.isArray(ne)) {
|
|
2372
|
-
for (const [ae,
|
|
2373
|
-
const
|
|
2374
|
-
|
|
2373
|
+
for (const [ae, me] of Object.entries(X)) {
|
|
2374
|
+
const je = `${R}/${ae}`;
|
|
2375
|
+
N.has(je) || (ne[ae] = me);
|
|
2375
2376
|
}
|
|
2376
|
-
v.add(
|
|
2377
|
+
v.add(R);
|
|
2377
2378
|
}
|
|
2378
2379
|
}
|
|
2379
2380
|
}
|
|
2380
|
-
B = W(p,
|
|
2381
|
+
B = W(p, T);
|
|
2381
2382
|
} else
|
|
2382
|
-
B = W(p,
|
|
2383
|
+
B = W(p, T);
|
|
2383
2384
|
}
|
|
2384
2385
|
else {
|
|
2385
|
-
const w = V ? A :
|
|
2386
|
-
if (
|
|
2387
|
-
B =
|
|
2386
|
+
const w = V ? A : T, R = W(l, w);
|
|
2387
|
+
if (R !== void 0)
|
|
2388
|
+
B = R, M = w;
|
|
2388
2389
|
else
|
|
2389
2390
|
continue;
|
|
2390
2391
|
}
|
|
2391
|
-
B !== void 0 && (Gr(d,
|
|
2392
|
+
B !== void 0 && (Gr(d, M, B), L.add(M), N.add(M));
|
|
2392
2393
|
} catch (B) {
|
|
2393
|
-
i.push(`Failed to apply conflict at path ${
|
|
2394
|
+
i.push(`Failed to apply conflict at path ${T || g.id}: ${B instanceof Error ? B.message : String(B)}`);
|
|
2394
2395
|
}
|
|
2395
2396
|
}
|
|
2396
2397
|
const m = JSON.stringify(d, null, 2);
|
|
2397
2398
|
for (const g of n) {
|
|
2398
2399
|
const b = g.path;
|
|
2399
2400
|
if (!b) continue;
|
|
2400
|
-
const
|
|
2401
|
-
if (
|
|
2401
|
+
const j = g.input1State === te.first || g.input1State === te.second, T = g.input2State === te.first || g.input2State === te.second;
|
|
2402
|
+
if (j && T && g.conflictType === D.TRUE_CONFLICT) {
|
|
2402
2403
|
const B = Wr(m, b);
|
|
2403
2404
|
B && s.push({
|
|
2404
2405
|
conflictId: g.id,
|
|
@@ -2410,15 +2411,15 @@ function qr(e, t, r, n, o) {
|
|
|
2410
2411
|
});
|
|
2411
2412
|
}
|
|
2412
2413
|
}
|
|
2413
|
-
let f = !0,
|
|
2414
|
+
let f = !0, E;
|
|
2414
2415
|
try {
|
|
2415
2416
|
JSON.parse(m);
|
|
2416
2417
|
} catch (g) {
|
|
2417
|
-
f = !1,
|
|
2418
|
+
f = !1, E = g instanceof Error ? g.message : "Invalid JSON", s.push({
|
|
2418
2419
|
conflictId: "validation-error",
|
|
2419
2420
|
conflictPath: "/",
|
|
2420
2421
|
type: "error",
|
|
2421
|
-
message:
|
|
2422
|
+
message: E,
|
|
2422
2423
|
startLine: 1,
|
|
2423
2424
|
endLine: m.split(`
|
|
2424
2425
|
`).length
|
|
@@ -2427,7 +2428,7 @@ function qr(e, t, r, n, o) {
|
|
|
2427
2428
|
return {
|
|
2428
2429
|
content: m,
|
|
2429
2430
|
isValid: f,
|
|
2430
|
-
validationError:
|
|
2431
|
+
validationError: E,
|
|
2431
2432
|
warnings: i.length > 0 ? i : void 0,
|
|
2432
2433
|
conflictIssues: s.length > 0 ? s : void 0
|
|
2433
2434
|
};
|
|
@@ -2435,19 +2436,19 @@ function qr(e, t, r, n, o) {
|
|
|
2435
2436
|
function Yr(e, t, r) {
|
|
2436
2437
|
let n = "", o = "", i = "", s = "", c = "", a = "", u = "", l = "";
|
|
2437
2438
|
switch (e.conflictType) {
|
|
2438
|
-
case
|
|
2439
|
+
case D.SAME_CHANGE: {
|
|
2439
2440
|
const y = e.baseRange.startLineNumber === 1 && e.baseRange.endLineNumberExclusive === 2 && // Default "not found" range
|
|
2440
2441
|
e.input1Range.startLineNumber !== 1 && e.input2Range.startLineNumber !== 1;
|
|
2441
2442
|
t ? y ? (n = "merge-2way-deletion", o = "merge-same-change", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "", u = "-", l = "+") : (n = "merge-2way-deletion", o = "merge-same-change", i = "merge-change-base", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "", u = "-", l = "") : y ? (n = "merge-same-change", o = "merge-same-change", i = "", s = r.changeOverviewColor, c = r.changeOverviewColor, a = "", u = "+", l = "+") : (n = "merge-change-incoming", o = "merge-same-change", i = "merge-change-base", s = r.changeOverviewColor, c = r.changeOverviewColor, a = r.baseOverviewColor, u = "", l = "");
|
|
2442
2443
|
break;
|
|
2443
2444
|
}
|
|
2444
|
-
case
|
|
2445
|
+
case D.INPUT1_ONLY:
|
|
2445
2446
|
t ? (n = "merge-2way-deletion", o = "", s = r.baseOverviewColor, c = "", u = "-", l = "") : (n = "merge-change-incoming", o = "", i = "merge-change-base", s = r.conflictOverviewColor, c = "", a = r.baseOverviewColor, u = "-", l = "");
|
|
2446
2447
|
break;
|
|
2447
|
-
case
|
|
2448
|
+
case D.INPUT2_ONLY:
|
|
2448
2449
|
n = "", o = "merge-change-current", i = t ? "" : "merge-change-base", s = "", c = r.changeOverviewColor, a = t ? "" : r.baseOverviewColor, u = "", l = "+";
|
|
2449
2450
|
break;
|
|
2450
|
-
case
|
|
2451
|
+
case D.TRUE_CONFLICT: {
|
|
2451
2452
|
const y = e.baseRange.startLineNumber === 1 && e.baseRange.endLineNumberExclusive === 2 && // Default "not found" range
|
|
2452
2453
|
e.input1Range.startLineNumber !== 1 && e.input2Range.startLineNumber !== 1;
|
|
2453
2454
|
t ? y ? (n = "merge-2way-deletion", o = "merge-change-current", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "", u = "-", l = "+") : (n = "merge-2way-deletion", o = "merge-conflict-current", i = "merge-conflict-base", s = r.baseOverviewColor, c = r.conflictOverviewColor, a = r.baseOverviewColor, u = "-", l = "+") : y ? (n = "merge-change-incoming", o = "merge-change-current", i = "", s = r.changeOverviewColor, c = r.changeOverviewColor, a = "", u = "+", l = "+") : (n = "merge-conflict-incoming", o = "merge-conflict-current", i = "merge-conflict-base", s = r.conflictOverviewColor, c = r.conflictOverviewColor, a = r.baseOverviewColor, u = "", l = "");
|
|
@@ -2476,25 +2477,46 @@ function yn(e) {
|
|
|
2476
2477
|
}
|
|
2477
2478
|
function zr(e, t, r) {
|
|
2478
2479
|
const n = [];
|
|
2479
|
-
if (
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2480
|
+
if (t.input1Class) {
|
|
2481
|
+
if (e.input1Diffs.length > 0) {
|
|
2482
|
+
const o = yn(e.input1Diffs);
|
|
2483
|
+
for (const i of o)
|
|
2484
|
+
n.push({
|
|
2485
|
+
range: new r.Range(i, 1, i, Number.MAX_SAFE_INTEGER),
|
|
2486
|
+
options: {
|
|
2487
|
+
isWholeLine: !0,
|
|
2488
|
+
className: t.input1Class,
|
|
2489
|
+
linesDecorationsClassName: t.input1Symbol && t.input1Symbol !== "" ? `diff-symbol diff-symbol-${t.input1Symbol === "+" ? "plus" : "minus"}` : void 0,
|
|
2490
|
+
overviewRuler: t.input1OverviewColor ? {
|
|
2491
|
+
color: t.input1OverviewColor,
|
|
2492
|
+
position: r.editor.OverviewRulerLane.Full
|
|
2493
|
+
} : void 0,
|
|
2494
|
+
minimap: t.input1OverviewColor ? {
|
|
2495
|
+
color: t.input1OverviewColor,
|
|
2496
|
+
position: r.editor.MinimapPosition.Inline
|
|
2497
|
+
} : void 0
|
|
2498
|
+
}
|
|
2499
|
+
});
|
|
2500
|
+
} else if (e.conflictType === D.INPUT1_ONLY) {
|
|
2501
|
+
const o = e.input1Range.startLineNumber, i = e.input1Range.endLineNumberExclusive - 1;
|
|
2502
|
+
for (let s = o; s <= i; s++)
|
|
2503
|
+
n.push({
|
|
2504
|
+
range: new r.Range(s, 1, s, Number.MAX_SAFE_INTEGER),
|
|
2505
|
+
options: {
|
|
2506
|
+
isWholeLine: !0,
|
|
2507
|
+
className: t.input1Class,
|
|
2508
|
+
linesDecorationsClassName: t.input1Symbol && t.input1Symbol !== "" ? `diff-symbol diff-symbol-${t.input1Symbol === "+" ? "plus" : "minus"}` : void 0,
|
|
2509
|
+
overviewRuler: t.input1OverviewColor ? {
|
|
2510
|
+
color: t.input1OverviewColor,
|
|
2511
|
+
position: r.editor.OverviewRulerLane.Full
|
|
2512
|
+
} : void 0,
|
|
2513
|
+
minimap: t.input1OverviewColor ? {
|
|
2514
|
+
color: t.input1OverviewColor,
|
|
2515
|
+
position: r.editor.MinimapPosition.Inline
|
|
2516
|
+
} : void 0
|
|
2517
|
+
}
|
|
2518
|
+
});
|
|
2519
|
+
}
|
|
2498
2520
|
}
|
|
2499
2521
|
return n;
|
|
2500
2522
|
}
|
|
@@ -2553,7 +2575,7 @@ function Zr(e, t, r, n) {
|
|
|
2553
2575
|
baseDecorations: Qr(e, o, n)
|
|
2554
2576
|
};
|
|
2555
2577
|
}
|
|
2556
|
-
function
|
|
2578
|
+
function Cr(e, t, r, n) {
|
|
2557
2579
|
const o = [], i = [], s = [];
|
|
2558
2580
|
for (const c of e) {
|
|
2559
2581
|
const a = Zr(c, t, r, n);
|
|
@@ -2565,7 +2587,7 @@ function Kr(e, t, r, n) {
|
|
|
2565
2587
|
baseDecorations: s
|
|
2566
2588
|
};
|
|
2567
2589
|
}
|
|
2568
|
-
const
|
|
2590
|
+
const Kr = () => /* @__PURE__ */ st("div", { style: { padding: "20px", textAlign: "center", color: "#888" }, children: "Loading Monaco Editor..." }), Nt = "⚠";
|
|
2569
2591
|
function ro(e) {
|
|
2570
2592
|
const {
|
|
2571
2593
|
original: t = "",
|
|
@@ -2582,38 +2604,38 @@ function ro(e) {
|
|
|
2582
2604
|
showResultColumn: p,
|
|
2583
2605
|
baseIndex: d = 1,
|
|
2584
2606
|
comparisonMode: L = "split",
|
|
2585
|
-
schema:
|
|
2607
|
+
schema: N,
|
|
2586
2608
|
patches: v,
|
|
2587
2609
|
labels: h
|
|
2588
|
-
} = e, m = n ? p : !1, f = !n || n === "",
|
|
2610
|
+
} = e, m = n ? p : !1, f = !n || n === "", E = "json", [S, g] = _e(!1), [b, j] = _e(!0), [T, B] = _e([]), [M, x] = _e(null), [V, A] = _e([]), [w, R] = _e([]), [X, ne] = _e(!1), ae = le(""), me = Ee((k, O, I, $) => {
|
|
2589
2611
|
const P = document.createElement("div");
|
|
2590
2612
|
P.className = "native-checkbox-container";
|
|
2591
2613
|
const U = document.createElement("input");
|
|
2592
|
-
return U.type = "checkbox", U.className = "native-checkbox", U.checked =
|
|
2614
|
+
return U.type = "checkbox", U.className = "native-checkbox", U.checked = k === te.first || k === te.second, U.setAttribute("aria-label", U.checked ? "Undo accept" : "Accept change"), U.addEventListener("click", (Q) => {
|
|
2593
2615
|
Q.preventDefault(), Q.stopPropagation(), requestAnimationFrame(() => {
|
|
2594
2616
|
$();
|
|
2595
2617
|
});
|
|
2596
2618
|
}), P.appendChild(U), P;
|
|
2597
|
-
}, []), [
|
|
2619
|
+
}, []), [je, Te] = _e(0), C = le(null), ie = le(null), ee = le(null), F = le(null), fe = le(null), Ie = le(null), De = le(!1), gt = le(!1), $e = le(null), Ye = le(null), ke = le(null), Be = le(/* @__PURE__ */ new Map()), Le = le(null), Fe = le(null), Ue = le(null), Ve = le(null);
|
|
2598
2620
|
Se(() => {
|
|
2599
|
-
let
|
|
2621
|
+
let k = !0;
|
|
2600
2622
|
const O = ur.init();
|
|
2601
2623
|
return O.then((I) => {
|
|
2602
|
-
|
|
2624
|
+
k && (fe.current = I, j(!1), g(!0));
|
|
2603
2625
|
}).catch((I) => {
|
|
2604
|
-
|
|
2626
|
+
k && (I == null ? void 0 : I.type) !== "cancelation" && console.error("Monaco initialization: error:", I);
|
|
2605
2627
|
}), () => {
|
|
2606
|
-
|
|
2628
|
+
k = !1, De.current || O.cancel();
|
|
2607
2629
|
};
|
|
2608
2630
|
}, []);
|
|
2609
2631
|
const xt = Ee(
|
|
2610
|
-
(
|
|
2632
|
+
(k, O, I) => {
|
|
2611
2633
|
if (!fe.current) return [];
|
|
2612
|
-
const $ = (
|
|
2634
|
+
const $ = (k == null ? void 0 : k.getValue()) || "", P = O.getValue(), U = I.getValue();
|
|
2613
2635
|
try {
|
|
2614
2636
|
const Q = performance.now(), Y = Jr($, P, U, {
|
|
2615
2637
|
comparisonMode: L,
|
|
2616
|
-
schema:
|
|
2638
|
+
schema: N,
|
|
2617
2639
|
patches: v
|
|
2618
2640
|
}), _ = performance.now() - Q;
|
|
2619
2641
|
return _ > 100 && console.warn(`JSON Patch diff took ${_.toFixed(2)}ms`), Y;
|
|
@@ -2622,21 +2644,21 @@ function ro(e) {
|
|
|
2622
2644
|
return console.error("JSON Patch diff error:", Y), [];
|
|
2623
2645
|
}
|
|
2624
2646
|
},
|
|
2625
|
-
[L,
|
|
2626
|
-
), ze = Ee((
|
|
2647
|
+
[L, N, v]
|
|
2648
|
+
), ze = Ee((k) => {
|
|
2627
2649
|
try {
|
|
2628
|
-
return
|
|
2650
|
+
return k.getLayoutInfo().decorationsLeft || 0;
|
|
2629
2651
|
} catch {
|
|
2630
2652
|
return 0;
|
|
2631
2653
|
}
|
|
2632
|
-
}, []), Xe = Ee((
|
|
2654
|
+
}, []), Xe = Ee((k) => {
|
|
2633
2655
|
try {
|
|
2634
|
-
return
|
|
2656
|
+
return k.getLayoutInfo().decorationsWidth || 0;
|
|
2635
2657
|
} catch {
|
|
2636
2658
|
return 0;
|
|
2637
2659
|
}
|
|
2638
2660
|
}, []), nt = Ee(
|
|
2639
|
-
(
|
|
2661
|
+
(k) => {
|
|
2640
2662
|
if (!m || !F.current || !ke.current)
|
|
2641
2663
|
return;
|
|
2642
2664
|
const O = fe.current;
|
|
@@ -2646,7 +2668,7 @@ function ro(e) {
|
|
|
2646
2668
|
const U = F.current.getScrollTop();
|
|
2647
2669
|
if (F.current.getModel()) {
|
|
2648
2670
|
ke.current.innerHTML = "";
|
|
2649
|
-
for (const Y of
|
|
2671
|
+
for (const Y of k) {
|
|
2650
2672
|
const _ = Y.startLine, ue = Y.endLine, Z = F.current.getTopForLineNumber(_) - U, H = F.current.getTopForLineNumber(ue) - U, J = F.current.getOption(O.editor.EditorOption.lineHeight), re = ue > _ ? H - Z + J : J, G = document.createElement("div");
|
|
2651
2673
|
G.className = `conflict-issue-marker conflict-issue-${Y.type}`, G.setAttribute("data-conflict-id", Y.conflictId), G.setAttribute("data-issue-type", Y.type), G.title = Y.message, G.style.position = "absolute", G.style.top = `${Math.max(0, Z)}px`, G.style.height = `${re}px`, G.style.width = "26px", G.style.display = "flex", G.style.alignItems = "center", G.style.justifyContent = "center", G.style.cursor = "help", G.style.pointerEvents = "auto";
|
|
2652
2674
|
const oe = document.createElement("div");
|
|
@@ -2656,15 +2678,15 @@ function ro(e) {
|
|
|
2656
2678
|
},
|
|
2657
2679
|
[m, o, ze, Xe]
|
|
2658
2680
|
), rt = Ee(
|
|
2659
|
-
(
|
|
2681
|
+
(k) => {
|
|
2660
2682
|
var se, re, G, oe;
|
|
2661
2683
|
if (!F.current || X)
|
|
2662
2684
|
return;
|
|
2663
|
-
const O = F.current.getModel(), I = (se =
|
|
2685
|
+
const O = F.current.getModel(), I = (se = C.current) == null ? void 0 : se.getModel(), $ = (re = ee.current) == null ? void 0 : re.getModel(), P = (G = ie.current) == null ? void 0 : G.getModel();
|
|
2664
2686
|
if (!O || !I || !$ || !P)
|
|
2665
2687
|
return;
|
|
2666
|
-
const U = P.getLinesContent(), Q = I.getLinesContent(), Y = $.getLinesContent(), _ = qr(U, Q, Y,
|
|
2667
|
-
if (x(_.isValid ? null : _.validationError || "Invalid JSON"), A(_.warnings || []),
|
|
2688
|
+
const U = P.getLinesContent(), Q = I.getLinesContent(), Y = $.getLinesContent(), _ = qr(U, Q, Y, k, N);
|
|
2689
|
+
if (x(_.isValid ? null : _.validationError || "Invalid JSON"), A(_.warnings || []), R(_.conflictIssues || []), Le.current) {
|
|
2668
2690
|
const z = (h == null ? void 0 : h.result) || "Result";
|
|
2669
2691
|
_.isValid ? _.warnings && _.warnings.length > 0 ? (Le.current.textContent = `${z} ${Nt}`, Le.current.title = _.warnings.join(`
|
|
2670
2692
|
`)) : (Le.current.textContent = z, Le.current.style.color = "", Le.current.title = "") : (Le.current.textContent = `${z} ${Nt} Invalid JSON`, Le.current.style.color = "#ff4444", Le.current.title = _.validationError || "Invalid JSON - please fix manually");
|
|
@@ -2672,9 +2694,9 @@ function ro(e) {
|
|
|
2672
2694
|
if (O.getValue() !== _.content) {
|
|
2673
2695
|
const z = F.current.getPosition(), q = F.current.getSelection();
|
|
2674
2696
|
if (gt.current = !0, O.setValue(_.content), gt.current = !1, z) {
|
|
2675
|
-
const
|
|
2676
|
-
lineNumber: Math.min(z.lineNumber,
|
|
2677
|
-
column: z.lineNumber <=
|
|
2697
|
+
const he = O.getLineCount(), K = O.getLineLength(he), ve = {
|
|
2698
|
+
lineNumber: Math.min(z.lineNumber, he),
|
|
2699
|
+
column: z.lineNumber <= he ? Math.min(z.column, O.getLineLength(z.lineNumber) + 1) : K + 1
|
|
2678
2700
|
};
|
|
2679
2701
|
F.current.setPosition(ve), q && !q.isEmpty() && F.current.setSelection(q);
|
|
2680
2702
|
}
|
|
@@ -2694,19 +2716,19 @@ function ro(e) {
|
|
|
2694
2716
|
if (nt(_.conflictIssues), F.current && Z) {
|
|
2695
2717
|
const z = O;
|
|
2696
2718
|
if (!z._conflictIssueDecorations) {
|
|
2697
|
-
const
|
|
2719
|
+
const K = F.current.createDecorationsCollection(
|
|
2698
2720
|
[]
|
|
2699
2721
|
);
|
|
2700
|
-
z._conflictIssueDecorations =
|
|
2722
|
+
z._conflictIssueDecorations = K;
|
|
2701
2723
|
}
|
|
2702
|
-
const q = z._conflictIssueDecorations,
|
|
2724
|
+
const q = z._conflictIssueDecorations, he = _.conflictIssues.map((K) => {
|
|
2703
2725
|
let ve, Ae;
|
|
2704
|
-
return
|
|
2705
|
-
range: new Z.Range(
|
|
2726
|
+
return K.type === "error" ? (ve = o === "vs-dark" ? "rgba(255, 0, 0, 0.1)" : "rgba(255, 0, 0, 0.05)", Ae = o === "vs-dark" ? "#ff6666" : "#cc0000") : K.type === "warning" ? (ve = o === "vs-dark" ? "rgba(255, 170, 0, 0.1)" : "rgba(255, 136, 0, 0.05)", Ae = o === "vs-dark" ? "#ffaa00" : "#ff8800") : (ve = o === "vs-dark" ? "rgba(0, 150, 255, 0.1)" : "rgba(0, 120, 212, 0.05)", Ae = o === "vs-dark" ? "#0096ff" : "#0078d4"), {
|
|
2727
|
+
range: new Z.Range(K.startLine, 1, K.endLine, Number.MAX_SAFE_INTEGER),
|
|
2706
2728
|
options: {
|
|
2707
2729
|
isWholeLine: !0,
|
|
2708
|
-
className: `conflict-issue-line conflict-issue-${
|
|
2709
|
-
linesDecorationsClassName: `conflict-issue-line-decoration conflict-issue-${
|
|
2730
|
+
className: `conflict-issue-line conflict-issue-${K.type}`,
|
|
2731
|
+
linesDecorationsClassName: `conflict-issue-line-decoration conflict-issue-${K.type}`,
|
|
2710
2732
|
backgroundColor: ve,
|
|
2711
2733
|
overviewRuler: {
|
|
2712
2734
|
color: Ae,
|
|
@@ -2719,7 +2741,7 @@ function ro(e) {
|
|
|
2719
2741
|
}
|
|
2720
2742
|
};
|
|
2721
2743
|
});
|
|
2722
|
-
q.set(
|
|
2744
|
+
q.set(he);
|
|
2723
2745
|
}
|
|
2724
2746
|
} else if (F.current) {
|
|
2725
2747
|
const z = O;
|
|
@@ -2737,12 +2759,12 @@ function ro(e) {
|
|
|
2737
2759
|
}));
|
|
2738
2760
|
}
|
|
2739
2761
|
},
|
|
2740
|
-
[y,
|
|
2762
|
+
[y, N, h, o, nt, m, X]
|
|
2741
2763
|
), mt = Ee(
|
|
2742
|
-
(
|
|
2764
|
+
(k, O) => {
|
|
2743
2765
|
ne(!1), B((I) => {
|
|
2744
2766
|
const $ = I.map((P) => {
|
|
2745
|
-
if (P.id !==
|
|
2767
|
+
if (P.id !== k) return P;
|
|
2746
2768
|
const Q = (O === 1 ? P.input1State : P.input2State) === te.excluded ? te.first : te.excluded;
|
|
2747
2769
|
return O === 1 ? { ...P, input1State: Q } : { ...P, input2State: Q };
|
|
2748
2770
|
});
|
|
@@ -2751,9 +2773,9 @@ function ro(e) {
|
|
|
2751
2773
|
},
|
|
2752
2774
|
[m, rt]
|
|
2753
2775
|
), yt = Ee(
|
|
2754
|
-
(
|
|
2776
|
+
(k, O, I, $, P, U, Q) => {
|
|
2755
2777
|
if (!fe.current) return;
|
|
2756
|
-
const _ = $ === 1 ?
|
|
2778
|
+
const _ = $ === 1 ? C.current : ee.current;
|
|
2757
2779
|
if (!_) return;
|
|
2758
2780
|
const ue = $ === 1 ? I.input1Range : I.input2Range, Z = $ === 1 ? I.input1State : I.input2State, H = _.getModel();
|
|
2759
2781
|
if (!H) return;
|
|
@@ -2764,33 +2786,33 @@ function ro(e) {
|
|
|
2764
2786
|
let q = Be.current.get(O);
|
|
2765
2787
|
if (!q) {
|
|
2766
2788
|
q = document.createElement("div"), q.className = "merge-accept-gutter-marker";
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2789
|
+
const ge = document.createElement("div");
|
|
2790
|
+
ge.className = "background", q.appendChild(ge);
|
|
2769
2791
|
const pe = document.createElement("div");
|
|
2770
2792
|
pe.className = "checkbox";
|
|
2771
|
-
const
|
|
2772
|
-
|
|
2773
|
-
const Ne =
|
|
2774
|
-
|
|
2793
|
+
const ye = document.createElement("div");
|
|
2794
|
+
ye.className = "checkbox-background";
|
|
2795
|
+
const Ne = me(Z, $, I.id, () => mt(I.id, $));
|
|
2796
|
+
ye.appendChild(Ne), pe.appendChild(ye), q.appendChild(pe), k.appendChild(q), Be.current.set(O, q);
|
|
2775
2797
|
}
|
|
2776
2798
|
q.style.top = `${G}px`, q.style.height = `${z}px`;
|
|
2777
|
-
const
|
|
2778
|
-
if (
|
|
2779
|
-
|
|
2780
|
-
const
|
|
2781
|
-
|
|
2782
|
-
}
|
|
2783
|
-
const
|
|
2784
|
-
q.className = "merge-accept-gutter-marker",
|
|
2799
|
+
const he = q.querySelector(".checkbox-background");
|
|
2800
|
+
if (he) {
|
|
2801
|
+
he.innerHTML = "";
|
|
2802
|
+
const ge = me(Z, $, I.id, () => mt(I.id, $));
|
|
2803
|
+
he.appendChild(ge);
|
|
2804
|
+
}
|
|
2805
|
+
const K = I.handled, ve = I.focused, Ae = z > 30;
|
|
2806
|
+
q.className = "merge-accept-gutter-marker", K && q.classList.add("handled"), ve && q.classList.add("focused"), Ae ? q.classList.add("multi-line") : q.classList.add("single-line");
|
|
2785
2807
|
const Oe = q.querySelector(".checkbox");
|
|
2786
2808
|
if (Oe) {
|
|
2787
|
-
const pe = z / 2 - 12,
|
|
2809
|
+
const pe = z / 2 - 12, ye = 24;
|
|
2788
2810
|
let Ne = pe;
|
|
2789
|
-
const vn =
|
|
2811
|
+
const vn = ye, bn = U - ye - 24, Ht = ye, Gt = z - 24 - ye;
|
|
2790
2812
|
Ht < Gt && (Ne = Math.max(vn, Math.min(Ne + G, bn)) - G, Ne = Math.max(Ht, Math.min(Ne, Gt))), Oe.style.top = `${Ne + 5}px`;
|
|
2791
2813
|
}
|
|
2792
2814
|
},
|
|
2793
|
-
[mt,
|
|
2815
|
+
[mt, me]
|
|
2794
2816
|
), ot = Ee(() => {
|
|
2795
2817
|
if (!m) {
|
|
2796
2818
|
const H = Be.current;
|
|
@@ -2798,14 +2820,14 @@ function ro(e) {
|
|
|
2798
2820
|
se.remove(), H.delete(J);
|
|
2799
2821
|
return;
|
|
2800
2822
|
}
|
|
2801
|
-
if (!
|
|
2823
|
+
if (!C.current || !ee.current || !$e.current || !Ye.current || !fe.current)
|
|
2802
2824
|
return;
|
|
2803
|
-
const O = o === "vs-dark" || typeof o == "string" && o.includes("dark"), I = ze(
|
|
2825
|
+
const O = o === "vs-dark" || typeof o == "string" && o.includes("dark"), I = ze(C.current), $ = Xe(C.current), P = ze(ee.current), U = Xe(ee.current);
|
|
2804
2826
|
$e.current.style.left = `${I}px`, $e.current.style.width = `${$}px`, Ye.current.style.left = `${P}px`, Ye.current.style.width = `${U}px`;
|
|
2805
|
-
const Q =
|
|
2827
|
+
const Q = C.current.getVisibleRanges();
|
|
2806
2828
|
if (!Q || Q.length === 0) return;
|
|
2807
|
-
const Y =
|
|
2808
|
-
for (const H of
|
|
2829
|
+
const Y = C.current.getScrollTop(), _ = $e.current.clientHeight, ue = /* @__PURE__ */ new Set();
|
|
2830
|
+
for (const H of T)
|
|
2809
2831
|
if (!(H.input1Diffs.length === 0 && H.input2Diffs.length === 0)) {
|
|
2810
2832
|
if (H.input1Diffs.length > 0) {
|
|
2811
2833
|
const J = `${H.id}-input1`;
|
|
@@ -2819,21 +2841,21 @@ function ro(e) {
|
|
|
2819
2841
|
const Z = Be.current;
|
|
2820
2842
|
for (const [H, J] of Z.entries())
|
|
2821
2843
|
ue.has(H) || (J.remove(), Z.delete(H));
|
|
2822
|
-
}, [
|
|
2844
|
+
}, [T, o, m, ze, Xe, yt]), be = Ee((k, O) => {
|
|
2823
2845
|
var I, $, P;
|
|
2824
2846
|
try {
|
|
2825
2847
|
if (fe.current) {
|
|
2826
2848
|
const U = ($ = (I = fe.current.editor).getTheme) == null ? void 0 : $.call(I);
|
|
2827
|
-
if ((P = U == null ? void 0 : U.colors) != null && P[
|
|
2828
|
-
return U.colors[
|
|
2849
|
+
if ((P = U == null ? void 0 : U.colors) != null && P[k])
|
|
2850
|
+
return U.colors[k];
|
|
2829
2851
|
}
|
|
2830
2852
|
} catch {
|
|
2831
2853
|
}
|
|
2832
2854
|
return O;
|
|
2833
2855
|
}, []), $t = Ee(() => {
|
|
2834
|
-
if (!fe.current || !
|
|
2856
|
+
if (!fe.current || !C.current || !ee.current)
|
|
2835
2857
|
return;
|
|
2836
|
-
const
|
|
2858
|
+
const k = fe.current, O = o === "vs-dark" || typeof o == "string" && o.includes("dark"), I = be("mergeEditor.change.background", O ? "rgba(255, 166, 0, 0.2)" : "rgba(255, 166, 0, 0.15)"), $ = be(
|
|
2837
2859
|
"diffEditor.insertedTextBackground",
|
|
2838
2860
|
O ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
|
|
2839
2861
|
), P = be(
|
|
@@ -2852,18 +2874,18 @@ function ro(e) {
|
|
|
2852
2874
|
conflictOverviewColor: U,
|
|
2853
2875
|
changeOverviewColor: Q,
|
|
2854
2876
|
baseOverviewColor: Y
|
|
2855
|
-
}, { input1Decorations: Z, input2Decorations: H, baseDecorations: J } =
|
|
2856
|
-
|
|
2877
|
+
}, { input1Decorations: Z, input2Decorations: H, baseDecorations: J } = Cr(
|
|
2878
|
+
T,
|
|
2857
2879
|
_,
|
|
2858
2880
|
ue,
|
|
2859
|
-
|
|
2881
|
+
k
|
|
2860
2882
|
), se = be("input.background", O ? "#3c3c3c" : "#f3f3f3"), re = be("input.border", O ? "#6b6b6b" : "#c8c8c8"), G = be("focusBorder", O ? "#007acc" : "#0078d4"), oe = be("inputOption.activeForeground", O ? "#3794ff" : "#0078d4"), z = "monaco-three-way-diff-dynamic";
|
|
2861
2883
|
let q = document.getElementById(z);
|
|
2862
2884
|
q || (q = document.createElement("style"), q.id = z, document.head.appendChild(q));
|
|
2863
|
-
const
|
|
2885
|
+
const he = be(
|
|
2864
2886
|
"diffEditor.insertedTextBackground",
|
|
2865
2887
|
O ? "rgba(100, 100, 255, 0.15)" : "rgba(100, 100, 255, 0.1)"
|
|
2866
|
-
),
|
|
2888
|
+
), K = be(
|
|
2867
2889
|
"diffEditor.insertedTextBackground",
|
|
2868
2890
|
O ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
|
|
2869
2891
|
);
|
|
@@ -2882,7 +2904,7 @@ function ro(e) {
|
|
|
2882
2904
|
|
|
2883
2905
|
/* Single-side change (green for input2/ours, orange for input1/theirs in 3-way) */
|
|
2884
2906
|
.monaco-editor .merge-change-incoming {
|
|
2885
|
-
background-color: ${
|
|
2907
|
+
background-color: ${K};
|
|
2886
2908
|
}
|
|
2887
2909
|
.monaco-editor .merge-change-current {
|
|
2888
2910
|
background-color: ${$};
|
|
@@ -2890,7 +2912,7 @@ function ro(e) {
|
|
|
2890
2912
|
|
|
2891
2913
|
/* Same change on both sides (blue/purple) */
|
|
2892
2914
|
.monaco-editor .merge-same-change {
|
|
2893
|
-
background-color: ${
|
|
2915
|
+
background-color: ${he};
|
|
2894
2916
|
}
|
|
2895
2917
|
|
|
2896
2918
|
/* Base changes */
|
|
@@ -3052,49 +3074,49 @@ function ro(e) {
|
|
|
3052
3074
|
outline: 2px solid ${G};
|
|
3053
3075
|
outline-offset: 2px;
|
|
3054
3076
|
}
|
|
3055
|
-
`, Fe.current || (Fe.current =
|
|
3056
|
-
}, [
|
|
3077
|
+
`, Fe.current || (Fe.current = C.current.createDecorationsCollection([])), Fe.current.set(Z), Ue.current || (Ue.current = ee.current.createDecorationsCollection([])), Ue.current.set(H), ie.current && (Ve.current || (Ve.current = ie.current.createDecorationsCollection([])), Ve.current.set(J));
|
|
3078
|
+
}, [T, o, f, be]), Bt = Ee(() => {
|
|
3057
3079
|
if (!De.current && Ie.current && fe.current && !b) {
|
|
3058
|
-
const
|
|
3080
|
+
const k = fe.current;
|
|
3059
3081
|
Ie.current.innerHTML = "";
|
|
3060
3082
|
const O = document.createElement("div");
|
|
3061
3083
|
O.style.display = "flex", O.style.height = "100%", O.style.width = "100%";
|
|
3062
|
-
const I = o === "vs-dark" || typeof o == "string" && o.includes("dark"), $ = I ? "#444" : "#ddd", P = I ? "#fff" : "#333", U = (
|
|
3063
|
-
var Ae, Oe,
|
|
3084
|
+
const I = o === "vs-dark" || typeof o == "string" && o.includes("dark"), $ = I ? "#444" : "#ddd", P = I ? "#fff" : "#333", U = (K, ve) => {
|
|
3085
|
+
var Ae, Oe, ge;
|
|
3064
3086
|
try {
|
|
3065
|
-
const pe = (Oe = (Ae =
|
|
3066
|
-
if ((
|
|
3067
|
-
return pe.colors[
|
|
3087
|
+
const pe = (Oe = (Ae = k.editor).getTheme) == null ? void 0 : Oe.call(Ae);
|
|
3088
|
+
if ((ge = pe == null ? void 0 : pe.colors) != null && ge[K])
|
|
3089
|
+
return pe.colors[K];
|
|
3068
3090
|
} catch {
|
|
3069
3091
|
}
|
|
3070
3092
|
return ve;
|
|
3071
|
-
}, Q = U("mergeEditor.conflict.input1.header.background", I ? "#4B1818" : "#FFE6E6"), Y = U("editorGutter.background", I ? "#333" : "#f0f0f0"), _ = U("mergeEditor.conflict.input2.header.background", I ? "#1B4B18" : "#E6FFE6"), ue = U("mergeEditor.result.header.background", I ? "#7F5F00" : "#FFECB3"), Z = (
|
|
3093
|
+
}, Q = U("mergeEditor.conflict.input1.header.background", I ? "#4B1818" : "#FFE6E6"), Y = U("editorGutter.background", I ? "#333" : "#f0f0f0"), _ = U("mergeEditor.conflict.input2.header.background", I ? "#1B4B18" : "#E6FFE6"), ue = U("mergeEditor.result.header.background", I ? "#7F5F00" : "#FFECB3"), Z = (K, ve, Ae = !1) => {
|
|
3072
3094
|
const Oe = document.createElement("div");
|
|
3073
3095
|
Oe.style.flex = "1", Oe.style.display = "flex", Oe.style.flexDirection = "column", Oe.style.borderRight = `1px solid ${$}`;
|
|
3074
|
-
const
|
|
3075
|
-
|
|
3096
|
+
const ge = document.createElement("div");
|
|
3097
|
+
ge.textContent = K, ge.style.padding = "4px 8px", ge.style.fontSize = "11px", ge.style.fontWeight = "500", ge.style.backgroundColor = ve, ge.style.color = P, ge.style.borderBottom = `1px solid ${$}`, Oe.appendChild(ge);
|
|
3076
3098
|
const pe = document.createElement("div");
|
|
3077
3099
|
pe.style.flex = "1", pe.style.position = "relative", pe.style.overflow = "hidden";
|
|
3078
|
-
const
|
|
3079
|
-
|
|
3100
|
+
const ye = document.createElement("div");
|
|
3101
|
+
ye.style.position = "absolute", ye.style.left = "0", ye.style.right = "0", ye.style.top = "0", ye.style.bottom = "0", pe.appendChild(ye);
|
|
3080
3102
|
let Ne = null;
|
|
3081
|
-
return Ae && (Ne = document.createElement("div"), Ne.className = "merge-editor-gutter", pe.appendChild(Ne)), Oe.appendChild(pe), { container: Oe, editorDiv:
|
|
3103
|
+
return Ae && (Ne = document.createElement("div"), Ne.className = "merge-editor-gutter", pe.appendChild(Ne)), Oe.appendChild(pe), { container: Oe, editorDiv: ye, gutterDiv: Ne };
|
|
3082
3104
|
}, H = Z((h == null ? void 0 : h.input1) || "Theirs", Q, m), J = Z((h == null ? void 0 : h.input2) || "Ours", _, m);
|
|
3083
3105
|
H.gutterDiv && ($e.current = H.gutterDiv), J.gutterDiv && (Ye.current = J.gutterDiv);
|
|
3084
3106
|
const se = !!n;
|
|
3085
3107
|
let re = null;
|
|
3086
3108
|
if (se) {
|
|
3087
3109
|
re = Z((h == null ? void 0 : h.base) || "Base", Y, !1);
|
|
3088
|
-
const
|
|
3089
|
-
d === 0 ?
|
|
3110
|
+
const K = [];
|
|
3111
|
+
d === 0 ? K.push(re.container, H.container, J.container) : d === 1 ? K.push(H.container, re.container, J.container) : d === 2 && K.push(H.container, J.container, re.container), K.forEach((ve) => {
|
|
3090
3112
|
O.appendChild(ve);
|
|
3091
3113
|
});
|
|
3092
3114
|
} else
|
|
3093
3115
|
O.appendChild(H.container), O.appendChild(J.container);
|
|
3094
3116
|
let G = null;
|
|
3095
3117
|
m && se && (G = Z((h == null ? void 0 : h.result) || "Result", ue, !0), Le.current = G.container.querySelector("div"), G.gutterDiv && (ke.current = G.gutterDiv), O.appendChild(G.container)), Ie.current.appendChild(O);
|
|
3096
|
-
const oe =
|
|
3097
|
-
if (
|
|
3118
|
+
const oe = k.editor.createModel(t || "", E), z = se ? k.editor.createModel(n || "", E) : null, q = k.editor.createModel(r || "", E);
|
|
3119
|
+
if (C.current = k.editor.create(H.editorDiv, {
|
|
3098
3120
|
model: oe,
|
|
3099
3121
|
readOnly: !0,
|
|
3100
3122
|
automaticLayout: !0,
|
|
@@ -3102,7 +3124,7 @@ function ro(e) {
|
|
|
3102
3124
|
glyphMargin: !1,
|
|
3103
3125
|
...i,
|
|
3104
3126
|
lineDecorationsWidth: m ? 26 : 10
|
|
3105
|
-
}), se && re && (ie.current =
|
|
3127
|
+
}), se && re && (ie.current = k.editor.create(re.editorDiv, {
|
|
3106
3128
|
model: z,
|
|
3107
3129
|
readOnly: !0,
|
|
3108
3130
|
automaticLayout: !0,
|
|
@@ -3110,7 +3132,7 @@ function ro(e) {
|
|
|
3110
3132
|
glyphMargin: !1,
|
|
3111
3133
|
...i,
|
|
3112
3134
|
lineDecorationsWidth: 10
|
|
3113
|
-
})), ee.current =
|
|
3135
|
+
})), ee.current = k.editor.create(J.editorDiv, {
|
|
3114
3136
|
model: q,
|
|
3115
3137
|
readOnly: !0,
|
|
3116
3138
|
automaticLayout: !0,
|
|
@@ -3119,71 +3141,71 @@ function ro(e) {
|
|
|
3119
3141
|
...i,
|
|
3120
3142
|
lineDecorationsWidth: m ? 26 : 10
|
|
3121
3143
|
}), m && G) {
|
|
3122
|
-
const
|
|
3123
|
-
F.current =
|
|
3124
|
-
model:
|
|
3144
|
+
const K = k.editor.createModel(r || "", E);
|
|
3145
|
+
F.current = k.editor.create(G.editorDiv, {
|
|
3146
|
+
model: K,
|
|
3125
3147
|
automaticLayout: !0,
|
|
3126
3148
|
folding: !m,
|
|
3127
3149
|
glyphMargin: !1,
|
|
3128
3150
|
...i,
|
|
3129
3151
|
readOnly: !1,
|
|
3130
3152
|
lineDecorationsWidth: 26
|
|
3131
|
-
}),
|
|
3153
|
+
}), K.onDidChangeContent(() => {
|
|
3132
3154
|
gt.current || ne(!0);
|
|
3133
3155
|
});
|
|
3134
3156
|
}
|
|
3135
|
-
|
|
3136
|
-
const
|
|
3137
|
-
B(
|
|
3157
|
+
k.editor.setTheme(o);
|
|
3158
|
+
const he = xt(z, oe, q);
|
|
3159
|
+
B(he), De.current = !0, l && C.current && l(C.current, k);
|
|
3138
3160
|
}
|
|
3139
3161
|
}, [i, o, t, r, n, m, d, b, xt, l, h]), Ft = le(m), Ut = le(d), Vt = le(L), Jt = le(n);
|
|
3140
3162
|
return Se(() => {
|
|
3141
3163
|
var P, U, Q, Y, _, ue, Z, H, J, se, re;
|
|
3142
|
-
const
|
|
3143
|
-
if ((
|
|
3144
|
-
Ft.current = m, Ut.current = d, Vt.current = L, Jt.current = n, Be.current.forEach((
|
|
3145
|
-
|
|
3164
|
+
const k = Ft.current !== m, O = Ut.current !== d, I = Vt.current !== L, $ = Jt.current !== n;
|
|
3165
|
+
if ((k || O || I || $) && De.current) {
|
|
3166
|
+
Ft.current = m, Ut.current = d, Vt.current = L, Jt.current = n, Be.current.forEach((he) => {
|
|
3167
|
+
he.remove();
|
|
3146
3168
|
}), Be.current.clear(), (P = Fe.current) == null || P.set([]), (U = Ue.current) == null || U.set([]), (Q = Ve.current) == null || Q.set([]), Fe.current = null, Ue.current = null, Ve.current = null;
|
|
3147
|
-
const G = (Y =
|
|
3148
|
-
(H =
|
|
3169
|
+
const G = (Y = C.current) == null ? void 0 : Y.getModel(), oe = (_ = ie.current) == null ? void 0 : _.getModel(), z = (ue = ee.current) == null ? void 0 : ue.getModel(), q = (Z = F.current) == null ? void 0 : Z.getModel();
|
|
3170
|
+
(H = C.current) == null || H.dispose(), (J = ie.current) == null || J.dispose(), (se = ee.current) == null || se.dispose(), (re = F.current) == null || re.dispose(), G == null || G.dispose(), oe == null || oe.dispose(), z == null || z.dispose(), q == null || q.dispose(), De.current = !1, Te((he) => he + 1);
|
|
3149
3171
|
}
|
|
3150
3172
|
}, [m, d, L, n]), Se(() => {
|
|
3151
3173
|
!b && fe.current && Ie.current && !De.current && Bt();
|
|
3152
3174
|
}, [b, Bt]), Se(() => {
|
|
3153
|
-
!
|
|
3154
|
-
}, [i,
|
|
3155
|
-
|
|
3156
|
-
}, [
|
|
3157
|
-
|
|
3158
|
-
}, [
|
|
3159
|
-
if (!
|
|
3160
|
-
const
|
|
3175
|
+
!S || !i || (C.current && C.current.updateOptions(i), ee.current && ee.current.updateOptions(i), ie.current && ie.current.updateOptions(i), F.current && F.current.updateOptions(i));
|
|
3176
|
+
}, [i, S]), Se(() => {
|
|
3177
|
+
S && T.length > 0 && ($t(), m && ot());
|
|
3178
|
+
}, [S, T, $t, ot, m]), Se(() => {
|
|
3179
|
+
S && T.length > 0 && m && F.current && rt(T);
|
|
3180
|
+
}, [S, T, m, rt]), Se(() => {
|
|
3181
|
+
if (!S) return;
|
|
3182
|
+
const k = () => {
|
|
3161
3183
|
w.length > 0 && nt(w);
|
|
3162
3184
|
}, O = [], I = () => {
|
|
3163
3185
|
ot();
|
|
3164
3186
|
};
|
|
3165
|
-
return
|
|
3187
|
+
return C.current && O.push(C.current.onDidScrollChange(I)), ee.current && O.push(ee.current.onDidScrollChange(I)), F.current && m && (O.push(F.current.onDidScrollChange(k)), O.push(F.current.onDidLayoutChange(k))), C.current && O.push(C.current.onDidLayoutChange(I)), ee.current && O.push(ee.current.onDidLayoutChange(I)), () => {
|
|
3166
3188
|
O.forEach(($) => {
|
|
3167
3189
|
$ == null || $.dispose();
|
|
3168
3190
|
});
|
|
3169
3191
|
};
|
|
3170
|
-
}, [
|
|
3171
|
-
if (!
|
|
3172
|
-
const
|
|
3173
|
-
m && F.current &&
|
|
3192
|
+
}, [S, ot, nt, m, w]), Se(() => {
|
|
3193
|
+
if (!S) return;
|
|
3194
|
+
const k = [C.current, ie.current, ee.current];
|
|
3195
|
+
m && F.current && k.push(F.current);
|
|
3174
3196
|
const O = [];
|
|
3175
3197
|
let I = !1;
|
|
3176
3198
|
const $ = (P) => {
|
|
3177
3199
|
if (I) return;
|
|
3178
3200
|
I = !0;
|
|
3179
3201
|
const U = P.getScrollTop(), Q = P.getScrollLeft();
|
|
3180
|
-
|
|
3202
|
+
k.forEach((Y) => {
|
|
3181
3203
|
Y && Y !== P && (Y.setScrollTop(U), Y.setScrollLeft(Q));
|
|
3182
3204
|
}), setTimeout(() => {
|
|
3183
3205
|
I = !1;
|
|
3184
3206
|
}, 10);
|
|
3185
3207
|
};
|
|
3186
|
-
return
|
|
3208
|
+
return k.forEach((P) => {
|
|
3187
3209
|
P && O.push(
|
|
3188
3210
|
P.onDidScrollChange(() => {
|
|
3189
3211
|
$(P);
|
|
@@ -3194,12 +3216,12 @@ function ro(e) {
|
|
|
3194
3216
|
P == null || P.dispose();
|
|
3195
3217
|
});
|
|
3196
3218
|
};
|
|
3197
|
-
}, [
|
|
3219
|
+
}, [S, m]), Se(() => () => {
|
|
3198
3220
|
var P, U, Q, Y, _, ue, Z, H, J, se, re;
|
|
3199
3221
|
(P = Fe.current) == null || P.set([]), (U = Ue.current) == null || U.set([]), (Q = Ve.current) == null || Q.set([]);
|
|
3200
|
-
const
|
|
3201
|
-
(H =
|
|
3202
|
-
}, []), b || !
|
|
3222
|
+
const k = (Y = C.current) == null ? void 0 : Y.getModel(), O = (_ = ie.current) == null ? void 0 : _.getModel(), I = (ue = ee.current) == null ? void 0 : ue.getModel(), $ = (Z = F.current) == null ? void 0 : Z.getModel();
|
|
3223
|
+
(H = C.current) == null || H.dispose(), (J = ie.current) == null || J.dispose(), (se = ee.current) == null || se.dispose(), (re = F.current) == null || re.dispose(), k == null || k.dispose(), O == null || O.dispose(), I == null || I.dispose(), $ == null || $.dispose(), De.current = !1, g(!1);
|
|
3224
|
+
}, []), b || !S ? /* @__PURE__ */ st(On, { children: u ?? /* @__PURE__ */ st(Kr, {}) }) : /* @__PURE__ */ st("div", { ref: Ie, style: { width: s, height: c }, className: a });
|
|
3203
3225
|
}
|
|
3204
3226
|
export {
|
|
3205
3227
|
ro as JsonDiffMergeEditor,
|