@rivm-loculus-tools/sequence-editor 1.7.1 → 1.9.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 (58) hide show
  1. package/dist/_chunks/EngineWorker.js +1 -1
  2. package/dist/_chunks/EngineWorker.js.map +1 -1
  3. package/dist/_chunks/SequenceEditor.js +250 -145
  4. package/dist/_chunks/SequenceEditor.js.map +1 -1
  5. package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
  6. package/dist/_chunks/SequenceEditorPageDrawer.js +132 -127
  7. package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
  8. package/dist/_chunks/SequenceEditorPageHeader.js +123 -0
  9. package/dist/_chunks/SequenceEditorPageHeader.js.map +1 -0
  10. package/dist/_chunks/sequenceEditorStore.js +2 -2
  11. package/dist/_chunks/sequenceEditorStore.js.map +1 -1
  12. package/dist/_chunks/sequence_editor.js +8 -1
  13. package/dist/_chunks/sequence_editor.js.map +1 -1
  14. package/dist/assets/AlignerWorker-cbSDVRKB.js +8 -0
  15. package/dist/assets/AlignerWorker-cbSDVRKB.js.map +1 -0
  16. package/dist/assets/index--BqOy4u7.js +8 -0
  17. package/dist/assets/index--BqOy4u7.js.map +1 -0
  18. package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +29 -23
  19. package/dist/classes/services/EditorWorkerService/index.js +80 -69
  20. package/dist/classes/services/EditorWorkerService/index.js.map +1 -1
  21. package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +4 -0
  22. package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +2 -0
  23. package/dist/classes/workers/EngineWorker/index.js +6 -0
  24. package/dist/classes/workers/EngineWorker/index.js.map +1 -1
  25. package/dist/components/app/SequenceEditorApp/index.js +4 -1
  26. package/dist/components/app/SequenceEditorApp/index.js.map +1 -1
  27. package/dist/components/ui/SequenceEditorPageHeader/SequenceEditorUndoRedoButtons.d.ts +1 -0
  28. package/dist/components/ui/SequenceEditorPageHeader/index.js +1 -109
  29. package/dist/components/ui/SequenceEditorRealignModal/index.js +2 -2
  30. package/dist/components/ui/SequenceEditorRealignModal/index.js.map +1 -1
  31. package/dist/constants/index.js +5 -4
  32. package/dist/constants/keyboard.d.ts +2 -0
  33. package/dist/constants/keyboard.js +44 -7
  34. package/dist/constants/keyboard.js.map +1 -1
  35. package/dist/constants/palette.d.ts +1 -2
  36. package/dist/constants/palette.js +162 -204
  37. package/dist/constants/palette.js.map +1 -1
  38. package/dist/constants/paletteSchemaData.d.ts +4 -0
  39. package/dist/constants/paletteSchemaData.js +48 -0
  40. package/dist/constants/paletteSchemaData.js.map +1 -0
  41. package/dist/models/editor.models.d.ts +2 -0
  42. package/dist/models/editor.models.js.map +1 -1
  43. package/dist/pages/SequenceEditorMainPage/index.js +1 -0
  44. package/dist/pages/SequenceEditorMainPage/index.js.map +1 -1
  45. package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +2 -2
  46. package/dist/utils/EditorUtil/EditorUtil.d.ts +3 -0
  47. package/dist/utils/EditorUtil/index.js +206 -169
  48. package/dist/utils/EditorUtil/index.js.map +1 -1
  49. package/dist/utils/SequenceEditorStandardConfigUtil/index.js +1 -1
  50. package/dist/vite/paletteSchemaPlugin/index.d.ts +1 -1
  51. package/dist/vite/paletteSchemaPlugin/index.js +1 -1
  52. package/dist/vite/paletteSchemaPlugin/index.js.map +1 -1
  53. package/package.json +7 -3
  54. package/dist/assets/AlignerWorker-Cf4trdzm.js +0 -8
  55. package/dist/assets/AlignerWorker-Cf4trdzm.js.map +0 -1
  56. package/dist/assets/index-YCKQaSTQ.js +0 -8
  57. package/dist/assets/index-YCKQaSTQ.js.map +0 -1
  58. package/dist/components/ui/SequenceEditorPageHeader/index.js.map +0 -1
@@ -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 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 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\""],"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"}
@@ -27,6 +27,7 @@ var f = () => {
27
27
  }),
28
28
  /* @__PURE__ */ r(a, {
29
29
  extraActions: f?.fastaImportExtraActions,
30
+ fastaDescription: "Nucleotide or amino-acid sequence data.",
30
31
  store: e
31
32
  }),
32
33
  /* @__PURE__ */ r(o, {
@@ -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 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,OAAOJ;GACR,CAAA;GACD,kBAACa,GAAD;IACE,OAAO;IACP,MAAMP,MAAkBQ,EAAe;GACxC,CAAA;EACS;;AAEhB"}
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"}
@@ -6,9 +6,9 @@ export interface SequenceEditorStoreActions extends FastaDataStoreActions {
6
6
  setAminoAcidPalette: (palette: AminoAcidPalette) => void;
7
7
  setCustomAminoAcidPalette: (palette: AminoAcidPalette) => void;
8
8
  setCustomNucleotidePalette: (palette: NucleotidePalette) => void;
9
+ setEngineMeta: (meta: EngineMeta | null) => void;
9
10
  setIsRealigning: (isRealigning: boolean) => void;
10
11
  setLatestMessage: (message: null | string) => void;
11
- setMeta: (meta: EngineMeta | null) => void;
12
12
  setNucleotidePalette: (palette: NucleotidePalette) => void;
13
13
  setSearchQuery: (query: string) => void;
14
14
  setSearchResult: (results: EngineSearchResult | null) => void;
@@ -19,9 +19,9 @@ export interface SequenceEditorStoreState extends FastaDataStoreState {
19
19
  aminoAcidPalette: AminoAcidPalette;
20
20
  customAminoAcidPalette: AminoAcidPalette;
21
21
  customNucleotidePalette: NucleotidePalette;
22
+ engineMeta: EngineMeta | null;
22
23
  isRealigning: boolean;
23
24
  latestMessage: null | string;
24
- meta: EngineMeta | null;
25
25
  nucleotidePalette: NucleotidePalette;
26
26
  searchQuery: string;
27
27
  searchResult: EngineSearchResult | null;
@@ -47,8 +47,11 @@ export declare class EditorUtil {
47
47
  editorAssembly: EditorAssembly;
48
48
  event: MouseEvent;
49
49
  }): EditorPathProperties | undefined;
50
+ static getPostDeleteRowsSelection(selection: EditorSelection | null, sequenceCount: number): EditorSelection | null;
51
+ static getPostPasteSequencesSelection(selection: EditorSelection | null, insertedFasta: string): EditorSelection | null;
50
52
  static getPostUpsertSelection(selection: EditorSelection | null, direction: EDITOR_DIRECTION): EditorSelection | null;
51
53
  static getRowsToMove(selection: EditorSelection | null, direction: EDITOR_DIRECTION, metaData: EngineMeta): number[] | undefined;
54
+ static getSelectedFasta(fasta: string, selection: EditorSelection | null): string;
52
55
  static getSelectionFromPathProperties(params: {
53
56
  endPath: EditorPathProperties;
54
57
  startPath: EditorPathProperties;