@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,48 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { StringUtil as e } from "@gen-epix/ui-core/utils/StringUtil";
|
|
2
|
+
import { FastaUtil as t } from "@rivm-loculus-tools/common-frontend/utils/FastaUtil";
|
|
3
|
+
import { EDITOR_DIRECTION as n, EDITOR_PATH_PROPERTIES_TYPE as r, MATRIX_TYPE as i, READING_MODE as a } from "../../models/editor.models.js";
|
|
4
|
+
import { DEFAULT_GRID_GEOMETRY as o } from "../../constants/editor.js";
|
|
5
|
+
import { PaletteUtil as s } from "../PaletteUtil/index.js";
|
|
4
6
|
import "../../constants/index.js";
|
|
5
|
-
import { StringUtil as a } from "@gen-epix/ui-core/utils/StringUtil";
|
|
6
|
-
import { FastaUtil as o } from "@rivm-loculus-tools/common-frontend/utils/FastaUtil";
|
|
7
7
|
// \0rolldown/runtime.js
|
|
8
|
-
var
|
|
9
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
8
|
+
var c = Object.create, l = Object.defineProperty, u = Object.getOwnPropertyDescriptor, d = Object.getOwnPropertyNames, f = Object.getPrototypeOf, p = Object.prototype.hasOwnProperty, m = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), h = (e, t, n, r) => {
|
|
9
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = d(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !p.call(e, s) && s !== n && l(e, s, {
|
|
10
10
|
get: ((e) => t[e]).bind(null, s),
|
|
11
|
-
enumerable: !(r =
|
|
11
|
+
enumerable: !(r = u(t, s)) || r.enumerable
|
|
12
12
|
});
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
14
|
+
}, g = (e, t, n) => (n = e == null ? {} : c(f(e)), h(t || !e || !e.__esModule || !p.call(e, "default") ? l(n, "default", {
|
|
15
15
|
value: e,
|
|
16
16
|
enumerable: !0
|
|
17
|
-
}) : n, e)),
|
|
17
|
+
}) : n, e)), _ = /* @__PURE__ */ m(((e, t) => {
|
|
18
18
|
var n = Math.floor;
|
|
19
|
-
function
|
|
19
|
+
t.exports = function(e, t) {
|
|
20
20
|
var r = "";
|
|
21
|
-
if (!e || t < 1 || t >
|
|
21
|
+
if (!e || t < 1 || t > 0x1fffffffffffff) return r;
|
|
22
22
|
do
|
|
23
23
|
t % 2 && (r += e), t = n(t / 2), t && (e += e);
|
|
24
24
|
while (t);
|
|
25
25
|
return r;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
})), _ = /* @__PURE__ */ p(((e, t) => {
|
|
26
|
+
};
|
|
27
|
+
})), v = /* @__PURE__ */ m(((e, t) => {
|
|
29
28
|
t.exports = typeof global == "object" && global && global.Object === Object && global;
|
|
30
|
-
})),
|
|
31
|
-
var n =
|
|
29
|
+
})), y = /* @__PURE__ */ m(((e, t) => {
|
|
30
|
+
var n = v(), r = typeof self == "object" && self && self.Object === Object && self;
|
|
32
31
|
t.exports = n || r || Function("return this")();
|
|
33
|
-
})),
|
|
34
|
-
t.exports =
|
|
35
|
-
})),
|
|
36
|
-
function
|
|
32
|
+
})), b = /* @__PURE__ */ m(((e, t) => {
|
|
33
|
+
t.exports = y().Symbol;
|
|
34
|
+
})), x = /* @__PURE__ */ m(((e, t) => {
|
|
35
|
+
t.exports = function(e, t) {
|
|
37
36
|
for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
|
|
38
37
|
return i;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
})), x = /* @__PURE__ */ p(((e, t) => {
|
|
38
|
+
};
|
|
39
|
+
})), S = /* @__PURE__ */ m(((e, t) => {
|
|
42
40
|
t.exports = Array.isArray;
|
|
43
|
-
})),
|
|
44
|
-
var n =
|
|
45
|
-
function
|
|
41
|
+
})), C = /* @__PURE__ */ m(((e, t) => {
|
|
42
|
+
var n = b(), r = Object.prototype, i = r.hasOwnProperty, a = r.toString, o = n ? n.toStringTag : void 0;
|
|
43
|
+
t.exports = function(e) {
|
|
46
44
|
var t = i.call(e, o), n = e[o];
|
|
47
45
|
try {
|
|
48
46
|
e[o] = void 0;
|
|
@@ -50,33 +48,28 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
50
48
|
} catch {}
|
|
51
49
|
var s = a.call(e);
|
|
52
50
|
return r && (t ? e[o] = n : delete e[o]), s;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
})), C = /* @__PURE__ */ p(((e, t) => {
|
|
51
|
+
};
|
|
52
|
+
})), w = /* @__PURE__ */ m(((e, t) => {
|
|
56
53
|
var n = Object.prototype.toString;
|
|
57
|
-
function
|
|
54
|
+
t.exports = function(e) {
|
|
58
55
|
return n.call(e);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
function c(e) {
|
|
56
|
+
};
|
|
57
|
+
})), T = /* @__PURE__ */ m(((e, t) => {
|
|
58
|
+
var n = b(), r = C(), i = w(), a = "[object Null]", o = "[object Undefined]", s = n ? n.toStringTag : void 0;
|
|
59
|
+
t.exports = function(e) {
|
|
64
60
|
return e == null ? e === void 0 ? o : a : s && s in Object(e) ? r(e) : i(e);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
function n(e) {
|
|
61
|
+
};
|
|
62
|
+
})), E = /* @__PURE__ */ m(((e, t) => {
|
|
63
|
+
t.exports = function(e) {
|
|
69
64
|
return typeof e == "object" && !!e;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
function a(e) {
|
|
65
|
+
};
|
|
66
|
+
})), D = /* @__PURE__ */ m(((e, t) => {
|
|
67
|
+
var n = T(), r = E(), i = "[object Symbol]";
|
|
68
|
+
t.exports = function(e) {
|
|
75
69
|
return typeof e == "symbol" || r(e) && n(e) == i;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var n = y(), r = b(), i = x(), a = E(), o = 1 / 0, s = n ? n.prototype : void 0, c = s ? s.toString : void 0;
|
|
70
|
+
};
|
|
71
|
+
})), O = /* @__PURE__ */ m(((e, t) => {
|
|
72
|
+
var n = b(), r = x(), i = S(), a = D(), o = 1 / 0, s = n ? n.prototype : void 0, c = s ? s.toString : void 0;
|
|
80
73
|
function l(e) {
|
|
81
74
|
if (typeof e == "string") return e;
|
|
82
75
|
if (i(e)) return r(e, l) + "";
|
|
@@ -85,37 +78,33 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
85
78
|
return t == "0" && 1 / e == -o ? "-0" : t;
|
|
86
79
|
}
|
|
87
80
|
t.exports = l;
|
|
88
|
-
})),
|
|
89
|
-
function
|
|
81
|
+
})), k = /* @__PURE__ */ m(((e, t) => {
|
|
82
|
+
t.exports = function(e, t, n) {
|
|
90
83
|
var r = -1, i = e.length;
|
|
91
84
|
t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
|
|
92
85
|
for (var a = Array(i); ++r < i;) a[r] = e[r + t];
|
|
93
86
|
return a;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
function r(e, t, r) {
|
|
87
|
+
};
|
|
88
|
+
})), A = /* @__PURE__ */ m(((e, t) => {
|
|
89
|
+
var n = k();
|
|
90
|
+
t.exports = function(e, t, r) {
|
|
99
91
|
var i = e.length;
|
|
100
92
|
return r = r === void 0 ? i : r, !t && r >= i ? e : n(e, t, r);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
})), A = /* @__PURE__ */ p(((e, t) => {
|
|
93
|
+
};
|
|
94
|
+
})), j = /* @__PURE__ */ m(((e, t) => {
|
|
104
95
|
var n = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");
|
|
105
|
-
function
|
|
96
|
+
t.exports = function(e) {
|
|
106
97
|
return n.test(e);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
function n(e) {
|
|
98
|
+
};
|
|
99
|
+
})), M = /* @__PURE__ */ m(((e, t) => {
|
|
100
|
+
t.exports = function(e) {
|
|
111
101
|
return function(t) {
|
|
112
102
|
return t?.[e];
|
|
113
103
|
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
})), N = /* @__PURE__ */ p(((e, t) => {
|
|
104
|
+
};
|
|
105
|
+
})), N = /* @__PURE__ */ m(((e, t) => {
|
|
106
|
+
t.exports = M()("length");
|
|
107
|
+
})), P = /* @__PURE__ */ m(((e, t) => {
|
|
119
108
|
var n = "\\ud800-\\udfff", r = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", i = "\\ufe0e\\ufe0f", a = "[" + n + "]", o = "[" + r + "]", s = "\\ud83c[\\udffb-\\udfff]", c = "(?:" + o + "|" + s + ")", l = "[^" + n + "]", u = "(?:\\ud83c[\\udde6-\\uddff]){2}", d = "[\\ud800-\\udbff][\\udc00-\\udfff]", f = "\\u200d", p = c + "?", m = "[" + i + "]?", h = "(?:" + f + "(?:" + [
|
|
120
109
|
l,
|
|
121
110
|
u,
|
|
@@ -127,23 +116,20 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
127
116
|
d,
|
|
128
117
|
a
|
|
129
118
|
].join("|") + ")", v = RegExp(s + "(?=" + s + ")|" + _ + g, "g");
|
|
130
|
-
function
|
|
119
|
+
t.exports = function(e) {
|
|
131
120
|
for (var t = v.lastIndex = 0; v.test(e);) ++t;
|
|
132
121
|
return t;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
function a(e) {
|
|
122
|
+
};
|
|
123
|
+
})), F = /* @__PURE__ */ m(((e, t) => {
|
|
124
|
+
var n = N(), r = j(), i = P();
|
|
125
|
+
t.exports = function(e) {
|
|
138
126
|
return r(e) ? i(e) : n(e);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
function n(e) {
|
|
127
|
+
};
|
|
128
|
+
})), I = /* @__PURE__ */ m(((e, t) => {
|
|
129
|
+
t.exports = function(e) {
|
|
143
130
|
return e.split("");
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
})), I = /* @__PURE__ */ p(((e, t) => {
|
|
131
|
+
};
|
|
132
|
+
})), L = /* @__PURE__ */ m(((e, t) => {
|
|
147
133
|
var n = "\\ud800-\\udfff", r = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", i = "\\ufe0e\\ufe0f", a = "[" + n + "]", o = "[" + r + "]", s = "\\ud83c[\\udffb-\\udfff]", c = "(?:" + o + "|" + s + ")", l = "[^" + n + "]", u = "(?:\\ud83c[\\udde6-\\uddff]){2}", d = "[\\ud800-\\udbff][\\udc00-\\udfff]", f = "\\u200d", p = c + "?", m = "[" + i + "]?", h = "(?:" + f + "(?:" + [
|
|
148
134
|
l,
|
|
149
135
|
u,
|
|
@@ -155,48 +141,42 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
155
141
|
d,
|
|
156
142
|
a
|
|
157
143
|
].join("|") + ")", v = RegExp(s + "(?=" + s + ")|" + _ + g, "g");
|
|
158
|
-
function
|
|
144
|
+
t.exports = function(e) {
|
|
159
145
|
return e.match(v) || [];
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
function a(e) {
|
|
146
|
+
};
|
|
147
|
+
})), R = /* @__PURE__ */ m(((e, t) => {
|
|
148
|
+
var n = I(), r = j(), i = L();
|
|
149
|
+
t.exports = function(e) {
|
|
165
150
|
return r(e) ? i(e) : n(e);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
function l(e, t) {
|
|
151
|
+
};
|
|
152
|
+
})), z = /* @__PURE__ */ m(((e, t) => {
|
|
153
|
+
var n = _(), r = O(), i = A(), a = j(), o = F(), s = R(), c = Math.ceil;
|
|
154
|
+
t.exports = function(e, t) {
|
|
171
155
|
t = t === void 0 ? " " : r(t);
|
|
172
156
|
var l = t.length;
|
|
173
157
|
if (l < 2) return l ? n(t, e) : t;
|
|
174
158
|
var u = n(t, c(e / o(t)));
|
|
175
159
|
return a(t) ? i(s(u), 0, e).join("") : u.slice(0, e);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
})), z = /* @__PURE__ */ p(((e, t) => {
|
|
160
|
+
};
|
|
161
|
+
})), B = /* @__PURE__ */ m(((e, t) => {
|
|
179
162
|
var n = /\s/;
|
|
180
|
-
function
|
|
163
|
+
t.exports = function(e) {
|
|
181
164
|
for (var t = e.length; t-- && n.test(e.charAt(t)););
|
|
182
165
|
return t;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
function i(e) {
|
|
166
|
+
};
|
|
167
|
+
})), V = /* @__PURE__ */ m(((e, t) => {
|
|
168
|
+
var n = B(), r = /^\s+/;
|
|
169
|
+
t.exports = function(e) {
|
|
188
170
|
return e && e.slice(0, n(e) + 1).replace(r, "");
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
function n(e) {
|
|
171
|
+
};
|
|
172
|
+
})), H = /* @__PURE__ */ m(((e, t) => {
|
|
173
|
+
t.exports = function(e) {
|
|
193
174
|
var t = typeof e;
|
|
194
175
|
return e != null && (t == "object" || t == "function");
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
function u(e) {
|
|
176
|
+
};
|
|
177
|
+
})), U = /* @__PURE__ */ m(((e, t) => {
|
|
178
|
+
var n = V(), r = H(), i = D(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
|
|
179
|
+
t.exports = function(e) {
|
|
200
180
|
if (typeof e == "number") return e;
|
|
201
181
|
if (i(e)) return a;
|
|
202
182
|
if (r(e)) {
|
|
@@ -207,152 +187,164 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
207
187
|
e = n(e);
|
|
208
188
|
var u = s.test(e);
|
|
209
189
|
return u || c.test(e) ? l(e.slice(2), u ? 2 : 8) : o.test(e) ? a : +e;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
function a(e) {
|
|
190
|
+
};
|
|
191
|
+
})), W = /* @__PURE__ */ m(((e, t) => {
|
|
192
|
+
var n = U(), r = 1 / 0, i = 17976931348623157e292;
|
|
193
|
+
t.exports = function(e) {
|
|
215
194
|
return e ? (e = n(e), e === r || e === -r ? (e < 0 ? -1 : 1) * i : e === e ? e : 0) : e === 0 ? e : 0;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
function r(e) {
|
|
195
|
+
};
|
|
196
|
+
})), G = /* @__PURE__ */ m(((e, t) => {
|
|
197
|
+
var n = W();
|
|
198
|
+
t.exports = function(e) {
|
|
221
199
|
var t = n(e), r = t % 1;
|
|
222
200
|
return t === t ? r ? t - r : t : 0;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
function r(e) {
|
|
201
|
+
};
|
|
202
|
+
})), K = /* @__PURE__ */ m(((e, t) => {
|
|
203
|
+
var n = O();
|
|
204
|
+
t.exports = function(e) {
|
|
228
205
|
return e == null ? "" : n(e);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
function o(e, t, o) {
|
|
206
|
+
};
|
|
207
|
+
})), q = /* @__PURE__ */ g((/* @__PURE__ */ m(((e, t) => {
|
|
208
|
+
var n = z(), r = F(), i = G(), a = K();
|
|
209
|
+
t.exports = function(e, t, o) {
|
|
234
210
|
e = a(e), t = i(t);
|
|
235
211
|
var s = t ? r(e) : 0;
|
|
236
212
|
return t && s < t ? n(t - s, o) + e : e;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
let y = {
|
|
213
|
+
};
|
|
214
|
+
})))(), 1), J = class c {
|
|
215
|
+
static drawCanvas({ aminoAcidPalette: e, canvasElement: t, devicePixelRatio: n, geometry: a, meta: o, nucleotidePalette: s, readingFrame: l, readingMode: u, rowNames: d, rowNamesStartRow: f, scrollLeft: p, scrollTop: m, searchResult: h, searchResultHighlightedIndex: g, selection: _, viewport: v, viewportHeight: y, viewportWidth: b }) {
|
|
216
|
+
let x = {
|
|
242
217
|
cells: { pathPropertiesMap: /* @__PURE__ */ new Map() },
|
|
243
218
|
divider: { pathPropertiesMap: /* @__PURE__ */ new Map() },
|
|
244
219
|
labels: { pathPropertiesMap: /* @__PURE__ */ new Map() },
|
|
245
220
|
ruler: { pathPropertiesMap: /* @__PURE__ */ new Map() }
|
|
246
221
|
};
|
|
247
|
-
if (!
|
|
248
|
-
let
|
|
249
|
-
if (!
|
|
250
|
-
let
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
let { cellHeight:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
222
|
+
if (!t) return x;
|
|
223
|
+
let S = t.getContext("2d");
|
|
224
|
+
if (!S) return x;
|
|
225
|
+
let C = o.sequenceCount.toString().length, w = (e) => _?.rows?.includes(e) ?? !1, T = (e, t) => !!(_?.cells && t >= _.cells.startCol && t <= _.cells.endCol && e >= _.cells.startRow && e <= _.cells.endRow) || !!_?.cols?.includes(t) || !!w(e), E = h && g !== null ? c.searchHitAt(h, g) : null;
|
|
226
|
+
return c.draw(t, n, () => {
|
|
227
|
+
S.clearRect(0, 0, t.width, t.height);
|
|
228
|
+
let { cellHeight: n, cellWidth: g, dividerWidth: D, labelWidth: O, rulerHeight: k } = a, A = O + D, { aminoAcidCodonOverlay: j, bytes: M, cols: N, rows: P, startCol: F, startRow: I } = v, L = c.getCellRenderConfig({
|
|
229
|
+
aminoAcidCodonOverlay: j,
|
|
230
|
+
aminoAcidPalette: e,
|
|
231
|
+
meta: o,
|
|
232
|
+
nucleotidePalette: s,
|
|
233
|
+
readingFrame: l,
|
|
234
|
+
readingMode: u
|
|
235
|
+
}), R = (h?.positions.length ?? 0) > 0, z = R ? new Uint8Array(P * N) : null, B = E ? new Uint8Array(P * N) : null, V = R ? new Uint8Array(P) : null, H = E ? new Uint8Array(P) : null, U = R ? new Path2D() : null, W = E ? new Path2D() : null, G = (e, t) => {
|
|
236
|
+
if (!h) return;
|
|
237
|
+
let n = Math.max(1, h.query.length), r = e.row - I;
|
|
238
|
+
if (r < 0 || r >= P) return;
|
|
239
|
+
if (e.matrix_type === i.RECORD_NAME) {
|
|
240
|
+
t.fill(1, r * N, (r + 1) * N);
|
|
259
241
|
return;
|
|
260
242
|
}
|
|
261
|
-
let a = Math.max(
|
|
262
|
-
if (a >= o || !
|
|
263
|
-
let
|
|
264
|
-
t.fill(1,
|
|
265
|
-
},
|
|
266
|
-
e.matrix_type ===
|
|
243
|
+
let a = Math.max(F, e.col), o = Math.min(F + N, e.col + n);
|
|
244
|
+
if (a >= o || !c.searchHitContainsCell(e, h.query, e.row, a)) return;
|
|
245
|
+
let s = r * N + a - F;
|
|
246
|
+
t.fill(1, s, s + o - a);
|
|
247
|
+
}, K = (e, t) => {
|
|
248
|
+
e.matrix_type === i.RECORD_NAME && e.row >= I && e.row < I + P && (t[e.row - I] = 1);
|
|
267
249
|
};
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}),
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
250
|
+
h && z && (h.positions.forEach((e) => G(e, z)), h.positions.forEach((e) => {
|
|
251
|
+
V && K(e, V);
|
|
252
|
+
}), E && B && (G(E, B), H && K(E, H)));
|
|
253
|
+
let J = c.drawCells({
|
|
254
|
+
bytes: M,
|
|
255
|
+
cellHeight: n,
|
|
256
|
+
cellRenderConfig: L,
|
|
257
|
+
cellWidth: g,
|
|
258
|
+
cols: N,
|
|
259
|
+
context: S,
|
|
260
|
+
editorAssembly: x,
|
|
261
|
+
gridStart: A,
|
|
262
|
+
isCellSelected: T,
|
|
263
|
+
rows: P,
|
|
264
|
+
rulerHeight: k,
|
|
265
|
+
scrollLeft: p,
|
|
266
|
+
scrollTop: m,
|
|
267
|
+
searchRenderState: {
|
|
268
|
+
highlightedSearchMatchFlags: B,
|
|
269
|
+
highlightedSearchMatchPath: W,
|
|
270
|
+
highlightedSearchRowFlags: H,
|
|
271
|
+
searchMatchFlags: z,
|
|
272
|
+
searchMatchPath: U,
|
|
273
|
+
searchRowFlags: V
|
|
274
|
+
},
|
|
275
|
+
startCol: F,
|
|
276
|
+
startRow: I,
|
|
277
|
+
viewportHeight: y,
|
|
278
|
+
viewportWidth: b
|
|
279
|
+
});
|
|
280
|
+
J.hasSearchMatches && U && (S.strokeStyle = "#000000", S.lineWidth = 1, S.stroke(U)), J.hasHighlightedSearchMatches && W && (S.lineWidth = 2, S.stroke(W)), S.fillStyle = "#edf2f6", S.fillRect(0, 0, b, k), S.font = "12px monospace", S.textBaseline = "middle";
|
|
281
|
+
let Y = [];
|
|
282
|
+
S.strokeStyle = "#9fb3c8", S.lineWidth = 1, S.beginPath();
|
|
283
|
+
for (let e = 0; e < N; e++) {
|
|
284
|
+
let t = (F + e + 1) % 10 == 0;
|
|
285
|
+
t && Y.push(e);
|
|
286
|
+
let n = (F + e) * g + A - p, i = new Path2D();
|
|
287
|
+
i.rect(n, 0, g, k), i.closePath(), x.ruler.pathPropertiesMap.set(i, {
|
|
288
|
+
col: F + e,
|
|
289
|
+
type: r.RULER
|
|
298
290
|
});
|
|
299
|
-
let a =
|
|
300
|
-
|
|
291
|
+
let a = n + .5, o = t ? 8 : 4;
|
|
292
|
+
S.moveTo(a, k), S.lineTo(a, k - o);
|
|
301
293
|
}
|
|
302
|
-
|
|
303
|
-
let t = (
|
|
304
|
-
t - r / 2 <
|
|
305
|
-
}),
|
|
306
|
-
let
|
|
307
|
-
|
|
308
|
-
for (let e = 0; e <
|
|
309
|
-
let
|
|
310
|
-
if (
|
|
294
|
+
S.stroke(), S.fillStyle = "#486581", S.textAlign = "center", Y.forEach((e) => {
|
|
295
|
+
let t = (F + e) * g + A - p, n = String(F + e + 1), r = S.measureText(n).width;
|
|
296
|
+
t - r / 2 < A || t + r / 2 > b || S.fillText(n, t, k / 2);
|
|
297
|
+
}), S.textAlign = "start", S.strokeStyle = "#bcccdc", S.lineWidth = 1, S.beginPath(), S.moveTo(A + .5, 0), S.lineTo(A + .5, y), S.moveTo(0, k + .5), S.lineTo(b, k + .5), S.stroke(), S.fillStyle = "#edf2f6", S.fillRect(0, 0, A, k), S.fillStyle = "#d9e2ec", S.fillRect(O, 0, D, y);
|
|
298
|
+
let X = new Path2D();
|
|
299
|
+
X.rect(O, 0, D, y), X.closePath(), x.divider.pathPropertiesMap.set(X, { type: r.DIVIDER }), S.fillStyle = "#f8fafb", S.fillRect(0, k, O, y - k), S.font = "12px monospace", S.textBaseline = "middle", S.save(), S.beginPath(), S.rect(0, k, O, y - k), S.clip();
|
|
300
|
+
for (let e = 0; e < P; e++) {
|
|
301
|
+
let t = (I + e) * n + k - m;
|
|
302
|
+
if (t + n < k || t > y) continue;
|
|
311
303
|
let i = new Path2D();
|
|
312
|
-
i.rect(0,
|
|
313
|
-
row:
|
|
314
|
-
type:
|
|
304
|
+
i.rect(0, t, O, n), i.closePath(), x.labels.pathPropertiesMap.set(i, {
|
|
305
|
+
row: I + e,
|
|
306
|
+
type: r.LABEL
|
|
315
307
|
});
|
|
316
|
-
let a =
|
|
317
|
-
|
|
308
|
+
let a = I + e - f, o = I + e, s = V?.[e] === 1, c = H?.[e] === 1, l = !!_?.cols || !!(_?.cells && o >= _.cells.startRow && o <= _.cells.endRow) || w(o);
|
|
309
|
+
S.fillStyle = l ? "#1565c0" : "#f8fafb", S.fillRect(0, t, O, n), s && (S.fillStyle = "#ffecb3", S.fillRect(0, t, O, n)), c && (S.fillStyle = "rgba(255, 193, 7, 0.35)", S.fillRect(2, t + 2, Math.max(0, O - 4), Math.max(0, n - 4))), S.fillStyle = l ? "#ffffff" : "#334e68", S.fillText(`${(0, q.default)(String(I + e + 1), C, "0")}: ${d[a] ?? ""}`, 8, t + n / 2);
|
|
318
310
|
}
|
|
319
|
-
|
|
320
|
-
}),
|
|
311
|
+
S.restore();
|
|
312
|
+
}), x;
|
|
321
313
|
}
|
|
322
|
-
static getExpandedSelection(e,
|
|
314
|
+
static getExpandedSelection(e, t, r, i) {
|
|
323
315
|
let a = e.cells;
|
|
324
316
|
if (a) {
|
|
325
|
-
if (r ===
|
|
326
|
-
let e =
|
|
317
|
+
if (r === n.LEFT) {
|
|
318
|
+
let e = t.cells;
|
|
327
319
|
if (!e) return null;
|
|
328
|
-
let
|
|
320
|
+
let n = a.startCol < e.startCol || a.endCol <= e.startCol, r = n ? a.startCol - 1 : a.startCol, i = n ? a.endCol : a.endCol - 1;
|
|
329
321
|
return r < 0 ? null : { cells: {
|
|
330
322
|
...a,
|
|
331
323
|
endCol: i,
|
|
332
324
|
startCol: r
|
|
333
325
|
} };
|
|
334
326
|
}
|
|
335
|
-
if (r ===
|
|
336
|
-
let e =
|
|
327
|
+
if (r === n.RIGHT) {
|
|
328
|
+
let e = t.cells;
|
|
337
329
|
if (!e) return null;
|
|
338
|
-
let
|
|
330
|
+
let n = a.startCol < e.startCol ? a.startCol + 1 : a.startCol, r = a.startCol < e.startCol ? a.endCol : a.endCol + 1;
|
|
339
331
|
return r >= i.alignmentWidth ? null : { cells: {
|
|
340
332
|
...a,
|
|
341
333
|
endCol: r,
|
|
342
|
-
startCol:
|
|
334
|
+
startCol: n
|
|
343
335
|
} };
|
|
344
336
|
}
|
|
345
|
-
if (r ===
|
|
346
|
-
let e =
|
|
337
|
+
if (r === n.UP) {
|
|
338
|
+
let e = t.cells;
|
|
347
339
|
if (!e) return null;
|
|
348
|
-
let
|
|
340
|
+
let n = a.startRow < e.startRow || a.endRow <= e.startRow, r = n ? a.startRow - 1 : a.startRow, i = n ? a.endRow : a.endRow - 1;
|
|
349
341
|
return r < 0 ? null : { cells: {
|
|
350
342
|
...a,
|
|
351
343
|
endRow: i,
|
|
352
344
|
startRow: r
|
|
353
345
|
} };
|
|
354
346
|
}
|
|
355
|
-
let e =
|
|
347
|
+
let e = t.cells;
|
|
356
348
|
if (!e) return null;
|
|
357
349
|
let o = a.startRow < e.startRow ? a.startRow + 1 : a.startRow, s = a.startRow < e.startRow ? a.endRow : a.endRow + 1;
|
|
358
350
|
return s >= i.sequenceCount ? null : { cells: {
|
|
@@ -363,18 +355,18 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
363
355
|
}
|
|
364
356
|
let o = e.cols;
|
|
365
357
|
if (o) {
|
|
366
|
-
if (o.length === 0 || r !==
|
|
367
|
-
let e = Math.min(...o), a = Math.max(...o), s =
|
|
358
|
+
if (o.length === 0 || r !== n.LEFT && r !== n.RIGHT) return null;
|
|
359
|
+
let e = Math.min(...o), a = Math.max(...o), s = t.cols;
|
|
368
360
|
if (!s || s.length === 0) return null;
|
|
369
361
|
let c = Math.min(...s);
|
|
370
|
-
return r ===
|
|
362
|
+
return r === n.LEFT ? a > c ? { cols: o.slice(0, -1) } : e > 0 ? { cols: [e - 1, ...o] } : null : e < c ? { cols: o.slice(1) } : a < i.alignmentWidth - 1 ? { cols: [...o, a + 1] } : null;
|
|
371
363
|
}
|
|
372
364
|
return e.rows ? e : null;
|
|
373
365
|
}
|
|
374
|
-
static getMovedRowsEndSelection(e,
|
|
366
|
+
static getMovedRowsEndSelection(e, t, r) {
|
|
375
367
|
if (!e || !r) return null;
|
|
376
|
-
let i =
|
|
377
|
-
return
|
|
368
|
+
let i = t === n.UP ? 0 : r.sequenceCount;
|
|
369
|
+
return c.getMovedRowsGroupedSelection(e, i, r);
|
|
378
370
|
}
|
|
379
371
|
static getMovedRowsGroupedSelection(e, t, n) {
|
|
380
372
|
if (!e || !n) return null;
|
|
@@ -394,13 +386,13 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
394
386
|
}
|
|
395
387
|
return null;
|
|
396
388
|
}
|
|
397
|
-
static getMovedRowsRelativeSelection(e,
|
|
389
|
+
static getMovedRowsRelativeSelection(e, t, r) {
|
|
398
390
|
if (!e || !r) return null;
|
|
399
391
|
let i = e.cells;
|
|
400
392
|
if (i) {
|
|
401
|
-
let a =
|
|
393
|
+
let a = t === n.UP && i.startRow > 0, o = t === n.DOWN && i.endRow < r.sequenceCount - 1;
|
|
402
394
|
if (!a && !o) return e;
|
|
403
|
-
let s =
|
|
395
|
+
let s = t === n.UP ? -1 : 1;
|
|
404
396
|
return { cells: {
|
|
405
397
|
...i,
|
|
406
398
|
endRow: i.endRow + s,
|
|
@@ -410,8 +402,8 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
410
402
|
let a = e.rows;
|
|
411
403
|
if (a && a.length > 0) {
|
|
412
404
|
let e = [...new Set(a)].sort((e, t) => e - t), i = e.length;
|
|
413
|
-
if (
|
|
414
|
-
if (
|
|
405
|
+
if (t === n.UP) return { rows: e.map((e, t) => Math.max(t, e - 1)) };
|
|
406
|
+
if (t === n.DOWN) {
|
|
415
407
|
let t = r.sequenceCount - i;
|
|
416
408
|
return { rows: e.map((e, n) => Math.min(t + n, e + 1)) };
|
|
417
409
|
}
|
|
@@ -419,10 +411,10 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
419
411
|
}
|
|
420
412
|
return null;
|
|
421
413
|
}
|
|
422
|
-
static getMovedSelection(e,
|
|
414
|
+
static getMovedSelection(e, t, r) {
|
|
423
415
|
if (!e || !r) return null;
|
|
424
|
-
let i =
|
|
425
|
-
if (o) return
|
|
416
|
+
let i = t === n.LEFT || t === n.UP ? -1 : 1, a = (e, t, n) => i < 0 ? e > 0 : t < n - 1, o = e.cells;
|
|
417
|
+
if (o) return t === n.LEFT || t === n.RIGHT ? a(o.startCol, o.endCol, r.alignmentWidth) ? { cells: {
|
|
426
418
|
endCol: o.endCol + i,
|
|
427
419
|
endRow: o.endRow,
|
|
428
420
|
startCol: o.startCol + i,
|
|
@@ -433,10 +425,10 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
433
425
|
startCol: o.startCol,
|
|
434
426
|
startRow: o.startRow + i
|
|
435
427
|
} } : null;
|
|
436
|
-
let
|
|
437
|
-
if (
|
|
428
|
+
let s = e.cols;
|
|
429
|
+
if (s) return t !== n.LEFT && t !== n.RIGHT || s.length === 0 || !a(Math.min(...s), Math.max(...s), r.alignmentWidth) ? null : { cols: s.map((e) => e + i) };
|
|
438
430
|
let l = e.rows;
|
|
439
|
-
return l ?
|
|
431
|
+
return l ? t !== n.UP && t !== n.DOWN || l.length === 0 ? null : c.getMovedRowsRelativeSelection(e, t, r) : null;
|
|
440
432
|
}
|
|
441
433
|
static getMutateArguments(e, t, n = 0) {
|
|
442
434
|
let r = e?.cells;
|
|
@@ -459,7 +451,7 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
459
451
|
};
|
|
460
452
|
}
|
|
461
453
|
static getPathPropertiesFromCanvas(e) {
|
|
462
|
-
let { canvas: t, devicePixelRatio: n, editorAssembly: r, event: i } = e, a =
|
|
454
|
+
let { canvas: t, devicePixelRatio: n, editorAssembly: r, event: i } = e, a = c.getCanvasContext(t), o = t.getBoundingClientRect(), s = t.width / o.width, l = t.height / o.height, u = (i.clientX - o.left) * s / n, d = (i.clientY - o.top) * l / n;
|
|
463
455
|
for (let [e, t] of r.ruler.pathPropertiesMap) if (a.isPointInPath(e, u, d)) return t;
|
|
464
456
|
for (let [e, t] of r.labels.pathPropertiesMap) if (a.isPointInPath(e, u, d)) return t;
|
|
465
457
|
for (let [e, t] of r.divider.pathPropertiesMap) if (a.isPointInPath(e, u, d)) return t;
|
|
@@ -485,10 +477,10 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
485
477
|
startRow: e.cells.startRow + n.length
|
|
486
478
|
} } : null;
|
|
487
479
|
}
|
|
488
|
-
static getPostUpsertSelection(e,
|
|
480
|
+
static getPostUpsertSelection(e, t) {
|
|
489
481
|
if (!e) return null;
|
|
490
|
-
if (
|
|
491
|
-
let r =
|
|
482
|
+
if (t !== n.LEFT && t !== n.RIGHT) return e;
|
|
483
|
+
let r = t === n.LEFT ? -1 : 1, i = e.cells;
|
|
492
484
|
if (i) {
|
|
493
485
|
let t = i.startCol + r, n = i.endCol + r;
|
|
494
486
|
return t < 0 ? e : { cells: {
|
|
@@ -506,47 +498,47 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
506
498
|
let o = e.rows;
|
|
507
499
|
return o ? { rows: o } : null;
|
|
508
500
|
}
|
|
509
|
-
static getRowsToMove(e,
|
|
501
|
+
static getRowsToMove(e, t, r) {
|
|
510
502
|
let i = e?.cells, a = e?.rows ?? (i ? Array.from({ length: i.endRow - i.startRow + 1 }, (e, t) => i.startRow + t) : void 0);
|
|
511
503
|
if (!a || a.length === 0) return;
|
|
512
504
|
let o = [...new Set(a)].sort((e, t) => e - t), s = o.length;
|
|
513
505
|
if (s !== 0 && s !== r.sequenceCount) {
|
|
514
|
-
if (
|
|
506
|
+
if (t === n.UP) {
|
|
515
507
|
if (o.every((e, t) => e === t)) return;
|
|
516
|
-
} else if (
|
|
508
|
+
} else if (t === n.DOWN && o.every((e, t) => e === r.sequenceCount - s + t)) return;
|
|
517
509
|
return a;
|
|
518
510
|
}
|
|
519
511
|
}
|
|
520
|
-
static getSelectedFasta(
|
|
521
|
-
if (!
|
|
522
|
-
let
|
|
523
|
-
if (
|
|
524
|
-
let
|
|
525
|
-
if (
|
|
526
|
-
let { endCol: e, endRow:
|
|
527
|
-
|
|
528
|
-
} else if (
|
|
529
|
-
let e = [...new Set(
|
|
512
|
+
static getSelectedFasta(n, r) {
|
|
513
|
+
if (!r) return "";
|
|
514
|
+
let i = t.parseFasta(n);
|
|
515
|
+
if (i.error) throw Error(i.error);
|
|
516
|
+
let a = (e) => [...new Set(e)].filter((e) => Number.isInteger(e) && e >= 0 && e < i.sequences.length).sort((e, t) => e - t).map((e) => i.sequences[e].sequence), o;
|
|
517
|
+
if (r.cells) {
|
|
518
|
+
let { endCol: e, endRow: t, startCol: n, startRow: i } = r.cells, s = Math.min(i, t), c = Math.max(i, t), l = Math.min(n, e), u = Math.max(n, e);
|
|
519
|
+
o = a(Array.from({ length: c - s + 1 }, (e, t) => s + t)).map((e) => e.slice(l, u + 1));
|
|
520
|
+
} else if (r.cols) {
|
|
521
|
+
let e = [...new Set(r.cols)].filter((e) => Number.isInteger(e) && e >= 0).sort((e, t) => e - t);
|
|
530
522
|
if (e.length === 0) return "";
|
|
531
|
-
|
|
532
|
-
} else
|
|
533
|
-
return
|
|
523
|
+
o = a(Array.from({ length: i.sequences.length }, (e, t) => t)).map((t) => e.map((e) => t[e] ?? "").join(""));
|
|
524
|
+
} else o = a(r.rows ?? []);
|
|
525
|
+
return o.map((t) => `>${e.createUuid()}\n${t}\n`).join("");
|
|
534
526
|
}
|
|
535
527
|
static getSelectionFromPathProperties(e) {
|
|
536
|
-
let { endPath: t, startPath:
|
|
537
|
-
if (
|
|
538
|
-
let e = Math.min(
|
|
539
|
-
return { cols: Array.from({ length:
|
|
528
|
+
let { endPath: t, startPath: n } = e;
|
|
529
|
+
if (n.type === r.RULER && (t.type === r.RULER || t.type === r.CELL)) {
|
|
530
|
+
let e = Math.min(n.col, t.col), r = Math.max(n.col, t.col);
|
|
531
|
+
return { cols: Array.from({ length: r - e + 1 }, (t, n) => e + n) };
|
|
540
532
|
}
|
|
541
|
-
if (
|
|
542
|
-
endCol: Math.max(
|
|
543
|
-
endRow: Math.max(
|
|
544
|
-
startCol: Math.min(
|
|
545
|
-
startRow: Math.min(
|
|
533
|
+
if (n.type === r.CELL && t.type === r.CELL) return { cells: {
|
|
534
|
+
endCol: Math.max(n.col, t.col),
|
|
535
|
+
endRow: Math.max(n.row, t.row),
|
|
536
|
+
startCol: Math.min(n.col, t.col),
|
|
537
|
+
startRow: Math.min(n.row, t.row)
|
|
546
538
|
} };
|
|
547
|
-
if (
|
|
548
|
-
let e = Math.min(
|
|
549
|
-
return { rows: Array.from({ length:
|
|
539
|
+
if (n.type === r.LABEL && t.type === r.LABEL) {
|
|
540
|
+
let e = Math.min(n.row, t.row), r = Math.max(n.row, t.row);
|
|
541
|
+
return { rows: Array.from({ length: r - e + 1 }, (t, n) => e + n) };
|
|
550
542
|
}
|
|
551
543
|
}
|
|
552
544
|
static getStatusBarSelectionStats(e, t = null) {
|
|
@@ -599,14 +591,14 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
599
591
|
rows: a
|
|
600
592
|
};
|
|
601
593
|
}
|
|
602
|
-
static getVisibleGridRange(
|
|
603
|
-
let { geometry:
|
|
594
|
+
static getVisibleGridRange(e) {
|
|
595
|
+
let { geometry: t = o, numCols: n, numRows: r, scrollLeft: i, scrollTop: a, viewportHeight: s, viewportWidth: c } = e, l = t.labelWidth + t.dividerWidth, u = Math.max(0, Math.floor(i / t.cellWidth)), d = Math.min(n, u + Math.max(1, Math.ceil((c - l) / t.cellWidth) + 1)), f = Math.max(0, Math.floor(Math.max(0, a - t.rulerHeight) / t.cellHeight)), p = Math.min(r, f + Math.max(1, Math.ceil((s - t.rulerHeight) / t.cellHeight) + 1));
|
|
604
596
|
return {
|
|
605
597
|
cache: {
|
|
606
|
-
endCol: Math.min(
|
|
607
|
-
endRow: Math.min(
|
|
608
|
-
startCol: Math.max(0, u -
|
|
609
|
-
startRow: Math.max(0, f -
|
|
598
|
+
endCol: Math.min(n, d + t.numOverscanCols),
|
|
599
|
+
endRow: Math.min(r, p + t.numOverscanRows),
|
|
600
|
+
startCol: Math.max(0, u - t.numOverscanCols),
|
|
601
|
+
startRow: Math.max(0, f - t.numOverscanRows)
|
|
610
602
|
},
|
|
611
603
|
visible: {
|
|
612
604
|
endCol: d,
|
|
@@ -628,8 +620,8 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
628
620
|
});
|
|
629
621
|
}
|
|
630
622
|
static scrollToSearchResult(e) {
|
|
631
|
-
let { geometry: t, scrollContainer: n, searchResult: r, searchResultHighlightedIndex: i } = e, a = r && i !== null ?
|
|
632
|
-
a &&
|
|
623
|
+
let { geometry: t, scrollContainer: n, searchResult: r, searchResultHighlightedIndex: i } = e, a = r && i !== null ? c.searchHitAt(r, i) : null;
|
|
624
|
+
a && c.scrollToPosition({
|
|
633
625
|
geometry: t,
|
|
634
626
|
scrollContainer: n,
|
|
635
627
|
x: a.col + 1,
|
|
@@ -637,21 +629,114 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
|
|
|
637
629
|
});
|
|
638
630
|
}
|
|
639
631
|
static draw(e, t, n) {
|
|
640
|
-
let r =
|
|
632
|
+
let r = c.getCanvasContext(e);
|
|
641
633
|
r.setTransform(t, 0, 0, t, 0, 0), n(r), r.setTransform(1, 0, 0, 1, 0, 0);
|
|
642
634
|
}
|
|
635
|
+
static drawCell({ bytes: e, cellHeight: t, cellRenderConfig: n, cellWidth: i, col: a, cols: o, context: s, editorAssembly: l, highlightedSearchMatchFlags: u, highlightedSearchMatchPath: d, highlightedSearchRowFlags: f, isCellSelected: p, row: m, searchMatchFlags: h, searchMatchPath: g, searchRowFlags: _, startCol: v, startRow: y, x: b, y: x }) {
|
|
636
|
+
let S = v + a, C = y + m, { colorByte: w, colors: T, label: E } = c.getCellRenderData({
|
|
637
|
+
bytes: e,
|
|
638
|
+
cellCol: S,
|
|
639
|
+
cellRenderConfig: n,
|
|
640
|
+
cellRow: C,
|
|
641
|
+
col: a,
|
|
642
|
+
cols: o,
|
|
643
|
+
row: m,
|
|
644
|
+
startCol: v
|
|
645
|
+
}), D = T.background;
|
|
646
|
+
w === void 0 ? D = "#e9eef2" : E === " " && (D = "#f7f8f9");
|
|
647
|
+
let O = T.foreground;
|
|
648
|
+
p(C, S) && (D = T.backgroundSelected, O = T.foregroundSelected);
|
|
649
|
+
let k = m * o + a, A = h?.[k] === 1, j = u?.[k] === 1, M = new Path2D();
|
|
650
|
+
M.rect(b, x, i, t), M.closePath(), l.cells.pathPropertiesMap.set(M, {
|
|
651
|
+
col: S,
|
|
652
|
+
row: C,
|
|
653
|
+
type: r.CELL
|
|
654
|
+
}), s.fillStyle = D;
|
|
655
|
+
let N = Math.floor(b), P = Math.floor(x), F = Math.ceil(b + i), I = Math.ceil(x + t);
|
|
656
|
+
s.fillRect(N, P, F - N, I - P), (j || f?.[m] === 1) && (s.fillStyle = "rgba(255, 193, 7, 0.35)", s.fillRect(b + 2, x + 2, Math.max(0, i - 4), Math.max(0, t - 4))), s.fillStyle = O, s.textAlign = "center", s.textBaseline = "middle", s.fillText(E, b + i / 2, x + t / 2);
|
|
657
|
+
let L = !1;
|
|
658
|
+
return (A || _?.[m] === 1) && g && (g.rect(b + .5, x + .5, i - 1, t - 1), (j || f?.[m] === 1) && d && (L = !0, d.rect(b + 1, x + 1, i - 2, t - 2))), {
|
|
659
|
+
hasHighlightedSearchMatches: L,
|
|
660
|
+
hasSearchMatches: A || _?.[m] === 1
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
static drawCells({ bytes: e, cellHeight: t, cellRenderConfig: n, cellWidth: r, cols: i, context: a, editorAssembly: o, gridStart: s, isCellSelected: l, rows: u, rulerHeight: d, scrollLeft: f, scrollTop: p, searchRenderState: m, startCol: h, startRow: g, viewportHeight: _, viewportWidth: v }) {
|
|
664
|
+
let y = !1, b = !1, { highlightedSearchMatchFlags: x, highlightedSearchMatchPath: S, highlightedSearchRowFlags: C, searchMatchFlags: w, searchMatchPath: T, searchRowFlags: E } = m;
|
|
665
|
+
for (let m = 0; m < u; m++) {
|
|
666
|
+
let u = (g + m) * t + d - p;
|
|
667
|
+
if (!(u + t < d || u > _)) for (let d = 0; d < i; d++) {
|
|
668
|
+
let p = (h + d) * r + s - f;
|
|
669
|
+
if (p + r < s || p > v) continue;
|
|
670
|
+
let _ = c.drawCell({
|
|
671
|
+
bytes: e,
|
|
672
|
+
cellHeight: t,
|
|
673
|
+
cellRenderConfig: n,
|
|
674
|
+
cellWidth: r,
|
|
675
|
+
col: d,
|
|
676
|
+
cols: i,
|
|
677
|
+
context: a,
|
|
678
|
+
editorAssembly: o,
|
|
679
|
+
highlightedSearchMatchFlags: x,
|
|
680
|
+
highlightedSearchMatchPath: S,
|
|
681
|
+
highlightedSearchRowFlags: C,
|
|
682
|
+
isCellSelected: l,
|
|
683
|
+
row: m,
|
|
684
|
+
searchMatchFlags: w,
|
|
685
|
+
searchMatchPath: T,
|
|
686
|
+
searchRowFlags: E,
|
|
687
|
+
startCol: h,
|
|
688
|
+
startRow: g,
|
|
689
|
+
x: p,
|
|
690
|
+
y: u
|
|
691
|
+
});
|
|
692
|
+
b ||= _.hasSearchMatches, y ||= _.hasHighlightedSearchMatches;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
return {
|
|
696
|
+
hasHighlightedSearchMatches: y,
|
|
697
|
+
hasSearchMatches: b
|
|
698
|
+
};
|
|
699
|
+
}
|
|
643
700
|
static getCanvasContext(e) {
|
|
644
701
|
let t = e.getContext("2d");
|
|
645
702
|
if (!t) throw Error("Failed to acquire 2D canvas context.");
|
|
646
703
|
return t;
|
|
647
704
|
}
|
|
705
|
+
static getCellRenderConfig({ aminoAcidCodonOverlay: e, aminoAcidPalette: t, meta: n, nucleotidePalette: r, readingFrame: i, readingMode: o }) {
|
|
706
|
+
let s = o ?? a.NUCLEOTIDE, c = e && s !== a.NUCLEOTIDE ? s : a.NUCLEOTIDE;
|
|
707
|
+
return {
|
|
708
|
+
aminoAcidCodonOverlay: e,
|
|
709
|
+
aminoAcidPalette: t,
|
|
710
|
+
meta: n,
|
|
711
|
+
nucleotidePalette: r,
|
|
712
|
+
readingFrame: i ?? 1,
|
|
713
|
+
readingMode: c
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
static getCellRenderData({ bytes: e, cellCol: t, cellRenderConfig: n, cellRow: r, col: i, cols: o, row: c }) {
|
|
717
|
+
let { aminoAcidCodonOverlay: l, aminoAcidPalette: u, meta: d, nucleotidePalette: f, readingFrame: p, readingMode: m } = n, h = e[c * o + i], g;
|
|
718
|
+
l && r < d.sequenceCount && t < d.alignmentWidth && (g = l[r * d.alignmentWidth + t]);
|
|
719
|
+
let _ = m === a.AMINO_ACIDS || m === a.NUCLEOTIDE_PLUS_AMINO_ACIDS, v = _ ? g : h, y = h;
|
|
720
|
+
m === a.AMINO_ACIDS && (y = g, g !== void 0 && t >= p - 1 && (t - (p - 1)) % 3 != 1 && (y = void 0));
|
|
721
|
+
let b = y === void 0 ? "" : String.fromCharCode(y), x = v === void 0 ? "" : String.fromCharCode(v), S = _ ? u : f, C = m === a.NUCLEOTIDE_PLUS_AMINO_ACIDS ? f : S, w = s.paletteEntryFor(S, x), T = s.paletteEntryFor(C, y === void 0 ? "" : String.fromCharCode(y));
|
|
722
|
+
return {
|
|
723
|
+
colorByte: v,
|
|
724
|
+
colors: {
|
|
725
|
+
background: w.background,
|
|
726
|
+
backgroundSelected: w.backgroundSelected,
|
|
727
|
+
foreground: T.foreground,
|
|
728
|
+
foregroundSelected: T.foregroundSelected
|
|
729
|
+
},
|
|
730
|
+
label: b
|
|
731
|
+
};
|
|
732
|
+
}
|
|
648
733
|
static searchHitAt(e, t) {
|
|
649
734
|
return e?.positions[t] ?? null;
|
|
650
735
|
}
|
|
651
|
-
static searchHitContainsCell(e, t, n,
|
|
652
|
-
return e.matrix_type ===
|
|
736
|
+
static searchHitContainsCell(e, t, n, r) {
|
|
737
|
+
return e.matrix_type === i.NUCLEOTIDE && e.row === n && r >= e.col && r < e.col + Math.max(1, t.length);
|
|
653
738
|
}
|
|
654
739
|
};
|
|
655
|
-
export {
|
|
740
|
+
export { J as EditorUtil };
|
|
656
741
|
|
|
657
742
|
//# sourceMappingURL=index.js.map
|