@crewlethq/ui 0.151.0 → 0.153.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.
- package/README.md +9 -1
- package/dist/ChangeList/index.js +2 -2
- package/dist/Combobox/Combobox.d.ts +2 -0
- package/dist/Combobox/index.js +1 -1
- package/dist/{Combobox-F5VEJIAO.css → Combobox-GHT43K32.css} +7 -0
- package/dist/DataView/index.js +2 -2
- package/dist/DiffList/index.js +1 -1
- package/dist/{DiffList-3JNPLQ2E.css → DiffList-57M6YCNS.css} +6 -7
- package/dist/DiffView/DiffView.d.ts +60 -35
- package/dist/DiffView/diff.d.ts +9 -41
- package/dist/DiffView/index.d.ts +7 -3
- package/dist/DiffView/index.js +1 -1
- package/dist/DiffView/lineDiff.d.ts +58 -0
- package/dist/DiffView/wordDiff.d.ts +47 -0
- package/dist/DiffView-J55CPJDX.css +224 -0
- package/dist/DurationField/index.js +2 -2
- package/dist/FilterPill/FilterPill.d.ts +6 -1
- package/dist/FilterPill/index.js +1 -1
- package/dist/{FilterPill-4GMNFZND.css → FilterPill-C6LFYCCA.css} +7 -0
- package/dist/OpenInAppCard/index.js +1 -1
- package/dist/PrincipalPicker/index.js +2 -2
- package/dist/ProposalCard/index.js +3 -3
- package/dist/RailList/index.js +1 -1
- package/dist/RichEditor/index.js +1 -1
- package/dist/ValueField/ValueField.d.ts +2 -0
- package/dist/ValueField/index.js +2 -2
- package/dist/VersionCompare/VersionCompare.d.ts +3 -4
- package/dist/VersionCompare/index.js +2 -2
- package/dist/{chunk-5DLBGF6I.js → chunk-2YAK37D6.js} +1 -1
- package/dist/chunk-4YLN5QVL.js +803 -0
- package/dist/{chunk-Z6OZNSHF.js → chunk-7FWYJCKT.js} +2 -1
- package/dist/{chunk-RGJB34YN.js → chunk-7XUP32RY.js} +1 -1
- package/dist/{chunk-TPABM6DW.js → chunk-CJAPAIJG.js} +8 -3
- package/dist/{chunk-FCRJAFTU.js → chunk-DWXTJWCJ.js} +1 -1
- package/dist/{chunk-TBOVJ7RL.js → chunk-GQQMN6O3.js} +3 -1
- package/dist/{chunk-4DUK2TC4.js → chunk-ITZAWYRG.js} +1 -1
- package/dist/{chunk-NB53SAL4.js → chunk-NOZD547E.js} +1 -1
- package/dist/{chunk-OMVGWZ3V.js → chunk-V3HP2HOI.js} +24 -19
- package/dist/generated/index.js +50 -50
- package/dist/index.js +50 -50
- package/dist/styles.css +191 -44
- package/package.json +3 -3
- package/dist/DiffView-ZI5C25Q3.css +0 -90
- package/dist/chunk-F4CM5KD3.js +0 -187
- package/dist/{chunk-CKNDBAQ7.js → chunk-OX332RI7.js} +1 -1
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/* DiffView: a line diff, monospace and line-numbered on both sides.
|
|
2
|
-
|
|
3
|
-
A changed line is marked three ways, a tint, a drawn mark and a word read
|
|
4
|
-
in its place, because colour alone is not a signal and a printed or
|
|
5
|
-
forced-colours render loses the tint entirely. The tint and the mark are
|
|
6
|
-
the diff family's row and sign, which the palette suite measures together. */
|
|
7
|
-
.crewlet-diff-view {
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
border: 1px solid var(--color-border-default);
|
|
10
|
-
border-radius: var(--radius-sm);
|
|
11
|
-
font-family: var(--font-family-mono);
|
|
12
|
-
font-size: var(--font-size-xs);
|
|
13
|
-
line-height: var(--font-line-height-normal);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.crewlet-diff-view__section + .crewlet-diff-view__section,
|
|
17
|
-
.crewlet-diff-view__skip + .crewlet-diff-view__line {
|
|
18
|
-
border-top: 1px solid var(--color-border-default);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* A GAP SAYS WHAT IT STANDS FOR. Silently closed, a document edited at both
|
|
22
|
-
ends looks like one rewritten in the middle. */
|
|
23
|
-
.crewlet-diff-view__skip {
|
|
24
|
-
padding: var(--spacing-1) var(--spacing-3);
|
|
25
|
-
background: var(--color-surface-elevated);
|
|
26
|
-
color: var(--color-text-tertiary);
|
|
27
|
-
font-family: var(--font-family-sans);
|
|
28
|
-
font-size: var(--font-size-xs);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.crewlet-diff-view__line {
|
|
32
|
-
display: grid;
|
|
33
|
-
grid-template-columns: 3.5ch 3.5ch 2ch minmax(0, 1fr);
|
|
34
|
-
gap: var(--spacing-2);
|
|
35
|
-
padding: calc(var(--spacing-1) / 4) var(--spacing-3) calc(var(--spacing-1) / 4) var(--spacing-2);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.crewlet-diff-view__number {
|
|
39
|
-
color: var(--color-text-tertiary);
|
|
40
|
-
text-align: right;
|
|
41
|
-
user-select: none;
|
|
42
|
-
font-variant-numeric: tabular-nums;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.crewlet-diff-view__mark {
|
|
46
|
-
text-align: center;
|
|
47
|
-
user-select: none;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.crewlet-diff-view__text {
|
|
51
|
-
white-space: pre-wrap;
|
|
52
|
-
overflow-wrap: anywhere;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.crewlet-diff-view__line--add {
|
|
56
|
-
background: var(--color-diff-added-row);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.crewlet-diff-view__line--add .crewlet-diff-view__mark {
|
|
60
|
-
color: var(--color-diff-added-sign);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.crewlet-diff-view__line--remove {
|
|
64
|
-
background: var(--color-diff-removed-row);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.crewlet-diff-view__line--remove .crewlet-diff-view__mark {
|
|
68
|
-
color: var(--color-diff-removed-sign);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/* DiffSummary: the size of the change, in the same inks as its lines. */
|
|
72
|
-
.crewlet-diff-summary {
|
|
73
|
-
margin: 0;
|
|
74
|
-
color: var(--color-text-secondary);
|
|
75
|
-
font-size: var(--font-size-compact);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.crewlet-diff-summary__added,
|
|
79
|
-
.crewlet-diff-summary__removed {
|
|
80
|
-
font-family: var(--font-family-mono);
|
|
81
|
-
font-variant-numeric: tabular-nums;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.crewlet-diff-summary__added {
|
|
85
|
-
color: var(--color-diff-added-sign);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.crewlet-diff-summary__removed {
|
|
89
|
-
color: var(--color-diff-removed-sign);
|
|
90
|
-
}
|
package/dist/chunk-F4CM5KD3.js
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { VisuallyHidden } from './chunk-RRRK2KB6.js';
|
|
2
|
-
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
-
import './DiffView-ZI5C25Q3.css';
|
|
4
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var DIFF_VIEW_LABELS = {
|
|
7
|
-
skipped: (count) => count === 1 ? "1 unchanged line" : `${count.toLocaleString()} unchanged lines`,
|
|
8
|
-
added: "Added",
|
|
9
|
-
removed: "Removed",
|
|
10
|
-
region: "Line changes"
|
|
11
|
-
};
|
|
12
|
-
function DiffView({ sections, labels: overrides, className, "aria-label": ariaLabel, ...rest }) {
|
|
13
|
-
const labels = overrides ? { ...DIFF_VIEW_LABELS, ...overrides } : DIFF_VIEW_LABELS;
|
|
14
|
-
return /* @__PURE__ */ jsx("div", { ...rest, role: "group", "aria-label": ariaLabel ?? labels.region, className: cx("crewlet-diff-view", className), children: sections.map((section, s) => (
|
|
15
|
-
// A section has no identity of its own: a diff is computed whole, so
|
|
16
|
-
// its position is what tells two sections apart.
|
|
17
|
-
/* @__PURE__ */ jsxs("div", { className: "crewlet-diff-view__section", children: [
|
|
18
|
-
section.skipped > 0 && /* @__PURE__ */ jsx("div", { className: "crewlet-diff-view__skip", children: labels.skipped(section.skipped) }),
|
|
19
|
-
section.lines.map((line, i) => (
|
|
20
|
-
// THE CLASS NAMES ARE LITERALS, never assembled from the value: a
|
|
21
|
-
// stylesheet gate that cannot see a class cannot tell a rule this
|
|
22
|
-
// file relies on from one nothing uses.
|
|
23
|
-
/* @__PURE__ */ jsxs(
|
|
24
|
-
"div",
|
|
25
|
-
{
|
|
26
|
-
className: cx(
|
|
27
|
-
"crewlet-diff-view__line",
|
|
28
|
-
line.kind === "add" && "crewlet-diff-view__line--add",
|
|
29
|
-
line.kind === "remove" && "crewlet-diff-view__line--remove"
|
|
30
|
-
),
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ jsx("span", { className: "crewlet-diff-view__number", "aria-hidden": "true", children: line.before ?? "" }),
|
|
33
|
-
/* @__PURE__ */ jsx("span", { className: "crewlet-diff-view__number", "aria-hidden": "true", children: line.after ?? "" }),
|
|
34
|
-
/* @__PURE__ */ jsxs("span", { className: "crewlet-diff-view__mark", children: [
|
|
35
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: line.kind === "add" ? "+" : line.kind === "remove" ? "\u2212" : " " }),
|
|
36
|
-
line.kind === "add" && /* @__PURE__ */ jsx(VisuallyHidden, { children: labels.added }),
|
|
37
|
-
line.kind === "remove" && /* @__PURE__ */ jsx(VisuallyHidden, { children: labels.removed })
|
|
38
|
-
] }),
|
|
39
|
-
/* @__PURE__ */ jsx("span", { className: "crewlet-diff-view__text", children: line.text || " " })
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
i
|
|
43
|
-
)
|
|
44
|
-
))
|
|
45
|
-
] }, s)
|
|
46
|
-
)) });
|
|
47
|
-
}
|
|
48
|
-
var DIFF_SUMMARY_LABELS = {
|
|
49
|
-
spoken: (added, removed) => `${added === 1 ? "1 line" : `${added.toLocaleString()} lines`} added, ${removed.toLocaleString()} removed`,
|
|
50
|
-
against: (what) => `against ${what}`
|
|
51
|
-
};
|
|
52
|
-
function DiffSummary({ added, removed, against, labels: overrides, className, ...rest }) {
|
|
53
|
-
const labels = overrides ? { ...DIFF_SUMMARY_LABELS, ...overrides } : DIFF_SUMMARY_LABELS;
|
|
54
|
-
return /* @__PURE__ */ jsxs("p", { ...rest, className: cx("crewlet-diff-summary", className), children: [
|
|
55
|
-
/* @__PURE__ */ jsxs("span", { "aria-hidden": "true", children: [
|
|
56
|
-
/* @__PURE__ */ jsxs("span", { className: "crewlet-diff-summary__added", children: [
|
|
57
|
-
"+",
|
|
58
|
-
added.toLocaleString()
|
|
59
|
-
] }),
|
|
60
|
-
" ",
|
|
61
|
-
/* @__PURE__ */ jsx("span", { className: "crewlet-diff-summary__removed", children: `\u2212${removed.toLocaleString()}` })
|
|
62
|
-
] }),
|
|
63
|
-
/* @__PURE__ */ jsx(VisuallyHidden, { children: labels.spoken(added, removed) }),
|
|
64
|
-
against !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
65
|
-
" ",
|
|
66
|
-
labels.against(against)
|
|
67
|
-
] })
|
|
68
|
-
] });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// src/DiffView/diff.ts
|
|
72
|
-
var MAX_DIFF_LINES = 2e3;
|
|
73
|
-
function splitLines(text) {
|
|
74
|
-
const normalised = (text ?? "").replace(/\r\n?/g, "\n");
|
|
75
|
-
if (normalised === "") return [];
|
|
76
|
-
return normalised.replace(/\n$/, "").split("\n");
|
|
77
|
-
}
|
|
78
|
-
function diffLines(before, after) {
|
|
79
|
-
const a = splitLines(before);
|
|
80
|
-
const b = splitLines(after);
|
|
81
|
-
if (a.length > MAX_DIFF_LINES || b.length > MAX_DIFF_LINES) {
|
|
82
|
-
return [
|
|
83
|
-
...a.map((text, i) => ({ kind: "remove", text, before: i + 1, after: null })),
|
|
84
|
-
...b.map((text, i) => ({ kind: "add", text, before: null, after: i + 1 }))
|
|
85
|
-
];
|
|
86
|
-
}
|
|
87
|
-
return walk(a, b, common(a, b));
|
|
88
|
-
}
|
|
89
|
-
function diffStat(diff) {
|
|
90
|
-
let added = 0;
|
|
91
|
-
let removed = 0;
|
|
92
|
-
for (const line of diff) {
|
|
93
|
-
if (line.kind === "add") added++;
|
|
94
|
-
if (line.kind === "remove") removed++;
|
|
95
|
-
}
|
|
96
|
-
return { added, removed, identical: added === 0 && removed === 0 };
|
|
97
|
-
}
|
|
98
|
-
function collapseDiff(diff, context = 3) {
|
|
99
|
-
const keep = new Array(diff.length).fill(false);
|
|
100
|
-
diff.forEach((line, i) => {
|
|
101
|
-
if (line.kind === "same") return;
|
|
102
|
-
for (let k = Math.max(0, i - context); k <= Math.min(diff.length - 1, i + context); k++) {
|
|
103
|
-
keep[k] = true;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
const out = [];
|
|
107
|
-
let skipped = 0;
|
|
108
|
-
let current = null;
|
|
109
|
-
diff.forEach((line, i) => {
|
|
110
|
-
if (keep[i]) {
|
|
111
|
-
if (!current) {
|
|
112
|
-
current = [];
|
|
113
|
-
out.push({ lines: current, skipped });
|
|
114
|
-
skipped = 0;
|
|
115
|
-
}
|
|
116
|
-
current.push(line);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
skipped++;
|
|
120
|
-
current = null;
|
|
121
|
-
});
|
|
122
|
-
return out;
|
|
123
|
-
}
|
|
124
|
-
function firstChangedLines(sections, max) {
|
|
125
|
-
const out = [];
|
|
126
|
-
let shown = 0;
|
|
127
|
-
let more = 0;
|
|
128
|
-
for (const section of sections) {
|
|
129
|
-
const kept = [];
|
|
130
|
-
for (const line of section.lines) {
|
|
131
|
-
const changed = line.kind !== "same";
|
|
132
|
-
if (shown >= max) {
|
|
133
|
-
if (changed) more++;
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
if (changed) shown++;
|
|
137
|
-
kept.push(line);
|
|
138
|
-
}
|
|
139
|
-
if (kept.length > 0) out.push({ lines: kept, skipped: section.skipped });
|
|
140
|
-
}
|
|
141
|
-
return { sections: out, more };
|
|
142
|
-
}
|
|
143
|
-
function common(a, b) {
|
|
144
|
-
const table = [];
|
|
145
|
-
for (let i = 0; i <= a.length; i++) table.push(new Uint32Array(b.length + 1));
|
|
146
|
-
for (let i = a.length - 1; i >= 0; i--) {
|
|
147
|
-
const row = table[i];
|
|
148
|
-
const next = table[i + 1];
|
|
149
|
-
for (let j = b.length - 1; j >= 0; j--) {
|
|
150
|
-
row[j] = a[i] === b[j] ? next[j + 1] + 1 : Math.max(next[j], row[j + 1]);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return table;
|
|
154
|
-
}
|
|
155
|
-
function walk(a, b, table) {
|
|
156
|
-
const out = [];
|
|
157
|
-
let i = 0;
|
|
158
|
-
let j = 0;
|
|
159
|
-
while (i < a.length && j < b.length) {
|
|
160
|
-
if (a[i] === b[j]) {
|
|
161
|
-
out.push({ kind: "same", text: a[i], before: i + 1, after: j + 1 });
|
|
162
|
-
i++;
|
|
163
|
-
j++;
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
const down = table[i + 1][j];
|
|
167
|
-
const right = table[i][j + 1];
|
|
168
|
-
if (down >= right) {
|
|
169
|
-
out.push({ kind: "remove", text: a[i], before: i + 1, after: null });
|
|
170
|
-
i++;
|
|
171
|
-
} else {
|
|
172
|
-
out.push({ kind: "add", text: b[j], before: null, after: j + 1 });
|
|
173
|
-
j++;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
while (i < a.length) {
|
|
177
|
-
out.push({ kind: "remove", text: a[i], before: i + 1, after: null });
|
|
178
|
-
i++;
|
|
179
|
-
}
|
|
180
|
-
while (j < b.length) {
|
|
181
|
-
out.push({ kind: "add", text: b[j], before: null, after: j + 1 });
|
|
182
|
-
j++;
|
|
183
|
-
}
|
|
184
|
-
return out;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export { DIFF_SUMMARY_LABELS, DIFF_VIEW_LABELS, DiffSummary, DiffView, MAX_DIFF_LINES, collapseDiff, diffLines, diffStat, firstChangedLines, splitLines };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { typedNumber, NumberField } from './chunk-DDGHRDGV.js';
|
|
2
1
|
import { Select } from './chunk-657WR3MX.js';
|
|
2
|
+
import { typedNumber, NumberField } from './chunk-DDGHRDGV.js';
|
|
3
3
|
import { PresetChips } from './chunk-6QWSGM4W.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
5
|
import './DurationField-TJFIAUMW.css';
|