@rivm-loculus-tools/sequence-editor 0.1.4 → 0.1.7
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 +127 -0
- package/dist/_chunks/EditorWorkerService.js.map +1 -0
- package/dist/_chunks/SequenceEditor.js +733 -0
- package/dist/_chunks/SequenceEditor.js.map +1 -0
- package/dist/_chunks/SequenceEditorPageDrawer.js +425 -0
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -0
- 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 +174 -0
- package/dist/_chunks/sequenceEditorStore.js.map +1 -0
- package/dist/assets/index-Dn92arD_.js +8 -0
- package/dist/assets/index-Dn92arD_.js.map +1 -0
- package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +27 -0
- package/dist/classes/services/EditorWorkerService/index.js +2 -0
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +25 -0
- package/dist/classes/services/SequenceEditorEventBusService/index.js +16 -0
- package/dist/classes/services/SequenceEditorEventBusService/index.js.map +1 -0
- package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +46 -0
- package/dist/classes/workers/EngineWorker/index.js +111 -0
- package/dist/classes/workers/EngineWorker/index.js.map +1 -0
- package/dist/components/app/App/App.d.ts +1 -0
- package/dist/components/app/App/index.js +21 -0
- package/dist/components/app/App/index.js.map +1 -0
- package/dist/components/pages/EmptyWorkspace.d.ts +3 -0
- package/dist/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.d.ts +3 -0
- package/dist/components/pages/SequenceEditorErrorPage/index.js +12 -0
- package/dist/components/pages/SequenceEditorErrorPage/index.js.map +1 -0
- package/dist/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.d.ts +1 -0
- package/dist/components/pages/SequenceEditorMainPage/index.js +61 -0
- package/dist/components/pages/SequenceEditorMainPage/index.js.map +1 -0
- package/dist/components/ui/SequenceEditor/SequenceEditor.d.ts +1 -0
- package/dist/components/ui/SequenceEditor/SequenceEditorGotoPositionDialog.d.ts +8 -0
- package/dist/components/ui/SequenceEditor/SequenceEditorStatusBar.d.ts +1 -0
- package/dist/components/ui/SequenceEditor/index.js +2 -0
- package/dist/components/ui/SequenceEditorPage/SequenceEditorPage.d.ts +5 -0
- package/dist/components/ui/SequenceEditorPage/index.js +15 -0
- package/dist/components/ui/SequenceEditorPage/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawer.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.d.ts +7 -0
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageDrawer/index.js +2 -0
- package/dist/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageHeader/index.js +60 -0
- package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.d.ts +1 -0
- package/dist/components/ui/SequenceEditorSearchBar/index.js +27 -0
- package/dist/components/ui/SequenceEditorSearchBar/index.js.map +1 -0
- package/dist/constants/editor.d.ts +4 -0
- package/dist/constants/editor.js +14 -0
- package/dist/constants/editor.js.map +1 -0
- package/dist/constants/index.js +4 -0
- package/dist/constants/keyboard.d.ts +10 -0
- package/dist/constants/keyboard.js +179 -0
- package/dist/constants/keyboard.js.map +1 -0
- package/dist/constants/palette.d.ts +15 -0
- package/dist/constants/palette.js +196 -0
- package/dist/constants/palette.js.map +1 -0
- package/dist/models/editor.d.ts +6 -0
- package/dist/models/editor.js +8 -0
- package/dist/models/editor.js.map +1 -0
- package/dist/models/model.d.ts +250 -0
- package/dist/models/model.js +10 -0
- package/dist/models/model.js.map +1 -0
- package/dist/models/palette.d.ts +61 -0
- package/dist/models/palette.js +10 -0
- package/dist/models/palette.js.map +1 -0
- package/dist/stores/sequenceEditorStore/index.js +2 -0
- package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +36 -0
- package/dist/utils/EditorUtil/EditorUtil.d.ts +96 -0
- package/dist/utils/EditorUtil/index.js +552 -0
- package/dist/utils/EditorUtil/index.js.map +1 -0
- package/dist/utils/EngineErrorUtil/EngineErrorUtil.d.ts +4 -0
- package/dist/utils/PaletteUtil/PaletteUtil.d.ts +6 -0
- package/dist/utils/PaletteUtil/index.js +19 -0
- package/dist/utils/PaletteUtil/index.js.map +1 -0
- package/package.json +47 -21
- package/.gitkeep +0 -0
- package/CHANGELOG.md +0 -37
- package/eslint.config.js +0 -16
- package/scripts/update-exports.js +0 -9
- package/src/classes/services/EditorWorkerService/EditorWorkerService.ts +0 -163
- package/src/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.ts +0 -37
- package/src/classes/workers/EngineWorker/EngineWorker.ts +0 -196
- package/src/components/app/App/App.tsx +0 -22
- package/src/components/pages/EmptyWorkspace.tsx +0 -43
- package/src/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.tsx +0 -16
- package/src/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.tsx +0 -76
- package/src/components/ui/SequenceEditor/SequenceEditor.tsx +0 -896
- package/src/components/ui/SequenceEditor/SequenceEditorGotoPositionDialog.tsx +0 -108
- package/src/components/ui/SequenceEditor/SequenceEditorStatusBar.tsx +0 -72
- package/src/components/ui/SequenceEditorPage/SequenceEditorPage.tsx +0 -23
- package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawer.tsx +0 -234
- package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.tsx +0 -73
- package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.tsx +0 -230
- package/src/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.tsx +0 -71
- package/src/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.tsx +0 -35
- package/src/constants/editor.ts +0 -15
- package/src/constants/keyboard.ts +0 -154
- package/src/constants/palette.ts +0 -227
- package/src/models/editor.ts +0 -6
- package/src/models/model.ts +0 -295
- package/src/models/palette.ts +0 -68
- package/src/stores/sequenceEditorStore/sequenceEditorStore.ts +0 -103
- package/src/utils/EditorUtil/EditorUtil.ts +0 -892
- package/src/utils/EngineErrorUtil/EngineErrorUtil.ts +0 -25
- package/src/utils/PaletteUtil/PaletteUtil.ts +0 -31
- package/tsconfig.build.json +0 -14
- package/tsconfig.json +0 -32
- package/vite.config.ts +0 -177
- /package/{src/classes/services/EditorWorkerService/index.ts → dist/classes/services/EditorWorkerService/index.d.ts} +0 -0
- /package/{src/classes/services/SequenceEditorEventBusService/index.ts → dist/classes/services/SequenceEditorEventBusService/index.d.ts} +0 -0
- /package/{src/classes/workers/EngineWorker/index.ts → dist/classes/workers/EngineWorker/index.d.ts} +0 -0
- /package/{src/components/app/App/index.ts → dist/components/app/App/index.d.ts} +0 -0
- /package/{src/components/pages/SequenceEditorErrorPage/index.ts → dist/components/pages/SequenceEditorErrorPage/index.d.ts} +0 -0
- /package/{src/components/pages/SequenceEditorMainPage/index.ts → dist/components/pages/SequenceEditorMainPage/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditor/index.ts → dist/components/ui/SequenceEditor/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorPage/index.ts → dist/components/ui/SequenceEditorPage/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorPageDrawer/index.ts → dist/components/ui/SequenceEditorPageDrawer/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorPageHeader/index.ts → dist/components/ui/SequenceEditorPageHeader/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorSearchBar/index.ts → dist/components/ui/SequenceEditorSearchBar/index.d.ts} +0 -0
- /package/{src/constants/index.ts → dist/constants/index.d.ts} +0 -0
- /package/{src/models/index.ts → dist/models/index.d.ts} +0 -0
- /package/{src/stores/sequenceEditorStore/index.ts → dist/stores/sequenceEditorStore/index.d.ts} +0 -0
- /package/{src/utils/EditorUtil/index.ts → dist/utils/EditorUtil/index.d.ts} +0 -0
- /package/{src/utils/PaletteUtil/index.ts → dist/utils/PaletteUtil/index.d.ts} +0 -0
package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EventBusAbstract } from '@gen-epix/ui-core/classes/abstracts/EventBusAbstract';
|
|
2
|
+
import { EDITOR_DIRECTION } from '../../../models/editor';
|
|
3
|
+
export type SequenceEditorEventBusServiceEvent = {
|
|
4
|
+
onDeleteBackward: void;
|
|
5
|
+
onExpandSelection: EDITOR_DIRECTION;
|
|
6
|
+
onGotoPosition: void;
|
|
7
|
+
onInsert: void;
|
|
8
|
+
onMoveCells: EDITOR_DIRECTION;
|
|
9
|
+
onMoveRows: EDITOR_DIRECTION;
|
|
10
|
+
onMoveRowsEnd: EDITOR_DIRECTION;
|
|
11
|
+
onMoveSelection: EDITOR_DIRECTION;
|
|
12
|
+
onMutateSelection: string;
|
|
13
|
+
onRedo: void;
|
|
14
|
+
onScrollPageDown: void;
|
|
15
|
+
onScrollPageUp: void;
|
|
16
|
+
onScrollToLineEnd: void;
|
|
17
|
+
onScrollToLineStart: void;
|
|
18
|
+
onSearch: string;
|
|
19
|
+
onUndo: void;
|
|
20
|
+
};
|
|
21
|
+
export declare class SequenceEditorEventBusService extends EventBusAbstract<SequenceEditorEventBusServiceEvent> {
|
|
22
|
+
private static __instance;
|
|
23
|
+
private constructor();
|
|
24
|
+
static getInstance(): SequenceEditorEventBusService;
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EventBusAbstract as e } from "@gen-epix/ui-core/classes/abstracts/EventBusAbstract";
|
|
2
|
+
import { HmrUtil as t } from "@gen-epix/ui-core/utils/HmrUtil";
|
|
3
|
+
//#region src/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.ts
|
|
4
|
+
var n = class n extends e {
|
|
5
|
+
static __instance;
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
9
|
+
static getInstance() {
|
|
10
|
+
return n.__instance = t.getHmrSingleton("SequenceEditorEventBusService", n.__instance, () => new n()), n.__instance;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as SequenceEditorEventBusService };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { MoveDirection } from '@rivm-loculus-tools/sequence-editor-wasm';
|
|
2
|
+
import { EngineMeta, EngineSearchResult, EngineViewportResult, EngineWorkerApi, ViewportBounds } from '../../../models';
|
|
3
|
+
/**
|
|
4
|
+
* MSA engine Web Worker.
|
|
5
|
+
*
|
|
6
|
+
* This worker is the **single owner** of the `MsaEngine` WASM instance and its
|
|
7
|
+
* linear memory for the lifetime of the page. All Rust calls happen here, off
|
|
8
|
+
* the main thread, so FASTA parsing, structural mutations, and undo/redo
|
|
9
|
+
* snapshots never stall the React render loop.
|
|
10
|
+
*
|
|
11
|
+
* The class is exposed to the main thread through comlink, so every public
|
|
12
|
+
* method is proxied as an asynchronous call across the worker boundary.
|
|
13
|
+
*/
|
|
14
|
+
export declare class EngineWorker implements EngineWorkerApi {
|
|
15
|
+
private engine;
|
|
16
|
+
private initialization;
|
|
17
|
+
delete(rows: number[], column: number): Promise<void>;
|
|
18
|
+
deleteColumn(column: number): Promise<void>;
|
|
19
|
+
exportFasta(): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Idempotently instantiates the WASM module and constructs the engine.
|
|
22
|
+
* Safe to call multiple times; concurrent callers share one initialization.
|
|
23
|
+
*/
|
|
24
|
+
initialize(): Promise<void>;
|
|
25
|
+
insert(rows: number[], column: number): Promise<void>;
|
|
26
|
+
load(fastaContent: string): Promise<number>;
|
|
27
|
+
meta(): Promise<EngineMeta>;
|
|
28
|
+
moveHorizontal(row: number, columns: number[], direction: MoveDirection): Promise<void>;
|
|
29
|
+
moveRowsDown(rows: number[]): Promise<void>;
|
|
30
|
+
moveRowsUp(rows: number[]): Promise<void>;
|
|
31
|
+
mutate(rows: number[], column: number, base: string): Promise<void>;
|
|
32
|
+
name(row: number): Promise<string>;
|
|
33
|
+
redo(): Promise<boolean>;
|
|
34
|
+
search(query: string, checkRecordNames: boolean): Promise<EngineSearchResult>;
|
|
35
|
+
translate(bounds: ViewportBounds, readingFrame: number): Promise<EngineViewportResult>;
|
|
36
|
+
undo(): Promise<boolean>;
|
|
37
|
+
viewport(bounds: ViewportBounds): Promise<EngineViewportResult>;
|
|
38
|
+
/** Builds a fixed-stride viewport result from the engine's returned bytes. */
|
|
39
|
+
private buildViewportResult;
|
|
40
|
+
/** Returns the initialized engine, initializing it first if necessary. */
|
|
41
|
+
private requireEngine;
|
|
42
|
+
/** Converts a plain row-index list into the typed array the WASM API expects. */
|
|
43
|
+
private toRowIndices;
|
|
44
|
+
/** Validates that viewport/translation bounds are safe, non-negative, and ordered. */
|
|
45
|
+
private validateBounds;
|
|
46
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { t as e } from "../../../_chunks/comlink.js";
|
|
2
|
+
import t, { MsaEngine as n } from "@rivm-loculus-tools/sequence-editor-wasm";
|
|
3
|
+
//#region src/classes/workers/EngineWorker/EngineWorker.ts
|
|
4
|
+
var r = class {
|
|
5
|
+
engine = null;
|
|
6
|
+
initialization = null;
|
|
7
|
+
async delete(e, t) {
|
|
8
|
+
(await this.requireEngine()).delete_at_subset(this.toRowIndices(e), t);
|
|
9
|
+
}
|
|
10
|
+
async deleteColumn(e) {
|
|
11
|
+
(await this.requireEngine()).delete_column(e);
|
|
12
|
+
}
|
|
13
|
+
async exportFasta() {
|
|
14
|
+
let e = await this.requireEngine(), t = [];
|
|
15
|
+
for (let n = 0; n < e.get_sequence_count(); n += 1) {
|
|
16
|
+
let r = [];
|
|
17
|
+
for (let t = 0; t < e.get_row_length(n); t += 1) r.push(String.fromCharCode(e.get_base(n, t)));
|
|
18
|
+
t.push(`>${e.get_name(n)}\n${r.join("")}\n`);
|
|
19
|
+
}
|
|
20
|
+
return t.join("");
|
|
21
|
+
}
|
|
22
|
+
async initialize() {
|
|
23
|
+
this.engine || (this.initialization || (this.initialization = (async () => {
|
|
24
|
+
await t(void 0), this.engine = new n();
|
|
25
|
+
})(), this.initialization.catch(() => {
|
|
26
|
+
this.initialization = null;
|
|
27
|
+
})), await this.initialization);
|
|
28
|
+
}
|
|
29
|
+
async insert(e, t) {
|
|
30
|
+
(await this.requireEngine()).insert_at_subset(this.toRowIndices(e), t);
|
|
31
|
+
}
|
|
32
|
+
async load(e) {
|
|
33
|
+
return (await this.requireEngine()).load_fasta(e);
|
|
34
|
+
}
|
|
35
|
+
async meta() {
|
|
36
|
+
let e = await this.requireEngine();
|
|
37
|
+
return {
|
|
38
|
+
alignmentWidth: e.get_alignment_width(),
|
|
39
|
+
redoDepth: e.redo_depth(),
|
|
40
|
+
sequenceCount: e.get_sequence_count(),
|
|
41
|
+
undoDepth: e.undo_depth()
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async moveHorizontal(e, t, n) {
|
|
45
|
+
(await this.requireEngine()).move_horizontal(e, this.toRowIndices(t), n);
|
|
46
|
+
}
|
|
47
|
+
async moveRowsDown(e) {
|
|
48
|
+
(await this.requireEngine()).move_rows_down(this.toRowIndices(e));
|
|
49
|
+
}
|
|
50
|
+
async moveRowsUp(e) {
|
|
51
|
+
(await this.requireEngine()).move_rows_up(this.toRowIndices(e));
|
|
52
|
+
}
|
|
53
|
+
async mutate(e, t, n) {
|
|
54
|
+
(await this.requireEngine()).mutate_base_subset(this.toRowIndices(e), t, n.charCodeAt(0));
|
|
55
|
+
}
|
|
56
|
+
async name(e) {
|
|
57
|
+
return (await this.requireEngine()).get_name(e);
|
|
58
|
+
}
|
|
59
|
+
async redo() {
|
|
60
|
+
return (await this.requireEngine()).redo();
|
|
61
|
+
}
|
|
62
|
+
async search(e, t) {
|
|
63
|
+
return (await this.requireEngine()).search(e, t);
|
|
64
|
+
}
|
|
65
|
+
async translate(e, t) {
|
|
66
|
+
let n = await this.requireEngine();
|
|
67
|
+
this.validateBounds(e);
|
|
68
|
+
let r = n.translate(e.startRow, e.endRow, e.startCol, e.endCol, t);
|
|
69
|
+
return this.buildViewportResult(r, e);
|
|
70
|
+
}
|
|
71
|
+
async undo() {
|
|
72
|
+
return (await this.requireEngine()).undo();
|
|
73
|
+
}
|
|
74
|
+
async viewport(e) {
|
|
75
|
+
let t = await this.requireEngine();
|
|
76
|
+
this.validateBounds(e);
|
|
77
|
+
let n = t.update_viewport(e.startRow, e.endRow, e.startCol, e.endCol);
|
|
78
|
+
return this.buildViewportResult(n, e);
|
|
79
|
+
}
|
|
80
|
+
buildViewportResult(e, t) {
|
|
81
|
+
let n = t.endCol - t.startCol + 1;
|
|
82
|
+
return {
|
|
83
|
+
bytes: e,
|
|
84
|
+
cols: n,
|
|
85
|
+
rows: n > 0 ? Math.floor(e.byteLength / n) : 0,
|
|
86
|
+
startCol: t.startCol,
|
|
87
|
+
startRow: t.startRow
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
async requireEngine() {
|
|
91
|
+
if (await this.initialize(), !this.engine) throw Error("Engine failed to initialize");
|
|
92
|
+
return this.engine;
|
|
93
|
+
}
|
|
94
|
+
toRowIndices(e) {
|
|
95
|
+
return new Uint32Array(e);
|
|
96
|
+
}
|
|
97
|
+
validateBounds(e) {
|
|
98
|
+
if (![
|
|
99
|
+
e.startRow,
|
|
100
|
+
e.endRow,
|
|
101
|
+
e.startCol,
|
|
102
|
+
e.endCol
|
|
103
|
+
].every((e) => Number.isSafeInteger(e) && e >= 0)) throw Error("Viewport bounds must be non-negative safe integers");
|
|
104
|
+
if (e.startRow > e.endRow || e.startCol > e.endCol) throw Error("Viewport bounds must be ordered (start <= end)");
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
e(new r());
|
|
108
|
+
//#endregion
|
|
109
|
+
export { r as EngineWorker };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/classes/workers/EngineWorker/EngineWorker.ts"],"sourcesContent":["/// <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"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const App: () => import('react').JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SequenceEditorMainPage as e } from "../../pages/SequenceEditorMainPage/index.js";
|
|
2
|
+
import { SequenceEditorErrorPage as t } from "../../pages/SequenceEditorErrorPage/index.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { PageCommonContextProvider as i } from "@rivm-loculus-tools/common-frontend/components/page";
|
|
5
|
+
import { CssBaseline as a } from "@mui/material";
|
|
6
|
+
import { ThemeProvider as o } from "@mui/material/styles";
|
|
7
|
+
import { ErrorBoundary as s } from "react-error-boundary";
|
|
8
|
+
import { theme as c } from "@rivm-loculus-tools/common-frontend/theme";
|
|
9
|
+
import { I18nWrapper as l } from "@rivm-loculus-tools/common-frontend/components/I18nWrapper";
|
|
10
|
+
//#region src/components/app/App/App.tsx
|
|
11
|
+
var u = () => /* @__PURE__ */ n(s, {
|
|
12
|
+
FallbackComponent: t,
|
|
13
|
+
children: /* @__PURE__ */ n(l, { children: /* @__PURE__ */ r(o, {
|
|
14
|
+
theme: c,
|
|
15
|
+
children: [/* @__PURE__ */ n(a, {}), /* @__PURE__ */ n(i, { children: /* @__PURE__ */ n(e, {}) })]
|
|
16
|
+
}) })
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { u as App };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/app/App/App.tsx"],"sourcesContent":["import { CssBaseline } from '@mui/material';\nimport { ThemeProvider } from '@mui/material/styles';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { theme } from '@rivm-loculus-tools/common-frontend/theme';\nimport { I18nWrapper } from '@rivm-loculus-tools/common-frontend/components/I18nWrapper';\nimport { PageCommonContextProvider } from '@rivm-loculus-tools/common-frontend/components/page';\n\nimport { SequenceEditorMainPage } from '../../pages/SequenceEditorMainPage';\nimport { SequenceEditorErrorPage } from '../../pages/SequenceEditorErrorPage';\n\nexport const App = () => (\n <ErrorBoundary FallbackComponent={SequenceEditorErrorPage}>\n <I18nWrapper>\n <ThemeProvider theme={theme}>\n <CssBaseline />\n <PageCommonContextProvider>\n <SequenceEditorMainPage />\n </PageCommonContextProvider>\n </ThemeProvider>\n </I18nWrapper>\n </ErrorBoundary>\n);\n"],"mappings":";;;;;;;;;;AAUA,IAAa,UACX,kBAAC,GAAD;CAAe,mBAAmB;CAChC,UAAA,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAsB;EAAtB,UAAA,CACE,kBAAC,GAAD,CAAc,CAAA,GACd,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,CAAyB,CAAA,EACA,CAAA,CACd;CACJ,CAAA,EAAA,CAAA;AACA,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SequenceEditorMainPage: () => import('react').JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { t as e } from "../../../_chunks/sequenceEditorStore.js";
|
|
2
|
+
import { t } from "../../../_chunks/react.js";
|
|
3
|
+
import { SequenceEditorPage as n } from "../../ui/SequenceEditorPage/index.js";
|
|
4
|
+
import { t as r } from "../../../_chunks/SequenceEditor.js";
|
|
5
|
+
import { useCallback as i, useMemo as a } from "react";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import c from "@mui/icons-material/BiotechOutlined";
|
|
8
|
+
import { FastaDataEventBusService as l } from "@rivm-loculus-tools/common-frontend/classes/services/FastaDataEventBusService";
|
|
9
|
+
import { ErrorUtil as u } from "@rivm-loculus-tools/common-frontend/utils/ErrorUtil";
|
|
10
|
+
import { UrlUtil as d } from "@rivm-loculus-tools/common-frontend/utils/UrlUtil";
|
|
11
|
+
import { FastaDataImportDialogLoader as f } from "@rivm-loculus-tools/common-frontend/components/FastaDataImportDialogLoader";
|
|
12
|
+
import { BackdropSpinner as p } from "@gen-epix/ui-core-components/components/BackdropSpinner";
|
|
13
|
+
import { FastaNotLoaded as m } from "@rivm-loculus-tools/common-frontend/components/FastaNotLoaded";
|
|
14
|
+
import { LOADING_STATUS as h } from "@rivm-loculus-tools/common-frontend/models/fasta";
|
|
15
|
+
//#region src/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.tsx
|
|
16
|
+
var g = () => {
|
|
17
|
+
let g = t(e, (e) => e.loadingStatus), _ = t(e, (e) => e.setData), v = t(e, (e) => e.rawFasta), y = i(async () => {
|
|
18
|
+
try {
|
|
19
|
+
let e = await (await fetch("/sample-data/sarscov2_demo.fasta")).text();
|
|
20
|
+
await _(e), l.getInstance().emit("onCloseImportDialog");
|
|
21
|
+
} catch (e) {
|
|
22
|
+
l.getInstance().emit("onCloseImportDialog");
|
|
23
|
+
let t = `Failed to load demo dataset: ${u.getErrorMessage(e, "Unknown error")}`;
|
|
24
|
+
l.getInstance().emit("onShowImportDialog", t);
|
|
25
|
+
} finally {
|
|
26
|
+
d.clearSearchParams();
|
|
27
|
+
}
|
|
28
|
+
}, [_]), b = a(() => [{
|
|
29
|
+
autoFocus: !0,
|
|
30
|
+
color: "secondary",
|
|
31
|
+
label: "Demo (SARS-CoV-2)",
|
|
32
|
+
onClick: y,
|
|
33
|
+
variant: "contained"
|
|
34
|
+
}], [y]);
|
|
35
|
+
return /* @__PURE__ */ s(n, {
|
|
36
|
+
isNoInteraction: !1,
|
|
37
|
+
children: [
|
|
38
|
+
v && /* @__PURE__ */ o(r, {}),
|
|
39
|
+
!v && /* @__PURE__ */ o(m, {
|
|
40
|
+
description: "Load a FASTA sequence file to enable the editor.",
|
|
41
|
+
icon: /* @__PURE__ */ o(c, { sx: {
|
|
42
|
+
color: "text.disabled",
|
|
43
|
+
fontSize: 72
|
|
44
|
+
} }),
|
|
45
|
+
title: "No FASTA Sequence Loaded"
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ o(f, {
|
|
48
|
+
extraActions: b,
|
|
49
|
+
store: e
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ o(p, {
|
|
52
|
+
label: "Computing phylogenetic tree",
|
|
53
|
+
open: g === h.LOADING
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { g as SequenceEditorMainPage };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SequenceEditor: () => import('react').JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WithDialogRefMethods, WithDialogRenderProps } from '@gen-epix/ui-core-components/hoc/withDialog';
|
|
2
|
+
export interface SequenceEditorGotoPositionDialogOpenProps {
|
|
3
|
+
}
|
|
4
|
+
export interface SequenceEditorGotoPositionDialogProps extends WithDialogRenderProps<SequenceEditorGotoPositionDialogOpenProps> {
|
|
5
|
+
onGotoPosition: (x: null | number, y: null | number) => void;
|
|
6
|
+
}
|
|
7
|
+
export type SequenceEditorGotoPositionDialogRefMethods = WithDialogRefMethods<SequenceEditorGotoPositionDialogProps, SequenceEditorGotoPositionDialogOpenProps>;
|
|
8
|
+
export declare const SequenceEditorGotoPositionDialog: import('react').ComponentClass<SequenceEditorGotoPositionDialogProps, import('@gen-epix/ui-core-components/hoc/withDialog').WithDialogState<SequenceEditorGotoPositionDialogOpenProps>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SequenceEditorStatusBar: () => import('react').JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SequenceEditorPageDrawer: () => import('react').JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AminoAcidPalette, NucleotidePalette } from '../../../models';
|
|
2
|
+
export type SequenceEditorPageDrawerColorFormProps<TPalette extends AminoAcidPalette | NucleotidePalette> = {
|
|
3
|
+
currentPalette: TPalette;
|
|
4
|
+
onPaletteChange: (palettes: TPalette) => void;
|
|
5
|
+
palettes: Array<TPalette>;
|
|
6
|
+
};
|
|
7
|
+
export declare const SequenceEditorPageDrawerColorForm: <TPalette extends AminoAcidPalette | NucleotidePalette>({ currentPalette, onPaletteChange, palettes }: SequenceEditorPageDrawerColorFormProps<TPalette>) => import('react').JSX.Element;
|
package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SequenceEditorPageDrawerKeyboardShortcuts: () => import('react').JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SequenceEditorPageHeader: () => import('react').JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { SequenceEditorEventBusService as e } from "../../../classes/services/SequenceEditorEventBusService/index.js";
|
|
2
|
+
import { t } from "../../../_chunks/sequenceEditorStore.js";
|
|
3
|
+
import { t as n } from "../../../_chunks/react.js";
|
|
4
|
+
import { useCallback as r } from "react";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { FastaPageHeaderCenterComponent as s } from "@rivm-loculus-tools/common-frontend/components/FastaPageHeaderCenterComponent";
|
|
7
|
+
import { FastaPageHeaderImportButton as c } from "@rivm-loculus-tools/common-frontend/components/FastaPageHeaderImportButton";
|
|
8
|
+
import { FastaPageHeaderResetButton as l } from "@rivm-loculus-tools/common-frontend/components/FastaPageHeaderResetButton";
|
|
9
|
+
import { PageCommonHeader as u } from "@rivm-loculus-tools/common-frontend/components/page";
|
|
10
|
+
import { PageHeaderDocumentationButton as d } from "@rivm-loculus-tools/common-frontend/components/PageHeaderDocumentationButton";
|
|
11
|
+
import f from "@mui/icons-material/BiotechOutlined";
|
|
12
|
+
import p from "@mui/icons-material/Undo";
|
|
13
|
+
import m from "@mui/icons-material/Redo";
|
|
14
|
+
import { IconButton as h, Tooltip as g } from "@mui/material";
|
|
15
|
+
//#region src/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.tsx
|
|
16
|
+
var _ = () => {
|
|
17
|
+
let _ = n(t, (e) => e.resetDataset), v = n(t, (e) => e.meta), y = r(() => {
|
|
18
|
+
_();
|
|
19
|
+
}, [_]), b = r(() => {
|
|
20
|
+
e.getInstance().emit("onUndo");
|
|
21
|
+
}, []), x = r(() => {
|
|
22
|
+
e.getInstance().emit("onRedo");
|
|
23
|
+
}, []);
|
|
24
|
+
return /* @__PURE__ */ a(u, {
|
|
25
|
+
centerComponent: /* @__PURE__ */ a(s, { store: t }),
|
|
26
|
+
icon: /* @__PURE__ */ a(f, { sx: { fontSize: 24 } }),
|
|
27
|
+
rightComponent: /* @__PURE__ */ o(i, { children: [
|
|
28
|
+
/* @__PURE__ */ a(c, {}),
|
|
29
|
+
/* @__PURE__ */ a(g, {
|
|
30
|
+
title: "Undo last action",
|
|
31
|
+
children: /* @__PURE__ */ a(h, {
|
|
32
|
+
color: "inherit",
|
|
33
|
+
disabled: v?.undoDepth === 0,
|
|
34
|
+
onClick: b,
|
|
35
|
+
size: "small",
|
|
36
|
+
sx: { opacity: .85 },
|
|
37
|
+
children: /* @__PURE__ */ a(p, { fontSize: "small" })
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ a(g, {
|
|
41
|
+
title: "Redo last action",
|
|
42
|
+
children: /* @__PURE__ */ a(h, {
|
|
43
|
+
color: "inherit",
|
|
44
|
+
disabled: v?.redoDepth === 0,
|
|
45
|
+
onClick: x,
|
|
46
|
+
size: "small",
|
|
47
|
+
sx: { opacity: .85 },
|
|
48
|
+
children: /* @__PURE__ */ a(m, { fontSize: "small" })
|
|
49
|
+
})
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ a(l, { onReset: y }),
|
|
52
|
+
/* @__PURE__ */ a(d, {})
|
|
53
|
+
] }),
|
|
54
|
+
title: "Sequence Editor"
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { _ as SequenceEditorPageHeader };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.tsx"],"sourcesContent":["import { FastaPageHeaderCenterComponent } from '@rivm-loculus-tools/common-frontend/components/FastaPageHeaderCenterComponent';\nimport { FastaPageHeaderImportButton } from '@rivm-loculus-tools/common-frontend/components/FastaPageHeaderImportButton';\nimport { FastaPageHeaderResetButton } from '@rivm-loculus-tools/common-frontend/components/FastaPageHeaderResetButton';\nimport { PageCommonHeader } from '@rivm-loculus-tools/common-frontend/components/page';\nimport { PageHeaderDocumentationButton } from '@rivm-loculus-tools/common-frontend/components/PageHeaderDocumentationButton';\nimport { useCallback } from 'react';\nimport { useStore } from 'zustand';\nimport BiotechOutlinedIcon from '@mui/icons-material/BiotechOutlined';\nimport UndoIcon from '@mui/icons-material/Undo';\nimport RedoIcon from '@mui/icons-material/Redo';\nimport {\n IconButton,\n Tooltip,\n} from '@mui/material';\n\nimport { sequenceEditorStore } from '../../../stores/sequenceEditorStore';\nimport { SequenceEditorEventBusService } from '../../../classes/services/SequenceEditorEventBusService';\n\nexport const SequenceEditorPageHeader = () => {\n const resetDataset = useStore(sequenceEditorStore, (state) => state.resetDataset);\n const meta = useStore(sequenceEditorStore, (state) => state.meta);\n\n const onReset = useCallback(() => {\n resetDataset();\n }, [resetDataset]);\n\n const onUndoButtonClick = useCallback(() => {\n SequenceEditorEventBusService.getInstance().emit('onUndo');\n }, []);\n\n const onRedoButtonClick = useCallback(() => {\n SequenceEditorEventBusService.getInstance().emit('onRedo');\n }, []);\n\n return (\n <PageCommonHeader\n centerComponent={<FastaPageHeaderCenterComponent store={sequenceEditorStore} />}\n icon={<BiotechOutlinedIcon sx={{ fontSize: 24 }} />}\n rightComponent={(\n <>\n <FastaPageHeaderImportButton />\n <Tooltip title={'Undo last action'}>\n <IconButton\n color={'inherit'}\n disabled={meta?.undoDepth === 0}\n onClick={onUndoButtonClick}\n size={'small'}\n sx={{ opacity: 0.85 }}\n >\n <UndoIcon fontSize={'small'} />\n </IconButton>\n </Tooltip>\n <Tooltip title={'Redo last action'}>\n <IconButton\n color={'inherit'}\n disabled={meta?.redoDepth === 0}\n onClick={onRedoButtonClick}\n size={'small'}\n sx={{ opacity: 0.85 }}\n >\n <RedoIcon fontSize={'small'} />\n </IconButton>\n </Tooltip>\n <FastaPageHeaderResetButton onReset={onReset} />\n <PageHeaderDocumentationButton />\n </>\n )}\n title={'Sequence Editor'}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,IAAa,UAAiC;CAC5C,IAAM,IAAe,EAAS,IAAsB,MAAU,EAAM,YAAY,GAC1E,IAAO,EAAS,IAAsB,MAAU,EAAM,IAAI,GAE1D,IAAU,QAAkB;EAChC,EAAa;CACf,GAAG,CAAC,CAAY,CAAC,GAEX,IAAoB,QAAkB;EAC1C,EAA8B,YAAY,CAAC,CAAC,KAAK,QAAQ;CAC3D,GAAG,CAAC,CAAC,GAEC,IAAoB,QAAkB;EAC1C,EAA8B,YAAY,CAAC,CAAC,KAAK,QAAQ;CAC3D,GAAG,CAAC,CAAC;CAEL,OACE,kBAAC,GAAD;EACE,iBAAiB,kBAAC,GAAD,EAAgC,OAAO,EAAsB,CAAA;EAC9E,MAAM,kBAAC,GAAD,EAAqB,IAAI,EAAE,UAAU,GAAG,EAAI,CAAA;EAClD,gBACE,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD,CAA8B,CAAA;GAC9B,kBAAC,GAAD;IAAS,OAAO;IACd,UAAA,kBAAC,GAAD;KACE,OAAO;KACP,UAAU,GAAM,cAAc;KAC9B,SAAS;KACT,MAAM;KACN,IAAI,EAAE,SAAS,IAAK;KAEpB,UAAA,kBAAC,GAAD,EAAU,UAAU,QAAU,CAAA;IACpB,CAAA;GACL,CAAA;GACT,kBAAC,GAAD;IAAS,OAAO;IACd,UAAA,kBAAC,GAAD;KACE,OAAO;KACP,UAAU,GAAM,cAAc;KAC9B,SAAS;KACT,MAAM;KACN,IAAI,EAAE,SAAS,IAAK;KAEpB,UAAA,kBAAC,GAAD,EAAU,UAAU,QAAU,CAAA;IACpB,CAAA;GACL,CAAA;GACT,kBAAC,GAAD,EAAqC,WAAU,CAAA;GAC/C,kBAAC,GAAD,CAAgC,CAAA;EAChC,EAAA,CAAA;EAEJ,OAAO;CACR,CAAA;AAEL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SequenceEditorSearchBar: () => import('react').JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SequenceEditorEventBusService as e } from "../../../classes/services/SequenceEditorEventBusService/index.js";
|
|
2
|
+
import { t } from "../../../_chunks/sequenceEditorStore.js";
|
|
3
|
+
import { t as n } from "../../../_chunks/react.js";
|
|
4
|
+
import { useCallback as r } from "react";
|
|
5
|
+
import { SearchBar as i } from "@rivm-loculus-tools/common-frontend/components/SearchBar";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.tsx
|
|
8
|
+
var o = () => {
|
|
9
|
+
let o = n(t, (e) => e.setSearchQuery), s = n(t, (e) => e.setSearchResultHighlightedIndex), c = n(t, (e) => e.searchQuery), l = n(t, (e) => e.searchResult), u = n(t, (e) => e.searchResultHighlightedIndex), d = r((t) => {
|
|
10
|
+
o(t), e.getInstance().emit("onSearch", t);
|
|
11
|
+
}, [o]), f = r((e) => {
|
|
12
|
+
s(e);
|
|
13
|
+
}, [s]);
|
|
14
|
+
return /* @__PURE__ */ a(i, {
|
|
15
|
+
allowNavigation: !0,
|
|
16
|
+
highlightedIndex: u,
|
|
17
|
+
numResults: l?.num_matches,
|
|
18
|
+
onHighlightedIndexChange: f,
|
|
19
|
+
onSearchQueryChange: d,
|
|
20
|
+
searchQuery: c,
|
|
21
|
+
truncated: l?.truncated
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { o as SequenceEditorSearchBar };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.tsx"],"sourcesContent":["import { SearchBar } from '@rivm-loculus-tools/common-frontend/components/SearchBar';\nimport { useCallback } from 'react';\nimport { useStore } from 'zustand';\n\nimport { sequenceEditorStore } from '../../../stores/sequenceEditorStore';\nimport { SequenceEditorEventBusService } from '../../../classes/services/SequenceEditorEventBusService';\n\nexport const SequenceEditorSearchBar = () => {\n const setSearchQuery = useStore(sequenceEditorStore, (state) => state.setSearchQuery);\n const setSearchHighlightedIndex = useStore(sequenceEditorStore, (state) => state.setSearchResultHighlightedIndex);\n const searchQuery = useStore(sequenceEditorStore, (state) => state.searchQuery);\n const searchResults = useStore(sequenceEditorStore, (state) => state.searchResult);\n const searchHighlightedIndex = useStore(sequenceEditorStore, (state) => state.searchResultHighlightedIndex);\n\n const onSearchQueryChange = useCallback((query: string) => {\n setSearchQuery(query);\n SequenceEditorEventBusService.getInstance().emit('onSearch', query);\n }, [setSearchQuery]);\n\n const onHighlightedIndexChange = useCallback((index: number) => {\n setSearchHighlightedIndex(index);\n }, [setSearchHighlightedIndex]);\n\n return (\n <SearchBar\n allowNavigation\n highlightedIndex={searchHighlightedIndex}\n numResults={searchResults?.num_matches}\n onHighlightedIndexChange={onHighlightedIndexChange}\n onSearchQueryChange={onSearchQueryChange}\n searchQuery={searchQuery}\n truncated={searchResults?.truncated}\n />\n );\n};\n"],"mappings":";;;;;;;AAOA,IAAa,UAAgC;CAC3C,IAAM,IAAiB,EAAS,IAAsB,MAAU,EAAM,cAAc,GAC9E,IAA4B,EAAS,IAAsB,MAAU,EAAM,+BAA+B,GAC1G,IAAc,EAAS,IAAsB,MAAU,EAAM,WAAW,GACxE,IAAgB,EAAS,IAAsB,MAAU,EAAM,YAAY,GAC3E,IAAyB,EAAS,IAAsB,MAAU,EAAM,4BAA4B,GAEpG,IAAsB,GAAa,MAAkB;EAEzD,AADA,EAAe,CAAK,GACpB,EAA8B,YAAY,CAAC,CAAC,KAAK,YAAY,CAAK;CACpE,GAAG,CAAC,CAAc,CAAC,GAEb,IAA2B,GAAa,MAAkB;EAC9D,EAA0B,CAAK;CACjC,GAAG,CAAC,CAAyB,CAAC;CAE9B,OACE,kBAAC,GAAD;EACE,iBAAA;EACA,kBAAkB;EAClB,YAAY,GAAe;EACD;EACL;EACR;EACb,WAAW,GAAe;CAC3B,CAAA;AAEL"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/constants/editor.ts
|
|
2
|
+
var e = 120, t = {
|
|
3
|
+
cellHeight: 22,
|
|
4
|
+
cellWidth: 18,
|
|
5
|
+
dividerWidth: 4,
|
|
6
|
+
labelWidth: 300,
|
|
7
|
+
numOverscanCols: 128,
|
|
8
|
+
numOverscanRows: 16,
|
|
9
|
+
rulerHeight: 26
|
|
10
|
+
}, n = /* @__PURE__ */ new Set("ACGTURYKMSWBDHVN");
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as DEFAULT_GRID_GEOMETRY, n as IUPAC_KEYS, e as MIN_LABEL_WIDTH };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.js","names":[],"sources":["../../src/constants/editor.ts"],"sourcesContent":["import type { GridGeometry } from '../models';\n\nexport const MIN_LABEL_WIDTH = 120;\n\nexport const DEFAULT_GRID_GEOMETRY: GridGeometry = {\n cellHeight: 22,\n cellWidth: 18,\n dividerWidth: 4,\n labelWidth: 300,\n numOverscanCols: 128,\n numOverscanRows: 16,\n rulerHeight: 26,\n};\n\nexport const IUPAC_KEYS = new Set('ACGTURYKMSWBDHVN');\n"],"mappings":";AAEA,IAAa,IAAkB,KAElB,IAAsC;CACjD,YAAY;CACZ,WAAW;CACX,cAAc;CACd,YAAY;CACZ,iBAAiB;CACjB,iBAAiB;CACjB,aAAa;AACf,GAEa,oBAAa,IAAI,IAAI,kBAAkB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_GRID_GEOMETRY as e, IUPAC_KEYS as t, MIN_LABEL_WIDTH as n } from "./editor.js";
|
|
2
|
+
import { KEYBOARD_SHORTCUTS as r } from "./keyboard.js";
|
|
3
|
+
import { ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE as i, ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE_COLORS as a, ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE as o, ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS as s, ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE as c, ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS as l, ALI_VIEW_FAST_NUCLEOTIDE_PALETTE as u, ALI_VIEW_FAST_NUCLEOTIDE_PALETTE_COLORS as d, ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE as f, ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE_COLORS as p, ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE as m, ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE_COLORS as h, AMINO_ACID_SYMBOLS as g, NUCLEOTIDE_SYMBOLS as _ } from "./palette.js";
|
|
4
|
+
export { i as ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE, a as ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE_COLORS, o as ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE, s as ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS, c as ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE, l as ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS, u as ALI_VIEW_FAST_NUCLEOTIDE_PALETTE, d as ALI_VIEW_FAST_NUCLEOTIDE_PALETTE_COLORS, f as ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE, p as ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE_COLORS, m as ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE, h as ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE_COLORS, g as AMINO_ACID_SYMBOLS, e as DEFAULT_GRID_GEOMETRY, t as IUPAC_KEYS, r as KEYBOARD_SHORTCUTS, n as MIN_LABEL_WIDTH, _ as NUCLEOTIDE_SYMBOLS };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { KeyboardShortcutConfig } from '@gen-epix/ui-core/classes/services/KeyboardShortcutService';
|
|
2
|
+
type KeyboardShortcut = {
|
|
3
|
+
callback: KeyboardShortcutConfig['callback'];
|
|
4
|
+
description: string;
|
|
5
|
+
shortcut: Pick<KeyboardShortcutConfig, 'code' | 'key' | 'modifiers'>;
|
|
6
|
+
};
|
|
7
|
+
export declare const KEYBOARD_SHORTCUTS: {
|
|
8
|
+
[key: string]: KeyboardShortcut;
|
|
9
|
+
};
|
|
10
|
+
export {};
|