@rivm-loculus-tools/sequence-editor 1.7.0 → 1.8.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/SequenceEditor.js +138 -120
- package/dist/_chunks/SequenceEditor.js.map +1 -1
- package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageDrawer.js +97 -96
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageHeader.js +120 -0
- package/dist/_chunks/SequenceEditorPageHeader.js.map +1 -0
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +1 -0
- package/dist/components/app/SequenceEditorApp/index.js +4 -1
- package/dist/components/app/SequenceEditorApp/index.js.map +1 -1
- package/dist/components/ui/SequenceEditorPageHeader/SequenceEditorUndoRedoButtons.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageHeader/index.js +1 -109
- package/dist/components/ui/SequenceEditorRealignModal/index.js +2 -2
- package/dist/components/ui/SequenceEditorRealignModal/index.js.map +1 -1
- package/dist/constants/index.js +5 -4
- package/dist/constants/keyboard.js +2 -2
- package/dist/constants/keyboard.js.map +1 -1
- package/dist/constants/palette.d.ts +1 -2
- package/dist/constants/palette.js +162 -204
- package/dist/constants/palette.js.map +1 -1
- package/dist/constants/paletteSchemaData.d.ts +4 -0
- package/dist/constants/paletteSchemaData.js +48 -0
- package/dist/constants/paletteSchemaData.js.map +1 -0
- package/dist/pages/SequenceEditorMainPage/index.js +1 -0
- package/dist/pages/SequenceEditorMainPage/index.js.map +1 -1
- package/dist/utils/EditorUtil/index.js +83 -83
- package/dist/utils/EditorUtil/index.js.map +1 -1
- package/dist/utils/SequenceEditorStandardConfigUtil/index.js +1 -1
- package/dist/vite/paletteSchemaPlugin/index.d.ts +1 -1
- package/dist/vite/paletteSchemaPlugin/index.js +1 -1
- package/dist/vite/paletteSchemaPlugin/index.js.map +1 -1
- package/package.json +6 -2
- package/dist/components/ui/SequenceEditorPageHeader/index.js.map +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
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.meta?.undoDepth), a = t(e, (e) => e.meta?.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.meta?.sequenceCount), 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
|
+
]);
|
|
88
|
+
return /* @__PURE__ */ d(g, {
|
|
89
|
+
centerComponent: /* @__PURE__ */ d(p, { store: e }),
|
|
90
|
+
rightComponent: /* @__PURE__ */ f(u, { children: [
|
|
91
|
+
/* @__PURE__ */ d(E, {}),
|
|
92
|
+
/* @__PURE__ */ d(c, {
|
|
93
|
+
title: k ? "Re-aligning sequences..." : "Re-align all sequences (MAFFT FFT-NS-1)",
|
|
94
|
+
children: /* @__PURE__ */ d("span", { children: /* @__PURE__ */ d(s, {
|
|
95
|
+
"aria-label": k ? "Re-aligning sequences..." : "Re-align all sequences (MAFFT FFT-NS-1)",
|
|
96
|
+
color: "inherit",
|
|
97
|
+
disabled: k || (j ?? 0) < 2,
|
|
98
|
+
onClick: F,
|
|
99
|
+
size: "small",
|
|
100
|
+
sx: { opacity: .85 },
|
|
101
|
+
children: k ? /* @__PURE__ */ d(o, {
|
|
102
|
+
color: "inherit",
|
|
103
|
+
size: 18
|
|
104
|
+
}) : /* @__PURE__ */ d(b, { fontSize: "small" })
|
|
105
|
+
}) })
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ d(h, { onReset: P }),
|
|
108
|
+
/* @__PURE__ */ d(m, {}),
|
|
109
|
+
/* @__PURE__ */ d(x, {
|
|
110
|
+
items: z,
|
|
111
|
+
label: "Export",
|
|
112
|
+
startIcon: /* @__PURE__ */ d(S, {})
|
|
113
|
+
})
|
|
114
|
+
] }),
|
|
115
|
+
title: "Sequence Editor"
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
export { D as t };
|
|
119
|
+
|
|
120
|
+
//# sourceMappingURL=SequenceEditorPageHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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","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.meta?.undoDepth);\n const redoDepth = useStore(sequenceEditorStore, (state) => state.meta?.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.meta?.sequenceCount);\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 return (\n <PageCommonHeader\n centerComponent={<FastaPageHeaderCenterComponent store={sequenceEditorStore} />}\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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iBQ;EAAUL;EAAiBI;EAAgBM;EAAwBF;EAAoBC;CAAwB,CAAC;CAErI,OACE,kBAACG,GAAD;EACE,iBAAiB,kBAACC,GAAD,EAAgC,OAAO1C,EAAsB,CAAA;EAC9E,gBACE,kBAAAD,GAAA,EAAA,UAAA;GACE,kBAACS,GAAD,CAAgC,CAAA;GAChC,kBAACS,GAAD;IAAS,OAAOa,IAAe,6BAA6B;IAC1D,UAAA,kBAAC,QAAD,EAAA,UACE,kBAACZ,GAAD;KACE,cAAYY,IAAe,6BAA6B;KACxD,OAAO;KACP,UAAUA,MAAiBE,KAAiB,KAAK;KACjD,SAASI;KACT,MAAM;KACN,IAAI,EAAE,SAAS,IAAK;KAEnB,UAAAN,IACC,kBAACa,GAAD;MACE,OAAO;MACP,MAAM;KACP,CAAA,IAED,kBAACvC,GAAD,EAAiB,UAAU,QAAU,CAAA;IAE7B,CAAA,EACR,CAAA;GACC,CAAA;GACT,kBAACwC,GAAD,EAAqC,WAAU,CAAA;GAC/C,kBAACC,GAAD,CAA8B,CAAA;GAC9B,kBAACC,GAAD;IACE,OAAON;IACP,OAAO;IACP,WAAW,kBAACnC,GAAD,CAA2B,CAAA;GACvC,CAAA;EACD,EAAA,CAAA;EAEJ,OAAO;CACR,CAAA;AAEL"}
|
|
@@ -13,7 +13,10 @@ var o = () => (n(() => {
|
|
|
13
13
|
console.error(e);
|
|
14
14
|
}
|
|
15
15
|
})();
|
|
16
|
-
}, []), /* @__PURE__ */ i(a, {
|
|
16
|
+
}, []), /* @__PURE__ */ i(a, {
|
|
17
|
+
useAuthentication: !0,
|
|
18
|
+
children: /* @__PURE__ */ i(t, {})
|
|
19
|
+
}));
|
|
17
20
|
export { o as SequenceEditorApp };
|
|
18
21
|
|
|
19
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SequenceEditorApp","useEffect","container","EditorWorkerService","error","App","SequenceEditorMainPage"],"sources":["../../../../src/components/app/SequenceEditorApp/SequenceEditorApp.tsx"],"sourcesContent":["import { App } from '@rivm-loculus-tools/common-frontend/components/app/App';\nimport { useEffect } from 'react';\nimport { container } from 'tsyringe';\n\nimport { SequenceEditorMainPage } from '../../../pages/SequenceEditorMainPage';\nimport { EditorWorkerService } from '../../../classes/services/EditorWorkerService';\n\nexport const SequenceEditorApp = () => {\n useEffect(() => {\n const performInitialization = async () => {\n try {\n // initialize here so prefetch works.\n await container.resolve(EditorWorkerService).initialize();\n } catch (error) {\n console.error(error);\n }\n };\n void performInitialization();\n }, []);\n\n return (\n <App>\n <SequenceEditorMainPage />\n </App>\n );\n};\n"],"mappings":";;;;;;;AAOA,IAAaA,WACXC,QAAgB;CASd,aAR0C;EACxC,IAAI;GAEF,MAAMC,EAAU,QAAQC,CAAmB,CAAC,CAAC,WAAW;EAC1D,SAASC,GAAO;GACd,QAAQ,MAAMA,CAAK;EACrB;CACF,EACK,CAAsB;AAC7B,GAAG,CAAC,CAAC,GAGH,kBAACC,GAAD,
|
|
1
|
+
{"version":3,"file":"index.js","names":["SequenceEditorApp","useEffect","container","EditorWorkerService","error","App","SequenceEditorMainPage"],"sources":["../../../../src/components/app/SequenceEditorApp/SequenceEditorApp.tsx"],"sourcesContent":["import { App } from '@rivm-loculus-tools/common-frontend/components/app/App';\nimport { useEffect } from 'react';\nimport { container } from 'tsyringe';\n\nimport { SequenceEditorMainPage } from '../../../pages/SequenceEditorMainPage';\nimport { EditorWorkerService } from '../../../classes/services/EditorWorkerService';\n\nexport const SequenceEditorApp = () => {\n useEffect(() => {\n const performInitialization = async () => {\n try {\n // initialize here so prefetch works.\n await container.resolve(EditorWorkerService).initialize();\n } catch (error) {\n console.error(error);\n }\n };\n void performInitialization();\n }, []);\n\n return (\n <App useAuthentication>\n <SequenceEditorMainPage />\n </App>\n );\n};\n"],"mappings":";;;;;;;AAOA,IAAaA,WACXC,QAAgB;CASd,aAR0C;EACxC,IAAI;GAEF,MAAMC,EAAU,QAAQC,CAAmB,CAAC,CAAC,WAAW;EAC1D,SAASC,GAAO;GACd,QAAQ,MAAMA,CAAK;EACrB;CACF,EACK,CAAsB;AAC7B,GAAG,CAAC,CAAC,GAGH,kBAACC,GAAD;CAAK,mBAAA;CACH,UAAA,kBAACC,GAAD,CAAyB,CAAA;AACtB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SequenceEditorUndoRedoButtons: () => import('react').JSX.Element;
|
|
@@ -1,109 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { t } from "../../../_chunks/react.js";
|
|
3
|
-
import { t as n } from "../../../_chunks/SequenceEditorEventBusService.js";
|
|
4
|
-
import { useCallback as r, useMemo as i } from "react";
|
|
5
|
-
import { CircularProgress as a, IconButton as o, Tooltip as s } from "@mui/material";
|
|
6
|
-
import { container as c } from "tsyringe";
|
|
7
|
-
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
-
import { FastaPageHeaderCenterComponent as f } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaPageHeaderCenterComponent";
|
|
9
|
-
import { FastaPageHeaderImportButton as p } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaPageHeaderImportButton";
|
|
10
|
-
import { FastaPageHeaderResetButton as m } from "@rivm-loculus-tools/common-frontend/components/fasta/FastaPageHeaderResetButton";
|
|
11
|
-
import { PageCommonHeader as h } from "@rivm-loculus-tools/common-frontend/components/ui/PageCommonHeader";
|
|
12
|
-
import g from "@mui/icons-material/Code";
|
|
13
|
-
import _ from "@mui/icons-material/Publish";
|
|
14
|
-
import v from "@mui/icons-material/AutoFixHigh";
|
|
15
|
-
import y from "@mui/icons-material/Undo";
|
|
16
|
-
import b from "@mui/icons-material/Redo";
|
|
17
|
-
import { ButtonWithMenu as x } from "@rivm-loculus-tools/common-frontend/components/ui/ButtonWithMenu";
|
|
18
|
-
import S from "@mui/icons-material/FileDownloadOutlined";
|
|
19
|
-
// src/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.tsx
|
|
20
|
-
var C = () => {
|
|
21
|
-
let C = t(e, (e) => e.isRealigning), w = t(e, (e) => e.resetDataset), T = t(e, (e) => e.meta), E = r(() => {
|
|
22
|
-
w();
|
|
23
|
-
}, [w]), D = r(() => {
|
|
24
|
-
c.resolve(n).emit("onUndo");
|
|
25
|
-
}, []), O = r(() => {
|
|
26
|
-
c.resolve(n).emit("onRedo");
|
|
27
|
-
}, []), k = r(() => {
|
|
28
|
-
C || c.resolve(n).emit("onRealign");
|
|
29
|
-
}, [C]), A = r(() => {
|
|
30
|
-
c.resolve(n).emit("onExportUngappedFasta");
|
|
31
|
-
}, []), j = r(() => {
|
|
32
|
-
c.resolve(n).emit("onExportGappedFasta");
|
|
33
|
-
}, []), M = r(() => {
|
|
34
|
-
alert("Not implemented");
|
|
35
|
-
}, []), N = i(() => [
|
|
36
|
-
{
|
|
37
|
-
icon: /* @__PURE__ */ u(_, { fontSize: "small" }),
|
|
38
|
-
label: "Export to loculus",
|
|
39
|
-
onClick: M
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
icon: /* @__PURE__ */ u(g, { fontSize: "small" }),
|
|
43
|
-
label: "Save as Ungapped Fasta (.fasta)",
|
|
44
|
-
onClick: A
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
icon: /* @__PURE__ */ u(g, { fontSize: "small" }),
|
|
48
|
-
label: "Save as Gapped Fasta (.fasta)",
|
|
49
|
-
onClick: j
|
|
50
|
-
}
|
|
51
|
-
], [
|
|
52
|
-
A,
|
|
53
|
-
j,
|
|
54
|
-
M
|
|
55
|
-
]);
|
|
56
|
-
return /* @__PURE__ */ u(h, {
|
|
57
|
-
centerComponent: /* @__PURE__ */ u(f, { store: e }),
|
|
58
|
-
rightComponent: /* @__PURE__ */ d(l, { children: [
|
|
59
|
-
/* @__PURE__ */ u(s, {
|
|
60
|
-
title: "Undo last action",
|
|
61
|
-
children: /* @__PURE__ */ u(o, {
|
|
62
|
-
color: "inherit",
|
|
63
|
-
disabled: T?.undoDepth === 0,
|
|
64
|
-
onClick: D,
|
|
65
|
-
size: "small",
|
|
66
|
-
sx: { opacity: .85 },
|
|
67
|
-
children: /* @__PURE__ */ u(y, { fontSize: "small" })
|
|
68
|
-
})
|
|
69
|
-
}),
|
|
70
|
-
/* @__PURE__ */ u(s, {
|
|
71
|
-
title: "Redo last action",
|
|
72
|
-
children: /* @__PURE__ */ u(o, {
|
|
73
|
-
color: "inherit",
|
|
74
|
-
disabled: T?.redoDepth === 0,
|
|
75
|
-
onClick: O,
|
|
76
|
-
size: "small",
|
|
77
|
-
sx: { opacity: .85 },
|
|
78
|
-
children: /* @__PURE__ */ u(b, { fontSize: "small" })
|
|
79
|
-
})
|
|
80
|
-
}),
|
|
81
|
-
/* @__PURE__ */ u(s, {
|
|
82
|
-
title: C ? "Re-aligning sequences..." : "Re-align all sequences (MAFFT FFT-NS-1)",
|
|
83
|
-
children: /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(o, {
|
|
84
|
-
"aria-label": C ? "Re-aligning sequences..." : "Re-align all sequences (MAFFT FFT-NS-1)",
|
|
85
|
-
color: "inherit",
|
|
86
|
-
disabled: C || (T?.sequenceCount ?? 0) < 2,
|
|
87
|
-
onClick: k,
|
|
88
|
-
size: "small",
|
|
89
|
-
sx: { opacity: .85 },
|
|
90
|
-
children: C ? /* @__PURE__ */ u(a, {
|
|
91
|
-
color: "inherit",
|
|
92
|
-
size: 18
|
|
93
|
-
}) : /* @__PURE__ */ u(v, { fontSize: "small" })
|
|
94
|
-
}) })
|
|
95
|
-
}),
|
|
96
|
-
/* @__PURE__ */ u(m, { onReset: E }),
|
|
97
|
-
/* @__PURE__ */ u(p, {}),
|
|
98
|
-
/* @__PURE__ */ u(x, {
|
|
99
|
-
items: N,
|
|
100
|
-
label: "Export",
|
|
101
|
-
startIcon: /* @__PURE__ */ u(S, {})
|
|
102
|
-
})
|
|
103
|
-
] }),
|
|
104
|
-
title: "Sequence Editor"
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
export { C as SequenceEditorPageHeader };
|
|
108
|
-
|
|
109
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { t as SequenceEditorPageHeader } from "../../../_chunks/SequenceEditorPageHeader.js";
|
|
@@ -22,9 +22,9 @@ var u = l(({ onActionsChange: l }) => {
|
|
|
22
22
|
display: "flex",
|
|
23
23
|
flexDirection: "column",
|
|
24
24
|
gap: 2,
|
|
25
|
-
maxWidth: 480,
|
|
26
25
|
p: 3,
|
|
27
|
-
textAlign: "center"
|
|
26
|
+
textAlign: "center",
|
|
27
|
+
width: "100%"
|
|
28
28
|
},
|
|
29
29
|
children: [/* @__PURE__ */ s(i, {
|
|
30
30
|
color: "primary",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SequenceEditorEventBusService","SequenceEditorRealignModal","withDialog","onCancelClick","useCallback","useEffect","onActionsChange","Box","CircularProgress","Typography"],"sources":["../../../../src/components/ui/SequenceEditorRealignModal/SequenceEditorRealignModal.tsx"],"sourcesContent":["import {\n Box,\n CircularProgress,\n Typography,\n} from '@mui/material';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n} from 'react';\nimport { container } from 'tsyringe';\n\nimport { SequenceEditorEventBusService } from '../../../classes/services/SequenceEditorEventBusService';\n\nexport interface SequenceEditorRealignModalOpenProps {\n //\n}\n\nexport interface SequenceEditorRealignModalProps extends WithDialogRenderProps<SequenceEditorRealignModalOpenProps> {\n //\n}\n\nexport type SequenceEditorRealignModalRefMethods = WithDialogRefMethods<SequenceEditorRealignModalProps, SequenceEditorRealignModalOpenProps>;\n\nexport const SequenceEditorRealignModal = withDialog<SequenceEditorRealignModalProps, SequenceEditorRealignModalOpenProps>((\n {\n onActionsChange,\n }: SequenceEditorRealignModalProps,\n): ReactElement => {\n const onCancelClick = useCallback(() => {\n container.resolve(SequenceEditorEventBusService).emit('onCancelRealign');\n }, []);\n\n useEffect(() => {\n const actions: DialogAction[] = [\n {\n color: 'primary',\n label: 'Cancel',\n onClick: onCancelClick,\n variant: 'outlined',\n },\n ];\n onActionsChange?.(actions);\n }, [onActionsChange, onCancelClick]);\n\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["SequenceEditorEventBusService","SequenceEditorRealignModal","withDialog","onCancelClick","useCallback","useEffect","onActionsChange","Box","CircularProgress","Typography"],"sources":["../../../../src/components/ui/SequenceEditorRealignModal/SequenceEditorRealignModal.tsx"],"sourcesContent":["import {\n Box,\n CircularProgress,\n Typography,\n} from '@mui/material';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n} from 'react';\nimport { container } from 'tsyringe';\n\nimport { SequenceEditorEventBusService } from '../../../classes/services/SequenceEditorEventBusService';\n\nexport interface SequenceEditorRealignModalOpenProps {\n //\n}\n\nexport interface SequenceEditorRealignModalProps extends WithDialogRenderProps<SequenceEditorRealignModalOpenProps> {\n //\n}\n\nexport type SequenceEditorRealignModalRefMethods = WithDialogRefMethods<SequenceEditorRealignModalProps, SequenceEditorRealignModalOpenProps>;\n\nexport const SequenceEditorRealignModal = withDialog<SequenceEditorRealignModalProps, SequenceEditorRealignModalOpenProps>((\n {\n onActionsChange,\n }: SequenceEditorRealignModalProps,\n): ReactElement => {\n const onCancelClick = useCallback(() => {\n container.resolve(SequenceEditorEventBusService).emit('onCancelRealign');\n }, []);\n\n useEffect(() => {\n const actions: DialogAction[] = [\n {\n color: 'primary',\n label: 'Cancel',\n onClick: onCancelClick,\n variant: 'outlined',\n },\n ];\n onActionsChange?.(actions);\n }, [onActionsChange, onCancelClick]);\n\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n p: 3,\n textAlign: 'center',\n width: '100%',\n }}\n >\n <CircularProgress\n color={'primary'}\n size={36}\n />\n <Typography\n color={'text.secondary'}\n variant={'body2'}\n >\n {'Sequence (re-)alignment in progress using MAFFT (progressive alignment with FFT-NS-1). This may take a while depending on the amount of sequences.'}\n </Typography>\n </Box>\n );\n\n}, {\n defaultTitle: 'Sequence Re-alignment',\n disableBackdropClick: true,\n fullWidth: true,\n maxWidth: 'sm',\n noCloseButton: true,\n noPadding: true,\n testId: 'SequenceEditorRealignModal',\n});\n"],"mappings":";;;;;;;AA8BA,IAAaC,IAA6BC,GACxC,EACE,yBAEe;CACjB,IAAMC,IAAgBC,QAAkB;EACtC,EAAU,QAAQJ,CAA6B,CAAC,CAAC,KAAK,iBAAiB;CACzE,GAAG,CAAC,CAAC;CAcL,OAZAK,QAAgB;EASd,IAAkB,CAPhB;GACE,OAAO;GACP,OAAO;GACP,SAASF;GACT,SAAS;EACX,CAEgB,CAAO;CAC3B,GAAG,CAACG,GAAiBH,CAAa,CAAC,GAGjC,kBAACI,GAAD;EACE,IAAI;GACF,YAAY;GACZ,SAAS;GACT,eAAe;GACf,KAAK;GACL,GAAG;GACH,WAAW;GACX,OAAO;EACT;EATF,UAAA,CAWE,kBAACC,GAAD;GACE,OAAO;GACP,MAAM;EACP,CAAA,GACD,kBAACC,GAAD;GACE,OAAO;GACP,SAAS;GAER,UAAA;EACS,CAAA,CACT;;AAGT,GAAG;CACD,cAAc;CACd,sBAAsB;CACtB,WAAW;CACX,UAAU;CACV,eAAe;CACf,WAAW;CACX,QAAQ;AACV,CAAC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DEFAULT_GRID_GEOMETRY as
|
|
3
|
-
import { KEYBOARD_SHORTCUTS as
|
|
4
|
-
|
|
1
|
+
import { PALETTE_SCHEMA_ASSET_PATH as e, PALETTE_SCHEMA_URL_PATH as t } from "./paletteSchemaData.js";
|
|
2
|
+
import { DEFAULT_GRID_GEOMETRY as n, IUPAC_KEYS as r, MIN_LABEL_WIDTH as i } from "./editor.js";
|
|
3
|
+
import { KEYBOARD_SHORTCUTS as a } from "./keyboard.js";
|
|
4
|
+
import { ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE as o, ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE_COLORS as s, ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE as c, ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS as l, ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE as u, ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS as d, ALI_VIEW_FAST_NUCLEOTIDE_PALETTE as f, ALI_VIEW_FAST_NUCLEOTIDE_PALETTE_COLORS as p, ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE as m, ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE_COLORS as h, ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE as g, ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE_COLORS as _, AMINO_ACID_SYMBOLS as v, AMINO_ACID_SYMBOL_LABELS as y, NUCLEOTIDE_SYMBOLS as b, NUCLEOTIDE_SYMBOL_LABELS as x } from "./palette.js";
|
|
5
|
+
export { o as ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE, s as ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE_COLORS, c as ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE, l as ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS, u as ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE, d as ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS, f as ALI_VIEW_FAST_NUCLEOTIDE_PALETTE, p as ALI_VIEW_FAST_NUCLEOTIDE_PALETTE_COLORS, m as ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE, h as ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE_COLORS, g as ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE, _ as ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE_COLORS, v as AMINO_ACID_SYMBOLS, y as AMINO_ACID_SYMBOL_LABELS, n as DEFAULT_GRID_GEOMETRY, r as IUPAC_KEYS, a as KEYBOARD_SHORTCUTS, i as MIN_LABEL_WIDTH, b as NUCLEOTIDE_SYMBOLS, x as NUCLEOTIDE_SYMBOL_LABELS, e as PALETTE_SCHEMA_ASSET_PATH, t as PALETTE_SCHEMA_URL_PATH };
|
|
@@ -74,7 +74,7 @@ var r = (t, r) => (i) => {
|
|
|
74
74
|
description: "Move cell left",
|
|
75
75
|
shortcut: {
|
|
76
76
|
code: "ArrowLeft",
|
|
77
|
-
modifiers: [["
|
|
77
|
+
modifiers: [["Control"], ["Meta"]]
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
moveCellRight: {
|
|
@@ -82,7 +82,7 @@ var r = (t, r) => (i) => {
|
|
|
82
82
|
description: "Move cell right",
|
|
83
83
|
shortcut: {
|
|
84
84
|
code: "ArrowRight",
|
|
85
|
-
modifiers: [["
|
|
85
|
+
modifiers: [["Control"], ["Meta"]]
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
moveRowDown: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.js","names":["SequenceEditorEventBusService","emitDirection","event","container","eventName","direction","emitVoid","emitMutateSelection","base","KEYBOARD_SHORTCUTS","EDITOR_DIRECTION"],"sources":["../../src/constants/keyboard.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport type { KeyboardShortcutConfig } from '@gen-epix/ui-core/classes/services/KeyboardShortcutService';\n\nimport { SequenceEditorEventBusService } from '../classes/services/SequenceEditorEventBusService';\nimport { EDITOR_DIRECTION } from '../models/editor.models';\n\n\ntype KeyboardShortcut = {\n callback: KeyboardShortcutConfig['callback'];\n description: string;\n shortcut: Pick<KeyboardShortcutConfig, 'code' | 'key' | 'modifiers'>;\n};\n\nconst emitDirection = (eventName: 'onExpandSelection' | 'onMoveCells' | 'onMoveRows' | 'onMoveRowsEnd' | 'onMoveSelection', direction: EDITOR_DIRECTION): KeyboardShortcutConfig['callback'] => (event) => {\n event.preventDefault();\n container.resolve(SequenceEditorEventBusService).emit(eventName, direction);\n};\n\nconst emitVoid = (eventName: 'onDeleteBackward' | 'onGotoPosition' | 'onInsert' | 'onRedo' | 'onScrollPageDown' | 'onScrollPageUp' | 'onScrollToLineEnd' | 'onScrollToLineStart' | 'onUndo'): KeyboardShortcutConfig['callback'] => (event) => {\n event.preventDefault();\n container.resolve(SequenceEditorEventBusService).emit(eventName);\n};\n\nconst emitMutateSelection = (base: string): KeyboardShortcutConfig['callback'] => (event) => {\n event.preventDefault();\n container.resolve(SequenceEditorEventBusService).emit('onMutateSelection', base);\n};\n\nexport const KEYBOARD_SHORTCUTS: { [key: string]: KeyboardShortcut } = {\n deleteBackward: {\n callback: emitVoid('onDeleteBackward'),\n description: 'Delete backward',\n shortcut: { code: 'Backspace' },\n },\n deleteBase: {\n callback: emitMutateSelection('-'),\n description: 'Delete base',\n shortcut: { key: '-' },\n },\n deleteSelection: {\n callback: emitMutateSelection('-'),\n description: 'Delete selection',\n shortcut: { code: 'Delete' },\n },\n expandSelectionDown: {\n callback: emitDirection('onExpandSelection', EDITOR_DIRECTION.DOWN),\n description: 'Expand selection down',\n shortcut: { code: 'ArrowDown', modifiers: [['Shift']] },\n },\n expandSelectionLeft: {\n callback: emitDirection('onExpandSelection', EDITOR_DIRECTION.LEFT),\n description: 'Expand selection left',\n shortcut: { code: 'ArrowLeft', modifiers: [['Shift']] },\n },\n expandSelectionRight: {\n callback: emitDirection('onExpandSelection', EDITOR_DIRECTION.RIGHT),\n description: 'Expand selection right',\n shortcut: { code: 'ArrowRight', modifiers: [['Shift']] },\n },\n expandSelectionUp: {\n callback: emitDirection('onExpandSelection', EDITOR_DIRECTION.UP),\n description: 'Expand selection up',\n shortcut: { code: 'ArrowUp', modifiers: [['Shift']] },\n },\n gotoPosition: {\n callback: emitVoid('onGotoPosition'),\n description: 'Go to position',\n shortcut: { key: 'g', modifiers: [['Meta'], ['Control']] },\n },\n insertGap: {\n callback: emitVoid('onInsert'),\n description: 'Insert gap',\n shortcut: { code: 'Space' },\n },\n moveCellLeft: {\n callback: emitDirection('onMoveCells', EDITOR_DIRECTION.LEFT),\n description: 'Move cell left',\n shortcut: { code: 'ArrowLeft', modifiers: [['
|
|
1
|
+
{"version":3,"file":"keyboard.js","names":["SequenceEditorEventBusService","emitDirection","event","container","eventName","direction","emitVoid","emitMutateSelection","base","KEYBOARD_SHORTCUTS","EDITOR_DIRECTION"],"sources":["../../src/constants/keyboard.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport type { KeyboardShortcutConfig } from '@gen-epix/ui-core/classes/services/KeyboardShortcutService';\n\nimport { SequenceEditorEventBusService } from '../classes/services/SequenceEditorEventBusService';\nimport { EDITOR_DIRECTION } from '../models/editor.models';\n\n\ntype KeyboardShortcut = {\n callback: KeyboardShortcutConfig['callback'];\n description: string;\n shortcut: Pick<KeyboardShortcutConfig, 'code' | 'key' | 'modifiers'>;\n};\n\nconst emitDirection = (eventName: 'onExpandSelection' | 'onMoveCells' | 'onMoveRows' | 'onMoveRowsEnd' | 'onMoveSelection', direction: EDITOR_DIRECTION): KeyboardShortcutConfig['callback'] => (event) => {\n event.preventDefault();\n container.resolve(SequenceEditorEventBusService).emit(eventName, direction);\n};\n\nconst emitVoid = (eventName: 'onDeleteBackward' | 'onGotoPosition' | 'onInsert' | 'onRedo' | 'onScrollPageDown' | 'onScrollPageUp' | 'onScrollToLineEnd' | 'onScrollToLineStart' | 'onUndo'): KeyboardShortcutConfig['callback'] => (event) => {\n event.preventDefault();\n container.resolve(SequenceEditorEventBusService).emit(eventName);\n};\n\nconst emitMutateSelection = (base: string): KeyboardShortcutConfig['callback'] => (event) => {\n event.preventDefault();\n container.resolve(SequenceEditorEventBusService).emit('onMutateSelection', base);\n};\n\nexport const KEYBOARD_SHORTCUTS: { [key: string]: KeyboardShortcut } = {\n deleteBackward: {\n callback: emitVoid('onDeleteBackward'),\n description: 'Delete backward',\n shortcut: { code: 'Backspace' },\n },\n deleteBase: {\n callback: emitMutateSelection('-'),\n description: 'Delete base',\n shortcut: { key: '-' },\n },\n deleteSelection: {\n callback: emitMutateSelection('-'),\n description: 'Delete selection',\n shortcut: { code: 'Delete' },\n },\n expandSelectionDown: {\n callback: emitDirection('onExpandSelection', EDITOR_DIRECTION.DOWN),\n description: 'Expand selection down',\n shortcut: { code: 'ArrowDown', modifiers: [['Shift']] },\n },\n expandSelectionLeft: {\n callback: emitDirection('onExpandSelection', EDITOR_DIRECTION.LEFT),\n description: 'Expand selection left',\n shortcut: { code: 'ArrowLeft', modifiers: [['Shift']] },\n },\n expandSelectionRight: {\n callback: emitDirection('onExpandSelection', EDITOR_DIRECTION.RIGHT),\n description: 'Expand selection right',\n shortcut: { code: 'ArrowRight', modifiers: [['Shift']] },\n },\n expandSelectionUp: {\n callback: emitDirection('onExpandSelection', EDITOR_DIRECTION.UP),\n description: 'Expand selection up',\n shortcut: { code: 'ArrowUp', modifiers: [['Shift']] },\n },\n gotoPosition: {\n callback: emitVoid('onGotoPosition'),\n description: 'Go to position',\n shortcut: { key: 'g', modifiers: [['Meta'], ['Control']] },\n },\n insertGap: {\n callback: emitVoid('onInsert'),\n description: 'Insert gap',\n shortcut: { code: 'Space' },\n },\n moveCellLeft: {\n callback: emitDirection('onMoveCells', EDITOR_DIRECTION.LEFT),\n description: 'Move cell left',\n shortcut: { code: 'ArrowLeft', modifiers: [['Control'], ['Meta']] },\n },\n moveCellRight: {\n callback: emitDirection('onMoveCells', EDITOR_DIRECTION.RIGHT),\n description: 'Move cell right',\n shortcut: { code: 'ArrowRight', modifiers: [['Control'], ['Meta']] },\n },\n moveRowDown: {\n callback: emitDirection('onMoveRows', EDITOR_DIRECTION.DOWN),\n description: 'Move row down',\n shortcut: { code: 'ArrowDown', modifiers: [['Control'], ['Meta']] },\n },\n moveRowToEnd: {\n callback: emitDirection('onMoveRowsEnd', EDITOR_DIRECTION.DOWN),\n description: 'Move row to end',\n shortcut: { code: 'ArrowDown', modifiers: [['Alt']] },\n },\n moveRowToStart: {\n callback: emitDirection('onMoveRowsEnd', EDITOR_DIRECTION.UP),\n description: 'Move row to start',\n shortcut: { code: 'ArrowUp', modifiers: [['Alt']] },\n },\n moveRowUp: {\n callback: emitDirection('onMoveRows', EDITOR_DIRECTION.UP),\n description: 'Move row up',\n shortcut: { code: 'ArrowUp', modifiers: [['Control'], ['Meta']] },\n },\n moveSelectionDown: {\n callback: emitDirection('onMoveSelection', EDITOR_DIRECTION.DOWN),\n description: 'Move selection down',\n shortcut: { code: 'ArrowDown' },\n },\n moveSelectionLeft: {\n callback: emitDirection('onMoveSelection', EDITOR_DIRECTION.LEFT),\n description: 'Move selection left',\n shortcut: { code: 'ArrowLeft' },\n },\n moveSelectionRight: {\n callback: emitDirection('onMoveSelection', EDITOR_DIRECTION.RIGHT),\n description: 'Move selection right',\n shortcut: { code: 'ArrowRight' },\n },\n moveSelectionUp: {\n callback: emitDirection('onMoveSelection', EDITOR_DIRECTION.UP),\n description: 'Move selection up',\n shortcut: { code: 'ArrowUp' },\n },\n redo: {\n callback: emitVoid('onRedo'),\n description: 'Redo',\n shortcut: { key: 'z', modifiers: [['Meta', 'Shift'], ['Control', 'Shift']] },\n },\n scrollPageDown: {\n callback: emitVoid('onScrollPageDown'),\n description: 'Scroll page down',\n shortcut: { code: 'PageDown' },\n },\n scrollPageUp: {\n callback: emitVoid('onScrollPageUp'),\n description: 'Scroll page up',\n shortcut: { code: 'PageUp' },\n },\n scrollToLineEnd: {\n callback: emitVoid('onScrollToLineEnd'),\n description: 'Scroll to line end',\n shortcut: { code: 'End' },\n },\n scrollToLineStart: {\n callback: emitVoid('onScrollToLineStart'),\n description: 'Scroll to line start',\n shortcut: { code: 'Home' },\n },\n undo: {\n callback: emitVoid('onUndo'),\n description: 'Undo',\n shortcut: { key: 'z', modifiers: [['Meta'], ['Control']] },\n },\n};\n"],"mappings":";;;;AAaA,IAAMC,KAAiB,GAAqG,OAAqE,MAAU;CAEzM,AADAC,EAAM,eAAe,GACrBC,EAAU,QAAQH,CAA6B,CAAC,CAAC,KAAKI,GAAWC,CAAS;AAC5E,GAEMC,KAAY,OAAmN,MAAU;CAE7O,AADAJ,EAAM,eAAe,GACrBC,EAAU,QAAQH,CAA6B,CAAC,CAAC,KAAKI,CAAS;AACjE,GAEMG,KAAuB,OAAsD,MAAU;CAE3F,AADAL,EAAM,eAAe,GACrBC,EAAU,QAAQH,CAA6B,CAAC,CAAC,KAAK,qBAAqBQ,CAAI;AACjF,GAEaC,IAA0D;CACrE,gBAAgB;EACd,UAAUH,EAAS,kBAAkB;EACrC,aAAa;EACb,UAAU,EAAE,MAAM,YAAY;CAChC;CACA,YAAY;EACV,UAAUC,EAAoB,GAAG;EACjC,aAAa;EACb,UAAU,EAAE,KAAK,IAAI;CACvB;CACA,iBAAiB;EACf,UAAUA,EAAoB,GAAG;EACjC,aAAa;EACb,UAAU,EAAE,MAAM,SAAS;CAC7B;CACA,qBAAqB;EACnB,UAAUN,EAAc,qBAAqBS,EAAiB,IAAI;EAClE,aAAa;EACb,UAAU;GAAE,MAAM;GAAa,WAAW,CAAC,CAAC,OAAO,CAAC;EAAE;CACxD;CACA,qBAAqB;EACnB,UAAUT,EAAc,qBAAqBS,EAAiB,IAAI;EAClE,aAAa;EACb,UAAU;GAAE,MAAM;GAAa,WAAW,CAAC,CAAC,OAAO,CAAC;EAAE;CACxD;CACA,sBAAsB;EACpB,UAAU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
import { AminoAcidSymbol, NucleotideSymbol, AminoAcidPalette, AminoAcidPaletteColors, NucleotidePalette, NucleotidePaletteColors } from '../models/palette.models';
|
|
2
|
-
export
|
|
3
|
-
export declare const PALETTE_SCHEMA_URL_PATH = "/assets/palette.schema.json";
|
|
2
|
+
export { PALETTE_SCHEMA_ASSET_PATH, PALETTE_SCHEMA_URL_PATH, } from './paletteSchemaData';
|
|
4
3
|
export declare const NUCLEOTIDE_SYMBOLS: readonly NucleotideSymbol[];
|
|
5
4
|
export declare const NUCLEOTIDE_SYMBOL_LABELS: Readonly<Record<NucleotideSymbol, string>>;
|
|
6
5
|
export declare const AMINO_ACID_SYMBOLS: readonly AminoAcidSymbol[];
|