@rivm-loculus-tools/sequence-editor 0.1.7 → 1.0.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 +18 -0
- package/dist/_chunks/EngineErrorUtil.js.map +1 -0
- package/dist/_chunks/SequenceEditor.js +311 -318
- package/dist/_chunks/SequenceEditor.js.map +1 -1
- package/dist/_chunks/SequenceEditorEventBusService.js +21 -0
- package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -0
- package/dist/_chunks/SequenceEditorPageDrawer.js +112 -112
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
- package/dist/_chunks/comlink.js.map +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/sequenceEditorStore.js +4 -0
- package/dist/_chunks/sequenceEditorStore.js.map +1 -1
- package/dist/assets/{index-Dn92arD_.js → index-B5Du4hQk.js} +2 -2
- package/dist/assets/index-B5Du4hQk.js.map +1 -0
- package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +4 -6
- package/dist/classes/services/EditorWorkerService/index.js +112 -2
- package/dist/classes/services/EditorWorkerService/index.js.map +1 -0
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +2 -4
- package/dist/classes/services/SequenceEditorEventBusService/index.js +1 -16
- package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +3 -2
- package/dist/classes/workers/EngineWorker/index.js +7 -8
- package/dist/classes/workers/EngineWorker/index.js.map +1 -1
- package/dist/components/app/App/App.d.ts +5 -1
- package/dist/components/app/App/index.js +7 -16
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/ui/SequenceEditor/index.js +1 -2
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.d.ts +1 -1
- package/dist/components/ui/SequenceEditorPageDrawer/index.js +1 -2
- package/dist/components/ui/SequenceEditorPageHeader/index.js +39 -38
- package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -1
- package/dist/components/ui/SequenceEditorSearchBar/index.js +19 -18
- package/dist/components/ui/SequenceEditorSearchBar/index.js.map +1 -1
- package/dist/constants/editor.d.ts +1 -1
- package/dist/constants/editor.js.map +1 -1
- package/dist/constants/keyboard.js +36 -35
- package/dist/constants/keyboard.js.map +1 -1
- package/dist/constants/palette.d.ts +1 -1
- package/dist/constants/palette.js +138 -138
- package/dist/constants/palette.js.map +1 -1
- package/dist/models/config.models.d.ts +3 -0
- package/dist/models/config.models.js +0 -0
- package/dist/models/{model.d.ts → editor.models.d.ts} +8 -1
- package/dist/models/{model.js → editor.models.js} +6 -4
- package/dist/models/editor.models.js.map +1 -0
- package/dist/models/{palette.js → palette.models.js} +2 -2
- package/dist/models/palette.models.js.map +1 -0
- package/dist/{components/pages → pages}/SequenceEditorMainPage/index.js +25 -23
- package/dist/pages/SequenceEditorMainPage/index.js.map +1 -0
- package/dist/stores/sequenceEditorStore/index.js +1 -2
- package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +2 -1
- package/dist/utils/EditorUtil/EditorUtil.d.ts +3 -3
- package/dist/utils/EditorUtil/index.js +73 -64
- package/dist/utils/EditorUtil/index.js.map +1 -1
- package/dist/utils/EngineErrorUtil/index.d.ts +1 -0
- package/dist/utils/EngineErrorUtil/index.js +1 -0
- package/dist/utils/PaletteUtil/PaletteUtil.d.ts +1 -1
- package/dist/utils/PaletteUtil/index.js.map +1 -1
- package/dist/utils/SequenceEditorStandardConfigUtil/SequenceEditorStandardConfigUtil.d.ts +4 -0
- package/dist/utils/SequenceEditorStandardConfigUtil/index.d.ts +1 -0
- package/dist/utils/SequenceEditorStandardConfigUtil/index.js +19 -0
- package/dist/utils/SequenceEditorStandardConfigUtil/index.js.map +1 -0
- package/package.json +50 -46
- package/dist/_chunks/EditorWorkerService.js +0 -127
- package/dist/_chunks/EditorWorkerService.js.map +0 -1
- package/dist/assets/index-Dn92arD_.js.map +0 -1
- package/dist/classes/services/SequenceEditorEventBusService/index.js.map +0 -1
- package/dist/components/pages/EmptyWorkspace.d.ts +0 -3
- package/dist/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.d.ts +0 -3
- package/dist/components/pages/SequenceEditorErrorPage/index.d.ts +0 -1
- package/dist/components/pages/SequenceEditorErrorPage/index.js +0 -12
- package/dist/components/pages/SequenceEditorErrorPage/index.js.map +0 -1
- package/dist/components/pages/SequenceEditorMainPage/index.js.map +0 -1
- package/dist/components/ui/SequenceEditorPage/SequenceEditorPage.d.ts +0 -5
- package/dist/components/ui/SequenceEditorPage/index.d.ts +0 -1
- package/dist/components/ui/SequenceEditorPage/index.js +0 -15
- package/dist/components/ui/SequenceEditorPage/index.js.map +0 -1
- package/dist/models/editor.d.ts +0 -6
- package/dist/models/editor.js +0 -8
- package/dist/models/editor.js.map +0 -1
- package/dist/models/index.d.ts +0 -3
- package/dist/models/model.js.map +0 -1
- package/dist/models/palette.js.map +0 -1
- /package/dist/models/{palette.d.ts → palette.models.d.ts} +0 -0
- /package/dist/{components/pages → pages}/SequenceEditorMainPage/SequenceEditorMainPage.d.ts +0 -0
- /package/dist/{components/pages → pages}/SequenceEditorMainPage/index.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivm-loculus-tools/sequence-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,55 +21,59 @@
|
|
|
21
21
|
"@mui/system": "*",
|
|
22
22
|
"@mui/utils": "*",
|
|
23
23
|
"@mui/x-date-pickers": "*",
|
|
24
|
-
"@rivm-loculus-tools/common-frontend": "^0.
|
|
25
|
-
"@rivm-loculus-tools/sequence-editor-wasm": "^0.
|
|
24
|
+
"@rivm-loculus-tools/common-frontend": "^0.3.0",
|
|
25
|
+
"@rivm-loculus-tools/sequence-editor-wasm": "^0.2.0",
|
|
26
26
|
"i18next": "*",
|
|
27
27
|
"react-dom": "*",
|
|
28
28
|
"react-error-boundary": "*",
|
|
29
29
|
"react-hook-form": "*",
|
|
30
30
|
"react-i18next": "*",
|
|
31
|
-
"react": "*"
|
|
31
|
+
"react": "*",
|
|
32
|
+
"reflect-metadata": "*",
|
|
33
|
+
"tsyringe": "*"
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
36
|
"comlink": "^4.4.2",
|
|
35
37
|
"lodash": "4.18.1",
|
|
36
38
|
"use-debounce": "10.1.1",
|
|
37
|
-
"zustand": "5.0.15"
|
|
39
|
+
"zustand": "5.0.15",
|
|
40
|
+
"tsyringe": "4.10.0"
|
|
38
41
|
},
|
|
39
42
|
"devDependencies": {
|
|
40
43
|
"@emotion/cache": "11.14.0",
|
|
41
44
|
"@emotion/react": "11.14.0",
|
|
42
45
|
"@emotion/styled": "11.14.1",
|
|
43
|
-
"@gen-epix/eslint-config": "0.
|
|
44
|
-
"@gen-epix/ui-core-components": "4.
|
|
45
|
-
"@gen-epix/ui-core-form": "4.
|
|
46
|
-
"@gen-epix/ui-core": "3.
|
|
47
|
-
"@gen-epix/ui-phylogenetic-tree": "3.
|
|
48
|
-
"@mui/icons-material": "9.
|
|
49
|
-
"@mui/material": "9.
|
|
50
|
-
"@mui/styled-engine": "9.
|
|
51
|
-
"@mui/system": "9.
|
|
52
|
-
"@mui/utils": "9.
|
|
53
|
-
"@types/lodash": "4.17.
|
|
54
|
-
"@types/node": "26.6.
|
|
46
|
+
"@gen-epix/eslint-config": "0.8.0",
|
|
47
|
+
"@gen-epix/ui-core-components": "4.5.0",
|
|
48
|
+
"@gen-epix/ui-core-form": "4.4.1",
|
|
49
|
+
"@gen-epix/ui-core": "3.9.1",
|
|
50
|
+
"@gen-epix/ui-phylogenetic-tree": "3.5.1",
|
|
51
|
+
"@mui/icons-material": "9.5.0",
|
|
52
|
+
"@mui/material": "9.5.0",
|
|
53
|
+
"@mui/styled-engine": "9.5.0",
|
|
54
|
+
"@mui/system": "9.5.0",
|
|
55
|
+
"@mui/utils": "9.5.0",
|
|
56
|
+
"@types/lodash": "4.17.26",
|
|
57
|
+
"@types/node": "26.6.5",
|
|
55
58
|
"@types/react-dom": "19.3.0",
|
|
56
59
|
"@types/react": "19.3.0",
|
|
57
|
-
"@vitejs/plugin-react": "6.1.
|
|
58
|
-
"eslint": "10.
|
|
59
|
-
"i18next": "26.4.
|
|
60
|
+
"@vitejs/plugin-react": "6.1.2",
|
|
61
|
+
"eslint": "10.12.0",
|
|
62
|
+
"i18next": "26.4.4",
|
|
60
63
|
"react-dom": "19.3.0",
|
|
61
64
|
"react-error-boundary": "6.1.6",
|
|
62
|
-
"react-hook-form": "7.
|
|
63
|
-
"react-i18next": "17.0.
|
|
65
|
+
"react-hook-form": "7.90.0",
|
|
66
|
+
"react-i18next": "17.0.16",
|
|
64
67
|
"react": "19.3.0",
|
|
65
68
|
"typescript": "6.0.3",
|
|
66
|
-
"
|
|
69
|
+
"tsyringe": "4.10.0",
|
|
70
|
+
"vite-plugin-dts": "5.1.2",
|
|
67
71
|
"vite-plugin-lib-inject-css": "2.2.2",
|
|
68
72
|
"vite-plugin-static-copy": "4.1.1",
|
|
69
73
|
"vite-plugin-svgr": "5.2.0",
|
|
70
|
-
"vite": "8.3.
|
|
74
|
+
"vite": "8.3.4",
|
|
71
75
|
"vitest-browser-react": "2.3.0",
|
|
72
|
-
"vitest": "5.0.
|
|
76
|
+
"vitest": "5.0.4"
|
|
73
77
|
},
|
|
74
78
|
"files": [
|
|
75
79
|
"dist"
|
|
@@ -91,22 +95,10 @@
|
|
|
91
95
|
"types": "./dist/components/app/App/index.d.ts",
|
|
92
96
|
"import": "./dist/components/app/App/index.js"
|
|
93
97
|
},
|
|
94
|
-
"./components/pages/SequenceEditorErrorPage": {
|
|
95
|
-
"types": "./dist/components/pages/SequenceEditorErrorPage/index.d.ts",
|
|
96
|
-
"import": "./dist/components/pages/SequenceEditorErrorPage/index.js"
|
|
97
|
-
},
|
|
98
|
-
"./components/pages/SequenceEditorMainPage": {
|
|
99
|
-
"types": "./dist/components/pages/SequenceEditorMainPage/index.d.ts",
|
|
100
|
-
"import": "./dist/components/pages/SequenceEditorMainPage/index.js"
|
|
101
|
-
},
|
|
102
98
|
"./components/ui/SequenceEditor": {
|
|
103
99
|
"types": "./dist/components/ui/SequenceEditor/index.d.ts",
|
|
104
100
|
"import": "./dist/components/ui/SequenceEditor/index.js"
|
|
105
101
|
},
|
|
106
|
-
"./components/ui/SequenceEditorPage": {
|
|
107
|
-
"types": "./dist/components/ui/SequenceEditorPage/index.d.ts",
|
|
108
|
-
"import": "./dist/components/ui/SequenceEditorPage/index.js"
|
|
109
|
-
},
|
|
110
102
|
"./components/ui/SequenceEditorPageDrawer": {
|
|
111
103
|
"types": "./dist/components/ui/SequenceEditorPageDrawer/index.d.ts",
|
|
112
104
|
"import": "./dist/components/ui/SequenceEditorPageDrawer/index.js"
|
|
@@ -135,17 +127,21 @@
|
|
|
135
127
|
"types": "./dist/constants/palette.d.ts",
|
|
136
128
|
"import": "./dist/constants/palette.js"
|
|
137
129
|
},
|
|
138
|
-
"./models/
|
|
139
|
-
"types": "./dist/models/
|
|
140
|
-
"import": "./dist/models/
|
|
130
|
+
"./models/config.models": {
|
|
131
|
+
"types": "./dist/models/config.models.d.ts",
|
|
132
|
+
"import": "./dist/models/config.models.js"
|
|
141
133
|
},
|
|
142
|
-
"./models/
|
|
143
|
-
"types": "./dist/models/
|
|
144
|
-
"import": "./dist/models/
|
|
134
|
+
"./models/editor.models": {
|
|
135
|
+
"types": "./dist/models/editor.models.d.ts",
|
|
136
|
+
"import": "./dist/models/editor.models.js"
|
|
145
137
|
},
|
|
146
|
-
"./models/palette": {
|
|
147
|
-
"types": "./dist/models/palette.d.ts",
|
|
148
|
-
"import": "./dist/models/palette.js"
|
|
138
|
+
"./models/palette.models": {
|
|
139
|
+
"types": "./dist/models/palette.models.d.ts",
|
|
140
|
+
"import": "./dist/models/palette.models.js"
|
|
141
|
+
},
|
|
142
|
+
"./pages/SequenceEditorMainPage": {
|
|
143
|
+
"types": "./dist/pages/SequenceEditorMainPage/index.d.ts",
|
|
144
|
+
"import": "./dist/pages/SequenceEditorMainPage/index.js"
|
|
149
145
|
},
|
|
150
146
|
"./stores/sequenceEditorStore": {
|
|
151
147
|
"types": "./dist/stores/sequenceEditorStore/index.d.ts",
|
|
@@ -155,9 +151,17 @@
|
|
|
155
151
|
"types": "./dist/utils/EditorUtil/index.d.ts",
|
|
156
152
|
"import": "./dist/utils/EditorUtil/index.js"
|
|
157
153
|
},
|
|
154
|
+
"./utils/EngineErrorUtil": {
|
|
155
|
+
"types": "./dist/utils/EngineErrorUtil/index.d.ts",
|
|
156
|
+
"import": "./dist/utils/EngineErrorUtil/index.js"
|
|
157
|
+
},
|
|
158
158
|
"./utils/PaletteUtil": {
|
|
159
159
|
"types": "./dist/utils/PaletteUtil/index.d.ts",
|
|
160
160
|
"import": "./dist/utils/PaletteUtil/index.js"
|
|
161
|
+
},
|
|
162
|
+
"./utils/SequenceEditorStandardConfigUtil": {
|
|
163
|
+
"types": "./dist/utils/SequenceEditorStandardConfigUtil/index.d.ts",
|
|
164
|
+
"import": "./dist/utils/SequenceEditorStandardConfigUtil/index.js"
|
|
161
165
|
}
|
|
162
166
|
},
|
|
163
167
|
"scripts": {
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { EDITOR_DIRECTION as e } from "../models/editor.js";
|
|
2
|
-
import { t } from "./sequenceEditorStore.js";
|
|
3
|
-
import { n } from "./comlink.js";
|
|
4
|
-
import { HmrUtil as r } from "@gen-epix/ui-core/utils/HmrUtil";
|
|
5
|
-
import { MoveDirection as i } from "@rivm-loculus-tools/sequence-editor-wasm";
|
|
6
|
-
//#region src/utils/EngineErrorUtil/EngineErrorUtil.ts
|
|
7
|
-
var a = /* @__PURE__ */ new Map([
|
|
8
|
-
["DeleteNotGap", "Delete failed: the selected position is not a gap."],
|
|
9
|
-
["MoveNoGapTarget", "Move failed: the target position must be a gap."],
|
|
10
|
-
["MoveNotIupac", "Move failed: only nucleotide or gap characters can move."],
|
|
11
|
-
["MutateNotIupac", "Edit failed: use a nucleotide, IUPAC ambiguity code, or gap."]
|
|
12
|
-
]), o = class e {
|
|
13
|
-
static getEngineErrorMessage(t) {
|
|
14
|
-
let n = e.getEngineErrorCode(t);
|
|
15
|
-
return (n ? a.get(n) : void 0) || (t instanceof Error ? t.message : "The sequence-editor command failed.");
|
|
16
|
-
}
|
|
17
|
-
static getEngineErrorCode(e) {
|
|
18
|
-
if (typeof e == "object" && e && "message" in e) {
|
|
19
|
-
let t = e.message;
|
|
20
|
-
return typeof t == "string" ? t : null;
|
|
21
|
-
}
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}, s = class a {
|
|
25
|
-
static __instance;
|
|
26
|
-
commandQueue = Promise.resolve();
|
|
27
|
-
engineWorkerProxy;
|
|
28
|
-
constructor() {
|
|
29
|
-
let e = new Worker(new URL(
|
|
30
|
-
/* @vite-ignore */
|
|
31
|
-
"/assets/index-Dn92arD_.js",
|
|
32
|
-
"" + import.meta.url
|
|
33
|
-
), { type: "module" });
|
|
34
|
-
this.engineWorkerProxy = n(e);
|
|
35
|
-
}
|
|
36
|
-
static getInstance() {
|
|
37
|
-
return a.__instance = r.getHmrSingleton("EditorService", a.__instance, () => new a()), a.__instance;
|
|
38
|
-
}
|
|
39
|
-
async delete(e, t) {
|
|
40
|
-
return await this.runCommand(async () => {
|
|
41
|
-
await this.engineWorkerProxy.delete(e, t);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
async deleteColumn(e) {
|
|
45
|
-
return await this.runCommand(async () => {
|
|
46
|
-
await this.engineWorkerProxy.deleteColumn(e);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
async exportFasta() {
|
|
50
|
-
return await this.runCommand(async () => await this.engineWorkerProxy.exportFasta());
|
|
51
|
-
}
|
|
52
|
-
async getMetaData() {
|
|
53
|
-
return await this.runCommand(async () => await this.engineWorkerProxy.meta());
|
|
54
|
-
}
|
|
55
|
-
async initialize() {
|
|
56
|
-
return await this.runCommand(async () => await this.engineWorkerProxy.initialize());
|
|
57
|
-
}
|
|
58
|
-
async insert(e, t) {
|
|
59
|
-
return await this.runCommand(async () => {
|
|
60
|
-
await this.engineWorkerProxy.insert(e, t);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
async loadFasta(e) {
|
|
64
|
-
return this.runCommand(async () => {
|
|
65
|
-
await this.engineWorkerProxy.load(e);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
async moveHorizontal(t, n, r) {
|
|
69
|
-
if (r !== e.LEFT && r !== e.RIGHT) throw Error("Invalid horizontal move direction");
|
|
70
|
-
return await this.runCommand(async () => {
|
|
71
|
-
await this.engineWorkerProxy.moveHorizontal(t, n, r === e.LEFT ? i.Left : i.Right);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
async moveRowsDown(e) {
|
|
75
|
-
return await this.runCommand(async () => {
|
|
76
|
-
await this.engineWorkerProxy.moveRowsDown(e);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
async moveRowsUp(e) {
|
|
80
|
-
return await this.runCommand(async () => {
|
|
81
|
-
await this.engineWorkerProxy.moveRowsUp(e);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
async mutate(e, t, n) {
|
|
85
|
-
return await this.runCommand(async () => {
|
|
86
|
-
await this.engineWorkerProxy.mutate(e, t, n);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
async name(e) {
|
|
90
|
-
return await this.runCommand(async () => await this.engineWorkerProxy.name(e));
|
|
91
|
-
}
|
|
92
|
-
async redo() {
|
|
93
|
-
return await this.runCommand(async () => {
|
|
94
|
-
await this.engineWorkerProxy.redo();
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
async search(e, t) {
|
|
98
|
-
return await this.runCommand(async () => await this.engineWorkerProxy.search(e, t));
|
|
99
|
-
}
|
|
100
|
-
async translate(e, t) {
|
|
101
|
-
return await this.runCommand(async () => await this.engineWorkerProxy.translate(e, t));
|
|
102
|
-
}
|
|
103
|
-
async undo() {
|
|
104
|
-
return await this.runCommand(async () => {
|
|
105
|
-
await this.engineWorkerProxy.undo();
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
async viewport(e) {
|
|
109
|
-
return await this.runCommand(async () => await this.engineWorkerProxy.viewport(e));
|
|
110
|
-
}
|
|
111
|
-
async runCommand(e) {
|
|
112
|
-
let n = this.commandQueue.then(async () => {
|
|
113
|
-
let { setLatestMessage: n } = t.getState();
|
|
114
|
-
try {
|
|
115
|
-
let r = await e();
|
|
116
|
-
return t.getState().latestMessage && n(null), r;
|
|
117
|
-
} catch (e) {
|
|
118
|
-
throw n(o.getEngineErrorMessage(e)), console.error("COMMAND ERROR", e), e;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
return this.commandQueue = n.then(() => void 0, () => void 0), await n;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
//#endregion
|
|
125
|
-
export { s as t };
|
|
126
|
-
|
|
127
|
-
//# sourceMappingURL=EditorWorkerService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditorWorkerService.js","names":[],"sources":["../../src/utils/EngineErrorUtil/EngineErrorUtil.ts","../../src/classes/services/EditorWorkerService/EditorWorkerService.ts"],"sourcesContent":["const ENGINE_ERROR_MESSAGES = new Map<string, string>([\n ['DeleteNotGap', 'Delete failed: the selected position is not a gap.'],\n ['MoveNoGapTarget', 'Move failed: the target position must be a gap.'],\n ['MoveNotIupac', 'Move failed: only nucleotide or gap characters can move.'],\n ['MutateNotIupac', 'Edit failed: use a nucleotide, IUPAC ambiguity code, or gap.'],\n]);\n\nexport class EngineErrorUtil {\n public static getEngineErrorMessage(error: unknown): string {\n const code = EngineErrorUtil.getEngineErrorCode(error);\n const mappedMessage = code ? ENGINE_ERROR_MESSAGES.get(code) : undefined;\n if (mappedMessage) {\n return mappedMessage;\n }\n return error instanceof Error ? error.message : 'The sequence-editor command failed.';\n }\n\n private static getEngineErrorCode(error: unknown): null | string {\n if (typeof error === 'object' && error !== null && 'message' in error) {\n const code = (error as { message?: unknown }).message;\n return typeof code === 'string' ? code : null;\n }\n return null;\n }\n}\n","import { HmrUtil } from '@gen-epix/ui-core/utils/HmrUtil';\nimport type { Remote } from 'comlink';\nimport { wrap } from 'comlink';\nimport { MoveDirection } from '@rivm-loculus-tools/sequence-editor-wasm';\n\nimport type {\n EngineMeta,\n EngineSearchResult,\n EngineViewportResult,\n EngineWorkerApi,\n ViewportBounds,\n} from '../../../models';\nimport { EDITOR_DIRECTION } from '../../../models/editor';\nimport { EngineErrorUtil } from '../../../utils/EngineErrorUtil/EngineErrorUtil';\nimport { sequenceEditorStore } from '../../../stores/sequenceEditorStore';\n\n\nexport class EditorWorkerService {\n private static __instance: EditorWorkerService;\n private commandQueue: Promise<void> = Promise.resolve();\n private readonly engineWorkerProxy: Remote<EngineWorkerApi>;\n\n private constructor() {\n const worker = new Worker(new URL('../../workers/EngineWorker', import.meta.url), {\n type: 'module',\n });\n this.engineWorkerProxy = wrap<EngineWorkerApi>(worker);\n }\n\n public static getInstance(): EditorWorkerService {\n EditorWorkerService.__instance = HmrUtil.getHmrSingleton('EditorService', EditorWorkerService.__instance, () => new EditorWorkerService());\n return EditorWorkerService.__instance;\n }\n\n public async delete(rows: number[], col: number): Promise<void> {\n return await this.runCommand(async () => {\n await this.engineWorkerProxy.delete(rows, col);\n });\n }\n\n public async deleteColumn(col: number): Promise<void> {\n return await this.runCommand(async () => {\n await this.engineWorkerProxy.deleteColumn(col);\n });\n }\n\n public async exportFasta(): Promise<string> {\n return await this.runCommand(async () => {\n return await this.engineWorkerProxy.exportFasta();\n });\n }\n\n public async getMetaData(): Promise<EngineMeta> {\n return await this.runCommand(async () => {\n return await this.engineWorkerProxy.meta();\n });\n }\n\n public async initialize(): Promise<void> {\n return await this.runCommand(async () => {\n return await this.engineWorkerProxy.initialize();\n });\n }\n\n public async insert(rows: number[], col: number): Promise<void> {\n return await this.runCommand(async () => {\n await this.engineWorkerProxy.insert(rows, col);\n });\n }\n\n public async loadFasta(fasta: string): Promise<void> {\n return this.runCommand(async () => {\n await this.engineWorkerProxy.load(fasta);\n });\n }\n\n public async moveHorizontal(row: number, cols: number[], direction: EDITOR_DIRECTION): Promise<void> {\n if (direction !== EDITOR_DIRECTION.LEFT && direction !== EDITOR_DIRECTION.RIGHT) {\n throw new Error('Invalid horizontal move direction');\n }\n return await this.runCommand(async () => {\n await this.engineWorkerProxy.moveHorizontal(row, cols, direction === EDITOR_DIRECTION.LEFT ? MoveDirection.Left : MoveDirection.Right);\n });\n }\n\n public async moveRowsDown(rows: number[]): Promise<void> {\n return await this.runCommand(async () => {\n await this.engineWorkerProxy.moveRowsDown(rows);\n });\n }\n\n public async moveRowsUp(rows: number[]): Promise<void> {\n return await this.runCommand(async () => {\n await this.engineWorkerProxy.moveRowsUp(rows);\n });\n }\n\n public async mutate(rows: number[], col: number, base: string): Promise<void> {\n return await this.runCommand(async () => {\n await this.engineWorkerProxy.mutate(rows, col, base);\n });\n }\n\n public async name(row: number): Promise<string> {\n return await this.runCommand(async () => {\n return await this.engineWorkerProxy.name(row);\n });\n }\n\n public async redo(): Promise<void> {\n return await this.runCommand(async () => {\n await this.engineWorkerProxy.redo();\n });\n }\n\n public async search(query: string, checkRecordNames: boolean): Promise<EngineSearchResult> {\n return await this.runCommand(async () => {\n return await this.engineWorkerProxy.search(query, checkRecordNames);\n });\n }\n\n public async translate(bounds: ViewportBounds, readingFrame: number): Promise<EngineViewportResult> {\n return await this.runCommand(async () => {\n return await this.engineWorkerProxy.translate(bounds, readingFrame);\n });\n }\n\n public async undo(): Promise<void> {\n return await this.runCommand(async () => {\n await this.engineWorkerProxy.undo();\n });\n }\n\n public async viewport(bounds: ViewportBounds): Promise<EngineViewportResult> {\n return await this.runCommand(async () => {\n return await this.engineWorkerProxy.viewport(bounds);\n });\n }\n\n private async runCommand<T>(command: () => Promise<T>): Promise<T> {\n const queuedCommand = this.commandQueue.then(async (): Promise<T> => {\n const { setLatestMessage } = sequenceEditorStore.getState();\n try {\n const result = await command();\n if (sequenceEditorStore.getState().latestMessage) {\n setLatestMessage(null);\n }\n return result;\n } catch (error: unknown) {\n setLatestMessage(EngineErrorUtil.getEngineErrorMessage(error));\n console.error('COMMAND ERROR', error);\n throw error;\n }\n });\n\n this.commandQueue = queuedCommand.then(\n () => undefined,\n () => undefined,\n );\n\n return await queuedCommand;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAM,oBAAwB,IAAI,IAAoB;CACpD,CAAC,gBAAgB,oDAAoD;CACrE,CAAC,mBAAmB,iDAAiD;CACrE,CAAC,gBAAgB,0DAA0D;CAC3E,CAAC,kBAAkB,8DAA8D;AACnF,CAAC,GAEY,IAAb,MAAa,EAAgB;CAC3B,OAAc,sBAAsB,GAAwB;EAC1D,IAAM,IAAO,EAAgB,mBAAmB,CAAK;EAKrD,QAJsB,IAAO,EAAsB,IAAI,CAAI,IAAI,KAAA,OAIxD,aAAiB,QAAQ,EAAM,UAAU;CAClD;CAEA,OAAe,mBAAmB,GAA+B;EAC/D,IAAI,OAAO,KAAU,YAAY,KAAkB,aAAa,GAAO;GACrE,IAAM,IAAQ,EAAgC;GAC9C,OAAO,OAAO,KAAS,WAAW,IAAO;EAC3C;EACA,OAAO;CACT;AACF,GCPa,IAAb,MAAa,EAAoB;CAC/B,OAAe;CACf,eAAsC,QAAQ,QAAQ;CACtD;CAEA,cAAsB;EACpB,IAAM,IAAS,IAAI,OAAO,IAAA;;GAAA;GAAA,KAAA,YAAA;EAAA,GAAwD,EAChF,MAAM,SACR,CAAC;EACD,KAAK,oBAAoB,EAAsB,CAAM;CACvD;CAEA,OAAc,cAAmC;EAE/C,OADA,EAAoB,aAAa,EAAQ,gBAAgB,iBAAiB,EAAoB,kBAAkB,IAAI,EAAoB,CAA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,KAAA,SACA,KAAA,CACR,GAEO,MAAM;CACf;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-Dn92arD_.js","names":[],"sources":["../../../../../../node_modules/.pnpm/comlink@4.4.2/node_modules/comlink/dist/esm/comlink.mjs","../../src/classes/workers/EngineWorker/EngineWorker.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","/// <reference lib=\"webworker\" />\nimport { expose } from 'comlink';\nimport type { MoveDirection } from '@rivm-loculus-tools/sequence-editor-wasm';\nimport init, { MsaEngine } from '@rivm-loculus-tools/sequence-editor-wasm';\n\nimport type {\n EngineMeta,\n EngineSearchResult,\n EngineViewportResult,\n EngineWorkerApi,\n ViewportBounds,\n} from '../../../models';\n\n/**\n * MSA engine Web Worker.\n *\n * This worker is the **single owner** of the `MsaEngine` WASM instance and its\n * linear memory for the lifetime of the page. All Rust calls happen here, off\n * the main thread, so FASTA parsing, structural mutations, and undo/redo\n * snapshots never stall the React render loop.\n *\n * The class is exposed to the main thread through comlink, so every public\n * method is proxied as an asynchronous call across the worker boundary.\n */\nexport class EngineWorker implements EngineWorkerApi {\n private engine: MsaEngine | null = null;\n private initialization: null | Promise<void> = null;\n\n public async delete(rows: number[], column: number): Promise<void> {\n const engine = await this.requireEngine();\n engine.delete_at_subset(this.toRowIndices(rows), column);\n }\n\n public async deleteColumn(column: number): Promise<void> {\n const engine = await this.requireEngine();\n engine.delete_column(column);\n }\n\n public async exportFasta(): Promise<string> {\n const engine = await this.requireEngine();\n const records: string[] = [];\n for (let row = 0; row < engine.get_sequence_count(); row += 1) {\n const sequence: string[] = [];\n for (let column = 0; column < engine.get_row_length(row); column += 1) {\n sequence.push(String.fromCharCode(engine.get_base(row, column)));\n }\n records.push(`>${engine.get_name(row)}\\n${sequence.join('')}\\n`);\n }\n return records.join('');\n }\n\n /**\n * Idempotently instantiates the WASM module and constructs the engine.\n * Safe to call multiple times; concurrent callers share one initialization.\n */\n public async initialize(): Promise<void> {\n if (this.engine) {\n return;\n }\n if (!this.initialization) {\n this.initialization = (async () => {\n await init(undefined);\n this.engine = new MsaEngine();\n })();\n this.initialization.catch(() => {\n this.initialization = null;\n });\n }\n await this.initialization;\n }\n\n public async insert(rows: number[], column: number): Promise<void> {\n const engine = await this.requireEngine();\n engine.insert_at_subset(this.toRowIndices(rows), column);\n }\n\n public async load(fastaContent: string): Promise<number> {\n const engine = await this.requireEngine();\n return engine.load_fasta(fastaContent);\n }\n\n public async meta(): Promise<EngineMeta> {\n const engine = await this.requireEngine();\n return {\n alignmentWidth: engine.get_alignment_width(),\n redoDepth: engine.redo_depth(),\n sequenceCount: engine.get_sequence_count(),\n undoDepth: engine.undo_depth(),\n };\n }\n\n public async moveHorizontal(row: number, columns: number[], direction: MoveDirection): Promise<void> {\n const engine = await this.requireEngine();\n engine.move_horizontal(row, this.toRowIndices(columns), direction);\n }\n\n public async moveRowsDown(rows: number[]): Promise<void> {\n const engine = await this.requireEngine();\n engine.move_rows_down(this.toRowIndices(rows));\n }\n\n public async moveRowsUp(rows: number[]): Promise<void> {\n const engine = await this.requireEngine();\n engine.move_rows_up(this.toRowIndices(rows));\n }\n\n public async mutate(rows: number[], column: number, base: string): Promise<void> {\n const engine = await this.requireEngine();\n engine.mutate_base_subset(this.toRowIndices(rows), column, base.charCodeAt(0));\n }\n\n public async name(row: number): Promise<string> {\n const engine = await this.requireEngine();\n return engine.get_name(row);\n }\n\n public async redo(): Promise<boolean> {\n const engine = await this.requireEngine();\n return engine.redo();\n }\n\n public async search(query: string, checkRecordNames: boolean): Promise<EngineSearchResult> {\n const engine = await this.requireEngine();\n return engine.search(query, checkRecordNames) as EngineSearchResult;\n }\n\n public async translate(bounds: ViewportBounds, readingFrame: number): Promise<EngineViewportResult> {\n const engine = await this.requireEngine();\n this.validateBounds(bounds);\n const bytes = engine.translate(\n bounds.startRow,\n bounds.endRow,\n bounds.startCol,\n bounds.endCol,\n readingFrame,\n );\n return this.buildViewportResult(bytes, bounds);\n }\n\n public async undo(): Promise<boolean> {\n const engine = await this.requireEngine();\n return engine.undo();\n }\n\n public async viewport(bounds: ViewportBounds): Promise<EngineViewportResult> {\n const engine = await this.requireEngine();\n this.validateBounds(bounds);\n const bytes = engine.update_viewport(\n bounds.startRow,\n bounds.endRow,\n bounds.startCol,\n bounds.endCol,\n );\n return this.buildViewportResult(bytes, bounds);\n }\n\n /** Builds a fixed-stride viewport result from the engine's returned bytes. */\n private buildViewportResult(bytes: Uint8Array, bounds: ViewportBounds): EngineViewportResult {\n const columns = bounds.endCol - bounds.startCol + 1;\n const rows = columns > 0 ? Math.floor(bytes.byteLength / columns) : 0;\n return {\n bytes,\n cols: columns,\n rows,\n startCol: bounds.startCol,\n startRow: bounds.startRow,\n };\n }\n\n /** Returns the initialized engine, initializing it first if necessary. */\n private async requireEngine(): Promise<MsaEngine> {\n await this.initialize();\n if (!this.engine) {\n throw new Error('Engine failed to initialize');\n }\n return this.engine;\n }\n\n /** Converts a plain row-index list into the typed array the WASM API expects. */\n private toRowIndices(rows: number[]): Uint32Array {\n return new Uint32Array(rows);\n }\n\n /** Validates that viewport/translation bounds are safe, non-negative, and ordered. */\n private validateBounds(bounds: ViewportBounds): void {\n const values = [bounds.startRow, bounds.endRow, bounds.startCol, bounds.endCol];\n if (!values.every((value) => Number.isSafeInteger(value) && value >= 0)) {\n throw new Error('Viewport bounds must be non-negative safe integers');\n }\n if (bounds.startRow > bounds.endRow || bounds.startCol > bounds.endCol) {\n throw new Error('Viewport bounds must be ordered (start <= end)');\n }\n }\n}\n\nexpose(new EngineWorker());\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAKA,IAAM,EAAc,OAAO,eAAe,EACpC,EAAiB,OAAO,kBAAkB,EAC1C,EAAe,OAAO,sBAAsB,EAC5C,EAAY,OAAO,mBAAmB,EACtC,EAAc,OAAO,gBAAgB,EACrC,EAAY,GAAS,OAAO,GAAQ,YAAY,GAAiB,OAAO,GAAQ,WAgDhF,kBAAmB,IAAI,IAAI,CAC7B,CAAC,QAAS,CA5CV,UAAY,GAAQ,EAAS,CAAG,GAAK,EAAI,GACzC,UAAU,EAAK,CACX,GAAM,CAAE,QAAO,SAAU,IAAI,eAE7B,OADA,EAAO,EAAK,CAAK,EACV,CAAC,EAAO,CAAC,CAAK,CAAC,CAC1B,EACA,YAAY,EAAM,CAEd,OADA,EAAK,MAAM,EACJ,EAAK,CAAI,CACpB,CAmC6B,CAAC,EAC9B,CAAC,QAAS,CA9BV,UAAY,GAAU,EAAS,CAAK,GAAK,KAAe,EACxD,UAAU,CAAE,SAAS,CACjB,IAAI,EAcJ,MAbA,CAWI,EAXA,aAAiB,MACJ,CACT,QAAS,GACT,MAAO,CACH,QAAS,EAAM,QACf,KAAM,EAAM,KACZ,M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AQ,EAAO,gBACnB,EAAO,SACP,EAAO,OACP,EAAO,SACP,EAAO,MACT,EACA,OAAO,KAAK,oBAAoB,EAAO,CAAM,CAC/C,CAGA,oBAA4B,EAAmB,EAA8C,CAC3F,IAAM,EAAU,EAAO,OAAS,EAAO,SAAW,EAElD,MAAO,CACL,QACA,KAAM,EACN,KAJW,EAAU,EAAI,KAAK,MAAM,EAAM,WAAa,CAAO,EAAI,EAKlE,SAAU,EAAO,SACjB,SAAU,EAAO,QACnB,CACF,CAGA,MAAc,eAAoC,CAEhD,GADA,MAAM,KAAK,WAAW,EAClB,CAAC,KAAK,OACR,MAAU,MAAM,6BAA6B,EAE/C,OAAO,KAAK,MACd,CAGA,aAAqB,EAA6B,CAChD,OAAO,IAAI,YAAY,CAAI,CAC7B,CAGA,eAAuB,EAA8B,CAEnD,GAAI,CAAC,CADW,EAAO,SAAU,EAAO,OAAQ,EAAO,SAAU,EAAO,MACnE,CAAA,CAAO,MAAO,GAAU,OAAO,cAAc,CAAK,GAAK,GAAS,CAAC,EACpE,MAAU,MAAM,oDAAoD,EAEtE,GAAI,EAAO,SAAW,EAAO,QAAU,EAAO,SAAW,EAAO,OAC9D,MAAU,MAAM,gDAAgD,CAEpE,CACF,CAEyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.ts"],"sourcesContent":["import { EventBusAbstract } from '@gen-epix/ui-core/classes/abstracts/EventBusAbstract';\nimport { HmrUtil } from '@gen-epix/ui-core/utils/HmrUtil';\n\nimport type { EDITOR_DIRECTION } from '../../../models/editor';\n\nexport type SequenceEditorEventBusServiceEvent = {\n onDeleteBackward: void;\n onExpandSelection: EDITOR_DIRECTION;\n onGotoPosition: void;\n onInsert: void;\n onMoveCells: EDITOR_DIRECTION;\n onMoveRows: EDITOR_DIRECTION;\n onMoveRowsEnd: EDITOR_DIRECTION;\n onMoveSelection: EDITOR_DIRECTION;\n onMutateSelection: string;\n onRedo: void;\n onScrollPageDown: void;\n onScrollPageUp: void;\n onScrollToLineEnd: void;\n onScrollToLineStart: void;\n onSearch: string;\n onUndo: void;\n};\n\nexport class SequenceEditorEventBusService extends EventBusAbstract<SequenceEditorEventBusServiceEvent> {\n private static __instance: SequenceEditorEventBusService;\n\n\n private constructor() {\n super();\n }\n\n public static getInstance(): SequenceEditorEventBusService {\n SequenceEditorEventBusService.__instance = HmrUtil.getHmrSingleton('SequenceEditorEventBusService', SequenceEditorEventBusService.__instance, () => new SequenceEditorEventBusService());\n return SequenceEditorEventBusService.__instance;\n }\n}\n"],"mappings":";;;AAwBA,IAAa,IAAb,MAAa,UAAsC,EAAqD;CACtG,OAAe;CAGf,cAAsB;EACpB,MAAM;CACR;CAEA,OAAc,cAA6C;EAEzD,OADA,EAA8B,aAAa,EAAQ,gBAAgB,iCAAiC,EAA8B,kBAAkB,IAAI,EAA8B,CAAC,GAChL,EAA8B;CACvC;AACF"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ErrorPageCommonProps } from '@rivm-loculus-tools/common-frontend/components/page';
|
|
2
|
-
export type SequenceEditorErrorPageProps = ErrorPageCommonProps;
|
|
3
|
-
export declare const SequenceEditorErrorPage: ({ error }: SequenceEditorErrorPageProps) => import('react').JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SequenceEditorErrorPage';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SequenceEditorPage as e } from "../../ui/SequenceEditorPage/index.js";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { ErrorPageCommon as n } from "@rivm-loculus-tools/common-frontend/components/page";
|
|
4
|
-
//#region src/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.tsx
|
|
5
|
-
var r = ({ error: r }) => /* @__PURE__ */ t(e, {
|
|
6
|
-
isNoInteraction: !0,
|
|
7
|
-
children: /* @__PURE__ */ t(n, { error: r })
|
|
8
|
-
});
|
|
9
|
-
//#endregion
|
|
10
|
-
export { r as SequenceEditorErrorPage };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.tsx"],"sourcesContent":["import type { ErrorPageCommonProps } from '@rivm-loculus-tools/common-frontend/components/page';\nimport { ErrorPageCommon } from '@rivm-loculus-tools/common-frontend/components/page';\n\nimport { SequenceEditorPage } from '../../ui/SequenceEditorPage';\n\nexport type SequenceEditorErrorPageProps = ErrorPageCommonProps;\n\nexport const SequenceEditorErrorPage = ({ error }: SequenceEditorErrorPageProps) => {\n return (\n <SequenceEditorPage\n isNoInteraction\n >\n <ErrorPageCommon error={error} />\n </SequenceEditorPage>\n );\n};\n"],"mappings":";;;;AAOA,IAAa,KAA2B,EAAE,eAEtC,kBAAC,GAAD;CACE,iBAAA;CAEA,UAAA,kBAAC,GAAD,EAAwB,SAAQ,CAAA;AACd,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.tsx"],"sourcesContent":["import { useStore } from 'zustand';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { FastaDataEventBusService } from '@rivm-loculus-tools/common-frontend/classes/services/FastaDataEventBusService';\nimport { ErrorUtil } from '@rivm-loculus-tools/common-frontend/utils/ErrorUtil';\nimport { UrlUtil } from '@rivm-loculus-tools/common-frontend/utils/UrlUtil';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport { FastaDataImportDialogLoader } from '@rivm-loculus-tools/common-frontend/components/FastaDataImportDialogLoader';\nimport { BackdropSpinner } from '@gen-epix/ui-core-components/components/BackdropSpinner';\nimport { FastaNotLoaded } from '@rivm-loculus-tools/common-frontend/components/FastaNotLoaded';\nimport BiotechOutlinedIcon from '@mui/icons-material/BiotechOutlined';\nimport { LOADING_STATUS } from '@rivm-loculus-tools/common-frontend/models/fasta';\n\nimport { sequenceEditorStore } from '../../../stores/sequenceEditorStore';\nimport { SequenceEditor } from '../../ui/SequenceEditor';\nimport { SequenceEditorPage } from '../../ui/SequenceEditorPage';\n\n\nexport const SequenceEditorMainPage = () => {\n const loadingStatus = useStore(sequenceEditorStore, (state) => state.loadingStatus);\n const setData = useStore(sequenceEditorStore, (state) => state.setData);\n const rawFasta = useStore(sequenceEditorStore, (state) => state.rawFasta);\n\n const onClickLoadDemoData = useCallback(async () => {\n try {\n const fastaRes = await fetch('/sample-data/sarscov2_demo.fasta');\n const demoFastaText = await fastaRes.text();\n\n await setData(demoFastaText);\n FastaDataEventBusService.getInstance().emit('onCloseImportDialog');\n } catch (err: unknown) {\n FastaDataEventBusService.getInstance().emit('onCloseImportDialog');\n const errorMessage = `Failed to load demo dataset: ${ErrorUtil.getErrorMessage(err, 'Unknown error')}`;\n FastaDataEventBusService.getInstance().emit('onShowImportDialog', errorMessage);\n } finally {\n UrlUtil.clearSearchParams();\n }\n }, [setData]);\n\n const extraFastaDataImportDialogLoaderActions = useMemo<DialogAction[]>(() => [\n {\n autoFocus: true,\n color: 'secondary',\n label: 'Demo (SARS-CoV-2)',\n onClick: onClickLoadDemoData,\n variant: 'contained',\n },\n ], [onClickLoadDemoData]);\n\n return (\n <SequenceEditorPage\n isNoInteraction={false}\n >\n {rawFasta && (\n <SequenceEditor />\n )}\n {!rawFasta && (\n <FastaNotLoaded\n description={'Load a FASTA sequence file to enable the editor.'}\n icon={<BiotechOutlinedIcon sx={{ color: 'text.disabled', fontSize: 72 }} />}\n title={'No FASTA Sequence Loaded'}\n />\n )}\n <FastaDataImportDialogLoader\n extraActions={extraFastaDataImportDialogLoaderActions}\n store={sequenceEditorStore}\n />\n <BackdropSpinner\n label={`Computing phylogenetic tree`}\n open={loadingStatus === LOADING_STATUS.LOADING}\n />\n </SequenceEditorPage>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,IAAa,UAA+B;CAC1C,IAAM,IAAgB,EAAS,IAAsB,MAAU,EAAM,aAAa,GAC5E,IAAU,EAAS,IAAsB,MAAU,EAAM,OAAO,GAChE,IAAW,EAAS,IAAsB,MAAU,EAAM,QAAQ,GAElE,IAAsB,EAAY,YAAY;EAClD,IAAI;GAEF,IAAM,IAAgB,OAAM,MADL,MAAM,kCAAkC,EAAA,CAC1B,KAAK;GAG1C,AADA,MAAM,EAAQ,CAAa,GAC3B,EAAyB,YAAY,CAAC,CAAC,KAAK,qBAAqB;EACnE,SAAS,GAAc;GACrB,EAAyB,YAAY,CAAC,CAAC,KAAK,qBAAqB;GACjE,IAAM,IAAe,gCAAgC,EAAU,gBAAgB,GAAK,eAAe;GACnG,EAAyB,YAAY,CAAC,CAAC,KAAK,sBAAsB,CAAY;EAChF,UAAU;GACR,EAAQ,kBAAkB;EAC5B;CACF,GAAG,CAAC,CAAO,CAAC,GAEN,IAA0C,QAA8B,CAC5E;EACE,WAAW;EACX,OAAO;EACP,OAAO;EACP,SAAS;EACT,SAAS;CACX,CACF,GAAG,CAAC,CAAmB,CAAC;CAExB,OACE,kBAAC,GAAD;EACE,iBAAiB;EADnB,UAAA;GAGG,KACC,kBAAC,GAAD,CAAiB,CAAA;GAElB,CAAC,KACA,kBAAC,GAAD;IACE,aAAa;IACb,MAAM,kBAAC,GAAD,EAAqB,IAAI;KAAE,OAAO;KAAiB,UAAU;IAAG,EAAI,CAAA;IAC1E,OAAO;GACR,CAAA;GAEH,kBAAC,GAAD;IACE,cAAc;IACd,OAAO;GACR,CAAA;GACD,kBAAC,GAAD;IACE,OAAO;IACP,MAAM,MAAkB,EAAe;GACxC,CAAA;EACiB;;AAExB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SequenceEditorPage';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SequenceEditorPageHeader as e } from "../SequenceEditorPageHeader/index.js";
|
|
2
|
-
import { t } from "../../../_chunks/SequenceEditorPageDrawer.js";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
import { PageCommon as r } from "@rivm-loculus-tools/common-frontend/components/page";
|
|
5
|
-
//#region src/components/ui/SequenceEditorPage/SequenceEditorPage.tsx
|
|
6
|
-
var i = ({ children: i, isNoInteraction: a }) => /* @__PURE__ */ n(r, {
|
|
7
|
-
drawerComponent: /* @__PURE__ */ n(t, {}),
|
|
8
|
-
headerComponent: /* @__PURE__ */ n(e, {}),
|
|
9
|
-
isNoInteraction: a,
|
|
10
|
-
children: i
|
|
11
|
-
});
|
|
12
|
-
//#endregion
|
|
13
|
-
export { i as SequenceEditorPage };
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/SequenceEditorPage/SequenceEditorPage.tsx"],"sourcesContent":["import { PageCommon } from '@rivm-loculus-tools/common-frontend/components/page';\nimport type { PropsWithChildren } from 'react';\n\nimport { SequenceEditorPageDrawer } from '../SequenceEditorPageDrawer';\nimport { SequenceEditorPageHeader } from '../SequenceEditorPageHeader';\n\n\nexport type SequenceEditorPageProps = PropsWithChildren<{\n isNoInteraction: boolean;\n}>;\n\nexport const SequenceEditorPage = ({ children, isNoInteraction }: SequenceEditorPageProps) => {\n return (\n <PageCommon\n drawerComponent={<SequenceEditorPageDrawer />}\n headerComponent={<SequenceEditorPageHeader />}\n isNoInteraction={isNoInteraction}\n >\n {children}\n </PageCommon>\n );\n\n};\n"],"mappings":";;;;;AAWA,IAAa,KAAsB,EAAE,aAAU,yBAE3C,kBAAC,GAAD;CACE,iBAAiB,kBAAC,GAAD,CAA2B,CAAA;CAC5C,iBAAiB,kBAAC,GAAD,CAA2B,CAAA;CAC3B;CAEhB;AACS,CAAA"}
|
package/dist/models/editor.d.ts
DELETED
package/dist/models/editor.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","names":[],"sources":["../../src/models/editor.ts"],"sourcesContent":["export enum EDITOR_DIRECTION {\n DOWN = 'DOWN',\n LEFT = 'LEFT',\n RIGHT = 'RIGHT',\n UP = 'UP',\n}\n"],"mappings":";AAAA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,OAAA,QACA,EAAA,QAAA,SACA,EAAA,KAAA;AACF,EAAA,CAAA,CAAA"}
|
package/dist/models/index.d.ts
DELETED
package/dist/models/model.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","names":[],"sources":["../../src/models/model.ts"],"sourcesContent":["import type { MoveDirection } from '@rivm-loculus-tools/sequence-editor-wasm';\n\nexport enum EDITOR_PATH_PROPERTIES_TYPE {\n CELL = 'CELL',\n DIVIDER = 'DIVIDER',\n LABEL = 'LABEL',\n RULER = 'RULER',\n}\n\n\nexport enum MATRIX_TYPE {\n AMINO_ACID = 'amino_acid',\n NUCLEOTIDE = 'nucleotide',\n RECORD_NAME = 'record_name',\n}\n\nexport type EditorAssembly = {\n cells: EditorAssemblyCells;\n divider: EditorAssemblyDivider;\n labels: EditorAssemblyLabels;\n ruler: EditorAssemblyRuler;\n};\n\nexport type EditorAssemblyCells = {\n pathPropertiesMap: Map<Path2D, EditorPathProperties>;\n};\n\nexport type EditorAssemblyDivider = {\n pathPropertiesMap: Map<Path2D, EditorPathProperties>;\n};\n\nexport type EditorAssemblyLabels = {\n pathPropertiesMap: Map<Path2D, EditorPathProperties>;\n};\n\nexport type EditorAssemblyRuler = {\n pathPropertiesMap: Map<Path2D, EditorPathProperties>;\n};\n\nexport type EditorPathProperties = {\n col: number;\n row: number;\n type: EDITOR_PATH_PROPERTIES_TYPE.CELL;\n} | {\n col: number;\n type: EDITOR_PATH_PROPERTIES_TYPE.RULER;\n} | {\n row: number;\n type: EDITOR_PATH_PROPERTIES_TYPE.LABEL;\n} | {\n type: EDITOR_PATH_PROPERTIES_TYPE.DIVIDER;\n};\n\nexport type EditorSelection = {\n cells?: { // when a rectangular block of cells is selected\n endCol: number;\n endRow: number;\n startCol: number;\n startRow: number;\n };\n cols?: number[]; // when entire columns are selected\n rows?: number[]; // when entire rows are selected\n};\n\n/** Metadata describing the currently loaded alignment. */\nexport type EngineMeta = {\n alignmentWidth: number;\n redoDepth: number;\n sequenceCount: number;\n undoDepth: number;\n};\n\n/** A single search match, matching the Rust `search_algorithms::Match`. */\nexport type EngineSearchMatch = {\n col: number;\n matrix_type: MATRIX_TYPE;\n row: number;\n};\n\n/** Search results, matching the Rust `search_algorithms::SearchResult`. */\nexport type EngineSearchResult = {\n num_matches: number;\n positions: EngineSearchMatch[];\n query: string;\n truncated: boolean;\n};\n\n/**\n * Timing breakdown for a single request, measured in milliseconds via\n * `performance.now()`. All fields are optional so non-instrumented responses\n * (e.g. `ready`) can omit them.\n *\n * The full call-to-render latency decomposes as:\n *\n * total = bridgeOut + engineMs + bridgeBack + renderMs\n *\n * where:\n * - `engineMs` : time spent inside the Rust call (measured in worker)\n * - `workerMs` : total time the worker held the request, including the\n * Rust call + response postMessage setup (measured in worker)\n * - `bridgeOut` : main→worker postMessage latency (computed on main thread\n * as `workerReceiveTs - sentTs`, see `TimingMarks`)\n * - `bridgeBack` : worker→main postMessage latency (computed on main thread\n * as `receivedTs - workerDoneTs`)\n * - `renderMs` : time from promise resolution to browser paint (measured\n * with `requestAnimationFrame` in the harness)\n */\nexport type EngineTiming = {\n /** Time inside the Rust engine call (ms). */\n engineMs: number;\n /** Total time the worker held the request (ms): from receive to postMessage. */\n workerMs: number;\n};\n\n/** A fetched viewport or translation slice plus the metadata to interpret it. */\nexport type EngineViewportResult = {\n /** Row-major bytes, transferred from the worker via comlink. */\n bytes: Uint8Array;\n /** Number of columns per row (may be less than requested if clamped). */\n cols: number;\n /** Number of rows actually present in `bytes`. */\n rows: number;\n /** Column index of the first column in the slice. */\n startCol: number;\n /** Row index of the first row in the slice. */\n startRow: number;\n};\n\n/**\n * Contract implemented by the `EngineWorker` class and exposed to the main\n * thread through comlink. Every method is asynchronous so comlink can proxy it\n * across the worker boundary.\n */\nexport interface EngineWorkerApi {\n delete: (rows: number[], column: number) => Promise<void>;\n deleteColumn: (column: number) => Promise<void>;\n exportFasta: () => Promise<string>;\n /** Idempotently initializes the WASM engine; resolves once it is ready. */\n initialize: () => Promise<void>;\n insert: (rows: number[], column: number) => Promise<void>;\n load: (fastaContent: string) => Promise<number>;\n meta: () => Promise<EngineMeta>;\n moveHorizontal: (row: number, columns: number[], direction: MoveDirection) => Promise<void>;\n moveRowsDown: (rows: number[]) => Promise<void>;\n moveRowsUp: (rows: number[]) => Promise<void>;\n mutate: (rows: number[], column: number, base: string) => Promise<void>;\n name: (row: number) => Promise<string>;\n redo: () => Promise<boolean>;\n search: (query: string, checkRecordNames: boolean) => Promise<EngineSearchResult>;\n translate: (bounds: ViewportBounds, readingFrame: number) => Promise<EngineViewportResult>;\n undo: () => Promise<boolean>;\n viewport: (bounds: ViewportBounds) => Promise<EngineViewportResult>;\n}\n\n\n/**\n * Wire protocol between the main thread and the MSA Web Worker.\n *\n * Design goals:\n * - **Zero-copy for binary payloads via SharedArrayBuffer.** Viewport\n * responses write into a single SAB created at worker init. The worker\n * sends a tiny control message (`{sabLen, data: ViewportResult}`) and the\n * main thread reads bytes directly from shared memory — no per-call\n * structured clone of binary data.\n * - **O(1) response correlation.** Every request carries a monotonically\n * increasing `reqId`; the client keeps a `Map<reqId, resolver>` for\n * constant-time dispatch.\n * - **Typed arrays for index vectors.** Row-index lists travel as\n * `Uint32Array` (not `number[]`) to avoid per-element number boxing and to\n * match the wasm-bindgen `&[usize]` slice mapping directly.\n * - **No JSON for hot paths.** Only small plain objects are structured-cloned;\n * binary data is always transferred via the shared SAB.\n */\n\n// ---------------------------------------------------------------------------\n// Shared types\n// ---------------------------------------------------------------------------\n\nexport type GridGeometry = {\n cellHeight: number;\n cellWidth: number;\n dividerWidth: number;\n labelWidth: number;\n numOverscanCols: number;\n numOverscanRows: number;\n rulerHeight: number;\n};\n\nexport type GridPoint = {\n col: number;\n row: number;\n surface: 'cell' | 'gutter' | 'ruler';\n};\n\nexport type GridRange = {\n endCol: number;\n endRow: number;\n startCol: number;\n startRow: number;\n};\n\nexport type GridRangeWithRowNames = {\n range: GridRange;\n rowNames: string[];\n};\n\nexport type GridRangeWithViewportResults = {\n range: GridRange;\n viewportResult: EngineViewportResult;\n};\n\nexport type Meta = {\n redoDepth: number;\n sequences: number;\n undoDepth: number;\n width: number;\n};\n\n// ---------------------------------------------------------------------------\n// Main → Worker requests\n// ---------------------------------------------------------------------------\n\n/**The following types match the Rust `search_algorithms::Match` and search_algorithms::SearchResult structures. */\nexport type SearchMatch = {\n col: number;\n matrix_type: MATRIX_TYPE;\n row: number;\n};\n\n// ---------------------------------------------------------------------------\n// Worker → Main responses\n// ---------------------------------------------------------------------------\n\nexport type SearchResult = EngineSearchResult;\n\n/** Summary statistics for a set of measured values. */\nexport type Stats = {\n count: number;\n max: number;\n mean: number;\n median: number;\n min: number;\n p95: number;\n};\n\nexport type StatusBarSelectionStats = {\n cols: number;\n pos: number;\n selectedSeqs: number;\n totalSelectedChars: number;\n};\n\n/** Inclusive column/row bounds for a viewport or translation request. */\nexport type ViewportBounds = {\n endCol: number;\n endRow: number;\n startCol: number;\n startRow: number;\n};\n\n/** A fetched viewport slice plus the metadata needed to interpret it. */\nexport type ViewportResult = {\n /** Number of columns per row (may be less than requested if clamped). */\n cols: number;\n /** Number of rows actually present in `bytes`. */\n rows: number;\n /** Column index of the first column in the slice. */\n startCol: number;\n /** Row index of the first row in the slice. */\n startRow: number;\n};\n\nexport type VisibleGridRange = {\n cache: GridRange;\n visible: GridRange;\n};\n\nexport type VisibleGridRangeWithArguments = {\n geometry: GridGeometry;\n scrollLeft: number;\n scrollTop: number;\n viewportHeight: number;\n viewportWidth: number;\n visibleGridRange: VisibleGridRange;\n};\n\n/** Debug info exposed to the scrolling viewport status bar. */\nexport type WindowInfo = {\n bufBytes: number;\n bufEnd: number;\n bufStart: number;\n fetching: boolean;\n visEnd: number;\n visStart: number;\n};\n"],"mappings":";AAEA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,UAAA,WACA,EAAA,QAAA,SACA,EAAA,QAAA;AACF,EAAA,CAAA,CAAA,GAGY,IAAL,yBAAA,GAAA;QACL,EAAA,aAAA,cACA,EAAA,aAAA,cACA,EAAA,cAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"palette.js","names":[],"sources":["../../src/models/palette.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/naming-convention\nexport enum AminoAcidSymbol {\n A = 'A',\n C = 'C',\n D = 'D',\n E = 'E',\n F = 'F',\n G = 'G',\n GAP = '-',\n H = 'H',\n I = 'I',\n K = 'K',\n L = 'L',\n M = 'M',\n N = 'N',\n P = 'P',\n Q = 'Q',\n R = 'R',\n S = 'S',\n STOP = '*',\n T = 'T',\n V = 'V',\n W = 'W',\n X = 'X',\n Y = 'Y',\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport enum NucleotideSymbol {\n A = 'A',\n B = 'B',\n C = 'C',\n D = 'D',\n G = 'G',\n GAP = '-',\n H = 'H',\n K = 'K',\n M = 'M',\n N = 'N',\n R = 'R',\n S = 'S',\n T = 'T',\n U = 'U',\n UNKNOWN = 'X',\n V = 'V',\n W = 'W',\n Y = 'Y',\n}\n\nexport type AminoAcidPalette = {\n name: string;\n paletteColors: AminoAcidPaletteColors;\n};\nexport type AminoAcidPaletteColors = Record<AminoAcidSymbol, PaletteEntry>;\n\nexport type NucleotidePalette = {\n name: string;\n paletteColors: NucleotidePaletteColors;\n};\n\nexport type NucleotidePaletteColors = Record<NucleotideSymbol, PaletteEntry>;\n\nexport type PaletteEntry = {\n background: string;\n backgroundSelected: string;\n foreground: string;\n foregroundSelected: string;\n};\n"],"mappings":";AACA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,MAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,OAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA;AACF,EAAA,CAAA,CAAA,GAGY,IAAL,yBAAA,GAAA;QACL,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,MAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,UAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA;AACF,EAAA,CAAA,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|