@knpkv/rly 0.8.0 → 0.10.0

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.
Files changed (91) hide show
  1. package/README.md +49 -3
  2. package/dist/{Dialog-_t9OodCK.js → Dialog-B9Ub_gMT.js} +79 -62
  3. package/dist/Dialog-B9Ub_gMT.js.map +1 -0
  4. package/dist/components.css +2 -2
  5. package/dist/diff/bounded/index.js +317 -303
  6. package/dist/diff/bounded/index.js.map +1 -1
  7. package/dist/diff/index.js +2436 -2433
  8. package/dist/diff/index.js.map +1 -1
  9. package/dist/diff/patch/index.js +188 -186
  10. package/dist/diff/patch/index.js.map +1 -1
  11. package/dist/diff/workbench/index.js +1 -1
  12. package/dist/dts/diff/DiffCodeView.d.ts.map +1 -1
  13. package/dist/dts/diff/DiffFileTree.d.ts.map +1 -1
  14. package/dist/dts/diff/DiffFinding.d.ts.map +1 -1
  15. package/dist/dts/diff/DiffHeader.d.ts.map +1 -1
  16. package/dist/dts/diff/bounded/BoundedDiffCodeView.d.ts.map +1 -1
  17. package/dist/dts/diff/patch/PatchDiffView.d.ts.map +1 -1
  18. package/dist/dts/internal/useNarrowerThan.d.ts +10 -0
  19. package/dist/dts/internal/useNarrowerThan.d.ts.map +1 -0
  20. package/dist/dts/patterns/AgentThread.d.ts.map +1 -1
  21. package/dist/dts/patterns/DecisionBar.d.ts +68 -0
  22. package/dist/dts/patterns/DecisionBar.d.ts.map +1 -0
  23. package/dist/dts/patterns/FreshnessStamp.d.ts.map +1 -1
  24. package/dist/dts/patterns/Hero.d.ts +69 -0
  25. package/dist/dts/patterns/Hero.d.ts.map +1 -0
  26. package/dist/dts/patterns/Region.d.ts +56 -0
  27. package/dist/dts/patterns/Region.d.ts.map +1 -0
  28. package/dist/dts/patterns/ReleaseRelay.d.ts.map +1 -1
  29. package/dist/dts/patterns/StageRail.d.ts +11 -1
  30. package/dist/dts/patterns/StageRail.d.ts.map +1 -1
  31. package/dist/dts/patterns/TimelineRow.d.ts +25 -0
  32. package/dist/dts/patterns/TimelineRow.d.ts.map +1 -1
  33. package/dist/dts/patterns/Verdict.d.ts +1 -1
  34. package/dist/dts/patterns/Verdict.d.ts.map +1 -1
  35. package/dist/dts/patterns/index.d.ts +8 -2
  36. package/dist/dts/patterns/index.d.ts.map +1 -1
  37. package/dist/dts/primitives/Button.d.ts +9 -4
  38. package/dist/dts/primitives/Button.d.ts.map +1 -1
  39. package/dist/dts/primitives/ChartLegend.d.ts +23 -0
  40. package/dist/dts/primitives/ChartLegend.d.ts.map +1 -0
  41. package/dist/dts/primitives/Field.d.ts +8 -3
  42. package/dist/dts/primitives/Field.d.ts.map +1 -1
  43. package/dist/dts/primitives/IconButton.d.ts +9 -4
  44. package/dist/dts/primitives/IconButton.d.ts.map +1 -1
  45. package/dist/dts/primitives/LimitTrack.d.ts +62 -0
  46. package/dist/dts/primitives/LimitTrack.d.ts.map +1 -0
  47. package/dist/dts/primitives/Notice.d.ts +5 -5
  48. package/dist/dts/primitives/Select.d.ts +8 -3
  49. package/dist/dts/primitives/Select.d.ts.map +1 -1
  50. package/dist/dts/primitives/StateLabel.d.ts +6 -6
  51. package/dist/dts/primitives/StateLabel.d.ts.map +1 -1
  52. package/dist/dts/primitives/StatePanel.d.ts +7 -6
  53. package/dist/dts/primitives/StatePanel.d.ts.map +1 -1
  54. package/dist/dts/primitives/ThemeSelect.d.ts +3 -2
  55. package/dist/dts/primitives/ThemeSelect.d.ts.map +1 -1
  56. package/dist/dts/primitives/ToggleGroup.d.ts +9 -4
  57. package/dist/dts/primitives/ToggleGroup.d.ts.map +1 -1
  58. package/dist/dts/primitives/TrackKey.d.ts +20 -0
  59. package/dist/dts/primitives/TrackKey.d.ts.map +1 -0
  60. package/dist/dts/primitives/index.d.ts +6 -0
  61. package/dist/dts/primitives/index.d.ts.map +1 -1
  62. package/dist/dts/tokens/control.d.ts +27 -0
  63. package/dist/dts/tokens/control.d.ts.map +1 -0
  64. package/dist/dts/tokens/index.d.ts +2 -2
  65. package/dist/dts/tokens/index.d.ts.map +1 -1
  66. package/dist/dts/tokens/semantic-tokens.d.ts +3 -1
  67. package/dist/dts/tokens/semantic-tokens.d.ts.map +1 -1
  68. package/dist/generated-tokens.css +55 -6
  69. package/dist/index.js +5 -5
  70. package/dist/patterns/index.js +2 -2
  71. package/dist/{patterns-LJ8Y44f2.js → patterns-DTsU3pFo.js} +1251 -954
  72. package/dist/patterns-DTsU3pFo.js.map +1 -0
  73. package/dist/primitives/index.js +3 -3
  74. package/dist/primitives-CgvvYKjR.js +589 -0
  75. package/dist/primitives-CgvvYKjR.js.map +1 -0
  76. package/dist/tokens/index.js +2 -2
  77. package/dist/{tokens-CjK9bxo7.js → tokens-B075JP3Z.js} +8 -3
  78. package/dist/tokens-B075JP3Z.js.map +1 -0
  79. package/dist/useNarrowerThan-B1PM32sm.js +21 -0
  80. package/dist/useNarrowerThan-B1PM32sm.js.map +1 -0
  81. package/dist/{workbench-4C25n_BY.js → workbench-CHCnYW3G.js} +107 -131
  82. package/dist/workbench-CHCnYW3G.js.map +1 -0
  83. package/package.json +5 -3
  84. package/registry/components.json +707 -25
  85. package/registry/search.json +172 -2
  86. package/dist/Dialog-_t9OodCK.js.map +0 -1
  87. package/dist/patterns-LJ8Y44f2.js.map +0 -1
  88. package/dist/primitives-CjQX0eVM.js +0 -453
  89. package/dist/primitives-CjQX0eVM.js.map +0 -1
  90. package/dist/tokens-CjK9bxo7.js.map +0 -1
  91. package/dist/workbench-4C25n_BY.js.map +0 -1
@@ -1,6 +1,7 @@
1
- import { Fragment as e } from "react";
2
- import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
3
- var i = {
1
+ import { t as e } from "../../useNarrowerThan-B1PM32sm.js";
2
+ import { Fragment as t } from "react";
3
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ var a = {
4
5
  root: "rly_BoundedDiffCodeView-module__root",
5
6
  file: "rly_BoundedDiffCodeView-module__file",
6
7
  noChanges: "rly_BoundedDiffCodeView-module__noChanges",
@@ -21,16 +22,16 @@ var i = {
21
22
  annotationRow: "rly_BoundedDiffCodeView-module__annotationRow",
22
23
  annotationCell: "rly_BoundedDiffCodeView-module__annotationCell",
23
24
  annotation: "rly_BoundedDiffCodeView-module__annotation"
24
- }, a = (e) => ({
25
+ }, o = (e) => ({
25
26
  _tag: "PatchInvalid",
26
27
  reason: e
27
- }), o = /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(.*)$/, s = "diff --git ", c = (e) => {
28
- if (e.includes("\0")) return a("Git paths cannot contain NUL");
28
+ }), s = /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(.*)$/, c = "diff --git ", l = (e) => {
29
+ if (e.includes("\0")) return o("Git paths cannot contain NUL");
29
30
  if (!e.startsWith("\"")) return {
30
31
  _tag: "Path",
31
32
  path: e
32
33
  };
33
- if (!e.endsWith("\"")) return a("Unclosed quoted path");
34
+ if (!e.endsWith("\"")) return o("Unclosed quoted path");
34
35
  let t = e.slice(1, -1), n = [], r = new TextEncoder(), i = /* @__PURE__ */ new Map([
35
36
  ["a", 7],
36
37
  ["b", 8],
@@ -41,18 +42,18 @@ var i = {
41
42
  ["r", 13],
42
43
  ["\"", 34],
43
44
  ["\\", 92]
44
- ]), o = 0;
45
+ ]), a = 0;
45
46
  for (let e of t.matchAll(/\\([0-7]{3}|.)/gs)) {
46
- let s = t.slice(o, e.index);
47
- if (s.includes("\"")) return a("Unescaped quote in quoted path");
47
+ let s = t.slice(a, e.index);
48
+ if (s.includes("\"")) return o("Unescaped quote in quoted path");
48
49
  for (let e of r.encode(s)) n.push(e);
49
50
  let c = e[1] ?? "", l = /^[0-7]{3}$/.test(c) ? parseInt(c, 8) : i.get(c);
50
- if (l === void 0 || l === 0 || l > 255) return a("Invalid quoted path escape");
51
- n.push(l), o = e.index + e[0].length;
51
+ if (l === void 0 || l === 0 || l > 255) return o("Invalid quoted path escape");
52
+ n.push(l), a = e.index + e[0].length;
52
53
  }
53
- let s = t.slice(o);
54
- if (s.includes("\\")) return a("Dangling quoted path escape");
55
- if (s.includes("\"")) return a("Unescaped quote in quoted path");
54
+ let s = t.slice(a);
55
+ if (s.includes("\\")) return o("Dangling quoted path escape");
56
+ if (s.includes("\"")) return o("Unescaped quote in quoted path");
56
57
  for (let e of r.encode(s)) n.push(e);
57
58
  try {
58
59
  return {
@@ -63,36 +64,36 @@ var i = {
63
64
  }).decode(new Uint8Array(n))
64
65
  };
65
66
  } catch {
66
- return a("Quoted Git path is not valid UTF-8");
67
+ return o("Quoted Git path is not valid UTF-8");
67
68
  }
68
- }, l = (e, t, n, r, i, o = !1) => {
69
+ }, u = (e, t, n, r, i, a = !1) => {
69
70
  let s = [];
70
- for (let a = 0; a < e.length; a++) {
71
- if (e[a] !== " ") continue;
72
- let l = c(e.slice(0, a)), u = c(e.slice(a + 1));
73
- if (l._tag === "PatchInvalid" || u._tag === "PatchInvalid" || l.path === "" || u.path === "" || t !== void 0 && t !== "/dev/null" && t !== l.path || n !== void 0 && n !== "/dev/null" && n !== u.path) continue;
74
- let d = r === void 0 && l.path.startsWith("a/") && u.path.startsWith("b/"), f = r ?? (d ? {
71
+ for (let o = 0; o < e.length; o++) {
72
+ if (e[o] !== " ") continue;
73
+ let c = l(e.slice(0, o)), u = l(e.slice(o + 1));
74
+ if (c._tag === "PatchInvalid" || u._tag === "PatchInvalid" || c.path === "" || u.path === "" || t !== void 0 && t !== "/dev/null" && t !== c.path || n !== void 0 && n !== "/dev/null" && n !== u.path) continue;
75
+ let d = r === void 0 && c.path.startsWith("a/") && u.path.startsWith("b/"), f = r ?? (d ? {
75
76
  source: "a/",
76
77
  destination: "b/"
77
78
  } : {
78
79
  source: "",
79
80
  destination: ""
80
81
  });
81
- if (!l.path.startsWith(f.source) || !u.path.startsWith(f.destination)) continue;
82
- let p = l.path.slice(f.source.length), m = u.path.slice(f.destination.length);
83
- p !== "" && m !== "" && (i === void 0 || p === i.source && m === i.destination) && (i !== void 0 || t !== void 0 || n !== void 0 || p === m || o && (d || r !== void 0)) && s.push({
82
+ if (!c.path.startsWith(f.source) || !u.path.startsWith(f.destination)) continue;
83
+ let p = c.path.slice(f.source.length), m = u.path.slice(f.destination.length);
84
+ p !== "" && m !== "" && (i === void 0 || p === i.source && m === i.destination) && (i !== void 0 || t !== void 0 || n !== void 0 || p === m || a && (d || r !== void 0)) && s.push({
84
85
  oldPath: p,
85
86
  newPath: m
86
87
  });
87
88
  }
88
- let l = s[0];
89
- return s.length === 1 && l !== void 0 ? {
89
+ let c = s[0];
90
+ return s.length === 1 && c !== void 0 ? {
90
91
  _tag: "Paths",
91
- ...l
92
- } : a("Inconsistent or ambiguous Git file headers; custom prefixes must be supplied explicitly");
93
- }, u = (e, t, n, r, i) => {
94
- if (!t.endsWith(" differ")) return a("Incomplete binary summary");
95
- let o = t.slice(13, -7), s = n === void 0 ? [{
92
+ ...c
93
+ } : o("Inconsistent or ambiguous Git file headers; custom prefixes must be supplied explicitly");
94
+ }, d = (e, t, n, r, i) => {
95
+ if (!t.endsWith(" differ")) return o("Incomplete binary summary");
96
+ let a = t.slice(13, -7), s = n === void 0 ? [{
96
97
  source: "a/",
97
98
  destination: "b/"
98
99
  }, {
@@ -101,118 +102,118 @@ var i = {
101
102
  }] : [n];
102
103
  for (let t of s) {
103
104
  let n = [];
104
- for (let a of o.matchAll(/(?= and )/g)) {
105
- let s = c(o.slice(0, a.index)), u = c(o.slice(a.index + 5));
106
- if (s._tag === "PatchInvalid" || u._tag === "PatchInvalid" || s.path === "/dev/null" != (i === "added") || u.path === "/dev/null" != (i === "deleted")) continue;
107
- let d = l(e, s.path, u.path, t, r);
105
+ for (let o of a.matchAll(/(?= and )/g)) {
106
+ let s = l(a.slice(0, o.index)), c = l(a.slice(o.index + 5));
107
+ if (s._tag === "PatchInvalid" || c._tag === "PatchInvalid" || s.path === "/dev/null" != (i === "added") || c.path === "/dev/null" != (i === "deleted")) continue;
108
+ let d = u(e, s.path, c.path, t, r);
108
109
  d._tag === "Paths" && n.push(d);
109
110
  }
110
111
  let s = n[0];
111
112
  if (n.length === 1 && s !== void 0) return s;
112
- if (n.length > 1) return a("Ambiguous binary summary paths");
113
+ if (n.length > 1) return o("Ambiguous binary summary paths");
113
114
  }
114
- return a("Binary summary paths disagree with Git headers");
115
- }, d = (e, t) => {
116
- if (e !== "" && !e.endsWith("\n")) return a("Unterminated patch record");
117
- let n = e.split("\n"), r = n.some((e) => e.startsWith(s) && e.endsWith("\r")) ? n.map((e) => e.endsWith("\r") ? e.slice(0, -1) : e) : n, i = [], d = /* @__PURE__ */ new Set(), m = 0;
118
- for (; m < r.length;) {
119
- let e = r[m] ?? "";
120
- if (!e.startsWith(s)) {
121
- m += 1;
115
+ return o("Binary summary paths disagree with Git headers");
116
+ }, f = (e, t) => {
117
+ if (e !== "" && !e.endsWith("\n")) return o("Unterminated patch record");
118
+ let n = e.split("\n"), r = n.some((e) => e.startsWith(c) && e.endsWith("\r")) ? n.map((e) => e.endsWith("\r") ? e.slice(0, -1) : e) : n, i = [], a = /* @__PURE__ */ new Set(), f = 0;
119
+ for (; f < r.length;) {
120
+ let e = r[f] ?? "";
121
+ if (!e.startsWith(c)) {
122
+ f += 1;
122
123
  continue;
123
124
  }
124
125
  let n = e.slice(11), h, g, _, v, y = "modified", b, x, S, C = !1, w, T = [], E = 0, D = 0, O = !1, k = !1, A = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Set();
125
- for (m += 1; m < r.length && !(r[m] ?? "").startsWith(s);) {
126
- let e = r[m] ?? "";
126
+ for (f += 1; f < r.length && !(r[f] ?? "").startsWith(c);) {
127
+ let e = r[f] ?? "";
127
128
  if (/^(new file|deleted file|old|new) mode/.test(e)) {
128
129
  let t = /^(new file|deleted file|old|new) mode ([0-7]{6})$/.exec(e);
129
- if (t === null) return a("Invalid file mode header");
130
+ if (t === null) return o("Invalid file mode header");
130
131
  let n = t[2];
131
132
  if (t[1] === "old") {
132
- if (x !== void 0 && x !== n) return a("Conflicting old modes");
133
+ if (x !== void 0 && x !== n) return o("Conflicting old modes");
133
134
  x = n;
134
135
  } else if (t[1] === "new") {
135
- if (S !== void 0 && S !== n) return a("Conflicting new modes");
136
+ if (S !== void 0 && S !== n) return o("Conflicting new modes");
136
137
  S = n;
137
138
  } else {
138
139
  let e = t[1] === "new file" ? "added" : "deleted";
139
- if (y !== "modified" && y !== e) return a("Conflicting file status headers");
140
- if (b !== void 0 && b !== n) return a("Conflicting file modes");
140
+ if (y !== "modified" && y !== e) return o("Conflicting file status headers");
141
+ if (b !== void 0 && b !== n) return o("Conflicting file modes");
141
142
  y = e, b = n;
142
143
  }
143
144
  } else if (/^(rename|copy) (from|to) /.test(e)) {
144
145
  let t = e.startsWith("copy ") ? "copied" : "renamed";
145
- if (y !== "modified" && y !== t) return a("Conflicting file status headers");
146
+ if (y !== "modified" && y !== t) return o("Conflicting file status headers");
146
147
  y = t;
147
- let n = c(e.replace(/^(rename|copy) (from|to) /, ""));
148
+ let n = l(e.replace(/^(rename|copy) (from|to) /, ""));
148
149
  if (n._tag === "PatchInvalid") return n;
149
150
  if (/^(rename|copy) from /.test(e)) {
150
- if (_ !== void 0 && _ !== n.path) return a("Conflicting move source paths");
151
+ if (_ !== void 0 && _ !== n.path) return o("Conflicting move source paths");
151
152
  _ = n.path;
152
153
  } else {
153
- if (v !== void 0 && v !== n.path) return a("Conflicting move destination paths");
154
+ if (v !== void 0 && v !== n.path) return o("Conflicting move destination paths");
154
155
  v = n.path;
155
156
  }
156
157
  } else if (e.startsWith("GIT binary patch")) {
157
- if (e !== "GIT binary patch") return a("Invalid binary patch marker");
158
- let t = f(r, m + 1);
158
+ if (e !== "GIT binary patch") return o("Invalid binary patch marker");
159
+ let t = p(r, f + 1);
159
160
  if (t._tag === "PatchInvalid") return t;
160
- C = !0, m = t.next;
161
+ C = !0, f = t.next;
161
162
  continue;
162
163
  } else if (e.startsWith("Binary files ")) {
163
- if (w !== void 0 && w !== e) return a("Conflicting binary summaries");
164
+ if (w !== void 0 && w !== e) return o("Conflicting binary summaries");
164
165
  w = e, C = !0;
165
166
  } else if (e.startsWith("--- ") || e.startsWith("+++ ")) {
166
- let t = c(e.slice(4).replace(/\t$/, ""));
167
+ let t = l(e.slice(4).replace(/\t$/, ""));
167
168
  if (t._tag === "PatchInvalid") return t;
168
169
  if (e.startsWith("--- ")) {
169
- if (h !== void 0 && h !== t.path) return a("Conflicting source file markers");
170
+ if (h !== void 0 && h !== t.path) return o("Conflicting source file markers");
170
171
  h = t.path;
171
172
  } else {
172
- if (g !== void 0 && g !== t.path) return a("Conflicting destination file markers");
173
+ if (g !== void 0 && g !== t.path) return o("Conflicting destination file markers");
173
174
  g = t.path;
174
175
  }
175
- } else if (o.test(e)) {
176
- if (h === void 0 || g === void 0) return a("Text hunks require paired file markers");
177
- let e = p(r, m);
176
+ } else if (s.test(e)) {
177
+ if (h === void 0 || g === void 0) return o("Text hunks require paired file markers");
178
+ let e = m(r, f);
178
179
  if (e._tag === "PatchInvalid") return e;
179
- if (!e.hunk.lines.some((e) => e.kind === "add" || e.kind === "del")) return a("Text hunk has no change evidence");
180
- if (e.oldOffset < E || e.newOffset < D) return a("Hunk ranges move backwards");
180
+ if (!e.hunk.lines.some((e) => e.kind === "add" || e.kind === "del")) return o("Text hunk has no change evidence");
181
+ if (e.oldOffset < E || e.newOffset < D) return o("Hunk ranges move backwards");
181
182
  E = e.oldEnd, D = e.newEnd;
182
183
  for (let t of e.hunk.lines) {
183
- if (O && t.oldNo !== void 0 || k && t.newNo !== void 0) return a("Patch records follow an EOF marker on the same side");
184
- if (t.noNewline === !0 && (O ||= t.oldNo !== void 0, k ||= t.newNo !== void 0), t.oldNo !== void 0 && A.has(t.oldNo) || t.newNo !== void 0 && j.has(t.newNo)) return a(`Overlapping hunk at line ${m + 1}`);
184
+ if (O && t.oldNo !== void 0 || k && t.newNo !== void 0) return o("Patch records follow an EOF marker on the same side");
185
+ if (t.noNewline === !0 && (O ||= t.oldNo !== void 0, k ||= t.newNo !== void 0), t.oldNo !== void 0 && A.has(t.oldNo) || t.newNo !== void 0 && j.has(t.newNo)) return o(`Overlapping hunk at line ${f + 1}`);
185
186
  t.oldNo !== void 0 && A.add(t.oldNo), t.newNo !== void 0 && j.add(t.newNo);
186
187
  }
187
- T.push(e.hunk), m = e.next;
188
+ T.push(e.hunk), f = e.next;
188
189
  continue;
189
- } else if (/^(?:@@|[+\- \\])/.test(e)) return a(`Unexpected patch body at line ${m + 1}`);
190
- m += 1;
190
+ } else if (/^(?:@@|[+\- \\])/.test(e)) return o(`Unexpected patch body at line ${f + 1}`);
191
+ f += 1;
191
192
  }
192
- if (h === void 0 != (g === void 0)) return a("Unpaired file markers");
193
- if (_ === void 0 != (v === void 0)) return a("Unpaired rename or copy headers");
194
- if (x === void 0 != (S === void 0)) return a("Unpaired mode transition");
195
- if (b !== void 0 && x !== void 0) return a("Conflicting file mode headers");
196
- if (x !== void 0 && (h === "/dev/null" || g === "/dev/null")) return a("Mode transition requires both file sides");
197
- if (C && h !== void 0) return a("Mixed binary and text bodies");
198
- if (h !== void 0 && T.length === 0) return a("Text markers require hunks");
199
- if (h === "/dev/null" && g === "/dev/null") return a("Both file sides are absent");
200
- if (T.some((e) => e.lines.some((e) => h === "/dev/null" && e.oldNo !== void 0 || g === "/dev/null" && e.newNo !== void 0))) return a("Absent file side contains text lines");
193
+ if (h === void 0 != (g === void 0)) return o("Unpaired file markers");
194
+ if (_ === void 0 != (v === void 0)) return o("Unpaired rename or copy headers");
195
+ if (x === void 0 != (S === void 0)) return o("Unpaired mode transition");
196
+ if (b !== void 0 && x !== void 0) return o("Conflicting file mode headers");
197
+ if (x !== void 0 && (h === "/dev/null" || g === "/dev/null")) return o("Mode transition requires both file sides");
198
+ if (C && h !== void 0) return o("Mixed binary and text bodies");
199
+ if (h !== void 0 && T.length === 0) return o("Text markers require hunks");
200
+ if (h === "/dev/null" && g === "/dev/null") return o("Both file sides are absent");
201
+ if (T.some((e) => e.lines.some((e) => h === "/dev/null" && e.oldNo !== void 0 || g === "/dev/null" && e.newNo !== void 0))) return o("Absent file side contains text lines");
201
202
  if (h !== void 0) {
202
203
  let e = h === "/dev/null" ? "added" : g === "/dev/null" ? "deleted" : "modified";
203
- if ((y === "added" || y === "deleted" || e !== "modified") && y !== "modified" && y !== e) return a("File status disagrees with file markers");
204
+ if ((y === "added" || y === "deleted" || e !== "modified") && y !== "modified" && y !== e) return o("File status disagrees with file markers");
204
205
  e !== "modified" && (y = e);
205
206
  }
206
- if (T.length === 0 && !C && _ === void 0 && b === void 0 && (x === void 0 || x === S)) return a("File block has no change evidence");
207
+ if (T.length === 0 && !C && _ === void 0 && b === void 0 && (x === void 0 || x === S)) return o("File block has no change evidence");
207
208
  let M = _ === void 0 || v === void 0 ? void 0 : {
208
209
  source: _,
209
210
  destination: v
210
- }, N = w === void 0 ? l(n, h, g, t, M, C) : u(n, w, t, M, y);
211
+ }, N = w === void 0 ? u(n, h, g, t, M, C) : d(n, w, t, M, y);
211
212
  if (N._tag === "PatchInvalid") return N;
212
- if (C && h === void 0 && M === void 0 && y !== "modified" && N.oldPath !== N.newPath) return a("Binary addition or deletion has conflicting header paths");
213
+ if (C && h === void 0 && M === void 0 && y !== "modified" && N.oldPath !== N.newPath) return o("Binary addition or deletion has conflicting header paths");
213
214
  let P = y === "deleted" ? N.oldPath : N.newPath;
214
- if (d.has(P)) return a("Duplicate canonical current file path");
215
- d.add(P), i.push({
215
+ if (a.has(P)) return o("Duplicate canonical current file path");
216
+ a.add(P), i.push({
216
217
  path: P,
217
218
  oldPath: N.oldPath,
218
219
  newPath: N.newPath,
@@ -223,43 +224,43 @@ var i = {
223
224
  hunks: T
224
225
  });
225
226
  }
226
- return i.length === 0 && e.trim() !== "" ? a("Expected a git unified diff") : {
227
+ return i.length === 0 && e.trim() !== "" ? o("Expected a git unified diff") : {
227
228
  _tag: "Patch",
228
229
  patch: { files: i }
229
230
  };
230
- }, f = (e, t) => {
231
+ }, p = (e, t) => {
231
232
  let n = t, r = 0;
232
233
  do {
233
234
  let t = /^(literal|delta) (\d+)$/.exec(e[n] ?? "");
234
- if (t === null || !Number.isSafeInteger(Number(t[2]))) return a("Invalid binary chunk header");
235
+ if (t === null || !Number.isSafeInteger(Number(t[2]))) return o("Invalid binary chunk header");
235
236
  n += 1;
236
237
  let i = n;
237
238
  for (; n < e.length && e[n] !== "";) {
238
239
  let t = e[n] ?? "", r = t.charCodeAt(0), i = r >= 65 && r <= 90 ? r - 64 : r >= 97 && r <= 122 ? r - 70 : 0;
239
- if (i === 0 || t.length !== 1 + Math.ceil(i / 4) * 5 || !/^[0-9A-Za-z!#$%&()*+;<=>?@^_`{|}~-]+$/.test(t.slice(1))) return a("Invalid binary chunk data");
240
+ if (i === 0 || t.length !== 1 + Math.ceil(i / 4) * 5 || !/^[0-9A-Za-z!#$%&()*+;<=>?@^_`{|}~-]+$/.test(t.slice(1))) return o("Invalid binary chunk data");
240
241
  n += 1;
241
242
  }
242
- if (n === i || n >= e.length - 1) return a("Incomplete binary chunk");
243
+ if (n === i || n >= e.length - 1) return o("Incomplete binary chunk");
243
244
  n += 1, r += 1;
244
245
  } while (r < 2 && /^(literal|delta)(?:\s|$)/.test(e[n] ?? ""));
245
- return /^(literal|delta)(?:\s|$)/.test(e[n] ?? "") ? a("Surplus binary chunk") : {
246
+ return /^(literal|delta)(?:\s|$)/.test(e[n] ?? "") ? o("Surplus binary chunk") : {
246
247
  _tag: "Binary",
247
248
  next: n
248
249
  };
249
- }, p = (e, t) => {
250
- let n = o.exec(e[t] ?? "");
251
- if (n === null) return a(`not a hunk header at line ${t + 1}`);
252
- let r = Number(n[1]), i = Number(n[3]), s = n[2] === void 0 ? 1 : Number(n[2]), c = n[4] === void 0 ? 1 : Number(n[4]);
250
+ }, m = (e, t) => {
251
+ let n = s.exec(e[t] ?? "");
252
+ if (n === null) return o(`not a hunk header at line ${t + 1}`);
253
+ let r = Number(n[1]), i = Number(n[3]), a = n[2] === void 0 ? 1 : Number(n[2]), c = n[4] === void 0 ? 1 : Number(n[4]);
253
254
  if (![
254
255
  r,
255
256
  i,
256
- s,
257
+ a,
257
258
  c
258
- ].every(Number.isSafeInteger)) return a("Unsafe hunk integers");
259
- if (s === 0 && c === 0) return a("Empty hunk");
260
- if (s > 0 && !Number.isSafeInteger(r + (s - 1)) || c > 0 && !Number.isSafeInteger(i + (c - 1))) return a("Hunk coordinates overflow");
261
- let l = r - (s === 0 ? 0 : 1), u = i - (c === 0 ? 0 : 1), d = l + s, f = u + c, p = r, m = i, h = [], g = t + 1;
262
- for (; g < e.length && (s > 0 || c > 0);) {
259
+ ].every(Number.isSafeInteger)) return o("Unsafe hunk integers");
260
+ if (a === 0 && c === 0) return o("Empty hunk");
261
+ if (a > 0 && !Number.isSafeInteger(r + (a - 1)) || c > 0 && !Number.isSafeInteger(i + (c - 1))) return o("Hunk coordinates overflow");
262
+ let l = r - (a === 0 ? 0 : 1), u = i - (c === 0 ? 0 : 1), d = l + a, f = u + c, p = r, m = i, h = [], g = t + 1;
263
+ for (; g < e.length && (a > 0 || c > 0);) {
263
264
  let t = e[g] ?? "", n = t[0], r = t.slice(1);
264
265
  if (n === "+") h.push({
265
266
  kind: "add",
@@ -270,16 +271,16 @@ var i = {
270
271
  kind: "del",
271
272
  text: r,
272
273
  oldNo: p
273
- }), p += 1, --s;
274
+ }), p += 1, --a;
274
275
  else if (n === " ") h.push({
275
276
  kind: "context",
276
277
  text: r,
277
278
  oldNo: p,
278
279
  newNo: m
279
- }), p += 1, m += 1, --s, --c;
280
+ }), p += 1, m += 1, --a, --c;
280
281
  else break;
281
282
  if (g += 1, (e[g] ?? "").startsWith("\\")) {
282
- if (e[g] !== "\") return a(`Invalid newline marker at line ${g + 1}`);
283
+ if (e[g] !== "\") return o(`Invalid newline marker at line ${g + 1}`);
283
284
  let t = h[h.length - 1];
284
285
  t !== void 0 && (h[h.length - 1] = {
285
286
  ...t,
@@ -287,7 +288,7 @@ var i = {
287
288
  }), g += 1;
288
289
  }
289
290
  }
290
- return s !== 0 || c !== 0 ? a(`Incomplete hunk at line ${t + 1}`) : {
291
+ return a !== 0 || c !== 0 ? o(`Incomplete hunk at line ${t + 1}`) : {
291
292
  _tag: "Hunk",
292
293
  oldOffset: l,
293
294
  newOffset: u,
@@ -301,7 +302,7 @@ var i = {
301
302
  },
302
303
  next: g
303
304
  };
304
- }, m = (e) => e.status === "renamed" || e.status === "modified" && e.oldPath !== e.newPath ? [e.newPath, e.oldPath] : [e.path], h = (e, t) => e.files.find((e) => e.path === t) ?? e.files.find((e) => m(e).includes(t)), g = (e) => {
305
+ }, h = (e) => e.status === "renamed" || e.status === "modified" && e.oldPath !== e.newPath ? [e.newPath, e.oldPath] : [e.path], g = (e, t) => e.files.find((e) => e.path === t) ?? e.files.find((e) => h(e).includes(t)), _ = (e) => {
305
306
  let t = [], n = 0;
306
307
  for (; n < e.lines.length;) {
307
308
  let r = e.lines[n];
@@ -331,136 +332,137 @@ var i = {
331
332
  }
332
333
  }
333
334
  return t;
334
- }, _ = ({ file: a, id: o, mode: s = "split", renderAnnotation: c, wrap: l = !1 }) => {
335
- let u = (e, a) => {
336
- let s = a === "old" ? e?.oldNo : e?.newNo;
337
- return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("td", {
338
- className: i.lineNumber,
339
- children: s
340
- }), /* @__PURE__ */ n("td", {
341
- className: a === "old" ? i.deletionCode : i.additionCode,
342
- children: e === void 0 ? null : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("code", {
343
- className: l ? i.wrappedCode : i.code,
344
- id: `${o}-${a}-${s}`,
335
+ }, v = ({ file: o, id: s, mode: c = "split", renderAnnotation: l, wrap: u = !1 }) => {
336
+ let [d, f] = e(720), p = c === "split" && d ? "stacked" : c, m = (e, t) => {
337
+ let o = t === "old" ? e?.oldNo : e?.newNo;
338
+ return /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("td", {
339
+ className: a.lineNumber,
340
+ children: o
341
+ }), /* @__PURE__ */ r("td", {
342
+ className: t === "old" ? a.deletionCode : a.additionCode,
343
+ children: e === void 0 ? null : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("code", {
344
+ className: u ? a.wrappedCode : a.code,
345
+ id: `${s}-${t}-${o}`,
345
346
  tabIndex: -1,
346
347
  children: e.text || " "
347
- }), e.noNewline === !0 ? /* @__PURE__ */ n("small", {
348
- "aria-label": `${a === "old" ? "Before" : "After"}: no newline`,
348
+ }), e.noNewline === !0 ? /* @__PURE__ */ r("small", {
349
+ "aria-label": `${t === "old" ? "Before" : "After"}: no newline`,
349
350
  children: "No newline at end of file"
350
351
  }) : null] })
351
352
  })] });
352
- }, d = (e, t) => {
353
- let r = t === "old" ? e?.oldNo : e?.newNo, a = r === void 0 ? void 0 : c?.(t, r);
354
- return a == null ? null : /* @__PURE__ */ n("tr", {
355
- className: i.annotationRow,
356
- children: /* @__PURE__ */ n("td", {
357
- className: i.annotationCell,
353
+ }, h = (e, t) => {
354
+ let n = t === "old" ? e?.oldNo : e?.newNo, i = n === void 0 ? void 0 : l?.(t, n);
355
+ return i == null ? null : /* @__PURE__ */ r("tr", {
356
+ className: a.annotationRow,
357
+ children: /* @__PURE__ */ r("td", {
358
+ className: a.annotationCell,
358
359
  colSpan: 4,
359
- children: a
360
+ children: i
360
361
  })
361
362
  });
362
363
  };
363
- return /* @__PURE__ */ r("div", {
364
- className: i.root,
364
+ return /* @__PURE__ */ i("div", {
365
+ className: a.root,
365
366
  "data-rly-patch-diff": "",
366
- "data-rly-diff-mode": s,
367
- children: [a.oldMode === void 0 && a.newMode === void 0 ? null : /* @__PURE__ */ n("p", {
368
- className: i.noChanges,
369
- children: a.oldMode === void 0 ? `Mode added: ${a.newMode}` : a.newMode === void 0 ? `Mode removed: ${a.oldMode}` : `Mode: ${a.oldMode} → ${a.newMode}`
370
- }), a.binary || a.hunks.length === 0 ? /* @__PURE__ */ n("p", {
371
- className: i.noChanges,
372
- children: a.binary ? "Binary file." : "No content change."
373
- }) : /* @__PURE__ */ n("div", {
367
+ "data-rly-diff-mode": p,
368
+ ref: f,
369
+ children: [o.oldMode === void 0 && o.newMode === void 0 ? null : /* @__PURE__ */ r("p", {
370
+ className: a.noChanges,
371
+ children: o.oldMode === void 0 ? `Mode added: ${o.newMode}` : o.newMode === void 0 ? `Mode removed: ${o.oldMode}` : `Mode: ${o.oldMode} → ${o.newMode}`
372
+ }), o.binary || o.hunks.length === 0 ? /* @__PURE__ */ r("p", {
373
+ className: a.noChanges,
374
+ children: o.binary ? "Binary file." : "No content change."
375
+ }) : /* @__PURE__ */ r("div", {
374
376
  style: { overflowX: "auto" },
375
377
  role: "region",
376
- "aria-label": `Changes in ${a.path}`,
378
+ "aria-label": `Changes in ${o.path}`,
377
379
  tabIndex: 0,
378
- children: /* @__PURE__ */ r("table", {
379
- className: i.table,
380
- "aria-label": `Changes in ${a.path}`,
381
- children: [/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ n("tr", { children: s === "split" ? /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("th", {
380
+ children: /* @__PURE__ */ i("table", {
381
+ className: a.table,
382
+ "aria-label": `Changes in ${o.path}`,
383
+ children: [/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: p === "split" ? /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("th", {
382
384
  colSpan: 2,
383
385
  scope: "colgroup",
384
386
  children: "Before"
385
- }), /* @__PURE__ */ n("th", {
387
+ }), /* @__PURE__ */ r("th", {
386
388
  colSpan: 2,
387
389
  scope: "colgroup",
388
390
  children: "After"
389
- })] }) : /* @__PURE__ */ r(t, { children: [
390
- /* @__PURE__ */ n("th", {
391
+ })] }) : /* @__PURE__ */ i(n, { children: [
392
+ /* @__PURE__ */ r("th", {
391
393
  scope: "col",
392
394
  children: "Before"
393
395
  }),
394
- /* @__PURE__ */ n("th", {
396
+ /* @__PURE__ */ r("th", {
395
397
  scope: "col",
396
398
  children: "After"
397
399
  }),
398
- /* @__PURE__ */ n("th", {
400
+ /* @__PURE__ */ r("th", {
399
401
  colSpan: 2,
400
402
  scope: "colgroup",
401
403
  children: "Change"
402
404
  })
403
- ] }) }) }), /* @__PURE__ */ n("tbody", { children: a.hunks.map((t, a) => /* @__PURE__ */ r(e, { children: [/* @__PURE__ */ n("tr", {
404
- className: i.hunk,
405
- children: /* @__PURE__ */ r("td", {
405
+ ] }) }) }), /* @__PURE__ */ r("tbody", { children: o.hunks.map((e, n) => /* @__PURE__ */ i(t, { children: [/* @__PURE__ */ r("tr", {
406
+ className: a.hunk,
407
+ children: /* @__PURE__ */ i("td", {
406
408
  colSpan: 4,
407
409
  children: [
408
410
  "@@ ",
409
- t.oldStart,
411
+ e.oldStart,
410
412
  " → ",
411
- t.newStart,
413
+ e.newStart,
412
414
  " ",
413
- t.header
415
+ e.header
414
416
  ]
415
417
  })
416
- }), s === "split" ? g(t).map((t, n) => /* @__PURE__ */ r(e, { children: [
417
- /* @__PURE__ */ r("tr", {
418
- className: t.left?.kind === "context" ? i.context : i.change,
419
- children: [u(t.left, "old"), u(t.right, "new")]
418
+ }), p === "split" ? _(e).map((e, n) => /* @__PURE__ */ i(t, { children: [
419
+ /* @__PURE__ */ i("tr", {
420
+ className: e.left?.kind === "context" ? a.context : a.change,
421
+ children: [m(e.left, "old"), m(e.right, "new")]
420
422
  }),
421
- d(t.left, "old"),
422
- d(t.right, "new")
423
- ] }, n)) : t.lines.map((t, a) => /* @__PURE__ */ r(e, { children: [
424
- /* @__PURE__ */ r("tr", {
425
- className: t.kind === "add" ? i.addition : t.kind === "del" ? i.deletion : i.context,
423
+ h(e.left, "old"),
424
+ h(e.right, "new")
425
+ ] }, n)) : e.lines.map((e, n) => /* @__PURE__ */ i(t, { children: [
426
+ /* @__PURE__ */ i("tr", {
427
+ className: e.kind === "add" ? a.addition : e.kind === "del" ? a.deletion : a.context,
426
428
  children: [
427
- /* @__PURE__ */ n("td", {
428
- className: i.lineNumber,
429
- children: /* @__PURE__ */ n("span", {
430
- id: t.oldNo === void 0 ? void 0 : `${o}-old-${t.oldNo}`,
429
+ /* @__PURE__ */ r("td", {
430
+ className: a.lineNumber,
431
+ children: /* @__PURE__ */ r("span", {
432
+ id: e.oldNo === void 0 ? void 0 : `${s}-old-${e.oldNo}`,
431
433
  tabIndex: -1,
432
- children: t.oldNo
434
+ children: e.oldNo
433
435
  })
434
436
  }),
435
- /* @__PURE__ */ n("td", {
436
- className: i.lineNumber,
437
- children: /* @__PURE__ */ n("span", {
438
- id: t.newNo === void 0 ? void 0 : `${o}-new-${t.newNo}`,
437
+ /* @__PURE__ */ r("td", {
438
+ className: a.lineNumber,
439
+ children: /* @__PURE__ */ r("span", {
440
+ id: e.newNo === void 0 ? void 0 : `${s}-new-${e.newNo}`,
439
441
  tabIndex: -1,
440
- children: t.newNo
442
+ children: e.newNo
441
443
  })
442
444
  }),
443
- /* @__PURE__ */ n("td", {
444
- className: i.marker,
445
- children: t.kind === "add" ? "+" : t.kind === "del" ? "−" : " "
445
+ /* @__PURE__ */ r("td", {
446
+ className: a.marker,
447
+ children: e.kind === "add" ? "+" : e.kind === "del" ? "−" : " "
446
448
  }),
447
- /* @__PURE__ */ r("td", { children: [/* @__PURE__ */ n("code", {
448
- className: l ? i.wrappedCode : i.code,
449
- children: t.text || " "
450
- }), t.noNewline === !0 ? /* @__PURE__ */ n("small", {
451
- "aria-label": t.kind === "del" ? "Before: no newline" : t.kind === "add" ? "After: no newline" : "Before: no newline; After: no newline",
449
+ /* @__PURE__ */ i("td", { children: [/* @__PURE__ */ r("code", {
450
+ className: u ? a.wrappedCode : a.code,
451
+ children: e.text || " "
452
+ }), e.noNewline === !0 ? /* @__PURE__ */ r("small", {
453
+ "aria-label": e.kind === "del" ? "Before: no newline" : e.kind === "add" ? "After: no newline" : "Before: no newline; After: no newline",
452
454
  children: "No newline at end of file"
453
455
  }) : null] })
454
456
  ]
455
457
  }),
456
- d(t, "old"),
457
- d(t, "new")
458
- ] }, a))] }, a)) })]
458
+ h(e, "old"),
459
+ h(e, "new")
460
+ ] }, n))] }, n)) })]
459
461
  })
460
462
  })]
461
463
  });
462
464
  };
463
465
  //#endregion
464
- export { _ as PatchDiffView, h as findFile, d as parsePatch, m as pathsOf };
466
+ export { v as PatchDiffView, g as findFile, f as parsePatch, h as pathsOf };
465
467
 
466
468
  //# sourceMappingURL=index.js.map