@rivm-loculus-tools/sequence-editor 1.7.0 → 1.8.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 (33) hide show
  1. package/dist/_chunks/SequenceEditor.js +138 -120
  2. package/dist/_chunks/SequenceEditor.js.map +1 -1
  3. package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
  4. package/dist/_chunks/SequenceEditorPageDrawer.js +97 -96
  5. package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
  6. package/dist/_chunks/SequenceEditorPageHeader.js +120 -0
  7. package/dist/_chunks/SequenceEditorPageHeader.js.map +1 -0
  8. package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +1 -0
  9. package/dist/components/app/SequenceEditorApp/index.js +4 -1
  10. package/dist/components/app/SequenceEditorApp/index.js.map +1 -1
  11. package/dist/components/ui/SequenceEditorPageHeader/SequenceEditorUndoRedoButtons.d.ts +1 -0
  12. package/dist/components/ui/SequenceEditorPageHeader/index.js +1 -109
  13. package/dist/components/ui/SequenceEditorRealignModal/index.js +2 -2
  14. package/dist/components/ui/SequenceEditorRealignModal/index.js.map +1 -1
  15. package/dist/constants/index.js +5 -4
  16. package/dist/constants/keyboard.js +2 -2
  17. package/dist/constants/keyboard.js.map +1 -1
  18. package/dist/constants/palette.d.ts +1 -2
  19. package/dist/constants/palette.js +162 -204
  20. package/dist/constants/palette.js.map +1 -1
  21. package/dist/constants/paletteSchemaData.d.ts +4 -0
  22. package/dist/constants/paletteSchemaData.js +48 -0
  23. package/dist/constants/paletteSchemaData.js.map +1 -0
  24. package/dist/pages/SequenceEditorMainPage/index.js +1 -0
  25. package/dist/pages/SequenceEditorMainPage/index.js.map +1 -1
  26. package/dist/utils/EditorUtil/index.js +83 -83
  27. package/dist/utils/EditorUtil/index.js.map +1 -1
  28. package/dist/utils/SequenceEditorStandardConfigUtil/index.js +1 -1
  29. package/dist/vite/paletteSchemaPlugin/index.d.ts +1 -1
  30. package/dist/vite/paletteSchemaPlugin/index.js +1 -1
  31. package/dist/vite/paletteSchemaPlugin/index.js.map +1 -1
  32. package/package.json +6 -2
  33. package/dist/components/ui/SequenceEditorPageHeader/index.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { PaletteUtil as e } from "../PaletteUtil/index.js";
2
- import { DEFAULT_GRID_GEOMETRY as t } from "../../constants/editor.js";
3
- import { EDITOR_DIRECTION as n, EDITOR_PATH_PROPERTIES_TYPE as r, MATRIX_TYPE as i } from "../../models/editor.models.js";
1
+ import { DEFAULT_GRID_GEOMETRY as e } from "../../constants/editor.js";
2
+ import { EDITOR_DIRECTION as t, EDITOR_PATH_PROPERTIES_TYPE as n, MATRIX_TYPE as r } from "../../models/editor.models.js";
3
+ import { PaletteUtil as i } from "../PaletteUtil/index.js";
4
4
  import "../../constants/index.js";
5
5
  // \0rolldown/runtime.js
6
6
  var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescriptor, c = Object.getOwnPropertyNames, l = Object.getPrototypeOf, u = Object.prototype.hasOwnProperty, d = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), f = (e, t, n, r) => {
@@ -235,52 +235,52 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
235
235
  }
236
236
  t.exports = o;
237
237
  })))(), 1), G = class a {
238
- static drawCanvas({ canvasElement: t, devicePixelRatio: n, geometry: o, meta: s, palette: c, rowNames: l, rowNamesStartRow: u, scrollLeft: d, scrollTop: f, searchResult: p, searchResultHighlightedIndex: m, selection: h, viewport: g, viewportHeight: _, viewportWidth: v }) {
238
+ static drawCanvas({ canvasElement: e, devicePixelRatio: t, geometry: o, meta: s, palette: c, rowNames: l, rowNamesStartRow: u, scrollLeft: d, scrollTop: f, searchResult: p, searchResultHighlightedIndex: m, selection: h, viewport: g, viewportHeight: _, viewportWidth: v }) {
239
239
  let y = {
240
240
  cells: { pathPropertiesMap: /* @__PURE__ */ new Map() },
241
241
  divider: { pathPropertiesMap: /* @__PURE__ */ new Map() },
242
242
  labels: { pathPropertiesMap: /* @__PURE__ */ new Map() },
243
243
  ruler: { pathPropertiesMap: /* @__PURE__ */ new Map() }
244
244
  };
245
- if (!t) return y;
246
- let b = t.getContext("2d");
245
+ if (!e) return y;
246
+ let b = e.getContext("2d");
247
247
  if (!b) return y;
248
248
  let x = s.sequenceCount.toString().length, S = (e) => h?.rows?.includes(e) ?? !1, C = (e, t) => !!(h?.cells && t >= h.cells.startCol && t <= h.cells.endCol && e >= h.cells.startRow && e <= h.cells.endRow) || !!h?.cols?.includes(t) || !!S(e), w = p && m !== null ? a.searchHitAt(p, m) : null;
249
- return a.draw(t, n, () => {
250
- b.clearRect(0, 0, t.width, t.height);
251
- let { cellHeight: n, cellWidth: s, dividerWidth: m, labelWidth: T, rulerHeight: E } = o, D = T + m, { bytes: O, cols: k, rows: A, startCol: j, startRow: M } = g, N = (p?.positions.length ?? 0) > 0, P = N ? new Uint8Array(A * k) : null, F = w ? new Uint8Array(A * k) : null, I = N ? new Uint8Array(A) : null, L = w ? new Uint8Array(A) : null, R = N ? new Path2D() : null, z = w ? new Path2D() : null, B = !1, V = !1, H = (e, t) => {
249
+ return a.draw(e, t, () => {
250
+ b.clearRect(0, 0, e.width, e.height);
251
+ let { cellHeight: t, cellWidth: s, dividerWidth: m, labelWidth: T, rulerHeight: E } = o, D = T + m, { bytes: O, cols: k, rows: A, startCol: j, startRow: M } = g, N = (p?.positions.length ?? 0) > 0, P = N ? new Uint8Array(A * k) : null, F = w ? new Uint8Array(A * k) : null, I = N ? new Uint8Array(A) : null, L = w ? new Uint8Array(A) : null, R = N ? new Path2D() : null, z = w ? new Path2D() : null, B = !1, V = !1, H = (e, t) => {
252
252
  if (!p) return;
253
- let n = Math.max(1, p.query.length), r = e.row - M;
254
- if (r < 0 || r >= A) return;
255
- if (e.matrix_type === i.RECORD_NAME) {
256
- t.fill(1, r * k, (r + 1) * k);
253
+ let n = Math.max(1, p.query.length), i = e.row - M;
254
+ if (i < 0 || i >= A) return;
255
+ if (e.matrix_type === r.RECORD_NAME) {
256
+ t.fill(1, i * k, (i + 1) * k);
257
257
  return;
258
258
  }
259
259
  let o = Math.max(j, e.col), s = Math.min(j + k, e.col + n);
260
260
  if (o >= s || !a.searchHitContainsCell(e, p.query, e.row, o)) return;
261
- let c = r * k + o - j;
261
+ let c = i * k + o - j;
262
262
  t.fill(1, c, c + s - o);
263
263
  }, U = (e, t) => {
264
- e.matrix_type === i.RECORD_NAME && e.row >= M && e.row < M + A && (t[e.row - M] = 1);
264
+ e.matrix_type === r.RECORD_NAME && e.row >= M && e.row < M + A && (t[e.row - M] = 1);
265
265
  };
266
266
  p && P && (p.positions.forEach((e) => H(e, P)), p.positions.forEach((e) => {
267
267
  I && U(e, I);
268
268
  }), w && F && (H(w, F), L && U(w, L))), b.font = "12px monospace", b.textAlign = "center", b.textBaseline = "middle";
269
- for (let t = 0; t < A; t++) {
270
- let i = (M + t) * n + E - f;
271
- if (!(i + n < E || i > _)) for (let a = 0; a < k; a++) {
269
+ for (let e = 0; e < A; e++) {
270
+ let r = (M + e) * t + E - f;
271
+ if (!(r + t < E || r > _)) for (let a = 0; a < k; a++) {
272
272
  let o = (j + a) * s + D - d;
273
273
  if (o + s < D || o > v) continue;
274
- let l = O[t * k + a], u = j + a, f = M + t, p = l ?? "", m = String.fromCharCode(p), h = e.paletteEntryFor(c, m), g = h.background;
274
+ let l = O[e * k + a], u = j + a, f = M + e, p = l ?? "", m = String.fromCharCode(p), h = i.paletteEntryFor(c, m), g = h.background;
275
275
  l === null ? g = "#e9eef2" : m === " " && (g = "#f7f8f9");
276
276
  let _ = h.foreground;
277
277
  C(f, u) && (g = h.backgroundSelected, _ = h.foregroundSelected);
278
- let x = t * k + a, S = P?.[x] === 1, w = F?.[x] === 1, T = new Path2D();
279
- T.rect(o, i, s, n), T.closePath(), y.cells.pathPropertiesMap.set(T, {
278
+ let x = e * k + a, S = P?.[x] === 1, w = F?.[x] === 1, T = new Path2D();
279
+ T.rect(o, r, s, t), T.closePath(), y.cells.pathPropertiesMap.set(T, {
280
280
  col: u,
281
281
  row: f,
282
- type: r.CELL
283
- }), b.fillStyle = g, b.fill(T), (w || L?.[t] === 1) && (b.fillStyle = "rgba(255, 193, 7, 0.35)", b.fillRect(o + 2, i + 2, Math.max(0, s - 4), Math.max(0, n - 4))), b.fillStyle = _, b.fillText(m, o + s / 2, i + n / 2), (S || I?.[t] === 1) && R && (B = !0, R.rect(o + .5, i + .5, s - 1, n - 1), (w || L?.[t] === 1) && z && (V = !0, z.rect(o + 1, i + 1, s - 2, n - 2)));
282
+ type: n.CELL
283
+ }), b.fillStyle = g, b.fill(T), (w || L?.[e] === 1) && (b.fillStyle = "rgba(255, 193, 7, 0.35)", b.fillRect(o + 2, r + 2, Math.max(0, s - 4), Math.max(0, t - 4))), b.fillStyle = _, b.fillText(m, o + s / 2, r + t / 2), (S || I?.[e] === 1) && R && (B = !0, R.rect(o + .5, r + .5, s - 1, t - 1), (w || L?.[e] === 1) && z && (V = !0, z.rect(o + 1, r + 1, s - 2, t - 2)));
284
284
  }
285
285
  }
286
286
  B && R && (b.strokeStyle = "#000000", b.lineWidth = 1, b.stroke(R)), V && z && (b.lineWidth = 2, b.stroke(z)), b.fillStyle = "#edf2f6", b.fillRect(0, 0, v, E), b.font = "12px monospace", b.textBaseline = "middle";
@@ -289,12 +289,12 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
289
289
  for (let e = 0; e < k; e++) {
290
290
  let t = (j + e + 1) % 10 == 0;
291
291
  t && G.push(e);
292
- let n = (j + e) * s + D - d, i = new Path2D();
293
- i.rect(n, 0, s, E), i.closePath(), y.ruler.pathPropertiesMap.set(i, {
292
+ let r = (j + e) * s + D - d, i = new Path2D();
293
+ i.rect(r, 0, s, E), i.closePath(), y.ruler.pathPropertiesMap.set(i, {
294
294
  col: j + e,
295
- type: r.RULER
295
+ type: n.RULER
296
296
  });
297
- let a = n + .5, o = t ? 8 : 4;
297
+ let a = r + .5, o = t ? 8 : 4;
298
298
  b.moveTo(a, E), b.lineTo(a, E - o);
299
299
  }
300
300
  b.stroke(), b.fillStyle = "#486581", b.textAlign = "center", G.forEach((e) => {
@@ -302,55 +302,55 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
302
302
  t - r / 2 < D || t + r / 2 > v || b.fillText(n, t, E / 2);
303
303
  }), b.textAlign = "start", b.strokeStyle = "#bcccdc", b.lineWidth = 1, b.beginPath(), b.moveTo(D + .5, 0), b.lineTo(D + .5, _), b.moveTo(0, E + .5), b.lineTo(v, E + .5), b.stroke(), b.fillStyle = "#edf2f6", b.fillRect(0, 0, D, E), b.fillStyle = "#d9e2ec", b.fillRect(T, 0, m, _);
304
304
  let K = new Path2D();
305
- K.rect(T, 0, m, _), K.closePath(), y.divider.pathPropertiesMap.set(K, { type: r.DIVIDER }), b.fillStyle = "#f8fafb", b.fillRect(0, E, T, _ - E), b.font = "12px monospace", b.textBaseline = "middle", b.save(), b.beginPath(), b.rect(0, E, T, _ - E), b.clip();
305
+ K.rect(T, 0, m, _), K.closePath(), y.divider.pathPropertiesMap.set(K, { type: n.DIVIDER }), b.fillStyle = "#f8fafb", b.fillRect(0, E, T, _ - E), b.font = "12px monospace", b.textBaseline = "middle", b.save(), b.beginPath(), b.rect(0, E, T, _ - E), b.clip();
306
306
  for (let e = 0; e < A; e++) {
307
- let t = (M + e) * n + E - f;
308
- if (t + n < E || t > _) continue;
307
+ let r = (M + e) * t + E - f;
308
+ if (r + t < E || r > _) continue;
309
309
  let i = new Path2D();
310
- i.rect(0, t, T, n), i.closePath(), y.labels.pathPropertiesMap.set(i, {
310
+ i.rect(0, r, T, t), i.closePath(), y.labels.pathPropertiesMap.set(i, {
311
311
  row: M + e,
312
- type: r.LABEL
312
+ type: n.LABEL
313
313
  });
314
314
  let a = M + e - u, o = M + e, s = I?.[e] === 1, c = L?.[e] === 1, d = !!h?.cols || !!(h?.cells && o >= h.cells.startRow && o <= h.cells.endRow) || S(o);
315
- b.fillStyle = d ? "#1565c0" : "#f8fafb", b.fillRect(0, t, T, n), s && (b.fillStyle = "#ffecb3", b.fillRect(0, t, T, n)), c && (b.fillStyle = "rgba(255, 193, 7, 0.35)", b.fillRect(2, t + 2, Math.max(0, T - 4), Math.max(0, n - 4))), b.fillStyle = d ? "#ffffff" : "#334e68", b.fillText(`${(0, W.default)(String(M + e + 1), x, "0")}: ${l[a] ?? ""}`, 8, t + n / 2);
315
+ b.fillStyle = d ? "#1565c0" : "#f8fafb", b.fillRect(0, r, T, t), s && (b.fillStyle = "#ffecb3", b.fillRect(0, r, T, t)), c && (b.fillStyle = "rgba(255, 193, 7, 0.35)", b.fillRect(2, r + 2, Math.max(0, T - 4), Math.max(0, t - 4))), b.fillStyle = d ? "#ffffff" : "#334e68", b.fillText(`${(0, W.default)(String(M + e + 1), x, "0")}: ${l[a] ?? ""}`, 8, r + t / 2);
316
316
  }
317
317
  b.restore();
318
318
  }), y;
319
319
  }
320
- static getExpandedSelection(e, t, r, i) {
320
+ static getExpandedSelection(e, n, r, i) {
321
321
  let a = e.cells;
322
322
  if (a) {
323
- if (r === n.LEFT) {
324
- let e = t.cells;
323
+ if (r === t.LEFT) {
324
+ let e = n.cells;
325
325
  if (!e) return null;
326
- let n = a.startCol < e.startCol || a.endCol <= e.startCol, r = n ? a.startCol - 1 : a.startCol, i = n ? a.endCol : a.endCol - 1;
326
+ let t = a.startCol < e.startCol || a.endCol <= e.startCol, r = t ? a.startCol - 1 : a.startCol, i = t ? a.endCol : a.endCol - 1;
327
327
  return r < 0 ? null : { cells: {
328
328
  ...a,
329
329
  endCol: i,
330
330
  startCol: r
331
331
  } };
332
332
  }
333
- if (r === n.RIGHT) {
334
- let e = t.cells;
333
+ if (r === t.RIGHT) {
334
+ let e = n.cells;
335
335
  if (!e) return null;
336
- let n = a.startCol < e.startCol ? a.startCol + 1 : a.startCol, r = a.startCol < e.startCol ? a.endCol : a.endCol + 1;
336
+ let t = a.startCol < e.startCol ? a.startCol + 1 : a.startCol, r = a.startCol < e.startCol ? a.endCol : a.endCol + 1;
337
337
  return r >= i.alignmentWidth ? null : { cells: {
338
338
  ...a,
339
339
  endCol: r,
340
- startCol: n
340
+ startCol: t
341
341
  } };
342
342
  }
343
- if (r === n.UP) {
344
- let e = t.cells;
343
+ if (r === t.UP) {
344
+ let e = n.cells;
345
345
  if (!e) return null;
346
- let n = a.startRow < e.startRow || a.endRow <= e.startRow, r = n ? a.startRow - 1 : a.startRow, i = n ? a.endRow : a.endRow - 1;
346
+ let t = a.startRow < e.startRow || a.endRow <= e.startRow, r = t ? a.startRow - 1 : a.startRow, i = t ? a.endRow : a.endRow - 1;
347
347
  return r < 0 ? null : { cells: {
348
348
  ...a,
349
349
  endRow: i,
350
350
  startRow: r
351
351
  } };
352
352
  }
353
- let e = t.cells;
353
+ let e = n.cells;
354
354
  if (!e) return null;
355
355
  let o = a.startRow < e.startRow ? a.startRow + 1 : a.startRow, s = a.startRow < e.startRow ? a.endRow : a.endRow + 1;
356
356
  return s >= i.sequenceCount ? null : { cells: {
@@ -361,17 +361,17 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
361
361
  }
362
362
  let o = e.cols;
363
363
  if (o) {
364
- if (o.length === 0 || r !== n.LEFT && r !== n.RIGHT) return null;
365
- let e = Math.min(...o), a = Math.max(...o), s = t.cols;
364
+ if (o.length === 0 || r !== t.LEFT && r !== t.RIGHT) return null;
365
+ let e = Math.min(...o), a = Math.max(...o), s = n.cols;
366
366
  if (!s || s.length === 0) return null;
367
367
  let c = Math.min(...s);
368
- return r === n.LEFT ? a > c ? { cols: o.slice(0, -1) } : e > 0 ? { cols: [e - 1, ...o] } : null : e < c ? { cols: o.slice(1) } : a < i.alignmentWidth - 1 ? { cols: [...o, a + 1] } : null;
368
+ return r === t.LEFT ? a > c ? { cols: o.slice(0, -1) } : e > 0 ? { cols: [e - 1, ...o] } : null : e < c ? { cols: o.slice(1) } : a < i.alignmentWidth - 1 ? { cols: [...o, a + 1] } : null;
369
369
  }
370
370
  return e.rows ? e : null;
371
371
  }
372
- static getMovedRowsEndSelection(e, t, r) {
372
+ static getMovedRowsEndSelection(e, n, r) {
373
373
  if (!e || !r) return null;
374
- let i = t === n.UP ? 0 : r.sequenceCount;
374
+ let i = n === t.UP ? 0 : r.sequenceCount;
375
375
  return a.getMovedRowsGroupedSelection(e, i, r);
376
376
  }
377
377
  static getMovedRowsGroupedSelection(e, t, n) {
@@ -392,13 +392,13 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
392
392
  }
393
393
  return null;
394
394
  }
395
- static getMovedRowsRelativeSelection(e, t, r) {
395
+ static getMovedRowsRelativeSelection(e, n, r) {
396
396
  if (!e || !r) return null;
397
397
  let i = e.cells;
398
398
  if (i) {
399
- let a = t === n.UP && i.startRow > 0, o = t === n.DOWN && i.endRow < r.sequenceCount - 1;
399
+ let a = n === t.UP && i.startRow > 0, o = n === t.DOWN && i.endRow < r.sequenceCount - 1;
400
400
  if (!a && !o) return e;
401
- let s = t === n.UP ? -1 : 1;
401
+ let s = n === t.UP ? -1 : 1;
402
402
  return { cells: {
403
403
  ...i,
404
404
  endRow: i.endRow + s,
@@ -408,8 +408,8 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
408
408
  let a = e.rows;
409
409
  if (a && a.length > 0) {
410
410
  let e = [...new Set(a)].sort((e, t) => e - t), i = e.length;
411
- if (t === n.UP) return { rows: e.map((e, t) => Math.max(t, e - 1)) };
412
- if (t === n.DOWN) {
411
+ if (n === t.UP) return { rows: e.map((e, t) => Math.max(t, e - 1)) };
412
+ if (n === t.DOWN) {
413
413
  let t = r.sequenceCount - i;
414
414
  return { rows: e.map((e, n) => Math.min(t + n, e + 1)) };
415
415
  }
@@ -417,10 +417,10 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
417
417
  }
418
418
  return null;
419
419
  }
420
- static getMovedSelection(e, t, r) {
420
+ static getMovedSelection(e, n, r) {
421
421
  if (!e || !r) return null;
422
- let i = t === n.LEFT || t === n.UP ? -1 : 1, o = (e, t, n) => i < 0 ? e > 0 : t < n - 1, s = e.cells;
423
- if (s) return t === n.LEFT || t === n.RIGHT ? o(s.startCol, s.endCol, r.alignmentWidth) ? { cells: {
422
+ let i = n === t.LEFT || n === t.UP ? -1 : 1, o = (e, t, n) => i < 0 ? e > 0 : t < n - 1, s = e.cells;
423
+ if (s) return n === t.LEFT || n === t.RIGHT ? o(s.startCol, s.endCol, r.alignmentWidth) ? { cells: {
424
424
  endCol: s.endCol + i,
425
425
  endRow: s.endRow,
426
426
  startCol: s.startCol + i,
@@ -432,9 +432,9 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
432
432
  startRow: s.startRow + i
433
433
  } } : null;
434
434
  let c = e.cols;
435
- if (c) return t !== n.LEFT && t !== n.RIGHT || c.length === 0 || !o(Math.min(...c), Math.max(...c), r.alignmentWidth) ? null : { cols: c.map((e) => e + i) };
435
+ if (c) return n !== t.LEFT && n !== t.RIGHT || c.length === 0 || !o(Math.min(...c), Math.max(...c), r.alignmentWidth) ? null : { cols: c.map((e) => e + i) };
436
436
  let l = e.rows;
437
- return l ? t !== n.UP && t !== n.DOWN || l.length === 0 ? null : a.getMovedRowsRelativeSelection(e, t, r) : null;
437
+ return l ? n !== t.UP && n !== t.DOWN || l.length === 0 ? null : a.getMovedRowsRelativeSelection(e, n, r) : null;
438
438
  }
439
439
  static getMutateArguments(e, t, n = 0) {
440
440
  let r = e?.cells;
@@ -458,15 +458,15 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
458
458
  }
459
459
  static getPathPropertiesFromCanvas(e) {
460
460
  let { canvas: t, devicePixelRatio: n, editorAssembly: r, event: i } = e, o = a.getCanvasContext(t), s = t.getBoundingClientRect(), c = t.width / s.width, l = t.height / s.height, u = (i.clientX - s.left) * c / n, d = (i.clientY - s.top) * l / n;
461
- for (let [e, t] of r.cells.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
462
461
  for (let [e, t] of r.ruler.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
463
462
  for (let [e, t] of r.labels.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
464
463
  for (let [e, t] of r.divider.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
464
+ for (let [e, t] of r.cells.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
465
465
  }
466
- static getPostUpsertSelection(e, t) {
466
+ static getPostUpsertSelection(e, n) {
467
467
  if (!e) return null;
468
- if (t !== n.LEFT && t !== n.RIGHT) return e;
469
- let r = t === n.LEFT ? -1 : 1, i = e.cells;
468
+ if (n !== t.LEFT && n !== t.RIGHT) return e;
469
+ let r = n === t.LEFT ? -1 : 1, i = e.cells;
470
470
  if (i) {
471
471
  let t = i.startCol + r, n = i.endCol + r;
472
472
  return t < 0 ? e : { cells: {
@@ -484,32 +484,32 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
484
484
  let o = e.rows;
485
485
  return o ? { rows: o } : null;
486
486
  }
487
- static getRowsToMove(e, t, r) {
487
+ static getRowsToMove(e, n, r) {
488
488
  let i = e?.cells, a = e?.rows ?? (i ? Array.from({ length: i.endRow - i.startRow + 1 }, (e, t) => i.startRow + t) : void 0);
489
489
  if (!a || a.length === 0) return;
490
490
  let o = [...new Set(a)].sort((e, t) => e - t), s = o.length;
491
491
  if (s !== 0 && s !== r.sequenceCount) {
492
- if (t === n.UP) {
492
+ if (n === t.UP) {
493
493
  if (o.every((e, t) => e === t)) return;
494
- } else if (t === n.DOWN && o.every((e, t) => e === r.sequenceCount - s + t)) return;
494
+ } else if (n === t.DOWN && o.every((e, t) => e === r.sequenceCount - s + t)) return;
495
495
  return a;
496
496
  }
497
497
  }
498
498
  static getSelectionFromPathProperties(e) {
499
- let { endPath: t, startPath: n } = e;
500
- if (n.type === r.RULER && (t.type === r.RULER || t.type === r.CELL)) {
501
- let e = Math.min(n.col, t.col), r = Math.max(n.col, t.col);
502
- return { cols: Array.from({ length: r - e + 1 }, (t, n) => e + n) };
499
+ let { endPath: t, startPath: r } = e;
500
+ if (r.type === n.RULER && (t.type === n.RULER || t.type === n.CELL)) {
501
+ let e = Math.min(r.col, t.col), n = Math.max(r.col, t.col);
502
+ return { cols: Array.from({ length: n - e + 1 }, (t, n) => e + n) };
503
503
  }
504
- if (n.type === r.CELL && t.type === r.CELL) return { cells: {
505
- endCol: Math.max(n.col, t.col),
506
- endRow: Math.max(n.row, t.row),
507
- startCol: Math.min(n.col, t.col),
508
- startRow: Math.min(n.row, t.row)
504
+ if (r.type === n.CELL && t.type === n.CELL) return { cells: {
505
+ endCol: Math.max(r.col, t.col),
506
+ endRow: Math.max(r.row, t.row),
507
+ startCol: Math.min(r.col, t.col),
508
+ startRow: Math.min(r.row, t.row)
509
509
  } };
510
- if (n.type === r.LABEL && t.type === r.LABEL) {
511
- let e = Math.min(n.row, t.row), r = Math.max(n.row, t.row);
512
- return { rows: Array.from({ length: r - e + 1 }, (t, n) => e + n) };
510
+ if (r.type === n.LABEL && t.type === n.LABEL) {
511
+ let e = Math.min(r.row, t.row), n = Math.max(r.row, t.row);
512
+ return { rows: Array.from({ length: n - e + 1 }, (t, n) => e + n) };
513
513
  }
514
514
  }
515
515
  static getStatusBarSelectionStats(e, t = null) {
@@ -562,8 +562,8 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
562
562
  rows: a
563
563
  };
564
564
  }
565
- static getVisibleGridRange(e) {
566
- let { geometry: n = t, numCols: r, numRows: i, scrollLeft: a, scrollTop: o, viewportHeight: s, viewportWidth: c } = e, l = n.labelWidth + n.dividerWidth, u = Math.max(0, Math.floor(a / n.cellWidth)), d = Math.min(r, u + Math.max(1, Math.ceil((c - l) / n.cellWidth) + 1)), f = Math.max(0, Math.floor(Math.max(0, o - n.rulerHeight) / n.cellHeight)), p = Math.min(i, f + Math.max(1, Math.ceil((s - n.rulerHeight) / n.cellHeight) + 1));
565
+ static getVisibleGridRange(t) {
566
+ let { geometry: n = e, numCols: r, numRows: i, scrollLeft: a, scrollTop: o, viewportHeight: s, viewportWidth: c } = t, l = n.labelWidth + n.dividerWidth, u = Math.max(0, Math.floor(a / n.cellWidth)), d = Math.min(r, u + Math.max(1, Math.ceil((c - l) / n.cellWidth) + 1)), f = Math.max(0, Math.floor(Math.max(0, o - n.rulerHeight) / n.cellHeight)), p = Math.min(i, f + Math.max(1, Math.ceil((s - n.rulerHeight) / n.cellHeight) + 1));
567
567
  return {
568
568
  cache: {
569
569
  endCol: Math.min(r, d + n.numOverscanCols),
@@ -611,8 +611,8 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
611
611
  static searchHitAt(e, t) {
612
612
  return e?.positions[t] ?? null;
613
613
  }
614
- static searchHitContainsCell(e, t, n, r) {
615
- return e.matrix_type === i.NUCLEOTIDE && e.row === n && r >= e.col && r < e.col + Math.max(1, t.length);
614
+ static searchHitContainsCell(e, t, n, i) {
615
+ return e.matrix_type === r.NUCLEOTIDE && e.row === n && i >= e.col && i < e.col + Math.max(1, t.length);
616
616
  }
617
617
  };
618
618
  export { G as EditorUtil };