@sheetpane/grid 0.3.0 → 0.4.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 +294 -13
- package/custom-elements.json +292 -27
- package/dist/check.d.ts +75 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +151 -0
- package/dist/check.js.map +1 -0
- package/dist/errors/element.d.ts +90 -12
- package/dist/errors/element.d.ts.map +1 -1
- package/dist/errors/element.js +572 -50
- package/dist/errors/element.js.map +1 -1
- package/dist/excel/element.d.ts +168 -15
- package/dist/excel/element.d.ts.map +1 -1
- package/dist/excel/element.js +752 -90
- package/dist/excel/element.js.map +1 -1
- package/dist/excel/link.d.ts +40 -0
- package/dist/excel/link.d.ts.map +1 -0
- package/dist/excel/link.js +90 -0
- package/dist/excel/link.js.map +1 -0
- package/dist/excel/styles.d.ts.map +1 -1
- package/dist/excel/styles.js +37 -5
- package/dist/excel/styles.js.map +1 -1
- package/dist/frameworks/elements.d.ts +57 -17
- package/dist/frameworks/jsx.d.ts +15 -9
- package/dist/frameworks/solid.d.ts +51 -11
- package/dist/frameworks/svelte.d.ts +28 -16
- package/dist/frameworks/vue.d.ts +15 -9
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +3027 -239
- package/dist/llms.txt +92 -86
- package/dist/pane/protection.d.ts +61 -0
- package/dist/pane/protection.d.ts.map +1 -0
- package/dist/pane/protection.js +89 -0
- package/dist/pane/protection.js.map +1 -0
- package/dist/pane/rules.d.ts +1 -1
- package/dist/pane/rules.d.ts.map +1 -1
- package/dist/pane/store.d.ts +336 -15
- package/dist/pane/store.d.ts.map +1 -1
- package/dist/pane/store.js +891 -44
- package/dist/pane/store.js.map +1 -1
- package/dist/pane/structure.d.ts +58 -0
- package/dist/pane/structure.d.ts.map +1 -0
- package/dist/pane/structure.js +238 -0
- package/dist/pane/structure.js.map +1 -0
- package/dist/pane/types.d.ts +195 -6
- package/dist/pane/types.d.ts.map +1 -1
- package/dist/pane/types.js +57 -0
- package/dist/pane/types.js.map +1 -1
- package/dist/plugins/types.d.ts +34 -6
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/plugins/types.js.map +1 -1
- package/dist/shared/detail.d.ts +24 -0
- package/dist/shared/detail.d.ts.map +1 -0
- package/dist/shared/detail.js +75 -0
- package/dist/shared/detail.js.map +1 -0
- package/dist/shared/dom.d.ts +3 -0
- package/dist/shared/dom.d.ts.map +1 -1
- package/dist/shared/dom.js +3 -0
- package/dist/shared/dom.js.map +1 -1
- package/dist/static.d.ts +81 -0
- package/dist/static.d.ts.map +1 -0
- package/dist/static.js +352 -0
- package/dist/static.js.map +1 -0
- package/dist/style.css +3 -3
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +2 -2
- package/dist/tokens.js.map +1 -1
- package/dist/vscode.css-custom-data.json +11 -1
- package/dist/vscode.html-custom-data.json +89 -2
- package/dist/web-types.json +204 -21
- package/package.json +12 -4
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// Rows and columns inserted or deleted (W-52), as the store applies them: what is refused, and
|
|
2
|
+
// how the store's own tables move — the change map, the errors, the derived values, the
|
|
3
|
+
// selection and the plugin-error index. The imported workbook itself moves through
|
|
4
|
+
// @sheetpane/import's restructureWorkbook; patchXlsx moves the file. Pure functions; the
|
|
5
|
+
// store owns the one commit path.
|
|
6
|
+
import { MAX_COLS, MAX_ROWS, cellRef, isInsertOp, isRowOp, movesRange, parseRange, parseRef, rangeRef, restructureFormula, shiftCount, shiftIndex, shiftRangePos, shiftRefText, splitsRange, tableRefusal, } from '@sheetpane/export';
|
|
7
|
+
/** The change-map ref that holds a sheet's operations, in order: `Sheet1!#structure`. */
|
|
8
|
+
export const STRUCTURE_REF = '#structure';
|
|
9
|
+
const splitKey = (k) => { const i = k.lastIndexOf('!'); return { sheet: k.slice(0, i), ref: k.slice(i + 1) }; };
|
|
10
|
+
const what = (o) => `${o.count} ${isRowOp(o) ? 'row' : 'column'}${o.count === 1 ? '' : 's'}`;
|
|
11
|
+
/** The sheet's Excel tables as `@sheetpane/import` reads them (W-61); none on a hand-made sheet. */
|
|
12
|
+
function tablesOf(s) {
|
|
13
|
+
return s.tables ?? [];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* What Excel refuses, sheetpane refuses (W-52 DoD 5): a delete that cuts a merged range (SP-3022),
|
|
17
|
+
* anything that would move a pivot table or its source (SP-3023), an insert that would push cells
|
|
18
|
+
* off the sheet (SP-3024), and a cut a table cannot follow (SP-3025).
|
|
19
|
+
* @param book - The workbook.
|
|
20
|
+
* @param merges - The sheet's merged ranges as they are now (the file's, with merge changes).
|
|
21
|
+
* @param o - The operation.
|
|
22
|
+
* @returns The refusal, or `undefined` when the operation may go ahead.
|
|
23
|
+
*/
|
|
24
|
+
export function structureRefusal(book, merges, o) {
|
|
25
|
+
const s = book.sheets.find((x) => x.name === o.sheet);
|
|
26
|
+
if (!s)
|
|
27
|
+
return undefined;
|
|
28
|
+
if (!isInsertOp(o)) {
|
|
29
|
+
const cut = merges.find((m) => { const r = parseRange(m); return r && splitsRange(r, o); });
|
|
30
|
+
if (cut)
|
|
31
|
+
return { code: 'SP-3022', message: `Deleting ${what(o)} would split the merged cells ${cut} — unmerge them first.` };
|
|
32
|
+
}
|
|
33
|
+
for (const sh of book.sheets)
|
|
34
|
+
for (const p of sh.pivotTables) {
|
|
35
|
+
const at = sh.name === o.sheet ? parseRange(p.ref) : undefined;
|
|
36
|
+
if (at && movesRange(at, o))
|
|
37
|
+
return { code: 'SP-3023', message: `This would move the pivot table ${p.name || p.ref} — sheetpane does not rewrite pivot tables.` };
|
|
38
|
+
const src = p.source && p.source.sheet.toUpperCase() === o.sheet.toUpperCase() ? parseRange(p.source.ref) : undefined;
|
|
39
|
+
if (src && movesRange(src, o))
|
|
40
|
+
return { code: 'SP-3023', message: `This would move ${p.source.ref}, the source of the pivot table ${p.name || p.ref} — sheetpane does not rewrite pivot sources.` };
|
|
41
|
+
}
|
|
42
|
+
if (isInsertOp(o)) {
|
|
43
|
+
const used = isRowOp(o) ? s.rows.length : s.rows.reduce((m, r) => Math.max(m, r.length), 0);
|
|
44
|
+
if (used > o.at && used + o.count > (isRowOp(o) ? MAX_ROWS : MAX_COLS))
|
|
45
|
+
return { code: 'SP-3024', message: `Inserting ${what(o)} would push cells off the end of the sheet.` };
|
|
46
|
+
}
|
|
47
|
+
for (const t of tablesOf(s)) {
|
|
48
|
+
const r = parseRange(t.ref);
|
|
49
|
+
const why = r && tableRefusal(r, o, { name: t.name, header: t.headerRowCount > 0, totals: t.totalsRowCount > 0 });
|
|
50
|
+
if (why)
|
|
51
|
+
return { code: 'SP-3025', message: `This ${why}.` };
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
/** A cell ref moved; `undefined` when deleted. */
|
|
56
|
+
function moveCell(ref, o) {
|
|
57
|
+
const p = parseRef(ref);
|
|
58
|
+
if (!p)
|
|
59
|
+
return ref;
|
|
60
|
+
const i = shiftIndex(isRowOp(o) ? p.row : p.col, o);
|
|
61
|
+
return i === undefined ? undefined : isRowOp(o) ? cellRef(i, p.col) : cellRef(p.row, i);
|
|
62
|
+
}
|
|
63
|
+
const isFormula = (c) => c.kind === 'formula' || (c.kind === 'value' && typeof c.now === 'string' && c.now.startsWith('='));
|
|
64
|
+
const moveIndexes = (v, o) => (Array.isArray(v) ? v.flatMap((i) => { const j = shiftIndex(i, o); return j === undefined ? [] : [j]; }) : v);
|
|
65
|
+
const moveLevels = (v, o) => {
|
|
66
|
+
if (!v || typeof v !== 'object')
|
|
67
|
+
return v;
|
|
68
|
+
const out = {};
|
|
69
|
+
for (const [k, l] of Object.entries(v)) {
|
|
70
|
+
const j = shiftIndex(Number(k), o);
|
|
71
|
+
if (j !== undefined)
|
|
72
|
+
out[j] = l;
|
|
73
|
+
}
|
|
74
|
+
return out;
|
|
75
|
+
};
|
|
76
|
+
const moveFreeze = (v, o) => {
|
|
77
|
+
const f = v;
|
|
78
|
+
if (!f || typeof f !== 'object')
|
|
79
|
+
return v;
|
|
80
|
+
return isRowOp(o) ? { ...f, rows: shiftCount(f.rows, o) } : { ...f, cols: shiftCount(f.cols, o) };
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* The change map after the operation: entries of the sheet rekeyed (deleted cells' entries go),
|
|
84
|
+
* formulas everywhere that point at the sheet rewritten, sheet-wide entries (freeze, hidden,
|
|
85
|
+
* outline) moved, and the operation appended to the sheet's `#structure` entry.
|
|
86
|
+
* @param changes - The change map now.
|
|
87
|
+
* @param o - The operation.
|
|
88
|
+
* @param carry - Told of each entry rewritten into a new object (a formula, a freeze), so its edit keeps its time (W-64).
|
|
89
|
+
* @returns A new change map.
|
|
90
|
+
*/
|
|
91
|
+
export function shiftChanges(changes, o, carry) {
|
|
92
|
+
const out = new Map();
|
|
93
|
+
const rows = isRowOp(o);
|
|
94
|
+
for (const [k, c] of changes) {
|
|
95
|
+
const { sheet, ref } = splitKey(k);
|
|
96
|
+
let next = c;
|
|
97
|
+
if (isFormula(c)) {
|
|
98
|
+
const f = String(c.now);
|
|
99
|
+
const g = `=${restructureFormula(f.slice(1), sheet, o)}`;
|
|
100
|
+
if (g !== f)
|
|
101
|
+
next = { ...c, now: g };
|
|
102
|
+
}
|
|
103
|
+
if (sheet !== o.sheet) {
|
|
104
|
+
if (next !== c)
|
|
105
|
+
carry?.(c, next);
|
|
106
|
+
out.set(k, next);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
let key = ref;
|
|
110
|
+
const slot = /^#(style|numFmt):(.+)$/.exec(ref);
|
|
111
|
+
if (slot) {
|
|
112
|
+
const m = moveCell(slot[2], o);
|
|
113
|
+
if (m === undefined)
|
|
114
|
+
continue;
|
|
115
|
+
key = `#${slot[1]}:${m}`;
|
|
116
|
+
}
|
|
117
|
+
else if (ref.startsWith('#merge:')) {
|
|
118
|
+
const m = shiftRefText(ref.slice(7), o);
|
|
119
|
+
if (m === undefined || !m.includes(':'))
|
|
120
|
+
continue;
|
|
121
|
+
key = `#merge:${m}`;
|
|
122
|
+
}
|
|
123
|
+
else if (ref === '#freeze')
|
|
124
|
+
next = { ...next, now: moveFreeze(next.now, o), was: moveFreeze(next.was, o) };
|
|
125
|
+
else if (ref === (rows ? '#hiddenRows' : '#hiddenCols'))
|
|
126
|
+
next = { ...next, now: moveIndexes(next.now, o), was: moveIndexes(next.was, o) };
|
|
127
|
+
else if (ref === (rows ? '#outlineRows' : '#outlineCols'))
|
|
128
|
+
next = { ...next, now: moveLevels(next.now, o), was: moveLevels(next.was, o) };
|
|
129
|
+
else if (!ref.startsWith('#')) {
|
|
130
|
+
const m = moveCell(ref, o);
|
|
131
|
+
if (m === undefined)
|
|
132
|
+
continue;
|
|
133
|
+
key = m;
|
|
134
|
+
}
|
|
135
|
+
if (next !== c)
|
|
136
|
+
carry?.(c, next);
|
|
137
|
+
out.set(`${sheet}!${key}`, next);
|
|
138
|
+
}
|
|
139
|
+
const sk = `${o.sheet}!${STRUCTURE_REF}`, prev = out.get(sk);
|
|
140
|
+
out.set(sk, { kind: 'structure', was: [], now: [...(prev?.now ?? []), { sheet: o.sheet, op: o.op, at: o.at, count: o.count }] });
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
/** Derived values keyed by cell, moved with their cells. */
|
|
144
|
+
export function shiftDerived(derived, o) {
|
|
145
|
+
const out = new Map();
|
|
146
|
+
for (const [k, d] of derived) {
|
|
147
|
+
const { sheet, ref } = splitKey(k);
|
|
148
|
+
if (sheet !== o.sheet) {
|
|
149
|
+
out.set(k, d);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
const m = moveCell(ref, o);
|
|
153
|
+
if (m !== undefined)
|
|
154
|
+
out.set(`${sheet}!${m}`, d);
|
|
155
|
+
}
|
|
156
|
+
return out;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The errors after the operation: ranges on the sheet move; an error whose every cell was deleted
|
|
160
|
+
* stays, `resolved`, with the message "row deleted" (or "column deleted"), its range as it was.
|
|
161
|
+
* @param errors - The errors now.
|
|
162
|
+
* @param o - The operation.
|
|
163
|
+
* @returns The errors, and the ids of those whose cells were deleted.
|
|
164
|
+
*/
|
|
165
|
+
export function shiftErrors(errors, o) {
|
|
166
|
+
const gone = new Set();
|
|
167
|
+
const out = errors.map((e) => {
|
|
168
|
+
if (e.sheet !== o.sheet)
|
|
169
|
+
return e;
|
|
170
|
+
const r = parseRange(e.range);
|
|
171
|
+
if (!r)
|
|
172
|
+
return e;
|
|
173
|
+
const m = shiftRangePos(r, o);
|
|
174
|
+
if (!m) { // W-69: a resolved error carries no acceptance
|
|
175
|
+
gone.add(e.id);
|
|
176
|
+
const { acceptedBy: _by, acceptedAt: _at, reason: _why, ...rest } = e;
|
|
177
|
+
return { ...rest, status: 'resolved', message: isRowOp(o) ? 'row deleted' : 'column deleted' };
|
|
178
|
+
}
|
|
179
|
+
const range = e.range.includes(':') ? `${cellRef(m.top, m.left)}:${cellRef(m.bottom, m.right)}` : rangeRef(m);
|
|
180
|
+
return range === e.range ? e : { ...e, range };
|
|
181
|
+
});
|
|
182
|
+
return { errors: out, gone };
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* The plugin-error index (`plugin|sheet|range|type…` → id) with each key's range following its
|
|
186
|
+
* error, so `validate` finds the moved error rather than adding a second one.
|
|
187
|
+
* @param index - The index now.
|
|
188
|
+
* @param before - The errors before the operation.
|
|
189
|
+
* @param after - The errors after it.
|
|
190
|
+
* @param gone - Ids of errors whose cells were deleted: their keys go.
|
|
191
|
+
* @returns A new index.
|
|
192
|
+
*/
|
|
193
|
+
export function shiftPluginErrors(index, before, after, gone) {
|
|
194
|
+
const was = new Map(before.map((e) => [e.id, e])), now = new Map(after.map((e) => [e.id, e]));
|
|
195
|
+
const out = new Map();
|
|
196
|
+
for (const [k, id] of index) {
|
|
197
|
+
if (gone.has(id))
|
|
198
|
+
continue;
|
|
199
|
+
const a = was.get(id), b = now.get(id);
|
|
200
|
+
if (!a || !b || a.range === b.range) {
|
|
201
|
+
out.set(k, id);
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
const from = `|${a.sheet}|${a.range}|`, i = k.indexOf(from);
|
|
205
|
+
out.set(i < 0 ? k : `${k.slice(0, i)}|${b.sheet}|${b.range}|${k.slice(i + from.length)}`, id);
|
|
206
|
+
}
|
|
207
|
+
return out;
|
|
208
|
+
}
|
|
209
|
+
/** The selection after the operation: it moves with its cells; a deleted active cell lands on the row (column) that took its place. */
|
|
210
|
+
export function shiftSelection(sel, o) {
|
|
211
|
+
if (sel.sheet !== o.sheet)
|
|
212
|
+
return sel;
|
|
213
|
+
const p = parseRef(sel.ref);
|
|
214
|
+
if (!p)
|
|
215
|
+
return sel;
|
|
216
|
+
const clamp = (i) => shiftIndex(i, o) ?? Math.max(0, Math.min(o.at, i));
|
|
217
|
+
const ref = isRowOp(o) ? cellRef(clamp(p.row), p.col) : cellRef(p.row, clamp(p.col));
|
|
218
|
+
const next = { sheet: sel.sheet, ref };
|
|
219
|
+
const r = sel.range ? parseRange(sel.range) : undefined;
|
|
220
|
+
const m = r && shiftRangePos(r, o);
|
|
221
|
+
if (m && (m.top !== m.bottom || m.left !== m.right))
|
|
222
|
+
next.range = `${cellRef(m.top, m.left)}:${cellRef(m.bottom, m.right)}`;
|
|
223
|
+
return next;
|
|
224
|
+
}
|
|
225
|
+
/** The open Flag issue form follows its cell, or closes when the cell was deleted. */
|
|
226
|
+
export function shiftComposing(c, o) {
|
|
227
|
+
if (!c || c.sheet !== o.sheet)
|
|
228
|
+
return c;
|
|
229
|
+
const ref = moveCell(c.ref, o);
|
|
230
|
+
if (ref === undefined)
|
|
231
|
+
return null;
|
|
232
|
+
const next = { sheet: c.sheet, ref };
|
|
233
|
+
const r = c.range ? parseRange(c.range) : undefined, m = r && shiftRangePos(r, o);
|
|
234
|
+
if (m)
|
|
235
|
+
next.range = rangeRef(m);
|
|
236
|
+
return next;
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=structure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure.js","sourceRoot":"","sources":["../../src/pane/structure.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,wFAAwF;AACxF,mFAAmF;AACnF,yFAAyF;AACzF,kCAAkC;AAClC,OAAO,EACL,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,GAEjM,MAAM,mBAAmB,CAAC;AAI3B,yFAAyF;AACzF,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAK1C,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACxH,MAAM,IAAI,GAAG,CAAC,CAAc,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAE1G,oGAAoG;AACpG,SAAS,QAAQ,CAAC,CAAgB;IAChC,OAAO,CAAC,CAAC,MAAM,IAAI,EAAE,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ane/types.d.ts
CHANGED
|
@@ -2,15 +2,33 @@ import type { Cell, SpCode } from '@sheetpane/export';
|
|
|
2
2
|
import type { ImportedWorkbook } from '@sheetpane/import';
|
|
3
3
|
/** The pane's mode, shared by its elements: `view` reads, `edit` changes cells and flags errors. */
|
|
4
4
|
export type Mode = 'view' | 'edit';
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* How serious an error is — or, for `pass` and `skipped` (not checked), a result rather than a
|
|
7
|
+
* problem (W-50); see {@link SEVERITY} for its name, glyph and help line.
|
|
8
|
+
*/
|
|
9
|
+
export type Severity = 'error' | 'warning' | 'note' | 'pass' | 'skipped';
|
|
10
|
+
/** The severities that ask for action: everything but a result. */
|
|
11
|
+
export type ProblemSeverity = 'error' | 'warning' | 'note';
|
|
12
|
+
/** A result, not a problem: a passed check or a cell that was not checked (W-50). */
|
|
13
|
+
export type ResultSeverity = 'pass' | 'skipped';
|
|
14
|
+
/**
|
|
15
|
+
* How much of the results a pane shows (W-50, the `results` attribute): `off` drops `pass` and
|
|
16
|
+
* `skipped` entries on arrival; `summary` (the default) counts them in the errors panel and marks
|
|
17
|
+
* nothing on the sheet; `marks` also puts a ✓ or — in each result cell's bottom-left corner.
|
|
18
|
+
*/
|
|
19
|
+
export type ResultsLevel = 'off' | 'summary' | 'marks';
|
|
20
|
+
/** The results levels, in order. */
|
|
21
|
+
export declare const RESULTS_LEVELS: readonly ResultsLevel[];
|
|
22
|
+
/** The `results` attribute's level: `off` or `marks`, else `summary`. */
|
|
23
|
+
export declare const resultsLevelOf: (v: string | null | undefined) => ResultsLevel;
|
|
7
24
|
/** SheetpaneError v1 — exactly the contract verdict's schema. */
|
|
8
25
|
export interface SheetpaneError {
|
|
9
26
|
v: 1;
|
|
10
27
|
/** `"ERR-0003"` — stable, never reused in a session. */
|
|
11
28
|
id: string;
|
|
29
|
+
/** The sheet's name; `""` (with `range: ""`) for an error about the whole workbook (W-55). */
|
|
12
30
|
sheet: string;
|
|
13
|
-
/** A1 cell `"I6"` or a whole row `"A14:J14"
|
|
31
|
+
/** A1 cell `"I6"` or a whole row `"A14:J14"`; `""` for an error about the whole sheet, or the workbook (W-55) — see {@link errorScope}. */
|
|
14
32
|
range: string;
|
|
15
33
|
/** An id from `errorTypes`, e.g. `"wrong-value"`. */
|
|
16
34
|
type: string;
|
|
@@ -21,7 +39,8 @@ export interface SheetpaneError {
|
|
|
21
39
|
message: string;
|
|
22
40
|
/** "Also change the cell" was ticked. */
|
|
23
41
|
cellChanged: boolean;
|
|
24
|
-
|
|
42
|
+
/** `accepted` (W-69): a known deviation someone approved — kept, never counted as open; it carries `acceptedBy`, `acceptedAt` and a `reason`. */
|
|
43
|
+
status: ErrorStatus;
|
|
25
44
|
/** Computed: the cell now shows `expected` (B-022 — it does not resolve the error). */
|
|
26
45
|
matchesExpected: boolean;
|
|
27
46
|
/** The element's `author`, `"workbook"` (validation) or `"file"` (comments), or `""`. */
|
|
@@ -30,18 +49,153 @@ export interface SheetpaneError {
|
|
|
30
49
|
createdAt: string;
|
|
31
50
|
/** The stable SP code (W-40) when sheetpane itself raised the error — a rules-engine note, e.g. `"SP-6023"`; see docs/ERRORS.md. Optional: v1 stays valid without it. */
|
|
32
51
|
code?: SpCode;
|
|
52
|
+
/**
|
|
53
|
+
* The host's own data about the error (W-68) — what `renderDetail` reads, e.g. a PDF page and box, a measured and an
|
|
54
|
+
* expected size. Any JSON value up to {@link ERROR_META_MAX} bytes; kept as its JSON round trip, carried by
|
|
55
|
+
* `getErrors()`, `setErrors()` and the `sheetpane-errors` envelope, and never written into the file. Optional: v1
|
|
56
|
+
* stays valid without it.
|
|
57
|
+
*/
|
|
58
|
+
meta?: ErrorMeta;
|
|
59
|
+
/** Who accepted the deviation (W-69): the element's `author`, or what the host passed; `""` when nobody was named. Only while `status` is `accepted`. */
|
|
60
|
+
acceptedBy?: string;
|
|
61
|
+
/** When it was accepted, ISO 8601 (W-69). Only while `status` is `accepted`. */
|
|
62
|
+
acceptedAt?: string;
|
|
63
|
+
/** Why it was accepted (W-69) — required, never blank, while `status` is `accepted`; written into the export as *Accepted: <reason>*. */
|
|
64
|
+
reason?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The review layer the error belongs to (W-51), e.g. `"validation"` or `"pdf"`: a named set of errors the host replaces
|
|
67
|
+
* whole with `setErrors(list, { layer })` and the user shows with the layers switch. Every error the store holds carries
|
|
68
|
+
* one; an error given without it (a review saved before W-51) is in {@link DEFAULT_LAYER}. A name is 1–64 characters
|
|
69
|
+
* with no spaces ({@link isLayerName}). An edit never moves an error to another layer.
|
|
70
|
+
*/
|
|
71
|
+
layer?: string;
|
|
33
72
|
}
|
|
73
|
+
/** The layer an error is in when nobody names one (W-51): `"review"` — people's errors and the plugins' land here. */
|
|
74
|
+
export declare const DEFAULT_LAYER = "review";
|
|
75
|
+
/**
|
|
76
|
+
* Whether a value may name a review layer (W-51): a string of 1–64 characters with no whitespace, so the `layers`
|
|
77
|
+
* attribute can list several separated by spaces.
|
|
78
|
+
*
|
|
79
|
+
* @param x - Any value.
|
|
80
|
+
* @returns True for a usable layer name.
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* import { isLayerName } from '@sheetpane/grid';
|
|
84
|
+
* isLayerName('pdf'); // true
|
|
85
|
+
* isLayerName('PDF check'); // false — a space
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare const isLayerName: (x: unknown) => x is string;
|
|
89
|
+
/**
|
|
90
|
+
* The layer an error is in (W-51): its `layer`, else {@link DEFAULT_LAYER}.
|
|
91
|
+
*
|
|
92
|
+
* @param e - The error, or just its `layer`.
|
|
93
|
+
* @returns The layer's name.
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* import { layerOf } from '@sheetpane/grid';
|
|
97
|
+
* layerOf({ layer: 'pdf' }); // 'pdf'
|
|
98
|
+
* layerOf({}); // 'review'
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export declare const layerOf: (e: Pick<SheetpaneError, 'layer'>) => string;
|
|
102
|
+
/**
|
|
103
|
+
* What `sheetpane-errors` carries and a host saves to restore a review (W-51 bumps it to `v: 2`): every error with its
|
|
104
|
+
* `layer`, the pane's plugin ids, and the pane's layers in order — an empty one included, so a check that found nothing
|
|
105
|
+
* comes back as a layer. `changed` names the layers whose errors changed in this event (ignored on restore).
|
|
106
|
+
* `setErrors(envelope)` restores it; an envelope saved before W-51 (`{ errors, plugins }`, no `v`) restores into
|
|
107
|
+
* `review`.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* import '@sheetpane/grid';
|
|
112
|
+
* import type { ErrorsEnvelope } from '@sheetpane/grid';
|
|
113
|
+
* const list = document.querySelector('sheetpane-errors')!;
|
|
114
|
+
* list.addEventListener('sheetpane-errors', (e) => localStorage.setItem('review', JSON.stringify((e as CustomEvent<ErrorsEnvelope>).detail)));
|
|
115
|
+
* const saved = JSON.parse(localStorage.getItem('review') ?? 'null') as ErrorsEnvelope | null;
|
|
116
|
+
* if (saved) list.setErrors(saved);
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export interface ErrorsEnvelope {
|
|
120
|
+
/** `2` since W-51; absent in an envelope saved before it. */
|
|
121
|
+
v?: 2;
|
|
122
|
+
errors: SheetpaneError[];
|
|
123
|
+
plugins?: string[];
|
|
124
|
+
/** The pane's layers in the order they were first named. */
|
|
125
|
+
layers?: string[];
|
|
126
|
+
/** The layers whose errors changed in this event. */
|
|
127
|
+
changed?: string[];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Where an error stands: `open` counts as a problem; `resolved` is fixed; `accepted` (W-69) is a known deviation someone
|
|
131
|
+
* approved with a reason — kept in the review and the download, never counted as open.
|
|
132
|
+
*/
|
|
133
|
+
export type ErrorStatus = 'open' | 'resolved' | 'accepted';
|
|
134
|
+
/** A JSON value: what `SheetpaneError.meta` holds (W-68). */
|
|
135
|
+
export type ErrorMeta = null | boolean | number | string | ErrorMeta[] | {
|
|
136
|
+
[key: string]: ErrorMeta;
|
|
137
|
+
};
|
|
138
|
+
/** The most an error's `meta` may weigh, in bytes of its JSON text (UTF-8): 64 KiB. Over it, the meta is dropped with SP-3016 (W-68). */
|
|
139
|
+
export declare const ERROR_META_MAX = 65536;
|
|
140
|
+
/**
|
|
141
|
+
* The host's extra detail for one error (W-68), drawn in the sheet's error card and the error list's open row, after the
|
|
142
|
+
* message, in a region the host styles as `::part(detail)`. A string is shown as text, never parsed as HTML; a Node is
|
|
143
|
+
* the host's own and is placed as it is; `null`, `undefined` or `''` shows nothing. It is called again only when the
|
|
144
|
+
* error changes (its `meta` included) or the hook is replaced. A throw is logged as SP-3017 and shows nothing.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* import '@sheetpane/grid';
|
|
149
|
+
* import type { RenderDetail } from '@sheetpane/grid';
|
|
150
|
+
* const detail: RenderDetail = (e) => {
|
|
151
|
+
* const m = e.meta as { measured?: string; expected?: string } | null | undefined;
|
|
152
|
+
* return m?.measured ? `The PDF measures ${m.measured}; the sheet says ${m.expected}.` : null;
|
|
153
|
+
* };
|
|
154
|
+
* document.querySelector('sheetpane-excel')!.renderDetail = detail;
|
|
155
|
+
* document.querySelector('sheetpane-errors')!.renderDetail = detail;
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
export type RenderDetail = (error: SheetpaneError) => Node | string | null | undefined;
|
|
159
|
+
/** A copy of an error the host may change freely: its `meta` is cloned too (W-68). */
|
|
160
|
+
export declare const copyError: (e: SheetpaneError) => SheetpaneError;
|
|
34
161
|
/** Plugins verdict decision 6. */
|
|
35
|
-
export type ChangeKind = 'value' | 'style' | 'numFmt' | 'formula' | 'merge' | 'freeze' | 'hidden' | 'sheetState' | 'outline';
|
|
162
|
+
export type ChangeKind = 'value' | 'style' | 'numFmt' | 'formula' | 'merge' | 'freeze' | 'hidden' | 'sheetState' | 'outline' | 'structure';
|
|
36
163
|
/** Whether Excel shows a sheet: `veryHidden` is hidden from Excel's own Unhide list (W-49). */
|
|
37
164
|
export type { SheetState } from '@sheetpane/export';
|
|
38
|
-
/** One entry of the change map, keyed `sheet!ref` (or `sheet!#freeze`). */
|
|
165
|
+
/** One entry of the change map, keyed `sheet!ref` (or `sheet!#freeze`; `sheet!#structure` holds the sheet's inserts and deletes, in order, W-52). */
|
|
39
166
|
export interface ChangeEntry {
|
|
40
167
|
kind: ChangeKind;
|
|
41
168
|
/** The uploaded value (for `value`: the stored cell; for others: the plugin's own shape). */
|
|
42
169
|
was: unknown;
|
|
43
170
|
now: unknown;
|
|
44
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* One change-map entry as the Edits view lists it (W-64, `store.edits()`): the edit's key, its place,
|
|
174
|
+
* kind, before and after, and when it was made. A kind the view does not know is listed as it is.
|
|
175
|
+
*/
|
|
176
|
+
export interface Edit {
|
|
177
|
+
/** The change-map key — `Sheet1!B3`, `Sheet1!#style:B3`, `Sheet1!#freeze` — what `revertEdits()` takes. */
|
|
178
|
+
key: string;
|
|
179
|
+
sheet: string;
|
|
180
|
+
/** The cell or range the edit is about (`B3`; `A1:C1` for a merge); `''` for one about the whole sheet (freeze, hidden rows, its state). */
|
|
181
|
+
ref: string;
|
|
182
|
+
kind: ChangeKind;
|
|
183
|
+
/** What the file had (for `value`: the stored cell). */
|
|
184
|
+
was: unknown;
|
|
185
|
+
/** What it holds now. */
|
|
186
|
+
now: unknown;
|
|
187
|
+
/** When the entry was last written, ISO 8601; undo brings back the entry with its time. */
|
|
188
|
+
at: string;
|
|
189
|
+
}
|
|
190
|
+
/** What an edit did to the problems on its cells (W-64, `store.editEffects(key)`): error ids, compared with before its cell first changed. */
|
|
191
|
+
export interface EditEffects {
|
|
192
|
+
/** Workbook, file or rule errors that were open and are now resolved or gone. */
|
|
193
|
+
cleared: string[];
|
|
194
|
+
/** Workbook, file or rule errors open now that were not open before. */
|
|
195
|
+
raised: string[];
|
|
196
|
+
/** A person's errors whose suggestion the cell now matches (they stay open — SR-GRID decision 5). */
|
|
197
|
+
matched: string[];
|
|
198
|
+
}
|
|
45
199
|
/** A value a plugin's `derive` hook computed (W-16): never a user change. */
|
|
46
200
|
export interface DerivedCell {
|
|
47
201
|
value: Cell;
|
|
@@ -88,7 +242,11 @@ export interface Source {
|
|
|
88
242
|
bytes: Uint8Array;
|
|
89
243
|
/** Milliseconds the read took. */
|
|
90
244
|
readMs: number;
|
|
245
|
+
/** The SHA-256 of `bytes`, 64 lowercase hex digits, hashed once on load (W-65); absent where Web Crypto is missing (SP-1009). */
|
|
246
|
+
sha256?: string;
|
|
91
247
|
}
|
|
248
|
+
/** Whether the pane keeps the file's protection in Edit (W-62): `honour` (the default) or `ignore` (the host's decision). */
|
|
249
|
+
export type ProtectionMode = 'honour' | 'ignore';
|
|
92
250
|
/** The pane's state at one moment: immutable, a new object per change (SR-GRID decision 2). */
|
|
93
251
|
export interface Snapshot {
|
|
94
252
|
readonly load: LoadState;
|
|
@@ -98,12 +256,21 @@ export interface Snapshot {
|
|
|
98
256
|
readonly changes: ReadonlyMap<string, ChangeEntry>;
|
|
99
257
|
/** `sheet!ref` → a value a plugin derived. */
|
|
100
258
|
readonly derived: ReadonlyMap<string, DerivedCell>;
|
|
259
|
+
/** Every error in the pane, in every layer (W-51). */
|
|
101
260
|
readonly errors: readonly SheetpaneError[];
|
|
261
|
+
/** The pane's review layers in the order they were first named (W-51): by `setErrors(list, { layer })`, by the `layers` attribute, or by an error. */
|
|
262
|
+
readonly layers: readonly string[];
|
|
263
|
+
/** The layers shown (W-51): what the `layers` attribute or the switch chose, else every layer. */
|
|
264
|
+
readonly visibleLayers: readonly string[];
|
|
265
|
+
/** The errors in the visible layers — what every surface draws and counts (W-51, SR-LAW-7). The same array as `errors` while every layer is shown. */
|
|
266
|
+
readonly visibleErrors: readonly SheetpaneError[];
|
|
102
267
|
readonly selection: Selection;
|
|
103
268
|
readonly mode: Mode;
|
|
104
269
|
readonly composing: Composing | null;
|
|
105
270
|
readonly canUndo: boolean;
|
|
106
271
|
readonly canRedo: boolean;
|
|
272
|
+
/** Whether the file's sheet and workbook protection is kept (W-62, SR-GRID decision 21e); the pane's, never undone. */
|
|
273
|
+
readonly protection: ProtectionMode;
|
|
107
274
|
/** Bumped on every change of state; elements compare it to skip work. */
|
|
108
275
|
readonly version: number;
|
|
109
276
|
}
|
|
@@ -119,6 +286,22 @@ export interface ErrorType {
|
|
|
119
286
|
export declare const DEFAULT_ERROR_TYPES: readonly ErrorType[];
|
|
120
287
|
/** Names for the types plugins and the core write, shown when the host's `errorTypes` does not name them. */
|
|
121
288
|
export declare const BUILTIN_TYPE_NAMES: Readonly<Record<string, string>>;
|
|
289
|
+
/** Where an error belongs (W-55). */
|
|
290
|
+
export type ErrorScope = 'cell' | 'sheet' | 'workbook';
|
|
291
|
+
/**
|
|
292
|
+
* Where an error belongs: `workbook` when `sheet` is `""`, `sheet` when `range` is `""`, else `cell`.
|
|
293
|
+
* A sheet- or workbook-level error has no cell — it is listed above the cell errors, never placed on A1.
|
|
294
|
+
*
|
|
295
|
+
* @param e - The error, or just its `sheet` and `range`.
|
|
296
|
+
* @returns `cell`, `sheet` or `workbook`.
|
|
297
|
+
* @example
|
|
298
|
+
* ```ts
|
|
299
|
+
* import { errorScope } from '@sheetpane/grid';
|
|
300
|
+
* errorScope({ sheet: 'Pages', range: '' }); // 'sheet'
|
|
301
|
+
* errorScope({ sheet: '', range: '' }); // 'workbook'
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
export declare const errorScope: (e: Pick<SheetpaneError, 'sheet' | 'range'>) => ErrorScope;
|
|
122
305
|
/** Errors the workbook, the file or a host rule wrote: shown, never resolved or deleted by hand. */
|
|
123
306
|
export declare const machineAuthored: (author: string) => author is "file" | "host" | "workbook";
|
|
124
307
|
/** Each severity's name, glyph and help line — a glyph and a colour, never colour alone. */
|
|
@@ -127,4 +310,10 @@ export declare const SEVERITY: Record<Severity, {
|
|
|
127
310
|
glyph: string;
|
|
128
311
|
help: string;
|
|
129
312
|
}>;
|
|
313
|
+
/** Severity order, worst first: error › warning › note › skipped › pass (W-50 DoD 4). */
|
|
314
|
+
export declare const SEVERITY_ORDER: Record<Severity, number>;
|
|
315
|
+
/** A `pass` or `skipped` entry: a result, never counted where a count asks for action (W-50). */
|
|
316
|
+
export declare const isResult: (e: {
|
|
317
|
+
severity: Severity;
|
|
318
|
+
}) => boolean;
|
|
130
319
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/pane/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pane/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,oGAAoG;AACpG,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AACnC
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pane/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,oGAAoG;AACpG,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AACnC;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AACzE,mEAAmE;AACnE,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3D,qFAAqF;AACrF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC;AAChD;;;;GAIG;AACH,MAAM,MAAM,YAAY,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AAyF;AACzF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAA0D,CAAC;AAE/G,iGAAiG;AACjG,eAAO,MAAM,QAAQ,MAAO;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,KAAG,OAA4D,CAAC"}
|
package/dist/pane/types.js
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
/** The results levels, in order. */
|
|
2
|
+
export const RESULTS_LEVELS = ['off', 'summary', 'marks'];
|
|
3
|
+
/** The `results` attribute's level: `off` or `marks`, else `summary`. */
|
|
4
|
+
export const resultsLevelOf = (v) => (v === 'off' || v === 'marks' ? v : 'summary');
|
|
5
|
+
/** The layer an error is in when nobody names one (W-51): `"review"` — people's errors and the plugins' land here. */
|
|
6
|
+
export const DEFAULT_LAYER = 'review';
|
|
7
|
+
/**
|
|
8
|
+
* Whether a value may name a review layer (W-51): a string of 1–64 characters with no whitespace, so the `layers`
|
|
9
|
+
* attribute can list several separated by spaces.
|
|
10
|
+
*
|
|
11
|
+
* @param x - Any value.
|
|
12
|
+
* @returns True for a usable layer name.
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { isLayerName } from '@sheetpane/grid';
|
|
16
|
+
* isLayerName('pdf'); // true
|
|
17
|
+
* isLayerName('PDF check'); // false — a space
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const isLayerName = (x) => typeof x === 'string' && /^\S{1,64}$/.test(x);
|
|
21
|
+
/**
|
|
22
|
+
* The layer an error is in (W-51): its `layer`, else {@link DEFAULT_LAYER}.
|
|
23
|
+
*
|
|
24
|
+
* @param e - The error, or just its `layer`.
|
|
25
|
+
* @returns The layer's name.
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { layerOf } from '@sheetpane/grid';
|
|
29
|
+
* layerOf({ layer: 'pdf' }); // 'pdf'
|
|
30
|
+
* layerOf({}); // 'review'
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const layerOf = (e) => e.layer ?? DEFAULT_LAYER;
|
|
34
|
+
/** The most an error's `meta` may weigh, in bytes of its JSON text (UTF-8): 64 KiB. Over it, the meta is dropped with SP-3016 (W-68). */
|
|
35
|
+
export const ERROR_META_MAX = 65536;
|
|
36
|
+
/** A copy of an error the host may change freely: its `meta` is cloned too (W-68). */
|
|
37
|
+
export const copyError = (e) => (e.meta !== null && typeof e.meta === 'object' ? { ...e, meta: structuredClone(e.meta) } : { ...e });
|
|
1
38
|
/** The seven error types and Other that `errorTypes` defaults to (SR-ERRORS decision 6). */
|
|
2
39
|
export const DEFAULT_ERROR_TYPES = [
|
|
3
40
|
{ id: 'wrong-value', name: 'Wrong value', severity: 'error', why: 'Fee rate is 10× the account’s tier and above the 2.00% cap — a misplaced decimal.', expected: '0.75%' },
|
|
@@ -11,6 +48,20 @@ export const DEFAULT_ERROR_TYPES = [
|
|
|
11
48
|
];
|
|
12
49
|
/** Names for the types plugins and the core write, shown when the host's `errorTypes` does not name them. */
|
|
13
50
|
export const BUILTIN_TYPE_NAMES = { validation: 'Workbook rule', comment: 'Comment', 'column-rule': 'Column rule', 'cell-rule': 'Cell rule' };
|
|
51
|
+
/**
|
|
52
|
+
* Where an error belongs: `workbook` when `sheet` is `""`, `sheet` when `range` is `""`, else `cell`.
|
|
53
|
+
* A sheet- or workbook-level error has no cell — it is listed above the cell errors, never placed on A1.
|
|
54
|
+
*
|
|
55
|
+
* @param e - The error, or just its `sheet` and `range`.
|
|
56
|
+
* @returns `cell`, `sheet` or `workbook`.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { errorScope } from '@sheetpane/grid';
|
|
60
|
+
* errorScope({ sheet: 'Pages', range: '' }); // 'sheet'
|
|
61
|
+
* errorScope({ sheet: '', range: '' }); // 'workbook'
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export const errorScope = (e) => (e.sheet === '' ? 'workbook' : e.range === '' ? 'sheet' : 'cell');
|
|
14
65
|
/** Errors the workbook, the file or a host rule wrote: shown, never resolved or deleted by hand. */
|
|
15
66
|
export const machineAuthored = (author) => author === 'workbook' || author === 'file' || author === 'host';
|
|
16
67
|
/** Each severity's name, glyph and help line — a glyph and a colour, never colour alone. */
|
|
@@ -18,5 +69,11 @@ export const SEVERITY = {
|
|
|
18
69
|
error: { name: 'Error', glyph: '✕', help: 'Must be fixed before this file is accepted.' },
|
|
19
70
|
warning: { name: 'Warning', glyph: '!', help: 'Needs a second look; may be fine.' },
|
|
20
71
|
note: { name: 'Note', glyph: 'i', help: 'For information — nothing blocks.' },
|
|
72
|
+
pass: { name: 'Passed', glyph: '✓', help: 'A check ran on this cell and it passed — not a problem.' },
|
|
73
|
+
skipped: { name: 'Not checked', glyph: '—', help: 'No check ran on this cell; the message says why — not a problem.' },
|
|
21
74
|
};
|
|
75
|
+
/** Severity order, worst first: error › warning › note › skipped › pass (W-50 DoD 4). */
|
|
76
|
+
export const SEVERITY_ORDER = { error: 5, warning: 4, note: 3, skipped: 2, pass: 1 };
|
|
77
|
+
/** A `pass` or `skipped` entry: a result, never counted where a count asks for action (W-50). */
|
|
78
|
+
export const isResult = (e) => e.severity === 'pass' || e.severity === 'skipped';
|
|
22
79
|
//# sourceMappingURL=types.js.map
|
package/dist/pane/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pane/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pane/types.ts"],"names":[],"mappings":"AAsBA,oCAAoC;AACpC,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACnF,yEAAyE;AACzE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAA4B,EAAgB,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,OAAO,CAAC,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