react-monaco-json-merge 1.1.16 → 1.1.17
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/components/editor.d.ts.map +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +141 -133
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.ts +7 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -843,7 +843,7 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
843
843
|
}
|
|
844
844
|
return g(), !0;
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function F() {
|
|
847
847
|
return n.getToken() !== 10 ? (b(3, [], [
|
|
848
848
|
2,
|
|
849
849
|
5
|
|
@@ -866,7 +866,7 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
866
866
|
if (A || b(4, [], []), h(","), g(), n.getToken() === 2 && S)
|
|
867
867
|
break;
|
|
868
868
|
} else A && b(6, [], []);
|
|
869
|
-
|
|
869
|
+
F() || b(4, [], [
|
|
870
870
|
2,
|
|
871
871
|
5
|
|
872
872
|
/* SyntaxKind.CommaToken */
|
|
@@ -1548,7 +1548,7 @@ 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 T = c.get(v) || [],
|
|
1551
|
+
const T = c.get(v) || [], F = a.get(v) || [];
|
|
1552
1552
|
for (const M of T) {
|
|
1553
1553
|
const x = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1554
1554
|
if (x) {
|
|
@@ -1558,7 +1558,7 @@ function Mr(e, t, r, n, o, i) {
|
|
|
1558
1558
|
A && A.patches1.push(M);
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
|
-
for (const M of
|
|
1561
|
+
for (const M of F) {
|
|
1562
1562
|
const x = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1563
1563
|
if (x) {
|
|
1564
1564
|
const V = x[1];
|
|
@@ -1573,9 +1573,9 @@ function Mr(e, t, r, n, o, i) {
|
|
|
1573
1573
|
if (g) {
|
|
1574
1574
|
const T = Br(h, m, f, g);
|
|
1575
1575
|
if (T.size > 0) {
|
|
1576
|
-
const
|
|
1576
|
+
const F = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
1577
1577
|
for (const [w, R] of T.entries())
|
|
1578
|
-
R.base !== void 0 &&
|
|
1578
|
+
R.base !== void 0 && F.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
1581
|
const R = w.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
|
|
@@ -1606,18 +1606,18 @@ function Mr(e, t, r, n, o, i) {
|
|
|
1606
1606
|
}
|
|
1607
1607
|
const b = c.get(v) || [], j = a.get(v) || [];
|
|
1608
1608
|
for (const T of b) {
|
|
1609
|
-
const
|
|
1610
|
-
if (
|
|
1611
|
-
const M =
|
|
1609
|
+
const F = T.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1610
|
+
if (F) {
|
|
1611
|
+
const M = F[1];
|
|
1612
1612
|
s.has(M) || s.set(M, { patches1: [], patches2: [] });
|
|
1613
1613
|
const x = s.get(M);
|
|
1614
1614
|
x && x.patches1.push(T);
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
1617
|
for (const T of j) {
|
|
1618
|
-
const
|
|
1619
|
-
if (
|
|
1620
|
-
const M =
|
|
1618
|
+
const F = T.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1619
|
+
if (F) {
|
|
1620
|
+
const M = F[1];
|
|
1621
1621
|
s.has(M) || s.set(M, { patches1: [], patches2: [] });
|
|
1622
1622
|
const x = s.get(M);
|
|
1623
1623
|
x && x.patches2.push(T);
|
|
@@ -1809,9 +1809,9 @@ function Fr(e, t, r, n) {
|
|
|
1809
1809
|
(Te) => Te.path.startsWith(`${h}/`) || Te.path === h
|
|
1810
1810
|
), me = [], je = [];
|
|
1811
1811
|
for (const Te of ae) {
|
|
1812
|
-
const C = Te.path,
|
|
1812
|
+
const C = Te.path, re = e !== void 0 ? W(e, C) : void 0, K = W(t, C), $ = W(r, C);
|
|
1813
1813
|
let fe = !1, Ie = !1;
|
|
1814
|
-
Te.op === "replace" ?
|
|
1814
|
+
Te.op === "replace" ? re !== void 0 && (fe = !de(re, K), Ie = !de(re, $)) : Te.op === "add" ? (fe = re === void 0 && K !== void 0, Ie = re === void 0 && $ !== void 0) : Te.op === "remove" && (fe = re !== void 0 && K === void 0, Ie = re !== void 0 && $ === void 0), re !== void 0 && (K !== void 0 && de(re, K) && (fe = !1), $ !== void 0 && de(re, $) && (Ie = !1)), fe && me.push(Te), Ie && je.push(Te);
|
|
1815
1815
|
}
|
|
1816
1816
|
l.push({
|
|
1817
1817
|
path: h,
|
|
@@ -1879,7 +1879,7 @@ function Ur(e, t, r) {
|
|
|
1879
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
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(),
|
|
1882
|
+
const T = /* @__PURE__ */ new Map(), F = [];
|
|
1883
1883
|
for (const x of v) {
|
|
1884
1884
|
const V = x.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
|
|
1885
1885
|
if (V) {
|
|
@@ -1890,7 +1890,7 @@ function Ur(e, t, r) {
|
|
|
1890
1890
|
const R = T.get(w);
|
|
1891
1891
|
R && R.push(x);
|
|
1892
1892
|
} else
|
|
1893
|
-
|
|
1893
|
+
F.push(x);
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
1896
|
for (const [x, V] of T) {
|
|
@@ -1900,7 +1900,7 @@ function Ur(e, t, r) {
|
|
|
1900
1900
|
s.push(...Ze(w, V, e, t, void 0)), c.add(w);
|
|
1901
1901
|
}
|
|
1902
1902
|
const M = /* @__PURE__ */ new Map();
|
|
1903
|
-
for (const x of
|
|
1903
|
+
for (const x of F) {
|
|
1904
1904
|
const V = x.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1905
1905
|
if (V) {
|
|
1906
1906
|
const A = V[1];
|
|
@@ -2317,7 +2317,7 @@ function qr(e, t, r, n, o) {
|
|
|
2317
2317
|
continue;
|
|
2318
2318
|
}
|
|
2319
2319
|
try {
|
|
2320
|
-
let
|
|
2320
|
+
let F, M = T;
|
|
2321
2321
|
const x = (S = g.path) == null ? void 0 : S.match(/^(.*\/\d+)(?:\/.*)?$/);
|
|
2322
2322
|
let V = !1, A = "";
|
|
2323
2323
|
if (x) {
|
|
@@ -2329,14 +2329,14 @@ function qr(e, t, r, n, o) {
|
|
|
2329
2329
|
}
|
|
2330
2330
|
if (b && j)
|
|
2331
2331
|
if (g.conflictType === D.SAME_CHANGE)
|
|
2332
|
-
V ? (
|
|
2332
|
+
V ? (F = W(p, A), M = A) : F = W(p, T);
|
|
2333
2333
|
else {
|
|
2334
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 ? (
|
|
2335
|
+
ae !== null ? (F = ae, M = w, i.push(`Smart-merged conflict at path ${w}`)) : (F = X, M = w, i.push(`Merge failed at path ${w}, using input2 value`));
|
|
2336
2336
|
}
|
|
2337
2337
|
else if (b)
|
|
2338
2338
|
if (V)
|
|
2339
|
-
|
|
2339
|
+
F = W(y, A), M = A;
|
|
2340
2340
|
else {
|
|
2341
2341
|
const w = T.split("/").filter(Boolean);
|
|
2342
2342
|
if (w.length > 1) {
|
|
@@ -2354,13 +2354,13 @@ function qr(e, t, r, n, o) {
|
|
|
2354
2354
|
}
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
2357
|
-
|
|
2357
|
+
F = W(y, T);
|
|
2358
2358
|
} else
|
|
2359
|
-
|
|
2359
|
+
F = W(y, T);
|
|
2360
2360
|
}
|
|
2361
2361
|
else if (j)
|
|
2362
2362
|
if (V)
|
|
2363
|
-
|
|
2363
|
+
F = W(p, A), M = A;
|
|
2364
2364
|
else {
|
|
2365
2365
|
const w = T.split("/").filter(Boolean);
|
|
2366
2366
|
if (w.length > 1) {
|
|
@@ -2378,20 +2378,20 @@ function qr(e, t, r, n, o) {
|
|
|
2378
2378
|
}
|
|
2379
2379
|
}
|
|
2380
2380
|
}
|
|
2381
|
-
|
|
2381
|
+
F = W(p, T);
|
|
2382
2382
|
} else
|
|
2383
|
-
|
|
2383
|
+
F = W(p, T);
|
|
2384
2384
|
}
|
|
2385
2385
|
else {
|
|
2386
2386
|
const w = V ? A : T, R = W(l, w);
|
|
2387
2387
|
if (R !== void 0)
|
|
2388
|
-
|
|
2388
|
+
F = R, M = w;
|
|
2389
2389
|
else
|
|
2390
2390
|
continue;
|
|
2391
2391
|
}
|
|
2392
|
-
|
|
2393
|
-
} catch (
|
|
2394
|
-
i.push(`Failed to apply conflict at path ${T || g.id}: ${
|
|
2392
|
+
F !== void 0 && (Gr(d, M, F), L.add(M), N.add(M));
|
|
2393
|
+
} catch (F) {
|
|
2394
|
+
i.push(`Failed to apply conflict at path ${T || g.id}: ${F instanceof Error ? F.message : String(F)}`);
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
2397
|
const m = JSON.stringify(d, null, 2);
|
|
@@ -2400,14 +2400,14 @@ function qr(e, t, r, n, o) {
|
|
|
2400
2400
|
if (!b) continue;
|
|
2401
2401
|
const j = g.input1State === te.first || g.input1State === te.second, T = g.input2State === te.first || g.input2State === te.second;
|
|
2402
2402
|
if (j && T && g.conflictType === D.TRUE_CONFLICT) {
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2403
|
+
const F = Wr(m, b);
|
|
2404
|
+
F && s.push({
|
|
2405
2405
|
conflictId: g.id,
|
|
2406
2406
|
conflictPath: b,
|
|
2407
2407
|
type: "warning",
|
|
2408
2408
|
message: "Both conflicting changes were accepted - please review and manually resolve",
|
|
2409
|
-
startLine:
|
|
2410
|
-
endLine:
|
|
2409
|
+
startLine: F.startLine,
|
|
2410
|
+
endLine: F.endLine
|
|
2411
2411
|
});
|
|
2412
2412
|
}
|
|
2413
2413
|
}
|
|
@@ -2607,16 +2607,16 @@ function ro(e) {
|
|
|
2607
2607
|
schema: N,
|
|
2608
2608
|
patches: v,
|
|
2609
2609
|
labels: h
|
|
2610
|
-
} = e, m = n ? p : !1, f = !n || n === "", E = "json", [S, g] = _e(!1), [b, j] = _e(!0), [T,
|
|
2610
|
+
} = e, m = n ? p : !1, f = !n || n === "", E = "json", [S, g] = _e(!1), [b, j] = _e(!0), [T, F] = _e([]), [M, x] = _e(null), [V, A] = _e([]), [w, R] = _e([]), [X, ne] = _e(!1), ae = le(""), me = Ee((k, O, I, B) => {
|
|
2611
2611
|
const P = document.createElement("div");
|
|
2612
2612
|
P.className = "native-checkbox-container";
|
|
2613
2613
|
const U = document.createElement("input");
|
|
2614
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) => {
|
|
2615
2615
|
Q.preventDefault(), Q.stopPropagation(), requestAnimationFrame(() => {
|
|
2616
|
-
|
|
2616
|
+
B();
|
|
2617
2617
|
});
|
|
2618
2618
|
}), P.appendChild(U), P;
|
|
2619
|
-
}, []), [je, Te] = _e(0), C = le(null),
|
|
2619
|
+
}, []), [je, Te] = _e(0), C = le(null), re = le(null), K = le(null), $ = 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);
|
|
2620
2620
|
Se(() => {
|
|
2621
2621
|
let k = !0;
|
|
2622
2622
|
const O = ur.init();
|
|
@@ -2631,9 +2631,9 @@ function ro(e) {
|
|
|
2631
2631
|
const xt = Ee(
|
|
2632
2632
|
(k, O, I) => {
|
|
2633
2633
|
if (!fe.current) return [];
|
|
2634
|
-
const
|
|
2634
|
+
const B = (k == null ? void 0 : k.getValue()) || "", P = O.getValue(), U = I.getValue();
|
|
2635
2635
|
try {
|
|
2636
|
-
const Q = performance.now(), Y = Jr(
|
|
2636
|
+
const Q = performance.now(), Y = Jr(B, P, U, {
|
|
2637
2637
|
comparisonMode: L,
|
|
2638
2638
|
schema: N,
|
|
2639
2639
|
patches: v
|
|
@@ -2659,51 +2659,51 @@ function ro(e) {
|
|
|
2659
2659
|
}
|
|
2660
2660
|
}, []), nt = Ee(
|
|
2661
2661
|
(k) => {
|
|
2662
|
-
if (!m ||
|
|
2662
|
+
if (!m || !$.current || !ke.current)
|
|
2663
2663
|
return;
|
|
2664
2664
|
const O = fe.current;
|
|
2665
2665
|
if (!O) return;
|
|
2666
|
-
const I = o === "vs-dark" || typeof o == "string" && o.includes("dark"),
|
|
2667
|
-
ke.current.style.left = `${
|
|
2668
|
-
const U =
|
|
2669
|
-
if (
|
|
2666
|
+
const I = o === "vs-dark" || typeof o == "string" && o.includes("dark"), B = ze($.current), P = Xe($.current);
|
|
2667
|
+
ke.current.style.left = `${B}px`, ke.current.style.width = `${P}px`;
|
|
2668
|
+
const U = $.current.getScrollTop();
|
|
2669
|
+
if ($.current.getModel()) {
|
|
2670
2670
|
ke.current.innerHTML = "";
|
|
2671
2671
|
for (const Y of k) {
|
|
2672
|
-
const _ = Y.startLine, ue = Y.endLine, Z =
|
|
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 = `${
|
|
2674
|
-
const
|
|
2675
|
-
|
|
2672
|
+
const _ = Y.startLine, ue = Y.endLine, Z = $.current.getTopForLineNumber(_) - U, H = $.current.getTopForLineNumber(ue) - U, J = $.current.getOption(O.editor.EditorOption.lineHeight), oe = ue > _ ? H - Z + J : J, G = document.createElement("div");
|
|
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 = `${oe}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";
|
|
2674
|
+
const ie = document.createElement("div");
|
|
2675
|
+
ie.className = "issue-icon", Y.type === "error" ? (ie.textContent = "✗", ie.style.color = I ? "#ff6666" : "#cc0000") : Y.type === "warning" ? (ie.textContent = Nt, ie.style.color = I ? "#ffaa00" : "#ff8800") : Y.type === "smart-merge" && (ie.textContent = "↕", ie.style.color = I ? "#0096ff" : "#0078d4"), ie.style.fontSize = "14px", ie.style.fontWeight = "bold", G.appendChild(ie), ke.current.appendChild(G);
|
|
2676
2676
|
}
|
|
2677
2677
|
}
|
|
2678
2678
|
},
|
|
2679
2679
|
[m, o, ze, Xe]
|
|
2680
2680
|
), rt = Ee(
|
|
2681
2681
|
(k) => {
|
|
2682
|
-
var se,
|
|
2683
|
-
if (
|
|
2682
|
+
var se, oe, G, ie;
|
|
2683
|
+
if (!$.current || X)
|
|
2684
2684
|
return;
|
|
2685
|
-
const O =
|
|
2686
|
-
if (!O || !I ||
|
|
2685
|
+
const O = $.current.getModel(), I = (se = C.current) == null ? void 0 : se.getModel(), B = (oe = K.current) == null ? void 0 : oe.getModel(), P = (G = re.current) == null ? void 0 : G.getModel();
|
|
2686
|
+
if (!O || !I || !B || !P)
|
|
2687
2687
|
return;
|
|
2688
|
-
const U = P.getLinesContent(), Q = I.getLinesContent(), Y =
|
|
2688
|
+
const U = P.getLinesContent(), Q = I.getLinesContent(), Y = B.getLinesContent(), _ = qr(U, Q, Y, k, N);
|
|
2689
2689
|
if (x(_.isValid ? null : _.validationError || "Invalid JSON"), A(_.warnings || []), R(_.conflictIssues || []), Le.current) {
|
|
2690
2690
|
const z = (h == null ? void 0 : h.result) || "Result";
|
|
2691
2691
|
_.isValid ? _.warnings && _.warnings.length > 0 ? (Le.current.textContent = `${z} ${Nt}`, Le.current.title = _.warnings.join(`
|
|
2692
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");
|
|
2693
2693
|
}
|
|
2694
2694
|
if (O.getValue() !== _.content) {
|
|
2695
|
-
const z =
|
|
2695
|
+
const z = $.current.getPosition(), q = $.current.getSelection();
|
|
2696
2696
|
if (gt.current = !0, O.setValue(_.content), gt.current = !1, z) {
|
|
2697
|
-
const he = O.getLineCount(),
|
|
2697
|
+
const he = O.getLineCount(), ee = O.getLineLength(he), ve = {
|
|
2698
2698
|
lineNumber: Math.min(z.lineNumber, he),
|
|
2699
|
-
column: z.lineNumber <= he ? Math.min(z.column, O.getLineLength(z.lineNumber) + 1) :
|
|
2699
|
+
column: z.lineNumber <= he ? Math.min(z.column, O.getLineLength(z.lineNumber) + 1) : ee + 1
|
|
2700
2700
|
};
|
|
2701
|
-
|
|
2701
|
+
$.current.setPosition(ve), q && !q.isEmpty() && $.current.setSelection(q);
|
|
2702
2702
|
}
|
|
2703
2703
|
}
|
|
2704
2704
|
const Z = fe.current, H = O;
|
|
2705
2705
|
let J = H._invalidDecorations;
|
|
2706
|
-
if (!_.isValid &&
|
|
2706
|
+
if (!_.isValid && $.current && Z ? (J || (J = $.current.createDecorationsCollection([]), H._invalidDecorations = J), J.set([
|
|
2707
2707
|
{
|
|
2708
2708
|
range: new Z.Range(1, 1, O.getLineCount(), Number.MAX_SAFE_INTEGER),
|
|
2709
2709
|
options: {
|
|
@@ -2712,23 +2712,23 @@ function ro(e) {
|
|
|
2712
2712
|
hoverMessage: { value: _.validationError || "Invalid JSON - please fix manually" }
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
|
-
])) : _.isValid && J &&
|
|
2716
|
-
if (nt(_.conflictIssues),
|
|
2715
|
+
])) : _.isValid && J && $.current && J.set([]), _.conflictIssues && _.conflictIssues.length > 0) {
|
|
2716
|
+
if (nt(_.conflictIssues), $.current && Z) {
|
|
2717
2717
|
const z = O;
|
|
2718
2718
|
if (!z._conflictIssueDecorations) {
|
|
2719
|
-
const
|
|
2719
|
+
const ee = $.current.createDecorationsCollection(
|
|
2720
2720
|
[]
|
|
2721
2721
|
);
|
|
2722
|
-
z._conflictIssueDecorations =
|
|
2722
|
+
z._conflictIssueDecorations = ee;
|
|
2723
2723
|
}
|
|
2724
|
-
const q = z._conflictIssueDecorations, he = _.conflictIssues.map((
|
|
2724
|
+
const q = z._conflictIssueDecorations, he = _.conflictIssues.map((ee) => {
|
|
2725
2725
|
let ve, Ae;
|
|
2726
|
-
return
|
|
2727
|
-
range: new Z.Range(
|
|
2726
|
+
return ee.type === "error" ? (ve = o === "vs-dark" ? "rgba(255, 0, 0, 0.1)" : "rgba(255, 0, 0, 0.05)", Ae = o === "vs-dark" ? "#ff6666" : "#cc0000") : ee.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(ee.startLine, 1, ee.endLine, Number.MAX_SAFE_INTEGER),
|
|
2728
2728
|
options: {
|
|
2729
2729
|
isWholeLine: !0,
|
|
2730
|
-
className: `conflict-issue-line conflict-issue-${
|
|
2731
|
-
linesDecorationsClassName: `conflict-issue-line-decoration conflict-issue-${
|
|
2730
|
+
className: `conflict-issue-line conflict-issue-${ee.type}`,
|
|
2731
|
+
linesDecorationsClassName: `conflict-issue-line-decoration conflict-issue-${ee.type}`,
|
|
2732
2732
|
backgroundColor: ve,
|
|
2733
2733
|
overviewRuler: {
|
|
2734
2734
|
color: Ae,
|
|
@@ -2743,12 +2743,12 @@ function ro(e) {
|
|
|
2743
2743
|
});
|
|
2744
2744
|
q.set(he);
|
|
2745
2745
|
}
|
|
2746
|
-
} else if (
|
|
2746
|
+
} else if ($.current) {
|
|
2747
2747
|
const z = O;
|
|
2748
2748
|
z._conflictIssueDecorations && z._conflictIssueDecorations.set([]), ke.current && m && (ke.current.innerHTML = "");
|
|
2749
2749
|
}
|
|
2750
2750
|
if (y) {
|
|
2751
|
-
const z = `${_.content}|${_.isValid}|${(
|
|
2751
|
+
const z = `${_.content}|${_.isValid}|${(ie = _.warnings) == null ? void 0 : ie.join(",")}`;
|
|
2752
2752
|
ae.current !== z && (ae.current = z, queueMicrotask(() => {
|
|
2753
2753
|
y(_.content, {
|
|
2754
2754
|
isValid: _.isValid,
|
|
@@ -2762,27 +2762,27 @@ function ro(e) {
|
|
|
2762
2762
|
[y, N, h, o, nt, m, X]
|
|
2763
2763
|
), mt = Ee(
|
|
2764
2764
|
(k, O) => {
|
|
2765
|
-
ne(!1),
|
|
2766
|
-
const
|
|
2765
|
+
ne(!1), F((I) => {
|
|
2766
|
+
const B = I.map((P) => {
|
|
2767
2767
|
if (P.id !== k) return P;
|
|
2768
2768
|
const Q = (O === 1 ? P.input1State : P.input2State) === te.excluded ? te.first : te.excluded;
|
|
2769
2769
|
return O === 1 ? { ...P, input1State: Q } : { ...P, input2State: Q };
|
|
2770
2770
|
});
|
|
2771
|
-
return m &&
|
|
2771
|
+
return m && $.current && rt(B), B;
|
|
2772
2772
|
});
|
|
2773
2773
|
},
|
|
2774
2774
|
[m, rt]
|
|
2775
2775
|
), yt = Ee(
|
|
2776
|
-
(k, O, I,
|
|
2776
|
+
(k, O, I, B, P, U, Q) => {
|
|
2777
2777
|
if (!fe.current) return;
|
|
2778
|
-
const _ =
|
|
2778
|
+
const _ = B === 1 ? C.current : K.current;
|
|
2779
2779
|
if (!_) return;
|
|
2780
|
-
const ue =
|
|
2780
|
+
const ue = B === 1 ? I.input1Range : I.input2Range, Z = B === 1 ? I.input1State : I.input2State, H = _.getModel();
|
|
2781
2781
|
if (!H) return;
|
|
2782
|
-
const J = H.getLineCount(), se = Math.max(1, Math.min(ue.startLineNumber, J)),
|
|
2783
|
-
if (se > J ||
|
|
2782
|
+
const J = H.getLineCount(), se = Math.max(1, Math.min(ue.startLineNumber, J)), oe = Math.max(1, Math.min(ue.endLineNumberExclusive - 1, J));
|
|
2783
|
+
if (se > J || oe < 1 || se > oe)
|
|
2784
2784
|
return;
|
|
2785
|
-
const G = _.getTopForLineNumber(se) - P, z = _.getBottomForLineNumber(
|
|
2785
|
+
const G = _.getTopForLineNumber(se) - P, z = _.getBottomForLineNumber(oe) - P - G;
|
|
2786
2786
|
let q = Be.current.get(O);
|
|
2787
2787
|
if (!q) {
|
|
2788
2788
|
q = document.createElement("div"), q.className = "merge-accept-gutter-marker";
|
|
@@ -2792,18 +2792,18 @@ function ro(e) {
|
|
|
2792
2792
|
pe.className = "checkbox";
|
|
2793
2793
|
const ye = document.createElement("div");
|
|
2794
2794
|
ye.className = "checkbox-background";
|
|
2795
|
-
const Ne = me(Z,
|
|
2795
|
+
const Ne = me(Z, B, I.id, () => mt(I.id, B));
|
|
2796
2796
|
ye.appendChild(Ne), pe.appendChild(ye), q.appendChild(pe), k.appendChild(q), Be.current.set(O, q);
|
|
2797
2797
|
}
|
|
2798
2798
|
q.style.top = `${G}px`, q.style.height = `${z}px`;
|
|
2799
2799
|
const he = q.querySelector(".checkbox-background");
|
|
2800
2800
|
if (he) {
|
|
2801
2801
|
he.innerHTML = "";
|
|
2802
|
-
const ge = me(Z,
|
|
2802
|
+
const ge = me(Z, B, I.id, () => mt(I.id, B));
|
|
2803
2803
|
he.appendChild(ge);
|
|
2804
2804
|
}
|
|
2805
|
-
const
|
|
2806
|
-
q.className = "merge-accept-gutter-marker",
|
|
2805
|
+
const ee = I.handled, ve = I.focused, Ae = z > 30;
|
|
2806
|
+
q.className = "merge-accept-gutter-marker", ee && q.classList.add("handled"), ve && q.classList.add("focused"), Ae ? q.classList.add("multi-line") : q.classList.add("single-line");
|
|
2807
2807
|
const Oe = q.querySelector(".checkbox");
|
|
2808
2808
|
if (Oe) {
|
|
2809
2809
|
const pe = z / 2 - 12, ye = 24;
|
|
@@ -2820,10 +2820,10 @@ function ro(e) {
|
|
|
2820
2820
|
se.remove(), H.delete(J);
|
|
2821
2821
|
return;
|
|
2822
2822
|
}
|
|
2823
|
-
if (!C.current || !
|
|
2823
|
+
if (!C.current || !K.current || !$e.current || !Ye.current || !fe.current)
|
|
2824
2824
|
return;
|
|
2825
|
-
const O = o === "vs-dark" || typeof o == "string" && o.includes("dark"), I = ze(C.current),
|
|
2826
|
-
$e.current.style.left = `${I}px`, $e.current.style.width = `${
|
|
2825
|
+
const O = o === "vs-dark" || typeof o == "string" && o.includes("dark"), I = ze(C.current), B = Xe(C.current), P = ze(K.current), U = Xe(K.current);
|
|
2826
|
+
$e.current.style.left = `${I}px`, $e.current.style.width = `${B}px`, Ye.current.style.left = `${P}px`, Ye.current.style.width = `${U}px`;
|
|
2827
2827
|
const Q = C.current.getVisibleRanges();
|
|
2828
2828
|
if (!Q || Q.length === 0) return;
|
|
2829
2829
|
const Y = C.current.getScrollTop(), _ = $e.current.clientHeight, ue = /* @__PURE__ */ new Set();
|
|
@@ -2842,10 +2842,10 @@ function ro(e) {
|
|
|
2842
2842
|
for (const [H, J] of Z.entries())
|
|
2843
2843
|
ue.has(H) || (J.remove(), Z.delete(H));
|
|
2844
2844
|
}, [T, o, m, ze, Xe, yt]), be = Ee((k, O) => {
|
|
2845
|
-
var I,
|
|
2845
|
+
var I, B, P;
|
|
2846
2846
|
try {
|
|
2847
2847
|
if (fe.current) {
|
|
2848
|
-
const U = (
|
|
2848
|
+
const U = (B = (I = fe.current.editor).getTheme) == null ? void 0 : B.call(I);
|
|
2849
2849
|
if ((P = U == null ? void 0 : U.colors) != null && P[k])
|
|
2850
2850
|
return U.colors[k];
|
|
2851
2851
|
}
|
|
@@ -2853,9 +2853,9 @@ function ro(e) {
|
|
|
2853
2853
|
}
|
|
2854
2854
|
return O;
|
|
2855
2855
|
}, []), $t = Ee(() => {
|
|
2856
|
-
if (!fe.current || !C.current || !
|
|
2856
|
+
if (!fe.current || !C.current || !K.current)
|
|
2857
2857
|
return;
|
|
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)"),
|
|
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)"), B = be(
|
|
2859
2859
|
"diffEditor.insertedTextBackground",
|
|
2860
2860
|
O ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
|
|
2861
2861
|
), P = be(
|
|
@@ -2879,13 +2879,13 @@ function ro(e) {
|
|
|
2879
2879
|
_,
|
|
2880
2880
|
ue,
|
|
2881
2881
|
k
|
|
2882
|
-
), se = be("input.background", O ? "#3c3c3c" : "#f3f3f3"),
|
|
2882
|
+
), se = be("input.background", O ? "#3c3c3c" : "#f3f3f3"), oe = be("input.border", O ? "#6b6b6b" : "#c8c8c8"), G = be("focusBorder", O ? "#007acc" : "#0078d4"), ie = be("inputOption.activeForeground", O ? "#3794ff" : "#0078d4"), z = "monaco-three-way-diff-dynamic";
|
|
2883
2883
|
let q = document.getElementById(z);
|
|
2884
2884
|
q || (q = document.createElement("style"), q.id = z, document.head.appendChild(q));
|
|
2885
2885
|
const he = be(
|
|
2886
2886
|
"diffEditor.insertedTextBackground",
|
|
2887
2887
|
O ? "rgba(100, 100, 255, 0.15)" : "rgba(100, 100, 255, 0.1)"
|
|
2888
|
-
),
|
|
2888
|
+
), ee = be(
|
|
2889
2889
|
"diffEditor.insertedTextBackground",
|
|
2890
2890
|
O ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
|
|
2891
2891
|
);
|
|
@@ -2904,10 +2904,10 @@ function ro(e) {
|
|
|
2904
2904
|
|
|
2905
2905
|
/* Single-side change (green for input2/ours, orange for input1/theirs in 3-way) */
|
|
2906
2906
|
.monaco-editor .merge-change-incoming {
|
|
2907
|
-
background-color: ${
|
|
2907
|
+
background-color: ${ee};
|
|
2908
2908
|
}
|
|
2909
2909
|
.monaco-editor .merge-change-current {
|
|
2910
|
-
background-color: ${
|
|
2910
|
+
background-color: ${B};
|
|
2911
2911
|
}
|
|
2912
2912
|
|
|
2913
2913
|
/* Same change on both sides (blue/purple) */
|
|
@@ -3019,7 +3019,7 @@ function ro(e) {
|
|
|
3019
3019
|
height: 14px;
|
|
3020
3020
|
border-radius: 3px;
|
|
3021
3021
|
background-color: ${se};
|
|
3022
|
-
border: 1px solid ${
|
|
3022
|
+
border: 1px solid ${oe};
|
|
3023
3023
|
}
|
|
3024
3024
|
|
|
3025
3025
|
.merge-accept-gutter-marker.focused .checkbox-background {
|
|
@@ -3046,7 +3046,7 @@ function ro(e) {
|
|
|
3046
3046
|
height: 16px;
|
|
3047
3047
|
cursor: pointer;
|
|
3048
3048
|
margin: 0;
|
|
3049
|
-
accent-color: ${
|
|
3049
|
+
accent-color: ${ie};
|
|
3050
3050
|
}
|
|
3051
3051
|
|
|
3052
3052
|
/* Result column status indicator */
|
|
@@ -3074,27 +3074,27 @@ function ro(e) {
|
|
|
3074
3074
|
outline: 2px solid ${G};
|
|
3075
3075
|
outline-offset: 2px;
|
|
3076
3076
|
}
|
|
3077
|
-
`, Fe.current || (Fe.current = C.current.createDecorationsCollection([])), Fe.current.set(Z), Ue.current || (Ue.current =
|
|
3077
|
+
`, Fe.current || (Fe.current = C.current.createDecorationsCollection([])), Fe.current.set(Z), Ue.current || (Ue.current = K.current.createDecorationsCollection([])), Ue.current.set(H), re.current && (Ve.current || (Ve.current = re.current.createDecorationsCollection([])), Ve.current.set(J));
|
|
3078
3078
|
}, [T, o, f, be]), Bt = Ee(() => {
|
|
3079
3079
|
if (!De.current && Ie.current && fe.current && !b) {
|
|
3080
3080
|
const k = fe.current;
|
|
3081
3081
|
Ie.current.innerHTML = "";
|
|
3082
3082
|
const O = document.createElement("div");
|
|
3083
3083
|
O.style.display = "flex", O.style.height = "100%", O.style.width = "100%";
|
|
3084
|
-
const I = o === "vs-dark" || typeof o == "string" && o.includes("dark"),
|
|
3084
|
+
const I = o === "vs-dark" || typeof o == "string" && o.includes("dark"), B = I ? "#444" : "#ddd", P = I ? "#fff" : "#333", U = (ee, ve) => {
|
|
3085
3085
|
var Ae, Oe, ge;
|
|
3086
3086
|
try {
|
|
3087
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[
|
|
3089
|
-
return pe.colors[
|
|
3088
|
+
if ((ge = pe == null ? void 0 : pe.colors) != null && ge[ee])
|
|
3089
|
+
return pe.colors[ee];
|
|
3090
3090
|
} catch {
|
|
3091
3091
|
}
|
|
3092
3092
|
return ve;
|
|
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 = (
|
|
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 = (ee, ve, Ae = !1) => {
|
|
3094
3094
|
const Oe = document.createElement("div");
|
|
3095
|
-
Oe.style.flex = "1", Oe.style.display = "flex", Oe.style.flexDirection = "column", Oe.style.borderRight = `1px solid ${
|
|
3095
|
+
Oe.style.flex = "1", Oe.style.display = "flex", Oe.style.flexDirection = "column", Oe.style.borderRight = `1px solid ${B}`;
|
|
3096
3096
|
const ge = document.createElement("div");
|
|
3097
|
-
ge.textContent =
|
|
3097
|
+
ge.textContent = ee, 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 ${B}`, Oe.appendChild(ge);
|
|
3098
3098
|
const pe = document.createElement("div");
|
|
3099
3099
|
pe.style.flex = "1", pe.style.position = "relative", pe.style.overflow = "hidden";
|
|
3100
3100
|
const ye = document.createElement("div");
|
|
@@ -3104,27 +3104,27 @@ function ro(e) {
|
|
|
3104
3104
|
}, H = Z((h == null ? void 0 : h.input1) || "Theirs", Q, m), J = Z((h == null ? void 0 : h.input2) || "Ours", _, m);
|
|
3105
3105
|
H.gutterDiv && ($e.current = H.gutterDiv), J.gutterDiv && (Ye.current = J.gutterDiv);
|
|
3106
3106
|
const se = !!n;
|
|
3107
|
-
let
|
|
3107
|
+
let oe = null;
|
|
3108
3108
|
if (se) {
|
|
3109
|
-
|
|
3110
|
-
const
|
|
3111
|
-
d === 0 ?
|
|
3109
|
+
oe = Z((h == null ? void 0 : h.base) || "Base", Y, !1);
|
|
3110
|
+
const ee = [];
|
|
3111
|
+
d === 0 ? ee.push(oe.container, H.container, J.container) : d === 1 ? ee.push(H.container, oe.container, J.container) : d === 2 && ee.push(H.container, J.container, oe.container), ee.forEach((ve) => {
|
|
3112
3112
|
O.appendChild(ve);
|
|
3113
3113
|
});
|
|
3114
3114
|
} else
|
|
3115
3115
|
O.appendChild(H.container), O.appendChild(J.container);
|
|
3116
3116
|
let G = null;
|
|
3117
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);
|
|
3118
|
-
const
|
|
3118
|
+
const ie = k.editor.createModel(t || "", E), z = se ? k.editor.createModel(n || "", E) : null, q = k.editor.createModel(r || "", E);
|
|
3119
3119
|
if (C.current = k.editor.create(H.editorDiv, {
|
|
3120
|
-
model:
|
|
3120
|
+
model: ie,
|
|
3121
3121
|
readOnly: !0,
|
|
3122
3122
|
automaticLayout: !0,
|
|
3123
3123
|
folding: !m,
|
|
3124
3124
|
glyphMargin: !1,
|
|
3125
3125
|
...i,
|
|
3126
3126
|
lineDecorationsWidth: m ? 26 : 10
|
|
3127
|
-
}), se &&
|
|
3127
|
+
}), se && oe && (re.current = k.editor.create(oe.editorDiv, {
|
|
3128
3128
|
model: z,
|
|
3129
3129
|
readOnly: !0,
|
|
3130
3130
|
automaticLayout: !0,
|
|
@@ -3132,7 +3132,7 @@ function ro(e) {
|
|
|
3132
3132
|
glyphMargin: !1,
|
|
3133
3133
|
...i,
|
|
3134
3134
|
lineDecorationsWidth: 10
|
|
3135
|
-
})),
|
|
3135
|
+
})), K.current = k.editor.create(J.editorDiv, {
|
|
3136
3136
|
model: q,
|
|
3137
3137
|
readOnly: !0,
|
|
3138
3138
|
automaticLayout: !0,
|
|
@@ -3141,42 +3141,50 @@ function ro(e) {
|
|
|
3141
3141
|
...i,
|
|
3142
3142
|
lineDecorationsWidth: m ? 26 : 10
|
|
3143
3143
|
}), m && G) {
|
|
3144
|
-
const
|
|
3145
|
-
|
|
3146
|
-
model:
|
|
3144
|
+
const ee = k.editor.createModel(r || "", E);
|
|
3145
|
+
$.current = k.editor.create(G.editorDiv, {
|
|
3146
|
+
model: ee,
|
|
3147
3147
|
automaticLayout: !0,
|
|
3148
3148
|
folding: !m,
|
|
3149
3149
|
glyphMargin: !1,
|
|
3150
3150
|
...i,
|
|
3151
3151
|
readOnly: !1,
|
|
3152
3152
|
lineDecorationsWidth: 26
|
|
3153
|
-
}),
|
|
3153
|
+
}), ee.onDidChangeContent(() => {
|
|
3154
3154
|
gt.current || ne(!0);
|
|
3155
3155
|
});
|
|
3156
3156
|
}
|
|
3157
3157
|
k.editor.setTheme(o);
|
|
3158
|
-
const he = xt(z,
|
|
3159
|
-
|
|
3158
|
+
const he = xt(z, ie, q);
|
|
3159
|
+
F(he), De.current = !0, l && C.current && K.current && l(
|
|
3160
|
+
{
|
|
3161
|
+
input1: C.current,
|
|
3162
|
+
input2: K.current,
|
|
3163
|
+
base: re.current,
|
|
3164
|
+
result: $.current
|
|
3165
|
+
},
|
|
3166
|
+
k
|
|
3167
|
+
);
|
|
3160
3168
|
}
|
|
3161
3169
|
}, [i, o, t, r, n, m, d, b, xt, l, h]), Ft = le(m), Ut = le(d), Vt = le(L), Jt = le(n);
|
|
3162
3170
|
return Se(() => {
|
|
3163
|
-
var P, U, Q, Y, _, ue, Z, H, J, se,
|
|
3164
|
-
const k = Ft.current !== m, O = Ut.current !== d, I = Vt.current !== L,
|
|
3165
|
-
if ((k || O || I ||
|
|
3171
|
+
var P, U, Q, Y, _, ue, Z, H, J, se, oe;
|
|
3172
|
+
const k = Ft.current !== m, O = Ut.current !== d, I = Vt.current !== L, B = Jt.current !== n;
|
|
3173
|
+
if ((k || O || I || B) && De.current) {
|
|
3166
3174
|
Ft.current = m, Ut.current = d, Vt.current = L, Jt.current = n, Be.current.forEach((he) => {
|
|
3167
3175
|
he.remove();
|
|
3168
3176
|
}), 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;
|
|
3169
|
-
const G = (Y = C.current) == null ? void 0 : Y.getModel(),
|
|
3170
|
-
(H = C.current) == null || H.dispose(), (J =
|
|
3177
|
+
const G = (Y = C.current) == null ? void 0 : Y.getModel(), ie = (_ = re.current) == null ? void 0 : _.getModel(), z = (ue = K.current) == null ? void 0 : ue.getModel(), q = (Z = $.current) == null ? void 0 : Z.getModel();
|
|
3178
|
+
(H = C.current) == null || H.dispose(), (J = re.current) == null || J.dispose(), (se = K.current) == null || se.dispose(), (oe = $.current) == null || oe.dispose(), G == null || G.dispose(), ie == null || ie.dispose(), z == null || z.dispose(), q == null || q.dispose(), De.current = !1, Te((he) => he + 1);
|
|
3171
3179
|
}
|
|
3172
3180
|
}, [m, d, L, n]), Se(() => {
|
|
3173
3181
|
!b && fe.current && Ie.current && !De.current && Bt();
|
|
3174
3182
|
}, [b, Bt]), Se(() => {
|
|
3175
|
-
!S || !i || (C.current && C.current.updateOptions(i),
|
|
3183
|
+
!S || !i || (C.current && C.current.updateOptions(i), K.current && K.current.updateOptions(i), re.current && re.current.updateOptions(i), $.current && $.current.updateOptions(i));
|
|
3176
3184
|
}, [i, S]), Se(() => {
|
|
3177
3185
|
S && T.length > 0 && ($t(), m && ot());
|
|
3178
3186
|
}, [S, T, $t, ot, m]), Se(() => {
|
|
3179
|
-
S && T.length > 0 && m &&
|
|
3187
|
+
S && T.length > 0 && m && $.current && rt(T);
|
|
3180
3188
|
}, [S, T, m, rt]), Se(() => {
|
|
3181
3189
|
if (!S) return;
|
|
3182
3190
|
const k = () => {
|
|
@@ -3184,18 +3192,18 @@ function ro(e) {
|
|
|
3184
3192
|
}, O = [], I = () => {
|
|
3185
3193
|
ot();
|
|
3186
3194
|
};
|
|
3187
|
-
return C.current && O.push(C.current.onDidScrollChange(I)),
|
|
3188
|
-
O.forEach((
|
|
3189
|
-
|
|
3195
|
+
return C.current && O.push(C.current.onDidScrollChange(I)), K.current && O.push(K.current.onDidScrollChange(I)), $.current && m && (O.push($.current.onDidScrollChange(k)), O.push($.current.onDidLayoutChange(k))), C.current && O.push(C.current.onDidLayoutChange(I)), K.current && O.push(K.current.onDidLayoutChange(I)), () => {
|
|
3196
|
+
O.forEach((B) => {
|
|
3197
|
+
B == null || B.dispose();
|
|
3190
3198
|
});
|
|
3191
3199
|
};
|
|
3192
3200
|
}, [S, ot, nt, m, w]), Se(() => {
|
|
3193
3201
|
if (!S) return;
|
|
3194
|
-
const k = [C.current,
|
|
3195
|
-
m &&
|
|
3202
|
+
const k = [C.current, re.current, K.current];
|
|
3203
|
+
m && $.current && k.push($.current);
|
|
3196
3204
|
const O = [];
|
|
3197
3205
|
let I = !1;
|
|
3198
|
-
const
|
|
3206
|
+
const B = (P) => {
|
|
3199
3207
|
if (I) return;
|
|
3200
3208
|
I = !0;
|
|
3201
3209
|
const U = P.getScrollTop(), Q = P.getScrollLeft();
|
|
@@ -3208,7 +3216,7 @@ function ro(e) {
|
|
|
3208
3216
|
return k.forEach((P) => {
|
|
3209
3217
|
P && O.push(
|
|
3210
3218
|
P.onDidScrollChange(() => {
|
|
3211
|
-
|
|
3219
|
+
B(P);
|
|
3212
3220
|
})
|
|
3213
3221
|
);
|
|
3214
3222
|
}), () => {
|
|
@@ -3217,10 +3225,10 @@ function ro(e) {
|
|
|
3217
3225
|
});
|
|
3218
3226
|
};
|
|
3219
3227
|
}, [S, m]), Se(() => () => {
|
|
3220
|
-
var P, U, Q, Y, _, ue, Z, H, J, se,
|
|
3228
|
+
var P, U, Q, Y, _, ue, Z, H, J, se, oe;
|
|
3221
3229
|
(P = Fe.current) == null || P.set([]), (U = Ue.current) == null || U.set([]), (Q = Ve.current) == null || Q.set([]);
|
|
3222
|
-
const k = (Y = C.current) == null ? void 0 : Y.getModel(), O = (_ =
|
|
3223
|
-
(H = C.current) == null || H.dispose(), (J =
|
|
3230
|
+
const k = (Y = C.current) == null ? void 0 : Y.getModel(), O = (_ = re.current) == null ? void 0 : _.getModel(), I = (ue = K.current) == null ? void 0 : ue.getModel(), B = (Z = $.current) == null ? void 0 : Z.getModel();
|
|
3231
|
+
(H = C.current) == null || H.dispose(), (J = re.current) == null || J.dispose(), (se = K.current) == null || se.dispose(), (oe = $.current) == null || oe.dispose(), k == null || k.dispose(), O == null || O.dispose(), I == null || I.dispose(), B == null || B.dispose(), De.current = !1, g(!1);
|
|
3224
3232
|
}, []), b || !S ? /* @__PURE__ */ st(On, { children: u ?? /* @__PURE__ */ st(Kr, {}) }) : /* @__PURE__ */ st("div", { ref: Ie, style: { width: s, height: c }, className: a });
|
|
3225
3233
|
}
|
|
3226
3234
|
export {
|