@rivm-loculus-tools/sequence-editor 0.1.5 → 0.2.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/EditorWorkerService.js +12 -11
- package/dist/_chunks/EditorWorkerService.js.map +1 -1
- package/dist/_chunks/SequenceEditor.js +362 -495
- package/dist/_chunks/SequenceEditor.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageDrawer.js +160 -49577
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
- package/dist/_chunks/comlink.js +228 -0
- package/dist/_chunks/comlink.js.map +1 -0
- package/dist/_chunks/react.js +11 -0
- package/dist/_chunks/react.js.map +1 -0
- package/dist/_chunks/sequenceEditorStore.js +40 -273
- package/dist/_chunks/sequenceEditorStore.js.map +1 -1
- package/dist/assets/index-Dn92arD_.js +8 -0
- package/dist/assets/index-Dn92arD_.js.map +1 -0
- package/dist/classes/services/EditorWorkerService/index.js +1 -2
- package/dist/classes/services/SequenceEditorEventBusService/index.js +16 -2
- package/dist/classes/services/SequenceEditorEventBusService/index.js.map +1 -0
- package/dist/classes/workers/EngineWorker/index.js +3 -2
- package/dist/classes/workers/EngineWorker/index.js.map +1 -1
- package/dist/components/app/App/index.js +15 -951
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/pages/SequenceEditorErrorPage/index.js +6 -6
- package/dist/components/pages/SequenceEditorErrorPage/index.js.map +1 -1
- package/dist/components/pages/SequenceEditorMainPage/index.js +61 -2
- package/dist/components/pages/SequenceEditorMainPage/index.js.map +1 -0
- package/dist/components/ui/SequenceEditor/index.js +1 -2
- package/dist/components/ui/SequenceEditorPage/index.js +8 -8
- package/dist/components/ui/SequenceEditorPage/index.js.map +1 -1
- package/dist/components/ui/SequenceEditorPageDrawer/index.js +1 -2
- package/dist/components/ui/SequenceEditorPageHeader/index.js +60 -2
- package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorSearchBar/index.js +27 -2
- package/dist/components/ui/SequenceEditorSearchBar/index.js.map +1 -0
- package/dist/constants/editor.js.map +1 -1
- package/dist/constants/keyboard.js +1 -1
- package/dist/constants/keyboard.js.map +1 -1
- package/dist/constants/palette.js.map +1 -1
- package/dist/models/editor.js.map +1 -1
- package/dist/models/model.js.map +1 -1
- package/dist/models/palette.js.map +1 -1
- package/dist/stores/sequenceEditorStore/index.js +1 -2
- package/dist/utils/EditorUtil/index.js +158 -150
- package/dist/utils/EditorUtil/index.js.map +1 -1
- package/dist/utils/PaletteUtil/index.js.map +1 -1
- package/package.json +52 -29
- package/dist/_chunks/Box.js +0 -6737
- package/dist/_chunks/Box.js.map +0 -1
- package/dist/_chunks/Close.js +0 -7
- package/dist/_chunks/Close.js.map +0 -1
- package/dist/_chunks/KeyboardArrowDown.js +0 -1023
- package/dist/_chunks/KeyboardArrowDown.js.map +0 -1
- package/dist/_chunks/Redo.js +0 -2559
- package/dist/_chunks/Redo.js.map +0 -1
- package/dist/_chunks/SequenceEditorEventBusService.js +0 -102
- package/dist/_chunks/SequenceEditorEventBusService.js.map +0 -1
- package/dist/_chunks/SequenceEditorMainPage.js +0 -552
- package/dist/_chunks/SequenceEditorMainPage.js.map +0 -1
- package/dist/_chunks/SequenceEditorPageHeader.js +0 -236
- package/dist/_chunks/SequenceEditorPageHeader.js.map +0 -1
- package/dist/_chunks/SequenceEditorSearchBar.js +0 -143
- package/dist/_chunks/SequenceEditorSearchBar.js.map +0 -1
- package/dist/_chunks/TestIdUtil.js +0 -4695
- package/dist/_chunks/TestIdUtil.js.map +0 -1
- package/dist/_chunks/TextField.js +0 -3083
- package/dist/_chunks/TextField.js.map +0 -1
- package/dist/_chunks/rolldown-runtime.js +0 -13
- package/dist/_chunks/sequence_editor.js +0 -517
- package/dist/_chunks/sequence_editor.js.map +0 -1
- package/dist/_chunks/withDialog.js +0 -289
- package/dist/_chunks/withDialog.js.map +0 -1
- package/dist/assets/index-C5rc-pJV.js +0 -8
- package/dist/assets/index-C5rc-pJV.js.map +0 -1
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { DEFAULT_GRID_GEOMETRY as o } from "../../constants/editor.js";
|
|
1
|
+
import { PaletteUtil as e } from "../PaletteUtil/index.js";
|
|
2
|
+
import { EDITOR_DIRECTION as t } from "../../models/editor.js";
|
|
3
|
+
import { EDITOR_PATH_PROPERTIES_TYPE as n, MATRIX_TYPE as r } from "../../models/model.js";
|
|
4
|
+
import { DEFAULT_GRID_GEOMETRY as i } from "../../constants/editor.js";
|
|
6
5
|
import "../../constants/index.js";
|
|
7
|
-
//#region
|
|
8
|
-
var s =
|
|
6
|
+
//#region \0rolldown/runtime.js
|
|
7
|
+
var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescriptor, c = Object.getOwnPropertyNames, l = Object.getPrototypeOf, u = Object.prototype.hasOwnProperty, d = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), f = (e, t, n, r) => {
|
|
8
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = c(t), a = 0, l = i.length, d; a < l; a++) d = i[a], !u.call(e, d) && d !== n && o(e, d, {
|
|
9
|
+
get: ((e) => t[e]).bind(null, d),
|
|
10
|
+
enumerable: !(r = s(t, d)) || r.enumerable
|
|
11
|
+
});
|
|
12
|
+
return e;
|
|
13
|
+
}, p = (e, t, n) => (n = e == null ? {} : a(l(e)), f(t || !e || !e.__esModule || !u.call(e, "default") ? o(n, "default", {
|
|
14
|
+
value: e,
|
|
15
|
+
enumerable: !0
|
|
16
|
+
}) : n, e)), m = /* @__PURE__ */ d(((e, t) => {
|
|
9
17
|
var n = Math.floor;
|
|
10
18
|
function r(e, t) {
|
|
11
19
|
var r = "";
|
|
@@ -16,23 +24,23 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
16
24
|
return r;
|
|
17
25
|
}
|
|
18
26
|
t.exports = r;
|
|
19
|
-
})),
|
|
27
|
+
})), h = /* @__PURE__ */ d(((e, t) => {
|
|
20
28
|
t.exports = typeof global == "object" && global && global.Object === Object && global;
|
|
21
|
-
})),
|
|
22
|
-
var n =
|
|
29
|
+
})), g = /* @__PURE__ */ d(((e, t) => {
|
|
30
|
+
var n = h(), r = typeof self == "object" && self && self.Object === Object && self;
|
|
23
31
|
t.exports = n || r || Function("return this")();
|
|
24
|
-
})),
|
|
25
|
-
t.exports =
|
|
26
|
-
})),
|
|
32
|
+
})), _ = /* @__PURE__ */ d(((e, t) => {
|
|
33
|
+
t.exports = g().Symbol;
|
|
34
|
+
})), v = /* @__PURE__ */ d(((e, t) => {
|
|
27
35
|
function n(e, t) {
|
|
28
36
|
for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
|
|
29
37
|
return i;
|
|
30
38
|
}
|
|
31
39
|
t.exports = n;
|
|
32
|
-
})),
|
|
40
|
+
})), y = /* @__PURE__ */ d(((e, t) => {
|
|
33
41
|
t.exports = Array.isArray;
|
|
34
|
-
})),
|
|
35
|
-
var n =
|
|
42
|
+
})), b = /* @__PURE__ */ d(((e, t) => {
|
|
43
|
+
var n = _(), r = Object.prototype, i = r.hasOwnProperty, a = r.toString, o = n ? n.toStringTag : void 0;
|
|
36
44
|
function s(e) {
|
|
37
45
|
var t = i.call(e, o), n = e[o];
|
|
38
46
|
try {
|
|
@@ -43,31 +51,31 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
43
51
|
return r && (t ? e[o] = n : delete e[o]), s;
|
|
44
52
|
}
|
|
45
53
|
t.exports = s;
|
|
46
|
-
})),
|
|
54
|
+
})), x = /* @__PURE__ */ d(((e, t) => {
|
|
47
55
|
var n = Object.prototype.toString;
|
|
48
56
|
function r(e) {
|
|
49
57
|
return n.call(e);
|
|
50
58
|
}
|
|
51
59
|
t.exports = r;
|
|
52
|
-
})),
|
|
53
|
-
var n =
|
|
60
|
+
})), S = /* @__PURE__ */ d(((e, t) => {
|
|
61
|
+
var n = _(), r = b(), i = x(), a = "[object Null]", o = "[object Undefined]", s = n ? n.toStringTag : void 0;
|
|
54
62
|
function c(e) {
|
|
55
63
|
return e == null ? e === void 0 ? o : a : s && s in Object(e) ? r(e) : i(e);
|
|
56
64
|
}
|
|
57
65
|
t.exports = c;
|
|
58
|
-
})),
|
|
66
|
+
})), C = /* @__PURE__ */ d(((e, t) => {
|
|
59
67
|
function n(e) {
|
|
60
68
|
return typeof e == "object" && !!e;
|
|
61
69
|
}
|
|
62
70
|
t.exports = n;
|
|
63
|
-
})),
|
|
64
|
-
var n =
|
|
71
|
+
})), w = /* @__PURE__ */ d(((e, t) => {
|
|
72
|
+
var n = S(), r = C(), i = "[object Symbol]";
|
|
65
73
|
function a(e) {
|
|
66
74
|
return typeof e == "symbol" || r(e) && n(e) == i;
|
|
67
75
|
}
|
|
68
76
|
t.exports = a;
|
|
69
|
-
})),
|
|
70
|
-
var n =
|
|
77
|
+
})), T = /* @__PURE__ */ d(((e, t) => {
|
|
78
|
+
var n = _(), r = v(), i = y(), a = w(), o = 1 / 0, s = n ? n.prototype : void 0, c = s ? s.toString : void 0;
|
|
71
79
|
function l(e) {
|
|
72
80
|
if (typeof e == "string") return e;
|
|
73
81
|
if (i(e)) return r(e, l) + "";
|
|
@@ -76,7 +84,7 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
76
84
|
return t == "0" && 1 / e == -o ? "-0" : t;
|
|
77
85
|
}
|
|
78
86
|
t.exports = l;
|
|
79
|
-
})),
|
|
87
|
+
})), E = /* @__PURE__ */ d(((e, t) => {
|
|
80
88
|
function n(e, t, n) {
|
|
81
89
|
var r = -1, i = e.length;
|
|
82
90
|
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;
|
|
@@ -84,29 +92,29 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
84
92
|
return a;
|
|
85
93
|
}
|
|
86
94
|
t.exports = n;
|
|
87
|
-
})),
|
|
88
|
-
var n =
|
|
95
|
+
})), D = /* @__PURE__ */ d(((e, t) => {
|
|
96
|
+
var n = E();
|
|
89
97
|
function r(e, t, r) {
|
|
90
98
|
var i = e.length;
|
|
91
99
|
return r = r === void 0 ? i : r, !t && r >= i ? e : n(e, t, r);
|
|
92
100
|
}
|
|
93
101
|
t.exports = r;
|
|
94
|
-
})),
|
|
102
|
+
})), O = /* @__PURE__ */ d(((e, t) => {
|
|
95
103
|
var n = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");
|
|
96
104
|
function r(e) {
|
|
97
105
|
return n.test(e);
|
|
98
106
|
}
|
|
99
107
|
t.exports = r;
|
|
100
|
-
})),
|
|
108
|
+
})), k = /* @__PURE__ */ d(((e, t) => {
|
|
101
109
|
function n(e) {
|
|
102
110
|
return function(t) {
|
|
103
111
|
return t?.[e];
|
|
104
112
|
};
|
|
105
113
|
}
|
|
106
114
|
t.exports = n;
|
|
107
|
-
})),
|
|
108
|
-
t.exports =
|
|
109
|
-
})),
|
|
115
|
+
})), A = /* @__PURE__ */ d(((e, t) => {
|
|
116
|
+
t.exports = k()("length");
|
|
117
|
+
})), j = /* @__PURE__ */ d(((e, t) => {
|
|
110
118
|
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 + "(?:" + [
|
|
111
119
|
l,
|
|
112
120
|
u,
|
|
@@ -123,18 +131,18 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
123
131
|
return t;
|
|
124
132
|
}
|
|
125
133
|
t.exports = y;
|
|
126
|
-
})),
|
|
127
|
-
var n =
|
|
134
|
+
})), M = /* @__PURE__ */ d(((e, t) => {
|
|
135
|
+
var n = A(), r = O(), i = j();
|
|
128
136
|
function a(e) {
|
|
129
137
|
return r(e) ? i(e) : n(e);
|
|
130
138
|
}
|
|
131
139
|
t.exports = a;
|
|
132
|
-
})),
|
|
140
|
+
})), N = /* @__PURE__ */ d(((e, t) => {
|
|
133
141
|
function n(e) {
|
|
134
142
|
return e.split("");
|
|
135
143
|
}
|
|
136
144
|
t.exports = n;
|
|
137
|
-
})),
|
|
145
|
+
})), P = /* @__PURE__ */ d(((e, t) => {
|
|
138
146
|
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 + "(?:" + [
|
|
139
147
|
l,
|
|
140
148
|
u,
|
|
@@ -150,43 +158,43 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
150
158
|
return e.match(v) || [];
|
|
151
159
|
}
|
|
152
160
|
t.exports = y;
|
|
153
|
-
})),
|
|
154
|
-
var n =
|
|
161
|
+
})), F = /* @__PURE__ */ d(((e, t) => {
|
|
162
|
+
var n = N(), r = O(), i = P();
|
|
155
163
|
function a(e) {
|
|
156
164
|
return r(e) ? i(e) : n(e);
|
|
157
165
|
}
|
|
158
166
|
t.exports = a;
|
|
159
|
-
})),
|
|
160
|
-
var n =
|
|
161
|
-
function
|
|
167
|
+
})), I = /* @__PURE__ */ d(((e, t) => {
|
|
168
|
+
var n = m(), r = T(), i = D(), a = O(), o = M(), s = F(), c = Math.ceil;
|
|
169
|
+
function l(e, t) {
|
|
162
170
|
t = t === void 0 ? " " : r(t);
|
|
163
|
-
var
|
|
164
|
-
if (
|
|
165
|
-
var u = n(t,
|
|
166
|
-
return a(t) ? i(
|
|
171
|
+
var l = t.length;
|
|
172
|
+
if (l < 2) return l ? n(t, e) : t;
|
|
173
|
+
var u = n(t, c(e / o(t)));
|
|
174
|
+
return a(t) ? i(s(u), 0, e).join("") : u.slice(0, e);
|
|
167
175
|
}
|
|
168
|
-
t.exports =
|
|
169
|
-
})),
|
|
176
|
+
t.exports = l;
|
|
177
|
+
})), L = /* @__PURE__ */ d(((e, t) => {
|
|
170
178
|
var n = /\s/;
|
|
171
179
|
function r(e) {
|
|
172
180
|
for (var t = e.length; t-- && n.test(e.charAt(t)););
|
|
173
181
|
return t;
|
|
174
182
|
}
|
|
175
183
|
t.exports = r;
|
|
176
|
-
})),
|
|
177
|
-
var n =
|
|
184
|
+
})), R = /* @__PURE__ */ d(((e, t) => {
|
|
185
|
+
var n = L(), r = /^\s+/;
|
|
178
186
|
function i(e) {
|
|
179
187
|
return e && e.slice(0, n(e) + 1).replace(r, "");
|
|
180
188
|
}
|
|
181
189
|
t.exports = i;
|
|
182
|
-
})),
|
|
190
|
+
})), z = /* @__PURE__ */ d(((e, t) => {
|
|
183
191
|
function n(e) {
|
|
184
192
|
var t = typeof e;
|
|
185
193
|
return e != null && (t == "object" || t == "function");
|
|
186
194
|
}
|
|
187
195
|
t.exports = n;
|
|
188
|
-
})),
|
|
189
|
-
var n =
|
|
196
|
+
})), B = /* @__PURE__ */ d(((e, t) => {
|
|
197
|
+
var n = R(), r = z(), i = w(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
|
|
190
198
|
function u(e) {
|
|
191
199
|
if (typeof e == "number") return e;
|
|
192
200
|
if (i(e)) return a;
|
|
@@ -200,35 +208,35 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
200
208
|
return u || c.test(e) ? l(e.slice(2), u ? 2 : 8) : o.test(e) ? a : +e;
|
|
201
209
|
}
|
|
202
210
|
t.exports = u;
|
|
203
|
-
})),
|
|
204
|
-
var n =
|
|
211
|
+
})), V = /* @__PURE__ */ d(((e, t) => {
|
|
212
|
+
var n = B(), r = 1 / 0, i = 17976931348623157e292;
|
|
205
213
|
function a(e) {
|
|
206
214
|
return e ? (e = n(e), e === r || e === -r ? (e < 0 ? -1 : 1) * i : e === e ? e : 0) : e === 0 ? e : 0;
|
|
207
215
|
}
|
|
208
216
|
t.exports = a;
|
|
209
|
-
})),
|
|
210
|
-
var n =
|
|
217
|
+
})), H = /* @__PURE__ */ d(((e, t) => {
|
|
218
|
+
var n = V();
|
|
211
219
|
function r(e) {
|
|
212
220
|
var t = n(e), r = t % 1;
|
|
213
221
|
return t === t ? r ? t - r : t : 0;
|
|
214
222
|
}
|
|
215
223
|
t.exports = r;
|
|
216
|
-
})),
|
|
217
|
-
var n =
|
|
224
|
+
})), U = /* @__PURE__ */ d(((e, t) => {
|
|
225
|
+
var n = T();
|
|
218
226
|
function r(e) {
|
|
219
227
|
return e == null ? "" : n(e);
|
|
220
228
|
}
|
|
221
229
|
t.exports = r;
|
|
222
|
-
})),
|
|
223
|
-
var n =
|
|
230
|
+
})), W = /* @__PURE__ */ p((/* @__PURE__ */ d(((e, t) => {
|
|
231
|
+
var n = I(), r = M(), i = H(), a = U();
|
|
224
232
|
function o(e, t, o) {
|
|
225
233
|
e = a(e), t = i(t);
|
|
226
234
|
var s = t ? r(e) : 0;
|
|
227
235
|
return t && s < t ? n(t - s, o) + e : e;
|
|
228
236
|
}
|
|
229
237
|
t.exports = o;
|
|
230
|
-
})))(), 1),
|
|
231
|
-
static drawCanvas({ canvasElement: t, devicePixelRatio: r, geometry:
|
|
238
|
+
})))(), 1), G = class a {
|
|
239
|
+
static drawCanvas({ canvasElement: t, devicePixelRatio: r, geometry: i, meta: o, palette: s, rowNames: c, rowNamesStartRow: l, scrollLeft: u, scrollTop: d, searchResult: f, searchResultHighlightedIndex: p, selection: m, viewport: h, viewportHeight: g, viewportWidth: _ }) {
|
|
232
240
|
let v = {
|
|
233
241
|
cells: { pathPropertiesMap: /* @__PURE__ */ new Map() },
|
|
234
242
|
divider: { pathPropertiesMap: /* @__PURE__ */ new Map() },
|
|
@@ -238,102 +246,102 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
238
246
|
if (!t) return v;
|
|
239
247
|
let y = t.getContext("2d");
|
|
240
248
|
if (!y) return v;
|
|
241
|
-
let b = o.sequenceCount.toString().length, x = (e) => m?.rows?.includes(e) ?? !1, S = (e, t) => !!(m?.cells && t >= m.cells.startCol && t <= m.cells.endCol && e >= m.cells.startRow && e <= m.cells.endRow) || !!m?.cols?.includes(t) || !!x(e), C = f && p !== null ?
|
|
242
|
-
return
|
|
249
|
+
let b = o.sequenceCount.toString().length, x = (e) => m?.rows?.includes(e) ?? !1, S = (e, t) => !!(m?.cells && t >= m.cells.startCol && t <= m.cells.endCol && e >= m.cells.startRow && e <= m.cells.endRow) || !!m?.cols?.includes(t) || !!x(e), C = f && p !== null ? a.searchHitAt(f, p) : null;
|
|
250
|
+
return a.draw(t, r, () => {
|
|
243
251
|
y.clearRect(0, 0, t.width, t.height);
|
|
244
|
-
let { cellHeight: r, cellWidth: o, dividerWidth: p, labelWidth: w, rulerHeight: T } =
|
|
252
|
+
let { cellHeight: r, cellWidth: o, dividerWidth: p, labelWidth: w, rulerHeight: T } = i, E = w + p, { bytes: D, cols: O, rows: k, startCol: A, startRow: j } = h, M = (f?.positions.length ?? 0) > 0, N = M ? new Uint8Array(k * O) : null, P = C ? new Uint8Array(k * O) : null, F = M ? new Path2D() : null, I = C ? new Path2D() : null, L = !1, R = !1, z = (e, t) => {
|
|
245
253
|
if (!f) return;
|
|
246
|
-
let
|
|
247
|
-
if (o < 0 || o >= k ||
|
|
248
|
-
let s = o * O +
|
|
249
|
-
|
|
254
|
+
let n = Math.max(1, f.query.length), r = Math.max(A, e.col), i = Math.min(A + O, e.col + n), o = e.row - j;
|
|
255
|
+
if (o < 0 || o >= k || r >= i || !a.searchHitContainsCell(e, f.query, e.row, r)) return;
|
|
256
|
+
let s = o * O + r - A;
|
|
257
|
+
t.fill(1, s, s + i - r);
|
|
250
258
|
};
|
|
251
|
-
f && N && (f.positions.forEach((e) =>
|
|
252
|
-
for (let
|
|
253
|
-
let
|
|
254
|
-
if (!(
|
|
259
|
+
f && N && (f.positions.forEach((e) => z(e, N)), C && P && z(C, P)), y.font = "12px monospace", y.textAlign = "center", y.textBaseline = "middle";
|
|
260
|
+
for (let t = 0; t < k; t++) {
|
|
261
|
+
let i = (j + t) * r + T - d;
|
|
262
|
+
if (!(i + r < T || i > g)) for (let a = 0; a < O; a++) {
|
|
255
263
|
let c = (A + a) * o + E - u;
|
|
256
264
|
if (c + o < E || c > _) continue;
|
|
257
|
-
let l = D[
|
|
265
|
+
let l = D[t * O + a], d = A + a, f = j + t, p = l ?? "", m = String.fromCharCode(p), h = e.paletteEntryFor(s, m), g = h.background;
|
|
258
266
|
l === null ? g = "#e9eef2" : m === " " && (g = "#f7f8f9");
|
|
259
267
|
let b = h.foreground;
|
|
260
268
|
S(f, d) && (g = h.backgroundSelected, b = h.foregroundSelected);
|
|
261
|
-
let x =
|
|
262
|
-
T.rect(c,
|
|
269
|
+
let x = t * O + a, C = N?.[x] === 1, w = P?.[x] === 1, T = new Path2D();
|
|
270
|
+
T.rect(c, i, o, r), T.closePath(), v.cells.pathPropertiesMap.set(T, {
|
|
263
271
|
col: d,
|
|
264
272
|
row: f,
|
|
265
|
-
type:
|
|
266
|
-
}), y.fillStyle = g, y.fill(T), w && (y.fillStyle = "rgba(255, 193, 7, 0.35)", y.fillRect(c + 2,
|
|
273
|
+
type: n.CELL
|
|
274
|
+
}), y.fillStyle = g, y.fill(T), w && (y.fillStyle = "rgba(255, 193, 7, 0.35)", y.fillRect(c + 2, i + 2, Math.max(0, o - 4), Math.max(0, r - 4))), y.fillStyle = b, y.fillText(m, c + o / 2, i + r / 2), C && F && (L = !0, F.rect(c + .5, i + .5, o - 1, r - 1), w && I && (R = !0, I.rect(c + 1, i + 1, o - 2, r - 2)));
|
|
267
275
|
}
|
|
268
276
|
}
|
|
269
|
-
|
|
270
|
-
let
|
|
277
|
+
L && F && (y.strokeStyle = "#000000", y.lineWidth = 1, y.stroke(F)), R && I && (y.lineWidth = 2, y.stroke(I)), y.fillStyle = "#edf2f6", y.fillRect(0, 0, _, T), y.font = "12px monospace", y.textBaseline = "middle";
|
|
278
|
+
let B = [];
|
|
271
279
|
y.strokeStyle = "#9fb3c8", y.lineWidth = 1, y.beginPath();
|
|
272
280
|
for (let e = 0; e < O; e++) {
|
|
273
281
|
let t = (A + e + 1) % 10 == 0;
|
|
274
|
-
t &&
|
|
275
|
-
let
|
|
276
|
-
|
|
282
|
+
t && B.push(e);
|
|
283
|
+
let r = (A + e) * o + E - u, i = new Path2D();
|
|
284
|
+
i.rect(r, 0, o, T), i.closePath(), v.ruler.pathPropertiesMap.set(i, {
|
|
277
285
|
col: A + e,
|
|
278
|
-
type:
|
|
286
|
+
type: n.RULER
|
|
279
287
|
});
|
|
280
|
-
let a =
|
|
288
|
+
let a = r + .5, s = t ? 8 : 4;
|
|
281
289
|
y.moveTo(a, T), y.lineTo(a, T - s);
|
|
282
290
|
}
|
|
283
|
-
y.stroke(), y.fillStyle = "#486581", y.textAlign = "center",
|
|
291
|
+
y.stroke(), y.fillStyle = "#486581", y.textAlign = "center", B.forEach((e) => {
|
|
284
292
|
let t = (A + e) * o + E - u, n = String(A + e + 1), r = y.measureText(n).width;
|
|
285
293
|
t - r / 2 < E || t + r / 2 > _ || y.fillText(n, t, T / 2);
|
|
286
294
|
}), y.textAlign = "start", y.strokeStyle = "#bcccdc", y.lineWidth = 1, y.beginPath(), y.moveTo(E + .5, 0), y.lineTo(E + .5, g), y.moveTo(0, T + .5), y.lineTo(_, T + .5), y.stroke(), y.fillStyle = "#edf2f6", y.fillRect(0, 0, E, T), y.fillStyle = "#d9e2ec", y.fillRect(w, 0, p, g);
|
|
287
|
-
let
|
|
288
|
-
|
|
295
|
+
let V = new Path2D();
|
|
296
|
+
V.rect(w, 0, p, g), V.closePath(), v.divider.pathPropertiesMap.set(V, { type: n.DIVIDER }), y.fillStyle = "#f8fafb", y.fillRect(0, T, w, g - T), y.font = "12px monospace", y.textBaseline = "middle", y.save(), y.beginPath(), y.rect(0, T, w, g - T), y.clip();
|
|
289
297
|
for (let e = 0; e < k; e++) {
|
|
290
298
|
let t = (j + e) * r + T - d;
|
|
291
299
|
if (t + r < T || t > g) continue;
|
|
292
|
-
let
|
|
293
|
-
|
|
300
|
+
let i = new Path2D();
|
|
301
|
+
i.rect(0, t, w, r), i.closePath(), v.labels.pathPropertiesMap.set(i, {
|
|
294
302
|
row: j + e,
|
|
295
|
-
type:
|
|
303
|
+
type: n.LABEL
|
|
296
304
|
});
|
|
297
305
|
let a = j + e - l, o = j + e, s = !!m?.cols || !!(m?.cells && o >= m.cells.startRow && o <= m.cells.endRow) || x(o);
|
|
298
|
-
y.fillStyle = s ? "#1565c0" : "#f8fafb", y.fillRect(0, t, w, r), y.fillStyle = s ? "#ffffff" : "#334e68", y.fillText(`${(0,
|
|
306
|
+
y.fillStyle = s ? "#1565c0" : "#f8fafb", y.fillRect(0, t, w, r), y.fillStyle = s ? "#ffffff" : "#334e68", y.fillText(`${(0, W.default)(String(j + e + 1), b, "0")}: ${c[a] ?? ""}`, 8, t + r / 2);
|
|
299
307
|
}
|
|
300
308
|
y.restore();
|
|
301
309
|
}), v;
|
|
302
310
|
}
|
|
303
|
-
static getExpandedSelection(e,
|
|
311
|
+
static getExpandedSelection(e, n, r, i) {
|
|
304
312
|
let a = e.cells;
|
|
305
313
|
if (a) {
|
|
306
|
-
if (
|
|
307
|
-
let e =
|
|
314
|
+
if (r === t.LEFT) {
|
|
315
|
+
let e = n.cells;
|
|
308
316
|
if (!e) return null;
|
|
309
|
-
let
|
|
317
|
+
let t = a.startCol < e.startCol || a.endCol <= e.startCol, r = t ? a.startCol - 1 : a.startCol, i = t ? a.endCol : a.endCol - 1;
|
|
310
318
|
return r < 0 ? null : { cells: {
|
|
311
319
|
...a,
|
|
312
320
|
endCol: i,
|
|
313
321
|
startCol: r
|
|
314
322
|
} };
|
|
315
323
|
}
|
|
316
|
-
if (
|
|
317
|
-
let e =
|
|
324
|
+
if (r === t.RIGHT) {
|
|
325
|
+
let e = n.cells;
|
|
318
326
|
if (!e) return null;
|
|
319
|
-
let
|
|
327
|
+
let t = a.startCol < e.startCol ? a.startCol + 1 : a.startCol, r = a.startCol < e.startCol ? a.endCol : a.endCol + 1;
|
|
320
328
|
return r >= i.alignmentWidth ? null : { cells: {
|
|
321
329
|
...a,
|
|
322
330
|
endCol: r,
|
|
323
|
-
startCol:
|
|
331
|
+
startCol: t
|
|
324
332
|
} };
|
|
325
333
|
}
|
|
326
|
-
if (
|
|
327
|
-
let e =
|
|
334
|
+
if (r === t.UP) {
|
|
335
|
+
let e = n.cells;
|
|
328
336
|
if (!e) return null;
|
|
329
|
-
let
|
|
337
|
+
let t = a.startRow < e.startRow || a.endRow <= e.startRow, r = t ? a.startRow - 1 : a.startRow, i = t ? a.endRow : a.endRow - 1;
|
|
330
338
|
return r < 0 ? null : { cells: {
|
|
331
339
|
...a,
|
|
332
340
|
endRow: i,
|
|
333
341
|
startRow: r
|
|
334
342
|
} };
|
|
335
343
|
}
|
|
336
|
-
let e =
|
|
344
|
+
let e = n.cells;
|
|
337
345
|
if (!e) return null;
|
|
338
346
|
let o = a.startRow < e.startRow ? a.startRow + 1 : a.startRow, s = a.startRow < e.startRow ? a.endRow : a.endRow + 1;
|
|
339
347
|
return s >= i.sequenceCount ? null : { cells: {
|
|
@@ -344,32 +352,32 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
344
352
|
}
|
|
345
353
|
let o = e.cols;
|
|
346
354
|
if (o) {
|
|
347
|
-
if (o.length === 0 ||
|
|
348
|
-
let e = Math.min(...o), a = Math.max(...o), s =
|
|
355
|
+
if (o.length === 0 || r !== t.LEFT && r !== t.RIGHT) return null;
|
|
356
|
+
let e = Math.min(...o), a = Math.max(...o), s = n.cols;
|
|
349
357
|
if (!s || s.length === 0) return null;
|
|
350
358
|
let c = Math.min(...s);
|
|
351
|
-
return
|
|
359
|
+
return r === t.LEFT ? a > c ? { cols: o.slice(0, -1) } : e > 0 ? { cols: [e - 1, ...o] } : null : e < c ? { cols: o.slice(1) } : a < i.alignmentWidth - 1 ? { cols: [...o, a + 1] } : null;
|
|
352
360
|
}
|
|
353
361
|
return e.rows ? e : null;
|
|
354
362
|
}
|
|
355
|
-
static getMovedSelection(e,
|
|
363
|
+
static getMovedSelection(e, n, r) {
|
|
356
364
|
if (!e) return null;
|
|
357
|
-
let i =
|
|
358
|
-
if (o) return
|
|
365
|
+
let i = n === t.LEFT || n === t.UP ? -1 : 1, a = (e, t, n) => i < 0 ? e > 0 : t < n - 1, o = e.cells;
|
|
366
|
+
if (o) return n === t.LEFT || n === t.RIGHT ? a(o.startCol, o.endCol, r.alignmentWidth) ? { cells: {
|
|
359
367
|
endCol: o.endCol + i,
|
|
360
368
|
endRow: o.endRow,
|
|
361
369
|
startCol: o.startCol + i,
|
|
362
370
|
startRow: o.startRow
|
|
363
|
-
} } : null : a(o.startRow, o.endRow,
|
|
371
|
+
} } : null : a(o.startRow, o.endRow, r.sequenceCount) ? { cells: {
|
|
364
372
|
endCol: o.endCol,
|
|
365
373
|
endRow: o.endRow + i,
|
|
366
374
|
startCol: o.startCol,
|
|
367
375
|
startRow: o.startRow + i
|
|
368
376
|
} } : null;
|
|
369
377
|
let s = e.cols;
|
|
370
|
-
if (s) return
|
|
378
|
+
if (s) return n !== t.LEFT && n !== t.RIGHT || s.length === 0 || !a(Math.min(...s), Math.max(...s), r.alignmentWidth) ? null : { cols: s.map((e) => e + i) };
|
|
371
379
|
let c = e.rows;
|
|
372
|
-
return c ?
|
|
380
|
+
return c ? n !== t.UP && n !== t.DOWN || c.length === 0 || !a(Math.min(...c), Math.max(...c), r.sequenceCount) ? null : { rows: c.map((e) => e + i) } : null;
|
|
373
381
|
}
|
|
374
382
|
static getMutateArguments(e, t, n = 0) {
|
|
375
383
|
let r = e?.cells;
|
|
@@ -391,48 +399,48 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
391
399
|
startCol: 0 + n
|
|
392
400
|
};
|
|
393
401
|
}
|
|
394
|
-
static getPathPropertiesFromCanvas(
|
|
395
|
-
let { canvas:
|
|
396
|
-
for (let [e, t] of
|
|
397
|
-
for (let [e, t] of
|
|
398
|
-
for (let [e, t] of
|
|
399
|
-
for (let [e, t] of
|
|
402
|
+
static getPathPropertiesFromCanvas(e) {
|
|
403
|
+
let { canvas: t, devicePixelRatio: n, editorAssembly: r, event: i } = e, o = a.getCanvasContext(t), s = t.getBoundingClientRect(), c = t.width / s.width, l = t.height / s.height, u = (i.clientX - s.left) * c / n, d = (i.clientY - s.top) * l / n;
|
|
404
|
+
for (let [e, t] of r.cells.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
|
|
405
|
+
for (let [e, t] of r.ruler.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
|
|
406
|
+
for (let [e, t] of r.labels.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
|
|
407
|
+
for (let [e, t] of r.divider.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
|
|
400
408
|
}
|
|
401
|
-
static getPostUpsertSelection(e,
|
|
409
|
+
static getPostUpsertSelection(e, n) {
|
|
402
410
|
if (!e) return null;
|
|
403
|
-
let
|
|
411
|
+
let r = n === t.LEFT ? -1 : 1, i = e.cells;
|
|
404
412
|
if (i) return { cells: {
|
|
405
|
-
endCol: i.endCol +
|
|
413
|
+
endCol: i.endCol + r,
|
|
406
414
|
endRow: i.endRow,
|
|
407
|
-
startCol: i.startCol +
|
|
415
|
+
startCol: i.startCol + r,
|
|
408
416
|
startRow: i.startRow
|
|
409
417
|
} };
|
|
410
418
|
let a = e.cols;
|
|
411
|
-
if (a) return { cols: a.map((e) => e +
|
|
419
|
+
if (a) return { cols: a.map((e) => e + r) };
|
|
412
420
|
let o = e.rows;
|
|
413
421
|
return o ? { rows: o } : null;
|
|
414
422
|
}
|
|
415
|
-
static getRowsToMove(e,
|
|
423
|
+
static getRowsToMove(e, n, r) {
|
|
416
424
|
let i = e?.cells, a = e?.rows ?? (i ? Array.from({ length: i.endRow - i.startRow + 1 }, (e, t) => i.startRow + t) : void 0);
|
|
417
425
|
if (!a || a.length === 0) return;
|
|
418
426
|
let o = Math.min(...a), s = Math.max(...a);
|
|
419
|
-
if ((
|
|
427
|
+
if ((n !== t.UP || o !== 0) && (n !== t.DOWN || s !== r.sequenceCount - 1)) return a;
|
|
420
428
|
}
|
|
421
429
|
static getSelectionFromPathProperties(e) {
|
|
422
|
-
let { endPath: t, startPath:
|
|
423
|
-
if (
|
|
424
|
-
let e = Math.min(
|
|
425
|
-
return { cols: Array.from({ length:
|
|
430
|
+
let { endPath: t, startPath: r } = e;
|
|
431
|
+
if (r.type === n.RULER && (t.type === n.RULER || t.type === n.CELL)) {
|
|
432
|
+
let e = Math.min(r.col, t.col), n = Math.max(r.col, t.col);
|
|
433
|
+
return { cols: Array.from({ length: n - e + 1 }, (t, n) => e + n) };
|
|
426
434
|
}
|
|
427
|
-
if (
|
|
428
|
-
endCol: Math.max(
|
|
429
|
-
endRow: Math.max(
|
|
430
|
-
startCol: Math.min(
|
|
431
|
-
startRow: Math.min(
|
|
435
|
+
if (r.type === n.CELL && t.type === n.CELL) return { cells: {
|
|
436
|
+
endCol: Math.max(r.col, t.col),
|
|
437
|
+
endRow: Math.max(r.row, t.row),
|
|
438
|
+
startCol: Math.min(r.col, t.col),
|
|
439
|
+
startRow: Math.min(r.row, t.row)
|
|
432
440
|
} };
|
|
433
|
-
if (
|
|
434
|
-
let e = Math.min(
|
|
435
|
-
return { rows: Array.from({ length:
|
|
441
|
+
if (r.type === n.LABEL && t.type === n.LABEL) {
|
|
442
|
+
let e = Math.min(r.row, t.row), n = Math.max(r.row, t.row);
|
|
443
|
+
return { rows: Array.from({ length: n - e + 1 }, (t, n) => e + n) };
|
|
436
444
|
}
|
|
437
445
|
}
|
|
438
446
|
static getStatusBarSelectionStats(e, t = null) {
|
|
@@ -486,7 +494,7 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
486
494
|
};
|
|
487
495
|
}
|
|
488
496
|
static getVisibleGridRange(e) {
|
|
489
|
-
let { geometry: t =
|
|
497
|
+
let { geometry: t = i, numCols: n, numRows: r, scrollLeft: a, scrollTop: o, viewportHeight: s, viewportWidth: c } = e, l = t.labelWidth + t.dividerWidth, u = Math.max(0, Math.floor(a / 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, o - t.rulerHeight) / t.cellHeight)), p = Math.min(r, f + Math.max(1, Math.ceil((s - t.rulerHeight) / t.cellHeight) + 1));
|
|
490
498
|
return {
|
|
491
499
|
cache: {
|
|
492
500
|
endCol: Math.min(n, d + t.numOverscanCols),
|
|
@@ -513,18 +521,18 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
513
521
|
top: i === null ? n.scrollTop : Math.max(0, i - 1) * t.cellHeight
|
|
514
522
|
});
|
|
515
523
|
}
|
|
516
|
-
static scrollToSearchResult(
|
|
517
|
-
let { geometry:
|
|
518
|
-
o &&
|
|
519
|
-
geometry:
|
|
520
|
-
scrollContainer:
|
|
524
|
+
static scrollToSearchResult(e) {
|
|
525
|
+
let { geometry: t, scrollContainer: n, searchResult: r, searchResultHighlightedIndex: i } = e, o = r && i !== null ? a.searchHitAt(r, i) : null;
|
|
526
|
+
o && a.scrollToPosition({
|
|
527
|
+
geometry: t,
|
|
528
|
+
scrollContainer: n,
|
|
521
529
|
x: o.col + 1,
|
|
522
530
|
y: o.row + 1
|
|
523
531
|
});
|
|
524
532
|
}
|
|
525
|
-
static draw(t, n
|
|
526
|
-
let
|
|
527
|
-
|
|
533
|
+
static draw(e, t, n) {
|
|
534
|
+
let r = a.getCanvasContext(e);
|
|
535
|
+
r.setTransform(t, 0, 0, t, 0, 0), n(r), r.setTransform(1, 0, 0, 1, 0, 0);
|
|
528
536
|
}
|
|
529
537
|
static getCanvasContext(e) {
|
|
530
538
|
let t = e.getContext("2d");
|
|
@@ -534,11 +542,11 @@ var s = /* @__PURE__ */ t(((e, t) => {
|
|
|
534
542
|
static searchHitAt(e, t) {
|
|
535
543
|
return e?.positions[t] ?? null;
|
|
536
544
|
}
|
|
537
|
-
static searchHitContainsCell(e, t, n,
|
|
538
|
-
return e.matrix_type ===
|
|
545
|
+
static searchHitContainsCell(e, t, n, i) {
|
|
546
|
+
return e.matrix_type === r.NUCLEOTIDE && e.row === n && i >= e.col && i < e.col + Math.max(1, t.length);
|
|
539
547
|
}
|
|
540
548
|
};
|
|
541
549
|
//#endregion
|
|
542
|
-
export {
|
|
550
|
+
export { G as EditorUtil };
|
|
543
551
|
|
|
544
552
|
//# sourceMappingURL=index.js.map
|