@rivm-loculus-tools/sequence-editor 0.1.3 → 0.1.5
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/Box.js +6737 -0
- package/dist/_chunks/Box.js.map +1 -0
- package/dist/_chunks/Close.js +7 -0
- package/dist/_chunks/Close.js.map +1 -0
- package/dist/_chunks/EditorWorkerService.js +126 -0
- package/dist/_chunks/EditorWorkerService.js.map +1 -0
- package/dist/_chunks/KeyboardArrowDown.js +1023 -0
- package/dist/_chunks/KeyboardArrowDown.js.map +1 -0
- package/dist/_chunks/Redo.js +2559 -0
- package/dist/_chunks/Redo.js.map +1 -0
- package/dist/_chunks/SequenceEditor.js +860 -0
- package/dist/_chunks/SequenceEditor.js.map +1 -0
- package/dist/_chunks/SequenceEditorEventBusService.js +102 -0
- package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -0
- package/dist/_chunks/SequenceEditorMainPage.js +552 -0
- package/dist/_chunks/SequenceEditorMainPage.js.map +1 -0
- package/dist/_chunks/SequenceEditorPageDrawer.js +49842 -0
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -0
- package/dist/_chunks/SequenceEditorPageHeader.js +236 -0
- package/dist/_chunks/SequenceEditorPageHeader.js.map +1 -0
- package/dist/_chunks/SequenceEditorSearchBar.js +143 -0
- package/dist/_chunks/SequenceEditorSearchBar.js.map +1 -0
- package/dist/_chunks/TestIdUtil.js +4695 -0
- package/dist/_chunks/TestIdUtil.js.map +1 -0
- package/dist/_chunks/TextField.js +3083 -0
- package/dist/_chunks/TextField.js.map +1 -0
- package/dist/_chunks/rolldown-runtime.js +13 -0
- package/dist/_chunks/sequenceEditorStore.js +407 -0
- package/dist/_chunks/sequenceEditorStore.js.map +1 -0
- package/dist/_chunks/sequence_editor.js +517 -0
- package/dist/_chunks/sequence_editor.js.map +1 -0
- package/dist/_chunks/withDialog.js +289 -0
- package/dist/_chunks/withDialog.js.map +1 -0
- package/dist/assets/index-C5rc-pJV.js +8 -0
- package/dist/assets/index-C5rc-pJV.js.map +1 -0
- package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +27 -0
- package/dist/classes/services/EditorWorkerService/index.js +2 -0
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +25 -0
- package/dist/classes/services/SequenceEditorEventBusService/index.js +2 -0
- package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +46 -0
- package/dist/classes/workers/EngineWorker/index.js +110 -0
- package/dist/classes/workers/EngineWorker/index.js.map +1 -0
- package/dist/components/app/App/App.d.ts +1 -0
- package/dist/components/app/App/index.js +957 -0
- package/dist/components/app/App/index.js.map +1 -0
- package/dist/components/pages/EmptyWorkspace.d.ts +3 -0
- package/dist/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.d.ts +3 -0
- package/dist/components/pages/SequenceEditorErrorPage/index.js +12 -0
- package/dist/components/pages/SequenceEditorErrorPage/index.js.map +1 -0
- package/dist/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.d.ts +1 -0
- package/dist/components/pages/SequenceEditorMainPage/index.js +2 -0
- package/dist/components/ui/SequenceEditor/SequenceEditor.d.ts +1 -0
- package/dist/components/ui/SequenceEditor/SequenceEditorGotoPositionDialog.d.ts +8 -0
- package/dist/components/ui/SequenceEditor/SequenceEditorStatusBar.d.ts +1 -0
- package/dist/components/ui/SequenceEditor/index.js +2 -0
- package/dist/components/ui/SequenceEditorPage/SequenceEditorPage.d.ts +5 -0
- package/dist/components/ui/SequenceEditorPage/index.js +15 -0
- package/dist/components/ui/SequenceEditorPage/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawer.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.d.ts +7 -0
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageDrawer/index.js +2 -0
- package/dist/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageHeader/index.js +2 -0
- package/dist/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.d.ts +1 -0
- package/dist/components/ui/SequenceEditorSearchBar/index.js +2 -0
- package/dist/constants/editor.d.ts +4 -0
- package/dist/constants/editor.js +14 -0
- package/dist/constants/editor.js.map +1 -0
- package/dist/constants/index.js +4 -0
- package/dist/constants/keyboard.d.ts +10 -0
- package/dist/constants/keyboard.js +179 -0
- package/dist/constants/keyboard.js.map +1 -0
- package/dist/constants/palette.d.ts +15 -0
- package/dist/constants/palette.js +196 -0
- package/dist/constants/palette.js.map +1 -0
- package/dist/models/editor.d.ts +6 -0
- package/dist/models/editor.js +8 -0
- package/dist/models/editor.js.map +1 -0
- package/dist/models/model.d.ts +250 -0
- package/dist/models/model.js +10 -0
- package/dist/models/model.js.map +1 -0
- package/dist/models/palette.d.ts +61 -0
- package/dist/models/palette.js +10 -0
- package/dist/models/palette.js.map +1 -0
- package/dist/stores/sequenceEditorStore/index.js +2 -0
- package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +36 -0
- package/dist/utils/EditorUtil/EditorUtil.d.ts +96 -0
- package/dist/utils/EditorUtil/index.js +544 -0
- package/dist/utils/EditorUtil/index.js.map +1 -0
- package/dist/utils/EngineErrorUtil/EngineErrorUtil.d.ts +4 -0
- package/dist/utils/PaletteUtil/PaletteUtil.d.ts +6 -0
- package/dist/utils/PaletteUtil/index.js +19 -0
- package/dist/utils/PaletteUtil/index.js.map +1 -0
- package/package.json +6 -3
- package/.gitkeep +0 -0
- package/CHANGELOG.md +0 -30
- package/eslint.config.js +0 -16
- package/scripts/update-exports.js +0 -9
- package/src/classes/services/EditorWorkerService/EditorWorkerService.ts +0 -163
- package/src/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.ts +0 -37
- package/src/classes/workers/EngineWorker/EngineWorker.ts +0 -196
- package/src/components/app/App/App.tsx +0 -22
- package/src/components/pages/EmptyWorkspace.tsx +0 -43
- package/src/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.tsx +0 -16
- package/src/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.tsx +0 -76
- package/src/components/ui/SequenceEditor/SequenceEditor.tsx +0 -896
- package/src/components/ui/SequenceEditor/SequenceEditorGotoPositionDialog.tsx +0 -108
- package/src/components/ui/SequenceEditor/SequenceEditorStatusBar.tsx +0 -72
- package/src/components/ui/SequenceEditorPage/SequenceEditorPage.tsx +0 -23
- package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawer.tsx +0 -234
- package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.tsx +0 -73
- package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.tsx +0 -230
- package/src/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.tsx +0 -71
- package/src/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.tsx +0 -35
- package/src/constants/editor.ts +0 -15
- package/src/constants/keyboard.ts +0 -154
- package/src/constants/palette.ts +0 -227
- package/src/models/editor.ts +0 -6
- package/src/models/model.ts +0 -295
- package/src/models/palette.ts +0 -68
- package/src/stores/sequenceEditorStore/sequenceEditorStore.ts +0 -103
- package/src/utils/EditorUtil/EditorUtil.ts +0 -892
- package/src/utils/EngineErrorUtil/EngineErrorUtil.ts +0 -25
- package/src/utils/PaletteUtil/PaletteUtil.ts +0 -31
- package/tsconfig.build.json +0 -14
- package/tsconfig.json +0 -32
- package/vite.config.ts +0 -177
- /package/{src/classes/services/EditorWorkerService/index.ts → dist/classes/services/EditorWorkerService/index.d.ts} +0 -0
- /package/{src/classes/services/SequenceEditorEventBusService/index.ts → dist/classes/services/SequenceEditorEventBusService/index.d.ts} +0 -0
- /package/{src/classes/workers/EngineWorker/index.ts → dist/classes/workers/EngineWorker/index.d.ts} +0 -0
- /package/{src/components/app/App/index.ts → dist/components/app/App/index.d.ts} +0 -0
- /package/{src/components/pages/SequenceEditorErrorPage/index.ts → dist/components/pages/SequenceEditorErrorPage/index.d.ts} +0 -0
- /package/{src/components/pages/SequenceEditorMainPage/index.ts → dist/components/pages/SequenceEditorMainPage/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditor/index.ts → dist/components/ui/SequenceEditor/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorPage/index.ts → dist/components/ui/SequenceEditorPage/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorPageDrawer/index.ts → dist/components/ui/SequenceEditorPageDrawer/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorPageHeader/index.ts → dist/components/ui/SequenceEditorPageHeader/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorSearchBar/index.ts → dist/components/ui/SequenceEditorSearchBar/index.d.ts} +0 -0
- /package/{src/constants/index.ts → dist/constants/index.d.ts} +0 -0
- /package/{src/models/index.ts → dist/models/index.d.ts} +0 -0
- /package/{src/stores/sequenceEditorStore/index.ts → dist/stores/sequenceEditorStore/index.d.ts} +0 -0
- /package/{src/utils/EditorUtil/index.ts → dist/utils/EditorUtil/index.d.ts} +0 -0
- /package/{src/utils/PaletteUtil/index.ts → dist/utils/PaletteUtil/index.d.ts} +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime.js";
|
|
2
|
+
import { n as t, r as n, t as r } from "./SequenceEditorEventBusService.js";
|
|
3
|
+
import { t as i } from "./sequenceEditorStore.js";
|
|
4
|
+
import { Dt as a, It as o, Lt as s, M as c, Ot as l, Q as u, dt as d, ft as f, g as p, i as m, j as h, k as g, n as _, t as v, ut as y } from "./Box.js";
|
|
5
|
+
import { b, i as x, s as S, t as C } from "./TestIdUtil.js";
|
|
6
|
+
import { l as w, n as T, r as E, t as D, u as O } from "./Redo.js";
|
|
7
|
+
import { t as k } from "./withDialog.js";
|
|
8
|
+
//#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/DialogContentText/dialogContentTextClasses.mjs
|
|
9
|
+
var A = /* @__PURE__ */ e(s(), 1), j = /* @__PURE__ */ e(l(), 1);
|
|
10
|
+
function M(e) {
|
|
11
|
+
return d("MuiDialogContentText", e);
|
|
12
|
+
}
|
|
13
|
+
y("MuiDialogContentText", ["root"]);
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/DialogContentText/DialogContentText.mjs
|
|
16
|
+
var N = a(), P = (e) => {
|
|
17
|
+
let { classes: t } = e, n = u({ root: ["root"] }, M, t);
|
|
18
|
+
return {
|
|
19
|
+
...t,
|
|
20
|
+
...n
|
|
21
|
+
};
|
|
22
|
+
}, F = h(_, {
|
|
23
|
+
shouldForwardProp: (e) => c(e) || e === "classes",
|
|
24
|
+
name: "MuiDialogContentText",
|
|
25
|
+
slot: "Root"
|
|
26
|
+
})({}), I = /*#__PURE__*/ A.forwardRef(function(e, t) {
|
|
27
|
+
let n = g({
|
|
28
|
+
props: e,
|
|
29
|
+
name: "MuiDialogContentText"
|
|
30
|
+
}), { children: r, className: i, ...a } = n, o = P(a);
|
|
31
|
+
return /*#__PURE__*/ (0, N.jsx)(F, {
|
|
32
|
+
component: "p",
|
|
33
|
+
variant: "body1",
|
|
34
|
+
color: "textSecondary",
|
|
35
|
+
ref: t,
|
|
36
|
+
ownerState: a,
|
|
37
|
+
className: f(o.root, i),
|
|
38
|
+
...n,
|
|
39
|
+
classes: o
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
process.env.NODE_ENV !== "production" && (I.propTypes = {
|
|
43
|
+
children: j.default.node,
|
|
44
|
+
classes: j.default.object,
|
|
45
|
+
className: j.default.string,
|
|
46
|
+
sx: j.default.oneOfType([
|
|
47
|
+
j.default.arrayOf(j.default.oneOfType([
|
|
48
|
+
j.default.func,
|
|
49
|
+
j.default.object,
|
|
50
|
+
j.default.bool
|
|
51
|
+
])),
|
|
52
|
+
j.default.func,
|
|
53
|
+
j.default.object
|
|
54
|
+
])
|
|
55
|
+
});
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region ../../../common/frontend/src/components/FastaPageHeaderCenterComponent/FastaPageHeaderCenterComponent.tsx
|
|
58
|
+
var L = ({ store: e }) => {
|
|
59
|
+
let t = o(e, (e) => e.parsedFasta), n = o(e, (e) => e.parsedMetadata), r = t?.sequences?.length || 0, i = n?.records?.length || 0;
|
|
60
|
+
return /* @__PURE__ */ (0, N.jsxs)(v, {
|
|
61
|
+
sx: {
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
display: "flex",
|
|
64
|
+
gap: 1
|
|
65
|
+
},
|
|
66
|
+
children: [r > 0 && /* @__PURE__ */ (0, N.jsx)(O, {
|
|
67
|
+
label: `${r} Sequences`,
|
|
68
|
+
size: "small",
|
|
69
|
+
sx: {
|
|
70
|
+
backgroundColor: "rgba(255, 255, 255, 0.2)",
|
|
71
|
+
color: "#FFFFFF",
|
|
72
|
+
fontSize: "0.75rem",
|
|
73
|
+
fontWeight: 600
|
|
74
|
+
}
|
|
75
|
+
}), i > 0 && /* @__PURE__ */ (0, N.jsx)(O, {
|
|
76
|
+
label: `${i} Metadata Records`,
|
|
77
|
+
size: "small",
|
|
78
|
+
sx: {
|
|
79
|
+
backgroundColor: "rgba(255, 255, 255, 0.2)",
|
|
80
|
+
color: "#FFFFFF",
|
|
81
|
+
fontSize: "0.75rem",
|
|
82
|
+
fontWeight: 600
|
|
83
|
+
}
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
86
|
+
}, R = p(/*#__PURE__*/ (0, N.jsx)("path", { d: "M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z" }), "FileUploadOutlined"), z = class e extends n {
|
|
87
|
+
static __instance;
|
|
88
|
+
constructor() {
|
|
89
|
+
super();
|
|
90
|
+
}
|
|
91
|
+
static getInstance() {
|
|
92
|
+
return e.__instance = t.getHmrSingleton("fastaDataEventBusService", e.__instance, () => new e()), e.__instance;
|
|
93
|
+
}
|
|
94
|
+
}, B = () => {
|
|
95
|
+
let e = (0, A.useCallback)(() => z.getInstance().emit("onShowImportDialog"), []);
|
|
96
|
+
return /* @__PURE__ */ (0, N.jsx)(b, {
|
|
97
|
+
color: "inherit",
|
|
98
|
+
onClick: e,
|
|
99
|
+
size: "small",
|
|
100
|
+
startIcon: /* @__PURE__ */ (0, N.jsx)(R, {}),
|
|
101
|
+
sx: {
|
|
102
|
+
"&:hover": { backgroundColor: "rgba(255, 255, 255, 0.25)" },
|
|
103
|
+
backgroundColor: "rgba(255, 255, 255, 0.15)",
|
|
104
|
+
color: "#FFFFFF"
|
|
105
|
+
},
|
|
106
|
+
variant: "contained",
|
|
107
|
+
children: "Import Data"
|
|
108
|
+
});
|
|
109
|
+
}, V = p(/*#__PURE__*/ (0, N.jsx)("path", { d: "M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91" }), "RestartAlt"), H = k(({ body: e, cancelLabel: t, confirmLabel: n, onActionsChange: r, onCancel: i, onClose: a, onConfirm: o, openProps: s }) => {
|
|
110
|
+
let { t: c } = x(), l = (0, A.useCallback)(() => {
|
|
111
|
+
i && i(s), a();
|
|
112
|
+
}, [
|
|
113
|
+
i,
|
|
114
|
+
a,
|
|
115
|
+
s
|
|
116
|
+
]), u = (0, A.useCallback)(() => {
|
|
117
|
+
o(s), a();
|
|
118
|
+
}, [
|
|
119
|
+
o,
|
|
120
|
+
s,
|
|
121
|
+
a
|
|
122
|
+
]);
|
|
123
|
+
return (0, A.useEffect)(() => {
|
|
124
|
+
let e = [];
|
|
125
|
+
t && e.push({
|
|
126
|
+
...C.createAttributes("Confirmation-cancelButton"),
|
|
127
|
+
color: "primary",
|
|
128
|
+
label: t ?? c`Cancel`,
|
|
129
|
+
onClick: l,
|
|
130
|
+
variant: "outlined"
|
|
131
|
+
}), e.push({
|
|
132
|
+
...C.createAttributes("Confirmation-confirmButton"),
|
|
133
|
+
autoFocus: !0,
|
|
134
|
+
color: "secondary",
|
|
135
|
+
label: n ?? c`OK`,
|
|
136
|
+
onClick: u,
|
|
137
|
+
variant: "contained"
|
|
138
|
+
}), r(e);
|
|
139
|
+
}, [
|
|
140
|
+
t,
|
|
141
|
+
l,
|
|
142
|
+
n,
|
|
143
|
+
u,
|
|
144
|
+
r,
|
|
145
|
+
i,
|
|
146
|
+
c
|
|
147
|
+
]), e ? /* @__PURE__ */ (0, N.jsx)(I, {
|
|
148
|
+
...C.createAttributes("Confirmation-textContent"),
|
|
149
|
+
children: e
|
|
150
|
+
}) : null;
|
|
151
|
+
}, {
|
|
152
|
+
fullWidth: !0,
|
|
153
|
+
maxWidth: "sm",
|
|
154
|
+
testId: "Confirmation"
|
|
155
|
+
}), U = ({ onReset: e }) => {
|
|
156
|
+
let t = (0, A.useRef)(null), n = (0, A.useCallback)(() => {
|
|
157
|
+
t.current?.open();
|
|
158
|
+
}, []), r = (0, A.useCallback)(() => {
|
|
159
|
+
e();
|
|
160
|
+
}, [e]);
|
|
161
|
+
return /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsx)(S, {
|
|
162
|
+
title: "Reset current session and dataset",
|
|
163
|
+
children: /* @__PURE__ */ (0, N.jsx)(m, {
|
|
164
|
+
color: "inherit",
|
|
165
|
+
onClick: n,
|
|
166
|
+
size: "small",
|
|
167
|
+
sx: { opacity: .85 },
|
|
168
|
+
children: /* @__PURE__ */ (0, N.jsx)(V, { fontSize: "small" })
|
|
169
|
+
})
|
|
170
|
+
}), /* @__PURE__ */ (0, N.jsx)(H, {
|
|
171
|
+
body: w`Are you sure you want to reset the current session and dataset?`,
|
|
172
|
+
cancelLabel: w`Cancel`,
|
|
173
|
+
confirmLabel: w`Reset`,
|
|
174
|
+
onConfirm: r,
|
|
175
|
+
ref: t,
|
|
176
|
+
title: w`Reset current session and dataset?`
|
|
177
|
+
})] });
|
|
178
|
+
}, W = p(/*#__PURE__*/ (0, N.jsx)("path", { d: "M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4" }), "HelpOutlineOutlined"), G = () => {
|
|
179
|
+
let e = (0, A.useCallback)(() => {
|
|
180
|
+
window.open("https://github.com/RIVM-bioinformatics/loculus-tools", "_blank");
|
|
181
|
+
}, []);
|
|
182
|
+
return /* @__PURE__ */ (0, N.jsx)(S, {
|
|
183
|
+
title: "Documentation & Specifications",
|
|
184
|
+
children: /* @__PURE__ */ (0, N.jsx)(m, {
|
|
185
|
+
color: "inherit",
|
|
186
|
+
onClick: e,
|
|
187
|
+
size: "small",
|
|
188
|
+
sx: { opacity: .85 },
|
|
189
|
+
children: /* @__PURE__ */ (0, N.jsx)(W, { fontSize: "small" })
|
|
190
|
+
})
|
|
191
|
+
});
|
|
192
|
+
}, K = p(/*#__PURE__*/ (0, N.jsx)("path", { d: "M7 19c-1.1 0-2 .9-2 2h14c0-1.1-.9-2-2-2h-4v-2h3c1.1 0 2-.9 2-2h-8c-1.66 0-3-1.34-3-3 0-1.09.59-2.04 1.47-2.57.41.59 1.06 1 1.83 1.06.7.06 1.36-.19 1.85-.62l.59 1.61.94-.34.34.94 1.88-.68-.34-.94.94-.34-2.74-7.52-.94.34-.34-.94-1.88.68.34.94-.94.35.56 1.55c-1.17-.04-2.19.75-2.48 1.86C6.27 8.14 5 9.92 5 12c0 2.76 2.24 5 5 5v2zm5.86-14.48 1.71 4.7-.94.34-1.71-4.7zM10.5 7c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1" }), "BiotechOutlined"), q = () => {
|
|
193
|
+
let e = o(i, (e) => e.resetDataset), t = o(i, (e) => e.meta), n = (0, A.useCallback)(() => {
|
|
194
|
+
e();
|
|
195
|
+
}, [e]), a = (0, A.useCallback)(() => {
|
|
196
|
+
r.getInstance().emit("onUndo");
|
|
197
|
+
}, []), s = (0, A.useCallback)(() => {
|
|
198
|
+
r.getInstance().emit("onRedo");
|
|
199
|
+
}, []);
|
|
200
|
+
return /* @__PURE__ */ (0, N.jsx)(E, {
|
|
201
|
+
centerComponent: /* @__PURE__ */ (0, N.jsx)(L, { store: i }),
|
|
202
|
+
icon: /* @__PURE__ */ (0, N.jsx)(K, { sx: { fontSize: 24 } }),
|
|
203
|
+
rightComponent: /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [
|
|
204
|
+
/* @__PURE__ */ (0, N.jsx)(B, {}),
|
|
205
|
+
/* @__PURE__ */ (0, N.jsx)(S, {
|
|
206
|
+
title: "Undo last action",
|
|
207
|
+
children: /* @__PURE__ */ (0, N.jsx)(m, {
|
|
208
|
+
color: "inherit",
|
|
209
|
+
disabled: t?.undoDepth === 0,
|
|
210
|
+
onClick: a,
|
|
211
|
+
size: "small",
|
|
212
|
+
sx: { opacity: .85 },
|
|
213
|
+
children: /* @__PURE__ */ (0, N.jsx)(T, { fontSize: "small" })
|
|
214
|
+
})
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ (0, N.jsx)(S, {
|
|
217
|
+
title: "Redo last action",
|
|
218
|
+
children: /* @__PURE__ */ (0, N.jsx)(m, {
|
|
219
|
+
color: "inherit",
|
|
220
|
+
disabled: t?.redoDepth === 0,
|
|
221
|
+
onClick: s,
|
|
222
|
+
size: "small",
|
|
223
|
+
sx: { opacity: .85 },
|
|
224
|
+
children: /* @__PURE__ */ (0, N.jsx)(D, { fontSize: "small" })
|
|
225
|
+
})
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ (0, N.jsx)(U, { onReset: n }),
|
|
228
|
+
/* @__PURE__ */ (0, N.jsx)(G, {})
|
|
229
|
+
] }),
|
|
230
|
+
title: "Sequence Editor"
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
//#endregion
|
|
234
|
+
export { R as i, K as n, z as r, q as t };
|
|
235
|
+
|
|
236
|
+
//# sourceMappingURL=SequenceEditorPageHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceEditorPageHeader.js","names":["PropTypes","i","t","n","a","r","e"],"sources":["../../../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/DialogContentText/dialogContentTextClasses.mjs","../../../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/DialogContentText/DialogContentText.mjs","../../../../../common/frontend/src/components/FastaPageHeaderCenterComponent/FastaPageHeaderCenterComponent.tsx","../../../../../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._9ea641d093c8d4a6ca4517c9b0071d29/node_modules/@mui/icons-material/FileUploadOutlined.mjs","../../../../../common/frontend/src/classes/services/FastaDataEventBusService/FastaDataEventBusService.ts","../../../../../common/frontend/src/components/FastaPageHeaderImportButton/FastaPageHeaderImportButton.tsx","../../../../../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._9ea641d093c8d4a6ca4517c9b0071d29/node_modules/@mui/icons-material/RestartAlt.mjs","../../../../../../node_modules/.pnpm/@gen-epix+ui-core-components@4.3.1_042ffd1b957752b43692251051b5ea4b/node_modules/@gen-epix/ui-core-components/dist/components/Confirmation/index.js","../../../../../common/frontend/src/components/FastaPageHeaderResetButton/FastaPageHeaderResetButton.tsx","../../../../../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._9ea641d093c8d4a6ca4517c9b0071d29/node_modules/@mui/icons-material/HelpOutlineOutlined.mjs","../../../../../common/frontend/src/components/PageHeaderDocumentationButton/PageHeaderDocumentationButton.tsx","../../../../../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._9ea641d093c8d4a6ca4517c9b0071d29/node_modules/@mui/icons-material/BiotechOutlined.mjs","../../src/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.tsx"],"sourcesContent":["import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getDialogContentTextUtilityClass(slot) {\n return generateUtilityClass('MuiDialogContentText', slot);\n}\nconst dialogContentTextClasses = generateUtilityClasses('MuiDialogContentText', ['root']);\nexport default dialogContentTextClasses;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport rootShouldForwardProp from \"../styles/rootShouldForwardProp.mjs\";\nimport { styled } from \"../zero-styled/index.mjs\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.mjs\";\nimport Typography from \"../Typography/index.mjs\";\nimport { getDialogContentTextUtilityClass } from \"./dialogContentTextClasses.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root']\n };\n const composedClasses = composeClasses(slots, getDialogContentTextUtilityClass, classes);\n return {\n ...classes,\n // forward classes to the Typography\n ...composedClasses\n };\n};\nconst DialogContentTextRoot = styled(Typography, {\n shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',\n name: 'MuiDialogContentText',\n slot: 'Root'\n})({});\nconst DialogContentText = /*#__PURE__*/React.forwardRef(function DialogContentText(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiDialogContentText'\n });\n const {\n children,\n className,\n ...ownerState\n } = props;\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(DialogContentTextRoot, {\n component: \"p\",\n variant: \"body1\",\n color: \"textSecondary\",\n ref: ref,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ...props,\n classes: classes\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? DialogContentText.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default DialogContentText;","import {\n Box,\n Chip,\n} from '@mui/material';\nimport type { StoreApi } from 'zustand';\nimport { useStore } from 'zustand';\n\nimport type { FastaDataStore } from '../../stores/fastaDataStore';\n\n\nexport type FastaPageHeaderCenterComponentProps = {\n store: StoreApi<FastaDataStore>;\n};\n\nexport const FastaPageHeaderCenterComponent = ({ store }: FastaPageHeaderCenterComponentProps) => {\n const parsedFasta = useStore(store, (state) => state.parsedFasta);\n const parsedMetadata = useStore(store, (state) => state.parsedMetadata);\n\n const seqCount = parsedFasta?.sequences?.length || 0;\n const metaCount = parsedMetadata?.records?.length || 0;\n\n return (\n <Box sx={{ alignItems: 'center', display: 'flex', gap: 1 }}>\n {seqCount > 0 && (\n <Chip\n label={`${seqCount} Sequences`}\n size={'small'}\n sx={{\n backgroundColor: 'rgba(255, 255, 255, 0.2)',\n color: '#FFFFFF',\n fontSize: '0.75rem',\n fontWeight: 600,\n }}\n />\n )}\n {metaCount > 0 && (\n <Chip\n label={`${metaCount} Metadata Records`}\n size={'small'}\n sx={{\n backgroundColor: 'rgba(255, 255, 255, 0.2)',\n color: '#FFFFFF',\n fontSize: '0.75rem',\n fontWeight: 600,\n }}\n />\n )}\n </Box>\n );\n};\n","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z\"\n}), 'FileUploadOutlined');","import { EventBusAbstract } from '@gen-epix/ui-core/classes/abstracts/EventBusAbstract';\nimport { HmrUtil } from '@gen-epix/ui-core/utils/HmrUtil';\n\n\nexport type Event = {\n onCloseImportDialog: undefined;\n onShowImportDialog: string | undefined;\n};\n\nexport class FastaDataEventBusService extends EventBusAbstract<Event> {\n private static __instance: FastaDataEventBusService;\n\n\n private constructor() {\n super();\n }\n\n public static getInstance(): FastaDataEventBusService {\n FastaDataEventBusService.__instance = HmrUtil.getHmrSingleton('fastaDataEventBusService', FastaDataEventBusService.__instance, () => new FastaDataEventBusService());\n return FastaDataEventBusService.__instance;\n }\n}\n","import FileUploadOutlinedIcon from '@mui/icons-material/FileUploadOutlined';\nimport { Button } from '@mui/material';\nimport { useCallback } from 'react';\n\nimport { FastaDataEventBusService } from '../../classes/services/FastaDataEventBusService';\n\nexport const FastaPageHeaderImportButton = () => {\n const onImportDataButtonClick = useCallback(() => FastaDataEventBusService.getInstance().emit('onShowImportDialog'), []);\n\n return (\n <Button\n color={'inherit'}\n onClick={onImportDataButtonClick}\n size={'small'}\n startIcon={<FileUploadOutlinedIcon />}\n sx={{\n '&:hover': {\n backgroundColor: 'rgba(255, 255, 255, 0.25)',\n },\n backgroundColor: 'rgba(255, 255, 255, 0.15)',\n color: '#FFFFFF',\n }}\n variant={'contained'}\n >\n {'Import Data'}\n </Button>\n );\n};\n","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91\"\n}), 'RestartAlt');","import { withDialog as e } from \"../../hoc/withDialog/index.js\";\nimport { useCallback as t, useEffect as n } from \"react\";\nimport { DialogContentText as r } from \"@mui/material\";\nimport { useTranslation as i } from \"react-i18next\";\nimport { TestIdUtil as a } from \"@gen-epix/ui-core/utils/TestIdUtil\";\nimport { jsx as o } from \"react/jsx-runtime\";\n//#region src/components/Confirmation/ConfirmationRender.tsx\nvar s = ({ body: e, cancelLabel: s, confirmLabel: c, onActionsChange: l, onCancel: u, onClose: d, onConfirm: f, openProps: p }) => {\n\tlet { t: m } = i(), h = t(() => {\n\t\tu && u(p), d();\n\t}, [\n\t\tu,\n\t\td,\n\t\tp\n\t]), g = t(() => {\n\t\tf(p), d();\n\t}, [\n\t\tf,\n\t\tp,\n\t\td\n\t]);\n\treturn n(() => {\n\t\tlet e = [];\n\t\ts && e.push({\n\t\t\t...a.createAttributes(\"Confirmation-cancelButton\"),\n\t\t\tcolor: \"primary\",\n\t\t\tlabel: s ?? m`Cancel`,\n\t\t\tonClick: h,\n\t\t\tvariant: \"outlined\"\n\t\t}), e.push({\n\t\t\t...a.createAttributes(\"Confirmation-confirmButton\"),\n\t\t\tautoFocus: !0,\n\t\t\tcolor: \"secondary\",\n\t\t\tlabel: c ?? m`OK`,\n\t\t\tonClick: g,\n\t\t\tvariant: \"contained\"\n\t\t}), l(e);\n\t}, [\n\t\ts,\n\t\th,\n\t\tc,\n\t\tg,\n\t\tl,\n\t\tu,\n\t\tm\n\t]), e ? /* @__PURE__ */ o(r, {\n\t\t...a.createAttributes(\"Confirmation-textContent\"),\n\t\tchildren: e\n\t}) : null;\n}, c = e(s, {\n\tfullWidth: !0,\n\tmaxWidth: \"sm\",\n\ttestId: \"Confirmation\"\n});\n//#endregion\nexport { c as Confirmation, s as ConfirmationRender };\n\n//# sourceMappingURL=index.js.map","import RestartAltIcon from '@mui/icons-material/RestartAlt';\nimport {\n IconButton,\n Tooltip,\n} from '@mui/material';\nimport {\n useCallback,\n useRef,\n} from 'react';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { t } from 'i18next';\n\nexport type FastaPageHeaderResetButtonProps = {\n onReset: () => void;\n};\n\nexport const FastaPageHeaderResetButton = ({ onReset }: FastaPageHeaderResetButtonProps) => {\n const confirmationRef = useRef<ConfirmationRefMethods>(null);\n const onClickResetSession = useCallback(() => {\n confirmationRef.current?.open();\n }, []);\n\n const onConfirm = useCallback(() => {\n onReset();\n }, [onReset]);\n\n return (\n <>\n <Tooltip title={'Reset current session and dataset'}>\n <IconButton\n color={'inherit'}\n onClick={onClickResetSession}\n size={'small'}\n sx={{ opacity: 0.85 }}\n >\n <RestartAltIcon fontSize={'small'} />\n </IconButton>\n </Tooltip>\n <Confirmation\n body={t`Are you sure you want to reset the current session and dataset?`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Reset`}\n onConfirm={onConfirm}\n ref={confirmationRef}\n title={t`Reset current session and dataset?`}\n />\n </>\n );\n};\n","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4\"\n}), 'HelpOutlineOutlined');","import { useCallback } from 'react';\nimport {\n IconButton,\n Tooltip,\n} from '@mui/material';\nimport HelpOutlineIcon from '@mui/icons-material/HelpOutlineOutlined';\n\nexport const PageHeaderDocumentationButton = () => {\n const onDocumentationButtonClick = useCallback(() => {\n window.open('https://github.com/RIVM-bioinformatics/loculus-tools', '_blank');\n }, []);\n\n return (\n <Tooltip title={'Documentation & Specifications'}>\n <IconButton\n color={'inherit'}\n onClick={onDocumentationButtonClick}\n size={'small'}\n sx={{ opacity: 0.85 }}\n >\n <HelpOutlineIcon fontSize={'small'} />\n </IconButton>\n </Tooltip>\n );\n};\n","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M7 19c-1.1 0-2 .9-2 2h14c0-1.1-.9-2-2-2h-4v-2h3c1.1 0 2-.9 2-2h-8c-1.66 0-3-1.34-3-3 0-1.09.59-2.04 1.47-2.57.41.59 1.06 1 1.83 1.06.7.06 1.36-.19 1.85-.62l.59 1.61.94-.34.34.94 1.88-.68-.34-.94.94-.34-2.74-7.52-.94.34-.34-.94-1.88.68.34.94-.94.35.56 1.55c-1.17-.04-2.19.75-2.48 1.86C6.27 8.14 5 9.92 5 12c0 2.76 2.24 5 5 5v2zm5.86-14.48 1.71 4.7-.94.34-1.71-4.7zM10.5 7c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1\"\n}), 'BiotechOutlined');","import { FastaPageHeaderCenterComponent } from '@rivm-loculus-tools/common-frontend/components/FastaPageHeaderCenterComponent';\nimport { FastaPageHeaderImportButton } from '@rivm-loculus-tools/common-frontend/components/FastaPageHeaderImportButton';\nimport { FastaPageHeaderResetButton } from '@rivm-loculus-tools/common-frontend/components/FastaPageHeaderResetButton';\nimport { PageCommonHeader } from '@rivm-loculus-tools/common-frontend/components/page';\nimport { PageHeaderDocumentationButton } from '@rivm-loculus-tools/common-frontend/components/PageHeaderDocumentationButton';\nimport { useCallback } from 'react';\nimport { useStore } from 'zustand';\nimport BiotechOutlinedIcon from '@mui/icons-material/BiotechOutlined';\nimport UndoIcon from '@mui/icons-material/Undo';\nimport RedoIcon from '@mui/icons-material/Redo';\nimport {\n IconButton,\n Tooltip,\n} from '@mui/material';\n\nimport { sequenceEditorStore } from '../../../stores/sequenceEditorStore';\nimport { SequenceEditorEventBusService } from '../../../classes/services/SequenceEditorEventBusService';\n\nexport const SequenceEditorPageHeader = () => {\n const resetDataset = useStore(sequenceEditorStore, (state) => state.resetDataset);\n const meta = useStore(sequenceEditorStore, (state) => state.meta);\n\n const onReset = useCallback(() => {\n resetDataset();\n }, [resetDataset]);\n\n const onUndoButtonClick = useCallback(() => {\n SequenceEditorEventBusService.getInstance().emit('onUndo');\n }, []);\n\n const onRedoButtonClick = useCallback(() => {\n SequenceEditorEventBusService.getInstance().emit('onRedo');\n }, []);\n\n return (\n <PageCommonHeader\n centerComponent={<FastaPageHeaderCenterComponent store={sequenceEditorStore} />}\n icon={<BiotechOutlinedIcon sx={{ fontSize: 24 }} />}\n rightComponent={(\n <>\n <FastaPageHeaderImportButton />\n <Tooltip title={'Undo last action'}>\n <IconButton\n color={'inherit'}\n disabled={meta?.undoDepth === 0}\n onClick={onUndoButtonClick}\n size={'small'}\n sx={{ opacity: 0.85 }}\n >\n <UndoIcon fontSize={'small'} />\n </IconButton>\n </Tooltip>\n <Tooltip title={'Redo last action'}>\n <IconButton\n color={'inherit'}\n disabled={meta?.redoDepth === 0}\n onClick={onRedoButtonClick}\n size={'small'}\n sx={{ opacity: 0.85 }}\n >\n <RedoIcon fontSize={'small'} />\n </IconButton>\n </Tooltip>\n <FastaPageHeaderResetButton onReset={onReset} />\n <PageHeaderDocumentationButton />\n </>\n )}\n title={'Sequence Editor'}\n />\n );\n};\n"],"x_google_ignoreList":[0,1,3,6,7,9,11],"mappings":";;;;;;;;;AAEA,SAAgB,EAAiC,GAAM;CACrD,OAAO,EAAqB,wBAAwB,CAAI;AAC1D;AACiC,EAAuB,wBAAwB,CAAC,MAAM,CAAC;;;aCOlF,KAAoB,MAAc;CACtC,IAAM,EACJ,eACE,GAIE,IAAkB,EAAe,EAFrC,MAAM,CAAC,MAAM,EAE4B,GAAG,GAAkC,CAAO;CACvF,OAAO;EACL,GAAG;EAEH,GAAG;CACL;AACF,GACM,IAAwB,EAAO,GAAY;CAC/C,oBAAmB,MAAQ,EAAsB,CAAI,KAAK,MAAS;CACnE,MAAM;CACN,MAAM;AACR,CAAC,CAAC,CAAC,CAAC,CAAC,GACC,IAAiC,gBAAM,WAAW,SAA2B,GAAS,GAAK;CAC/F,IAAM,IAAQ,EAAgB;EAC5B,OAAO;EACP,MAAM;CACR,CAAC,GACK,EACJ,aACA,cACA,GAAG,MACD,GACE,IAAU,EAAkB,CAAU;CAC5C,OAAoB,eAAA,GAAA,EAAA,IAAA,CAAK,GAAuB;EAC9C,WAAW;EACX,SAAS;EACT,OAAO;EACF;EACO;EACZ,WAAW,EAAK,EAAQ,MAAM,CAAS;EAC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AAC,GAAD;KACE,OAAO;KACP,UAAU,GAAM,cAAc;KAC9B,SAAS;KACT,MAAM;KACN,IAAI,EAAE,SAAS,IAAK;KAEpB,UAAA,iBAAA,GAAA,EAAA,IAAA,CAAC,GAAD,EAAU,UAAU,QAAU,CAAA;IACpB,CAAA;GACL,CAAA;GACT,iBAAA,GAAA,EAAA,IAAA,CAAC,GAAD;IAAS,OAAO;IACd,UAAA,iBAAA,GAAA,EAAA,IAAA,CAAC,GAAD;KACE,OAAO;KACP,UAAU,GAAM,cAAc;KAC9B,SAAS;KACT,MAAM;KACN,IAAI,EAAE,SAAS,IAAK;KAEpB,UAAA,iBAAA,GAAA,EAAA,IAAA,CAAC,GAAD,EAAU,UAAU,QAAU,CAAA;IACpB,CAAA;GACL,CAAA;GACT,iBAAA,GAAA,EAAA,IAAA,CAAC,GAAD,EAAqC,WAAU,CAAA;GAC/C,iBAAA,GAAA,EAAA,IAAA,CAAC,GAAD,CAAgC,CAAA;EAChC,EAAA,CAAA;EAEJ,OAAO;CACR,CAAA;AAEL"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime.js";
|
|
2
|
+
import { t } from "./SequenceEditorEventBusService.js";
|
|
3
|
+
import { t as n } from "./sequenceEditorStore.js";
|
|
4
|
+
import { Dt as r, It as i, Lt as a, P as o, g as s, i as c, t as l } from "./Box.js";
|
|
5
|
+
import { a as u, n as d, r as f, t as p } from "./KeyboardArrowDown.js";
|
|
6
|
+
import { t as m } from "./Close.js";
|
|
7
|
+
//#region ../../../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._9ea641d093c8d4a6ca4517c9b0071d29/node_modules/@mui/icons-material/Search.mjs
|
|
8
|
+
var h = /* @__PURE__ */ e(a(), 1), g = r(), _ = s(/*#__PURE__*/ (0, g.jsx)("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14" }), "Search"), v = ({ allowNavigation: e, highlightedIndex: t, numResults: n = 0, onHighlightedIndexChange: r, onSearchQueryChange: i, searchQuery: a, truncated: s }) => {
|
|
9
|
+
let v = o(), y = (0, h.useRef)(null), b = (0, h.useRef)(null), x = (0, h.useRef)(null), S = (0, h.useCallback)((e) => {
|
|
10
|
+
let t = e.target.value;
|
|
11
|
+
i(t);
|
|
12
|
+
}, [i]), C = (0, h.useCallback)(() => {
|
|
13
|
+
i(""), y.current?.focus();
|
|
14
|
+
}, [i]), w = (0, h.useCallback)((e) => {
|
|
15
|
+
if (e.key === "Enter") {
|
|
16
|
+
if (!n) return;
|
|
17
|
+
e.preventDefault(), r?.(0), x.current?.focus();
|
|
18
|
+
}
|
|
19
|
+
}, [n, r]), T = (0, h.useCallback)(() => {
|
|
20
|
+
if (!n) return;
|
|
21
|
+
let e = t == null || Number.isNaN(t) || t <= 0 ? n - 1 : t - 1;
|
|
22
|
+
r?.(e);
|
|
23
|
+
}, [
|
|
24
|
+
n,
|
|
25
|
+
t,
|
|
26
|
+
r
|
|
27
|
+
]), E = (0, h.useCallback)(() => {
|
|
28
|
+
if (!n) return;
|
|
29
|
+
let e = t == null || Number.isNaN(t) || t >= n - 1 ? 0 : t + 1;
|
|
30
|
+
r?.(e);
|
|
31
|
+
}, [
|
|
32
|
+
n,
|
|
33
|
+
t,
|
|
34
|
+
r
|
|
35
|
+
]), D = (0, h.useCallback)((e) => {
|
|
36
|
+
if (e.key === "ArrowRight") {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
let t = e.currentTarget.nextElementSibling;
|
|
39
|
+
t && t.focus();
|
|
40
|
+
}
|
|
41
|
+
if (e.key === "ArrowLeft") {
|
|
42
|
+
if (e.preventDefault(), e.target === b.current) {
|
|
43
|
+
y.current?.focus();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
let t = e.currentTarget.previousElementSibling;
|
|
47
|
+
t && t.focus();
|
|
48
|
+
}
|
|
49
|
+
}, []), O = (0, h.useMemo)(() => a ? a && (Number.isNaN(n) || n <= 0) ? "No results" : t == null || Number.isNaN(t) || t < 0 || !e ? `${n}${s ? "+" : ""} results` : e ? `${t + 1}/${n}${s ? "+" : ""} results` : "" : "", [
|
|
50
|
+
a,
|
|
51
|
+
n,
|
|
52
|
+
t,
|
|
53
|
+
e,
|
|
54
|
+
s
|
|
55
|
+
]);
|
|
56
|
+
return /* @__PURE__ */ (0, g.jsx)(u, {
|
|
57
|
+
endAdornment: /* @__PURE__ */ (0, g.jsxs)(f, {
|
|
58
|
+
position: "end",
|
|
59
|
+
children: [
|
|
60
|
+
O && /* @__PURE__ */ (0, g.jsx)(l, {
|
|
61
|
+
"aria-atomic": "true",
|
|
62
|
+
"aria-live": "polite",
|
|
63
|
+
role: "status",
|
|
64
|
+
sx: { fontSize: "1rem" },
|
|
65
|
+
children: O
|
|
66
|
+
}),
|
|
67
|
+
n > 0 && e && /* @__PURE__ */ (0, g.jsxs)(g.Fragment, { children: [/* @__PURE__ */ (0, g.jsx)(c, {
|
|
68
|
+
"aria-label": "Goto previous search result",
|
|
69
|
+
disabled: !n,
|
|
70
|
+
edge: "end",
|
|
71
|
+
onClick: T,
|
|
72
|
+
onKeyDown: D,
|
|
73
|
+
ref: b,
|
|
74
|
+
sx: { color: v.palette.primary.main },
|
|
75
|
+
children: /* @__PURE__ */ (0, g.jsx)(d, {})
|
|
76
|
+
}), /* @__PURE__ */ (0, g.jsx)(c, {
|
|
77
|
+
"aria-label": "Goto next search result",
|
|
78
|
+
disabled: !n,
|
|
79
|
+
edge: "end",
|
|
80
|
+
onClick: E,
|
|
81
|
+
onKeyDown: D,
|
|
82
|
+
ref: x,
|
|
83
|
+
sx: { color: v.palette.primary.main },
|
|
84
|
+
children: /* @__PURE__ */ (0, g.jsx)(p, {})
|
|
85
|
+
})] }),
|
|
86
|
+
a && /* @__PURE__ */ (0, g.jsx)(c, {
|
|
87
|
+
"aria-label": "Clear",
|
|
88
|
+
edge: "end",
|
|
89
|
+
onClick: C,
|
|
90
|
+
onKeyDown: D,
|
|
91
|
+
children: /* @__PURE__ */ (0, g.jsx)(m, {})
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}),
|
|
95
|
+
fullWidth: !0,
|
|
96
|
+
inputRef: y,
|
|
97
|
+
name: "Search",
|
|
98
|
+
onChange: S,
|
|
99
|
+
onKeyDown: w,
|
|
100
|
+
placeholder: "Search",
|
|
101
|
+
size: "small",
|
|
102
|
+
slotProps: { input: {
|
|
103
|
+
"aria-label": "Search",
|
|
104
|
+
sx: {
|
|
105
|
+
"&::-webkit-search-cancel-button": { display: "none" },
|
|
106
|
+
fontSize: "1rem",
|
|
107
|
+
height: v.spacing(4),
|
|
108
|
+
outline: "none !important",
|
|
109
|
+
paddingBottom: "0 !important",
|
|
110
|
+
paddingTop: "0 !important"
|
|
111
|
+
}
|
|
112
|
+
} },
|
|
113
|
+
startAdornment: /* @__PURE__ */ (0, g.jsx)(f, {
|
|
114
|
+
position: "start",
|
|
115
|
+
children: /* @__PURE__ */ (0, g.jsx)(_, { fontSize: "small" })
|
|
116
|
+
}),
|
|
117
|
+
sx: {
|
|
118
|
+
backgroundColor: v.palette.background.paper,
|
|
119
|
+
height: v.spacing(4)
|
|
120
|
+
},
|
|
121
|
+
type: "search",
|
|
122
|
+
value: a
|
|
123
|
+
});
|
|
124
|
+
}, y = () => {
|
|
125
|
+
let e = i(n, (e) => e.setSearchQuery), r = i(n, (e) => e.setSearchResultHighlightedIndex), a = i(n, (e) => e.searchQuery), o = i(n, (e) => e.searchResult), s = i(n, (e) => e.searchResultHighlightedIndex), c = (0, h.useCallback)((n) => {
|
|
126
|
+
e(n), t.getInstance().emit("onSearch", n);
|
|
127
|
+
}, [e]), l = (0, h.useCallback)((e) => {
|
|
128
|
+
r(e);
|
|
129
|
+
}, [r]);
|
|
130
|
+
return /* @__PURE__ */ (0, g.jsx)(v, {
|
|
131
|
+
allowNavigation: !0,
|
|
132
|
+
highlightedIndex: s,
|
|
133
|
+
numResults: o?.num_matches,
|
|
134
|
+
onHighlightedIndexChange: l,
|
|
135
|
+
onSearchQueryChange: c,
|
|
136
|
+
searchQuery: a,
|
|
137
|
+
truncated: o?.truncated
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
//#endregion
|
|
141
|
+
export { y as t };
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=SequenceEditorSearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceEditorSearchBar.js","names":[],"sources":["../../../../../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._9ea641d093c8d4a6ca4517c9b0071d29/node_modules/@mui/icons-material/Search.mjs","../../../../../common/frontend/src/components/SearchBar/SearchBar.tsx","../../src/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.tsx"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14\"\n}), 'Search');","import type {\n ChangeEvent,\n KeyboardEvent,\n} from 'react';\nimport {\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport {\n Box,\n FilledInput,\n IconButton,\n InputAdornment,\n useTheme,\n} from '@mui/material';\nimport SearchIcon from '@mui/icons-material/Search';\nimport KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';\nimport KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';\nimport CloseIcon from '@mui/icons-material/Close';\n\n\nexport type SearchBarProps = {\n allowNavigation?: boolean;\n highlightedIndex?: null | number;\n numResults?: number;\n onHighlightedIndexChange?: (index: number) => void;\n onSearchQueryChange: (query: string) => void;\n searchQuery: string;\n truncated?: boolean;\n};\n\nexport const SearchBar = ({ allowNavigation, highlightedIndex, numResults = 0, onHighlightedIndexChange, onSearchQueryChange, searchQuery, truncated }: SearchBarProps) => {\n const theme = useTheme();\n const inputRef = useRef<HTMLInputElement>(null);\n const arrowUpButtonRef = useRef<HTMLButtonElement>(null);\n const arrowDownButtonRef = useRef<HTMLButtonElement>(null);\n\n const onTextInputChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const nextSearchText = event.target.value;\n onSearchQueryChange(nextSearchText);\n }, [onSearchQueryChange]);\n\n const onClearButtonClick = useCallback(() => {\n onSearchQueryChange('');\n inputRef.current?.focus();\n }, [onSearchQueryChange]);\n\n const onTextInputKeyDown = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n // on enter press, highlight the first result and focus the down arrow button\n if (event.key === 'Enter') {\n if (!numResults) {\n return;\n }\n event.preventDefault();\n onHighlightedIndexChange?.(0);\n arrowDownButtonRef.current?.focus();\n }\n }, [numResults, onHighlightedIndexChange]);\n\n const onUpArrowButtonClick = useCallback(() => {\n // goto previous result\n if (!numResults) {\n return;\n }\n const newHighlightedIndex = highlightedIndex === null || highlightedIndex === undefined || Number.isNaN(highlightedIndex) || highlightedIndex <= 0 ? numResults - 1 : highlightedIndex - 1;\n\n onHighlightedIndexChange?.(newHighlightedIndex);\n }, [numResults, highlightedIndex, onHighlightedIndexChange]);\n\n const onDownArrowButtonClick = useCallback(() => {\n // goto next result\n if (!numResults) {\n return;\n }\n const newHighlightedIndex = highlightedIndex === null || highlightedIndex === undefined || Number.isNaN(highlightedIndex) || highlightedIndex >= numResults - 1 ? 0 : highlightedIndex + 1;\n onHighlightedIndexChange?.(newHighlightedIndex);\n }, [numResults, highlightedIndex, onHighlightedIndexChange]);\n\n const onGenericKeyDown = useCallback((event: KeyboardEvent<HTMLButtonElement>) => {\n // arrow right, focus the next focusable element\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n const nextFocusableElement = event.currentTarget.nextElementSibling as HTMLElement;\n if (nextFocusableElement) {\n nextFocusableElement.focus();\n }\n }\n // arrow left, focus the previous focusable element\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (event.target === arrowUpButtonRef.current) {\n inputRef.current?.focus();\n return;\n }\n const previousFocusableElement = event.currentTarget.previousElementSibling as HTMLElement;\n if (previousFocusableElement) {\n previousFocusableElement.focus();\n }\n }\n }, []);\n\n const searchResultStatusText = useMemo(() => {\n if (!searchQuery) {\n return '';\n }\n if (searchQuery && (Number.isNaN(numResults) || numResults <= 0)) {\n return 'No results';\n } else if (highlightedIndex === null || highlightedIndex === undefined || Number.isNaN(highlightedIndex) || highlightedIndex < 0 || !allowNavigation) {\n return `${numResults}${truncated ? '+' : ''} results`;\n } else if (allowNavigation) {\n return `${highlightedIndex + 1}/${numResults}${truncated ? '+' : ''} results`;\n }\n return '';\n }, [searchQuery, numResults, highlightedIndex, allowNavigation, truncated]);\n\n\n return (\n <FilledInput\n endAdornment={(\n <InputAdornment position={'end'}>\n {searchResultStatusText && (\n <Box\n aria-atomic={'true'}\n aria-live={'polite'}\n role={'status'}\n sx={{\n fontSize: '1rem',\n }}\n >\n {searchResultStatusText}\n </Box>\n )}\n {numResults > 0 && allowNavigation && (\n <>\n <IconButton\n aria-label={'Goto previous search result'}\n disabled={!numResults}\n edge={'end'}\n onClick={onUpArrowButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={arrowUpButtonRef}\n sx={{ color: theme.palette.primary.main }}\n >\n <KeyboardArrowUpIcon />\n </IconButton>\n <IconButton\n aria-label={'Goto next search result'}\n disabled={!numResults}\n edge={'end'}\n onClick={onDownArrowButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={arrowDownButtonRef}\n sx={{ color: theme.palette.primary.main }}\n >\n <KeyboardArrowDownIcon />\n </IconButton>\n </>\n )}\n {searchQuery && (\n <IconButton\n aria-label={'Clear'}\n edge={'end'}\n onClick={onClearButtonClick}\n onKeyDown={onGenericKeyDown}\n >\n <CloseIcon />\n </IconButton>\n )}\n </InputAdornment>\n )}\n fullWidth\n inputRef={inputRef}\n name={'Search'}\n onChange={onTextInputChange}\n onKeyDown={onTextInputKeyDown}\n placeholder={'Search'}\n size={'small'}\n slotProps={{\n input: {\n 'aria-label': 'Search',\n sx: {\n '&::-webkit-search-cancel-button': {\n display: 'none',\n },\n fontSize: '1rem',\n height: theme.spacing(4),\n outline: 'none !important',\n paddingBottom: '0 !important',\n paddingTop: '0 !important',\n },\n },\n }}\n startAdornment={(\n <InputAdornment position={'start'}>\n <SearchIcon fontSize={'small'} />\n </InputAdornment>\n )}\n sx={{\n backgroundColor: theme.palette.background.paper,\n height: theme.spacing(4),\n }}\n type={'search'}\n value={searchQuery}\n />\n );\n};\n","import { SearchBar } from '@rivm-loculus-tools/common-frontend/components/SearchBar';\nimport { useCallback } from 'react';\nimport { useStore } from 'zustand';\n\nimport { sequenceEditorStore } from '../../../stores/sequenceEditorStore';\nimport { SequenceEditorEventBusService } from '../../../classes/services/SequenceEditorEventBusService';\n\nexport const SequenceEditorSearchBar = () => {\n const setSearchQuery = useStore(sequenceEditorStore, (state) => state.setSearchQuery);\n const setSearchHighlightedIndex = useStore(sequenceEditorStore, (state) => state.setSearchResultHighlightedIndex);\n const searchQuery = useStore(sequenceEditorStore, (state) => state.searchQuery);\n const searchResults = useStore(sequenceEditorStore, (state) => state.searchResult);\n const searchHighlightedIndex = useStore(sequenceEditorStore, (state) => state.searchResultHighlightedIndex);\n\n const onSearchQueryChange = useCallback((query: string) => {\n setSearchQuery(query);\n SequenceEditorEventBusService.getInstance().emit('onSearch', query);\n }, [setSearchQuery]);\n\n const onHighlightedIndexChange = useCallback((index: number) => {\n setSearchHighlightedIndex(index);\n }, [setSearchHighlightedIndex]);\n\n return (\n <SearchBar\n allowNavigation\n highlightedIndex={searchHighlightedIndex}\n numResults={searchResults?.num_matches}\n onHighlightedIndexChange={onHighlightedIndexChange}\n onSearchQueryChange={onSearchQueryChange}\n searchQuery={searchQuery}\n truncated={searchResults?.truncated}\n />\n );\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;4CAIA,IAAe,EAA2B,eAAA,GAAA,EAAA,IAAA,CAAK,QAAQ,EACrD,GAAG,oOACL,CAAC,GAAG,QAAQ,GC0BC,KAAa,EAAE,oBAAiB,qBAAkB,gBAAa,GAAG,6BAA0B,wBAAqB,gBAAa,mBAAgC;CACzK,IAAM,IAAQ,EAAS,GACjB,KAAA,GAAW,EAAA,OAAA,CAAyB,IAAI,GACxC,KAAA,GAAmB,EAAA,OAAA,CAA0B,IAAI,GACjD,KAAA,GAAqB,EAAA,OAAA,CAA0B,IAAI,GAEnD,KAAA,GAAoB,EAAA,YAAA,EAAa,MAAyC;EAC9E,IAAM,IAAiB,EAAM,OAAO;EACpC,EAAoB,CAAc;CACpC,GAAG,CAAC,CAAmB,CAAC,GAElB,KAAA,GAAqB,EAAA,YAAA,OAAkB;EAE3C,AADA,EAAoB,EAAE,GACtB,EAAS,SAAS,MAAM;CAC1B,GAAG,CAAC,CAAmB,CAAC,GAElB,KAAA,GAAqB,EAAA,YAAA,EAAa,MAA2C;EAEjF,IAAI,EAAM,QAAQ,SAAS;GACzB,IAAI,CAAC,GACH;GAIF,AAFA,EAAM,eAAe,GACrB,IAA2B,CAAC,GAC5B,EAAmB,SAAS,MAAM;EACpC;CACF,GAAG,CAAC,GAAY,CAAwB,CAAC,GAEnC,KAAA,GAAuB,EAAA,YAAA,OAAkB;EAE7C,IAAI,CAAC,GACH;EAEF,IAAM,IAAsB,KAAqB,QAA0C,OAAO,MAAM,CAAgB,KAAK,KAAoB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