@rivm-loculus-tools/sequence-editor 1.6.6 → 1.7.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/EngineWorker.js +1 -1
- package/dist/_chunks/EngineWorker.js.map +1 -1
- package/dist/_chunks/SequenceEditor.js +333 -294
- package/dist/_chunks/SequenceEditor.js.map +1 -1
- package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageDrawer.js +1392 -195
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
- package/dist/_chunks/sequenceEditorStore.js +39 -24
- package/dist/_chunks/sequenceEditorStore.js.map +1 -1
- package/dist/_chunks/sequence_editor.js +146 -127
- package/dist/_chunks/sequence_editor.js.map +1 -1
- package/dist/assets/AlignerWorker-Cf4trdzm.js +8 -0
- package/dist/assets/AlignerWorker-Cf4trdzm.js.map +1 -0
- package/dist/assets/index-YCKQaSTQ.js +8 -0
- package/dist/assets/index-YCKQaSTQ.js.map +1 -0
- package/dist/assets/palette.schema.json +256 -0
- package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +6 -0
- package/dist/classes/services/EditorWorkerService/index.js +41 -1
- package/dist/classes/services/EditorWorkerService/index.js.map +1 -1
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +2 -0
- package/dist/classes/workers/AlignerWorker/AlignerWorker.d.ts +14 -0
- package/dist/classes/workers/AlignerWorker/index.d.ts +1 -0
- package/dist/classes/workers/AlignerWorker/index.js +19 -0
- package/dist/classes/workers/AlignerWorker/index.js.map +1 -0
- package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +1 -0
- package/dist/classes/workers/EngineWorker/index.js +4 -1
- package/dist/classes/workers/EngineWorker/index.js.map +1 -1
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.d.ts +17 -6
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorPicker.d.ts +10 -0
- package/dist/components/ui/SequenceEditorPageHeader/index.js +71 -53
- package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -1
- package/dist/components/ui/SequenceEditorRealignModal/SequenceEditorRealignModal.d.ts +7 -0
- package/dist/components/ui/SequenceEditorRealignModal/index.d.ts +1 -0
- package/dist/components/ui/SequenceEditorRealignModal/index.js +49 -0
- package/dist/components/ui/SequenceEditorRealignModal/index.js.map +1 -0
- package/dist/constants/index.js +4 -4
- package/dist/constants/palette.d.ts +4 -0
- package/dist/constants/palette.js +85 -42
- package/dist/constants/palette.js.map +1 -1
- package/dist/models/editor.models.d.ts +9 -5
- package/dist/models/editor.models.js.map +1 -1
- package/dist/models/palette.models.d.ts +1 -0
- package/dist/models/palette.models.js +2 -2
- package/dist/models/palette.models.js.map +1 -1
- package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +6 -0
- package/dist/utils/EditorUtil/index.js +82 -82
- package/dist/utils/PaletteUtil/PaletteUtil.d.ts +4 -0
- package/dist/utils/PaletteUtil/index.js +35 -2
- package/dist/utils/PaletteUtil/index.js.map +1 -1
- package/dist/vite/paletteSchemaPlugin/index.d.ts +1 -0
- package/dist/vite/paletteSchemaPlugin/index.js +60 -0
- package/dist/vite/paletteSchemaPlugin/index.js.map +1 -0
- package/dist/vite/paletteSchemaPlugin/paletteSchemaPlugin.d.ts +2 -0
- package/package.json +28 -14
- package/dist/assets/index-CuZIUEwe.js +0 -8
- package/dist/assets/index-CuZIUEwe.js.map +0 -1
|
@@ -5,41 +5,43 @@ import { t as i } from "./SequenceEditorEventBusService.js";
|
|
|
5
5
|
import { EDITOR_DIRECTION as a, EDITOR_PATH_PROPERTIES_TYPE as o } from "../models/editor.models.js";
|
|
6
6
|
import { KEYBOARD_SHORTCUTS as s } from "../constants/keyboard.js";
|
|
7
7
|
import "../constants/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
8
|
+
import { t as c } from "./EngineErrorUtil.js";
|
|
9
|
+
import { EditorUtil as l } from "../utils/EditorUtil/index.js";
|
|
10
|
+
import { EditorWorkerService as u } from "../classes/services/EditorWorkerService/index.js";
|
|
11
|
+
import { SequenceEditorSearchBar as d } from "../components/ui/SequenceEditorSearchBar/index.js";
|
|
12
|
+
import { SequenceEditorRealignModal as f } from "../components/ui/SequenceEditorRealignModal/index.js";
|
|
13
|
+
import { useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
14
|
+
import { Box as v, CircularProgress as y, TextField as b, darken as x, useTheme as S } from "@mui/material";
|
|
15
|
+
import { container as C } from "tsyringe";
|
|
16
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
17
|
+
import { Subject as E } from "@gen-epix/ui-core/classes/Subject";
|
|
18
|
+
import { DevicePixelRatioService as D } from "@gen-epix/ui-core/classes/services/DevicePixelRatioService";
|
|
19
|
+
import { KeyboardShortcutService as O } from "@gen-epix/ui-core/classes/services/KeyboardShortcutService";
|
|
20
|
+
import { ExportUtil as ee } from "@rivm-loculus-tools/common-frontend/utils/ExportUtil";
|
|
21
|
+
import { withDialog as k } from "@gen-epix/ui-core-components/hoc/withDialog";
|
|
20
22
|
// ../../../../node_modules/.pnpm/use-debounce@10.1.1_react@19.3.1/node_modules/use-debounce/dist/index.module.js
|
|
21
|
-
function
|
|
22
|
-
var i = this, a =
|
|
23
|
-
|
|
23
|
+
function te(e, t, n, r) {
|
|
24
|
+
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
|
+
f.current = e;
|
|
24
26
|
var y = typeof window < "u", b = !t && t !== 0 && y;
|
|
25
27
|
if (typeof e != "function") throw TypeError("Expected a function");
|
|
26
28
|
t = +t || 0;
|
|
27
|
-
var x = !!(n ||= {}).leading, S = !("trailing" in n) || !!n.trailing, C = !!n.flushOnExit && S, w = "maxWait" in n, T = "debounceOnServer" in n && !!n.debounceOnServer, E = w ? Math.max(+n.maxWait || 0, t) : null, D =
|
|
29
|
+
var x = !!(n ||= {}).leading, S = !("trailing" in n) || !!n.trailing, C = !!n.flushOnExit && S, w = "maxWait" in n, T = "debounceOnServer" in n && !!n.debounceOnServer, E = w ? Math.max(+n.maxWait || 0, t) : null, D = h(function() {
|
|
28
30
|
var e = function(e) {
|
|
29
31
|
var t = l.current, n = u.current;
|
|
30
|
-
return l.current = u.current = null, o.current = e, s.current = s.current || e, d.current =
|
|
32
|
+
return l.current = u.current = null, o.current = e, s.current = s.current || e, d.current = f.current.apply(n, t);
|
|
31
33
|
}, n = function(e, t) {
|
|
32
34
|
b && cancelAnimationFrame(c.current), c.current = b ? requestAnimationFrame(e) : setTimeout(e, t);
|
|
33
|
-
},
|
|
34
|
-
if (!
|
|
35
|
+
}, m = function(e) {
|
|
36
|
+
if (!p.current) return !1;
|
|
35
37
|
var n = e - a.current;
|
|
36
38
|
return !a.current || n >= t || n < 0 || w && e - o.current >= E;
|
|
37
|
-
},
|
|
39
|
+
}, h = function(t) {
|
|
38
40
|
return c.current = null, S && l.current ? e(t) : (l.current = u.current = null, d.current);
|
|
39
|
-
},
|
|
41
|
+
}, g = function e() {
|
|
40
42
|
var r = Date.now();
|
|
41
|
-
if (x && s.current === o.current && D(),
|
|
42
|
-
if (
|
|
43
|
+
if (x && s.current === o.current && D(), m(r)) return h(r);
|
|
44
|
+
if (p.current) {
|
|
43
45
|
var i = t - (r - a.current);
|
|
44
46
|
n(e, w ? Math.min(i, E - (r - o.current)) : i);
|
|
45
47
|
}
|
|
@@ -47,14 +49,14 @@ function O(e, t, n, r) {
|
|
|
47
49
|
r && r({});
|
|
48
50
|
}, O = function() {
|
|
49
51
|
if (y || T) {
|
|
50
|
-
var r, s = Date.now(),
|
|
52
|
+
var r, s = Date.now(), f = m(s);
|
|
51
53
|
if (l.current = [].slice.call(arguments), u.current = i, a.current = s, C && !_.current && (_.current = function() {
|
|
52
54
|
globalThis.document?.visibilityState === "hidden" && v.current.flush();
|
|
53
|
-
}, (r = globalThis.document) == null || r.addEventListener == null || r.addEventListener("visibilitychange", _.current)),
|
|
54
|
-
if (!c.current &&
|
|
55
|
-
if (w) return n(
|
|
55
|
+
}, (r = globalThis.document) == null || r.addEventListener == null || r.addEventListener("visibilitychange", _.current)), f) {
|
|
56
|
+
if (!c.current && p.current) return o.current = a.current, n(g, t), x ? e(a.current) : d.current;
|
|
57
|
+
if (w) return n(g, t), e(a.current);
|
|
56
58
|
}
|
|
57
|
-
return c.current || n(
|
|
59
|
+
return c.current || n(g, t), d.current;
|
|
58
60
|
}
|
|
59
61
|
};
|
|
60
62
|
return O.cancel = function() {
|
|
@@ -63,7 +65,7 @@ function O(e, t, n, r) {
|
|
|
63
65
|
}, O.isPending = function() {
|
|
64
66
|
return !!c.current;
|
|
65
67
|
}, O.flush = function() {
|
|
66
|
-
return c.current ?
|
|
68
|
+
return c.current ? h(Date.now()) : d.current;
|
|
67
69
|
}, O;
|
|
68
70
|
}, [
|
|
69
71
|
x,
|
|
@@ -77,29 +79,29 @@ function O(e, t, n, r) {
|
|
|
77
79
|
T,
|
|
78
80
|
r
|
|
79
81
|
]);
|
|
80
|
-
return v.current = D,
|
|
81
|
-
return
|
|
82
|
+
return v.current = D, m(function() {
|
|
83
|
+
return p.current = !0, function() {
|
|
82
84
|
var e;
|
|
83
|
-
C && v.current.flush(), _.current &&= ((e = globalThis.document) == null || e.removeEventListener == null || e.removeEventListener("visibilitychange", _.current), null),
|
|
85
|
+
C && v.current.flush(), _.current &&= ((e = globalThis.document) == null || e.removeEventListener == null || e.removeEventListener("visibilitychange", _.current), null), p.current = !1;
|
|
84
86
|
};
|
|
85
87
|
}, [C]), D;
|
|
86
88
|
}
|
|
87
89
|
// src/components/ui/SequenceEditor/SequenceEditorStatusBar.tsx
|
|
88
|
-
var
|
|
89
|
-
let n =
|
|
90
|
-
return /* @__PURE__ */
|
|
90
|
+
var ne = () => {
|
|
91
|
+
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
|
+
return /* @__PURE__ */ w(v, {
|
|
91
93
|
sx: {
|
|
92
|
-
backgroundColor:
|
|
93
|
-
borderTop: `1px solid ${
|
|
94
|
+
backgroundColor: x(n.palette.background.paper, .1),
|
|
95
|
+
borderTop: `1px solid ${x(n.palette.background.paper, .2)}`,
|
|
94
96
|
fontSize: n.typography.caption,
|
|
95
97
|
height: "100%",
|
|
96
98
|
width: "100%"
|
|
97
99
|
},
|
|
98
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ T(v, {
|
|
99
101
|
sx: {
|
|
100
102
|
"& > div": {
|
|
101
103
|
alignItems: "center",
|
|
102
|
-
borderLeft: `1px solid ${
|
|
104
|
+
borderLeft: `1px solid ${x(n.palette.background.paper, .2)}`,
|
|
103
105
|
display: "flex",
|
|
104
106
|
paddingLeft: n.spacing(1)
|
|
105
107
|
},
|
|
@@ -111,23 +113,33 @@ var ee = () => {
|
|
|
111
113
|
paddingRight: n.spacing(1)
|
|
112
114
|
},
|
|
113
115
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
/* @__PURE__ */ T(v, {
|
|
117
|
+
sx: {
|
|
118
|
+
alignItems: "center",
|
|
119
|
+
display: "flex",
|
|
120
|
+
gap: 1
|
|
121
|
+
},
|
|
122
|
+
children: [r && /* @__PURE__ */ w(y, {
|
|
123
|
+
color: "inherit",
|
|
124
|
+
size: 12
|
|
125
|
+
}), i ?? ""]
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ w(v, { children: `Pos: ${s.pos}` }),
|
|
128
|
+
/* @__PURE__ */ w(v, { children: `Selected seqs: ${s.selectedSeqs}` }),
|
|
129
|
+
/* @__PURE__ */ w(v, { children: `Cols: ${s.cols}` }),
|
|
130
|
+
/* @__PURE__ */ w(v, { children: `Total selected chars: ${s.totalSelectedChars}` }),
|
|
131
|
+
/* @__PURE__ */ w(v, { children: `Alignment: ${a?.sequenceCount ?? "0"} sequences, ${a?.alignmentWidth ?? "0"} positions` })
|
|
120
132
|
]
|
|
121
133
|
})
|
|
122
134
|
});
|
|
123
|
-
},
|
|
124
|
-
let [r, i] =
|
|
125
|
-
|
|
135
|
+
}, A = /^(?:\d+|,\d+|\d+,\d+)$/, re = k(({ onActionsChange: e, onClose: t, onGotoPosition: n }) => {
|
|
136
|
+
let [r, i] = _(""), a = g(null), o = r === "" || A.test(r);
|
|
137
|
+
m(() => {
|
|
126
138
|
a.current?.focus();
|
|
127
139
|
}, []);
|
|
128
|
-
let s =
|
|
140
|
+
let s = p((e) => {
|
|
129
141
|
i(e.target.value);
|
|
130
|
-
}, []), c =
|
|
142
|
+
}, []), c = p(() => {
|
|
131
143
|
if (!o) return;
|
|
132
144
|
let [e, i] = r.split(",");
|
|
133
145
|
n(e ? Number(e) : null, i ? Number(i) : null), t?.();
|
|
@@ -136,10 +148,10 @@ var ee = () => {
|
|
|
136
148
|
t,
|
|
137
149
|
n,
|
|
138
150
|
r
|
|
139
|
-
]), l =
|
|
151
|
+
]), l = p((e) => {
|
|
140
152
|
e.key === "Enter" && (e.preventDefault(), c());
|
|
141
153
|
}, [c]);
|
|
142
|
-
return
|
|
154
|
+
return m(() => {
|
|
143
155
|
let n = [];
|
|
144
156
|
n.push({
|
|
145
157
|
color: "secondary",
|
|
@@ -158,7 +170,7 @@ var ee = () => {
|
|
|
158
170
|
e,
|
|
159
171
|
t,
|
|
160
172
|
c
|
|
161
|
-
]), /* @__PURE__ */
|
|
173
|
+
]), /* @__PURE__ */ w(b, {
|
|
162
174
|
error: !o,
|
|
163
175
|
fullWidth: !0,
|
|
164
176
|
helperText: "Use x, ,y, or x,y.",
|
|
@@ -174,25 +186,29 @@ var ee = () => {
|
|
|
174
186
|
fullWidth: !0,
|
|
175
187
|
maxWidth: "xs",
|
|
176
188
|
testId: "SequenceEditorGotoPositionDialog"
|
|
177
|
-
}),
|
|
178
|
-
let
|
|
189
|
+
}), j = () => {
|
|
190
|
+
let y = t(e, (e) => e.isRealigning), b = t(e, (e) => e.rawFasta), x = t(e, (e) => e.setIsRealigning), k = t(e, (e) => e.setLatestMessage), A = t(e, (e) => e.setMeta), j = t(e, (e) => e.setSelection), ie = g(null), ae = g(null), M = h(() => C.resolve(u), []), N = g(null), P = g(null), oe = g(null), F = g(null), I = g(null), L = g(null), [R, se] = _({
|
|
179
191
|
height: 0,
|
|
180
192
|
width: 0
|
|
181
|
-
}), [
|
|
193
|
+
}), [ce, le] = _(() => C.resolve(D).data), [ue, de] = _(0), [fe, pe] = _(0), z = h(() => new E({
|
|
182
194
|
scrollLeft: 0,
|
|
183
195
|
scrollTop: 0
|
|
184
|
-
}), []),
|
|
185
|
-
|
|
196
|
+
}), []), me = g(R), 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), he = g(!1), Y = S();
|
|
197
|
+
m(() => {
|
|
198
|
+
y ? ae.current?.open() : ae.current?.close();
|
|
199
|
+
}, [y]);
|
|
200
|
+
let X = p(() => {
|
|
201
|
+
let e = W.data, t = B.data;
|
|
186
202
|
if (!e || !t) return;
|
|
187
203
|
let n = e.labelWidth + e.cellWidth + t.alignmentWidth * e.cellWidth, r = e.rulerHeight + t.sequenceCount * e.cellHeight;
|
|
188
|
-
|
|
189
|
-
}, [
|
|
190
|
-
let e = await
|
|
191
|
-
return
|
|
192
|
-
}, [
|
|
193
|
-
let e =
|
|
204
|
+
pe(n), de(r);
|
|
205
|
+
}, [W, B]), Z = p(async () => {
|
|
206
|
+
let e = await C.resolve(u).getMetaData();
|
|
207
|
+
return B.next(e), e;
|
|
208
|
+
}, [B]), Q = p(() => {
|
|
209
|
+
let e = W.data, t = B.data;
|
|
194
210
|
if (!t || !e) return;
|
|
195
|
-
let { scrollLeft: n, scrollTop: r } =
|
|
211
|
+
let { scrollLeft: n, scrollTop: r } = z.data, { height: i, width: a } = me.current, o = l.getVisibleGridRange({
|
|
196
212
|
geometry: e,
|
|
197
213
|
numCols: t.alignmentWidth,
|
|
198
214
|
numRows: t.sequenceCount,
|
|
@@ -201,7 +217,7 @@ var ee = () => {
|
|
|
201
217
|
viewportHeight: i,
|
|
202
218
|
viewportWidth: a
|
|
203
219
|
});
|
|
204
|
-
|
|
220
|
+
V.next({
|
|
205
221
|
geometry: e,
|
|
206
222
|
scrollLeft: n,
|
|
207
223
|
scrollTop: r,
|
|
@@ -210,188 +226,188 @@ var ee = () => {
|
|
|
210
226
|
visibleGridRange: o
|
|
211
227
|
});
|
|
212
228
|
}, [
|
|
213
|
-
|
|
229
|
+
W,
|
|
230
|
+
B,
|
|
214
231
|
z,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
re({
|
|
232
|
+
V
|
|
233
|
+
]), ge = te((e, t) => {
|
|
234
|
+
se({
|
|
219
235
|
height: t,
|
|
220
236
|
width: e
|
|
221
237
|
});
|
|
222
238
|
}, 0, { trailing: !0 });
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}, [
|
|
226
|
-
let $ =
|
|
227
|
-
|
|
228
|
-
let e = [
|
|
229
|
-
|
|
230
|
-
}),
|
|
231
|
-
|
|
239
|
+
m(() => {
|
|
240
|
+
me.current = R, Q();
|
|
241
|
+
}, [R, Q]);
|
|
242
|
+
let $ = R.width > 0 ? R.width / 2 : 120;
|
|
243
|
+
m(() => {
|
|
244
|
+
let e = [B.subscribe((e) => {
|
|
245
|
+
A(e);
|
|
246
|
+
}), G.subscribe((e) => {
|
|
247
|
+
j(e);
|
|
232
248
|
})];
|
|
233
249
|
return () => {
|
|
234
|
-
e.forEach((e) => e()),
|
|
250
|
+
e.forEach((e) => e()), k(null), A(null), j(null);
|
|
235
251
|
};
|
|
236
252
|
}, [
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
]),
|
|
243
|
-
if (
|
|
244
|
-
let e =
|
|
245
|
-
e.labelWidth > $ &&
|
|
253
|
+
B,
|
|
254
|
+
G,
|
|
255
|
+
k,
|
|
256
|
+
A,
|
|
257
|
+
j
|
|
258
|
+
]), m(() => {
|
|
259
|
+
if (R.width <= 0) return;
|
|
260
|
+
let e = W.data;
|
|
261
|
+
e.labelWidth > $ && W.next({
|
|
246
262
|
...e,
|
|
247
263
|
labelWidth: $
|
|
248
264
|
});
|
|
249
265
|
}, [
|
|
250
|
-
|
|
251
|
-
|
|
266
|
+
R.width,
|
|
267
|
+
W,
|
|
252
268
|
$
|
|
253
|
-
]),
|
|
254
|
-
let e =
|
|
269
|
+
]), m(() => {
|
|
270
|
+
let e = L.current;
|
|
255
271
|
if (!e) return;
|
|
256
272
|
let t = new ResizeObserver(([e]) => {
|
|
257
273
|
if (!e) return;
|
|
258
274
|
let t = Math.max(1, e.contentRect.height), n = Math.max(1, e.contentRect.width);
|
|
259
|
-
|
|
275
|
+
ge(n, t);
|
|
260
276
|
});
|
|
261
277
|
return t.observe(e), () => t.disconnect();
|
|
262
|
-
}, [
|
|
278
|
+
}, [M, ge]), m(() => {
|
|
263
279
|
(async () => {
|
|
264
|
-
|
|
280
|
+
H.current = null, U.current = null, z.next({
|
|
265
281
|
scrollLeft: 0,
|
|
266
282
|
scrollTop: 0
|
|
267
|
-
}),
|
|
283
|
+
}), G.next(null), await M.initialize(), await M.loadFasta(b), await Z(), Q();
|
|
268
284
|
})().catch((e) => {
|
|
269
285
|
console.error(e);
|
|
270
286
|
});
|
|
271
287
|
}, [
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
288
|
+
M,
|
|
289
|
+
b,
|
|
290
|
+
z,
|
|
291
|
+
G,
|
|
276
292
|
Z,
|
|
277
293
|
Q
|
|
278
|
-
]),
|
|
294
|
+
]), m(() => {
|
|
279
295
|
let t = null, n = !0, r = null, i = null, a = async () => {
|
|
280
|
-
if (n && !
|
|
281
|
-
|
|
296
|
+
if (n && !he.current) {
|
|
297
|
+
he.current = !0;
|
|
282
298
|
try {
|
|
283
|
-
for (; n &&
|
|
284
|
-
let a =
|
|
285
|
-
|
|
286
|
-
let o =
|
|
287
|
-
if (!
|
|
288
|
-
cachedGridRange:
|
|
299
|
+
for (; n && J.current;) {
|
|
300
|
+
let a = J.current;
|
|
301
|
+
J.current = null;
|
|
302
|
+
let o = q.current;
|
|
303
|
+
if (!U.current || !l.isWithinGridRange({
|
|
304
|
+
cachedGridRange: U.current.range,
|
|
289
305
|
visibleGridRange: a.visibleGridRange.visible
|
|
290
306
|
})) {
|
|
291
307
|
let e = [];
|
|
292
|
-
for (let t = a.visibleGridRange.cache.startRow; t <= a.visibleGridRange.cache.endRow; t++) e.push(await
|
|
308
|
+
for (let t = a.visibleGridRange.cache.startRow; t <= a.visibleGridRange.cache.endRow; t++) e.push(await M.name(t));
|
|
293
309
|
if (!n) return;
|
|
294
|
-
|
|
310
|
+
U.current = {
|
|
295
311
|
range: a.visibleGridRange.cache,
|
|
296
312
|
rowNames: e
|
|
297
313
|
};
|
|
298
314
|
}
|
|
299
|
-
if (!
|
|
300
|
-
cachedGridRange:
|
|
315
|
+
if (!H.current || !l.isWithinGridRange({
|
|
316
|
+
cachedGridRange: H.current.range,
|
|
301
317
|
visibleGridRange: a.visibleGridRange.visible
|
|
302
318
|
})) {
|
|
303
|
-
let e = await
|
|
319
|
+
let e = await C.resolve(u).viewport({
|
|
304
320
|
endCol: a.visibleGridRange.cache.endCol,
|
|
305
321
|
endRow: a.visibleGridRange.cache.endRow,
|
|
306
322
|
startCol: a.visibleGridRange.cache.startCol,
|
|
307
323
|
startRow: a.visibleGridRange.cache.startRow
|
|
308
324
|
});
|
|
309
325
|
if (!n) return;
|
|
310
|
-
|
|
326
|
+
H.current = {
|
|
311
327
|
range: a.visibleGridRange.cache,
|
|
312
328
|
viewportResult: e
|
|
313
329
|
};
|
|
314
330
|
}
|
|
315
|
-
o ===
|
|
316
|
-
n && o ===
|
|
317
|
-
canvasElement:
|
|
318
|
-
devicePixelRatio:
|
|
331
|
+
o === q.current && (t !== null && cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
332
|
+
n && o === q.current && N.current && e.getState().nucleotidePalette && H.current && B.data && U.current && (P.current = l.drawCanvas({
|
|
333
|
+
canvasElement: N.current,
|
|
334
|
+
devicePixelRatio: C.resolve(D).data,
|
|
319
335
|
geometry: a.geometry,
|
|
320
|
-
meta:
|
|
336
|
+
meta: B.data,
|
|
321
337
|
palette: e.getState().nucleotidePalette,
|
|
322
|
-
rowNames:
|
|
323
|
-
rowNamesStartRow:
|
|
338
|
+
rowNames: U.current.rowNames,
|
|
339
|
+
rowNamesStartRow: U.current.range.startRow,
|
|
324
340
|
scrollLeft: a.scrollLeft,
|
|
325
341
|
scrollTop: a.scrollTop,
|
|
326
342
|
searchResult: r,
|
|
327
343
|
searchResultHighlightedIndex: i,
|
|
328
|
-
selection:
|
|
329
|
-
viewport:
|
|
344
|
+
selection: G.data,
|
|
345
|
+
viewport: H.current.viewportResult,
|
|
330
346
|
viewportHeight: a.viewportHeight,
|
|
331
347
|
viewportWidth: a.viewportWidth
|
|
332
348
|
}));
|
|
333
349
|
}));
|
|
334
350
|
}
|
|
335
351
|
} finally {
|
|
336
|
-
|
|
352
|
+
he.current = !1, n && J.current && a();
|
|
337
353
|
}
|
|
338
354
|
}
|
|
339
355
|
}, o = [e.subscribe((e, t) => {
|
|
340
356
|
let n = !1;
|
|
341
|
-
e.searchResult !== t.searchResult && (r = e.searchResult, n = !0), e.searchResultHighlightedIndex !== t.searchResultHighlightedIndex && (i = e.searchResultHighlightedIndex,
|
|
342
|
-
geometry:
|
|
343
|
-
scrollContainer:
|
|
357
|
+
e.searchResult !== t.searchResult && (r = e.searchResult, n = !0), e.searchResultHighlightedIndex !== t.searchResultHighlightedIndex && (i = e.searchResultHighlightedIndex, l.scrollToSearchResult({
|
|
358
|
+
geometry: W.data,
|
|
359
|
+
scrollContainer: L.current,
|
|
344
360
|
searchResult: e.searchResult,
|
|
345
361
|
searchResultHighlightedIndex: e.searchResultHighlightedIndex
|
|
346
362
|
}), n = !0), n && Q();
|
|
347
|
-
}),
|
|
348
|
-
e && (
|
|
363
|
+
}), V.subscribe((e) => {
|
|
364
|
+
e && (J.current = e, q.current += 1, a());
|
|
349
365
|
})];
|
|
350
366
|
return () => {
|
|
351
|
-
n = !1,
|
|
367
|
+
n = !1, J.current = null, t !== null && cancelAnimationFrame(t), q.current += 1, o.forEach((e) => e());
|
|
352
368
|
};
|
|
353
369
|
}, [
|
|
354
|
-
|
|
355
|
-
U,
|
|
356
|
-
z,
|
|
370
|
+
M,
|
|
357
371
|
W,
|
|
372
|
+
B,
|
|
373
|
+
G,
|
|
358
374
|
Q,
|
|
359
|
-
|
|
360
|
-
]),
|
|
375
|
+
V
|
|
376
|
+
]), m(() => {
|
|
361
377
|
let t = [
|
|
362
378
|
e.subscribe((e, t) => {
|
|
363
|
-
e.nucleotidePalette
|
|
379
|
+
e.nucleotidePalette !== t.nucleotidePalette && Q();
|
|
364
380
|
}),
|
|
365
|
-
|
|
381
|
+
W.subscribe(() => {
|
|
366
382
|
X(), Q();
|
|
367
383
|
}),
|
|
368
|
-
|
|
369
|
-
|
|
384
|
+
z.subscribe(() => Q()),
|
|
385
|
+
B.subscribe((e) => {
|
|
370
386
|
e && (X(), Q());
|
|
371
387
|
}),
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
388
|
+
G.subscribe(() => Q()),
|
|
389
|
+
C.resolve(D).subscribe((e) => {
|
|
390
|
+
le(e), X(), Q();
|
|
375
391
|
})
|
|
376
392
|
];
|
|
377
393
|
return () => {
|
|
378
394
|
t.forEach((e) => e());
|
|
379
395
|
};
|
|
380
396
|
}, [
|
|
381
|
-
|
|
382
|
-
U,
|
|
383
|
-
z,
|
|
384
|
-
R,
|
|
397
|
+
M,
|
|
385
398
|
W,
|
|
399
|
+
B,
|
|
400
|
+
z,
|
|
401
|
+
G,
|
|
386
402
|
X,
|
|
387
403
|
Q
|
|
388
|
-
]),
|
|
404
|
+
]), m(() => {
|
|
389
405
|
let e = (e) => {
|
|
390
406
|
let t = e.key.toUpperCase();
|
|
391
|
-
r.has(t) && (e.preventDefault(),
|
|
392
|
-
}, t = (e) =>
|
|
407
|
+
r.has(t) && (e.preventDefault(), C.resolve(i).emit("onMutateSelection", t));
|
|
408
|
+
}, t = (e) => C.resolve(O).registerShortcut({
|
|
393
409
|
callback: e.callback,
|
|
394
|
-
element:
|
|
410
|
+
element: I.current,
|
|
395
411
|
...e.shortcut
|
|
396
412
|
}), n = [
|
|
397
413
|
t(s.expandSelectionLeft),
|
|
@@ -419,265 +435,287 @@ var ee = () => {
|
|
|
419
435
|
t(s.undo),
|
|
420
436
|
t(s.redo),
|
|
421
437
|
t(s.gotoPosition),
|
|
422
|
-
|
|
438
|
+
C.resolve(O).registerShortcut({
|
|
423
439
|
callback: e,
|
|
424
|
-
element:
|
|
440
|
+
element: I.current
|
|
425
441
|
}),
|
|
426
|
-
|
|
442
|
+
C.resolve(O).registerShortcut({
|
|
427
443
|
callback: e,
|
|
428
|
-
element:
|
|
444
|
+
element: I.current,
|
|
429
445
|
modifiers: [["Shift"]]
|
|
430
446
|
})
|
|
431
447
|
];
|
|
432
448
|
return () => {
|
|
433
449
|
n.forEach((e) => e());
|
|
434
450
|
};
|
|
435
|
-
}, []),
|
|
451
|
+
}, []), m(() => {
|
|
436
452
|
let t = async (e) => {
|
|
437
453
|
let { command: t, getSelectionPostCommand: n } = e;
|
|
438
454
|
try {
|
|
439
|
-
let e =
|
|
440
|
-
await t(),
|
|
455
|
+
let e = B.data?.undoDepth;
|
|
456
|
+
await t(), H.current = null, U.current = null;
|
|
441
457
|
let r = await Z();
|
|
442
458
|
if (Q(), n) {
|
|
443
459
|
if (e !== void 0 && r?.undoDepth === e) return;
|
|
444
460
|
let t = n();
|
|
445
|
-
|
|
461
|
+
G.next(t), K.current = t;
|
|
446
462
|
}
|
|
447
463
|
} catch (e) {
|
|
448
464
|
console.error("Failed to post command:", e);
|
|
449
465
|
}
|
|
450
466
|
}, n = async (e) => {
|
|
451
|
-
if (!
|
|
452
|
-
let n =
|
|
467
|
+
if (!B.data) return;
|
|
468
|
+
let n = l.getMutateArguments(G.data, B.data);
|
|
453
469
|
n && await t({ command: async () => {
|
|
454
|
-
await
|
|
470
|
+
await M.mutate(n.rows, n.columns, e);
|
|
455
471
|
} });
|
|
456
472
|
}, r = (e) => {
|
|
457
|
-
if (!
|
|
458
|
-
let t =
|
|
473
|
+
if (!B.data) return;
|
|
474
|
+
let t = l.getMovedSelection(G.data, e, B.data);
|
|
459
475
|
if (t) {
|
|
460
|
-
if (
|
|
461
|
-
let t =
|
|
462
|
-
|
|
463
|
-
} else
|
|
476
|
+
if (G.next(t), K.current) {
|
|
477
|
+
let t = l.getMovedSelection(K.current, e, B.data);
|
|
478
|
+
K.current = t;
|
|
479
|
+
} else K.current = t;
|
|
464
480
|
}
|
|
465
481
|
}, o = (e) => {
|
|
466
|
-
if (!
|
|
467
|
-
let t =
|
|
468
|
-
t &&
|
|
482
|
+
if (!B.data || !K.current || !G.data) return;
|
|
483
|
+
let t = l.getExpandedSelection(G.data, K.current, e, B.data);
|
|
484
|
+
t && G.next(t);
|
|
469
485
|
}, s = async (e) => {
|
|
470
|
-
if (!
|
|
471
|
-
let n =
|
|
486
|
+
if (!B.data) return;
|
|
487
|
+
let n = l.getRowsToMove(G.data, e, B.data);
|
|
472
488
|
n && await t({
|
|
473
489
|
command: async () => {
|
|
474
|
-
e === a.UP ? (await
|
|
490
|
+
e === a.UP ? (await M.moveRowsToTop(n), L.current && (L.current.scrollTop = 0)) : (await M.moveRowsToBottom(n), L.current && (L.current.scrollTop = L.current.scrollHeight - L.current.clientHeight));
|
|
475
491
|
},
|
|
476
|
-
getSelectionPostCommand: () =>
|
|
492
|
+
getSelectionPostCommand: () => l.getMovedRowsEndSelection(G.data, e, B.data)
|
|
477
493
|
});
|
|
478
|
-
},
|
|
479
|
-
if (!
|
|
480
|
-
let n =
|
|
494
|
+
}, u = async (e) => {
|
|
495
|
+
if (!B.data) return;
|
|
496
|
+
let n = l.getRowsToMove(G.data, e, B.data);
|
|
481
497
|
n && await t({
|
|
482
498
|
command: async () => {
|
|
483
|
-
e === a.UP ? await
|
|
499
|
+
e === a.UP ? await M.moveRowsUp(n) : await M.moveRowsDown(n);
|
|
484
500
|
},
|
|
485
|
-
getSelectionPostCommand: () =>
|
|
501
|
+
getSelectionPostCommand: () => l.getMovedRowsRelativeSelection(G.data, e, B.data)
|
|
486
502
|
});
|
|
487
|
-
},
|
|
488
|
-
if (!
|
|
489
|
-
let n =
|
|
503
|
+
}, d = async (e) => {
|
|
504
|
+
if (!B.data || e !== a.LEFT && e !== a.RIGHT || !G.data?.cells && (!G.data?.cols || G.data.cols.length === 0)) return;
|
|
505
|
+
let n = l.getMutateArguments(G.data, B.data);
|
|
490
506
|
n && n.columns.length !== 0 && n.rows.length !== 0 && await t({
|
|
491
507
|
command: async () => {
|
|
492
|
-
await
|
|
508
|
+
await M.moveHorizontal(n.rows, n.columns, e);
|
|
493
509
|
},
|
|
494
|
-
getSelectionPostCommand: () =>
|
|
510
|
+
getSelectionPostCommand: () => l.getPostUpsertSelection(G.data, e)
|
|
495
511
|
});
|
|
496
|
-
},
|
|
497
|
-
|
|
512
|
+
}, f = C.resolve(i), p = [
|
|
513
|
+
f.addEventListener("onSearch", async (t) => {
|
|
498
514
|
if (!t) return;
|
|
499
|
-
let n = await
|
|
515
|
+
let n = await M.search(t, !0);
|
|
500
516
|
e.getState().setSearchResult(n);
|
|
501
517
|
}),
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
518
|
+
f.addEventListener("onExpandSelection", (e) => o(e)),
|
|
519
|
+
f.addEventListener("onGotoPosition", () => ie.current?.open({})),
|
|
520
|
+
f.addEventListener("onMoveSelection", (e) => r(e)),
|
|
521
|
+
f.addEventListener("onMoveRows", (e) => {
|
|
522
|
+
u(e);
|
|
507
523
|
}),
|
|
508
|
-
|
|
524
|
+
f.addEventListener("onMoveRowsEnd", (e) => {
|
|
509
525
|
s(e);
|
|
510
526
|
}),
|
|
511
|
-
|
|
512
|
-
|
|
527
|
+
f.addEventListener("onMoveCells", (e) => {
|
|
528
|
+
d(e);
|
|
513
529
|
}),
|
|
514
|
-
|
|
515
|
-
let e =
|
|
530
|
+
f.addEventListener("onScrollToLineStart", () => {
|
|
531
|
+
let e = L.current;
|
|
516
532
|
e && (e.scrollLeft = 0);
|
|
517
533
|
}),
|
|
518
|
-
|
|
519
|
-
let e =
|
|
534
|
+
f.addEventListener("onScrollToLineEnd", () => {
|
|
535
|
+
let e = L.current;
|
|
520
536
|
e && (e.scrollLeft = e.scrollWidth - e.clientWidth);
|
|
521
537
|
}),
|
|
522
|
-
|
|
523
|
-
let e =
|
|
538
|
+
f.addEventListener("onScrollPageUp", () => {
|
|
539
|
+
let e = L.current;
|
|
524
540
|
e && (e.scrollTop = Math.max(0, e.scrollTop - e.clientHeight));
|
|
525
541
|
}),
|
|
526
|
-
|
|
527
|
-
let e =
|
|
542
|
+
f.addEventListener("onScrollPageDown", () => {
|
|
543
|
+
let e = L.current;
|
|
528
544
|
e && (e.scrollTop = Math.min(e.scrollHeight - e.clientHeight, e.scrollTop + e.clientHeight));
|
|
529
545
|
}),
|
|
530
|
-
|
|
546
|
+
f.addEventListener("onInsert", () => {
|
|
531
547
|
(async () => {
|
|
532
|
-
if (!
|
|
533
|
-
let e =
|
|
548
|
+
if (!B.data) return;
|
|
549
|
+
let e = l.getUpsertArguments(G.data, B.data);
|
|
534
550
|
e && await t({
|
|
535
|
-
command: async () =>
|
|
536
|
-
getSelectionPostCommand: () =>
|
|
551
|
+
command: async () => M.insert(e.rows, e.col),
|
|
552
|
+
getSelectionPostCommand: () => l.getPostUpsertSelection(G.data, a.RIGHT)
|
|
537
553
|
});
|
|
538
554
|
})();
|
|
539
555
|
}),
|
|
540
|
-
|
|
556
|
+
f.addEventListener("onDeleteBackward", () => {
|
|
541
557
|
(async () => {
|
|
542
|
-
if (!
|
|
543
|
-
let e =
|
|
558
|
+
if (!B.data) return;
|
|
559
|
+
let e = l.getUpsertArguments(G.data, B.data, -1);
|
|
544
560
|
e && await t({
|
|
545
|
-
command: async () =>
|
|
546
|
-
getSelectionPostCommand: () =>
|
|
561
|
+
command: async () => M.delete(e.rows, e.col),
|
|
562
|
+
getSelectionPostCommand: () => l.getPostUpsertSelection(G.data, a.LEFT)
|
|
547
563
|
});
|
|
548
564
|
})();
|
|
549
565
|
}),
|
|
550
|
-
|
|
566
|
+
f.addEventListener("onMutateSelection", (e) => {
|
|
551
567
|
n(e);
|
|
552
568
|
}),
|
|
553
|
-
|
|
569
|
+
f.addEventListener("onUndo", () => {
|
|
554
570
|
t({
|
|
555
|
-
command: async () =>
|
|
571
|
+
command: async () => M.undo(),
|
|
556
572
|
getSelectionPostCommand: () => null
|
|
557
573
|
});
|
|
558
574
|
}),
|
|
559
|
-
|
|
575
|
+
f.addEventListener("onCancelRealign", () => {
|
|
576
|
+
M.cancelRealign();
|
|
577
|
+
}),
|
|
578
|
+
f.addEventListener("onRealign", () => {
|
|
579
|
+
e.getState().setIsRealigning(!0);
|
|
580
|
+
let n = !1;
|
|
560
581
|
t({
|
|
561
|
-
command: async () =>
|
|
582
|
+
command: async () => {
|
|
583
|
+
try {
|
|
584
|
+
await M.realign();
|
|
585
|
+
} catch (t) {
|
|
586
|
+
if (t instanceof DOMException && t.name === "AbortError") n = !0;
|
|
587
|
+
else throw e.getState().setLatestMessage(c.getEngineErrorMessage(t)), t;
|
|
588
|
+
} finally {
|
|
589
|
+
e.getState().setIsRealigning(!1);
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
getSelectionPostCommand: () => n ? G.data : null
|
|
593
|
+
});
|
|
594
|
+
}),
|
|
595
|
+
f.addEventListener("onRedo", () => {
|
|
596
|
+
t({
|
|
597
|
+
command: async () => M.redo(),
|
|
562
598
|
getSelectionPostCommand: () => null
|
|
563
599
|
});
|
|
564
600
|
}),
|
|
565
|
-
|
|
601
|
+
f.addEventListener("onExportGappedFasta", async () => {
|
|
566
602
|
console.log("Exporting gapped fasta");
|
|
567
|
-
let e = await
|
|
568
|
-
|
|
603
|
+
let e = await M.exportGappedFasta();
|
|
604
|
+
ee.downloadFastaFile(e, "sequence.gapped.fasta");
|
|
569
605
|
}),
|
|
570
|
-
|
|
606
|
+
f.addEventListener("onExportUngappedFasta", async () => {
|
|
571
607
|
console.log("Exporting ungapped fasta");
|
|
572
|
-
let e = await
|
|
573
|
-
|
|
608
|
+
let e = await M.exportUngappedFasta();
|
|
609
|
+
ee.downloadFastaFile(e, "sequence.ungapped.fasta");
|
|
574
610
|
})
|
|
575
611
|
];
|
|
576
612
|
return () => {
|
|
577
|
-
|
|
613
|
+
p.forEach((e) => e()), M.cancelRealign();
|
|
578
614
|
};
|
|
579
615
|
}, [
|
|
580
|
-
|
|
581
|
-
|
|
616
|
+
M,
|
|
617
|
+
G,
|
|
582
618
|
Z,
|
|
583
619
|
Q,
|
|
584
|
-
|
|
585
|
-
|
|
620
|
+
B,
|
|
621
|
+
x,
|
|
622
|
+
k
|
|
623
|
+
]), m(() => {
|
|
586
624
|
Q();
|
|
587
625
|
}, [Q]);
|
|
588
|
-
let
|
|
626
|
+
let _e = p((e) => {
|
|
589
627
|
let t = e.currentTarget;
|
|
590
|
-
|
|
628
|
+
z.next({
|
|
591
629
|
scrollLeft: t.scrollLeft,
|
|
592
630
|
scrollTop: t.scrollTop
|
|
593
631
|
});
|
|
594
|
-
}, [
|
|
595
|
-
|
|
632
|
+
}, [z]), ve = p((e) => {
|
|
633
|
+
I.current?.focus();
|
|
596
634
|
let t = e.currentTarget, n = t.getBoundingClientRect(), r = e.clientX >= n.left + t.clientWidth, i = e.clientY >= n.top + t.clientHeight;
|
|
597
635
|
if (r || i) return;
|
|
598
|
-
let a =
|
|
636
|
+
let a = N.current, s = P.current, c = C.resolve(D).data;
|
|
599
637
|
if (!a || !s) return;
|
|
600
|
-
let u =
|
|
638
|
+
let u = l.getPathPropertiesFromCanvas({
|
|
601
639
|
canvas: a,
|
|
602
|
-
devicePixelRatio:
|
|
640
|
+
devicePixelRatio: c,
|
|
603
641
|
editorAssembly: s,
|
|
604
642
|
event: e.nativeEvent
|
|
605
643
|
});
|
|
606
644
|
if (u) {
|
|
607
645
|
if (u.type !== o.DIVIDER) {
|
|
608
646
|
if (u.type === o.LABEL && (e.metaKey || e.ctrlKey)) {
|
|
609
|
-
let t =
|
|
610
|
-
if (e.preventDefault(),
|
|
611
|
-
|
|
647
|
+
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(), F.current = null, n.length === 0) {
|
|
649
|
+
G.next(null), K.current = null;
|
|
612
650
|
return;
|
|
613
651
|
}
|
|
614
|
-
|
|
652
|
+
G.next({ rows: n }), K.current = { rows: n };
|
|
615
653
|
return;
|
|
616
654
|
}
|
|
617
|
-
let t =
|
|
655
|
+
let t = l.getSelectionFromPathProperties({
|
|
618
656
|
endPath: u,
|
|
619
657
|
startPath: u
|
|
620
658
|
});
|
|
621
659
|
if (!t) return;
|
|
622
|
-
e.preventDefault(),
|
|
623
|
-
} else e.preventDefault(),
|
|
624
|
-
startLabelWidth:
|
|
660
|
+
e.preventDefault(), F.current = u, G.next(t), K.current = t;
|
|
661
|
+
} else e.preventDefault(), F.current = null, oe.current = {
|
|
662
|
+
startLabelWidth: W.data.labelWidth,
|
|
625
663
|
startX: e.clientX
|
|
626
664
|
};
|
|
627
665
|
}
|
|
628
|
-
}, [
|
|
629
|
-
let t =
|
|
666
|
+
}, [W, G]), ye = p((e) => {
|
|
667
|
+
let t = N.current, n = I.current, r = C.resolve(D).data, i = oe.current;
|
|
630
668
|
if (!n || !t) return;
|
|
631
669
|
if (i) {
|
|
632
670
|
let t = Math.min($, Math.max(120, i.startLabelWidth + e.clientX - i.startX));
|
|
633
|
-
|
|
634
|
-
...
|
|
671
|
+
W.next({
|
|
672
|
+
...W.data,
|
|
635
673
|
labelWidth: t
|
|
636
674
|
}), n.style.cursor = "col-resize";
|
|
637
675
|
return;
|
|
638
676
|
}
|
|
639
|
-
let a =
|
|
677
|
+
let a = F.current;
|
|
640
678
|
if (a) {
|
|
641
|
-
let n =
|
|
679
|
+
let n = P.current;
|
|
642
680
|
if (!n) return;
|
|
643
|
-
let i =
|
|
681
|
+
let i = l.getPathPropertiesFromCanvas({
|
|
644
682
|
canvas: t,
|
|
645
683
|
devicePixelRatio: r,
|
|
646
684
|
editorAssembly: n,
|
|
647
685
|
event: e.nativeEvent
|
|
648
686
|
});
|
|
649
687
|
if (!i) return;
|
|
650
|
-
let o =
|
|
688
|
+
let o = l.getSelectionFromPathProperties({
|
|
651
689
|
endPath: i,
|
|
652
690
|
startPath: a
|
|
653
691
|
});
|
|
654
|
-
o && (
|
|
692
|
+
o && (G.next(o), K.current = o);
|
|
655
693
|
return;
|
|
656
694
|
}
|
|
657
|
-
let s =
|
|
695
|
+
let s = P.current;
|
|
658
696
|
if (!s) return;
|
|
659
|
-
let
|
|
697
|
+
let c = l.getPathPropertiesFromCanvas({
|
|
660
698
|
canvas: t,
|
|
661
699
|
devicePixelRatio: r,
|
|
662
700
|
editorAssembly: s,
|
|
663
701
|
event: e.nativeEvent
|
|
664
702
|
});
|
|
665
|
-
|
|
703
|
+
c && c.type === o.DIVIDER ? n.style.cursor = "col-resize" : n.style.cursor = "default";
|
|
666
704
|
}, [
|
|
667
|
-
|
|
705
|
+
W,
|
|
668
706
|
$,
|
|
669
|
-
|
|
670
|
-
]),
|
|
671
|
-
|
|
672
|
-
}, []),
|
|
673
|
-
|
|
674
|
-
geometry:
|
|
675
|
-
scrollContainer:
|
|
707
|
+
G
|
|
708
|
+
]), be = p(() => {
|
|
709
|
+
oe.current = null, F.current = null;
|
|
710
|
+
}, []), xe = p((e, t) => {
|
|
711
|
+
l.scrollToPosition({
|
|
712
|
+
geometry: W.data,
|
|
713
|
+
scrollContainer: L.current,
|
|
676
714
|
x: e,
|
|
677
715
|
y: t
|
|
678
716
|
});
|
|
679
|
-
}, [
|
|
680
|
-
return /* @__PURE__ */
|
|
717
|
+
}, [W]), Se = Math.max(1, Math.floor(R.width * ce)), Ce = Math.max(1, Math.floor(R.height * ce));
|
|
718
|
+
return /* @__PURE__ */ T(v, {
|
|
681
719
|
sx: {
|
|
682
720
|
display: "grid",
|
|
683
721
|
gridTemplateRows: "max-content auto",
|
|
@@ -686,10 +724,10 @@ var ee = () => {
|
|
|
686
724
|
width: "100%"
|
|
687
725
|
},
|
|
688
726
|
children: [
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
onMouseUp:
|
|
692
|
-
ref:
|
|
727
|
+
/* @__PURE__ */ w(d, {}),
|
|
728
|
+
/* @__PURE__ */ T(v, {
|
|
729
|
+
onMouseUp: be,
|
|
730
|
+
ref: I,
|
|
693
731
|
sx: {
|
|
694
732
|
height: `calc(100% - ${Y.spacing(3)})`,
|
|
695
733
|
marginBottom: Y.spacing(3),
|
|
@@ -698,11 +736,11 @@ var ee = () => {
|
|
|
698
736
|
},
|
|
699
737
|
tabIndex: 0,
|
|
700
738
|
children: [
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
onMouseDown:
|
|
703
|
-
onMouseMove:
|
|
704
|
-
onScroll:
|
|
705
|
-
ref:
|
|
739
|
+
/* @__PURE__ */ w(v, {
|
|
740
|
+
onMouseDown: ve,
|
|
741
|
+
onMouseMove: ye,
|
|
742
|
+
onScroll: _e,
|
|
743
|
+
ref: L,
|
|
706
744
|
sx: {
|
|
707
745
|
height: "100%",
|
|
708
746
|
overflowX: "scroll",
|
|
@@ -711,29 +749,29 @@ var ee = () => {
|
|
|
711
749
|
width: "100%",
|
|
712
750
|
zIndex: 1
|
|
713
751
|
},
|
|
714
|
-
children: /* @__PURE__ */
|
|
715
|
-
height: `${Math.max(
|
|
752
|
+
children: /* @__PURE__ */ w(v, { sx: {
|
|
753
|
+
height: `${Math.max(ue, R.height)}px`,
|
|
716
754
|
pointerEvents: "none",
|
|
717
|
-
width: `${Math.max(
|
|
755
|
+
width: `${Math.max(fe, R.width)}px`
|
|
718
756
|
} })
|
|
719
757
|
}),
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
height:
|
|
722
|
-
ref:
|
|
758
|
+
/* @__PURE__ */ w("canvas", {
|
|
759
|
+
height: Ce,
|
|
760
|
+
ref: N,
|
|
723
761
|
style: {
|
|
724
762
|
display: "block",
|
|
725
|
-
height: `${
|
|
763
|
+
height: `${R.height}px`,
|
|
726
764
|
imageRendering: "pixelated",
|
|
727
765
|
left: 0,
|
|
728
766
|
pointerEvents: "auto",
|
|
729
767
|
position: "absolute",
|
|
730
768
|
top: 0,
|
|
731
|
-
width: `${
|
|
769
|
+
width: `${R.width}px`,
|
|
732
770
|
zIndex: 0
|
|
733
771
|
},
|
|
734
|
-
width:
|
|
772
|
+
width: Se
|
|
735
773
|
}),
|
|
736
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ w(v, {
|
|
737
775
|
sx: {
|
|
738
776
|
bottom: Y.spacing(-3),
|
|
739
777
|
height: Y.spacing(3),
|
|
@@ -742,17 +780,18 @@ var ee = () => {
|
|
|
742
780
|
width: "100%",
|
|
743
781
|
zIndex: 2
|
|
744
782
|
},
|
|
745
|
-
children: /* @__PURE__ */
|
|
783
|
+
children: /* @__PURE__ */ w(ne, {})
|
|
746
784
|
})
|
|
747
785
|
]
|
|
748
786
|
}),
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
onGotoPosition:
|
|
751
|
-
ref:
|
|
752
|
-
})
|
|
787
|
+
/* @__PURE__ */ w(re, {
|
|
788
|
+
onGotoPosition: xe,
|
|
789
|
+
ref: ie
|
|
790
|
+
}),
|
|
791
|
+
/* @__PURE__ */ w(f, { ref: ae })
|
|
753
792
|
]
|
|
754
793
|
});
|
|
755
794
|
};
|
|
756
|
-
export {
|
|
795
|
+
export { j as t };
|
|
757
796
|
|
|
758
797
|
//# sourceMappingURL=SequenceEditor.js.map
|