ketcher-macromolecules 3.23.0-dev.1 → 3.23.0-dev.2
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/components/monomerLibrary/MonomerLibraryContextMenu.utils.d.ts +1 -1
- package/dist/components/monomerLibrary/RnaBuilder/RnaEditor/RnaEditorExpanded/helpers/sequenceEdit.d.ts +2 -1
- package/dist/components/preview/hooks/useIDTAliasesTextForMonomer.d.ts +1 -1
- package/dist/components/preview/hooks/useIDTAliasesTextForPreset.d.ts +1 -1
- package/dist/components/shared/dropDown/dropDown.d.ts +2 -0
- package/dist/constants.d.ts +1 -1
- package/dist/helpers/localizeOptions.d.ts +8 -0
- package/dist/helpers/resolveLocalizedTitle.d.ts +8 -0
- package/dist/i18n/localeResources.generated.d.ts +72 -0
- package/dist/index.js +274 -204
- package/dist/index.modern.js +275 -205
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -5,7 +5,7 @@ import React, { createContext, forwardRef, memo, useCallback, useContext, useEff
|
|
|
5
5
|
import { Global, ThemeProvider, css, useTheme } from "@emotion/react";
|
|
6
6
|
import { createTheme } from "@mui/material/styles";
|
|
7
7
|
import { debounce, flatten, get, isNumber, merge } from "lodash";
|
|
8
|
-
import { AmbiguousMonomer, AmbiguousMonomerRenderer, AtomRenderer, BASE_MODIFICATION_DISABLED_IN_SYNC_MODE, BackBoneSequenceNode, BaseMonomer, BaseSequenceItemRenderer, BondRenderer, CONTENT_LAYOUT_MODE, ChainsCollection, ChemicalMimeType, Coordinates, CoreAtom, CoreEditor, DEFAULT_LAYOUT_MODE, EditorHistory, EmptySequenceNode, Entities, HydrogenBond, KetAmbiguousMonomerTemplateSubType, KetMonomerClass, KetSerializer, KetcherAsyncEvents, KetcherLogger, LinkerSequenceNode, MONOMER_CONST, ModeTypes, MonomerGroups, MonomerToAtomBond, Nucleoside, Nucleotide, Peptide, Phosphate, RNABase, RNA_DNA_NON_MODIFIED_PART, RenderersManager, SGroupRenderer, STRAND_TYPE, SelectBase, SequenceMode, SequenceRenderer, SequenceType, SetEditorLineLengthAction, SettingsManager, SnakeLayoutCellWidth, Struct, Sugar, ToolName, UnsplitNucleotide, UsageInMacromolecule, Vec2, ZoomTool, buildRnaPresetConnections, canModifyAminoAcid, compareByTitleWithNaturalFirst, generateMenuShortcuts, getAllConnectedMonomersRecursively, getAminoAcidsToModify, getRnaBaseFromSugar, getRnaPresetPhosphatePosition, getSugarFromRnaBase, getSvgFromDrawnStructures, guardForMacromoleculesEditor,
|
|
8
|
+
import { AmbiguousMonomer, AmbiguousMonomerRenderer, AtomRenderer, BASE_MODIFICATION_DISABLED_IN_SYNC_MODE, BackBoneSequenceNode, BaseMonomer, BaseSequenceItemRenderer, BondRenderer, CONTENT_LAYOUT_MODE, ChainsCollection, ChemicalMimeType, Coordinates, CoreAtom, CoreEditor, DEFAULT_LAYOUT_MODE, EditorHistory, EmptySequenceNode, Entities, HydrogenBond, KetAmbiguousMonomerTemplateSubType, KetMonomerClass, KetSerializer, KetcherAsyncEvents, KetcherLogger, LinkerSequenceNode, MONOMER_CONST, ModeTypes, MonomerGroups, MonomerToAtomBond, Nucleoside, Nucleotide, Peptide, Phosphate, RNABase, RNA_DNA_NON_MODIFIED_PART, RenderersManager, SGroupRenderer, STRAND_TYPE, SelectBase, SequenceMode, SequenceRenderer, SequenceType, SetEditorLineLengthAction, SettingsManager, SnakeLayoutCellWidth, Struct, Sugar, ToolName, UnsplitNucleotide, UsageInMacromolecule, Vec2, ZoomTool, buildRnaPresetConnections, canModifyAminoAcid, compareByTitleWithNaturalFirst, generateMenuShortcuts, getAllConnectedMonomersRecursively, getAminoAcidsToModify, getRnaBaseFromSugar, getRnaPresetPhosphatePosition, getSugarFromRnaBase, getSvgFromDrawnStructures, guardForMacromoleculesEditor, hotkeysConfig, isAmbiguousMonomerLibraryItem, isClipboardAPIAvailable, isHelmCompatible, isLibraryItemRnaPreset, isPasteContentAvailable, isRnaBaseOrAmbiguousRnaBase, isSelectedAntisensePair, isSugarOrAmbiguousSugar, isTwoStrandedNodeRestrictedForHydrogenBondCreation, ketcherProvider, libraryItemHasR1AttachmentPoint, macromoleculesFilesInputFormats, monomerFactory, normalizeError, normalizeSettingsForCore, normalizeSettingsForForm, notifyRequestCompleted, peptideNaturalAnalogues, provideEditorInstance, rnaDnaNaturalAnalogues, setAmbiguousMonomerTemplatePrefix, setMonomerTemplatePrefix, shortcutStr } from "ketcher-core";
|
|
9
9
|
import { Tuple, configureStore, createSelector, createSlice } from "@reduxjs/toolkit";
|
|
10
10
|
import omit from "lodash/omit";
|
|
11
11
|
import styled from "@emotion/styled";
|
|
@@ -114,6 +114,19 @@ var BASE_RESOURCES = {
|
|
|
114
114
|
"unknownStructure": "Unknown structure",
|
|
115
115
|
"phosphateOnLeft": "Phosphate on the left (5')",
|
|
116
116
|
"phosphateOnRight": "Phosphate on the right (3')"
|
|
117
|
+
},
|
|
118
|
+
library: {
|
|
119
|
+
"ambiguousGroup": {
|
|
120
|
+
"bases": "Ambiguous Bases",
|
|
121
|
+
"dnaBases": "Ambiguous DNA Bases",
|
|
122
|
+
"rnaBases": "Ambiguous RNA Bases",
|
|
123
|
+
"sugars": "Ambiguous Sugars",
|
|
124
|
+
"phosphates": "Ambiguous Phosphates",
|
|
125
|
+
"aminoAcids": "Ambiguous Amino Acids",
|
|
126
|
+
"nucleotides": "Ambiguous Nucleotides",
|
|
127
|
+
"chem": "Ambiguous CHEM"
|
|
128
|
+
},
|
|
129
|
+
"noNaturalAnalogue": "No natural analogue"
|
|
117
130
|
}
|
|
118
131
|
},
|
|
119
132
|
macromoleculesDialogs: {
|
|
@@ -218,7 +231,13 @@ var BASE_RESOURCES = {
|
|
|
218
231
|
"openFromFile": "Open from file",
|
|
219
232
|
"openFromImage": "Open from image",
|
|
220
233
|
"orDragFileHere": "or drag file here",
|
|
221
|
-
"imageRecognitionUnavailable": "Image Recognition service is not available"
|
|
234
|
+
"imageRecognitionUnavailable": "Image Recognition service is not available",
|
|
235
|
+
"formats": {
|
|
236
|
+
"sequence": "Sequence",
|
|
237
|
+
"peptide": "Peptide",
|
|
238
|
+
"oneLetterCode": "1-letter code",
|
|
239
|
+
"threeLetterCode": "3-letter code"
|
|
240
|
+
}
|
|
222
241
|
},
|
|
223
242
|
save: {
|
|
224
243
|
"title": "save structure",
|
|
@@ -228,7 +247,12 @@ var BASE_RESOURCES = {
|
|
|
228
247
|
"convertError": "Convert error! {error}",
|
|
229
248
|
"helmSmilesExportNotice": "The molecule will be exported using inline SMILES, and on load will appear as a CHEM monomer",
|
|
230
249
|
"helmAliasExportNotice": "Some of the monomers do not have aliases in the HELM Core Library - they are exported using Ketcher aliases.",
|
|
231
|
-
"sequenceTypeRecognitionError": "Error during sequence type recognition(RNA, DNA or Peptide)"
|
|
250
|
+
"sequenceTypeRecognitionError": "Error during sequence type recognition(RNA, DNA or Peptide)",
|
|
251
|
+
"formats": {
|
|
252
|
+
"sequence1Letter": "Sequence (1-letter code)",
|
|
253
|
+
"sequence3Letter": "Sequence (3-letter code)",
|
|
254
|
+
"svgDocument": "SVG Document"
|
|
255
|
+
}
|
|
232
256
|
},
|
|
233
257
|
updateSequence: {
|
|
234
258
|
"title": "Update sequence",
|
|
@@ -819,10 +843,10 @@ var initialState$3 = {
|
|
|
819
843
|
unipositiveIonsValue: 140,
|
|
820
844
|
oligonucleotidesValue: 200,
|
|
821
845
|
app: {
|
|
822
|
-
buildDate: "2026-11-
|
|
846
|
+
buildDate: "2026-11-23T19:31:04",
|
|
823
847
|
indigoVersion: "",
|
|
824
848
|
indigoMachine: "",
|
|
825
|
-
version: "3.23.0-dev.
|
|
849
|
+
version: "3.23.0-dev.2"
|
|
826
850
|
},
|
|
827
851
|
selectedMenuGroupItems: {}
|
|
828
852
|
};
|
|
@@ -855,6 +879,7 @@ var editorSlice = createSlice({
|
|
|
855
879
|
createEditor: (state, action) => {
|
|
856
880
|
state.monomerLibraryLoadError = null;
|
|
857
881
|
const editor = new CoreEditor({
|
|
882
|
+
ketcherId: action.payload.ketcherId,
|
|
858
883
|
theme: action.payload.theme,
|
|
859
884
|
canvas: action.payload.canvas,
|
|
860
885
|
renderersContainer: new RenderersManager({ theme: action.payload.theme })
|
|
@@ -1003,7 +1028,7 @@ var FAVORITE_ITEMS_UNIQUE_KEYS = "favoriteItemsUniqueKeys";
|
|
|
1003
1028
|
var CUSTOM_PRESETS = "ketcher_custom_presets";
|
|
1004
1029
|
var PRESET_PHOSPHATE_FILTER_STORAGE_KEY = "ketcher_preset_phosphate_filter";
|
|
1005
1030
|
var SEQUENCE_TYPE_STORAGE_KEY = "ketcher_polymer_sequence_type";
|
|
1006
|
-
var NoNaturalAnalogueGroupTitle = "
|
|
1031
|
+
var NoNaturalAnalogueGroupTitle = "macromolecules:library.noNaturalAnalogue";
|
|
1007
1032
|
var LIBRARY_TAB_INDEX = {
|
|
1008
1033
|
FAVORITES: 0,
|
|
1009
1034
|
PEPTIDES: 1,
|
|
@@ -1152,28 +1177,34 @@ var selectAmbiguousMonomersInCategory = (libraryItems, libraryGroupName) => {
|
|
|
1152
1177
|
});
|
|
1153
1178
|
if (ambiguousMonomerLibraryItems.length === 0) return [];
|
|
1154
1179
|
let groupedAmbiguousMonomerLibraryItems = [];
|
|
1180
|
+
const ambiguousGroupKeyByName = {
|
|
1181
|
+
[MonomerGroups.SUGARS]: "macromolecules:library.ambiguousGroup.sugars",
|
|
1182
|
+
[MonomerGroups.PHOSPHATES]: "macromolecules:library.ambiguousGroup.phosphates",
|
|
1183
|
+
[MonomerGroups.PEPTIDES]: "macromolecules:library.ambiguousGroup.aminoAcids",
|
|
1184
|
+
[MonomerGroups.NUCLEOTIDES]: "macromolecules:library.ambiguousGroup.nucleotides"
|
|
1185
|
+
};
|
|
1155
1186
|
if (libraryGroupName === MonomerGroups.BASES) groupedAmbiguousMonomerLibraryItems = [
|
|
1156
1187
|
{
|
|
1157
|
-
groupTitle: "
|
|
1188
|
+
groupTitle: "macromolecules:library.ambiguousGroup.bases",
|
|
1158
1189
|
groupItems: ambiguousMonomerLibraryItems.filter((libraryItem) => {
|
|
1159
1190
|
return isAmbiguousMonomerLibraryItem(libraryItem) && libraryItem.options.every((option) => !option.templateId.toLowerCase().includes("thymine") && !option.templateId.toLowerCase().includes("uracil"));
|
|
1160
1191
|
})
|
|
1161
1192
|
},
|
|
1162
1193
|
{
|
|
1163
|
-
groupTitle: "
|
|
1194
|
+
groupTitle: "macromolecules:library.ambiguousGroup.dnaBases",
|
|
1164
1195
|
groupItems: ambiguousMonomerLibraryItems.filter((libraryItem) => {
|
|
1165
1196
|
return isAmbiguousMonomerLibraryItem(libraryItem) && libraryItem.options.find((option) => option.templateId.toLowerCase().includes("thymine"));
|
|
1166
1197
|
})
|
|
1167
1198
|
},
|
|
1168
1199
|
{
|
|
1169
|
-
groupTitle: "
|
|
1200
|
+
groupTitle: "macromolecules:library.ambiguousGroup.rnaBases",
|
|
1170
1201
|
groupItems: ambiguousMonomerLibraryItems.filter((libraryItem) => {
|
|
1171
1202
|
return isAmbiguousMonomerLibraryItem(libraryItem) && libraryItem.options.find((option) => option.templateId.toLowerCase().includes("uracil"));
|
|
1172
1203
|
})
|
|
1173
1204
|
}
|
|
1174
1205
|
];
|
|
1175
1206
|
else groupedAmbiguousMonomerLibraryItems.push({
|
|
1176
|
-
groupTitle:
|
|
1207
|
+
groupTitle: ambiguousGroupKeyByName[libraryGroupName] ?? "macromolecules:library.ambiguousGroup.chem",
|
|
1177
1208
|
groupItems: ambiguousMonomerLibraryItems
|
|
1178
1209
|
});
|
|
1179
1210
|
const firstAmbiguousMonomersInLibrary = /* @__PURE__ */ new Set(["X", "N"]);
|
|
@@ -2320,15 +2351,15 @@ var LayoutBoundsProvider = ({ children }) => {
|
|
|
2320
2351
|
function useLayoutBounds() {
|
|
2321
2352
|
return useContext(LayoutBoundsContext);
|
|
2322
2353
|
}
|
|
2323
|
-
var Column = /* @__PURE__ */ styled("div", { target: "
|
|
2354
|
+
var Column = /* @__PURE__ */ styled("div", { target: "e7sjpm60" })(({ fullWidth, withPaddingRight }) => ({
|
|
2324
2355
|
width: fullWidth ? "100%" : "fit-content",
|
|
2325
2356
|
display: "flex",
|
|
2326
2357
|
flexDirection: "column",
|
|
2327
2358
|
justifyContent: "space-between",
|
|
2328
2359
|
paddingInlineEnd: withPaddingRight ? "12px" : 0,
|
|
2329
|
-
|
|
2360
|
+
minWidth: fullWidth ? 0 : void 0
|
|
2330
2361
|
}));
|
|
2331
|
-
var RowMain = /* @__PURE__ */ styled("div", { target: "
|
|
2362
|
+
var RowMain = /* @__PURE__ */ styled("div", { target: "e7sjpm61" })(({ theme }) => ({
|
|
2332
2363
|
height: "100%",
|
|
2333
2364
|
width: "100%",
|
|
2334
2365
|
position: "relative",
|
|
@@ -2340,7 +2371,7 @@ var RowMain = /* @__PURE__ */ styled("div", { target: "e9rwxi1" })(({ theme }) =
|
|
|
2340
2371
|
containerType: "size",
|
|
2341
2372
|
overflow: "clip"
|
|
2342
2373
|
}));
|
|
2343
|
-
var Row$1 = /* @__PURE__ */ styled("div", { target: "
|
|
2374
|
+
var Row$1 = /* @__PURE__ */ styled("div", { target: "e7sjpm62" })(({ theme }) => ({
|
|
2344
2375
|
height: "100%",
|
|
2345
2376
|
width: "100%",
|
|
2346
2377
|
position: "relative",
|
|
@@ -2350,16 +2381,16 @@ var Row$1 = /* @__PURE__ */ styled("div", { target: "e9rwxi2" })(({ theme }) =>
|
|
|
2350
2381
|
justifyContent: "space-between",
|
|
2351
2382
|
columnGap: "3px"
|
|
2352
2383
|
}));
|
|
2353
|
-
var BaseLeftRightStyle = /* @__PURE__ */ styled("div", { target: "
|
|
2384
|
+
var BaseLeftRightStyle = /* @__PURE__ */ styled("div", { target: "e7sjpm63" })(({ hide = false }) => ({
|
|
2354
2385
|
height: "100%",
|
|
2355
2386
|
width: "fit-content",
|
|
2356
2387
|
display: hide ? "none" : "flex",
|
|
2357
2388
|
flexDirection: "column"
|
|
2358
2389
|
}));
|
|
2359
|
-
var Left = /* @__PURE__ */ styled(BaseLeftRightStyle, { target: "
|
|
2360
|
-
var Right = /* @__PURE__ */ styled(BaseLeftRightStyle, { target: "
|
|
2361
|
-
var StyledTopInnerDiv = /* @__PURE__ */ styled("div", { target: "
|
|
2362
|
-
var StyledTop = /* @__PURE__ */ styled("div", { target: "
|
|
2390
|
+
var Left = /* @__PURE__ */ styled(BaseLeftRightStyle, { target: "e7sjpm64" })();
|
|
2391
|
+
var Right = /* @__PURE__ */ styled(BaseLeftRightStyle, { target: "e7sjpm65" })();
|
|
2392
|
+
var StyledTopInnerDiv = /* @__PURE__ */ styled("div", { target: "e7sjpm66" })("display:flex;justify-content:space-between;width:100cqw;");
|
|
2393
|
+
var StyledTop = /* @__PURE__ */ styled("div", { target: "e7sjpm67" })(({ shortened = false, theme }) => ({
|
|
2363
2394
|
height: "36px",
|
|
2364
2395
|
width: shortened ? "100%" : `calc(100% - ${MONOMER_HIDE_LIBRARY_BUTTON_WIDTH})`,
|
|
2365
2396
|
marginBottom: "6px",
|
|
@@ -2370,20 +2401,20 @@ var StyledTop = /* @__PURE__ */ styled("div", { target: "e9rwxi7" })(({ shortene
|
|
|
2370
2401
|
borderRadius: "4px",
|
|
2371
2402
|
overflowX: "hidden"
|
|
2372
2403
|
}));
|
|
2373
|
-
var StyledArrowScrollWrapper = /* @__PURE__ */ styled("div", { target: "
|
|
2374
|
-
var Bottom = /* @__PURE__ */ styled("div", { target: "
|
|
2404
|
+
var StyledArrowScrollWrapper = /* @__PURE__ */ styled("div", { target: "e7sjpm68" })("width:42px;height:36px;display:flex;position:relative;inset-inline-end:0;cursor:pointer;background:white;box-shadow:", ({ theme }) => theme.ketcher.shadow.mainLayoutBlocks, ";border-radius:4px;");
|
|
2405
|
+
var Bottom = /* @__PURE__ */ styled("div", { target: "e7sjpm69" })("&:not(:empty){margin-bottom:15px;}");
|
|
2375
2406
|
/** Used only as the `data-testid` attribute value on the canvas area for E2E tests. */
|
|
2376
2407
|
var MACROMOLECULES_MAIN_AREA_TEST_ID = "macromolecules-main-area";
|
|
2377
2408
|
/** Used only as the `data-testid` attribute value on the layout root for E2E tests. */
|
|
2378
2409
|
var MACROMOLECULES_LAYOUT_ROOT_TEST_ID = "macromolecules-layout-root";
|
|
2379
|
-
var Main = /* @__PURE__ */ styled("div", { target: "
|
|
2410
|
+
var Main = /* @__PURE__ */ styled("div", { target: "e7sjpm610" })({
|
|
2380
2411
|
height: "100%",
|
|
2381
2412
|
width: "100%",
|
|
2382
2413
|
position: "relative",
|
|
2383
2414
|
overflow: "hidden"
|
|
2384
2415
|
});
|
|
2385
|
-
var InsideRoot = /* @__PURE__ */ styled("div", { target: "
|
|
2386
|
-
var DummyDiv = /* @__PURE__ */ styled("div", { target: "
|
|
2416
|
+
var InsideRoot = /* @__PURE__ */ styled("div", { target: "e7sjpm611" })({});
|
|
2417
|
+
var DummyDiv = /* @__PURE__ */ styled("div", { target: "e7sjpm612" })({ height: "40px" });
|
|
2387
2418
|
var Top = (props) => {
|
|
2388
2419
|
const [startRef, startInView] = useInView({ threshold: 1 });
|
|
2389
2420
|
const [endRef, endInView] = useInView({ threshold: 1 });
|
|
@@ -2411,7 +2442,7 @@ var Top = (props) => {
|
|
|
2411
2442
|
/* @__PURE__ */ jsx(StyledTopInnerDiv, { children: /* @__PURE__ */ jsx(Fragment, { children }) }),
|
|
2412
2443
|
/* @__PURE__ */ jsx("span", { ref: endRef })
|
|
2413
2444
|
]
|
|
2414
|
-
}), startInView && endInView ?
|
|
2445
|
+
}), startInView && endInView ? void 0 : /* @__PURE__ */ jsx(StyledArrowScrollWrapper, { children: /* @__PURE__ */ jsx(ArrowScroll, {
|
|
2415
2446
|
startInView,
|
|
2416
2447
|
endInView,
|
|
2417
2448
|
scrollBack: scrollLeft,
|
|
@@ -2428,14 +2459,7 @@ var Layout = ({ children }) => {
|
|
|
2428
2459
|
const canvasCallbackRef = useCallback((el) => {
|
|
2429
2460
|
setCanvasElement(el);
|
|
2430
2461
|
}, [setCanvasElement]);
|
|
2431
|
-
const subcomponents = {
|
|
2432
|
-
Left: null,
|
|
2433
|
-
Main: null,
|
|
2434
|
-
Right: null,
|
|
2435
|
-
Top: null,
|
|
2436
|
-
Bottom: null,
|
|
2437
|
-
InsideRoot: null
|
|
2438
|
-
};
|
|
2462
|
+
const subcomponents = {};
|
|
2439
2463
|
React.Children.forEach(children, (child) => {
|
|
2440
2464
|
if (child.type === Left) subcomponents.Left = child;
|
|
2441
2465
|
else if (child.type === Right) subcomponents.Right = child;
|
|
@@ -2444,7 +2468,7 @@ var Layout = ({ children }) => {
|
|
|
2444
2468
|
else if (child.type === Main) subcomponents.Main = child;
|
|
2445
2469
|
else if (child.type === InsideRoot) subcomponents.InsideRoot = child;
|
|
2446
2470
|
});
|
|
2447
|
-
const mainWithRef = subcomponents.Main ? React.cloneElement(subcomponents.Main, { ref: canvasCallbackRef }) :
|
|
2471
|
+
const mainWithRef = subcomponents.Main ? React.cloneElement(subcomponents.Main, { ref: canvasCallbackRef }) : void 0;
|
|
2448
2472
|
return /* @__PURE__ */ jsxs(RowMain, {
|
|
2449
2473
|
ref: layoutRootCallbackRef,
|
|
2450
2474
|
"data-testid": MACROMOLECULES_LAYOUT_ROOT_TEST_ID,
|
|
@@ -3224,6 +3248,14 @@ var MonomerGroup = ({ items, title, groupName, selectedMonomerUniqueKey, library
|
|
|
3224
3248
|
}, getMonomerUniqueKey(monomer));
|
|
3225
3249
|
}) })] });
|
|
3226
3250
|
};
|
|
3251
|
+
// src/helpers/resolveLocalizedTitle.ts
|
|
3252
|
+
/**
|
|
3253
|
+
* Group titles are either namespace-qualified i18n keys
|
|
3254
|
+
* ("macromolecules:library.noNaturalAnalogue") or literal codes ("A", "U").
|
|
3255
|
+
* Only the former are translated; translating a literal would log a spurious
|
|
3256
|
+
* missing-key warning.
|
|
3257
|
+
*/
|
|
3258
|
+
var resolveLocalizedTitle = (title, t) => title?.startsWith("macromolecules:") ? t(title) : title;
|
|
3227
3259
|
// src/components/monomerLibrary/monomerLibraryList/styles.ts
|
|
3228
3260
|
/****************************************************************************
|
|
3229
3261
|
* Copyright 2021 EPAM Systems
|
|
@@ -3642,7 +3674,7 @@ var RnaPresetGroup = ({ presets, duplicatePreset, editPreset }) => {
|
|
|
3642
3674
|
* limitations under the License.
|
|
3643
3675
|
***************************************************************************/
|
|
3644
3676
|
var MonomerList = ({ onItemClick, libraryName, duplicatePreset, editPreset }) => {
|
|
3645
|
-
const { t } = useTranslation("macromoleculesDialogs");
|
|
3677
|
+
const { t } = useTranslation(["macromoleculesDialogs", "macromolecules"]);
|
|
3646
3678
|
const monomers = useAppSelector(selectFilteredMonomers);
|
|
3647
3679
|
const presets = useAppSelector(selectFilteredPresets);
|
|
3648
3680
|
const isFavoriteTab = libraryName === MONOMER_LIBRARY_FAVORITES;
|
|
@@ -3655,8 +3687,9 @@ var MonomerList = ({ onItemClick, libraryName, duplicatePreset, editPreset }) =>
|
|
|
3655
3687
|
return /* @__PURE__ */ jsxs(MonomerListContainer, { children: [
|
|
3656
3688
|
isFavoriteTab && monomerGroups.length > 0 && /* @__PURE__ */ jsx("div", { children: t("monomerLibrary.monomersSectionHeader") }),
|
|
3657
3689
|
monomerGroups.map(({ groupItems, groupTitle }, _index, groups) => {
|
|
3690
|
+
const resolvedTitle = resolveLocalizedTitle(groupTitle, t);
|
|
3658
3691
|
return /* @__PURE__ */ jsx(MonomerGroup, {
|
|
3659
|
-
title: groups.length === 1 ? void 0 :
|
|
3692
|
+
title: groups.length === 1 ? void 0 : resolvedTitle,
|
|
3660
3693
|
items: groupItems,
|
|
3661
3694
|
libraryName,
|
|
3662
3695
|
onItemClick
|
|
@@ -3668,8 +3701,9 @@ var MonomerList = ({ onItemClick, libraryName, duplicatePreset, editPreset }) =>
|
|
|
3668
3701
|
presets: items.presets
|
|
3669
3702
|
})] }),
|
|
3670
3703
|
/* @__PURE__ */ jsx(Fragment, { children: (libraryName === "PEPTIDE" || isFavoriteTab) && ambiguousMonomers.map((group) => {
|
|
3704
|
+
const resolvedTitle = resolveLocalizedTitle(group.groupTitle, t);
|
|
3671
3705
|
return /* @__PURE__ */ jsx(MonomerGroup, {
|
|
3672
|
-
title:
|
|
3706
|
+
title: resolvedTitle,
|
|
3673
3707
|
items: group.groupItems,
|
|
3674
3708
|
libraryName,
|
|
3675
3709
|
onItemClick
|
|
@@ -4064,6 +4098,14 @@ var generateSequenceSelectionName = (labeledNucleoelements) => {
|
|
|
4064
4098
|
const groupNames = generateSequenceSelectionGroupNames(labeledNucleoelements);
|
|
4065
4099
|
return `${groupNames?.Sugars}(${groupNames?.Bases})${groupNames?.Phosphates ?? ""}`;
|
|
4066
4100
|
};
|
|
4101
|
+
var applyMonomerToSequenceSelection = (sequenceSelection, field, groupItem, isBaseGroup) => sequenceSelection.map((node) => {
|
|
4102
|
+
if (node.isNucleosideConnectedAndSelectedWithPhosphate && field === "phosphateLabel" || node.type === Entities.Phosphate && (field === "sugarLabel" || field === "baseLabel")) return node;
|
|
4103
|
+
return {
|
|
4104
|
+
...node,
|
|
4105
|
+
[field]: groupItem.label,
|
|
4106
|
+
rnaBaseMonomerItem: isBaseGroup ? groupItem : node.rnaBaseMonomerItem
|
|
4107
|
+
};
|
|
4108
|
+
});
|
|
4067
4109
|
// src/components/monomerLibrary/RnaBuilder/RnaEditor/RnaEditorExpanded/helpers/resetRnaBuilder.ts
|
|
4068
4110
|
var resetRnaBuilderCommon = (dispatch) => {
|
|
4069
4111
|
dispatch(setActivePresetMonomerGroup(null));
|
|
@@ -4115,13 +4157,6 @@ var RnaEditorExpanded_module_default = {
|
|
|
4115
4157
|
* See the License for the specific language governing permissions and
|
|
4116
4158
|
* limitations under the License.
|
|
4117
4159
|
***************************************************************************/
|
|
4118
|
-
function useLatestRef(value) {
|
|
4119
|
-
const ref = useRef(value);
|
|
4120
|
-
useEffect(() => {
|
|
4121
|
-
ref.current = value;
|
|
4122
|
-
}, [value]);
|
|
4123
|
-
return ref;
|
|
4124
|
-
}
|
|
4125
4160
|
var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
4126
4161
|
const { t } = useTranslation(["macromoleculesDialogs", "common"]);
|
|
4127
4162
|
const groupsData = [
|
|
@@ -4152,6 +4187,21 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4152
4187
|
const activePresetMonomerGroup = useAppSelector(selectActivePresetMonomerGroup);
|
|
4153
4188
|
const [newPreset, setNewPreset] = useState(activePreset);
|
|
4154
4189
|
const [prevActivePreset, setPrevActivePreset] = useState(activePreset);
|
|
4190
|
+
const pendingScrollTimeouts = useRef(/* @__PURE__ */ new Set());
|
|
4191
|
+
useEffect(() => {
|
|
4192
|
+
const timeouts = pendingScrollTimeouts.current;
|
|
4193
|
+
return () => {
|
|
4194
|
+
timeouts.forEach((timeout) => clearTimeout(timeout));
|
|
4195
|
+
timeouts.clear();
|
|
4196
|
+
};
|
|
4197
|
+
}, []);
|
|
4198
|
+
const scheduleLibraryScroll = (callback, delay) => {
|
|
4199
|
+
const timeout = setTimeout(() => {
|
|
4200
|
+
pendingScrollTimeouts.current.delete(timeout);
|
|
4201
|
+
callback();
|
|
4202
|
+
}, delay);
|
|
4203
|
+
pendingScrollTimeouts.current.add(timeout);
|
|
4204
|
+
};
|
|
4155
4205
|
const [selectedPhosphatePosition, setSelectedPhosphatePosition] = useState(activePreset?.connections?.length ? getRnaPresetPhosphatePosition(activePreset) : void 0);
|
|
4156
4206
|
const resolvePhosphatePosition = (preset) => {
|
|
4157
4207
|
if (!preset?.phosphate) return;
|
|
@@ -4166,12 +4216,8 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4166
4216
|
if (isLeftPositionAvailable && !isRightPositionAvailable) return "left";
|
|
4167
4217
|
if (isRightPositionAvailable && !isLeftPositionAvailable) return "right";
|
|
4168
4218
|
};
|
|
4169
|
-
const activeMonomerGroupRef = useLatestRef(activeMonomerGroup);
|
|
4170
|
-
const isEditModeRef = useLatestRef(isEditMode);
|
|
4171
4219
|
const activePresetGroupItem = activePresetMonomerGroup?.groupItem;
|
|
4172
|
-
const activePresetGroupNameRef = useLatestRef(activePresetMonomerGroup?.groupName);
|
|
4173
4220
|
const sequenceSelection = useAppSelector(selectSequenceSelection);
|
|
4174
|
-
const sequenceSelectionRef = useLatestRef(sequenceSelection);
|
|
4175
4221
|
const sequenceSelectionName = useAppSelector(selectSequenceSelectionName);
|
|
4176
4222
|
const isSequenceEditInRNABuilderMode = useAppSelector(isRnaBuilderSequenceEditMode);
|
|
4177
4223
|
const isBaseModificationBlocked = useAppSelector(isRnaBaseModificationBlocked);
|
|
@@ -4184,15 +4230,16 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4184
4230
|
isSequenceEdit: isSequenceEditInRNABuilderMode
|
|
4185
4231
|
});
|
|
4186
4232
|
const sequenceSelectionGroupNames = generateSequenceSelectionGroupNames(sequenceSelection);
|
|
4233
|
+
const displayedSequenceSelectionName = sequenceSelection && getCountOfNucleoelements(sequenceSelection) === 1 ? generateSequenceSelectionName(sequenceSelection) : sequenceSelectionName;
|
|
4187
4234
|
if (isEditMode !== isPreviousEditMode) {
|
|
4188
4235
|
setIsPreviousEditMode(isEditMode);
|
|
4189
4236
|
if (isEditMode) {
|
|
4190
4237
|
setLastAppliedPresetMonomerGroupItem(activePresetGroupItem);
|
|
4191
4238
|
setIsSequenceSelectionUpdated(false);
|
|
4192
4239
|
}
|
|
4193
|
-
} else if (isEditMode &&
|
|
4240
|
+
} else if (isEditMode && activePresetGroupItem && activePresetGroupItem !== lastAppliedPresetMonomerGroupItem && activeMonomerGroup !== RnaBuilderPresetsItem.Presets) {
|
|
4194
4241
|
setLastAppliedPresetMonomerGroupItem(activePresetGroupItem);
|
|
4195
|
-
setIsSequenceSelectionUpdated(true);
|
|
4242
|
+
if (isSequenceEditInRNABuilderMode) setIsSequenceSelectionUpdated(true);
|
|
4196
4243
|
}
|
|
4197
4244
|
const phosphatePosition = resolvePhosphatePosition(newPreset);
|
|
4198
4245
|
const { is3PrimeAvailable, is5PrimeAvailable } = getPhosphatePositionAvailability(newPreset || {});
|
|
@@ -4227,30 +4274,6 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4227
4274
|
};
|
|
4228
4275
|
});
|
|
4229
4276
|
}
|
|
4230
|
-
useEffect(() => {
|
|
4231
|
-
if (sequenceSelection && getCountOfNucleoelements(sequenceSelection) === 1) dispatch(setSequenceSelectionName(generateSequenceSelectionName(sequenceSelection)));
|
|
4232
|
-
}, [dispatch, sequenceSelection]);
|
|
4233
|
-
useEffect(() => {
|
|
4234
|
-
if (!isSequenceEditInRNABuilderMode || !activePresetGroupItem || !isEditModeRef.current || activeMonomerGroupRef.current === RnaBuilderPresetsItem.Presets) return;
|
|
4235
|
-
const field = `${monomerGroupToPresetGroup[activePresetGroupNameRef.current ?? ""]}Label`;
|
|
4236
|
-
const updatedSequenceSelection = sequenceSelectionRef.current.map((node) => {
|
|
4237
|
-
if (field === "phosphateLabel" && node.isNucleosideConnectedAndSelectedWithPhosphate || node.type === Entities.Phosphate && (field === "sugarLabel" || field === "baseLabel")) return node;
|
|
4238
|
-
return {
|
|
4239
|
-
...node,
|
|
4240
|
-
[field]: activePresetGroupItem.label,
|
|
4241
|
-
rnaBaseMonomerItem: activePresetGroupNameRef.current === "Bases" ? activePresetGroupItem : node.rnaBaseMonomerItem
|
|
4242
|
-
};
|
|
4243
|
-
});
|
|
4244
|
-
dispatch(setSequenceSelection(updatedSequenceSelection));
|
|
4245
|
-
}, [
|
|
4246
|
-
isSequenceEditInRNABuilderMode,
|
|
4247
|
-
activePresetGroupItem,
|
|
4248
|
-
dispatch,
|
|
4249
|
-
activeMonomerGroupRef,
|
|
4250
|
-
activePresetGroupNameRef,
|
|
4251
|
-
isEditModeRef,
|
|
4252
|
-
sequenceSelectionRef
|
|
4253
|
-
]);
|
|
4254
4277
|
const scrollToActiveItemInLibrary = (selectedGroup, selectedMonomer) => {
|
|
4255
4278
|
if (selectedGroup === RnaBuilderPresetsItem.Presets) {
|
|
4256
4279
|
scrollToSelectedPreset(newPreset?.name);
|
|
@@ -4261,7 +4284,7 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4261
4284
|
if (activeMonomerInSelectedGroup) scrollToSelectedMonomer(getMonomerUniqueKey(activeMonomerInSelectedGroup));
|
|
4262
4285
|
else if (selectedMonomer) scrollToSelectedMonomer(selectedMonomer);
|
|
4263
4286
|
};
|
|
4264
|
-
const selectGroup = (selectedGroup) =>
|
|
4287
|
+
const selectGroup = (selectedGroup) => {
|
|
4265
4288
|
if (isBaseModificationBlocked && isSequenceEditInRNABuilderMode && selectedGroup === MonomerGroups$1.BASES) editor?.events.error.dispatch(BASE_MODIFICATION_DISABLED_IN_SYNC_MODE);
|
|
4266
4289
|
const selectedRNAPartMonomer = selectCurrentMonomerGroup(newPreset, selectedGroup);
|
|
4267
4290
|
if (selectedRNAPartMonomer && !isSequenceMode) editor?.events.selectMonomer.dispatch(selectedRNAPartMonomer);
|
|
@@ -4283,7 +4306,7 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4283
4306
|
}
|
|
4284
4307
|
}
|
|
4285
4308
|
}
|
|
4286
|
-
|
|
4309
|
+
scheduleLibraryScroll(() => scrollToActiveItemInLibrary(selectedGroup, selectedMonomer), 100);
|
|
4287
4310
|
};
|
|
4288
4311
|
const onChangeName = (event) => {
|
|
4289
4312
|
if (isEditMode) {
|
|
@@ -4345,7 +4368,7 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4345
4368
|
"aria-label": t("monomerLibrary.selectPhosphatePositionAriaLabel"),
|
|
4346
4369
|
children: renderPhosphateTriggerIcon(triggerPosition, isPhosphateGroupActive)
|
|
4347
4370
|
}) })
|
|
4348
|
-
}), isTriggerDisabled || shouldShowPhosphatePositionTooltip ?
|
|
4371
|
+
}), isTriggerDisabled || shouldShowPhosphatePositionTooltip ? void 0 : /* @__PURE__ */ jsxs("div", {
|
|
4349
4372
|
className: RnaEditorExpanded_module_default.phosphatePositionSelector,
|
|
4350
4373
|
children: [renderPhosphatePositionOption("left", !is5PrimeAvailable), renderPhosphatePositionOption("right", !is3PrimeAvailable)]
|
|
4351
4374
|
})]
|
|
@@ -4383,7 +4406,7 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4383
4406
|
dispatch(savePreset(presetToSave));
|
|
4384
4407
|
dispatch(setActivePreset(presetToSave));
|
|
4385
4408
|
if (!isSequenceMode) editor?.events.selectPreset.dispatch(presetToSave);
|
|
4386
|
-
|
|
4409
|
+
scheduleLibraryScroll(() => {
|
|
4387
4410
|
scrollToSelectedPreset(presetName);
|
|
4388
4411
|
}, 0);
|
|
4389
4412
|
resetRnaBuilder(dispatch);
|
|
@@ -4490,17 +4513,17 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4490
4513
|
className: clsx(isSequenceEditInRNABuilderMode && "rna-editor-expanded--sequence-edit-mode"),
|
|
4491
4514
|
children: [
|
|
4492
4515
|
isCompactView ? /* @__PURE__ */ jsx(CompactViewName, {
|
|
4493
|
-
value: isSequenceEditInRNABuilderMode ?
|
|
4516
|
+
value: isSequenceEditInRNABuilderMode ? displayedSequenceSelectionName : newPreset?.name,
|
|
4494
4517
|
placeholder: t("monomerLibrary.nameYourStructure"),
|
|
4495
4518
|
"data-testid": "name-your-structure-editbox",
|
|
4496
4519
|
disabled: isSequenceEditInRNABuilderMode,
|
|
4497
|
-
onClick: selectGroup(RnaBuilderPresetsItem.Presets),
|
|
4520
|
+
onClick: () => selectGroup(RnaBuilderPresetsItem.Presets),
|
|
4498
4521
|
onChange: onChangeName
|
|
4499
4522
|
}) : /* @__PURE__ */ jsxs(NameContainer, {
|
|
4500
4523
|
selected: activeMonomerGroup === RnaBuilderPresetsItem.Presets,
|
|
4501
|
-
onClick: selectGroup(RnaBuilderPresetsItem.Presets),
|
|
4524
|
+
onClick: () => selectGroup(RnaBuilderPresetsItem.Presets),
|
|
4502
4525
|
children: [isEditMode ? /* @__PURE__ */ jsx(NameInput, {
|
|
4503
|
-
value: isSequenceEditInRNABuilderMode ?
|
|
4526
|
+
value: isSequenceEditInRNABuilderMode ? displayedSequenceSelectionName : newPreset?.name,
|
|
4504
4527
|
placeholder: t("monomerLibrary.nameYourStructure"),
|
|
4505
4528
|
"data-testid": "name-your-structure-editbox",
|
|
4506
4529
|
disabled: isSequenceEditInRNABuilderMode,
|
|
@@ -4517,8 +4540,8 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4517
4540
|
monomerName: isSequenceEditInRNABuilderMode ? getMonomersName(groupName) : getMonomerName(groupName),
|
|
4518
4541
|
iconName,
|
|
4519
4542
|
testid: testId,
|
|
4520
|
-
onClick: selectGroup(groupName),
|
|
4521
|
-
children: isPhosphateGroup ? renderPhosphatePositionSelector(phosphatePosition) :
|
|
4543
|
+
onClick: () => selectGroup(groupName),
|
|
4544
|
+
children: isPhosphateGroup ? renderPhosphatePositionSelector(phosphatePosition) : void 0
|
|
4522
4545
|
}, groupName);
|
|
4523
4546
|
})
|
|
4524
4547
|
}),
|
|
@@ -4657,8 +4680,8 @@ var Modal_module_default = {
|
|
|
4657
4680
|
draggableHeader: "Modal-module_draggableHeader__2FY4V"
|
|
4658
4681
|
};
|
|
4659
4682
|
// src/components/shared/modal/Modal.tsx
|
|
4660
|
-
var StyledDialog = /* @__PURE__ */ styled(Dialog, { target: "
|
|
4661
|
-
var Header$1 = /* @__PURE__ */ styled(DialogTitle, { target: "
|
|
4683
|
+
var StyledDialog = /* @__PURE__ */ styled(Dialog, { target: "evy8q2c0" })(".MuiPaper-root{min-width:304px;}");
|
|
4684
|
+
var Header$1 = /* @__PURE__ */ styled(DialogTitle, { target: "evy8q2c1" })(({ theme, hideborder }) => ({
|
|
4662
4685
|
padding: "2px 4px 2px 12px",
|
|
4663
4686
|
display: "flex",
|
|
4664
4687
|
alignItems: "center",
|
|
@@ -4669,17 +4692,17 @@ var Header$1 = /* @__PURE__ */ styled(DialogTitle, { target: "e1gf4okc1" })(({ t
|
|
|
4669
4692
|
textTransform: "capitalize",
|
|
4670
4693
|
borderBottom: hideborder ? "none" : "1px solid rgba(202, 211, 221, 1)"
|
|
4671
4694
|
}));
|
|
4672
|
-
var Title = /* @__PURE__ */ styled("div", { target: "
|
|
4695
|
+
var Title = /* @__PURE__ */ styled("div", { target: "evy8q2c2" })({
|
|
4673
4696
|
marginInlineEnd: "10px",
|
|
4674
4697
|
fontSize: "14px"
|
|
4675
4698
|
});
|
|
4676
|
-
var StyledIcon$1 = /* @__PURE__ */ styled(Icon, { target: "
|
|
4699
|
+
var StyledIcon$1 = /* @__PURE__ */ styled(Icon, { target: "evy8q2c3" })({
|
|
4677
4700
|
width: "16px",
|
|
4678
4701
|
height: "16px",
|
|
4679
4702
|
color: "rgba(51, 51, 51, 1)"
|
|
4680
4703
|
});
|
|
4681
|
-
var Content = /* @__PURE__ */ styled(DialogContent, { target: "
|
|
4682
|
-
var Footer = /* @__PURE__ */ styled(DialogActions, { target: "
|
|
4704
|
+
var Content = /* @__PURE__ */ styled(DialogContent, { target: "evy8q2c4" })("padding:0;font-size:", ({ theme }) => theme.ketcher.font.size.medium, ";line-height:17px;color:#000000;", ({ theme }) => scrollbarThin(theme), ";");
|
|
4705
|
+
var Footer = /* @__PURE__ */ styled(DialogActions, { target: "evy8q2c5" })("height:52px;margin:0;padding:0 12px;border-top:", ({ theme, withborder }) => withborder === "true" ? theme.ketcher.border.small : "none", ";justify-content:flex-end;.MuiButtonBase-root{border-radius:4px;font-size:", ({ theme }) => theme.ketcher.font.size.regular, ";}");
|
|
4683
4706
|
var Modal = ({ children, title, isOpen, showCloseButton = true, showExpandButton = false, onClose, className, modalWidth, expanded = false, setExpanded = EmptyFunction, testId, hideHeaderBorder, isDraggable = false, isResizable = true, repositionKey }) => {
|
|
4684
4707
|
const { t } = useTranslation("macromoleculesDialogs");
|
|
4685
4708
|
const theme = useTheme();
|
|
@@ -4786,10 +4809,7 @@ var Modal = ({ children, title, isOpen, showCloseButton = true, showExpandButton
|
|
|
4786
4809
|
background: theme.ketcher.color.background.overlay,
|
|
4787
4810
|
opacity: .4
|
|
4788
4811
|
} }), [theme.ketcher.color.background.overlay]);
|
|
4789
|
-
const subcomponents = {
|
|
4790
|
-
Content: null,
|
|
4791
|
-
Footer: null
|
|
4792
|
-
};
|
|
4812
|
+
const subcomponents = {};
|
|
4793
4813
|
React.Children.forEach(children, (child) => {
|
|
4794
4814
|
if (child.type === Content) subcomponents.Content = child;
|
|
4795
4815
|
else if (child.type === Footer) subcomponents.Footer = child;
|
|
@@ -5156,7 +5176,7 @@ var groupNameToTabLabelKey = {
|
|
|
5156
5176
|
};
|
|
5157
5177
|
// src/components/monomerLibrary/RnaBuilder/RnaElementsView/RnaElementsTabsView.tsx
|
|
5158
5178
|
var RnaElementsTabsView = ({ activeRnaBuilderItem, groupsData, onNewPresetClick, onSelectItem, duplicatePreset, editPreset, libraryName }) => {
|
|
5159
|
-
const { t } = useTranslation("macromoleculesDialogs");
|
|
5179
|
+
const { t } = useTranslation(["macromoleculesDialogs", "macromolecules"]);
|
|
5160
5180
|
const dispatch = useDispatch();
|
|
5161
5181
|
const presets = useAppSelector(selectFilteredPresets);
|
|
5162
5182
|
const monomers = useAppSelector(selectFilteredMonomers);
|
|
@@ -5172,7 +5192,7 @@ var RnaElementsTabsView = ({ activeRnaBuilderItem, groupsData, onNewPresetClick,
|
|
|
5172
5192
|
const variantMonomers = selectAmbiguousMonomersInCategory(monomers, groupName);
|
|
5173
5193
|
const quantity = [...groups, ...variantMonomers].reduce((acc, group) => acc + (group.groupItems.length || 0), 0);
|
|
5174
5194
|
const label = t(groupNameToTabLabelKey[groupName]);
|
|
5175
|
-
const caption = isSelected ? `${label} (${quantity})` :
|
|
5195
|
+
const caption = isSelected ? `${label} (${quantity})` : void 0;
|
|
5176
5196
|
return /* @__PURE__ */ jsx(RnaTabWrapper, {
|
|
5177
5197
|
className: clsx(isSelected && "rna-tab--selected"),
|
|
5178
5198
|
children: /* @__PURE__ */ jsx(RnaTab, {
|
|
@@ -5186,7 +5206,7 @@ var RnaElementsTabsView = ({ activeRnaBuilderItem, groupsData, onNewPresetClick,
|
|
|
5186
5206
|
}, groupName);
|
|
5187
5207
|
}) }), groupsData.map((groupData) => {
|
|
5188
5208
|
const { groupName, groups } = groupData;
|
|
5189
|
-
if (groupName !== activeRnaBuilderItem) return
|
|
5209
|
+
if (groupName !== activeRnaBuilderItem) return;
|
|
5190
5210
|
const variantMonomers = selectAmbiguousMonomersInCategory(monomers, groupName);
|
|
5191
5211
|
const details = groupName === RnaBuilderPresetsItem.Presets ? /* @__PURE__ */ jsxs(DetailsContainer, {
|
|
5192
5212
|
compact: true,
|
|
@@ -5220,20 +5240,26 @@ var RnaElementsTabsView = ({ activeRnaBuilderItem, groupsData, onNewPresetClick,
|
|
|
5220
5240
|
]
|
|
5221
5241
|
}) : /* @__PURE__ */ jsx(DetailsContainer, {
|
|
5222
5242
|
compact: true,
|
|
5223
|
-
children: /* @__PURE__ */ jsxs(Fragment, { children: [groups.map(({ groupItems, groupTitle }) =>
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5243
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [groups.map(({ groupItems, groupTitle }) => {
|
|
5244
|
+
const resolvedTitle = resolveLocalizedTitle(groupTitle, t);
|
|
5245
|
+
return /* @__PURE__ */ jsx(MonomerGroup, {
|
|
5246
|
+
title: [MonomerGroups$1.BASES, MonomerGroups$1.NUCLEOTIDES].includes(groupName) || groups.length > 1 ? resolvedTitle : void 0,
|
|
5247
|
+
groupName,
|
|
5248
|
+
items: groupItems,
|
|
5249
|
+
selectedMonomerUniqueKey: activeMonomerKey,
|
|
5250
|
+
onItemClick: (monomer) => onSelectItem(monomer, groupName)
|
|
5251
|
+
}, groupTitle);
|
|
5252
|
+
}), variantMonomers.map(({ groupTitle, groupItems }) => {
|
|
5253
|
+
const resolvedTitle = resolveLocalizedTitle(groupTitle, t);
|
|
5254
|
+
return /* @__PURE__ */ jsx(MonomerGroup, {
|
|
5255
|
+
title: resolvedTitle,
|
|
5256
|
+
items: groupItems,
|
|
5257
|
+
groupName,
|
|
5258
|
+
libraryName,
|
|
5259
|
+
selectedMonomerUniqueKey: activeMonomerKey,
|
|
5260
|
+
onItemClick: (monomer) => onSelectItem(monomer, groupName)
|
|
5261
|
+
}, groupTitle);
|
|
5262
|
+
})] })
|
|
5237
5263
|
});
|
|
5238
5264
|
const isFirstTabSelected = activeRnaBuilderItem === RnaBuilderPresetsItem.Presets;
|
|
5239
5265
|
const isLastTabSelected = activeRnaBuilderItem === MonomerGroups$1.NUCLEOTIDES;
|
|
@@ -5280,7 +5306,7 @@ var Summary = ({ groupName, label, quantity, expanded, iconName }) => {
|
|
|
5280
5306
|
};
|
|
5281
5307
|
// src/components/monomerLibrary/RnaBuilder/RnaElementsView/RnaElementsAccordionView.tsx
|
|
5282
5308
|
var RnaElementsAccordionView = ({ activeRnaBuilderItem, groupsData, newPreset, onNewPresetClick, onSelectItem, duplicatePreset, editPreset, libraryName }) => {
|
|
5283
|
-
const { t } = useTranslation("macromoleculesDialogs");
|
|
5309
|
+
const { t } = useTranslation(["macromoleculesDialogs", "macromolecules"]);
|
|
5284
5310
|
const dispatch = useDispatch();
|
|
5285
5311
|
const presets = useAppSelector(selectFilteredPresets);
|
|
5286
5312
|
const monomers = useAppSelector(selectFilteredMonomers);
|
|
@@ -5297,7 +5323,7 @@ var RnaElementsAccordionView = ({ activeRnaBuilderItem, groupsData, newPreset, o
|
|
|
5297
5323
|
setExpandedAccordion(activeRnaBuilderItem);
|
|
5298
5324
|
}
|
|
5299
5325
|
const handleAccordionSummaryClick = (rnaBuilderItem) => {
|
|
5300
|
-
if (expandedAccordion === rnaBuilderItem) setExpandedAccordion(
|
|
5326
|
+
if (expandedAccordion === rnaBuilderItem) setExpandedAccordion(void 0);
|
|
5301
5327
|
else {
|
|
5302
5328
|
setExpandedAccordion(rnaBuilderItem);
|
|
5303
5329
|
dispatch(recalculateRnaBuilderValidations({
|
|
@@ -5350,21 +5376,25 @@ var RnaElementsAccordionView = ({ activeRnaBuilderItem, groupsData, newPreset, o
|
|
|
5350
5376
|
MonomerGroups$1.NUCLEOTIDES,
|
|
5351
5377
|
MonomerGroups$1.PEPTIDES
|
|
5352
5378
|
].includes(groupData.groupName);
|
|
5379
|
+
const resolvedTitle = resolveLocalizedTitle(groupTitle, t);
|
|
5353
5380
|
return /* @__PURE__ */ jsx(MonomerGroup, {
|
|
5354
|
-
title: shouldShowTitle ?
|
|
5381
|
+
title: shouldShowTitle ? resolvedTitle : void 0,
|
|
5355
5382
|
groupName: groupData.groupName,
|
|
5356
5383
|
items: groupItems,
|
|
5357
5384
|
selectedMonomerUniqueKey: activeMonomerKey,
|
|
5358
5385
|
onItemClick: (monomer) => onSelectItem(monomer, groupData.groupName)
|
|
5359
5386
|
}, groupTitle);
|
|
5360
|
-
}), variantMonomers.map((group) =>
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5387
|
+
}), variantMonomers.map((group) => {
|
|
5388
|
+
const resolvedTitle = resolveLocalizedTitle(group.groupTitle, t);
|
|
5389
|
+
return /* @__PURE__ */ jsx(MonomerGroup, {
|
|
5390
|
+
title: resolvedTitle,
|
|
5391
|
+
items: group.groupItems,
|
|
5392
|
+
groupName: groupData.groupName,
|
|
5393
|
+
libraryName,
|
|
5394
|
+
selectedMonomerUniqueKey: activeMonomerKey,
|
|
5395
|
+
onItemClick: (monomer) => onSelectItem(monomer, groupData.groupName)
|
|
5396
|
+
}, group.groupTitle);
|
|
5397
|
+
})] }) });
|
|
5368
5398
|
return groupData.groupName === RnaBuilderPresetsItem.Presets && isExpanded ? /* @__PURE__ */ jsx(StyledAccordionWrapper, { children: /* @__PURE__ */ jsx(StyledAccordion, {
|
|
5369
5399
|
"data-testid": "styled-accordion",
|
|
5370
5400
|
dataTestIdDetails: `rna-accordion-details-${groupData.groupName}`,
|
|
@@ -5391,6 +5421,7 @@ var RnaElements = ({ view, libraryName, duplicatePreset, editPreset }) => {
|
|
|
5391
5421
|
const isEditMode = useAppSelector(isRnaBuilderEditMode);
|
|
5392
5422
|
const editor = useAppSelector(selectEditor);
|
|
5393
5423
|
const isSequenceEditInRNABuilderMode = useAppSelector(isRnaBuilderSequenceEditMode);
|
|
5424
|
+
const sequenceSelection = useAppSelector(selectSequenceSelection);
|
|
5394
5425
|
const [newPreset, setNewPreset] = useState(activePreset);
|
|
5395
5426
|
const [prevBuilderState, setPrevBuilderState] = useState({
|
|
5396
5427
|
activePreset,
|
|
@@ -5427,12 +5458,17 @@ var RnaElements = ({ view, libraryName, duplicatePreset, editPreset }) => {
|
|
|
5427
5458
|
groupItem: monomer
|
|
5428
5459
|
}));
|
|
5429
5460
|
dispatch(setActiveRnaBuilderItem(groupName));
|
|
5461
|
+
if (isSequenceEditInRNABuilderMode && sequenceSelection) {
|
|
5462
|
+
const field = `${monomerGroupToPresetGroup[groupName]}Label`;
|
|
5463
|
+
dispatch(setSequenceSelection(applyMonomerToSequenceSelection(sequenceSelection, field, monomer, groupName === MonomerGroups$1.BASES)));
|
|
5464
|
+
}
|
|
5430
5465
|
}, [
|
|
5431
5466
|
dispatch,
|
|
5432
5467
|
editor,
|
|
5433
5468
|
isEditMode,
|
|
5434
5469
|
isSequenceEditInRNABuilderMode,
|
|
5435
|
-
newPreset
|
|
5470
|
+
newPreset,
|
|
5471
|
+
sequenceSelection
|
|
5436
5472
|
]);
|
|
5437
5473
|
return /* @__PURE__ */ jsx(RnaAccordionContainer, {
|
|
5438
5474
|
"data-testid": "rna-accordion",
|
|
@@ -5596,7 +5632,6 @@ var getDeleteConfirmation = (isOnCanvas, hasReferencingPresets) => {
|
|
|
5596
5632
|
if (isOnCanvas && hasReferencingPresets) return DELETE_CONFIRMATION.onCanvasAndInPreset;
|
|
5597
5633
|
if (isOnCanvas) return DELETE_CONFIRMATION.onCanvas;
|
|
5598
5634
|
if (hasReferencingPresets) return DELETE_CONFIRMATION.inPreset;
|
|
5599
|
-
return null;
|
|
5600
5635
|
};
|
|
5601
5636
|
// src/components/monomerLibrary/MonomerLibraryContextMenu.tsx
|
|
5602
5637
|
var MonomerLibraryContextMenu = () => {
|
|
@@ -5868,10 +5903,10 @@ var baseStyle = {
|
|
|
5868
5903
|
flexDirection: "column",
|
|
5869
5904
|
justifyContent: "space-between"
|
|
5870
5905
|
};
|
|
5871
|
-
var StyledIcon = /* @__PURE__ */ styled(Icon, { target: "
|
|
5906
|
+
var StyledIcon = /* @__PURE__ */ styled(Icon, { target: "e10arzxy0" })("filter:", ({ disabled }) => disabled ? "grayscale(1)" : "", ";opacity:", ({ disabled }) => disabled ? "0.6" : "1", ";");
|
|
5872
5907
|
var activeStyle = { backgroundColor: "#F8FEFFFF" };
|
|
5873
|
-
var ButtonContainer$1 = /* @__PURE__ */ styled("div", { target: "
|
|
5874
|
-
var DropzoneButton = /* @__PURE__ */ styled("button", { target: "
|
|
5908
|
+
var ButtonContainer$1 = /* @__PURE__ */ styled("div", { target: "e10arzxy1" })("display:flex;flex-direction:column;align-items:center;& > span{font-size:", ({ theme }) => theme.ketcher.font.size.small, ";color:", ({ theme }) => theme.ketcher.color.text.primary, ";opacity:50%;}& > svg{margin-bottom:8px;}");
|
|
5909
|
+
var DropzoneButton = /* @__PURE__ */ styled("button", { target: "e10arzxy2" })("all:unset;width:100%;height:100%;display:flex;align-items:center;flex-direction:column;justify-content:space-between;cursor:pointer;&:disabled{cursor:default;}");
|
|
5875
5910
|
var FileDrop = ({ textLabel, iconName, disabled, disabledText, ...rest }) => {
|
|
5876
5911
|
const { t } = useTranslation("macromoleculesDialogs");
|
|
5877
5912
|
const { getRootProps, getInputProps, isDragActive, open } = useDropzone({
|
|
@@ -6018,7 +6053,7 @@ TextArea.displayName = "TextArea";
|
|
|
6018
6053
|
* See the License for the specific language governing permissions and
|
|
6019
6054
|
* limitations under the License.
|
|
6020
6055
|
***************************************************************************/
|
|
6021
|
-
var StyledTextField = /* @__PURE__ */ styled(TextArea, { target: "
|
|
6056
|
+
var StyledTextField = /* @__PURE__ */ styled(TextArea, { target: "e15986w80" })("width:100%;height:320px;");
|
|
6022
6057
|
var ViewSwitcher = (props) => {
|
|
6023
6058
|
if (props.isAnalyzingFile) return /* @__PURE__ */ jsx(AnalyzingFile, { fileName: props.fileName });
|
|
6024
6059
|
else switch (props.currentState) {
|
|
@@ -6098,8 +6133,8 @@ var ChevronIcon = ({ className }) => /* @__PURE__ */ jsx(ChevronStyled, {
|
|
|
6098
6133
|
* See the License for the specific language governing permissions and
|
|
6099
6134
|
* limitations under the License.
|
|
6100
6135
|
***************************************************************************/
|
|
6101
|
-
var StyledFormControl = /* @__PURE__ */ styled(FormControl, { target: "
|
|
6102
|
-
var DropDownSelect = /* @__PURE__ */ styled(Select, { target: "
|
|
6136
|
+
var StyledFormControl = /* @__PURE__ */ styled(FormControl, { target: "eastnt70" })("width:100%;padding:0 8px;& label{font-size:12px;line-height:unset;}");
|
|
6137
|
+
var DropDownSelect = /* @__PURE__ */ styled(Select, { target: "eastnt71" })("height:24px;border:1px solid #e1e5ea;border-radius:4px;font-size:12px;background-color:white;", ({ open }) => open && css`
|
|
6103
6138
|
background-color: white;
|
|
6104
6139
|
border-end-start-radius: 0;
|
|
6105
6140
|
border-end-end-radius: 0;
|
|
@@ -6111,7 +6146,7 @@ var stylesForExpanded$1 = {
|
|
|
6111
6146
|
borderRadius: "0px 0px 2px 2px",
|
|
6112
6147
|
boxShadow: "0 6px 10px rgba(103, 104, 132, 0.15)"
|
|
6113
6148
|
};
|
|
6114
|
-
var DropDownItem = /* @__PURE__ */ styled(MenuItem, { target: "
|
|
6149
|
+
var DropDownItem = /* @__PURE__ */ styled(MenuItem, { target: "eastnt72" })("display:flex;flex-direction:row;justify-content:space-between;padding:0 8px;height:28px;font-size:12px;&.MuiButtonBase-root:hover{border-inline-start:2px solid #167782;}& .MuiTypography-root{", ({ theme }) => `font-size: ${theme.ketcher.font.size.regular}`, "}");
|
|
6115
6150
|
var DropDown = ({ options, currentSelection, selectionHandler, className, label, testId, customStylesForExpanded = {}, disabled = false }) => {
|
|
6116
6151
|
const [expanded, setExpanded] = useState(false);
|
|
6117
6152
|
const portalContainer = !!document.fullscreenElement ? document.querySelector("#root") : void 0;
|
|
@@ -6218,6 +6253,16 @@ var PreviewContainer$1 = /* @__PURE__ */ styled("div", { target: "e1mrd8ci5" })(
|
|
|
6218
6253
|
"&:focus-within button": { opacity: 0 },
|
|
6219
6254
|
"&:focus-within button:hover": { opacity: 1 }
|
|
6220
6255
|
}));
|
|
6256
|
+
// src/helpers/localizeOptions.ts
|
|
6257
|
+
/**
|
|
6258
|
+
* Returns a copy of the options where every entry that declares a `labelKey`
|
|
6259
|
+
* gets its `label` replaced by the translation. Entries without a `labelKey`
|
|
6260
|
+
* are returned as is, so the English `label` remains their fallback.
|
|
6261
|
+
*/
|
|
6262
|
+
var localizeOptions = (options, t) => options.map((option) => option.labelKey ? {
|
|
6263
|
+
...option,
|
|
6264
|
+
label: t(option.labelKey)
|
|
6265
|
+
} : option);
|
|
6221
6266
|
// src/components/modal/Open/Open.tsx
|
|
6222
6267
|
/****************************************************************************
|
|
6223
6268
|
* Copyright 2021 EPAM Systems
|
|
@@ -6234,24 +6279,24 @@ var PreviewContainer$1 = /* @__PURE__ */ styled("div", { target: "e1mrd8ci5" })(
|
|
|
6234
6279
|
* See the License for the specific language governing permissions and
|
|
6235
6280
|
* limitations under the License.
|
|
6236
6281
|
***************************************************************************/
|
|
6237
|
-
var OpenModal = /* @__PURE__ */ styled(Modal, { target: "
|
|
6282
|
+
var OpenModal = /* @__PURE__ */ styled(Modal, { target: "ek5blzu0" })(({ modalWidth }) => `
|
|
6238
6283
|
.MuiPaper-root {
|
|
6239
6284
|
width: ${modalWidth};
|
|
6240
6285
|
max-width: ${modalWidth};
|
|
6241
6286
|
}`);
|
|
6242
|
-
var OpenFooter = /* @__PURE__ */ styled("div", { target: "
|
|
6287
|
+
var OpenFooter = /* @__PURE__ */ styled("div", { target: "ek5blzu1" })({
|
|
6243
6288
|
width: "100%",
|
|
6244
6289
|
display: "flex",
|
|
6245
6290
|
flexDirection: "row",
|
|
6246
6291
|
justifyContent: "space-between",
|
|
6247
6292
|
alignItems: "center"
|
|
6248
6293
|
});
|
|
6249
|
-
var FooterSelectorContainer = /* @__PURE__ */ styled("div", { target: "
|
|
6294
|
+
var FooterSelectorContainer = /* @__PURE__ */ styled("div", { target: "ek5blzu2" })({
|
|
6250
6295
|
display: "flex",
|
|
6251
6296
|
height: "24px",
|
|
6252
6297
|
fontSize: "12px"
|
|
6253
6298
|
});
|
|
6254
|
-
var StyledDropdown = /* @__PURE__ */ styled(StyledDropdown$1, { target: "
|
|
6299
|
+
var StyledDropdown = /* @__PURE__ */ styled(StyledDropdown$1, { target: "ek5blzu3" })({
|
|
6255
6300
|
padding: 0,
|
|
6256
6301
|
fontSize: "12px",
|
|
6257
6302
|
"& .MuiSelect-select": {
|
|
@@ -6264,20 +6309,20 @@ var StyledDropdown = /* @__PURE__ */ styled(StyledDropdown$1, { target: "egt08gw
|
|
|
6264
6309
|
},
|
|
6265
6310
|
"& span": { fontSize: "12px" }
|
|
6266
6311
|
});
|
|
6267
|
-
var FooterFormatSelector = /* @__PURE__ */ styled(StyledDropdown, { target: "
|
|
6268
|
-
var FooterSequenceSelector = /* @__PURE__ */ styled(StyledDropdown, { target: "
|
|
6312
|
+
var FooterFormatSelector = /* @__PURE__ */ styled(StyledDropdown, { target: "ek5blzu4" })(() => ({ width: "140px" }));
|
|
6313
|
+
var FooterSequenceSelector = /* @__PURE__ */ styled(StyledDropdown, { target: "ek5blzu5" })({
|
|
6269
6314
|
width: "76px",
|
|
6270
6315
|
marginInlineStart: "8px"
|
|
6271
6316
|
});
|
|
6272
|
-
var FooterPeptideLettersSelector = /* @__PURE__ */ styled(StyledDropdown, { target: "
|
|
6317
|
+
var FooterPeptideLettersSelector = /* @__PURE__ */ styled(StyledDropdown, { target: "ek5blzu6" })({
|
|
6273
6318
|
width: "105px",
|
|
6274
6319
|
marginInlineStart: "8px"
|
|
6275
6320
|
});
|
|
6276
|
-
var FooterButtonContainer = /* @__PURE__ */ styled("div", { target: "
|
|
6321
|
+
var FooterButtonContainer = /* @__PURE__ */ styled("div", { target: "ek5blzu7" })({
|
|
6277
6322
|
display: "flex",
|
|
6278
6323
|
gap: "10px"
|
|
6279
6324
|
});
|
|
6280
|
-
var FooterButton = /* @__PURE__ */ styled(ActionButton, { target: "
|
|
6325
|
+
var FooterButton = /* @__PURE__ */ styled(ActionButton, { target: "ek5blzu8" })({ width: "min-content" });
|
|
6281
6326
|
var KET = "ket";
|
|
6282
6327
|
var SEQ = "seq";
|
|
6283
6328
|
var RNA = "rna";
|
|
@@ -6285,7 +6330,7 @@ var PEPTIDE = "peptide";
|
|
|
6285
6330
|
var FASTA = "fasta";
|
|
6286
6331
|
var ONE_LETTER = "one-letter";
|
|
6287
6332
|
var THREE_LETTER = "three-letter";
|
|
6288
|
-
var
|
|
6333
|
+
var formatOptionsConfig = [
|
|
6289
6334
|
{
|
|
6290
6335
|
id: "ket",
|
|
6291
6336
|
label: "Ket Format"
|
|
@@ -6296,7 +6341,8 @@ var options$1 = [
|
|
|
6296
6341
|
},
|
|
6297
6342
|
{
|
|
6298
6343
|
id: "seq",
|
|
6299
|
-
label: "Sequence"
|
|
6344
|
+
label: "Sequence",
|
|
6345
|
+
labelKey: "open.formats.sequence"
|
|
6300
6346
|
},
|
|
6301
6347
|
{
|
|
6302
6348
|
id: "fasta",
|
|
@@ -6319,7 +6365,7 @@ var options$1 = [
|
|
|
6319
6365
|
label: "BILN"
|
|
6320
6366
|
}
|
|
6321
6367
|
];
|
|
6322
|
-
var
|
|
6368
|
+
var additionalOptionsConfig = [
|
|
6323
6369
|
{
|
|
6324
6370
|
id: RNA,
|
|
6325
6371
|
label: "RNA"
|
|
@@ -6330,15 +6376,18 @@ var additionalOptions = [
|
|
|
6330
6376
|
},
|
|
6331
6377
|
{
|
|
6332
6378
|
id: PEPTIDE,
|
|
6333
|
-
label: "Peptide"
|
|
6379
|
+
label: "Peptide",
|
|
6380
|
+
labelKey: "open.formats.peptide"
|
|
6334
6381
|
}
|
|
6335
6382
|
];
|
|
6336
|
-
var
|
|
6383
|
+
var peptideLettersFormatOptionsConfig = [{
|
|
6337
6384
|
id: ONE_LETTER,
|
|
6338
|
-
label: "1-letter code"
|
|
6385
|
+
label: "1-letter code",
|
|
6386
|
+
labelKey: "open.formats.oneLetterCode"
|
|
6339
6387
|
}, {
|
|
6340
6388
|
id: THREE_LETTER,
|
|
6341
|
-
label: "3-letter code"
|
|
6389
|
+
label: "3-letter code",
|
|
6390
|
+
labelKey: "open.formats.threeLetterCode"
|
|
6342
6391
|
}];
|
|
6343
6392
|
var inputFormats = macromoleculesFilesInputFormats;
|
|
6344
6393
|
var positionStructureOnNextSequenceLine = (drawingEntitiesManager) => {
|
|
@@ -6440,6 +6489,9 @@ var isAnalyzingFile = false;
|
|
|
6440
6489
|
var errorHandler = (error) => void 0;
|
|
6441
6490
|
var Open = ({ isModalOpen, onClose }) => {
|
|
6442
6491
|
const { t } = useTranslation("macromoleculesDialogs");
|
|
6492
|
+
const options = useMemo(() => localizeOptions(formatOptionsConfig, t), [t]);
|
|
6493
|
+
const additionalOptions = useMemo(() => localizeOptions(additionalOptionsConfig, t), [t]);
|
|
6494
|
+
const peptideLettersFormatOptions = useMemo(() => localizeOptions(peptideLettersFormatOptionsConfig, t), [t]);
|
|
6443
6495
|
const dispatch = useAppDispatch();
|
|
6444
6496
|
const [structStr, setStructStr] = useState("");
|
|
6445
6497
|
const [fileName, setFileName] = useState("");
|
|
@@ -6450,9 +6502,10 @@ var Open = ({ isModalOpen, onClose }) => {
|
|
|
6450
6502
|
const [additionalSelection, setAdditionalSelection] = useState(RNA);
|
|
6451
6503
|
const [peptideLettersFormatSelection, setPeptideLettersFormatSelection] = useState(ONE_LETTER);
|
|
6452
6504
|
useEffect(() => {
|
|
6453
|
-
|
|
6505
|
+
(async () => {
|
|
6506
|
+
const chosenOpener = await fileOpener();
|
|
6454
6507
|
setOpener({ chosenOpener });
|
|
6455
|
-
});
|
|
6508
|
+
})();
|
|
6456
6509
|
}, []);
|
|
6457
6510
|
const onCloseCallback = useCallback(() => {
|
|
6458
6511
|
setCurrentState(MODAL_STATES.openOptions);
|
|
@@ -6476,11 +6529,17 @@ var Open = ({ isModalOpen, onClose }) => {
|
|
|
6476
6529
|
const fileExtension = (fileName?.split(".")).at(-1);
|
|
6477
6530
|
setFileName(fileName);
|
|
6478
6531
|
if (fileExtension) {
|
|
6479
|
-
const option =
|
|
6532
|
+
const option = formatOptionsConfig.find((el) => el.id === fileExtension);
|
|
6480
6533
|
const id = option?.id ? option.id : SEQ;
|
|
6481
6534
|
setFormatSelection(id);
|
|
6482
6535
|
}
|
|
6483
|
-
opener
|
|
6536
|
+
if (opener) (async () => {
|
|
6537
|
+
try {
|
|
6538
|
+
onLoad(await opener.chosenOpener(files[0]));
|
|
6539
|
+
} catch {
|
|
6540
|
+
onError();
|
|
6541
|
+
}
|
|
6542
|
+
})();
|
|
6484
6543
|
};
|
|
6485
6544
|
const addToCanvasHandler = () => {
|
|
6486
6545
|
onOk({
|
|
@@ -6514,7 +6573,7 @@ var Open = ({ isModalOpen, onClose }) => {
|
|
|
6514
6573
|
};
|
|
6515
6574
|
const renderFooter = () => /* @__PURE__ */ jsxs(OpenFooter, { children: [/* @__PURE__ */ jsxs(FooterSelectorContainer, { children: [
|
|
6516
6575
|
/* @__PURE__ */ jsx(FooterFormatSelector, {
|
|
6517
|
-
options
|
|
6576
|
+
options,
|
|
6518
6577
|
currentSelection: formatSelection,
|
|
6519
6578
|
selectionHandler: setFormatSelection,
|
|
6520
6579
|
customStylesForExpanded: stylesForExpanded
|
|
@@ -6525,13 +6584,13 @@ var Open = ({ isModalOpen, onClose }) => {
|
|
|
6525
6584
|
selectionHandler: setAdditionalSelection,
|
|
6526
6585
|
customStylesForExpanded: stylesForExpanded,
|
|
6527
6586
|
testId: "dropdown-select-type"
|
|
6528
|
-
}, additionalSelection) :
|
|
6587
|
+
}, additionalSelection) : void 0,
|
|
6529
6588
|
formatSelection === SEQ && additionalSelection === PEPTIDE ? /* @__PURE__ */ jsx(FooterPeptideLettersSelector, {
|
|
6530
6589
|
options: peptideLettersFormatOptions,
|
|
6531
6590
|
currentSelection: peptideLettersFormatSelection,
|
|
6532
6591
|
selectionHandler: setPeptideLettersFormatSelection,
|
|
6533
6592
|
testId: "dropdown-select-peptide-letters-format"
|
|
6534
|
-
}) :
|
|
6593
|
+
}) : void 0
|
|
6535
6594
|
] }), /* @__PURE__ */ jsxs(FooterButtonContainer, { children: [/* @__PURE__ */ jsx(FooterButton, {
|
|
6536
6595
|
disabled: !structStr.trim(),
|
|
6537
6596
|
clickHandler: openHandler,
|
|
@@ -6715,7 +6774,7 @@ var getPropertiesByFormat = (format) => {
|
|
|
6715
6774
|
* See the License for the specific language governing permissions and
|
|
6716
6775
|
* limitations under the License.
|
|
6717
6776
|
***************************************************************************/
|
|
6718
|
-
var
|
|
6777
|
+
var optionsConfig = [
|
|
6719
6778
|
{
|
|
6720
6779
|
id: "ket",
|
|
6721
6780
|
label: "Ket Format"
|
|
@@ -6726,11 +6785,13 @@ var options = [
|
|
|
6726
6785
|
},
|
|
6727
6786
|
{
|
|
6728
6787
|
id: "sequence",
|
|
6729
|
-
label: "Sequence (1-letter code)"
|
|
6788
|
+
label: "Sequence (1-letter code)",
|
|
6789
|
+
labelKey: "save.formats.sequence1Letter"
|
|
6730
6790
|
},
|
|
6731
6791
|
{
|
|
6732
6792
|
id: "sequence-3-letter",
|
|
6733
|
-
label: "Sequence (3-letter code)"
|
|
6793
|
+
label: "Sequence (3-letter code)",
|
|
6794
|
+
labelKey: "save.formats.sequence3Letter"
|
|
6734
6795
|
},
|
|
6735
6796
|
{
|
|
6736
6797
|
id: "fasta",
|
|
@@ -6746,7 +6807,8 @@ var options = [
|
|
|
6746
6807
|
},
|
|
6747
6808
|
{
|
|
6748
6809
|
id: "svg",
|
|
6749
|
-
label: "SVG Document"
|
|
6810
|
+
label: "SVG Document",
|
|
6811
|
+
labelKey: "save.formats.svgDocument"
|
|
6750
6812
|
},
|
|
6751
6813
|
{
|
|
6752
6814
|
id: "helm",
|
|
@@ -6767,7 +6829,7 @@ var formatDetector = {
|
|
|
6767
6829
|
helm: ChemicalMimeType.HELM,
|
|
6768
6830
|
biln: ChemicalMimeType.BILN
|
|
6769
6831
|
};
|
|
6770
|
-
var StyledModal$1 = /* @__PURE__ */ styled(Modal, { target: "
|
|
6832
|
+
var StyledModal$1 = /* @__PURE__ */ styled(Modal, { target: "e89ny8p0" })({
|
|
6771
6833
|
"& div.MuiPaper-root": {
|
|
6772
6834
|
background: "white",
|
|
6773
6835
|
minHeight: "400px",
|
|
@@ -6780,6 +6842,7 @@ var StyledModal$1 = /* @__PURE__ */ styled(Modal, { target: "eom3gfk0" })({
|
|
|
6780
6842
|
});
|
|
6781
6843
|
var Save = ({ onClose, isModalOpen }) => {
|
|
6782
6844
|
const { t } = useTranslation("macromoleculesDialogs");
|
|
6845
|
+
const options = useMemo(() => localizeOptions(optionsConfig, t), [t]);
|
|
6783
6846
|
const dispatch = useAppDispatch();
|
|
6784
6847
|
const indigo = IndigoProvider.getIndigo();
|
|
6785
6848
|
const editor = provideEditorInstance();
|
|
@@ -7289,19 +7352,19 @@ var ConnectionOverview = ({ firstMonomer, secondMonomer, expanded, firstMonomerO
|
|
|
7289
7352
|
] }) });
|
|
7290
7353
|
};
|
|
7291
7354
|
// src/components/modal/monomerConnection/MonomerConnections.tsx
|
|
7292
|
-
var StyledModal = /* @__PURE__ */ styled(Modal, { target: "
|
|
7355
|
+
var StyledModal = /* @__PURE__ */ styled(Modal, { target: "eq3wxrv0" })({
|
|
7293
7356
|
"& .MuiPaper-root": { background: "#fff !important" },
|
|
7294
7357
|
"& .MuiDialogContent-root": { overflow: "hidden" }
|
|
7295
7358
|
});
|
|
7296
|
-
var ActionButtonLeft = /* @__PURE__ */ styled(ActionButton, { target: "
|
|
7297
|
-
var ActionButtonRight = /* @__PURE__ */ styled(ActionButton, { target: "
|
|
7359
|
+
var ActionButtonLeft = /* @__PURE__ */ styled(ActionButton, { target: "eq3wxrv1" })(() => ({ width: "97px !important" }));
|
|
7360
|
+
var ActionButtonRight = /* @__PURE__ */ styled(ActionButton, { target: "eq3wxrv2" })((props) => ({
|
|
7298
7361
|
width: "97px !important",
|
|
7299
7362
|
color: props.disabled ? "rgba(51, 51, 51, 0.6)" : "",
|
|
7300
7363
|
background: props.disabled ? "rgba(225, 229, 234, 1) !important" : "",
|
|
7301
7364
|
opacity: "1 !important",
|
|
7302
7365
|
minHeight: "0"
|
|
7303
7366
|
}));
|
|
7304
|
-
var ActionButtonAttachmentPoint = /* @__PURE__ */ styled(ActionButton, { target: "
|
|
7367
|
+
var ActionButtonAttachmentPoint = /* @__PURE__ */ styled(ActionButton, { target: "eq3wxrv3" })((props) => ({
|
|
7305
7368
|
borderRadius: 5,
|
|
7306
7369
|
minWidth: "45px !important",
|
|
7307
7370
|
padding: "4px",
|
|
@@ -7397,11 +7460,11 @@ function AttachmentPointSelectionPanel({ monomer, selectedAttachmentPoint, onSel
|
|
|
7397
7460
|
const getLeavingGroup = (attachmentPoint) => {
|
|
7398
7461
|
const MonomerCaps = monomer.monomerCaps;
|
|
7399
7462
|
const isAmbiguousMonomer = monomer instanceof AmbiguousMonomer;
|
|
7400
|
-
if (!MonomerCaps) return isAmbiguousMonomer ?
|
|
7401
|
-
return MonomerCaps[attachmentPoint]
|
|
7463
|
+
if (!MonomerCaps) return isAmbiguousMonomer ? void 0 : "H";
|
|
7464
|
+
return MonomerCaps[attachmentPoint];
|
|
7402
7465
|
};
|
|
7403
7466
|
const handleSelectAttachmentPoint = (attachmentPoint) => {
|
|
7404
|
-
const selectedBond = selectedAttachmentPoint ? monomer.attachmentPointsToBonds[selectedAttachmentPoint] :
|
|
7467
|
+
const selectedBond = selectedAttachmentPoint ? monomer.attachmentPointsToBonds[selectedAttachmentPoint] : void 0;
|
|
7405
7468
|
if (selectedAttachmentPoint && selectedBond) monomer.removeBond(selectedBond);
|
|
7406
7469
|
setConnectedAttachmentPoints(getConnectedAttachmentPoints(monomer.attachmentPointsToBonds));
|
|
7407
7470
|
onSelectAttachmentPoint(attachmentPoint);
|
|
@@ -7434,7 +7497,7 @@ function AttachmentPointSelectionPanel({ monomer, selectedAttachmentPoint, onSel
|
|
|
7434
7497
|
function getDefaultAttachmentPoint(monomer) {
|
|
7435
7498
|
if (monomer.chosenFirstAttachmentPointForBond) return monomer.chosenFirstAttachmentPointForBond;
|
|
7436
7499
|
if (monomer.chosenSecondAttachmentPointForBond) return monomer.chosenSecondAttachmentPointForBond;
|
|
7437
|
-
const possibleAttachmentPoints = Object.entries(monomer.attachmentPointsToBonds).filter(([_, bond]) => bond ==
|
|
7500
|
+
const possibleAttachmentPoints = Object.entries(monomer.attachmentPointsToBonds).filter(([_, bond]) => bond == void 0);
|
|
7438
7501
|
if (possibleAttachmentPoints.length === 1) {
|
|
7439
7502
|
const [attachmentPointName] = possibleAttachmentPoints[0];
|
|
7440
7503
|
return attachmentPointName;
|
|
@@ -8097,7 +8160,7 @@ var SettingsPanelAdapter = ({ isModalOpen, onClose }) => {
|
|
|
8097
8160
|
"macromoleculesDialogs"
|
|
8098
8161
|
]);
|
|
8099
8162
|
const settingsService = globalThis.ketcher?.settingsService;
|
|
8100
|
-
const [currentSettings, setCurrentSettings] = useState(
|
|
8163
|
+
const [currentSettings, setCurrentSettings] = useState();
|
|
8101
8164
|
const [isLoading, setIsLoading] = useState(false);
|
|
8102
8165
|
const { canvasElement, layoutRootElement } = useLayoutBounds();
|
|
8103
8166
|
useEffect(() => {
|
|
@@ -8113,7 +8176,7 @@ var SettingsPanelAdapter = ({ isModalOpen, onClose }) => {
|
|
|
8113
8176
|
setCurrentSettings((previous) => previous ? {
|
|
8114
8177
|
...previous,
|
|
8115
8178
|
[name]: value
|
|
8116
|
-
} :
|
|
8179
|
+
} : void 0);
|
|
8117
8180
|
};
|
|
8118
8181
|
const handleApply = async () => {
|
|
8119
8182
|
if (!settingsService || !currentSettings) return;
|
|
@@ -9124,7 +9187,7 @@ function useSetRnaPresets() {
|
|
|
9124
9187
|
customPresets = getPresets(monomersLibrary, customLabeledPresets);
|
|
9125
9188
|
}
|
|
9126
9189
|
dispatch(loadMonomerLibrary(monomersLibrary));
|
|
9127
|
-
dispatch(setFavoriteMonomersFromLocalStorage(
|
|
9190
|
+
dispatch(setFavoriteMonomersFromLocalStorage(void 0));
|
|
9128
9191
|
dispatch(setDefaultPresets(defaultPresets));
|
|
9129
9192
|
if (customLabeledPresets) dispatch(setCustomPresets(customPresets));
|
|
9130
9193
|
dispatch(setFavoritePresetsFromLocalStorage());
|
|
@@ -9141,7 +9204,7 @@ function useSetRnaPresets() {
|
|
|
9141
9204
|
// src/hooks/useMacromoleculesHotkeys.ts
|
|
9142
9205
|
function useMacromoleculesHotkeys() {
|
|
9143
9206
|
useEffect(() => {
|
|
9144
|
-
const helpUrl = `https://github.com/epam/ketcher/blob/v3.23.0-dev.
|
|
9207
|
+
const helpUrl = `https://github.com/epam/ketcher/blob/v3.23.0-dev.2/documentation/help.md#ketcher-macromolecules-mode`;
|
|
9145
9208
|
const handler = guardForMacromoleculesEditor((e) => {
|
|
9146
9209
|
if (e.defaultPrevented) return;
|
|
9147
9210
|
const target = e.target;
|
|
@@ -9342,7 +9405,7 @@ var SubMenu = ({ children, vertical = false, autoSize = false, disabled = false,
|
|
|
9342
9405
|
KETCHER_MACROMOLECULES_ROOT_NODE_SELECTOR
|
|
9343
9406
|
]);
|
|
9344
9407
|
const selectedMenuGroupItem = useAppSelector(selectSelectedMenuGroupItem(subMenuId));
|
|
9345
|
-
const lastActiveOption = subMenuId ? selectedMenuGroupItem :
|
|
9408
|
+
const lastActiveOption = subMenuId ? selectedMenuGroupItem : void 0;
|
|
9346
9409
|
const handleDropDownClick = () => {
|
|
9347
9410
|
if (disabled) return;
|
|
9348
9411
|
setOpen((prev) => !prev);
|
|
@@ -9409,16 +9472,18 @@ var SubMenu = ({ children, vertical = false, autoSize = false, disabled = false,
|
|
|
9409
9472
|
* See the License for the specific language governing permissions and
|
|
9410
9473
|
* limitations under the License.
|
|
9411
9474
|
***************************************************************************/
|
|
9412
|
-
var MenuLayout = /* @__PURE__ */ styled("div", { target: "
|
|
9475
|
+
var MenuLayout = /* @__PURE__ */ styled("div", { target: "ed4gkg0" })(({ theme, isHorizontal }) => ({
|
|
9413
9476
|
backgroundColor: theme.ketcher.color.background.primary,
|
|
9414
9477
|
borderRadius: "4px",
|
|
9478
|
+
boxShadow: isHorizontal ? "none" : theme.ketcher.shadow.mainLayoutBlocks,
|
|
9479
|
+
padding: isHorizontal ? void 0 : "2px 0",
|
|
9415
9480
|
display: "flex",
|
|
9416
9481
|
flexDirection: isHorizontal ? "row" : "column",
|
|
9417
9482
|
zIndex: theme.ketcher.zIndex.toolbar
|
|
9418
9483
|
}));
|
|
9419
|
-
var Divider = /* @__PURE__ */ styled("hr", { target: "
|
|
9420
|
-
var VerticalDivider = /* @__PURE__ */ styled("hr", { target: "
|
|
9421
|
-
var StyledGroup = /* @__PURE__ */ styled("div", { target: "
|
|
9484
|
+
var Divider = /* @__PURE__ */ styled("hr", { target: "ed4gkg1" })("width:18px;margin:6px 0;align-self:center;border-width:thin 0px 0px 0px;border-style:solid;border-color:", ({ theme }) => theme.ketcher.color.divider, ";");
|
|
9485
|
+
var VerticalDivider = /* @__PURE__ */ styled("hr", { target: "ed4gkg2" })("height:18px;margin:0px 6px;align-self:center;border-width:0px thin 0px 0px;border-style:solid;border-color:", ({ theme }) => theme.ketcher.color.divider, ";");
|
|
9486
|
+
var StyledGroup = /* @__PURE__ */ styled("div", { target: "ed4gkg3" })(({ theme, isHorizontal }) => ({
|
|
9422
9487
|
display: "flex",
|
|
9423
9488
|
flexDirection: isHorizontal ? "row" : "column",
|
|
9424
9489
|
flexWrap: "nowrap",
|
|
@@ -9462,7 +9527,7 @@ var Menu$1 = ({ children, onItemClick, activeMenuItems, testId, isHorizontal })
|
|
|
9462
9527
|
}
|
|
9463
9528
|
}), [activeMenuItems, onItemClick]);
|
|
9464
9529
|
const subComponents = React.Children.map(children, (child) => {
|
|
9465
|
-
return child?.type === Group ? child :
|
|
9530
|
+
return child?.type === Group ? child : void 0;
|
|
9466
9531
|
});
|
|
9467
9532
|
return /* @__PURE__ */ jsx(MenuContext.Provider, {
|
|
9468
9533
|
value: context,
|
|
@@ -9791,7 +9856,7 @@ var isCycleExistsForSelectedMonomers = (selectedMonomers) => {
|
|
|
9791
9856
|
return false;
|
|
9792
9857
|
};
|
|
9793
9858
|
for (const monomer of selectedMonomers) if (!visited.has(monomer)) {
|
|
9794
|
-
if (hasCycleFromMonomer(monomer
|
|
9859
|
+
if (hasCycleFromMonomer(monomer)) return true;
|
|
9795
9860
|
}
|
|
9796
9861
|
return false;
|
|
9797
9862
|
};
|
|
@@ -10216,14 +10281,14 @@ var useAttachmentPoints = ({ monomerCaps, attachmentPointsToBonds }) => {
|
|
|
10216
10281
|
// src/components/preview/hooks/useIDTAliasesTextForMonomer.ts
|
|
10217
10282
|
var useIDTAliasesTextForMonomer = ({ idtAliases, attachmentPointsToBonds }) => {
|
|
10218
10283
|
return useMemo(() => {
|
|
10219
|
-
if (!idtAliases) return
|
|
10284
|
+
if (!idtAliases) return;
|
|
10220
10285
|
const { base, modifications } = idtAliases;
|
|
10221
10286
|
if (!modifications) return removeSlashesFromIdtAlias(base);
|
|
10222
10287
|
const { endpoint5, internal, endpoint3 } = modifications;
|
|
10223
10288
|
if (attachmentPointsToBonds) {
|
|
10224
10289
|
const { R1, R2 } = attachmentPointsToBonds;
|
|
10225
|
-
const hasR1Connection = R1 !=
|
|
10226
|
-
const hasR2Connection = R2 !=
|
|
10290
|
+
const hasR1Connection = R1 != void 0;
|
|
10291
|
+
const hasR2Connection = R2 != void 0;
|
|
10227
10292
|
if (hasR1Connection && !hasR2Connection) return removeSlashesFromIdtAlias(endpoint3 ?? internal);
|
|
10228
10293
|
else if (!hasR1Connection && hasR2Connection) return removeSlashesFromIdtAlias(endpoint5 ?? internal);
|
|
10229
10294
|
else if (hasR1Connection && hasR2Connection) return removeSlashesFromIdtAlias(internal ?? endpoint5 ?? endpoint3);
|
|
@@ -10405,7 +10470,7 @@ var PhosphatePositionIconWrapper = /* @__PURE__ */ styled("span", { target: "eys
|
|
|
10405
10470
|
// src/components/preview/hooks/useIDTAliasesTextForPreset.ts
|
|
10406
10471
|
var useIDTAliasesTextForPreset = ({ presetName, position, idtAliases }) => {
|
|
10407
10472
|
return useMemo(() => {
|
|
10408
|
-
if (!presetName || !idtAliases) return
|
|
10473
|
+
if (!presetName || !idtAliases) return;
|
|
10409
10474
|
if (presetName.includes("MOE")) {
|
|
10410
10475
|
const { base, modifications } = idtAliases;
|
|
10411
10476
|
const endpoint5 = removeSlashesFromIdtAlias(modifications?.endpoint5) ?? `5${base}`;
|
|
@@ -10497,7 +10562,7 @@ var PresetPreview = ({ className }) => {
|
|
|
10497
10562
|
"data-phosphate-position": preview.phosphatePosition,
|
|
10498
10563
|
children: /* @__PURE__ */ jsx(PhosphatePositionIcon, { name: phosphatePositionIconName })
|
|
10499
10564
|
})
|
|
10500
|
-
] }, monomer.props.id ?? index) :
|
|
10565
|
+
] }, monomer.props.id ?? index) : void 0),
|
|
10501
10566
|
isMonomerPreviewPropertiesVisible && /* @__PURE__ */ jsx(MonomerPreviewProperties, {
|
|
10502
10567
|
preset: true,
|
|
10503
10568
|
idtAliasesText: idtAliasesText ?? void 0,
|
|
@@ -10506,7 +10571,7 @@ var PresetPreview = ({ className }) => {
|
|
|
10506
10571
|
]
|
|
10507
10572
|
});
|
|
10508
10573
|
};
|
|
10509
|
-
var PresetStyledPreview = /* @__PURE__ */ styled(PresetPreview, { target: "
|
|
10574
|
+
var PresetStyledPreview = /* @__PURE__ */ styled(PresetPreview, { target: "e106wyr50" })();
|
|
10510
10575
|
// src/components/preview/components/BondPreview/BondPreview.styles.ts
|
|
10511
10576
|
var Container$1 = /* @__PURE__ */ styled("div", { target: "eirlsnj0" })("display:flex;flex-direction:column;align-items:start;gap:8px;background:", (props) => props.theme.ketcher.color.background.primary, ";border:", (props) => props.theme.ketcher.border.regular, ";border-radius:", (props) => props.theme.ketcher.border.radius.regular, ";box-shadow:", (props) => props.theme.ketcher.shadow.regular, ";");
|
|
10512
10577
|
// src/components/preview/components/BondAttachmentPoints/BondAttachmentPoints.styles.ts
|
|
@@ -10742,7 +10807,7 @@ var persistSequenceType = (sequenceType) => {
|
|
|
10742
10807
|
localStorageWrapper.setItem(SEQUENCE_TYPE_STORAGE_KEY, sequenceType);
|
|
10743
10808
|
};
|
|
10744
10809
|
// src/components/ZoomControls/helpers.ts
|
|
10745
|
-
var hotkeysShortcuts = generateMenuShortcuts(
|
|
10810
|
+
var hotkeysShortcuts = generateMenuShortcuts(hotkeysConfig);
|
|
10746
10811
|
var getIntegerFromString = (zoomInput) => {
|
|
10747
10812
|
const zoomNumber = Number.parseInt(zoomInput ?? "");
|
|
10748
10813
|
if (Number.isNaN(zoomNumber)) return 0;
|
|
@@ -11870,7 +11935,7 @@ function LeftMenuComponent() {
|
|
|
11870
11935
|
testId: "hand",
|
|
11871
11936
|
disabled: isSettingsPanelOpen
|
|
11872
11937
|
}),
|
|
11873
|
-
/* @__PURE__ */
|
|
11938
|
+
/* @__PURE__ */ jsxs(Menu$1.Submenu, {
|
|
11874
11939
|
testId: "select-drop-down-button",
|
|
11875
11940
|
disabled: isSettingsPanelOpen,
|
|
11876
11941
|
subMenuId: SELECT_SUBMENU_ID,
|
|
@@ -11895,7 +11960,7 @@ function LeftMenuComponent() {
|
|
|
11895
11960
|
disabled: isSettingsPanelOpen
|
|
11896
11961
|
})
|
|
11897
11962
|
]
|
|
11898
|
-
})
|
|
11963
|
+
}),
|
|
11899
11964
|
/* @__PURE__ */ jsx(Menu$1.Item, {
|
|
11900
11965
|
itemId: "erase",
|
|
11901
11966
|
title: t("leftMenu.erase", { shortcut: hotkeysShortcuts.erase }),
|
|
@@ -11995,7 +12060,7 @@ var ZoomControls = () => {
|
|
|
11995
12060
|
const { t } = useTranslation("macromolecules");
|
|
11996
12061
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
11997
12062
|
const [currentZoom, setCurrentZoom] = useState(100);
|
|
11998
|
-
const [containerElement, setContainerElement] = useState(
|
|
12063
|
+
const [containerElement, setContainerElement] = useState();
|
|
11999
12064
|
const inputRef = useRef(null);
|
|
12000
12065
|
const zoomTool = useAppSelector(selectEditor)?.zoomTool;
|
|
12001
12066
|
useEffect(() => {
|
|
@@ -12642,7 +12707,7 @@ var SequenceSyncEditModeButton = () => {
|
|
|
12642
12707
|
};
|
|
12643
12708
|
// src/components/Ruler/useTranslateAlongXAxis.ts
|
|
12644
12709
|
var useTranslateAlongXAxis = (ref, offsetX) => {
|
|
12645
|
-
const animateRef = useRef(
|
|
12710
|
+
const animateRef = useRef(void 0);
|
|
12646
12711
|
useLayoutEffect(() => {
|
|
12647
12712
|
const element = ref.current;
|
|
12648
12713
|
if (!element) return;
|
|
@@ -12652,7 +12717,7 @@ var useTranslateAlongXAxis = (ref, offsetX) => {
|
|
|
12652
12717
|
return () => {
|
|
12653
12718
|
if (animateRef.current) {
|
|
12654
12719
|
cancelAnimationFrame(animateRef.current);
|
|
12655
|
-
animateRef.current =
|
|
12720
|
+
animateRef.current = void 0;
|
|
12656
12721
|
}
|
|
12657
12722
|
};
|
|
12658
12723
|
}, [ref, offsetX]);
|
|
@@ -12670,23 +12735,23 @@ var RulerInput = ({ lineLengthValue, offsetX, isDragging, layoutMode, onCommitVa
|
|
|
12670
12735
|
const ref = useRef(null);
|
|
12671
12736
|
useTranslateAlongXAxis(ref, offsetX);
|
|
12672
12737
|
const stringifiedLineLengthValue = lineLengthValue.toString();
|
|
12673
|
-
const [editingValue, setEditingValue] = useState(
|
|
12674
|
-
const displayValue = editingValue
|
|
12738
|
+
const [editingValue, setEditingValue] = useState();
|
|
12739
|
+
const displayValue = editingValue ?? stringifiedLineLengthValue;
|
|
12675
12740
|
const handleChange = (event) => {
|
|
12676
12741
|
setEditingValue(event.target.value);
|
|
12677
12742
|
};
|
|
12678
12743
|
const handleBlur = () => {
|
|
12679
12744
|
if (!editingValue || editingValue.trim() === "") {
|
|
12680
|
-
setEditingValue(
|
|
12745
|
+
setEditingValue(void 0);
|
|
12681
12746
|
return;
|
|
12682
12747
|
}
|
|
12683
12748
|
const newValue = Number(editingValue);
|
|
12684
12749
|
if (Number.isNaN(newValue) || newValue < 1) {
|
|
12685
|
-
setEditingValue(
|
|
12750
|
+
setEditingValue(void 0);
|
|
12686
12751
|
return;
|
|
12687
12752
|
}
|
|
12688
12753
|
const newLineLength = layoutMode === "sequence-layout-mode" ? Math.round(newValue / 10) * 10 : newValue;
|
|
12689
|
-
setEditingValue(
|
|
12754
|
+
setEditingValue(void 0);
|
|
12690
12755
|
onCommitValue(newLineLength);
|
|
12691
12756
|
};
|
|
12692
12757
|
const handleKeyDown = (event) => {
|
|
@@ -12715,7 +12780,7 @@ var RulerInput_default = memo(RulerInput);
|
|
|
12715
12780
|
var SnakeModeItemWidth = SnakeLayoutCellWidth;
|
|
12716
12781
|
// src/components/Ruler/RulerScale.tsx
|
|
12717
12782
|
var RulerScale = ({ transform, layoutMode }) => {
|
|
12718
|
-
const [svgElement, setSvgElement] = useState(
|
|
12783
|
+
const [svgElement, setSvgElement] = useState();
|
|
12719
12784
|
const isZoomedOut = transform.k - .5 < Number.EPSILON;
|
|
12720
12785
|
const getDynamicPositions = (visibleStart, visibleEnd, step, offset) => {
|
|
12721
12786
|
const startIndex = Math.max(0, Math.floor((visibleStart - offset) / step));
|
|
@@ -12882,7 +12947,7 @@ var useZoomTransform = () => {
|
|
|
12882
12947
|
// src/components/Ruler/RulerArea.tsx
|
|
12883
12948
|
var getVisibleEdges = (canvasContainer, fallbackWidth) => {
|
|
12884
12949
|
const visibleWidth = canvasContainer?.clientWidth || fallbackWidth;
|
|
12885
|
-
if (!visibleWidth) return
|
|
12950
|
+
if (!visibleWidth) return;
|
|
12886
12951
|
const left = canvasContainer?.scrollLeft || 0;
|
|
12887
12952
|
return {
|
|
12888
12953
|
left,
|
|
@@ -13041,11 +13106,11 @@ var GhostRnaPreset = ({ preset }) => {
|
|
|
13041
13106
|
const phosphateRenderer = phosphate ? (() => {
|
|
13042
13107
|
const [PhosphateMonomer, PhosphateRenderer] = monomerFactory(phosphate);
|
|
13043
13108
|
return new PhosphateRenderer(new PhosphateMonomer(phosphate));
|
|
13044
|
-
})() :
|
|
13109
|
+
})() : void 0;
|
|
13045
13110
|
const baseRenderer = base ? (() => {
|
|
13046
13111
|
const [BaseMonomer, BaseRenderer] = monomerFactory(base);
|
|
13047
13112
|
return new BaseRenderer(new BaseMonomer(base));
|
|
13048
|
-
})() :
|
|
13113
|
+
})() : void 0;
|
|
13049
13114
|
const sugarSize = sugarRenderer.monomerSize;
|
|
13050
13115
|
const phosphateSize = phosphateRenderer?.monomerSize;
|
|
13051
13116
|
const baseSize = baseRenderer?.monomerSize;
|
|
@@ -13241,9 +13306,9 @@ var GhostMonomer = ({ monomerItem }) => {
|
|
|
13241
13306
|
// src/components/DragGhost/DragGhost.tsx
|
|
13242
13307
|
var DragGhost = () => {
|
|
13243
13308
|
const editor = useSelector(selectEditor);
|
|
13244
|
-
const [libraryItemDragData, setLibraryItemDragData] = useState(
|
|
13309
|
+
const [libraryItemDragData, setLibraryItemDragData] = useState();
|
|
13245
13310
|
const ghostWrapperRef = useRef(null);
|
|
13246
|
-
const animateRef = useRef(
|
|
13311
|
+
const animateRef = useRef(void 0);
|
|
13247
13312
|
const canvasBBoxRef = useRef(null);
|
|
13248
13313
|
const transform = useZoomTransform();
|
|
13249
13314
|
useEffect(() => {
|
|
@@ -13278,7 +13343,7 @@ var DragGhost = () => {
|
|
|
13278
13343
|
return () => {
|
|
13279
13344
|
if (animateRef.current) {
|
|
13280
13345
|
cancelAnimationFrame(animateRef.current);
|
|
13281
|
-
animateRef.current =
|
|
13346
|
+
animateRef.current = void 0;
|
|
13282
13347
|
}
|
|
13283
13348
|
};
|
|
13284
13349
|
}, [
|
|
@@ -13572,7 +13637,7 @@ function ButtonsComponents() {
|
|
|
13572
13637
|
iconName: "help",
|
|
13573
13638
|
title: t("buttons.help"),
|
|
13574
13639
|
onClick: () => {
|
|
13575
|
-
window.open(`https://github.com/epam/ketcher/blob/v3.23.0-dev.
|
|
13640
|
+
window.open(`https://github.com/epam/ketcher/blob/v3.23.0-dev.2/documentation/help.md#ketcher-macromolecules-mode`, "_blank");
|
|
13576
13641
|
},
|
|
13577
13642
|
testId: "help-button"
|
|
13578
13643
|
}),
|
|
@@ -13740,12 +13805,13 @@ function EditorContainer({ onInit, ketcherId, theme, togglerComponent, monomersL
|
|
|
13740
13805
|
})
|
|
13741
13806
|
});
|
|
13742
13807
|
}
|
|
13743
|
-
function Editor({ theme, togglerComponent, monomersLibraryUpdate, monomersLibraryReplace, onInit }) {
|
|
13808
|
+
function Editor({ ketcherId, theme, togglerComponent, monomersLibraryUpdate, monomersLibraryReplace, onInit }) {
|
|
13744
13809
|
const dispatch = useAppDispatch();
|
|
13745
13810
|
const canvasRef = useRef(null);
|
|
13746
13811
|
const errorTooltips = useAppSelector(selectErrorTooltips);
|
|
13747
13812
|
const editor = useAppSelector(selectEditor);
|
|
13748
13813
|
const isHandToolSelected = useAppSelector(selectIsHandToolSelected);
|
|
13814
|
+
const layoutMode = useLayoutMode();
|
|
13749
13815
|
const isLoading = useLoading();
|
|
13750
13816
|
const [isMonomerLibraryHidden, setIsMonomerLibraryHidden] = useState(false);
|
|
13751
13817
|
const isSequenceEditInRNABuilderMode = useSequenceEditInRNABuilderMode();
|
|
@@ -13755,12 +13821,15 @@ function Editor({ theme, togglerComponent, monomersLibraryUpdate, monomersLibrar
|
|
|
13755
13821
|
const [isPasteAvailable, setIsPasteAvailable] = useState(true);
|
|
13756
13822
|
const updatePasteAvailability = useCallback(() => {
|
|
13757
13823
|
if (!editor) return;
|
|
13758
|
-
|
|
13824
|
+
(async () => {
|
|
13825
|
+
setIsPasteAvailable(await isPasteContentAvailable((content) => editor.mode.isPasteContentValid(content)));
|
|
13826
|
+
})();
|
|
13759
13827
|
}, [editor]);
|
|
13760
13828
|
const { show: showSequenceContextMenu } = useContextMenu({ id: CONTEXT_MENU_ID.FOR_SEQUENCE });
|
|
13761
13829
|
const { show: showSelectedMonomersContextMenu } = useContextMenu({ id: CONTEXT_MENU_ID.FOR_SELECTED_MONOMERS });
|
|
13762
13830
|
useEffect(() => {
|
|
13763
13831
|
dispatch(createEditor({
|
|
13832
|
+
ketcherId,
|
|
13764
13833
|
theme,
|
|
13765
13834
|
canvas: canvasRef.current,
|
|
13766
13835
|
monomersLibraryUpdate,
|
|
@@ -13883,6 +13952,7 @@ function Editor({ theme, togglerComponent, monomersLibraryUpdate, monomersLibrar
|
|
|
13883
13952
|
id: "polymer-editor-canvas",
|
|
13884
13953
|
"data-testid": "ketcher-canvas",
|
|
13885
13954
|
"data-canvasmode": "macromolecules-mode",
|
|
13955
|
+
"data-canvaslayout": layoutMode.replace(/-layout-mode$/, ""),
|
|
13886
13956
|
preserveAspectRatio: "xMidYMid meet",
|
|
13887
13957
|
ref: canvasRef,
|
|
13888
13958
|
width: "100%",
|