@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.
- package/dist/_chunks/SequenceEditor.js +138 -120
- package/dist/_chunks/SequenceEditor.js.map +1 -1
- package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageDrawer.js +97 -96
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageHeader.js +120 -0
- package/dist/_chunks/SequenceEditorPageHeader.js.map +1 -0
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +1 -0
- package/dist/components/app/SequenceEditorApp/index.js +4 -1
- package/dist/components/app/SequenceEditorApp/index.js.map +1 -1
- package/dist/components/ui/SequenceEditorPageHeader/SequenceEditorUndoRedoButtons.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageHeader/index.js +1 -109
- package/dist/components/ui/SequenceEditorRealignModal/index.js +2 -2
- package/dist/components/ui/SequenceEditorRealignModal/index.js.map +1 -1
- package/dist/constants/index.js +5 -4
- package/dist/constants/keyboard.js +2 -2
- package/dist/constants/keyboard.js.map +1 -1
- package/dist/constants/palette.d.ts +1 -2
- package/dist/constants/palette.js +162 -204
- package/dist/constants/palette.js.map +1 -1
- package/dist/constants/paletteSchemaData.d.ts +4 -0
- package/dist/constants/paletteSchemaData.js +48 -0
- package/dist/constants/paletteSchemaData.js.map +1 -0
- package/dist/pages/SequenceEditorMainPage/index.js +1 -0
- package/dist/pages/SequenceEditorMainPage/index.js.map +1 -1
- package/dist/utils/EditorUtil/index.js +83 -83
- package/dist/utils/EditorUtil/index.js.map +1 -1
- package/dist/utils/SequenceEditorStandardConfigUtil/index.js +1 -1
- package/dist/vite/paletteSchemaPlugin/index.d.ts +1 -1
- package/dist/vite/paletteSchemaPlugin/index.js +1 -1
- package/dist/vite/paletteSchemaPlugin/index.js.map +1 -1
- package/package.json +6 -2
- package/dist/components/ui/SequenceEditorPageHeader/index.js.map +0 -1
|
@@ -18,9 +18,10 @@ import { Subject as E } from "@gen-epix/ui-core/classes/Subject";
|
|
|
18
18
|
import { DevicePixelRatioService as D } from "@gen-epix/ui-core/classes/services/DevicePixelRatioService";
|
|
19
19
|
import { KeyboardShortcutService as O } from "@gen-epix/ui-core/classes/services/KeyboardShortcutService";
|
|
20
20
|
import { ExportUtil as ee } from "@rivm-loculus-tools/common-frontend/utils/ExportUtil";
|
|
21
|
+
import { UploadToLoculusModal as te } from "@rivm-loculus-tools/common-frontend/components/loculus/UploadToLoculusModal";
|
|
21
22
|
import { withDialog as k } from "@gen-epix/ui-core-components/hoc/withDialog";
|
|
22
23
|
// ../../../../node_modules/.pnpm/use-debounce@10.1.1_react@19.3.1/node_modules/use-debounce/dist/index.module.js
|
|
23
|
-
function
|
|
24
|
+
function ne(e, t, n, r) {
|
|
24
25
|
var i = this, a = g(null), o = g(0), s = g(0), c = g(null), l = g([]), u = g(), d = g(), f = g(e), p = g(!0), _ = g(), v = g();
|
|
25
26
|
f.current = e;
|
|
26
27
|
var y = typeof window < "u", b = !t && t !== 0 && y;
|
|
@@ -87,7 +88,7 @@ function te(e, t, n, r) {
|
|
|
87
88
|
}, [C]), D;
|
|
88
89
|
}
|
|
89
90
|
// src/components/ui/SequenceEditor/SequenceEditorStatusBar.tsx
|
|
90
|
-
var
|
|
91
|
+
var re = () => {
|
|
91
92
|
let n = S(), r = t(e, (e) => e.isRealigning), i = t(e, (e) => e.latestMessage), a = t(e, (e) => e.meta), o = t(e, (e) => e.selection), s = h(() => l.getStatusBarSelectionStats(o, a), [a, o]);
|
|
92
93
|
return /* @__PURE__ */ w(v, {
|
|
93
94
|
sx: {
|
|
@@ -132,8 +133,8 @@ var ne = () => {
|
|
|
132
133
|
]
|
|
133
134
|
})
|
|
134
135
|
});
|
|
135
|
-
},
|
|
136
|
-
let [r, i] = _(""), a = g(null), o = r === "" ||
|
|
136
|
+
}, ie = /^(?:\d+|,\d+|\d+,\d+)$/, ae = k(({ onActionsChange: e, onClose: t, onGotoPosition: n }) => {
|
|
137
|
+
let [r, i] = _(""), a = g(null), o = r === "" || ie.test(r);
|
|
137
138
|
m(() => {
|
|
138
139
|
a.current?.focus();
|
|
139
140
|
}, []);
|
|
@@ -186,29 +187,34 @@ var ne = () => {
|
|
|
186
187
|
fullWidth: !0,
|
|
187
188
|
maxWidth: "xs",
|
|
188
189
|
testId: "SequenceEditorGotoPositionDialog"
|
|
189
|
-
}),
|
|
190
|
-
let y = t(e, (e) => e.isRealigning), b = t(e, (e) => e.rawFasta), x = t(e, (e) => e.
|
|
190
|
+
}), oe = () => {
|
|
191
|
+
let y = t(e, (e) => e.isRealigning), b = t(e, (e) => e.rawFasta), x = t(e, (e) => e.setMeta), k = t(e, (e) => e.setSelection), ie = g(null), oe = g(null), se = g(null), A = h(() => C.resolve(u), []), j = g(null), M = g(null), ce = g(null), N = g(null), P = g(null), F = g(null), le = g(null), [I, ue] = _({
|
|
191
192
|
height: 0,
|
|
192
193
|
width: 0
|
|
193
|
-
}), [
|
|
194
|
+
}), [de, fe] = _(() => C.resolve(D).data), L = g(0), R = g(0), z = h(() => new E({
|
|
194
195
|
scrollLeft: 0,
|
|
195
196
|
scrollTop: 0
|
|
196
|
-
}), []),
|
|
197
|
+
}), []), pe = g(I), B = h(() => new E(null), []), V = h(() => new E(null), []), H = g(null), U = g(null), W = h(() => new E(n), []), G = h(() => new E(null), []), K = g(null), q = g(0), J = g(null), me = g(!1), Y = S();
|
|
197
198
|
m(() => {
|
|
198
|
-
y ?
|
|
199
|
+
y ? se.current?.open() : se.current?.close();
|
|
199
200
|
}, [y]);
|
|
200
201
|
let X = p(() => {
|
|
201
|
-
let e =
|
|
202
|
-
if (!e
|
|
203
|
-
let
|
|
204
|
-
|
|
202
|
+
let e = le.current;
|
|
203
|
+
if (!e) return;
|
|
204
|
+
let t = W.data, n = B.data;
|
|
205
|
+
if (t && n) {
|
|
206
|
+
let e = t.labelWidth + t.cellWidth + n.alignmentWidth * t.cellWidth, r = t.rulerHeight + n.sequenceCount * t.cellHeight;
|
|
207
|
+
R.current !== e && (R.current = e), L.current !== r && (L.current = r);
|
|
208
|
+
}
|
|
209
|
+
let { height: r, width: i } = pe.current, a = `${Math.max(R.current, i)}px`, o = `${Math.max(L.current, r)}px`;
|
|
210
|
+
e.style.width !== a && (e.style.width = a), e.style.height !== o && (e.style.height = o);
|
|
205
211
|
}, [W, B]), Z = p(async () => {
|
|
206
212
|
let e = await C.resolve(u).getMetaData();
|
|
207
213
|
return B.next(e), e;
|
|
208
214
|
}, [B]), Q = p(() => {
|
|
209
215
|
let e = W.data, t = B.data;
|
|
210
216
|
if (!t || !e) return;
|
|
211
|
-
let { scrollLeft: n, scrollTop: r } = z.data, { height: i, width: a } =
|
|
217
|
+
let { scrollLeft: n, scrollTop: r } = z.data, { height: i, width: a } = pe.current, o = l.getVisibleGridRange({
|
|
212
218
|
geometry: e,
|
|
213
219
|
numCols: t.alignmentWidth,
|
|
214
220
|
numRows: t.sequenceCount,
|
|
@@ -230,62 +236,65 @@ var ne = () => {
|
|
|
230
236
|
B,
|
|
231
237
|
z,
|
|
232
238
|
V
|
|
233
|
-
]),
|
|
234
|
-
|
|
239
|
+
]), he = ne((e, t) => {
|
|
240
|
+
ue({
|
|
235
241
|
height: t,
|
|
236
242
|
width: e
|
|
237
243
|
});
|
|
238
244
|
}, 0, { trailing: !0 });
|
|
239
245
|
m(() => {
|
|
240
|
-
|
|
241
|
-
}, [
|
|
242
|
-
|
|
246
|
+
pe.current = I, X(), Q();
|
|
247
|
+
}, [
|
|
248
|
+
I,
|
|
249
|
+
X,
|
|
250
|
+
Q
|
|
251
|
+
]);
|
|
252
|
+
let $ = I.width > 0 ? I.width / 2 : 120;
|
|
243
253
|
m(() => {
|
|
244
|
-
let
|
|
245
|
-
|
|
254
|
+
let t = [B.subscribe((e) => {
|
|
255
|
+
x(e);
|
|
246
256
|
}), G.subscribe((e) => {
|
|
247
|
-
|
|
257
|
+
k(e);
|
|
248
258
|
})];
|
|
249
259
|
return () => {
|
|
250
|
-
|
|
260
|
+
t.forEach((e) => e()), e.getState().setLatestMessage(null), x(null), k(null);
|
|
251
261
|
};
|
|
252
262
|
}, [
|
|
253
263
|
B,
|
|
254
264
|
G,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
j
|
|
265
|
+
x,
|
|
266
|
+
k
|
|
258
267
|
]), m(() => {
|
|
259
|
-
if (
|
|
268
|
+
if (I.width <= 0) return;
|
|
260
269
|
let e = W.data;
|
|
261
270
|
e.labelWidth > $ && W.next({
|
|
262
271
|
...e,
|
|
263
272
|
labelWidth: $
|
|
264
273
|
});
|
|
265
274
|
}, [
|
|
266
|
-
|
|
275
|
+
I.width,
|
|
267
276
|
W,
|
|
268
277
|
$
|
|
269
278
|
]), m(() => {
|
|
270
|
-
let e =
|
|
279
|
+
let e = F.current;
|
|
271
280
|
if (!e) return;
|
|
272
281
|
let t = new ResizeObserver(([e]) => {
|
|
273
282
|
if (!e) return;
|
|
274
283
|
let t = Math.max(1, e.contentRect.height), n = Math.max(1, e.contentRect.width);
|
|
275
|
-
|
|
284
|
+
he(n, t);
|
|
276
285
|
});
|
|
277
286
|
return t.observe(e), () => t.disconnect();
|
|
278
|
-
}, [
|
|
287
|
+
}, [A, he]), m(() => {
|
|
279
288
|
(async () => {
|
|
280
289
|
H.current = null, U.current = null, z.next({
|
|
281
290
|
scrollLeft: 0,
|
|
282
291
|
scrollTop: 0
|
|
283
|
-
}), G.next(null), await
|
|
292
|
+
}), G.next(null), await A.initialize(), await A.loadFasta(b), await Z();
|
|
284
293
|
})().catch((e) => {
|
|
285
294
|
console.error(e);
|
|
286
295
|
});
|
|
287
296
|
}, [
|
|
288
|
-
|
|
297
|
+
A,
|
|
289
298
|
b,
|
|
290
299
|
z,
|
|
291
300
|
G,
|
|
@@ -293,8 +302,8 @@ var ne = () => {
|
|
|
293
302
|
Q
|
|
294
303
|
]), m(() => {
|
|
295
304
|
let t = null, n = !0, r = null, i = null, a = async () => {
|
|
296
|
-
if (n && !
|
|
297
|
-
|
|
305
|
+
if (n && !me.current) {
|
|
306
|
+
me.current = !0;
|
|
298
307
|
try {
|
|
299
308
|
for (; n && J.current;) {
|
|
300
309
|
let a = J.current;
|
|
@@ -305,7 +314,7 @@ var ne = () => {
|
|
|
305
314
|
visibleGridRange: a.visibleGridRange.visible
|
|
306
315
|
})) {
|
|
307
316
|
let e = [];
|
|
308
|
-
for (let t = a.visibleGridRange.cache.startRow; t <= a.visibleGridRange.cache.endRow; t++) e.push(await
|
|
317
|
+
for (let t = a.visibleGridRange.cache.startRow; t <= a.visibleGridRange.cache.endRow; t++) e.push(await A.name(t));
|
|
309
318
|
if (!n) return;
|
|
310
319
|
U.current = {
|
|
311
320
|
range: a.visibleGridRange.cache,
|
|
@@ -329,8 +338,8 @@ var ne = () => {
|
|
|
329
338
|
};
|
|
330
339
|
}
|
|
331
340
|
o === q.current && (t !== null && cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
332
|
-
n && o === q.current &&
|
|
333
|
-
canvasElement:
|
|
341
|
+
n && o === q.current && j.current && e.getState().nucleotidePalette && H.current && B.data && U.current && (M.current = l.drawCanvas({
|
|
342
|
+
canvasElement: j.current,
|
|
334
343
|
devicePixelRatio: C.resolve(D).data,
|
|
335
344
|
geometry: a.geometry,
|
|
336
345
|
meta: B.data,
|
|
@@ -349,14 +358,14 @@ var ne = () => {
|
|
|
349
358
|
}));
|
|
350
359
|
}
|
|
351
360
|
} finally {
|
|
352
|
-
|
|
361
|
+
me.current = !1, n && J.current && a();
|
|
353
362
|
}
|
|
354
363
|
}
|
|
355
364
|
}, o = [e.subscribe((e, t) => {
|
|
356
365
|
let n = !1;
|
|
357
366
|
e.searchResult !== t.searchResult && (r = e.searchResult, n = !0), e.searchResultHighlightedIndex !== t.searchResultHighlightedIndex && (i = e.searchResultHighlightedIndex, l.scrollToSearchResult({
|
|
358
367
|
geometry: W.data,
|
|
359
|
-
scrollContainer:
|
|
368
|
+
scrollContainer: F.current,
|
|
360
369
|
searchResult: e.searchResult,
|
|
361
370
|
searchResultHighlightedIndex: e.searchResultHighlightedIndex
|
|
362
371
|
}), n = !0), n && Q();
|
|
@@ -367,7 +376,7 @@ var ne = () => {
|
|
|
367
376
|
n = !1, J.current = null, t !== null && cancelAnimationFrame(t), q.current += 1, o.forEach((e) => e());
|
|
368
377
|
};
|
|
369
378
|
}, [
|
|
370
|
-
|
|
379
|
+
A,
|
|
371
380
|
W,
|
|
372
381
|
B,
|
|
373
382
|
G,
|
|
@@ -387,14 +396,14 @@ var ne = () => {
|
|
|
387
396
|
}),
|
|
388
397
|
G.subscribe(() => Q()),
|
|
389
398
|
C.resolve(D).subscribe((e) => {
|
|
390
|
-
|
|
399
|
+
fe(e), X(), Q();
|
|
391
400
|
})
|
|
392
401
|
];
|
|
393
402
|
return () => {
|
|
394
403
|
t.forEach((e) => e());
|
|
395
404
|
};
|
|
396
405
|
}, [
|
|
397
|
-
|
|
406
|
+
A,
|
|
398
407
|
W,
|
|
399
408
|
B,
|
|
400
409
|
z,
|
|
@@ -407,7 +416,7 @@ var ne = () => {
|
|
|
407
416
|
r.has(t) && (e.preventDefault(), C.resolve(i).emit("onMutateSelection", t));
|
|
408
417
|
}, t = (e) => C.resolve(O).registerShortcut({
|
|
409
418
|
callback: e.callback,
|
|
410
|
-
element:
|
|
419
|
+
element: P.current,
|
|
411
420
|
...e.shortcut
|
|
412
421
|
}), n = [
|
|
413
422
|
t(s.expandSelectionLeft),
|
|
@@ -437,11 +446,11 @@ var ne = () => {
|
|
|
437
446
|
t(s.gotoPosition),
|
|
438
447
|
C.resolve(O).registerShortcut({
|
|
439
448
|
callback: e,
|
|
440
|
-
element:
|
|
449
|
+
element: P.current
|
|
441
450
|
}),
|
|
442
451
|
C.resolve(O).registerShortcut({
|
|
443
452
|
callback: e,
|
|
444
|
-
element:
|
|
453
|
+
element: P.current,
|
|
445
454
|
modifiers: [["Shift"]]
|
|
446
455
|
})
|
|
447
456
|
];
|
|
@@ -450,13 +459,13 @@ var ne = () => {
|
|
|
450
459
|
};
|
|
451
460
|
}, []), m(() => {
|
|
452
461
|
let t = async (e) => {
|
|
453
|
-
let { command: t, getSelectionPostCommand: n } = e;
|
|
462
|
+
let { command: t, getSelectionPostCommand: n, invalidateRowNames: r } = e;
|
|
454
463
|
try {
|
|
455
464
|
let e = B.data?.undoDepth;
|
|
456
|
-
await t(), H.current = null, U.current = null;
|
|
457
|
-
let
|
|
458
|
-
if (
|
|
459
|
-
if (e !== void 0 &&
|
|
465
|
+
await t(), H.current = null, r && (U.current = null);
|
|
466
|
+
let i = await Z();
|
|
467
|
+
if (n) {
|
|
468
|
+
if (e !== void 0 && i?.undoDepth === e) return;
|
|
460
469
|
let t = n();
|
|
461
470
|
G.next(t), K.current = t;
|
|
462
471
|
}
|
|
@@ -467,7 +476,7 @@ var ne = () => {
|
|
|
467
476
|
if (!B.data) return;
|
|
468
477
|
let n = l.getMutateArguments(G.data, B.data);
|
|
469
478
|
n && await t({ command: async () => {
|
|
470
|
-
await
|
|
479
|
+
await A.mutate(n.rows, n.columns, e);
|
|
471
480
|
} });
|
|
472
481
|
}, r = (e) => {
|
|
473
482
|
if (!B.data) return;
|
|
@@ -487,36 +496,38 @@ var ne = () => {
|
|
|
487
496
|
let n = l.getRowsToMove(G.data, e, B.data);
|
|
488
497
|
n && await t({
|
|
489
498
|
command: async () => {
|
|
490
|
-
e === a.UP ? (await
|
|
499
|
+
e === a.UP ? (await A.moveRowsToTop(n), F.current && (F.current.scrollTop = 0)) : (await A.moveRowsToBottom(n), F.current && (F.current.scrollTop = F.current.scrollHeight - F.current.clientHeight));
|
|
491
500
|
},
|
|
492
|
-
getSelectionPostCommand: () => l.getMovedRowsEndSelection(G.data, e, B.data)
|
|
501
|
+
getSelectionPostCommand: () => l.getMovedRowsEndSelection(G.data, e, B.data),
|
|
502
|
+
invalidateRowNames: !0
|
|
493
503
|
});
|
|
494
504
|
}, u = async (e) => {
|
|
495
505
|
if (!B.data) return;
|
|
496
506
|
let n = l.getRowsToMove(G.data, e, B.data);
|
|
497
507
|
n && await t({
|
|
498
508
|
command: async () => {
|
|
499
|
-
e === a.UP ? await
|
|
509
|
+
e === a.UP ? await A.moveRowsUp(n) : await A.moveRowsDown(n);
|
|
500
510
|
},
|
|
501
|
-
getSelectionPostCommand: () => l.getMovedRowsRelativeSelection(G.data, e, B.data)
|
|
511
|
+
getSelectionPostCommand: () => l.getMovedRowsRelativeSelection(G.data, e, B.data),
|
|
512
|
+
invalidateRowNames: !0
|
|
502
513
|
});
|
|
503
514
|
}, d = async (e) => {
|
|
504
515
|
if (!B.data || e !== a.LEFT && e !== a.RIGHT || !G.data?.cells && (!G.data?.cols || G.data.cols.length === 0)) return;
|
|
505
516
|
let n = l.getMutateArguments(G.data, B.data);
|
|
506
517
|
n && n.columns.length !== 0 && n.rows.length !== 0 && await t({
|
|
507
518
|
command: async () => {
|
|
508
|
-
await
|
|
519
|
+
await A.moveHorizontal(n.rows, n.columns, e);
|
|
509
520
|
},
|
|
510
521
|
getSelectionPostCommand: () => l.getPostUpsertSelection(G.data, e)
|
|
511
522
|
});
|
|
512
523
|
}, f = C.resolve(i), p = [
|
|
513
524
|
f.addEventListener("onSearch", async (t) => {
|
|
514
525
|
if (!t) return;
|
|
515
|
-
let n = await
|
|
526
|
+
let n = await A.search(t, !0);
|
|
516
527
|
e.getState().setSearchResult(n);
|
|
517
528
|
}),
|
|
518
529
|
f.addEventListener("onExpandSelection", (e) => o(e)),
|
|
519
|
-
f.addEventListener("onGotoPosition", () =>
|
|
530
|
+
f.addEventListener("onGotoPosition", () => oe.current?.open({})),
|
|
520
531
|
f.addEventListener("onMoveSelection", (e) => r(e)),
|
|
521
532
|
f.addEventListener("onMoveRows", (e) => {
|
|
522
533
|
u(e);
|
|
@@ -528,19 +539,19 @@ var ne = () => {
|
|
|
528
539
|
d(e);
|
|
529
540
|
}),
|
|
530
541
|
f.addEventListener("onScrollToLineStart", () => {
|
|
531
|
-
let e =
|
|
542
|
+
let e = F.current;
|
|
532
543
|
e && (e.scrollLeft = 0);
|
|
533
544
|
}),
|
|
534
545
|
f.addEventListener("onScrollToLineEnd", () => {
|
|
535
|
-
let e =
|
|
546
|
+
let e = F.current;
|
|
536
547
|
e && (e.scrollLeft = e.scrollWidth - e.clientWidth);
|
|
537
548
|
}),
|
|
538
549
|
f.addEventListener("onScrollPageUp", () => {
|
|
539
|
-
let e =
|
|
550
|
+
let e = F.current;
|
|
540
551
|
e && (e.scrollTop = Math.max(0, e.scrollTop - e.clientHeight));
|
|
541
552
|
}),
|
|
542
553
|
f.addEventListener("onScrollPageDown", () => {
|
|
543
|
-
let e =
|
|
554
|
+
let e = F.current;
|
|
544
555
|
e && (e.scrollTop = Math.min(e.scrollHeight - e.clientHeight, e.scrollTop + e.clientHeight));
|
|
545
556
|
}),
|
|
546
557
|
f.addEventListener("onInsert", () => {
|
|
@@ -548,7 +559,7 @@ var ne = () => {
|
|
|
548
559
|
if (!B.data) return;
|
|
549
560
|
let e = l.getUpsertArguments(G.data, B.data);
|
|
550
561
|
e && await t({
|
|
551
|
-
command: async () =>
|
|
562
|
+
command: async () => A.insert(e.rows, e.col),
|
|
552
563
|
getSelectionPostCommand: () => l.getPostUpsertSelection(G.data, a.RIGHT)
|
|
553
564
|
});
|
|
554
565
|
})();
|
|
@@ -558,7 +569,7 @@ var ne = () => {
|
|
|
558
569
|
if (!B.data) return;
|
|
559
570
|
let e = l.getUpsertArguments(G.data, B.data, -1);
|
|
560
571
|
e && await t({
|
|
561
|
-
command: async () =>
|
|
572
|
+
command: async () => A.delete(e.rows, e.col),
|
|
562
573
|
getSelectionPostCommand: () => l.getPostUpsertSelection(G.data, a.LEFT)
|
|
563
574
|
});
|
|
564
575
|
})();
|
|
@@ -568,12 +579,13 @@ var ne = () => {
|
|
|
568
579
|
}),
|
|
569
580
|
f.addEventListener("onUndo", () => {
|
|
570
581
|
t({
|
|
571
|
-
command: async () =>
|
|
572
|
-
getSelectionPostCommand: () => null
|
|
582
|
+
command: async () => A.undo(),
|
|
583
|
+
getSelectionPostCommand: () => null,
|
|
584
|
+
invalidateRowNames: !0
|
|
573
585
|
});
|
|
574
586
|
}),
|
|
575
587
|
f.addEventListener("onCancelRealign", () => {
|
|
576
|
-
|
|
588
|
+
A.cancelRealign();
|
|
577
589
|
}),
|
|
578
590
|
f.addEventListener("onRealign", () => {
|
|
579
591
|
e.getState().setIsRealigning(!0);
|
|
@@ -581,7 +593,7 @@ var ne = () => {
|
|
|
581
593
|
t({
|
|
582
594
|
command: async () => {
|
|
583
595
|
try {
|
|
584
|
-
await
|
|
596
|
+
await A.realign();
|
|
585
597
|
} catch (t) {
|
|
586
598
|
if (t instanceof DOMException && t.name === "AbortError") n = !0;
|
|
587
599
|
else throw e.getState().setLatestMessage(c.getEngineErrorMessage(t)), t;
|
|
@@ -589,51 +601,57 @@ var ne = () => {
|
|
|
589
601
|
e.getState().setIsRealigning(!1);
|
|
590
602
|
}
|
|
591
603
|
},
|
|
592
|
-
getSelectionPostCommand: () => n ? G.data : null
|
|
604
|
+
getSelectionPostCommand: () => n ? G.data : null,
|
|
605
|
+
invalidateRowNames: !0
|
|
593
606
|
});
|
|
594
607
|
}),
|
|
595
608
|
f.addEventListener("onRedo", () => {
|
|
596
609
|
t({
|
|
597
|
-
command: async () =>
|
|
598
|
-
getSelectionPostCommand: () => null
|
|
610
|
+
command: async () => A.redo(),
|
|
611
|
+
getSelectionPostCommand: () => null,
|
|
612
|
+
invalidateRowNames: !0
|
|
599
613
|
});
|
|
600
614
|
}),
|
|
601
615
|
f.addEventListener("onExportGappedFasta", async () => {
|
|
602
|
-
|
|
603
|
-
let e = await M.exportGappedFasta();
|
|
616
|
+
let e = await A.exportGappedFasta();
|
|
604
617
|
ee.downloadFastaFile(e, "sequence.gapped.fasta");
|
|
605
618
|
}),
|
|
606
619
|
f.addEventListener("onExportUngappedFasta", async () => {
|
|
607
|
-
|
|
608
|
-
let e = await M.exportUngappedFasta();
|
|
620
|
+
let e = await A.exportUngappedFasta();
|
|
609
621
|
ee.downloadFastaFile(e, "sequence.ungapped.fasta");
|
|
622
|
+
}),
|
|
623
|
+
f.addEventListener("onExportToLoculus", async () => {
|
|
624
|
+
let t = await A.exportUngappedFasta(), { parsedMetadata: n, rawFasta: r } = e.getState();
|
|
625
|
+
ie.current?.open({
|
|
626
|
+
fasta: t,
|
|
627
|
+
metaData: n,
|
|
628
|
+
rawFasta: r
|
|
629
|
+
});
|
|
610
630
|
})
|
|
611
631
|
];
|
|
612
632
|
return () => {
|
|
613
|
-
p.forEach((e) => e()),
|
|
633
|
+
p.forEach((e) => e()), A.cancelRealign();
|
|
614
634
|
};
|
|
615
635
|
}, [
|
|
616
|
-
|
|
636
|
+
A,
|
|
617
637
|
G,
|
|
618
638
|
Z,
|
|
619
639
|
Q,
|
|
620
|
-
B
|
|
621
|
-
x,
|
|
622
|
-
k
|
|
640
|
+
B
|
|
623
641
|
]), m(() => {
|
|
624
642
|
Q();
|
|
625
643
|
}, [Q]);
|
|
626
|
-
let
|
|
644
|
+
let ge = p((e) => {
|
|
627
645
|
let t = e.currentTarget;
|
|
628
646
|
z.next({
|
|
629
647
|
scrollLeft: t.scrollLeft,
|
|
630
648
|
scrollTop: t.scrollTop
|
|
631
649
|
});
|
|
632
|
-
}, [z]),
|
|
633
|
-
|
|
650
|
+
}, [z]), _e = p((e) => {
|
|
651
|
+
P.current?.focus();
|
|
634
652
|
let t = e.currentTarget, n = t.getBoundingClientRect(), r = e.clientX >= n.left + t.clientWidth, i = e.clientY >= n.top + t.clientHeight;
|
|
635
653
|
if (r || i) return;
|
|
636
|
-
let a =
|
|
654
|
+
let a = j.current, s = M.current, c = C.resolve(D).data;
|
|
637
655
|
if (!a || !s) return;
|
|
638
656
|
let u = l.getPathPropertiesFromCanvas({
|
|
639
657
|
canvas: a,
|
|
@@ -645,7 +663,7 @@ var ne = () => {
|
|
|
645
663
|
if (u.type !== o.DIVIDER) {
|
|
646
664
|
if (u.type === o.LABEL && (e.metaKey || e.ctrlKey)) {
|
|
647
665
|
let t = G.data?.rows ?? [], n = t.includes(u.row) ? t.filter((e) => e !== u.row) : [...t, u.row].sort((e, t) => e - t);
|
|
648
|
-
if (e.preventDefault(),
|
|
666
|
+
if (e.preventDefault(), N.current = null, n.length === 0) {
|
|
649
667
|
G.next(null), K.current = null;
|
|
650
668
|
return;
|
|
651
669
|
}
|
|
@@ -657,14 +675,14 @@ var ne = () => {
|
|
|
657
675
|
startPath: u
|
|
658
676
|
});
|
|
659
677
|
if (!t) return;
|
|
660
|
-
e.preventDefault(),
|
|
661
|
-
} else e.preventDefault(),
|
|
678
|
+
e.preventDefault(), N.current = u, G.next(t), K.current = t;
|
|
679
|
+
} else e.preventDefault(), N.current = null, ce.current = {
|
|
662
680
|
startLabelWidth: W.data.labelWidth,
|
|
663
681
|
startX: e.clientX
|
|
664
682
|
};
|
|
665
683
|
}
|
|
666
|
-
}, [W, G]),
|
|
667
|
-
let t =
|
|
684
|
+
}, [W, G]), ve = p((e) => {
|
|
685
|
+
let t = j.current, n = P.current, r = C.resolve(D).data, i = ce.current;
|
|
668
686
|
if (!n || !t) return;
|
|
669
687
|
if (i) {
|
|
670
688
|
let t = Math.min($, Math.max(120, i.startLabelWidth + e.clientX - i.startX));
|
|
@@ -674,9 +692,9 @@ var ne = () => {
|
|
|
674
692
|
}), n.style.cursor = "col-resize";
|
|
675
693
|
return;
|
|
676
694
|
}
|
|
677
|
-
let a =
|
|
695
|
+
let a = N.current;
|
|
678
696
|
if (a) {
|
|
679
|
-
let n =
|
|
697
|
+
let n = M.current;
|
|
680
698
|
if (!n) return;
|
|
681
699
|
let i = l.getPathPropertiesFromCanvas({
|
|
682
700
|
canvas: t,
|
|
@@ -692,7 +710,7 @@ var ne = () => {
|
|
|
692
710
|
o && (G.next(o), K.current = o);
|
|
693
711
|
return;
|
|
694
712
|
}
|
|
695
|
-
let s =
|
|
713
|
+
let s = M.current;
|
|
696
714
|
if (!s) return;
|
|
697
715
|
let c = l.getPathPropertiesFromCanvas({
|
|
698
716
|
canvas: t,
|
|
@@ -705,16 +723,16 @@ var ne = () => {
|
|
|
705
723
|
W,
|
|
706
724
|
$,
|
|
707
725
|
G
|
|
708
|
-
]),
|
|
709
|
-
|
|
710
|
-
}, []),
|
|
726
|
+
]), ye = p(() => {
|
|
727
|
+
ce.current = null, N.current = null;
|
|
728
|
+
}, []), be = p((e, t) => {
|
|
711
729
|
l.scrollToPosition({
|
|
712
730
|
geometry: W.data,
|
|
713
|
-
scrollContainer:
|
|
731
|
+
scrollContainer: F.current,
|
|
714
732
|
x: e,
|
|
715
733
|
y: t
|
|
716
734
|
});
|
|
717
|
-
}, [W]),
|
|
735
|
+
}, [W]), xe = Math.max(1, Math.floor(I.width * de)), Se = Math.max(1, Math.floor(I.height * de));
|
|
718
736
|
return /* @__PURE__ */ T(v, {
|
|
719
737
|
sx: {
|
|
720
738
|
display: "grid",
|
|
@@ -726,8 +744,8 @@ var ne = () => {
|
|
|
726
744
|
children: [
|
|
727
745
|
/* @__PURE__ */ w(d, {}),
|
|
728
746
|
/* @__PURE__ */ T(v, {
|
|
729
|
-
onMouseUp:
|
|
730
|
-
ref:
|
|
747
|
+
onMouseUp: ye,
|
|
748
|
+
ref: P,
|
|
731
749
|
sx: {
|
|
732
750
|
height: `calc(100% - ${Y.spacing(3)})`,
|
|
733
751
|
marginBottom: Y.spacing(3),
|
|
@@ -737,10 +755,10 @@ var ne = () => {
|
|
|
737
755
|
tabIndex: 0,
|
|
738
756
|
children: [
|
|
739
757
|
/* @__PURE__ */ w(v, {
|
|
740
|
-
onMouseDown:
|
|
741
|
-
onMouseMove:
|
|
742
|
-
onScroll:
|
|
743
|
-
ref:
|
|
758
|
+
onMouseDown: _e,
|
|
759
|
+
onMouseMove: ve,
|
|
760
|
+
onScroll: ge,
|
|
761
|
+
ref: F,
|
|
744
762
|
sx: {
|
|
745
763
|
height: "100%",
|
|
746
764
|
overflowX: "scroll",
|
|
@@ -749,27 +767,26 @@ var ne = () => {
|
|
|
749
767
|
width: "100%",
|
|
750
768
|
zIndex: 1
|
|
751
769
|
},
|
|
752
|
-
children: /* @__PURE__ */ w(v, {
|
|
753
|
-
|
|
754
|
-
pointerEvents: "none"
|
|
755
|
-
|
|
756
|
-
} })
|
|
770
|
+
children: /* @__PURE__ */ w(v, {
|
|
771
|
+
ref: le,
|
|
772
|
+
sx: { pointerEvents: "none" }
|
|
773
|
+
})
|
|
757
774
|
}),
|
|
758
775
|
/* @__PURE__ */ w("canvas", {
|
|
759
|
-
height:
|
|
760
|
-
ref:
|
|
776
|
+
height: Se,
|
|
777
|
+
ref: j,
|
|
761
778
|
style: {
|
|
762
779
|
display: "block",
|
|
763
|
-
height: `${
|
|
780
|
+
height: `${I.height}px`,
|
|
764
781
|
imageRendering: "pixelated",
|
|
765
782
|
left: 0,
|
|
766
783
|
pointerEvents: "auto",
|
|
767
784
|
position: "absolute",
|
|
768
785
|
top: 0,
|
|
769
|
-
width: `${
|
|
786
|
+
width: `${I.width}px`,
|
|
770
787
|
zIndex: 0
|
|
771
788
|
},
|
|
772
|
-
width:
|
|
789
|
+
width: xe
|
|
773
790
|
}),
|
|
774
791
|
/* @__PURE__ */ w(v, {
|
|
775
792
|
sx: {
|
|
@@ -780,18 +797,19 @@ var ne = () => {
|
|
|
780
797
|
width: "100%",
|
|
781
798
|
zIndex: 2
|
|
782
799
|
},
|
|
783
|
-
children: /* @__PURE__ */ w(
|
|
800
|
+
children: /* @__PURE__ */ w(re, {})
|
|
784
801
|
})
|
|
785
802
|
]
|
|
786
803
|
}),
|
|
787
|
-
/* @__PURE__ */ w(
|
|
788
|
-
onGotoPosition:
|
|
789
|
-
ref:
|
|
804
|
+
/* @__PURE__ */ w(ae, {
|
|
805
|
+
onGotoPosition: be,
|
|
806
|
+
ref: oe
|
|
790
807
|
}),
|
|
791
|
-
/* @__PURE__ */ w(f, { ref:
|
|
808
|
+
/* @__PURE__ */ w(f, { ref: se }),
|
|
809
|
+
/* @__PURE__ */ w(te, { ref: ie })
|
|
792
810
|
]
|
|
793
811
|
});
|
|
794
812
|
};
|
|
795
|
-
export {
|
|
813
|
+
export { oe as t };
|
|
796
814
|
|
|
797
815
|
//# sourceMappingURL=SequenceEditor.js.map
|