@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.
- package/dist/_chunks/EngineErrorUtil.js.map +1 -1
- package/dist/_chunks/EngineWorker.js +1 -1
- package/dist/_chunks/EngineWorker.js.map +1 -1
- package/dist/_chunks/SequenceEditor.js +520 -488
- package/dist/_chunks/SequenceEditor.js.map +1 -1
- package/dist/_chunks/SequenceEditorEventBusService.js +5 -5
- package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageDrawer.js +462 -693
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/sequenceEditorStore.js +84 -85
- package/dist/_chunks/sequenceEditorStore.js.map +1 -1
- package/dist/_chunks/sequence_editor.js +131 -104
- package/dist/_chunks/sequence_editor.js.map +1 -1
- package/dist/assets/AlignerWorker-DkAbHwjR.js +8 -0
- package/dist/assets/AlignerWorker-DkAbHwjR.js.map +1 -0
- package/dist/assets/index-CKWZNkQe.js +8 -0
- package/dist/assets/index-CKWZNkQe.js.map +1 -0
- package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +18 -19
- package/dist/classes/services/EditorWorkerService/index.js +76 -99
- package/dist/classes/services/EditorWorkerService/index.js.map +1 -1
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +2 -0
- package/dist/classes/workers/AlignerWorker/index.js.map +1 -1
- package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +19 -17
- package/dist/classes/workers/EngineWorker/index.js +78 -30
- package/dist/classes/workers/EngineWorker/index.js.map +1 -1
- package/dist/components/app/SequenceEditorApp/index.js +10 -10
- package/dist/components/app/SequenceEditorApp/index.js.map +1 -1
- package/dist/components/ui/SequenceActionsBar/SequenceActionsBar.d.ts +1 -0
- package/dist/components/ui/SequenceActionsBar/index.d.ts +1 -0
- package/dist/components/ui/SequenceActionsBar/index.js +113 -0
- package/dist/components/ui/SequenceActionsBar/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorMenu/SequenceEditorMenu.d.ts +1 -0
- package/dist/components/ui/SequenceEditorMenu/index.d.ts +1 -0
- package/dist/components/ui/SequenceEditorMenu/index.js +198 -0
- package/dist/components/ui/SequenceEditorMenu/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorPageHeader/index.js +86 -1
- package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorRealignModal/index.js +13 -13
- package/dist/components/ui/SequenceEditorRealignModal/index.js.map +1 -1
- package/dist/components/ui/SequenceEditorSearchBar/index.js +25 -21
- package/dist/components/ui/SequenceEditorSearchBar/index.js.map +1 -1
- package/dist/constants/keyboard.js +26 -26
- package/dist/constants/keyboard.js.map +1 -1
- package/dist/constants/palette.js +147 -147
- package/dist/constants/palette.js.map +1 -1
- package/dist/models/config.models.d.ts +1 -0
- package/dist/models/editor.models.d.ts +34 -26
- package/dist/models/editor.models.js +3 -1
- package/dist/models/editor.models.js.map +1 -1
- package/dist/models/palette.models.js.map +1 -1
- package/dist/pages/SequenceEditorMainPage/index.js +20 -20
- package/dist/pages/SequenceEditorMainPage/index.js.map +1 -1
- package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +4 -2
- package/dist/theme/demoTheme/index.js +5 -5
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/EditorUtil/EditorUtil.d.ts +10 -3
- package/dist/utils/EditorUtil/index.js +360 -275
- package/dist/utils/EditorUtil/index.js.map +1 -1
- package/dist/utils/PaletteUtil/index.js.map +1 -1
- package/dist/utils/SequenceEditorStandardConfigUtil/index.js +6 -6
- package/dist/utils/SequenceEditorStandardConfigUtil/index.js.map +1 -1
- package/dist/vite/paletteSchemaPlugin/index.js.map +1 -1
- package/package.json +22 -22
- package/dist/_chunks/SequenceEditorPageHeader.js +0 -123
- package/dist/_chunks/SequenceEditorPageHeader.js.map +0 -1
- package/dist/assets/AlignerWorker-cbSDVRKB.js +0 -8
- package/dist/assets/AlignerWorker-cbSDVRKB.js.map +0 -1
- package/dist/assets/index--BqOy4u7.js +0 -8
- package/dist/assets/index--BqOy4u7.js.map +0 -1
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["paletteEntryFields","createPaletteGroupSchema","symbols","symbol","paletteJsonSchema","field","
|
|
1
|
+
{"version":3,"file":"index.js","names":["AMINO_ACID_SYMBOLS","NUCLEOTIDE_SYMBOLS","PALETTE_SCHEMA_ASSET_PATH","PALETTE_SCHEMA_URL_PATH","paletteEntryFields","createPaletteGroupSchema","title","symbols","symbol","paletteJsonSchema","field","createPaletteSchemaPlugin","server","_request","response"],"sources":["../../../src/vite/paletteSchemaPlugin/paletteSchemaPlugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\n\nimport {\n AMINO_ACID_SYMBOLS,\n NUCLEOTIDE_SYMBOLS,\n PALETTE_SCHEMA_ASSET_PATH,\n PALETTE_SCHEMA_URL_PATH,\n} from '../../constants/paletteSchemaData.ts'; // eslint-disable-line import-x/extensions\n\nconst paletteEntryFields = [\n 'background',\n 'backgroundSelected',\n 'foreground',\n 'foregroundSelected',\n];\n\nconst createPaletteGroupSchema = (title: string, symbols: readonly string[]) => ({\n additionalProperties: false,\n properties: {\n $schema: {\n format: 'uri',\n type: 'string',\n },\n name: {\n minLength: 1,\n pattern: '\\\\S',\n type: 'string',\n },\n paletteColors: {\n additionalProperties: false,\n properties: Object.fromEntries(symbols.map((symbol) => [\n symbol,\n { $ref: '#/$defs/paletteEntry' },\n ])),\n required: symbols,\n type: 'object',\n },\n },\n required: ['name', 'paletteColors'],\n title,\n type: 'object',\n});\n\nconst paletteJsonSchema = JSON.stringify({\n $defs: {\n paletteEntry: {\n additionalProperties: false,\n properties: Object.fromEntries(paletteEntryFields.map((field) => [\n field,\n {\n pattern: '^#[0-9a-fA-F]{6}$',\n type: 'string',\n },\n ])),\n required: paletteEntryFields,\n type: 'object',\n },\n },\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n oneOf: [\n createPaletteGroupSchema('Nucleotide palette', NUCLEOTIDE_SYMBOLS),\n createPaletteGroupSchema('Amino-acid palette', AMINO_ACID_SYMBOLS),\n ],\n title: 'Sequence editor palette',\n}, null, 2);\n\nexport const createPaletteSchemaPlugin = (): Plugin => ({\n configureServer: (server): void => {\n server.middlewares.use(PALETTE_SCHEMA_URL_PATH, (_request, response) => {\n response.setHeader('Content-Type', 'application/schema+json; charset=utf-8');\n response.end(paletteJsonSchema);\n });\n },\n generateBundle() {\n this.emitFile({\n fileName: PALETTE_SCHEMA_ASSET_PATH,\n source: paletteJsonSchema,\n type: 'asset',\n });\n },\n name: 'sequence-editor-palette-schema',\n});\n"],"mappings":";;AASA,IAAMI,IAAqB;CACzB;CACA;CACA;CACA;AACF,GAEMC,KAA4BC,GAAeC,OAAgC;CAC/E,sBAAsB;CACtB,YAAY;EACV,SAAS;GACP,QAAQ;GACR,MAAM;EACR;EACA,MAAM;GACJ,WAAW;GACX,SAAS;GACT,MAAM;EACR;EACA,eAAe;GACb,sBAAsB;GACtB,YAAY,OAAO,YAAYA,EAAQ,KAAKC,MAAW,CACrDA,GACA,EAAE,MAAM,uBAAuB,CACjC,CAAC,CAAC;GACF,UAAUD;GACV,MAAM;EACR;CACF;CACA,UAAU,CAAC,QAAQ,eAAe;CAClCD;CACA,MAAM;AACR,IAEMG,IAAoB,KAAK,UAAU;CACvC,OAAO,EACL,cAAc;EACZ,sBAAsB;EACtB,YAAY,OAAO,YAAYL,EAAmB,KAAKM,MAAU,CAC/DA,GACA;GACE,SAAS;GACT,MAAM;EACR,CACF,CAAC,CAAC;EACF,UAAUN;EACV,MAAM;CACR,EACF;CACA,SAAS;CACT,OAAO,CACLC,EAAyB,sBAAsBJ,CAAkB,GACjEI,EAAyB,sBAAsBL,CAAkB,CACnE;CACA,OAAO;AACT,GAAG,MAAM,CAAC,GAEGW,WAA2C;CACtD,kBAAkBC,MAAiB;EACjCA,EAAO,YAAY,IAAIT,IAA0BU,GAAUC,MAAa;GACtEA,EAAS,UAAU,gBAAgB,wCAAwC,GAC3EA,EAAS,IAAIL,CAAiB;EAChC,CAAC;CACH;CACA,iBAAiB;EACf,KAAK,SAAS;GACZ,UAAUP;GACV,QAAQO;GACR,MAAM;EACR,CAAC;CACH;CACA,MAAM;AACR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivm-loculus-tools/sequence-editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,48 +31,48 @@
|
|
|
31
31
|
"tsyringe": "*"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@rivm-loculus-tools/sequence-editor-wasm": "^0.
|
|
34
|
+
"@rivm-loculus-tools/sequence-editor-wasm": "^0.6.0",
|
|
35
35
|
"comlink": "4.4.2",
|
|
36
36
|
"lodash": "4.18.1",
|
|
37
37
|
"mui-color-input": "9.0.0",
|
|
38
38
|
"tsyringe": "4.10.0",
|
|
39
39
|
"use-debounce": "10.1.1",
|
|
40
|
-
"zustand": "5.0
|
|
40
|
+
"zustand": "5.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@emotion/cache": "11.14.0",
|
|
44
44
|
"@emotion/react": "11.14.0",
|
|
45
45
|
"@emotion/styled": "11.14.1",
|
|
46
|
-
"@gen-epix/eslint-config": "0.
|
|
47
|
-
"@gen-epix/ui-core": "3.
|
|
48
|
-
"@gen-epix/ui-core-components": "4.
|
|
49
|
-
"@gen-epix/ui-core-form": "4.
|
|
50
|
-
"@mui/icons-material": "9.
|
|
51
|
-
"@mui/material": "9.
|
|
52
|
-
"@mui/styled-engine": "9.
|
|
53
|
-
"@mui/system": "9.
|
|
54
|
-
"@mui/utils": "9.
|
|
55
|
-
"@rivm-loculus-tools/common-frontend": "^0.
|
|
46
|
+
"@gen-epix/eslint-config": "0.10.0",
|
|
47
|
+
"@gen-epix/ui-core": "3.13.0",
|
|
48
|
+
"@gen-epix/ui-core-components": "4.9.0",
|
|
49
|
+
"@gen-epix/ui-core-form": "4.8.0",
|
|
50
|
+
"@mui/icons-material": "9.6.0",
|
|
51
|
+
"@mui/material": "9.6.0",
|
|
52
|
+
"@mui/styled-engine": "9.6.0",
|
|
53
|
+
"@mui/system": "9.6.0",
|
|
54
|
+
"@mui/utils": "9.6.0",
|
|
55
|
+
"@rivm-loculus-tools/common-frontend": "^0.13.0",
|
|
56
56
|
"@types/lodash": "4.17.27",
|
|
57
|
-
"@types/node": "26.6.
|
|
58
|
-
"@types/react": "19.3.
|
|
57
|
+
"@types/node": "26.6.11",
|
|
58
|
+
"@types/react": "19.3.3",
|
|
59
59
|
"@types/react-dom": "19.3.0",
|
|
60
|
-
"@vitejs/plugin-react": "6.
|
|
61
|
-
"eslint": "10.
|
|
62
|
-
"i18next": "
|
|
60
|
+
"@vitejs/plugin-react": "6.3.0",
|
|
61
|
+
"eslint": "10.15.0",
|
|
62
|
+
"i18next": "27.2.9",
|
|
63
63
|
"react": "19.3.1",
|
|
64
64
|
"react-dom": "19.3.1",
|
|
65
65
|
"react-error-boundary": "6.1.6",
|
|
66
|
-
"react-hook-form": "7.
|
|
67
|
-
"react-i18next": "
|
|
66
|
+
"react-hook-form": "7.92.0",
|
|
67
|
+
"react-i18next": "18.0.3",
|
|
68
68
|
"tsyringe": "4.10.0",
|
|
69
69
|
"typescript": "6.0.3",
|
|
70
|
-
"vite": "8.
|
|
70
|
+
"vite": "8.4.0",
|
|
71
71
|
"vite-plugin-dts": "5.1.2",
|
|
72
72
|
"vite-plugin-lib-inject-css": "2.2.2",
|
|
73
73
|
"vite-plugin-static-copy": "4.1.1",
|
|
74
74
|
"vite-plugin-svgr": "5.2.0",
|
|
75
|
-
"vitest": "5.
|
|
75
|
+
"vitest": "5.1.2",
|
|
76
76
|
"vitest-browser-react": "2.3.0"
|
|
77
77
|
},
|
|
78
78
|
"files": [
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./sequenceEditorStore.js";
|
|
2
|
-
import { t } from "./react.js";
|
|
3
|
-
import { t as n } from "./SequenceEditorEventBusService.js";
|
|
4
|
-
import { useCallback as r, useMemo as i, useSyncExternalStore as a } from "react";
|
|
5
|
-
import { CircularProgress as o, IconButton as s, Tooltip as c } from "@mui/material";
|
|
6
|
-
import { container as l } from "tsyringe";
|
|
7
|
-
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
-
import { FastaPageHeaderCenterComponent as p } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaPageHeaderCenterComponent";
|
|
9
|
-
import { FastaPageHeaderImportButton as m } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaPageHeaderImportButton";
|
|
10
|
-
import { FastaPageHeaderResetButton as h } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaPageHeaderResetButton";
|
|
11
|
-
import { PageCommonHeader as g } from "@rivm-loculus-tools/common-frontend/components/ui/PageCommonHeader";
|
|
12
|
-
import { UrlService as _ } from "@rivm-loculus-tools/common-frontend/classes/services/UrlService";
|
|
13
|
-
import v from "@mui/icons-material/Code";
|
|
14
|
-
import y from "@mui/icons-material/Publish";
|
|
15
|
-
import b from "@mui/icons-material/AutoFixHigh";
|
|
16
|
-
import { ButtonWithMenu as x } from "@rivm-loculus-tools/common-frontend/components/ui/ButtonWithMenu";
|
|
17
|
-
import S from "@mui/icons-material/FileDownloadOutlined";
|
|
18
|
-
import { LoculusService as C } from "@rivm-loculus-tools/common-frontend/classes/services/LoculusService";
|
|
19
|
-
import w from "@mui/icons-material/Undo";
|
|
20
|
-
import T from "@mui/icons-material/Redo";
|
|
21
|
-
// src/components/ui/SequenceEditorPageHeader/SequenceEditorUndoRedoButtons.tsx
|
|
22
|
-
var E = () => {
|
|
23
|
-
let i = t(e, (e) => e.engineMeta?.undoDepth), a = t(e, (e) => e.engineMeta?.redoDepth), o = r(() => {
|
|
24
|
-
l.resolve(n).emit("onUndo");
|
|
25
|
-
}, []), p = r(() => {
|
|
26
|
-
l.resolve(n).emit("onRedo");
|
|
27
|
-
}, []);
|
|
28
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(c, {
|
|
29
|
-
title: "Undo last action",
|
|
30
|
-
children: /* @__PURE__ */ d(s, {
|
|
31
|
-
color: "inherit",
|
|
32
|
-
disabled: i === 0,
|
|
33
|
-
onClick: o,
|
|
34
|
-
size: "small",
|
|
35
|
-
sx: { opacity: .85 },
|
|
36
|
-
children: /* @__PURE__ */ d(w, { fontSize: "small" })
|
|
37
|
-
})
|
|
38
|
-
}), /* @__PURE__ */ d(c, {
|
|
39
|
-
title: "Redo last action",
|
|
40
|
-
children: /* @__PURE__ */ d(s, {
|
|
41
|
-
color: "inherit",
|
|
42
|
-
disabled: a === 0,
|
|
43
|
-
onClick: p,
|
|
44
|
-
size: "small",
|
|
45
|
-
sx: { opacity: .85 },
|
|
46
|
-
children: /* @__PURE__ */ d(T, { fontSize: "small" })
|
|
47
|
-
})
|
|
48
|
-
})] });
|
|
49
|
-
}, D = () => {
|
|
50
|
-
let w = i(() => l.resolve(C), []), T = i(() => l.resolve(_), []), D = a(r((e) => w.subscribe(e), [w]), r(() => w.data.authenticated, [w]), () => !1), O = a(r((e) => T.subscribe(e), [T]), r(() => T.hasReturnParams(), [T]), () => !1), k = t(e, (e) => e.isRealigning), A = t(e, (e) => e.resetDataset), j = t(e, (e) => e.engineMeta?.sequenceCount ?? 0), M = t(e, (e) => e.parsedMetadata), N = t(e, (e) => !!e.rawFasta), P = r(() => {
|
|
51
|
-
A();
|
|
52
|
-
}, [A]), F = r(() => {
|
|
53
|
-
k || l.resolve(n).emit("onRealign");
|
|
54
|
-
}, [k]), I = r(() => {
|
|
55
|
-
l.resolve(n).emit("onExportUngappedFasta");
|
|
56
|
-
}, []), L = r(() => {
|
|
57
|
-
l.resolve(n).emit("onExportGappedFasta");
|
|
58
|
-
}, []), R = r(() => {
|
|
59
|
-
l.resolve(n).emit("onExportToLoculus");
|
|
60
|
-
}, []), z = i(() => [
|
|
61
|
-
{
|
|
62
|
-
disabled: !D || !N || !O || !M,
|
|
63
|
-
icon: /* @__PURE__ */ d(y, { fontSize: "small" }),
|
|
64
|
-
label: "Export to loculus",
|
|
65
|
-
onClick: R
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
disabled: !N,
|
|
69
|
-
icon: /* @__PURE__ */ d(v, { fontSize: "small" }),
|
|
70
|
-
label: "Save as Ungapped Fasta (.fasta)",
|
|
71
|
-
onClick: I
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
disabled: !N,
|
|
75
|
-
icon: /* @__PURE__ */ d(v, { fontSize: "small" }),
|
|
76
|
-
label: "Save as Gapped Fasta (.fasta)",
|
|
77
|
-
onClick: L
|
|
78
|
-
}
|
|
79
|
-
], [
|
|
80
|
-
D,
|
|
81
|
-
N,
|
|
82
|
-
O,
|
|
83
|
-
M,
|
|
84
|
-
R,
|
|
85
|
-
I,
|
|
86
|
-
L
|
|
87
|
-
]), B = M?.records?.length || 0;
|
|
88
|
-
return /* @__PURE__ */ d(g, {
|
|
89
|
-
centerComponent: /* @__PURE__ */ d(p, {
|
|
90
|
-
metaDataCount: B,
|
|
91
|
-
sequenceCount: j
|
|
92
|
-
}),
|
|
93
|
-
rightComponent: /* @__PURE__ */ f(u, { children: [
|
|
94
|
-
/* @__PURE__ */ d(E, {}),
|
|
95
|
-
/* @__PURE__ */ d(c, {
|
|
96
|
-
title: k ? "Re-aligning sequences..." : "Re-align all sequences (MAFFT FFT-NS-1)",
|
|
97
|
-
children: /* @__PURE__ */ d("span", { children: /* @__PURE__ */ d(s, {
|
|
98
|
-
"aria-label": k ? "Re-aligning sequences..." : "Re-align all sequences (MAFFT FFT-NS-1)",
|
|
99
|
-
color: "inherit",
|
|
100
|
-
disabled: k || (j ?? 0) < 2,
|
|
101
|
-
onClick: F,
|
|
102
|
-
size: "small",
|
|
103
|
-
sx: { opacity: .85 },
|
|
104
|
-
children: k ? /* @__PURE__ */ d(o, {
|
|
105
|
-
color: "inherit",
|
|
106
|
-
size: 18
|
|
107
|
-
}) : /* @__PURE__ */ d(b, { fontSize: "small" })
|
|
108
|
-
}) })
|
|
109
|
-
}),
|
|
110
|
-
/* @__PURE__ */ d(h, { onReset: P }),
|
|
111
|
-
/* @__PURE__ */ d(m, {}),
|
|
112
|
-
/* @__PURE__ */ d(x, {
|
|
113
|
-
items: z,
|
|
114
|
-
label: "Export",
|
|
115
|
-
startIcon: /* @__PURE__ */ d(S, {})
|
|
116
|
-
})
|
|
117
|
-
] }),
|
|
118
|
-
title: "Sequence Editor"
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
export { D as t };
|
|
122
|
-
|
|
123
|
-
//# sourceMappingURL=SequenceEditorPageHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SequenceEditorPageHeader.js","names":["_Fragment","_Fragment","sequenceEditorStore","SequenceEditorEventBusService","CodeIcon","PublishIcon","AutoFixHighIcon","FileDownloadOutlinedIcon","UndoIcon","RedoIcon","SequenceEditorUndoRedoButtons","undoDepth","useStore","state","redoDepth","onUndoButtonClick","useCallback","onRedoButtonClick","Fragment","Tooltip","IconButton","SequenceEditorPageHeader","loculusService","useMemo","container","LoculusService","urlService","UrlService","isAuthenticated","useSyncExternalStore","onStoreChange","hasReturnParams","isRealigning","resetDataset","sequenceCount","parsedMetadata","hasFasta","onReset","onRealignButtonClick","onClickExportFasta","onClickExportGappedFasta","onClickUploadToLoculus","exportExportMenuItems","metaDataCount","PageCommonHeader","FastaPageHeaderCenterComponent","CircularProgress","FastaPageHeaderResetButton","FastaPageHeaderImportButton","ButtonWithMenu"],"sources":["../../src/components/ui/SequenceEditorPageHeader/SequenceEditorUndoRedoButtons.tsx","../../src/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport UndoIcon from '@mui/icons-material/Undo';\nimport RedoIcon from '@mui/icons-material/Redo';\nimport {\n IconButton,\n Tooltip,\n} from '@mui/material';\nimport { useCallback } from 'react';\nimport { useStore } from 'zustand';\n\nimport { sequenceEditorStore } from '../../../stores/sequenceEditorStore';\nimport { SequenceEditorEventBusService } from '../../../classes/services/SequenceEditorEventBusService';\n\nexport const SequenceEditorUndoRedoButtons = () => {\n const undoDepth = useStore(sequenceEditorStore, (state) => state.engineMeta?.undoDepth);\n const redoDepth = useStore(sequenceEditorStore, (state) => state.engineMeta?.redoDepth);\n\n const onUndoButtonClick = useCallback(() => {\n container.resolve(SequenceEditorEventBusService).emit('onUndo');\n }, []);\n\n const onRedoButtonClick = useCallback(() => {\n container.resolve(SequenceEditorEventBusService).emit('onRedo');\n }, []);\n\n return (\n <>\n <Tooltip title={'Undo last action'}>\n <IconButton\n color={'inherit'}\n disabled={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={redoDepth === 0}\n onClick={onRedoButtonClick}\n size={'small'}\n sx={{ opacity: 0.85 }}\n >\n <RedoIcon fontSize={'small'} />\n </IconButton>\n </Tooltip>\n </>\n );\n};\n","import { container } from 'tsyringe';\nimport { FastaPageHeaderCenterComponent } from '@rivm-loculus-tools/common-frontend/components/fasta/FastaPageHeaderCenterComponent';\nimport { FastaPageHeaderImportButton } from '@rivm-loculus-tools/common-frontend/components/fasta/FastaPageHeaderImportButton';\nimport { FastaPageHeaderResetButton } from '@rivm-loculus-tools/common-frontend/components/fasta/FastaPageHeaderResetButton';\nimport { PageCommonHeader } from '@rivm-loculus-tools/common-frontend/components/ui/PageCommonHeader';\nimport {\n useCallback,\n useMemo,\n useSyncExternalStore,\n} from 'react';\nimport { UrlService } from '@rivm-loculus-tools/common-frontend/classes/services/UrlService';\nimport CodeIcon from '@mui/icons-material/Code';\nimport PublishIcon from '@mui/icons-material/Publish';\nimport { useStore } from 'zustand';\nimport AutoFixHighIcon from '@mui/icons-material/AutoFixHigh';\nimport {\n CircularProgress,\n IconButton,\n Tooltip,\n} from '@mui/material';\nimport { ButtonWithMenu } from '@rivm-loculus-tools/common-frontend/components/ui/ButtonWithMenu';\nimport type { ButtonWithMenuProps } from '@rivm-loculus-tools/common-frontend/components/ui/ButtonWithMenu';\nimport FileDownloadOutlinedIcon from '@mui/icons-material/FileDownloadOutlined';\nimport { LoculusService } from '@rivm-loculus-tools/common-frontend/classes/services/LoculusService';\n\nimport { sequenceEditorStore } from '../../../stores/sequenceEditorStore';\nimport { SequenceEditorEventBusService } from '../../../classes/services/SequenceEditorEventBusService';\n\nimport { SequenceEditorUndoRedoButtons } from './SequenceEditorUndoRedoButtons';\n\nexport const SequenceEditorPageHeader = () => {\n const loculusService = useMemo(() => container.resolve(LoculusService), []);\n const urlService = useMemo(() => container.resolve(UrlService), []);\n\n const isAuthenticated = useSyncExternalStore(\n useCallback((onStoreChange) => loculusService.subscribe(onStoreChange), [loculusService]),\n useCallback(() => loculusService.data.authenticated, [loculusService]),\n () => false,\n );\n\n const hasReturnParams = useSyncExternalStore(\n useCallback((onStoreChange) => urlService.subscribe(onStoreChange), [urlService]),\n useCallback(() => urlService.hasReturnParams(), [urlService]),\n () => false,\n );\n\n const isRealigning = useStore(sequenceEditorStore, (state) => state.isRealigning);\n const resetDataset = useStore(sequenceEditorStore, (state) => state.resetDataset);\n\n const sequenceCount = useStore(sequenceEditorStore, (state) => state.engineMeta?.sequenceCount ?? 0);\n const parsedMetadata = useStore(sequenceEditorStore, (state) => state.parsedMetadata);\n const hasFasta = useStore(sequenceEditorStore, (state) => !!state.rawFasta);\n\n const onReset = useCallback(() => {\n resetDataset();\n }, [resetDataset]);\n\n const onRealignButtonClick = useCallback(() => {\n if (isRealigning) {\n return;\n }\n container.resolve(SequenceEditorEventBusService).emit('onRealign');\n }, [isRealigning]);\n\n const onClickExportFasta = useCallback(() => {\n container.resolve(SequenceEditorEventBusService).emit('onExportUngappedFasta');\n }, []);\n\n const onClickExportGappedFasta = useCallback(() => {\n container.resolve(SequenceEditorEventBusService).emit('onExportGappedFasta');\n }, []);\n\n const onClickUploadToLoculus = useCallback(() => {\n container.resolve(SequenceEditorEventBusService).emit('onExportToLoculus');\n }, []);\n\n const exportExportMenuItems: ButtonWithMenuProps['items'] = useMemo(() => [\n {\n disabled: !isAuthenticated || !hasFasta || !hasReturnParams || !parsedMetadata,\n icon: <PublishIcon fontSize={'small'} />,\n label: 'Export to loculus',\n onClick: onClickUploadToLoculus,\n },\n {\n disabled: !hasFasta,\n icon: <CodeIcon fontSize={'small'} />,\n label: 'Save as Ungapped Fasta (.fasta)',\n onClick: onClickExportFasta,\n },\n {\n disabled: !hasFasta,\n icon: <CodeIcon fontSize={'small'} />,\n label: 'Save as Gapped Fasta (.fasta)',\n onClick: onClickExportGappedFasta,\n },\n ], [isAuthenticated, hasFasta, hasReturnParams, parsedMetadata, onClickUploadToLoculus, onClickExportFasta, onClickExportGappedFasta]);\n\n const metaDataCount = parsedMetadata?.records?.length || 0;\n\n return (\n <PageCommonHeader\n centerComponent={(\n <FastaPageHeaderCenterComponent\n metaDataCount={metaDataCount}\n sequenceCount={sequenceCount}\n />\n )}\n rightComponent={(\n <>\n <SequenceEditorUndoRedoButtons />\n <Tooltip title={isRealigning ? 'Re-aligning sequences...' : 'Re-align all sequences (MAFFT FFT-NS-1)'}>\n <span>\n <IconButton\n aria-label={isRealigning ? 'Re-aligning sequences...' : 'Re-align all sequences (MAFFT FFT-NS-1)'}\n color={'inherit'}\n disabled={isRealigning || (sequenceCount ?? 0) < 2}\n onClick={onRealignButtonClick}\n size={'small'}\n sx={{ opacity: 0.85 }}\n >\n {isRealigning ? (\n <CircularProgress\n color={'inherit'}\n size={18}\n />\n ) : (\n <AutoFixHighIcon fontSize={'small'} />\n )}\n </IconButton>\n </span>\n </Tooltip>\n <FastaPageHeaderResetButton onReset={onReset} />\n <FastaPageHeaderImportButton />\n <ButtonWithMenu\n items={exportExportMenuItems}\n label={'Export'}\n startIcon={<FileDownloadOutlinedIcon />}\n />\n </>\n )}\n title={'Sequence Editor'}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaA,IAAaU,UAAsC;CACjD,IAAMC,IAAYC,EAASV,IAAsB,MAAUW,EAAM,YAAY,SAAS,GAChFC,IAAYF,EAASV,IAAsB,MAAUW,EAAM,YAAY,SAAS,GAEhFE,IAAoBC,QAAkB;EAC1C,EAAU,QAAQb,CAA6B,CAAC,CAAC,KAAK,QAAQ;CAChE,GAAG,CAAC,CAAC,GAECc,IAAoBD,QAAkB;EAC1C,EAAU,QAAQb,CAA6B,CAAC,CAAC,KAAK,QAAQ;CAChE,GAAG,CAAC,CAAC;CAEL,OACE,kBAAAH,GAAA,EAAA,UAAA,CACE,kBAACmB,GAAD;EAAS,OAAO;EACd,UAAA,kBAACC,GAAD;GACE,OAAO;GACP,UAAUT,MAAc;GACxB,SAASI;GACT,MAAM;GACN,IAAI,EAAE,SAAS,IAAK;GAEpB,UAAA,kBAACP,GAAD,EAAU,UAAU,QAAU,CAAA;EACpB,CAAA;CACL,CAAA,GACT,kBAACW,GAAD;EAAS,OAAO;EACd,UAAA,kBAACC,GAAD;GACE,OAAO;GACP,UAAUN,MAAc;GACxB,SAASG;GACT,MAAM;GACN,IAAI,EAAE,SAAS,IAAK;GAEpB,UAAA,kBAACR,GAAD,EAAU,UAAU,QAAU,CAAA;EACpB,CAAA;CACL,CAAA,CACT,EAAA,CAAA;AAEN,GCrBaY,UAAiC;CAC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