@rivm-loculus-tools/sequence-editor 1.9.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/_chunks/EngineErrorUtil.js.map +1 -1
  2. package/dist/_chunks/EngineWorker.js +1 -1
  3. package/dist/_chunks/EngineWorker.js.map +1 -1
  4. package/dist/_chunks/SequenceEditor.js +520 -488
  5. package/dist/_chunks/SequenceEditor.js.map +1 -1
  6. package/dist/_chunks/SequenceEditorEventBusService.js +5 -5
  7. package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
  8. package/dist/_chunks/SequenceEditorPageDrawer.js +462 -693
  9. package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
  10. package/dist/_chunks/react.js +1 -1
  11. package/dist/_chunks/react.js.map +1 -1
  12. package/dist/_chunks/sequenceEditorStore.js +84 -85
  13. package/dist/_chunks/sequenceEditorStore.js.map +1 -1
  14. package/dist/_chunks/sequence_editor.js +131 -104
  15. package/dist/_chunks/sequence_editor.js.map +1 -1
  16. package/dist/assets/AlignerWorker-DkAbHwjR.js +8 -0
  17. package/dist/assets/AlignerWorker-DkAbHwjR.js.map +1 -0
  18. package/dist/assets/index-CKWZNkQe.js +8 -0
  19. package/dist/assets/index-CKWZNkQe.js.map +1 -0
  20. package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +18 -19
  21. package/dist/classes/services/EditorWorkerService/index.js +76 -99
  22. package/dist/classes/services/EditorWorkerService/index.js.map +1 -1
  23. package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +2 -0
  24. package/dist/classes/workers/AlignerWorker/index.js.map +1 -1
  25. package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +19 -17
  26. package/dist/classes/workers/EngineWorker/index.js +78 -30
  27. package/dist/classes/workers/EngineWorker/index.js.map +1 -1
  28. package/dist/components/app/SequenceEditorApp/index.js +10 -10
  29. package/dist/components/app/SequenceEditorApp/index.js.map +1 -1
  30. package/dist/components/ui/SequenceActionsBar/SequenceActionsBar.d.ts +1 -0
  31. package/dist/components/ui/SequenceActionsBar/index.d.ts +1 -0
  32. package/dist/components/ui/SequenceActionsBar/index.js +113 -0
  33. package/dist/components/ui/SequenceActionsBar/index.js.map +1 -0
  34. package/dist/components/ui/SequenceEditorMenu/SequenceEditorMenu.d.ts +1 -0
  35. package/dist/components/ui/SequenceEditorMenu/index.d.ts +1 -0
  36. package/dist/components/ui/SequenceEditorMenu/index.js +198 -0
  37. package/dist/components/ui/SequenceEditorMenu/index.js.map +1 -0
  38. package/dist/components/ui/SequenceEditorPageHeader/index.js +86 -1
  39. package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -0
  40. package/dist/components/ui/SequenceEditorRealignModal/index.js +13 -13
  41. package/dist/components/ui/SequenceEditorRealignModal/index.js.map +1 -1
  42. package/dist/components/ui/SequenceEditorSearchBar/index.js +25 -21
  43. package/dist/components/ui/SequenceEditorSearchBar/index.js.map +1 -1
  44. package/dist/constants/keyboard.js +26 -26
  45. package/dist/constants/keyboard.js.map +1 -1
  46. package/dist/constants/palette.js +147 -147
  47. package/dist/constants/palette.js.map +1 -1
  48. package/dist/models/config.models.d.ts +1 -0
  49. package/dist/models/editor.models.d.ts +34 -26
  50. package/dist/models/editor.models.js +3 -1
  51. package/dist/models/editor.models.js.map +1 -1
  52. package/dist/models/palette.models.js.map +1 -1
  53. package/dist/pages/SequenceEditorMainPage/index.js +20 -20
  54. package/dist/pages/SequenceEditorMainPage/index.js.map +1 -1
  55. package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +4 -2
  56. package/dist/theme/demoTheme/index.js +5 -5
  57. package/dist/theme/demoTheme/index.js.map +1 -1
  58. package/dist/utils/EditorUtil/EditorUtil.d.ts +10 -3
  59. package/dist/utils/EditorUtil/index.js +360 -275
  60. package/dist/utils/EditorUtil/index.js.map +1 -1
  61. package/dist/utils/PaletteUtil/index.js.map +1 -1
  62. package/dist/utils/SequenceEditorStandardConfigUtil/index.js +6 -6
  63. package/dist/utils/SequenceEditorStandardConfigUtil/index.js.map +1 -1
  64. package/dist/vite/paletteSchemaPlugin/index.js.map +1 -1
  65. package/package.json +22 -22
  66. package/dist/_chunks/SequenceEditorPageHeader.js +0 -123
  67. package/dist/_chunks/SequenceEditorPageHeader.js.map +0 -1
  68. package/dist/assets/AlignerWorker-cbSDVRKB.js +0 -8
  69. package/dist/assets/AlignerWorker-cbSDVRKB.js.map +0 -1
  70. package/dist/assets/index--BqOy4u7.js +0 -8
  71. package/dist/assets/index--BqOy4u7.js.map +0 -1
  72. package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.d.ts +0 -1
@@ -16,6 +16,12 @@ export declare enum MATRIX_TYPE {
16
16
  NUCLEOTIDE = "nucleotide",
17
17
  RECORD_NAME = "record_name"
18
18
  }
19
+ export declare enum READING_MODE {
20
+ AMINO_ACIDS = "AMINO_ACIDS",
21
+ AMINO_ACIDS_CONDENSED = "AMINO_ACIDS_CONDENSED",
22
+ NUCLEOTIDE = "NUCLEOTIDE",
23
+ NUCLEOTIDE_PLUS_AMINO_ACIDS = "NUCLEOTIDE_PLUS_AMINO_ACIDS"
24
+ }
19
25
  /**
20
26
  * Contract implemented by the `EngineWorker` class and exposed to the main
21
27
  * thread through comlink. Every method is asynchronous so comlink can proxy it
@@ -69,6 +75,7 @@ export type EditorSelection = {
69
75
  export type EngineMeta = {
70
76
  alignmentWidth: number;
71
77
  redoDepth: number;
78
+ revision: number;
72
79
  sequenceCount: number;
73
80
  undoDepth: number;
74
81
  };
@@ -113,6 +120,8 @@ export type EngineTiming = {
113
120
  };
114
121
  /** A fetched viewport or translation slice plus the metadata to interpret it. */
115
122
  export type EngineViewportResult = {
123
+ /** Full row-major overlay, indexed independently of the visible viewport. */
124
+ aminoAcidCodonOverlay?: Uint8Array;
116
125
  /** Row-major bytes, transferred from the worker via comlink. */
117
126
  bytes: Uint8Array;
118
127
  /** Number of columns per row (may be less than requested if clamped). */
@@ -125,43 +134,33 @@ export type EngineViewportResult = {
125
134
  startRow: number;
126
135
  };
127
136
  export interface EngineWorkerApi {
128
- applyAlignedFasta: (fasta: string) => Promise<void>;
129
- delete: (rows: number[], column: number) => Promise<void>;
130
- deleteColumn: (column: number) => Promise<void>;
131
- deleteRows: (rows: number[]) => Promise<void>;
137
+ applyAlignedFasta: (fasta: string, expectedRevision?: number) => Promise<boolean>;
138
+ delete: (rows: number[], column: number) => Promise<boolean>;
139
+ deleteColumn: (column: number) => Promise<boolean>;
140
+ deleteRows: (rows: number[]) => Promise<boolean>;
132
141
  exportGappedFasta: () => Promise<string>;
133
142
  exportUngappedFasta: () => Promise<string>;
134
143
  /** Idempotently initializes the WASM engine; resolves once it is ready. */
135
144
  initialize: () => Promise<void>;
136
- insert: (rows: number[], column: number) => Promise<void>;
137
- load: (fastaContent: string) => Promise<number>;
145
+ insert: (rows: number[], column: number) => Promise<boolean>;
146
+ load: (fastaContent: string) => Promise<boolean>;
138
147
  meta: () => Promise<EngineMeta>;
139
- moveHorizontal: (rows: number[], columns: number[], direction: MoveDirection) => Promise<void>;
140
- moveRows: (rows: number[], options: MoveRowsOptions) => Promise<void>;
141
- moveRowsDown: (rows: number[]) => Promise<void>;
142
- moveRowsGrouped: (rows: number[], targetRow: number) => Promise<void>;
143
- moveRowsRelative: (rows: number[], delta: number) => Promise<void>;
144
- moveRowsToBottom: (rows: number[]) => Promise<void>;
145
- moveRowsToTop: (rows: number[]) => Promise<void>;
146
- moveRowsUp: (rows: number[]) => Promise<void>;
147
- mutate: (rows: number[], columns: number[], base: string) => Promise<void>;
148
+ moveHorizontal: (rows: number[], columns: number[], direction: MoveDirection) => Promise<boolean>;
149
+ moveRows: (rows: number[], options: MoveRowsOptions) => Promise<boolean>;
150
+ moveRowsDown: (rows: number[]) => Promise<boolean>;
151
+ moveRowsGrouped: (rows: number[], targetRow: number) => Promise<boolean>;
152
+ moveRowsRelative: (rows: number[], delta: number) => Promise<boolean>;
153
+ moveRowsToBottom: (rows: number[]) => Promise<boolean>;
154
+ moveRowsToTop: (rows: number[]) => Promise<boolean>;
155
+ moveRowsUp: (rows: number[]) => Promise<boolean>;
156
+ mutate: (rows: number[], columns: number[], base: string) => Promise<boolean>;
148
157
  name: (row: number) => Promise<string>;
149
158
  redo: () => Promise<boolean>;
150
159
  reset: () => Promise<void>;
151
160
  search: (query: string, checkRecordNames: boolean) => Promise<EngineSearchResult>;
152
- translate: (bounds: ViewportBounds, readingFrame: number) => Promise<EngineViewportResult>;
153
161
  undo: () => Promise<boolean>;
154
- viewport: (bounds: ViewportBounds) => Promise<EngineViewportResult>;
162
+ viewport: (bounds: ViewportBounds, overlayReadingFrame?: number) => Promise<EngineViewportResult>;
155
163
  }
156
- export type GridGeometry = {
157
- cellHeight: number;
158
- cellWidth: number;
159
- dividerWidth: number;
160
- labelWidth: number;
161
- numOverscanCols: number;
162
- numOverscanRows: number;
163
- rulerHeight: number;
164
- };
165
164
  /**
166
165
  * Wire protocol between the main thread and the MSA Web Worker.
167
166
  *
@@ -180,6 +179,15 @@ export type GridGeometry = {
180
179
  * - **No JSON for hot paths.** Only small plain objects are structured-cloned;
181
180
  * binary data is always transferred via the shared SAB.
182
181
  */
182
+ export type GridGeometry = {
183
+ cellHeight: number;
184
+ cellWidth: number;
185
+ dividerWidth: number;
186
+ labelWidth: number;
187
+ numOverscanCols: number;
188
+ numOverscanRows: number;
189
+ rulerHeight: number;
190
+ };
183
191
  export type GridPoint = {
184
192
  col: number;
185
193
  row: number;
@@ -5,7 +5,9 @@ var e = /* @__PURE__ */ function(e) {
5
5
  return e.CELL = "CELL", e.DIVIDER = "DIVIDER", e.LABEL = "LABEL", e.RULER = "RULER", e;
6
6
  }({}), n = /* @__PURE__ */ function(e) {
7
7
  return e.AMINO_ACID = "amino_acid", e.NUCLEOTIDE = "nucleotide", e.RECORD_NAME = "record_name", e;
8
+ }({}), r = /* @__PURE__ */ function(e) {
9
+ return e.AMINO_ACIDS = "AMINO_ACIDS", e.AMINO_ACIDS_CONDENSED = "AMINO_ACIDS_CONDENSED", e.NUCLEOTIDE = "NUCLEOTIDE", e.NUCLEOTIDE_PLUS_AMINO_ACIDS = "NUCLEOTIDE_PLUS_AMINO_ACIDS", e;
8
10
  }({});
9
- export { e as EDITOR_DIRECTION, t as EDITOR_PATH_PROPERTIES_TYPE, n as MATRIX_TYPE };
11
+ export { e as EDITOR_DIRECTION, t as EDITOR_PATH_PROPERTIES_TYPE, n as MATRIX_TYPE, r as READING_MODE };
10
12
 
11
13
  //# sourceMappingURL=editor.models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor.models.js","names":["EDITOR_DIRECTION","\"DOWN\"","\"LEFT\"","\"RIGHT\"","\"UP\"","EDITOR_PATH_PROPERTIES_TYPE","\"CELL\"","\"DIVIDER\"","\"LABEL\"","\"RULER\"","MATRIX_TYPE","\"AMINO_ACID\"","\"NUCLEOTIDE\"","\"RECORD_NAME\""],"sources":["../../src/models/editor.models.ts"],"sourcesContent":["import type { MoveDirection } from '@rivm-loculus-tools/sequence-editor-wasm';\n\nexport enum EDITOR_DIRECTION {\n DOWN = 'DOWN',\n LEFT = 'LEFT',\n RIGHT = 'RIGHT',\n UP = 'UP',\n}\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\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 AlignerWorkerApi {\n align: (fastaContent: string) => Promise<string>;\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\nexport interface EngineWorkerApi {\n applyAlignedFasta: (fasta: string) => Promise<void>;\n delete: (rows: number[], column: number) => Promise<void>;\n deleteColumn: (column: number) => Promise<void>;\n deleteRows: (rows: number[]) => Promise<void>;\n exportGappedFasta: () => Promise<string>;\n exportUngappedFasta: () => 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: (rows: number[], columns: number[], direction: MoveDirection) => Promise<void>;\n moveRows: (rows: number[], options: MoveRowsOptions) => Promise<void>;\n moveRowsDown: (rows: number[]) => Promise<void>;\n moveRowsGrouped: (rows: number[], targetRow: number) => Promise<void>;\n moveRowsRelative: (rows: number[], delta: number) => Promise<void>;\n moveRowsToBottom: (rows: number[]) => Promise<void>;\n moveRowsToTop: (rows: number[]) => Promise<void>;\n moveRowsUp: (rows: number[]) => Promise<void>;\n mutate: (rows: number[], columns: number[], base: string) => Promise<void>;\n name: (row: number) => Promise<string>;\n redo: () => Promise<boolean>;\n reset: () => Promise<void>;\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\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\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 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\nexport type MoveRowsOptions =\n | { delta: number; mode: 'relative' }\n | { mode: 'bottom' }\n | { mode: 'grouped'; targetRow: number }\n | { mode: 'top' };\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,IAAYA,IAAL,yBAAA,GAAA;C,OACL,EAAAC,OAAA,QACA,EAAAC,OAAA,QACA,EAAAC,QAAA,SACA,EAAAC,KAAA,M;AACF,EAAA,CAAA,CAAA,GAEYC,IAAL,yBAAA,GAAA;C,OACL,EAAAC,OAAA,QACA,EAAAC,UAAA,WACA,EAAAC,QAAA,SACA,EAAAC,QAAA,S;AACF,EAAA,CAAA,CAAA,GAGYC,IAAL,yBAAA,GAAA;C,OACL,EAAAC,aAAA,cACA,EAAAC,aAAA,cACA,EAAAC,cAAA,e;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"editor.models.js","names":["EDITOR_DIRECTION","\"DOWN\"","\"LEFT\"","\"RIGHT\"","\"UP\"","EDITOR_PATH_PROPERTIES_TYPE","\"CELL\"","\"DIVIDER\"","\"LABEL\"","\"RULER\"","MATRIX_TYPE","\"AMINO_ACID\"","\"NUCLEOTIDE\"","\"RECORD_NAME\"","READING_MODE","\"AMINO_ACIDS\"","\"AMINO_ACIDS_CONDENSED\"","\"NUCLEOTIDE_PLUS_AMINO_ACIDS\""],"sources":["../../src/models/editor.models.ts"],"sourcesContent":["import type { MoveDirection } from '@rivm-loculus-tools/sequence-editor-wasm';\n\nexport enum EDITOR_DIRECTION {\n DOWN = 'DOWN',\n LEFT = 'LEFT',\n RIGHT = 'RIGHT',\n UP = 'UP',\n}\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 enum READING_MODE {\n AMINO_ACIDS = 'AMINO_ACIDS',\n AMINO_ACIDS_CONDENSED = 'AMINO_ACIDS_CONDENSED',\n NUCLEOTIDE = 'NUCLEOTIDE',\n NUCLEOTIDE_PLUS_AMINO_ACIDS = 'NUCLEOTIDE_PLUS_AMINO_ACIDS',\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 AlignerWorkerApi {\n align: (fastaContent: string) => Promise<string>;\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 revision: 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 /** Full row-major overlay, indexed independently of the visible viewport. */\n aminoAcidCodonOverlay?: Uint8Array;\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\nexport interface EngineWorkerApi {\n applyAlignedFasta: (fasta: string, expectedRevision?: number) => Promise<boolean>;\n delete: (rows: number[], column: number) => Promise<boolean>;\n deleteColumn: (column: number) => Promise<boolean>;\n deleteRows: (rows: number[]) => Promise<boolean>;\n exportGappedFasta: () => Promise<string>;\n exportUngappedFasta: () => Promise<string>;\n /** Idempotently initializes the WASM engine; resolves once it is ready. */\n initialize: () => Promise<void>;\n insert: (rows: number[], column: number) => Promise<boolean>;\n load: (fastaContent: string) => Promise<boolean>;\n meta: () => Promise<EngineMeta>;\n moveHorizontal: (rows: number[], columns: number[], direction: MoveDirection) => Promise<boolean>;\n moveRows: (rows: number[], options: MoveRowsOptions) => Promise<boolean>;\n moveRowsDown: (rows: number[]) => Promise<boolean>;\n moveRowsGrouped: (rows: number[], targetRow: number) => Promise<boolean>;\n moveRowsRelative: (rows: number[], delta: number) => Promise<boolean>;\n moveRowsToBottom: (rows: number[]) => Promise<boolean>;\n moveRowsToTop: (rows: number[]) => Promise<boolean>;\n moveRowsUp: (rows: number[]) => Promise<boolean>;\n mutate: (rows: number[], columns: number[], base: string) => Promise<boolean>;\n name: (row: number) => Promise<string>;\n redo: () => Promise<boolean>;\n reset: () => Promise<void>;\n search: (query: string, checkRecordNames: boolean) => Promise<EngineSearchResult>;\n undo: () => Promise<boolean>;\n viewport: (bounds: ViewportBounds, overlayReadingFrame?: number) => 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\nexport type MoveRowsOptions =\n | { delta: number; mode: 'relative' }\n | { mode: 'bottom' }\n | { mode: 'grouped'; targetRow: number }\n | { mode: 'top' };\n\n// ---------------------------------------------------------------------------\n// Worker → Main responses\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\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,IAAYA,IAAL,yBAAAA,GAAA;C,OACLA,EAAAC,OAAA,QACAD,EAAAE,OAAA,QACAF,EAAAG,QAAA,SACAH,EAAAI,KAAA,M;AACF,EAAA,CAAA,CAAA,GAEYC,IAAL,yBAAAA,GAAA;C,OACLA,EAAAC,OAAA,QACAD,EAAAE,UAAA,WACAF,EAAAG,QAAA,SACAH,EAAAI,QAAA,S;AACF,EAAA,CAAA,CAAA,GAGYC,IAAL,yBAAAA,GAAA;C,OACLA,EAAAC,aAAA,cACAD,EAAAE,aAAA,cACAF,EAAAG,cAAA,e;AACF,EAAA,CAAA,CAAA,GAEYC,IAAL,yBAAAA,GAAA;C,OACLA,EAAAC,cAAA,eACAD,EAAAE,wBAAA,yBACAF,EAAAF,aAAA,cACAE,EAAAG,8BAAA,+B;AACF,EAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"palette.models.js","names":["AminoAcidSymbol","\"A\"","\"C\"","\"D\"","\"E\"","\"F\"","\"G\"","\"GAP\"","\"H\"","\"I\"","\"K\"","\"L\"","\"M\"","\"N\"","\"P\"","\"Q\"","\"R\"","\"S\"","\"STOP\"","\"T\"","\"V\"","\"W\"","\"X\"","\"Y\"","NucleotideSymbol","\"B\"","\"U\"","\"UNKNOWN\"","CUSTOM_PALETTE_NAME"],"sources":["../../src/models/palette.models.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 const CUSTOM_PALETTE_NAME = 'Custom';\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,IAAYA,IAAL,yBAAA,GAAA;C,OACL,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,MAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,OAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,KACA,EAAAC,IAAA,K;AACF,EAAA,CAAA,CAAA,GAGYC,IAAL,yBAAA,GAAA;C,OACL,EAAAvB,IAAA,KACA,EAAAwB,IAAA,KACA,EAAAvB,IAAA,KACA,EAAAC,IAAA,KACA,EAAAG,IAAA,KACA,EAAAC,MAAA,KACA,EAAAC,IAAA,KACA,EAAAE,IAAA,KACA,EAAAE,IAAA,KACA,EAAAC,IAAA,KACA,EAAAG,IAAA,KACA,EAAAC,IAAA,KACA,EAAAE,IAAA,KACA,EAAAO,IAAA,KACA,EAAAC,UAAA,KACA,EAAAP,IAAA,KACA,EAAAC,IAAA,KACA,EAAAE,IAAA,K;AACF,EAAA,CAAA,CAAA,GAEaK,IAAsB"}
1
+ {"version":3,"file":"palette.models.js","names":["AminoAcidSymbol","\"A\"","\"C\"","\"D\"","\"E\"","\"F\"","\"G\"","\"GAP\"","\"H\"","\"I\"","\"K\"","\"L\"","\"M\"","\"N\"","\"P\"","\"Q\"","\"R\"","\"S\"","\"STOP\"","\"T\"","\"V\"","\"W\"","\"X\"","\"Y\"","NucleotideSymbol","\"B\"","\"U\"","\"UNKNOWN\"","CUSTOM_PALETTE_NAME"],"sources":["../../src/models/palette.models.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 const CUSTOM_PALETTE_NAME = 'Custom';\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,IAAYA,IAAL,yBAAAA,GAAA;C,OACLA,EAAAC,IAAA,KACAD,EAAAE,IAAA,KACAF,EAAAG,IAAA,KACAH,EAAAI,IAAA,KACAJ,EAAAK,IAAA,KACAL,EAAAM,IAAA,KACAN,EAAAO,MAAA,KACAP,EAAAQ,IAAA,KACAR,EAAAS,IAAA,KACAT,EAAAU,IAAA,KACAV,EAAAW,IAAA,KACAX,EAAAY,IAAA,KACAZ,EAAAa,IAAA,KACAb,EAAAc,IAAA,KACAd,EAAAe,IAAA,KACAf,EAAAgB,IAAA,KACAhB,EAAAiB,IAAA,KACAjB,EAAAkB,OAAA,KACAlB,EAAAmB,IAAA,KACAnB,EAAAoB,IAAA,KACApB,EAAAqB,IAAA,KACArB,EAAAsB,IAAA,KACAtB,EAAAuB,IAAA,K;AACF,EAAA,CAAA,CAAA,GAGYC,IAAL,yBAAAA,GAAA;C,OACLA,EAAAvB,IAAA,KACAuB,EAAAC,IAAA,KACAD,EAAAtB,IAAA,KACAsB,EAAArB,IAAA,KACAqB,EAAAlB,IAAA,KACAkB,EAAAjB,MAAA,KACAiB,EAAAhB,IAAA,KACAgB,EAAAd,IAAA,KACAc,EAAAZ,IAAA,KACAY,EAAAX,IAAA,KACAW,EAAAR,IAAA,KACAQ,EAAAP,IAAA,KACAO,EAAAL,IAAA,KACAK,EAAAE,IAAA,KACAF,EAAAG,UAAA,KACAH,EAAAJ,IAAA,KACAI,EAAAH,IAAA,KACAG,EAAAD,IAAA,K;AACF,EAAA,CAAA,CAAA,GAEaK,IAAsB"}
@@ -1,38 +1,38 @@
1
- import { t as e } from "../../_chunks/sequenceEditorStore.js";
2
- import { t } from "../../_chunks/react.js";
3
- import { t as n } from "../../_chunks/SequenceEditor.js";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import { FastaDataImportDialogLoader as a } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaDataImportDialogLoader";
6
- import { BackdropSpinner as o } from "@gen-epix/ui-core-components/components/BackdropSpinner";
7
- import { FastaNotLoaded as s } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaNotLoaded";
8
- import c from "@mui/icons-material/BiotechOutlined";
9
- import { LOADING_STATUS as l } from "@rivm-loculus-tools/common-frontend/models/fasta.models";
10
- import { PageCommon as u } from "@rivm-loculus-tools/common-frontend/components/ui/PageCommon";
11
- import { useConfig as d } from "@rivm-loculus-tools/common-frontend/hooks/useConfig";
1
+ import { t as e } from "../../_chunks/react.js";
2
+ import { FastaDataImportDialogLoader as t } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaDataImportDialogLoader";
3
+ import { BackdropSpinner as n } from "@gen-epix/ui-core-components/components/BackdropSpinner";
4
+ import { FastaNotLoaded as r } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaNotLoaded";
5
+ import i from "@mui/icons-material/BiotechOutlined";
6
+ import { LOADING_STATUS as a } from "@rivm-loculus-tools/common-frontend/models/fasta.models";
7
+ import { PageCommon as o } from "@rivm-loculus-tools/common-frontend/components/ui/PageCommon";
8
+ import { useConfig as s } from "@rivm-loculus-tools/common-frontend/hooks/useConfig";
9
+ import { t as c } from "../../_chunks/sequenceEditorStore.js";
10
+ import { t as l } from "../../_chunks/SequenceEditor.js";
11
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
12
12
  // src/pages/SequenceEditorMainPage/SequenceEditorMainPage.tsx
13
13
  var f = () => {
14
- let f = d(), p = t(e, (e) => e.loadingStatus), m = t(e, (e) => e.rawFasta);
15
- return /* @__PURE__ */ i(u, {
14
+ let f = s(), p = e(c, (e) => e.loadingStatus), m = e(c, (e) => e.rawFasta);
15
+ return /* @__PURE__ */ d(o, {
16
16
  isNoInteraction: !1,
17
17
  title: "Sequence Editor",
18
18
  children: [
19
- m && /* @__PURE__ */ r(n, {}),
20
- !m && /* @__PURE__ */ r(s, {
19
+ m && /* @__PURE__ */ u(l, {}),
20
+ !m && /* @__PURE__ */ u(r, {
21
21
  description: "Load a FASTA sequence file to enable the editor.",
22
- icon: /* @__PURE__ */ r(c, { sx: {
22
+ icon: /* @__PURE__ */ u(i, { sx: {
23
23
  color: "text.disabled",
24
24
  fontSize: 72
25
25
  } }),
26
26
  title: "No FASTA Sequence Loaded"
27
27
  }),
28
- /* @__PURE__ */ r(a, {
28
+ /* @__PURE__ */ u(t, {
29
29
  extraActions: f?.fastaImportExtraActions,
30
30
  fastaDescription: "Nucleotide or amino-acid sequence data.",
31
- store: e
31
+ store: c
32
32
  }),
33
- /* @__PURE__ */ r(o, {
33
+ /* @__PURE__ */ u(n, {
34
34
  label: "Computing phylogenetic tree",
35
- open: p === l.LOADING
35
+ open: p === a.LOADING
36
36
  })
37
37
  ]
38
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["sequenceEditorStore","SequenceEditor","BiotechOutlinedIcon","SequenceEditorMainPage","config","useConfig","loadingStatus","useStore","state","rawFasta","PageCommon","FastaNotLoaded","FastaDataImportDialogLoader","BackdropSpinner","LOADING_STATUS"],"sources":["../../../src/pages/SequenceEditorMainPage/SequenceEditorMainPage.tsx"],"sourcesContent":["import { useStore } from 'zustand';\nimport { FastaDataImportDialogLoader } from '@rivm-loculus-tools/common-frontend/components/fasta/FastaDataImportDialogLoader';\nimport { BackdropSpinner } from '@gen-epix/ui-core-components/components/BackdropSpinner';\nimport { FastaNotLoaded } from '@rivm-loculus-tools/common-frontend/components/fasta/FastaNotLoaded';\nimport BiotechOutlinedIcon from '@mui/icons-material/BiotechOutlined';\nimport { LOADING_STATUS } from '@rivm-loculus-tools/common-frontend/models/fasta.models';\nimport { PageCommon } from '@rivm-loculus-tools/common-frontend/components/ui/PageCommon';\nimport { useConfig } from '@rivm-loculus-tools/common-frontend/hooks/useConfig';\n\nimport { sequenceEditorStore } from '../../stores/sequenceEditorStore';\nimport { SequenceEditor } from '../../components/ui/SequenceEditor';\nimport type { SequenceEditorConfig } from '../../models/config.models';\n\n\nexport const SequenceEditorMainPage = () => {\n const config = useConfig<SequenceEditorConfig>();\n const loadingStatus = useStore(sequenceEditorStore, (state) => state.loadingStatus);\n const rawFasta = useStore(sequenceEditorStore, (state) => state.rawFasta);\n\n return (\n <PageCommon\n isNoInteraction={false}\n title={'Sequence Editor'}\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={config?.fastaImportExtraActions}\n fastaDescription={'Nucleotide or amino-acid sequence data.'}\n store={sequenceEditorStore}\n />\n <BackdropSpinner\n label={`Computing phylogenetic tree`}\n open={loadingStatus === LOADING_STATUS.LOADING}\n />\n </PageCommon>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAcA,IAAaG,UAA+B;CAC1C,IAAMC,IAASC,EAAgC,GACzCC,IAAgBC,EAASP,IAAsB,MAAUQ,EAAM,aAAa,GAC5EC,IAAWF,EAASP,IAAsB,MAAUQ,EAAM,QAAQ;CAExE,OACE,kBAACE,GAAD;EACE,iBAAiB;EACjB,OAAO;EAFT,UAAA;GAIGD,KACC,kBAACR,GAAD,CAAiB,CAAA;GAElB,CAACQ,KACA,kBAACE,GAAD;IACE,aAAa;IACb,MAAM,kBAACT,GAAD,EAAqB,IAAI;KAAE,OAAO;KAAiB,UAAU;IAAG,EAAI,CAAA;IAC1E,OAAO;GACR,CAAA;GAEH,kBAACU,GAAD;IACE,cAAcR,GAAQ;IACtB,kBAAkB;IAClB,OAAOJ;GACR,CAAA;GACD,kBAACa,GAAD;IACE,OAAO;IACP,MAAMP,MAAkBQ,EAAe;GACxC,CAAA;EACS;;AAEhB"}
1
+ {"version":3,"file":"index.js","names":["_jsxs","_jsx","useStore","FastaDataImportDialogLoader","BackdropSpinner","FastaNotLoaded","BiotechOutlinedIcon","LOADING_STATUS","PageCommon","useConfig","sequenceEditorStore","SequenceEditor","jsx","jsxs","SequenceEditorMainPage","config","loadingStatus","state","rawFasta"],"sources":["../../../src/pages/SequenceEditorMainPage/SequenceEditorMainPage.tsx"],"sourcesContent":["import { useStore } from 'zustand';\nimport { FastaDataImportDialogLoader } from '@rivm-loculus-tools/common-frontend/components/fasta/FastaDataImportDialogLoader';\nimport { BackdropSpinner } from '@gen-epix/ui-core-components/components/BackdropSpinner';\nimport { FastaNotLoaded } from '@rivm-loculus-tools/common-frontend/components/fasta/FastaNotLoaded';\nimport BiotechOutlinedIcon from '@mui/icons-material/BiotechOutlined';\nimport { LOADING_STATUS } from '@rivm-loculus-tools/common-frontend/models/fasta.models';\nimport { PageCommon } from '@rivm-loculus-tools/common-frontend/components/ui/PageCommon';\nimport { useConfig } from '@rivm-loculus-tools/common-frontend/hooks/useConfig';\n\nimport { sequenceEditorStore } from '../../stores/sequenceEditorStore';\nimport { SequenceEditor } from '../../components/ui/SequenceEditor';\nimport type { SequenceEditorConfig } from '../../models/config.models';\n\n\nexport const SequenceEditorMainPage = () => {\n const config = useConfig<SequenceEditorConfig>();\n const loadingStatus = useStore(sequenceEditorStore, (state) => state.loadingStatus);\n const rawFasta = useStore(sequenceEditorStore, (state) => state.rawFasta);\n\n return (\n <PageCommon\n isNoInteraction={false}\n title={'Sequence Editor'}\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={config?.fastaImportExtraActions}\n fastaDescription={'Nucleotide or amino-acid sequence data.'}\n store={sequenceEditorStore}\n />\n <BackdropSpinner\n label={`Computing phylogenetic tree`}\n open={loadingStatus === LOADING_STATUS.LOADING}\n />\n </PageCommon>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAcA,IAAac,UAA+B;CAC1C,IAAMC,IAASN,EAAgC,GACzCO,IAAgBd,EAASQ,IAAsBO,MAAUA,EAAM,aAAa,GAC5EC,IAAWhB,EAASQ,IAAsBO,MAAUA,EAAM,QAAQ;CAExE,OACEjB,kBAACQ,GAAD;EACE,iBAAiB;EACjB,OAAO;EAFT,UAAA;GAIGU,KACCjB,kBAACU,GAAD,CAAiB,CAAA;GAElB,CAACO,KACAjB,kBAACI,GAAD;IACE,aAAa;IACb,MAAMJ,kBAACK,GAAD,EAAqB,IAAI;KAAE,OAAO;KAAiB,UAAU;IAAG,EAAI,CAAA;IAC1E,OAAO;GACR,CAAA;GAEHL,kBAACE,GAAD;IACE,cAAcY,GAAQ;IACtB,kBAAkB;IAClB,OAAOL;GACR,CAAA;GACDT,kBAACG,GAAD;IACE,OAAO;IACP,MAAMY,MAAkBT,EAAe;GACxC,CAAA;EACS;;AAEhB"}
@@ -1,5 +1,5 @@
1
1
  import { FastaDataStoreActions, FastaDataStoreState } from '@rivm-loculus-tools/common-frontend/stores/fastaDataStore';
2
- import { EditorSelection, EngineMeta, EngineSearchResult } from '../../models/editor.models';
2
+ import { READING_MODE, EditorSelection, EngineMeta, EngineSearchResult } from '../../models/editor.models';
3
3
  import { AminoAcidPalette, NucleotidePalette } from '../../models/palette.models';
4
4
  export type SequenceEditorStore = SequenceEditorStoreActions & SequenceEditorStoreState;
5
5
  export interface SequenceEditorStoreActions extends FastaDataStoreActions {
@@ -23,6 +23,8 @@ export interface SequenceEditorStoreState extends FastaDataStoreState {
23
23
  isRealigning: boolean;
24
24
  latestMessage: null | string;
25
25
  nucleotidePalette: NucleotidePalette;
26
+ readingFrame: 1 | 2 | 3;
27
+ readingMode: READING_MODE;
26
28
  searchQuery: string;
27
29
  searchResult: EngineSearchResult | null;
28
30
  searchResultHighlightedIndex: null | number;
@@ -34,7 +36,7 @@ export declare const sequenceEditorStore: Omit<import('zustand').StoreApi<Sequen
34
36
  persist: {
35
37
  setOptions: (options: Partial<import('zustand/middleware').PersistOptions<SequenceEditorStore, unknown, unknown>>) => void;
36
38
  clearStorage: () => void;
37
- rehydrate: () => Promise<void> | void;
39
+ rehydrate: () => Promise<void>;
38
40
  hasHydrated: () => boolean;
39
41
  onHydrate: (fn: (state: SequenceEditorStore) => void) => () => void;
40
42
  onFinishHydration: (fn: (state: SequenceEditorStore) => void) => () => void;
@@ -1,13 +1,13 @@
1
- import { createTheme as e } from "@mui/material";
2
- import { createDemoThemeOptions as t } from "@rivm-loculus-tools/common-frontend/theme/demoTheme";
1
+ import { createDemoThemeOptions as e } from "@rivm-loculus-tools/common-frontend/theme/demoTheme";
2
+ import { createTheme as t } from "@mui/material";
3
3
  // src/theme/demoTheme/demoTheme.ts
4
- var n = (e) => {
5
- let n = t(e);
4
+ var n = (t) => {
5
+ let n = e(t);
6
6
  return {
7
7
  ...n,
8
8
  components: { ...n.components }
9
9
  };
10
- }, r = (t) => e(n(t));
10
+ }, r = (e) => t(n(e));
11
11
  export { r as createSequenceEditorTheme, n as createSequenceEditorThemeOptions };
12
12
 
13
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["muiCreateTheme","createSequenceEditorThemeOptions","commonThemeOptions","createDemoThemeOptions","paletteMode","createSequenceEditorTheme","createTheme"],"sources":["../../../src/theme/demoTheme/demoTheme.ts"],"sourcesContent":["import { createDemoThemeOptions } from '@rivm-loculus-tools/common-frontend/theme/demoTheme';\nimport type {\n PaletteMode,\n Theme,\n ThemeOptions,\n} from '@mui/material';\nimport { createTheme as muiCreateTheme } from '@mui/material';\n\nexport const createSequenceEditorThemeOptions = (paletteMode: PaletteMode): ThemeOptions => {\n const commonThemeOptions = createDemoThemeOptions(paletteMode);\n const themeOptions: ThemeOptions = {\n ...commonThemeOptions,\n components: {\n ...commonThemeOptions.components,\n },\n };\n return themeOptions;\n};\n\nexport const createSequenceEditorTheme = (paletteMode: PaletteMode): Theme => {\n return muiCreateTheme(createSequenceEditorThemeOptions(paletteMode));\n};\n"],"mappings":";;;AAQA,IAAaC,KAAoC,MAA2C;CAC1F,IAAMC,IAAqBC,EAAuBC,CAAW;CAO7D,OAAO;EALL,GAAGF;EACH,YAAY,EACV,GAAGA,EAAmB,WACxB;CAEK;AACT,GAEaG,KAA6B,MACjCL,EAAeC,EAAiCG,CAAW,CAAC"}
1
+ {"version":3,"file":"index.js","names":["muiCreateTheme","createDemoThemeOptions","createTheme","createSequenceEditorThemeOptions","paletteMode","commonThemeOptions","createSequenceEditorTheme"],"sources":["../../../src/theme/demoTheme/demoTheme.ts"],"sourcesContent":["import { createDemoThemeOptions } from '@rivm-loculus-tools/common-frontend/theme/demoTheme';\nimport type {\n PaletteMode,\n Theme,\n ThemeOptions,\n} from '@mui/material';\nimport { createTheme as muiCreateTheme } from '@mui/material';\n\nexport const createSequenceEditorThemeOptions = (paletteMode: PaletteMode): ThemeOptions => {\n const commonThemeOptions = createDemoThemeOptions(paletteMode);\n const themeOptions: ThemeOptions = {\n ...commonThemeOptions,\n components: {\n ...commonThemeOptions.components,\n },\n };\n return themeOptions;\n};\n\nexport const createSequenceEditorTheme = (paletteMode: PaletteMode): Theme => {\n return muiCreateTheme(createSequenceEditorThemeOptions(paletteMode));\n};\n"],"mappings":";;;AAQA,IAAaG,KAAoCC,MAA2C;CAC1F,IAAMC,IAAqBJ,EAAuBG,CAAW;CAO7D,OAAO;EALL,GAAGC;EACH,YAAY,EACV,GAAGA,EAAmB,WACxB;CAEK;AACT,GAEaC,KAA6BF,MACjCJ,EAAeG,EAAiCC,CAAW,CAAC"}
@@ -1,12 +1,15 @@
1
- import { EditorAssembly, EditorPathProperties, EditorSelection, EngineMeta, EngineSearchResult, EngineViewportResult, GridGeometry, GridRange, StatusBarSelectionStats, VisibleGridRange, EDITOR_DIRECTION } from '../../models/editor.models';
1
+ import { EditorAssembly, EditorPathProperties, EditorSelection, EngineMeta, EngineSearchResult, EngineViewportResult, GridGeometry, GridRange, StatusBarSelectionStats, VisibleGridRange, EDITOR_DIRECTION, READING_MODE } from '../../models/editor.models';
2
2
  import { AminoAcidPalette, NucleotidePalette } from '../../models/palette.models';
3
3
  export declare class EditorUtil {
4
- static drawCanvas({ canvasElement, devicePixelRatio, geometry, meta, palette, rowNames, rowNamesStartRow, scrollLeft, scrollTop, searchResult, searchResultHighlightedIndex, selection, viewport, viewportHeight, viewportWidth, }: {
4
+ static drawCanvas({ aminoAcidPalette, canvasElement, devicePixelRatio, geometry, meta, nucleotidePalette, readingFrame, readingMode, rowNames, rowNamesStartRow, scrollLeft, scrollTop, searchResult, searchResultHighlightedIndex, selection, viewport, viewportHeight, viewportWidth, }: {
5
+ aminoAcidPalette: AminoAcidPalette;
5
6
  canvasElement: HTMLCanvasElement;
6
7
  devicePixelRatio: number;
7
8
  geometry: GridGeometry;
8
9
  meta: EngineMeta;
9
- palette: AminoAcidPalette | NucleotidePalette;
10
+ nucleotidePalette: NucleotidePalette;
11
+ readingFrame?: number;
12
+ readingMode?: READING_MODE;
10
13
  rowNames: string[];
11
14
  rowNamesStartRow: number;
12
15
  scrollLeft: number;
@@ -95,7 +98,11 @@ export declare class EditorUtil {
95
98
  * @param callback - Drawing operations to perform inside the transform.
96
99
  */
97
100
  private static draw;
101
+ private static drawCell;
102
+ private static drawCells;
98
103
  private static getCanvasContext;
104
+ private static getCellRenderConfig;
105
+ private static getCellRenderData;
99
106
  private static searchHitAt;
100
107
  private static searchHitContainsCell;
101
108
  }