@rivm-loculus-tools/sequence-editor 1.10.0 → 1.11.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/EngineErrorUtil.js.map +1 -1
- package/dist/_chunks/EngineWorker.js +1 -1
- package/dist/_chunks/SequenceEditor.js +545 -526
- package/dist/_chunks/SequenceEditor.js.map +1 -1
- package/dist/_chunks/SequenceEditorEventBusService.js +5 -5
- package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageDrawer.js +462 -693
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/sequenceEditorStore.js +61 -58
- package/dist/_chunks/sequenceEditorStore.js.map +1 -1
- package/dist/_chunks/sequence_editor.js +131 -104
- package/dist/_chunks/sequence_editor.js.map +1 -1
- package/dist/assets/AlignerWorker-DkAbHwjR.js +8 -0
- package/dist/assets/AlignerWorker-DkAbHwjR.js.map +1 -0
- package/dist/assets/index-CKWZNkQe.js +8 -0
- package/dist/assets/index-CKWZNkQe.js.map +1 -0
- package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +18 -19
- package/dist/classes/services/EditorWorkerService/index.js +67 -90
- package/dist/classes/services/EditorWorkerService/index.js.map +1 -1
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +1 -0
- package/dist/classes/workers/AlignerWorker/index.js.map +1 -1
- package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +19 -17
- package/dist/classes/workers/EngineWorker/index.js +78 -30
- package/dist/classes/workers/EngineWorker/index.js.map +1 -1
- package/dist/components/app/SequenceEditorApp/index.js +10 -10
- package/dist/components/app/SequenceEditorApp/index.js.map +1 -1
- package/dist/components/ui/SequenceActionsBar/SequenceActionsBar.d.ts +1 -0
- package/dist/components/ui/SequenceActionsBar/index.d.ts +1 -0
- package/dist/components/ui/SequenceActionsBar/index.js +113 -0
- package/dist/components/ui/SequenceActionsBar/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorMenu/SequenceEditorMenu.d.ts +1 -0
- package/dist/components/ui/SequenceEditorMenu/index.d.ts +1 -0
- package/dist/components/ui/SequenceEditorMenu/index.js +198 -0
- package/dist/components/ui/SequenceEditorMenu/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorPageHeader/index.js +86 -1
- package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorRealignModal/index.js +13 -13
- package/dist/components/ui/SequenceEditorRealignModal/index.js.map +1 -1
- package/dist/components/ui/SequenceEditorSearchBar/index.js +25 -21
- package/dist/components/ui/SequenceEditorSearchBar/index.js.map +1 -1
- package/dist/constants/keyboard.js +26 -26
- package/dist/constants/keyboard.js.map +1 -1
- package/dist/constants/palette.js +20 -20
- package/dist/constants/palette.js.map +1 -1
- package/dist/models/editor.models.d.ts +34 -26
- package/dist/models/editor.models.js +3 -1
- package/dist/models/editor.models.js.map +1 -1
- package/dist/models/palette.models.js.map +1 -1
- package/dist/pages/SequenceEditorMainPage/index.js +19 -19
- package/dist/pages/SequenceEditorMainPage/index.js.map +1 -1
- package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +3 -1
- package/dist/theme/demoTheme/index.js +5 -5
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/EditorUtil/EditorUtil.d.ts +10 -3
- package/dist/utils/EditorUtil/index.js +360 -275
- package/dist/utils/EditorUtil/index.js.map +1 -1
- package/dist/utils/PaletteUtil/index.js.map +1 -1
- package/dist/utils/SequenceEditorStandardConfigUtil/index.js +6 -6
- package/dist/utils/SequenceEditorStandardConfigUtil/index.js.map +1 -1
- package/dist/vite/paletteSchemaPlugin/index.js.map +1 -1
- package/package.json +17 -17
- package/dist/_chunks/SequenceEditorPageHeader.js +0 -135
- package/dist/_chunks/SequenceEditorPageHeader.js.map +0 -1
- package/dist/assets/AlignerWorker-ag-D8qid.js +0 -8
- package/dist/assets/AlignerWorker-ag-D8qid.js.map +0 -1
- package/dist/assets/index-CN_G9YrF.js +0 -8
- package/dist/assets/index-CN_G9YrF.js.map +0 -1
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.d.ts +0 -1
|
@@ -1,222 +1,225 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { container as e } from "tsyringe";
|
|
2
|
+
import { useCallback as t, useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
3
|
+
import { Box as o, CircularProgress as s, TextField as c, darken as l, useTheme as u } from "@mui/material";
|
|
4
|
+
import { Subject as d } from "@gen-epix/ui-core/classes/Subject";
|
|
5
|
+
import { DevicePixelRatioService as f } from "@gen-epix/ui-core/classes/services/DevicePixelRatioService";
|
|
6
|
+
import { KeyboardShortcutService as p } from "@gen-epix/ui-core/classes/services/KeyboardShortcutService";
|
|
7
|
+
import { t as m } from "./react.js";
|
|
8
|
+
import { ExportUtil as h } from "@rivm-loculus-tools/common-frontend/utils/ExportUtil";
|
|
9
|
+
import { UploadToLoculusModal as g } from "@rivm-loculus-tools/common-frontend/components/loculus/UploadToLoculusModal";
|
|
10
|
+
import { WindowService as _ } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
11
|
+
import { useConfig as v } from "@rivm-loculus-tools/common-frontend/hooks/useConfig";
|
|
12
|
+
import { useFastaDataTransfer as y } from "@rivm-loculus-tools/common-frontend/hooks/useFastaDataTransfer";
|
|
13
|
+
import { EditorWorkerService as b } from "../classes/services/EditorWorkerService/index.js";
|
|
14
|
+
import { t as x } from "./SequenceEditorEventBusService.js";
|
|
15
|
+
import { DEFAULT_GRID_GEOMETRY as ee, IUPAC_KEYS as S } from "../constants/editor.js";
|
|
16
|
+
import { EDITOR_DIRECTION as C, EDITOR_PATH_PROPERTIES_TYPE as w, READING_MODE as T } from "../models/editor.models.js";
|
|
17
|
+
import { KEYBOARD_SHORTCUTS as E } from "../constants/keyboard.js";
|
|
7
18
|
import "../constants/index.js";
|
|
8
|
-
import { EditorUtil as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { SequenceEditorSearchBar as
|
|
12
|
-
import { SequenceEditorRealignModal as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { useConfig as E } from "@rivm-loculus-tools/common-frontend/hooks/useConfig";
|
|
18
|
-
import { Subject as D } from "@gen-epix/ui-core/classes/Subject";
|
|
19
|
-
import { DevicePixelRatioService as O } from "@gen-epix/ui-core/classes/services/DevicePixelRatioService";
|
|
20
|
-
import { KeyboardShortcutService as ee } from "@gen-epix/ui-core/classes/services/KeyboardShortcutService";
|
|
21
|
-
import { ExportUtil as te } from "@rivm-loculus-tools/common-frontend/utils/ExportUtil";
|
|
22
|
-
import { UploadToLoculusModal as ne } from "@rivm-loculus-tools/common-frontend/components/loculus/UploadToLoculusModal";
|
|
23
|
-
import { WindowService as re } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
24
|
-
import { withDialog as k } from "@gen-epix/ui-core-components/hoc/withDialog";
|
|
19
|
+
import { EditorUtil as D } from "../utils/EditorUtil/index.js";
|
|
20
|
+
import { t as te } from "./EngineErrorUtil.js";
|
|
21
|
+
import { t as O } from "./sequenceEditorStore.js";
|
|
22
|
+
import { SequenceEditorSearchBar as ne } from "../components/ui/SequenceEditorSearchBar/index.js";
|
|
23
|
+
import { SequenceEditorRealignModal as re } from "../components/ui/SequenceEditorRealignModal/index.js";
|
|
24
|
+
import { SequenceEditorMenu as ie } from "../components/ui/SequenceEditorMenu/index.js";
|
|
25
|
+
import { SequenceActionsBar as ae } from "../components/ui/SequenceActionsBar/index.js";
|
|
26
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
27
|
+
import { withDialog as oe } from "@gen-epix/ui-core-components/hoc/withDialog";
|
|
25
28
|
// ../../../../node_modules/.pnpm/use-debounce@10.1.1_react@19.3.1/node_modules/use-debounce/dist/index.module.js
|
|
26
|
-
function
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
+
function se(e, t, a, o) {
|
|
30
|
+
var s = this, c = i(null), l = i(0), u = i(0), d = i(null), f = i([]), p = i(), m = i(), h = i(e), g = i(!0), _ = i(), v = i();
|
|
31
|
+
h.current = e;
|
|
29
32
|
var y = typeof window < "u", b = !t && t !== 0 && y;
|
|
30
33
|
if (typeof e != "function") throw TypeError("Expected a function");
|
|
31
34
|
t = +t || 0;
|
|
32
|
-
var x = !!(
|
|
35
|
+
var x = !!(a ||= {}).leading, ee = !("trailing" in a) || !!a.trailing, S = !!a.flushOnExit && ee, C = "maxWait" in a, w = "debounceOnServer" in a && !!a.debounceOnServer, T = C ? Math.max(+a.maxWait || 0, t) : null, E = r(function() {
|
|
33
36
|
var e = function(e) {
|
|
34
|
-
var t =
|
|
35
|
-
return
|
|
37
|
+
var t = f.current, n = p.current;
|
|
38
|
+
return f.current = p.current = null, l.current = e, u.current = u.current || e, m.current = h.current.apply(n, t);
|
|
36
39
|
}, n = function(e, t) {
|
|
37
|
-
b && cancelAnimationFrame(
|
|
38
|
-
},
|
|
39
|
-
if (!
|
|
40
|
-
var n = e -
|
|
41
|
-
return !
|
|
42
|
-
},
|
|
43
|
-
return
|
|
44
|
-
},
|
|
45
|
-
var
|
|
46
|
-
if (x &&
|
|
47
|
-
if (
|
|
48
|
-
var
|
|
49
|
-
n(e,
|
|
40
|
+
b && cancelAnimationFrame(d.current), d.current = b ? requestAnimationFrame(e) : setTimeout(e, t);
|
|
41
|
+
}, r = function(e) {
|
|
42
|
+
if (!g.current) return !1;
|
|
43
|
+
var n = e - c.current;
|
|
44
|
+
return !c.current || n >= t || n < 0 || C && e - l.current >= T;
|
|
45
|
+
}, i = function(t) {
|
|
46
|
+
return d.current = null, ee && f.current ? e(t) : (f.current = p.current = null, m.current);
|
|
47
|
+
}, a = function e() {
|
|
48
|
+
var a = Date.now();
|
|
49
|
+
if (x && u.current === l.current && E(), r(a)) return i(a);
|
|
50
|
+
if (g.current) {
|
|
51
|
+
var o = t - (a - c.current);
|
|
52
|
+
n(e, C ? Math.min(o, T - (a - l.current)) : o);
|
|
50
53
|
}
|
|
54
|
+
}, E = function() {
|
|
55
|
+
o && o({});
|
|
51
56
|
}, D = function() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var r, s = Date.now(), f = m(s);
|
|
56
|
-
if (l.current = [].slice.call(arguments), u.current = i, a.current = s, C && !_.current && (_.current = function() {
|
|
57
|
+
if (y || w) {
|
|
58
|
+
var i, o = Date.now(), u = r(o);
|
|
59
|
+
if (f.current = [].slice.call(arguments), p.current = s, c.current = o, S && !_.current && (_.current = function() {
|
|
57
60
|
globalThis.document?.visibilityState === "hidden" && v.current.flush();
|
|
58
|
-
}, (
|
|
59
|
-
if (!
|
|
60
|
-
if (
|
|
61
|
+
}, (i = globalThis.document) == null || i.addEventListener == null || i.addEventListener("visibilitychange", _.current)), u) {
|
|
62
|
+
if (!d.current && g.current) return l.current = c.current, n(a, t), x ? e(c.current) : m.current;
|
|
63
|
+
if (C) return n(a, t), e(c.current);
|
|
61
64
|
}
|
|
62
|
-
return
|
|
65
|
+
return d.current || n(a, t), m.current;
|
|
63
66
|
}
|
|
64
67
|
};
|
|
65
|
-
return
|
|
66
|
-
var e =
|
|
67
|
-
e && (b ? cancelAnimationFrame(
|
|
68
|
-
},
|
|
69
|
-
return !!
|
|
70
|
-
},
|
|
71
|
-
return
|
|
72
|
-
},
|
|
68
|
+
return D.cancel = function() {
|
|
69
|
+
var e = d.current;
|
|
70
|
+
e && (b ? cancelAnimationFrame(d.current) : clearTimeout(d.current)), l.current = 0, f.current = c.current = p.current = d.current = null, e && o && o({});
|
|
71
|
+
}, D.isPending = function() {
|
|
72
|
+
return !!d.current;
|
|
73
|
+
}, D.flush = function() {
|
|
74
|
+
return d.current ? i(Date.now()) : m.current;
|
|
75
|
+
}, D;
|
|
73
76
|
}, [
|
|
74
77
|
x,
|
|
75
|
-
|
|
78
|
+
C,
|
|
76
79
|
t,
|
|
77
|
-
|
|
80
|
+
T,
|
|
81
|
+
ee,
|
|
78
82
|
S,
|
|
79
|
-
C,
|
|
80
83
|
b,
|
|
81
84
|
y,
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
w,
|
|
86
|
+
o
|
|
84
87
|
]);
|
|
85
|
-
return v.current =
|
|
86
|
-
return
|
|
88
|
+
return v.current = E, n(function() {
|
|
89
|
+
return g.current = !0, function() {
|
|
87
90
|
var e;
|
|
88
|
-
|
|
91
|
+
S && v.current.flush(), _.current &&= ((e = globalThis.document) == null || e.removeEventListener == null || e.removeEventListener("visibilitychange", _.current), null), g.current = !1;
|
|
89
92
|
};
|
|
90
|
-
}, [
|
|
93
|
+
}, [S]), E;
|
|
91
94
|
}
|
|
92
95
|
// src/components/ui/SequenceEditor/SequenceEditorStatusBar.tsx
|
|
93
|
-
var
|
|
94
|
-
let
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
+
var ce = () => {
|
|
97
|
+
let e = u(), t = m(O, (e) => e.isRealigning), n = m(O, (e) => e.latestMessage), i = m(O, (e) => e.engineMeta), a = m(O, (e) => e.selection), c = r(() => D.getStatusBarSelectionStats(a, i), [i, a]);
|
|
98
|
+
return /* @__PURE__ */ k(o, {
|
|
96
99
|
sx: {
|
|
97
|
-
backgroundColor:
|
|
98
|
-
borderTop: `1px solid ${
|
|
99
|
-
fontSize:
|
|
100
|
+
backgroundColor: l(e.palette.background.paper, .1),
|
|
101
|
+
borderTop: `1px solid ${l(e.palette.background.paper, .2)}`,
|
|
102
|
+
fontSize: e.typography.caption,
|
|
100
103
|
height: "100%",
|
|
101
104
|
width: "100%"
|
|
102
105
|
},
|
|
103
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ A(o, {
|
|
104
107
|
sx: {
|
|
105
108
|
"& > div": {
|
|
106
109
|
alignItems: "center",
|
|
107
|
-
borderLeft: `1px solid ${
|
|
110
|
+
borderLeft: `1px solid ${l(e.palette.background.paper, .2)}`,
|
|
108
111
|
display: "flex",
|
|
109
|
-
paddingLeft:
|
|
112
|
+
paddingLeft: e.spacing(1)
|
|
110
113
|
},
|
|
111
114
|
"& > div:first-of-type": { borderLeft: "none" },
|
|
112
115
|
display: "grid",
|
|
113
116
|
gap: 4,
|
|
114
117
|
gridTemplateColumns: "1fr repeat(5, max-content)",
|
|
115
|
-
paddingLeft:
|
|
116
|
-
paddingRight:
|
|
118
|
+
paddingLeft: e.spacing(1),
|
|
119
|
+
paddingRight: e.spacing(1)
|
|
117
120
|
},
|
|
118
121
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ A(o, {
|
|
120
123
|
sx: {
|
|
121
124
|
alignItems: "center",
|
|
122
125
|
display: "flex",
|
|
123
126
|
gap: 1
|
|
124
127
|
},
|
|
125
|
-
children: [
|
|
128
|
+
children: [t && /* @__PURE__ */ k(s, {
|
|
126
129
|
color: "inherit",
|
|
127
130
|
size: 12
|
|
128
|
-
}),
|
|
131
|
+
}), n ?? ""]
|
|
129
132
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ k(o, { children: `Pos: ${c.pos}` }),
|
|
134
|
+
/* @__PURE__ */ k(o, { children: `Selected seqs: ${c.selectedSeqs}` }),
|
|
135
|
+
/* @__PURE__ */ k(o, { children: `Cols: ${c.cols}` }),
|
|
136
|
+
/* @__PURE__ */ k(o, { children: `Total selected chars: ${c.totalSelectedChars}` }),
|
|
137
|
+
/* @__PURE__ */ k(o, { children: `Alignment: ${i?.sequenceCount ?? "0"} sequences, ${i?.alignmentWidth ?? "0"} positions` })
|
|
135
138
|
]
|
|
136
139
|
})
|
|
137
140
|
});
|
|
138
|
-
},
|
|
139
|
-
let [
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
}, j = /^(?:\d+|,\d+|\d+,\d+)$/, le = oe(({ onActionsChange: e, onClose: r, onGotoPosition: o }) => {
|
|
142
|
+
let [s, l] = a(""), u = i(null), d = s === "" || j.test(s);
|
|
143
|
+
n(() => {
|
|
144
|
+
u.current?.focus();
|
|
142
145
|
}, []);
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
}, []),
|
|
146
|
-
if (!
|
|
147
|
-
let [e,
|
|
148
|
-
|
|
146
|
+
let f = t((e) => {
|
|
147
|
+
l(e.target.value);
|
|
148
|
+
}, []), p = t(() => {
|
|
149
|
+
if (!d) return;
|
|
150
|
+
let [e, t] = s.split(",");
|
|
151
|
+
o(e ? Number(e) : null, t ? Number(t) : null), r?.();
|
|
149
152
|
}, [
|
|
153
|
+
d,
|
|
154
|
+
r,
|
|
150
155
|
o,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
let n = [];
|
|
159
|
-
n.push({
|
|
156
|
+
s
|
|
157
|
+
]), m = t((e) => {
|
|
158
|
+
e.key === "Enter" && (e.preventDefault(), p());
|
|
159
|
+
}, [p]);
|
|
160
|
+
return n(() => {
|
|
161
|
+
let t = [];
|
|
162
|
+
t.push({
|
|
160
163
|
color: "secondary",
|
|
161
164
|
label: "Close",
|
|
162
|
-
onClick:
|
|
165
|
+
onClick: r,
|
|
163
166
|
variant: "outlined"
|
|
164
|
-
}),
|
|
167
|
+
}), t.push({
|
|
165
168
|
color: "primary",
|
|
166
|
-
disabled: !
|
|
169
|
+
disabled: !d,
|
|
167
170
|
label: "Ok",
|
|
168
|
-
onClick:
|
|
171
|
+
onClick: p,
|
|
169
172
|
variant: "contained"
|
|
170
|
-
}), e?.(
|
|
173
|
+
}), e?.(t);
|
|
171
174
|
}, [
|
|
172
|
-
|
|
175
|
+
d,
|
|
173
176
|
e,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
]), /* @__PURE__ */
|
|
177
|
-
error: !
|
|
177
|
+
r,
|
|
178
|
+
p
|
|
179
|
+
]), /* @__PURE__ */ k(c, {
|
|
180
|
+
error: !d,
|
|
178
181
|
fullWidth: !0,
|
|
179
182
|
helperText: "Use x, ,y, or x,y.",
|
|
180
|
-
inputRef:
|
|
183
|
+
inputRef: u,
|
|
181
184
|
label: "Position",
|
|
182
|
-
onChange:
|
|
183
|
-
onKeyDown:
|
|
185
|
+
onChange: f,
|
|
186
|
+
onKeyDown: m,
|
|
184
187
|
placeholder: "x or ,y or x,y",
|
|
185
|
-
value:
|
|
188
|
+
value: s
|
|
186
189
|
});
|
|
187
190
|
}, {
|
|
188
191
|
defaultTitle: "Goto position (x) or (,y) or (x,y)",
|
|
189
192
|
fullWidth: !0,
|
|
190
193
|
maxWidth: "xs",
|
|
191
194
|
testId: "SequenceEditorGotoPositionDialog"
|
|
192
|
-
}),
|
|
193
|
-
let
|
|
195
|
+
}), M = () => {
|
|
196
|
+
let s = v(), c = y(), l = m(O, (e) => e.isRealigning), oe = m(O, (e) => e.rawFasta), j = m(O, (e) => e.setEngineMeta), M = m(O, (e) => e.setSelection), ue = i(null), de = i(null), fe = i(null), N = r(() => e.resolve(b), []), P = i(null), F = i(null), pe = i(null), I = i(null), L = i(null), R = i(null), me = i(null), [z, he] = a({
|
|
194
197
|
height: 0,
|
|
195
198
|
width: 0
|
|
196
|
-
}), [
|
|
199
|
+
}), [ge, _e] = a(() => e.resolve(f).data), ve = i(0), ye = i(0), B = r(() => new d({
|
|
197
200
|
scrollLeft: 0,
|
|
198
201
|
scrollTop: 0
|
|
199
|
-
}), []),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}, [
|
|
203
|
-
let X =
|
|
204
|
-
let e =
|
|
202
|
+
}), []), be = i(z), V = r(() => new d(null), []), xe = r(() => new d(null), []), H = i(null), U = i(null), W = r(() => new d(ee), []), G = r(() => new d(null), []), K = i(null), q = i(0), J = i(null), Se = i(!1), Y = u();
|
|
203
|
+
n(() => {
|
|
204
|
+
l ? fe.current?.open() : fe.current?.close();
|
|
205
|
+
}, [l]);
|
|
206
|
+
let X = t(() => {
|
|
207
|
+
let e = me.current;
|
|
205
208
|
if (!e) return;
|
|
206
|
-
let t = W.data, n =
|
|
209
|
+
let t = W.data, n = V.data;
|
|
207
210
|
if (t && n) {
|
|
208
211
|
let e = t.labelWidth + t.cellWidth + n.alignmentWidth * t.cellWidth, r = t.rulerHeight + n.sequenceCount * t.cellHeight;
|
|
209
|
-
|
|
212
|
+
ye.current !== e && (ye.current = e), ve.current !== r && (ve.current = r);
|
|
210
213
|
}
|
|
211
|
-
let { height: r, width: i } =
|
|
214
|
+
let { height: r, width: i } = be.current, a = `${Math.max(ye.current, i)}px`, o = `${Math.max(ve.current, r)}px`;
|
|
212
215
|
e.style.width !== a && (e.style.width = a), e.style.height !== o && (e.style.height = o);
|
|
213
|
-
}, [W,
|
|
214
|
-
let n =
|
|
215
|
-
return n.abortSignal?.aborted ? null : (
|
|
216
|
-
}, [
|
|
217
|
-
let e = W.data, t =
|
|
216
|
+
}, [W, V]), Ce = t(async (t) => {
|
|
217
|
+
let n = e.resolve(b).getMetaData(t), r = await n;
|
|
218
|
+
return n.abortSignal?.aborted ? null : (V.next(r), r);
|
|
219
|
+
}, [V]), Z = t(() => {
|
|
220
|
+
let e = W.data, t = V.data;
|
|
218
221
|
if (!t || !e) return;
|
|
219
|
-
let { scrollLeft: n, scrollTop: r } =
|
|
222
|
+
let { scrollLeft: n, scrollTop: r } = B.data, { height: i, width: a } = be.current, o = D.getVisibleGridRange({
|
|
220
223
|
geometry: e,
|
|
221
224
|
numCols: t.alignmentWidth,
|
|
222
225
|
numRows: t.sequenceCount,
|
|
@@ -225,7 +228,7 @@ var ae = () => {
|
|
|
225
228
|
viewportHeight: i,
|
|
226
229
|
viewportWidth: a
|
|
227
230
|
});
|
|
228
|
-
|
|
231
|
+
xe.next({
|
|
229
232
|
geometry: e,
|
|
230
233
|
scrollLeft: n,
|
|
231
234
|
scrollTop: r,
|
|
@@ -235,617 +238,633 @@ var ae = () => {
|
|
|
235
238
|
});
|
|
236
239
|
}, [
|
|
237
240
|
W,
|
|
241
|
+
V,
|
|
238
242
|
B,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
de({
|
|
243
|
+
xe
|
|
244
|
+
]), we = se((e, t) => {
|
|
245
|
+
he({
|
|
243
246
|
height: t,
|
|
244
247
|
width: e
|
|
245
248
|
});
|
|
246
249
|
}, 0, { trailing: !0 });
|
|
247
|
-
|
|
248
|
-
|
|
250
|
+
n(() => {
|
|
251
|
+
be.current = z, X(), Z();
|
|
249
252
|
}, [
|
|
250
|
-
|
|
253
|
+
z,
|
|
251
254
|
X,
|
|
252
|
-
|
|
255
|
+
Z
|
|
253
256
|
]);
|
|
254
|
-
let
|
|
255
|
-
|
|
256
|
-
let e = [
|
|
257
|
-
|
|
257
|
+
let Q = z.width > 0 ? z.width / 2 : 120;
|
|
258
|
+
n(() => {
|
|
259
|
+
let e = [V.subscribe((e) => {
|
|
260
|
+
j(e);
|
|
258
261
|
}), G.subscribe((e) => {
|
|
259
|
-
|
|
262
|
+
M(e);
|
|
260
263
|
})];
|
|
261
264
|
return () => {
|
|
262
|
-
e.forEach((e) => e()),
|
|
265
|
+
e.forEach((e) => e()), O.getState().setLatestMessage(null), j(null), M(null);
|
|
263
266
|
};
|
|
264
267
|
}, [
|
|
265
|
-
|
|
268
|
+
V,
|
|
266
269
|
G,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
]),
|
|
270
|
-
if (
|
|
270
|
+
j,
|
|
271
|
+
M
|
|
272
|
+
]), n(() => {
|
|
273
|
+
if (z.width <= 0) return;
|
|
271
274
|
let e = W.data;
|
|
272
|
-
e.labelWidth >
|
|
275
|
+
e.labelWidth > Q && W.next({
|
|
273
276
|
...e,
|
|
274
|
-
labelWidth:
|
|
277
|
+
labelWidth: Q
|
|
275
278
|
});
|
|
276
279
|
}, [
|
|
277
|
-
|
|
280
|
+
z.width,
|
|
278
281
|
W,
|
|
279
|
-
|
|
280
|
-
]),
|
|
281
|
-
let e =
|
|
282
|
+
Q
|
|
283
|
+
]), n(() => {
|
|
284
|
+
let e = R.current;
|
|
282
285
|
if (!e) return;
|
|
283
286
|
let t = new ResizeObserver(([e]) => {
|
|
284
287
|
if (!e) return;
|
|
285
288
|
let t = Math.max(1, e.contentRect.height), n = Math.max(1, e.contentRect.width);
|
|
286
|
-
|
|
289
|
+
we(n, t);
|
|
287
290
|
});
|
|
288
291
|
return t.observe(e), () => t.disconnect();
|
|
289
|
-
}, [
|
|
292
|
+
}, [N, we]), n(() => {
|
|
290
293
|
let e = new AbortController();
|
|
291
294
|
return (async () => {
|
|
292
|
-
H.current = null, U.current = null,
|
|
295
|
+
H.current = null, U.current = null, B.next({
|
|
293
296
|
scrollLeft: 0,
|
|
294
297
|
scrollTop: 0
|
|
295
298
|
}), G.next(null);
|
|
296
|
-
let t =
|
|
299
|
+
let t = N.initialize(e.signal);
|
|
297
300
|
if (await t, t.abortSignal?.aborted) return;
|
|
298
|
-
let n =
|
|
301
|
+
let n = N.reset(e.signal);
|
|
299
302
|
if (await n, n.abortSignal?.aborted) return;
|
|
300
|
-
let r =
|
|
301
|
-
await r, r.abortSignal?.aborted || await
|
|
303
|
+
let r = N.loadFasta(oe, e.signal);
|
|
304
|
+
await r, r.abortSignal?.aborted || await Ce(e.signal);
|
|
302
305
|
})().catch((t) => {
|
|
303
306
|
e.signal.aborted || console.error(t);
|
|
304
307
|
}), () => e.abort();
|
|
305
308
|
}, [
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
+
N,
|
|
310
|
+
oe,
|
|
311
|
+
B,
|
|
309
312
|
G,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
]),
|
|
313
|
-
let
|
|
314
|
-
if (
|
|
315
|
-
|
|
313
|
+
Ce,
|
|
314
|
+
Z
|
|
315
|
+
]), n(() => {
|
|
316
|
+
let t = null, n = !0, r = null, i = null, a = null, o = async () => {
|
|
317
|
+
if (n && !Se.current) {
|
|
318
|
+
Se.current = !0;
|
|
316
319
|
try {
|
|
317
|
-
for (;
|
|
318
|
-
let
|
|
320
|
+
for (; n && J.current;) {
|
|
321
|
+
let o = J.current;
|
|
319
322
|
J.current = null;
|
|
320
|
-
let
|
|
321
|
-
if (!
|
|
322
|
-
if (!U.current || !
|
|
323
|
+
let s = q.current, c = r;
|
|
324
|
+
if (!c || c.signal.aborted) return;
|
|
325
|
+
if (!U.current || !D.isWithinGridRange({
|
|
323
326
|
cachedGridRange: U.current.range,
|
|
324
|
-
visibleGridRange:
|
|
327
|
+
visibleGridRange: o.visibleGridRange.visible
|
|
325
328
|
})) {
|
|
326
329
|
let e = [];
|
|
327
|
-
for (let t =
|
|
328
|
-
let n =
|
|
330
|
+
for (let t = o.visibleGridRange.cache.startRow; t <= o.visibleGridRange.cache.endRow; t++) {
|
|
331
|
+
let n = N.name(t, c.signal);
|
|
329
332
|
if (e.push(await n), n.abortSignal?.aborted) return;
|
|
330
333
|
}
|
|
331
|
-
if (!
|
|
334
|
+
if (!n || c.signal.aborted) return;
|
|
332
335
|
U.current = {
|
|
333
|
-
range:
|
|
336
|
+
range: o.visibleGridRange.cache,
|
|
334
337
|
rowNames: e
|
|
335
338
|
};
|
|
336
339
|
}
|
|
337
|
-
if (!H.current || !
|
|
340
|
+
if (!H.current || !D.isWithinGridRange({
|
|
338
341
|
cachedGridRange: H.current.range,
|
|
339
|
-
visibleGridRange:
|
|
342
|
+
visibleGridRange: o.visibleGridRange.visible
|
|
340
343
|
})) {
|
|
341
|
-
let e =
|
|
342
|
-
endCol:
|
|
343
|
-
endRow:
|
|
344
|
-
startCol:
|
|
345
|
-
startRow:
|
|
346
|
-
},
|
|
347
|
-
if (!
|
|
344
|
+
let e = N.viewport({
|
|
345
|
+
endCol: o.visibleGridRange.cache.endCol,
|
|
346
|
+
endRow: o.visibleGridRange.cache.endRow,
|
|
347
|
+
startCol: o.visibleGridRange.cache.startCol,
|
|
348
|
+
startRow: o.visibleGridRange.cache.startRow
|
|
349
|
+
}, O.getState().readingMode === T.NUCLEOTIDE ? void 0 : O.getState().readingFrame, c.signal), t = await e;
|
|
350
|
+
if (!n || e.abortSignal?.aborted) return;
|
|
348
351
|
H.current = {
|
|
349
|
-
range:
|
|
350
|
-
viewportResult:
|
|
352
|
+
range: o.visibleGridRange.cache,
|
|
353
|
+
viewportResult: t
|
|
351
354
|
};
|
|
352
355
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
356
|
+
s === q.current && (t !== null && cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
357
|
+
n && s === q.current && P.current && O.getState().nucleotidePalette && O.getState().aminoAcidPalette && H.current && V.data && U.current && (F.current = D.drawCanvas({
|
|
358
|
+
aminoAcidPalette: O.getState().aminoAcidPalette,
|
|
359
|
+
canvasElement: P.current,
|
|
360
|
+
devicePixelRatio: e.resolve(f).data,
|
|
361
|
+
geometry: o.geometry,
|
|
362
|
+
meta: V.data,
|
|
363
|
+
nucleotidePalette: O.getState().nucleotidePalette,
|
|
364
|
+
readingFrame: O.getState().readingFrame,
|
|
365
|
+
readingMode: O.getState().readingMode,
|
|
360
366
|
rowNames: U.current.rowNames,
|
|
361
367
|
rowNamesStartRow: U.current.range.startRow,
|
|
362
|
-
scrollLeft:
|
|
363
|
-
scrollTop:
|
|
364
|
-
searchResult:
|
|
365
|
-
searchResultHighlightedIndex:
|
|
368
|
+
scrollLeft: o.scrollLeft,
|
|
369
|
+
scrollTop: o.scrollTop,
|
|
370
|
+
searchResult: i,
|
|
371
|
+
searchResultHighlightedIndex: a,
|
|
366
372
|
selection: G.data,
|
|
367
373
|
viewport: H.current.viewportResult,
|
|
368
|
-
viewportHeight:
|
|
369
|
-
viewportWidth:
|
|
374
|
+
viewportHeight: o.viewportHeight,
|
|
375
|
+
viewportWidth: o.viewportWidth
|
|
370
376
|
}));
|
|
371
377
|
}));
|
|
372
378
|
}
|
|
373
379
|
} catch (e) {
|
|
374
380
|
if (!(e instanceof DOMException && e.name === "AbortError")) throw e;
|
|
375
381
|
} finally {
|
|
376
|
-
|
|
382
|
+
Se.current = !1, n && J.current && o();
|
|
377
383
|
}
|
|
378
384
|
}
|
|
379
|
-
},
|
|
385
|
+
}, s = [O.subscribe((e, t) => {
|
|
380
386
|
let n = !1;
|
|
381
|
-
e.searchResult !== t.searchResult && (
|
|
387
|
+
e.searchResult !== t.searchResult && (i = e.searchResult, n = !0), e.searchResultHighlightedIndex !== t.searchResultHighlightedIndex && (a = e.searchResultHighlightedIndex, D.scrollToSearchResult({
|
|
382
388
|
geometry: W.data,
|
|
383
|
-
scrollContainer:
|
|
389
|
+
scrollContainer: R.current,
|
|
384
390
|
searchResult: e.searchResult,
|
|
385
391
|
searchResultHighlightedIndex: e.searchResultHighlightedIndex
|
|
386
|
-
}), n = !0), n &&
|
|
387
|
-
}),
|
|
388
|
-
e && (
|
|
392
|
+
}), n = !0), n && Z();
|
|
393
|
+
}), xe.subscribe((e) => {
|
|
394
|
+
e && (r?.abort(), r = new AbortController(), J.current = e, q.current += 1, o());
|
|
389
395
|
})];
|
|
390
396
|
return () => {
|
|
391
|
-
|
|
397
|
+
n = !1, r?.abort(), J.current = null, t !== null && cancelAnimationFrame(t), q.current += 1, s.forEach((e) => e());
|
|
392
398
|
};
|
|
393
399
|
}, [
|
|
394
|
-
|
|
400
|
+
N,
|
|
395
401
|
W,
|
|
396
|
-
|
|
402
|
+
V,
|
|
397
403
|
G,
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
]),
|
|
401
|
-
let
|
|
402
|
-
|
|
403
|
-
e.nucleotidePalette !== t.nucleotidePalette &&
|
|
404
|
+
Z,
|
|
405
|
+
xe
|
|
406
|
+
]), n(() => {
|
|
407
|
+
let t = [
|
|
408
|
+
O.subscribe((e, t) => {
|
|
409
|
+
(e.readingMode !== t.readingMode || e.readingFrame !== t.readingFrame) && (H.current = null, Z()), (e.nucleotidePalette !== t.nucleotidePalette || e.aminoAcidPalette !== t.aminoAcidPalette) && Z();
|
|
404
410
|
}),
|
|
405
411
|
W.subscribe(() => {
|
|
406
|
-
X(),
|
|
412
|
+
X(), Z();
|
|
407
413
|
}),
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
e && (X(),
|
|
414
|
+
B.subscribe(() => Z()),
|
|
415
|
+
V.subscribe((e) => {
|
|
416
|
+
e && (X(), Z());
|
|
411
417
|
}),
|
|
412
|
-
G.subscribe(() =>
|
|
413
|
-
|
|
414
|
-
|
|
418
|
+
G.subscribe(() => Z()),
|
|
419
|
+
e.resolve(f).subscribe((e) => {
|
|
420
|
+
_e(e), X(), Z();
|
|
415
421
|
})
|
|
416
422
|
];
|
|
417
423
|
return () => {
|
|
418
|
-
|
|
424
|
+
t.forEach((e) => e());
|
|
419
425
|
};
|
|
420
426
|
}, [
|
|
421
|
-
|
|
427
|
+
N,
|
|
422
428
|
W,
|
|
429
|
+
V,
|
|
423
430
|
B,
|
|
424
|
-
z,
|
|
425
431
|
G,
|
|
426
432
|
X,
|
|
427
|
-
|
|
428
|
-
]),
|
|
429
|
-
let
|
|
430
|
-
let
|
|
431
|
-
|
|
432
|
-
},
|
|
433
|
-
callback:
|
|
434
|
-
element:
|
|
435
|
-
...
|
|
436
|
-
}),
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
callback:
|
|
468
|
-
element:
|
|
433
|
+
Z
|
|
434
|
+
]), n(() => {
|
|
435
|
+
let t = (t) => {
|
|
436
|
+
let n = t.key.toUpperCase();
|
|
437
|
+
S.has(n) && (t.preventDefault(), e.resolve(x).emit("onMutateSelection", n));
|
|
438
|
+
}, n = (t) => e.resolve(p).registerShortcut({
|
|
439
|
+
callback: t.callback,
|
|
440
|
+
element: L.current,
|
|
441
|
+
...t.shortcut
|
|
442
|
+
}), r = [
|
|
443
|
+
n(E.copySelection),
|
|
444
|
+
n(E.expandSelectionLeft),
|
|
445
|
+
n(E.expandSelectionRight),
|
|
446
|
+
n(E.expandSelectionUp),
|
|
447
|
+
n(E.expandSelectionDown),
|
|
448
|
+
n(E.moveSelectionLeft),
|
|
449
|
+
n(E.moveSelectionRight),
|
|
450
|
+
n(E.moveSelectionUp),
|
|
451
|
+
n(E.moveSelectionDown),
|
|
452
|
+
n(E.moveRowUp),
|
|
453
|
+
n(E.moveRowDown),
|
|
454
|
+
n(E.moveRowToStart),
|
|
455
|
+
n(E.moveRowToEnd),
|
|
456
|
+
n(E.moveCellLeft),
|
|
457
|
+
n(E.moveCellRight),
|
|
458
|
+
n(E.scrollToLineStart),
|
|
459
|
+
n(E.scrollToLineEnd),
|
|
460
|
+
n(E.scrollPageUp),
|
|
461
|
+
n(E.scrollPageDown),
|
|
462
|
+
n(E.insertGap),
|
|
463
|
+
n(E.deleteBackward),
|
|
464
|
+
n(E.deleteSelection),
|
|
465
|
+
n(E.deleteRows),
|
|
466
|
+
n(E.deleteRowsMac),
|
|
467
|
+
n(E.deleteBase),
|
|
468
|
+
n(E.pasteFasta),
|
|
469
|
+
n(E.undo),
|
|
470
|
+
n(E.redo),
|
|
471
|
+
n(E.gotoPosition),
|
|
472
|
+
e.resolve(p).registerShortcut({
|
|
473
|
+
callback: t,
|
|
474
|
+
element: L.current
|
|
469
475
|
}),
|
|
470
|
-
|
|
471
|
-
callback:
|
|
472
|
-
element:
|
|
476
|
+
e.resolve(p).registerShortcut({
|
|
477
|
+
callback: t,
|
|
478
|
+
element: L.current,
|
|
473
479
|
modifiers: [["Shift"]]
|
|
474
480
|
})
|
|
475
481
|
];
|
|
476
482
|
return () => {
|
|
477
|
-
|
|
483
|
+
r.forEach((e) => e());
|
|
478
484
|
};
|
|
479
|
-
}, [])
|
|
480
|
-
|
|
485
|
+
}, []);
|
|
486
|
+
let $ = t(() => O.getState().readingMode === T.AMINO_ACIDS && (O.getState().setLatestMessage("Mutations are not allowed in amino acid reading mode."), !0), []);
|
|
487
|
+
n(() => {
|
|
488
|
+
let t = async (e) => {
|
|
481
489
|
let { abortSignal: t, command: n, getSelectionPostCommand: r, invalidateRowNames: i } = e;
|
|
482
490
|
try {
|
|
483
|
-
let e =
|
|
484
|
-
if (
|
|
485
|
-
H.current = null, i && (U.current = null)
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
if (e !== void 0 && a?.undoDepth === e) return;
|
|
489
|
-
let t = r();
|
|
490
|
-
G.next(t), K.current = t;
|
|
491
|
+
let e = await n();
|
|
492
|
+
if (t?.aborted || e === !1) return !1;
|
|
493
|
+
if (H.current = null, i && (U.current = null), await Ce(), r) {
|
|
494
|
+
let e = r();
|
|
495
|
+
G.next(e), K.current = e;
|
|
491
496
|
}
|
|
497
|
+
return !0;
|
|
492
498
|
} catch (e) {
|
|
493
|
-
t?.aborted || console.error("Failed to post command:", e);
|
|
499
|
+
return t?.aborted || console.error("Failed to post command:", e), !1;
|
|
494
500
|
}
|
|
495
|
-
},
|
|
496
|
-
if (!
|
|
497
|
-
let n =
|
|
498
|
-
n && await
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
if (!B.data) return;
|
|
503
|
-
let t = c.getMovedSelection(G.data, e, B.data);
|
|
501
|
+
}, n = async (e) => {
|
|
502
|
+
if (!V.data || $()) return;
|
|
503
|
+
let n = D.getMutateArguments(G.data, V.data);
|
|
504
|
+
n && await t({ command: async () => N.mutate(n.rows, n.columns, e) });
|
|
505
|
+
}, r = (e) => {
|
|
506
|
+
if (!V.data) return;
|
|
507
|
+
let t = D.getMovedSelection(G.data, e, V.data);
|
|
504
508
|
if (t) {
|
|
505
509
|
if (G.next(t), K.current) {
|
|
506
|
-
let t =
|
|
510
|
+
let t = D.getMovedSelection(K.current, e, V.data);
|
|
507
511
|
K.current = t;
|
|
508
512
|
} else K.current = t;
|
|
509
513
|
}
|
|
510
|
-
},
|
|
511
|
-
if (!
|
|
512
|
-
let t =
|
|
514
|
+
}, i = (e) => {
|
|
515
|
+
if (!V.data || !K.current || !G.data) return;
|
|
516
|
+
let t = D.getExpandedSelection(G.data, K.current, e, V.data);
|
|
513
517
|
t && G.next(t);
|
|
514
|
-
},
|
|
515
|
-
if (!
|
|
516
|
-
let n =
|
|
517
|
-
n && await
|
|
518
|
+
}, a = async (e) => {
|
|
519
|
+
if (!V.data) return;
|
|
520
|
+
let n = D.getRowsToMove(G.data, e, V.data);
|
|
521
|
+
n && await t({
|
|
518
522
|
command: async () => {
|
|
519
|
-
|
|
523
|
+
if (e === C.UP) {
|
|
524
|
+
let e = await N.moveRowsToTop(n);
|
|
525
|
+
return e && R.current && (R.current.scrollTop = 0), e;
|
|
526
|
+
}
|
|
527
|
+
let t = await N.moveRowsToBottom(n);
|
|
528
|
+
return t && R.current && (R.current.scrollTop = R.current.scrollHeight - R.current.clientHeight), t;
|
|
520
529
|
},
|
|
521
|
-
getSelectionPostCommand: () =>
|
|
530
|
+
getSelectionPostCommand: () => D.getMovedRowsEndSelection(G.data, e, V.data),
|
|
522
531
|
invalidateRowNames: !0
|
|
523
532
|
});
|
|
524
|
-
},
|
|
525
|
-
if (!
|
|
526
|
-
let n =
|
|
527
|
-
n && await
|
|
528
|
-
command: async () =>
|
|
529
|
-
|
|
530
|
-
},
|
|
531
|
-
getSelectionPostCommand: () => c.getMovedRowsRelativeSelection(G.data, t, B.data),
|
|
533
|
+
}, o = async (e) => {
|
|
534
|
+
if (!V.data) return;
|
|
535
|
+
let n = D.getRowsToMove(G.data, e, V.data);
|
|
536
|
+
n && await t({
|
|
537
|
+
command: async () => e === C.UP ? N.moveRowsUp(n) : N.moveRowsDown(n),
|
|
538
|
+
getSelectionPostCommand: () => D.getMovedRowsRelativeSelection(G.data, e, V.data),
|
|
532
539
|
invalidateRowNames: !0
|
|
533
540
|
});
|
|
534
|
-
},
|
|
535
|
-
if (!
|
|
536
|
-
let n =
|
|
537
|
-
n && n.columns.length !== 0 && n.rows.length !== 0 && await
|
|
538
|
-
command: async () =>
|
|
539
|
-
|
|
540
|
-
},
|
|
541
|
-
getSelectionPostCommand: () => c.getPostUpsertSelection(G.data, t)
|
|
541
|
+
}, l = async (e) => {
|
|
542
|
+
if ($() || !V.data || e !== C.LEFT && e !== C.RIGHT || !G.data?.cells && (!G.data?.cols || G.data.cols.length === 0)) return;
|
|
543
|
+
let n = D.getMutateArguments(G.data, V.data);
|
|
544
|
+
n && n.columns.length !== 0 && n.rows.length !== 0 && await t({
|
|
545
|
+
command: async () => N.moveHorizontal(n.rows, n.columns, e),
|
|
546
|
+
getSelectionPostCommand: () => D.getPostUpsertSelection(G.data, e)
|
|
542
547
|
});
|
|
543
|
-
},
|
|
544
|
-
if (
|
|
545
|
-
|
|
548
|
+
}, u = e.resolve(x), d = null, f = null, p = async (e) => {
|
|
549
|
+
if ($() || O.getState().isRealigning || !e.trimStart().startsWith(">")) return;
|
|
550
|
+
f?.abort();
|
|
546
551
|
let n = new AbortController();
|
|
547
|
-
|
|
552
|
+
f = n;
|
|
548
553
|
try {
|
|
549
|
-
await
|
|
554
|
+
await t({
|
|
550
555
|
abortSignal: n.signal,
|
|
551
556
|
command: async () => {
|
|
552
|
-
let
|
|
553
|
-
|
|
557
|
+
let t = N.loadFasta(e, n.signal), r = await t;
|
|
558
|
+
return t.abortSignal?.aborted || !r ? !1 : (O.getState().searchQuery && u.emit("onSearch", O.getState().searchQuery), O.getState().setLatestMessage("Pasted sequences from clipboard"), !0);
|
|
554
559
|
},
|
|
555
|
-
getSelectionPostCommand: () =>
|
|
560
|
+
getSelectionPostCommand: () => D.getPostPasteSequencesSelection(G.data, e),
|
|
556
561
|
invalidateRowNames: !0
|
|
557
562
|
});
|
|
558
563
|
} catch (e) {
|
|
559
|
-
n.signal.aborted || (console.error("Failed to load FASTA from clipboard:", e),
|
|
564
|
+
n.signal.aborted || (console.error("Failed to load FASTA from clipboard:", e), O.getState().setLatestMessage("Failed to load FASTA from clipboard."));
|
|
560
565
|
} finally {
|
|
561
|
-
|
|
566
|
+
f === n && (f = null);
|
|
562
567
|
}
|
|
563
|
-
},
|
|
568
|
+
}, m = (e) => {
|
|
564
569
|
let t = e.target;
|
|
565
570
|
if (t instanceof HTMLElement && (t.isContentEditable || t.closest("input, textarea, select"))) return;
|
|
566
571
|
let n = e.clipboardData?.getData("text/plain") ?? "";
|
|
567
|
-
n.trimStart().startsWith(">") && (e.preventDefault(),
|
|
572
|
+
n.trimStart().startsWith(">") && (e.preventDefault(), p(n));
|
|
568
573
|
};
|
|
569
|
-
|
|
570
|
-
let
|
|
571
|
-
() =>
|
|
572
|
-
|
|
574
|
+
e.resolve(_).window.addEventListener("paste", m);
|
|
575
|
+
let g = [
|
|
576
|
+
() => e.resolve(_).window.removeEventListener("paste", m),
|
|
577
|
+
u.addEventListener("onSearch", async (e) => {
|
|
573
578
|
if (!e) {
|
|
574
|
-
|
|
579
|
+
d?.abort();
|
|
575
580
|
return;
|
|
576
581
|
}
|
|
577
|
-
|
|
582
|
+
d?.abort();
|
|
578
583
|
let t = new AbortController();
|
|
579
|
-
|
|
580
|
-
let n =
|
|
584
|
+
d = t;
|
|
585
|
+
let n = N.search(e, !0, t.signal);
|
|
581
586
|
try {
|
|
582
587
|
let e = await n;
|
|
583
|
-
n.abortSignal?.aborted ||
|
|
588
|
+
n.abortSignal?.aborted || O.getState().setSearchResult(e);
|
|
584
589
|
} catch (e) {
|
|
585
590
|
t.signal.aborted || console.error("Failed to search sequences:", e);
|
|
586
591
|
}
|
|
587
592
|
}),
|
|
588
|
-
|
|
589
|
-
|
|
593
|
+
u.addEventListener("onDeselect", () => {
|
|
594
|
+
G.next(null), K.current = null;
|
|
595
|
+
}),
|
|
596
|
+
u.addEventListener("onExpandSelection", (e) => i(e)),
|
|
597
|
+
u.addEventListener("onCopySelection", async () => {
|
|
590
598
|
let e = G.data;
|
|
591
599
|
if (e) try {
|
|
592
|
-
let t = await
|
|
600
|
+
let t = await N.exportGappedFasta(), n = D.getSelectedFasta(t, e);
|
|
593
601
|
if (!n) return;
|
|
594
|
-
await navigator.clipboard.writeText(n),
|
|
602
|
+
await navigator.clipboard.writeText(n), O.getState().setLatestMessage("Copied selected sequences to clipboard");
|
|
595
603
|
} catch (e) {
|
|
596
|
-
console.error("Failed to copy selected sequences:", e),
|
|
604
|
+
console.error("Failed to copy selected sequences:", e), O.getState().setLatestMessage("Failed to copy selected sequences to clipboard.");
|
|
597
605
|
}
|
|
598
606
|
}),
|
|
599
|
-
|
|
607
|
+
u.addEventListener("onPasteFasta", async () => {
|
|
600
608
|
try {
|
|
601
609
|
console.log("Reading FASTA from clipboard");
|
|
602
610
|
let e = await navigator.clipboard.readText();
|
|
603
|
-
await
|
|
611
|
+
await p(e);
|
|
604
612
|
} catch (e) {
|
|
605
|
-
console.error("Failed to read FASTA from clipboard:", e),
|
|
613
|
+
console.error("Failed to read FASTA from clipboard:", e), O.getState().setLatestMessage("Failed to read FASTA from clipboard.");
|
|
606
614
|
}
|
|
607
615
|
}),
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
s(e);
|
|
612
|
-
}),
|
|
613
|
-
f.addEventListener("onMoveRowsEnd", (e) => {
|
|
616
|
+
u.addEventListener("onGotoPosition", () => de.current?.open({})),
|
|
617
|
+
u.addEventListener("onMoveSelection", (e) => r(e)),
|
|
618
|
+
u.addEventListener("onMoveRows", (e) => {
|
|
614
619
|
o(e);
|
|
615
620
|
}),
|
|
616
|
-
|
|
617
|
-
|
|
621
|
+
u.addEventListener("onMoveRowsEnd", (e) => {
|
|
622
|
+
a(e);
|
|
618
623
|
}),
|
|
619
|
-
|
|
620
|
-
|
|
624
|
+
u.addEventListener("onMoveCells", (e) => {
|
|
625
|
+
l(e);
|
|
626
|
+
}),
|
|
627
|
+
u.addEventListener("onScrollToLineStart", () => {
|
|
628
|
+
let e = R.current;
|
|
621
629
|
e && (e.scrollLeft = 0);
|
|
622
630
|
}),
|
|
623
|
-
|
|
624
|
-
let e =
|
|
631
|
+
u.addEventListener("onScrollToLineEnd", () => {
|
|
632
|
+
let e = R.current;
|
|
625
633
|
e && (e.scrollLeft = e.scrollWidth - e.clientWidth);
|
|
626
634
|
}),
|
|
627
|
-
|
|
628
|
-
let e =
|
|
635
|
+
u.addEventListener("onScrollPageUp", () => {
|
|
636
|
+
let e = R.current;
|
|
629
637
|
e && (e.scrollTop = Math.max(0, e.scrollTop - e.clientHeight));
|
|
630
638
|
}),
|
|
631
|
-
|
|
632
|
-
let e =
|
|
639
|
+
u.addEventListener("onScrollPageDown", () => {
|
|
640
|
+
let e = R.current;
|
|
633
641
|
e && (e.scrollTop = Math.min(e.scrollHeight - e.clientHeight, e.scrollTop + e.clientHeight));
|
|
634
642
|
}),
|
|
635
|
-
|
|
643
|
+
u.addEventListener("onInsert", () => {
|
|
636
644
|
(async () => {
|
|
637
|
-
if (!
|
|
638
|
-
let
|
|
639
|
-
|
|
640
|
-
command: async () =>
|
|
641
|
-
getSelectionPostCommand: () =>
|
|
645
|
+
if (!V.data || $()) return;
|
|
646
|
+
let e = D.getUpsertArguments(G.data, V.data);
|
|
647
|
+
e && await t({
|
|
648
|
+
command: async () => N.insert(e.rows, e.col),
|
|
649
|
+
getSelectionPostCommand: () => D.getPostUpsertSelection(G.data, C.RIGHT)
|
|
642
650
|
});
|
|
643
651
|
})();
|
|
644
652
|
}),
|
|
645
|
-
|
|
653
|
+
u.addEventListener("onDeleteBackward", () => {
|
|
646
654
|
(async () => {
|
|
647
|
-
if (!
|
|
648
|
-
let
|
|
649
|
-
|
|
650
|
-
command: async () =>
|
|
651
|
-
getSelectionPostCommand: () =>
|
|
655
|
+
if (!V.data || $()) return;
|
|
656
|
+
let e = D.getUpsertArguments(G.data, V.data, -1);
|
|
657
|
+
e && await t({
|
|
658
|
+
command: async () => N.delete(e.rows, e.col),
|
|
659
|
+
getSelectionPostCommand: () => D.getPostUpsertSelection(G.data, C.LEFT)
|
|
652
660
|
});
|
|
653
661
|
})();
|
|
654
662
|
}),
|
|
655
|
-
|
|
663
|
+
u.addEventListener("onDeleteRows", () => {
|
|
656
664
|
(async () => {
|
|
657
|
-
let
|
|
658
|
-
n?.length && r &&
|
|
659
|
-
command: async () =>
|
|
660
|
-
getSelectionPostCommand: () =>
|
|
665
|
+
let e = G.data, n = e?.rows, r = V.data;
|
|
666
|
+
n?.length && r && await t({
|
|
667
|
+
command: async () => N.deleteRows(n),
|
|
668
|
+
getSelectionPostCommand: () => D.getPostDeleteRowsSelection(e, r.sequenceCount),
|
|
661
669
|
invalidateRowNames: !0
|
|
662
|
-
})
|
|
670
|
+
}) && O.getState().setLatestMessage(`${n.length} row${n.length > 1 ? "s" : ""} deleted`);
|
|
663
671
|
})();
|
|
664
672
|
}),
|
|
665
|
-
|
|
666
|
-
|
|
673
|
+
u.addEventListener("onMutateSelection", (e) => {
|
|
674
|
+
n(e);
|
|
667
675
|
}),
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
command: async () =>
|
|
676
|
+
u.addEventListener("onUndo", () => {
|
|
677
|
+
t({
|
|
678
|
+
command: async () => N.undo(),
|
|
671
679
|
getSelectionPostCommand: () => null,
|
|
672
680
|
invalidateRowNames: !0
|
|
673
681
|
});
|
|
674
682
|
}),
|
|
675
|
-
|
|
676
|
-
|
|
683
|
+
u.addEventListener("onCancelRealign", () => {
|
|
684
|
+
N.cancelRealign();
|
|
677
685
|
}),
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
let t = !1;
|
|
681
|
-
e({
|
|
686
|
+
u.addEventListener("onRealign", () => {
|
|
687
|
+
O.getState().setIsRealigning(!0), t({
|
|
682
688
|
command: async () => {
|
|
683
689
|
try {
|
|
684
|
-
await
|
|
690
|
+
return await N.realign();
|
|
685
691
|
} catch (e) {
|
|
686
|
-
if (e instanceof DOMException && e.name === "AbortError")
|
|
687
|
-
|
|
692
|
+
if (e instanceof DOMException && e.name === "AbortError") return !1;
|
|
693
|
+
throw O.getState().setLatestMessage(te.getEngineErrorMessage(e)), e;
|
|
688
694
|
} finally {
|
|
689
|
-
|
|
695
|
+
O.getState().setIsRealigning(!1);
|
|
690
696
|
}
|
|
691
697
|
},
|
|
692
|
-
getSelectionPostCommand: () =>
|
|
698
|
+
getSelectionPostCommand: () => null,
|
|
693
699
|
invalidateRowNames: !0
|
|
694
700
|
});
|
|
695
701
|
}),
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
command: async () =>
|
|
702
|
+
u.addEventListener("onRedo", () => {
|
|
703
|
+
t({
|
|
704
|
+
command: async () => N.redo(),
|
|
699
705
|
getSelectionPostCommand: () => null,
|
|
700
706
|
invalidateRowNames: !0
|
|
701
707
|
});
|
|
702
708
|
}),
|
|
703
|
-
|
|
704
|
-
let e = await
|
|
705
|
-
|
|
709
|
+
u.addEventListener("onExportGappedFasta", async () => {
|
|
710
|
+
let e = await N.exportGappedFasta();
|
|
711
|
+
h.downloadFastaFile(e, "sequence.gapped.fasta");
|
|
706
712
|
}),
|
|
707
|
-
|
|
708
|
-
let e = await
|
|
709
|
-
|
|
713
|
+
u.addEventListener("onExportUngappedFasta", async () => {
|
|
714
|
+
let e = await N.exportUngappedFasta();
|
|
715
|
+
h.downloadFastaFile(e, "sequence.ungapped.fasta");
|
|
710
716
|
}),
|
|
711
|
-
|
|
712
|
-
let e = await
|
|
713
|
-
|
|
717
|
+
u.addEventListener("onExportToLoculus", async () => {
|
|
718
|
+
let e = await N.exportUngappedFasta(), { parsedMetadata: t, rawFasta: n } = O.getState();
|
|
719
|
+
ue.current?.open({
|
|
714
720
|
fasta: e,
|
|
715
721
|
metaData: t,
|
|
716
722
|
rawFasta: n
|
|
717
723
|
});
|
|
718
724
|
}),
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
metaData: t,
|
|
725
|
-
type: "import-data"
|
|
726
|
-
}, n));
|
|
727
|
-
};
|
|
728
|
-
r.addEventListener("message", a), i = r.open(y.phylogenyViewerUrl), i || r.removeEventListener("message", a);
|
|
725
|
+
u.addEventListener("onOpenInPhylogenyViewer", async () => {
|
|
726
|
+
s.phylogenyViewerUrl && await c(s.phylogenyViewerUrl, async () => ({
|
|
727
|
+
fasta: await N.exportGappedFasta(),
|
|
728
|
+
metaData: O.getState().rawMetadata
|
|
729
|
+
}));
|
|
729
730
|
})
|
|
730
731
|
];
|
|
731
732
|
return () => {
|
|
732
|
-
window.removeEventListener("paste",
|
|
733
|
+
window.removeEventListener("paste", m), d?.abort(), f?.abort(), g.forEach((e) => e()), N.cancelRealign();
|
|
733
734
|
};
|
|
734
735
|
}, [
|
|
735
|
-
|
|
736
|
+
N,
|
|
736
737
|
G,
|
|
738
|
+
Ce,
|
|
737
739
|
Z,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
740
|
+
V,
|
|
741
|
+
s.phylogenyViewerUrl,
|
|
742
|
+
c,
|
|
743
|
+
$
|
|
744
|
+
]), n(() => {
|
|
745
|
+
Z();
|
|
746
|
+
}, [Z]);
|
|
747
|
+
let Te = t((e) => {
|
|
745
748
|
let t = e.currentTarget;
|
|
746
|
-
|
|
749
|
+
B.next({
|
|
747
750
|
scrollLeft: t.scrollLeft,
|
|
748
751
|
scrollTop: t.scrollTop
|
|
749
752
|
});
|
|
750
|
-
}, [
|
|
751
|
-
|
|
752
|
-
let
|
|
753
|
-
if (
|
|
754
|
-
let
|
|
755
|
-
if (!
|
|
756
|
-
let
|
|
757
|
-
canvas:
|
|
758
|
-
devicePixelRatio:
|
|
753
|
+
}, [B]), Ee = t((t) => {
|
|
754
|
+
L.current?.focus();
|
|
755
|
+
let n = t.currentTarget, r = n.getBoundingClientRect(), i = t.clientX >= r.left + n.clientWidth, a = t.clientY >= r.top + n.clientHeight;
|
|
756
|
+
if (i || a) return;
|
|
757
|
+
let o = P.current, s = F.current, c = e.resolve(f).data;
|
|
758
|
+
if (!o || !s) return;
|
|
759
|
+
let l = D.getPathPropertiesFromCanvas({
|
|
760
|
+
canvas: o,
|
|
761
|
+
devicePixelRatio: c,
|
|
759
762
|
editorAssembly: s,
|
|
760
|
-
event:
|
|
763
|
+
event: t.nativeEvent
|
|
761
764
|
});
|
|
762
|
-
if (
|
|
763
|
-
if (
|
|
764
|
-
if (
|
|
765
|
-
let
|
|
766
|
-
if (
|
|
765
|
+
if (l) {
|
|
766
|
+
if (l.type !== w.DIVIDER) {
|
|
767
|
+
if (l.type === w.LABEL && (t.metaKey || t.ctrlKey)) {
|
|
768
|
+
let e = G.data?.rows ?? [], n = e.includes(l.row) ? e.filter((e) => e !== l.row) : [...e, l.row].sort((e, t) => e - t);
|
|
769
|
+
if (t.preventDefault(), I.current = null, n.length === 0) {
|
|
767
770
|
G.next(null), K.current = null;
|
|
768
771
|
return;
|
|
769
772
|
}
|
|
770
773
|
G.next({ rows: n }), K.current = { rows: n };
|
|
771
774
|
return;
|
|
772
775
|
}
|
|
773
|
-
let
|
|
774
|
-
endPath:
|
|
775
|
-
startPath:
|
|
776
|
+
let e = D.getSelectionFromPathProperties({
|
|
777
|
+
endPath: l,
|
|
778
|
+
startPath: l
|
|
776
779
|
});
|
|
777
|
-
if (!
|
|
778
|
-
|
|
779
|
-
} else
|
|
780
|
+
if (!e) return;
|
|
781
|
+
t.preventDefault(), I.current = l, G.next(e), K.current = e;
|
|
782
|
+
} else t.preventDefault(), I.current = null, pe.current = {
|
|
780
783
|
startLabelWidth: W.data.labelWidth,
|
|
781
|
-
startX:
|
|
784
|
+
startX: t.clientX
|
|
782
785
|
};
|
|
783
786
|
}
|
|
784
|
-
}, [W, G]),
|
|
785
|
-
let
|
|
786
|
-
if (!
|
|
787
|
-
if (
|
|
788
|
-
let
|
|
787
|
+
}, [W, G]), De = t((t) => {
|
|
788
|
+
let n = P.current, r = L.current, i = e.resolve(f).data, a = pe.current;
|
|
789
|
+
if (!r || !n) return;
|
|
790
|
+
if (a) {
|
|
791
|
+
let e = Math.min(Q, Math.max(120, a.startLabelWidth + t.clientX - a.startX));
|
|
789
792
|
W.next({
|
|
790
793
|
...W.data,
|
|
791
|
-
labelWidth:
|
|
792
|
-
}),
|
|
794
|
+
labelWidth: e
|
|
795
|
+
}), r.style.cursor = "col-resize";
|
|
793
796
|
return;
|
|
794
797
|
}
|
|
795
|
-
let
|
|
796
|
-
if (
|
|
797
|
-
let
|
|
798
|
-
if (!
|
|
799
|
-
let
|
|
800
|
-
canvas:
|
|
801
|
-
devicePixelRatio:
|
|
802
|
-
editorAssembly:
|
|
803
|
-
event:
|
|
798
|
+
let o = I.current;
|
|
799
|
+
if (o) {
|
|
800
|
+
let e = F.current;
|
|
801
|
+
if (!e) return;
|
|
802
|
+
let r = D.getPathPropertiesFromCanvas({
|
|
803
|
+
canvas: n,
|
|
804
|
+
devicePixelRatio: i,
|
|
805
|
+
editorAssembly: e,
|
|
806
|
+
event: t.nativeEvent
|
|
804
807
|
});
|
|
805
|
-
if (!
|
|
806
|
-
let
|
|
807
|
-
endPath:
|
|
808
|
-
startPath:
|
|
808
|
+
if (!r) return;
|
|
809
|
+
let a = D.getSelectionFromPathProperties({
|
|
810
|
+
endPath: r,
|
|
811
|
+
startPath: o
|
|
809
812
|
});
|
|
810
|
-
|
|
813
|
+
a && (G.next(a), K.current = a);
|
|
811
814
|
return;
|
|
812
815
|
}
|
|
813
|
-
let s =
|
|
816
|
+
let s = F.current;
|
|
814
817
|
if (!s) return;
|
|
815
|
-
let
|
|
816
|
-
canvas:
|
|
817
|
-
devicePixelRatio:
|
|
818
|
+
let c = D.getPathPropertiesFromCanvas({
|
|
819
|
+
canvas: n,
|
|
820
|
+
devicePixelRatio: i,
|
|
818
821
|
editorAssembly: s,
|
|
819
|
-
event:
|
|
822
|
+
event: t.nativeEvent
|
|
820
823
|
});
|
|
821
|
-
|
|
824
|
+
c && c.type === w.DIVIDER ? r.style.cursor = "col-resize" : r.style.cursor = "default";
|
|
822
825
|
}, [
|
|
823
826
|
W,
|
|
824
|
-
|
|
827
|
+
Q,
|
|
825
828
|
G
|
|
826
|
-
]),
|
|
827
|
-
|
|
828
|
-
}, []),
|
|
829
|
-
|
|
829
|
+
]), Oe = t(() => {
|
|
830
|
+
pe.current = null, I.current = null;
|
|
831
|
+
}, []), ke = t((e, t) => {
|
|
832
|
+
D.scrollToPosition({
|
|
830
833
|
geometry: W.data,
|
|
831
|
-
scrollContainer:
|
|
834
|
+
scrollContainer: R.current,
|
|
832
835
|
x: e,
|
|
833
836
|
y: t
|
|
834
837
|
});
|
|
835
|
-
}, [W]),
|
|
836
|
-
return /* @__PURE__ */
|
|
838
|
+
}, [W]), Ae = Math.max(1, Math.floor(z.width * ge)), je = Math.max(1, Math.floor(z.height * ge));
|
|
839
|
+
return /* @__PURE__ */ A(o, {
|
|
837
840
|
sx: {
|
|
838
841
|
display: "grid",
|
|
839
|
-
gridTemplateRows: "max-content auto",
|
|
842
|
+
gridTemplateRows: "max-content max-content auto",
|
|
840
843
|
height: "100%",
|
|
841
844
|
position: "relative",
|
|
842
845
|
width: "100%"
|
|
843
846
|
},
|
|
844
847
|
children: [
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
848
|
+
/* @__PURE__ */ k(o, {
|
|
849
|
+
sx: {
|
|
850
|
+
borderBottom: `1px solid ${Y.palette.divider}`,
|
|
851
|
+
py: .5
|
|
852
|
+
},
|
|
853
|
+
children: /* @__PURE__ */ k(ie, {})
|
|
854
|
+
}),
|
|
855
|
+
/* @__PURE__ */ A(o, {
|
|
856
|
+
sx: {
|
|
857
|
+
alignItems: "center",
|
|
858
|
+
display: "grid",
|
|
859
|
+
gap: 1,
|
|
860
|
+
gridTemplateColumns: "4fr 1fr",
|
|
861
|
+
position: "relative"
|
|
862
|
+
},
|
|
863
|
+
children: [/* @__PURE__ */ k(ae, {}), /* @__PURE__ */ k(ne, {})]
|
|
864
|
+
}),
|
|
865
|
+
/* @__PURE__ */ A(o, {
|
|
866
|
+
onMouseUp: Oe,
|
|
867
|
+
ref: L,
|
|
849
868
|
sx: {
|
|
850
869
|
height: `calc(100% - ${Y.spacing(3)})`,
|
|
851
870
|
marginBottom: Y.spacing(3),
|
|
@@ -854,11 +873,11 @@ var ae = () => {
|
|
|
854
873
|
},
|
|
855
874
|
tabIndex: 0,
|
|
856
875
|
children: [
|
|
857
|
-
/* @__PURE__ */
|
|
858
|
-
onMouseDown:
|
|
859
|
-
onMouseMove:
|
|
860
|
-
onScroll:
|
|
861
|
-
ref:
|
|
876
|
+
/* @__PURE__ */ k(o, {
|
|
877
|
+
onMouseDown: Ee,
|
|
878
|
+
onMouseMove: De,
|
|
879
|
+
onScroll: Te,
|
|
880
|
+
ref: R,
|
|
862
881
|
sx: {
|
|
863
882
|
height: "100%",
|
|
864
883
|
overflowX: "scroll",
|
|
@@ -867,28 +886,28 @@ var ae = () => {
|
|
|
867
886
|
width: "100%",
|
|
868
887
|
zIndex: 1
|
|
869
888
|
},
|
|
870
|
-
children: /* @__PURE__ */
|
|
871
|
-
ref:
|
|
889
|
+
children: /* @__PURE__ */ k(o, {
|
|
890
|
+
ref: me,
|
|
872
891
|
sx: { pointerEvents: "none" }
|
|
873
892
|
})
|
|
874
893
|
}),
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
height:
|
|
877
|
-
ref:
|
|
894
|
+
/* @__PURE__ */ k("canvas", {
|
|
895
|
+
height: je,
|
|
896
|
+
ref: P,
|
|
878
897
|
style: {
|
|
879
898
|
display: "block",
|
|
880
|
-
height: `${
|
|
899
|
+
height: `${z.height}px`,
|
|
881
900
|
imageRendering: "pixelated",
|
|
882
901
|
left: 0,
|
|
883
902
|
pointerEvents: "auto",
|
|
884
903
|
position: "absolute",
|
|
885
904
|
top: 0,
|
|
886
|
-
width: `${
|
|
905
|
+
width: `${z.width}px`,
|
|
887
906
|
zIndex: 0
|
|
888
907
|
},
|
|
889
|
-
width:
|
|
908
|
+
width: Ae
|
|
890
909
|
}),
|
|
891
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ k(o, {
|
|
892
911
|
sx: {
|
|
893
912
|
bottom: Y.spacing(-3),
|
|
894
913
|
height: Y.spacing(3),
|
|
@@ -897,19 +916,19 @@ var ae = () => {
|
|
|
897
916
|
width: "100%",
|
|
898
917
|
zIndex: 2
|
|
899
918
|
},
|
|
900
|
-
children: /* @__PURE__ */
|
|
919
|
+
children: /* @__PURE__ */ k(ce, {})
|
|
901
920
|
})
|
|
902
921
|
]
|
|
903
922
|
}),
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
onGotoPosition:
|
|
906
|
-
ref:
|
|
923
|
+
/* @__PURE__ */ k(le, {
|
|
924
|
+
onGotoPosition: ke,
|
|
925
|
+
ref: de
|
|
907
926
|
}),
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ k(re, { ref: fe }),
|
|
928
|
+
/* @__PURE__ */ k(g, { ref: ue })
|
|
910
929
|
]
|
|
911
930
|
});
|
|
912
931
|
};
|
|
913
|
-
export {
|
|
932
|
+
export { M as t };
|
|
914
933
|
|
|
915
934
|
//# sourceMappingURL=SequenceEditor.js.map
|