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.js
CHANGED
|
@@ -148,6 +148,19 @@ var BASE_RESOURCES = {
|
|
|
148
148
|
"unknownStructure": "Unknown structure",
|
|
149
149
|
"phosphateOnLeft": "Phosphate on the left (5')",
|
|
150
150
|
"phosphateOnRight": "Phosphate on the right (3')"
|
|
151
|
+
},
|
|
152
|
+
library: {
|
|
153
|
+
"ambiguousGroup": {
|
|
154
|
+
"bases": "Ambiguous Bases",
|
|
155
|
+
"dnaBases": "Ambiguous DNA Bases",
|
|
156
|
+
"rnaBases": "Ambiguous RNA Bases",
|
|
157
|
+
"sugars": "Ambiguous Sugars",
|
|
158
|
+
"phosphates": "Ambiguous Phosphates",
|
|
159
|
+
"aminoAcids": "Ambiguous Amino Acids",
|
|
160
|
+
"nucleotides": "Ambiguous Nucleotides",
|
|
161
|
+
"chem": "Ambiguous CHEM"
|
|
162
|
+
},
|
|
163
|
+
"noNaturalAnalogue": "No natural analogue"
|
|
151
164
|
}
|
|
152
165
|
},
|
|
153
166
|
macromoleculesDialogs: {
|
|
@@ -252,7 +265,13 @@ var BASE_RESOURCES = {
|
|
|
252
265
|
"openFromFile": "Open from file",
|
|
253
266
|
"openFromImage": "Open from image",
|
|
254
267
|
"orDragFileHere": "or drag file here",
|
|
255
|
-
"imageRecognitionUnavailable": "Image Recognition service is not available"
|
|
268
|
+
"imageRecognitionUnavailable": "Image Recognition service is not available",
|
|
269
|
+
"formats": {
|
|
270
|
+
"sequence": "Sequence",
|
|
271
|
+
"peptide": "Peptide",
|
|
272
|
+
"oneLetterCode": "1-letter code",
|
|
273
|
+
"threeLetterCode": "3-letter code"
|
|
274
|
+
}
|
|
256
275
|
},
|
|
257
276
|
save: {
|
|
258
277
|
"title": "save structure",
|
|
@@ -262,7 +281,12 @@ var BASE_RESOURCES = {
|
|
|
262
281
|
"convertError": "Convert error! {error}",
|
|
263
282
|
"helmSmilesExportNotice": "The molecule will be exported using inline SMILES, and on load will appear as a CHEM monomer",
|
|
264
283
|
"helmAliasExportNotice": "Some of the monomers do not have aliases in the HELM Core Library - they are exported using Ketcher aliases.",
|
|
265
|
-
"sequenceTypeRecognitionError": "Error during sequence type recognition(RNA, DNA or Peptide)"
|
|
284
|
+
"sequenceTypeRecognitionError": "Error during sequence type recognition(RNA, DNA or Peptide)",
|
|
285
|
+
"formats": {
|
|
286
|
+
"sequence1Letter": "Sequence (1-letter code)",
|
|
287
|
+
"sequence3Letter": "Sequence (3-letter code)",
|
|
288
|
+
"svgDocument": "SVG Document"
|
|
289
|
+
}
|
|
266
290
|
},
|
|
267
291
|
updateSequence: {
|
|
268
292
|
"title": "Update sequence",
|
|
@@ -853,10 +877,10 @@ var initialState$3 = {
|
|
|
853
877
|
unipositiveIonsValue: 140,
|
|
854
878
|
oligonucleotidesValue: 200,
|
|
855
879
|
app: {
|
|
856
|
-
buildDate: "2026-11-
|
|
880
|
+
buildDate: "2026-11-23T19:31:04",
|
|
857
881
|
indigoVersion: "",
|
|
858
882
|
indigoMachine: "",
|
|
859
|
-
version: "3.23.0-dev.
|
|
883
|
+
version: "3.23.0-dev.2"
|
|
860
884
|
},
|
|
861
885
|
selectedMenuGroupItems: {}
|
|
862
886
|
};
|
|
@@ -889,6 +913,7 @@ var editorSlice = (0, _reduxjs_toolkit.createSlice)({
|
|
|
889
913
|
createEditor: (state, action) => {
|
|
890
914
|
state.monomerLibraryLoadError = null;
|
|
891
915
|
const editor = new ketcher_core.CoreEditor({
|
|
916
|
+
ketcherId: action.payload.ketcherId,
|
|
892
917
|
theme: action.payload.theme,
|
|
893
918
|
canvas: action.payload.canvas,
|
|
894
919
|
renderersContainer: new ketcher_core.RenderersManager({ theme: action.payload.theme })
|
|
@@ -1037,7 +1062,7 @@ var FAVORITE_ITEMS_UNIQUE_KEYS = "favoriteItemsUniqueKeys";
|
|
|
1037
1062
|
var CUSTOM_PRESETS = "ketcher_custom_presets";
|
|
1038
1063
|
var PRESET_PHOSPHATE_FILTER_STORAGE_KEY = "ketcher_preset_phosphate_filter";
|
|
1039
1064
|
var SEQUENCE_TYPE_STORAGE_KEY = "ketcher_polymer_sequence_type";
|
|
1040
|
-
var NoNaturalAnalogueGroupTitle = "
|
|
1065
|
+
var NoNaturalAnalogueGroupTitle = "macromolecules:library.noNaturalAnalogue";
|
|
1041
1066
|
var LIBRARY_TAB_INDEX = {
|
|
1042
1067
|
FAVORITES: 0,
|
|
1043
1068
|
PEPTIDES: 1,
|
|
@@ -1186,28 +1211,34 @@ var selectAmbiguousMonomersInCategory = (libraryItems, libraryGroupName) => {
|
|
|
1186
1211
|
});
|
|
1187
1212
|
if (ambiguousMonomerLibraryItems.length === 0) return [];
|
|
1188
1213
|
let groupedAmbiguousMonomerLibraryItems = [];
|
|
1214
|
+
const ambiguousGroupKeyByName = {
|
|
1215
|
+
[ketcher_core.MonomerGroups.SUGARS]: "macromolecules:library.ambiguousGroup.sugars",
|
|
1216
|
+
[ketcher_core.MonomerGroups.PHOSPHATES]: "macromolecules:library.ambiguousGroup.phosphates",
|
|
1217
|
+
[ketcher_core.MonomerGroups.PEPTIDES]: "macromolecules:library.ambiguousGroup.aminoAcids",
|
|
1218
|
+
[ketcher_core.MonomerGroups.NUCLEOTIDES]: "macromolecules:library.ambiguousGroup.nucleotides"
|
|
1219
|
+
};
|
|
1189
1220
|
if (libraryGroupName === ketcher_core.MonomerGroups.BASES) groupedAmbiguousMonomerLibraryItems = [
|
|
1190
1221
|
{
|
|
1191
|
-
groupTitle: "
|
|
1222
|
+
groupTitle: "macromolecules:library.ambiguousGroup.bases",
|
|
1192
1223
|
groupItems: ambiguousMonomerLibraryItems.filter((libraryItem) => {
|
|
1193
1224
|
return (0, ketcher_core.isAmbiguousMonomerLibraryItem)(libraryItem) && libraryItem.options.every((option) => !option.templateId.toLowerCase().includes("thymine") && !option.templateId.toLowerCase().includes("uracil"));
|
|
1194
1225
|
})
|
|
1195
1226
|
},
|
|
1196
1227
|
{
|
|
1197
|
-
groupTitle: "
|
|
1228
|
+
groupTitle: "macromolecules:library.ambiguousGroup.dnaBases",
|
|
1198
1229
|
groupItems: ambiguousMonomerLibraryItems.filter((libraryItem) => {
|
|
1199
1230
|
return (0, ketcher_core.isAmbiguousMonomerLibraryItem)(libraryItem) && libraryItem.options.find((option) => option.templateId.toLowerCase().includes("thymine"));
|
|
1200
1231
|
})
|
|
1201
1232
|
},
|
|
1202
1233
|
{
|
|
1203
|
-
groupTitle: "
|
|
1234
|
+
groupTitle: "macromolecules:library.ambiguousGroup.rnaBases",
|
|
1204
1235
|
groupItems: ambiguousMonomerLibraryItems.filter((libraryItem) => {
|
|
1205
1236
|
return (0, ketcher_core.isAmbiguousMonomerLibraryItem)(libraryItem) && libraryItem.options.find((option) => option.templateId.toLowerCase().includes("uracil"));
|
|
1206
1237
|
})
|
|
1207
1238
|
}
|
|
1208
1239
|
];
|
|
1209
1240
|
else groupedAmbiguousMonomerLibraryItems.push({
|
|
1210
|
-
groupTitle:
|
|
1241
|
+
groupTitle: ambiguousGroupKeyByName[libraryGroupName] ?? "macromolecules:library.ambiguousGroup.chem",
|
|
1211
1242
|
groupItems: ambiguousMonomerLibraryItems
|
|
1212
1243
|
});
|
|
1213
1244
|
const firstAmbiguousMonomersInLibrary = /* @__PURE__ */ new Set(["X", "N"]);
|
|
@@ -2354,15 +2385,15 @@ var LayoutBoundsProvider = ({ children }) => {
|
|
|
2354
2385
|
function useLayoutBounds() {
|
|
2355
2386
|
return (0, react.useContext)(LayoutBoundsContext);
|
|
2356
2387
|
}
|
|
2357
|
-
var Column = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2388
|
+
var Column = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm60" })(({ fullWidth, withPaddingRight }) => ({
|
|
2358
2389
|
width: fullWidth ? "100%" : "fit-content",
|
|
2359
2390
|
display: "flex",
|
|
2360
2391
|
flexDirection: "column",
|
|
2361
2392
|
justifyContent: "space-between",
|
|
2362
2393
|
paddingInlineEnd: withPaddingRight ? "12px" : 0,
|
|
2363
|
-
|
|
2394
|
+
minWidth: fullWidth ? 0 : void 0
|
|
2364
2395
|
}));
|
|
2365
|
-
var RowMain = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2396
|
+
var RowMain = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm61" })(({ theme }) => ({
|
|
2366
2397
|
height: "100%",
|
|
2367
2398
|
width: "100%",
|
|
2368
2399
|
position: "relative",
|
|
@@ -2374,7 +2405,7 @@ var RowMain = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e9r
|
|
|
2374
2405
|
containerType: "size",
|
|
2375
2406
|
overflow: "clip"
|
|
2376
2407
|
}));
|
|
2377
|
-
var Row$1 = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2408
|
+
var Row$1 = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm62" })(({ theme }) => ({
|
|
2378
2409
|
height: "100%",
|
|
2379
2410
|
width: "100%",
|
|
2380
2411
|
position: "relative",
|
|
@@ -2384,16 +2415,16 @@ var Row$1 = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e9rwx
|
|
|
2384
2415
|
justifyContent: "space-between",
|
|
2385
2416
|
columnGap: "3px"
|
|
2386
2417
|
}));
|
|
2387
|
-
var BaseLeftRightStyle = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2418
|
+
var BaseLeftRightStyle = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm63" })(({ hide = false }) => ({
|
|
2388
2419
|
height: "100%",
|
|
2389
2420
|
width: "fit-content",
|
|
2390
2421
|
display: hide ? "none" : "flex",
|
|
2391
2422
|
flexDirection: "column"
|
|
2392
2423
|
}));
|
|
2393
|
-
var Left = /* @__PURE__ */ (0, _emotion_styled.default)(BaseLeftRightStyle, { target: "
|
|
2394
|
-
var Right = /* @__PURE__ */ (0, _emotion_styled.default)(BaseLeftRightStyle, { target: "
|
|
2395
|
-
var StyledTopInnerDiv = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2396
|
-
var StyledTop = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2424
|
+
var Left = /* @__PURE__ */ (0, _emotion_styled.default)(BaseLeftRightStyle, { target: "e7sjpm64" })();
|
|
2425
|
+
var Right = /* @__PURE__ */ (0, _emotion_styled.default)(BaseLeftRightStyle, { target: "e7sjpm65" })();
|
|
2426
|
+
var StyledTopInnerDiv = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm66" })("display:flex;justify-content:space-between;width:100cqw;");
|
|
2427
|
+
var StyledTop = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm67" })(({ shortened = false, theme }) => ({
|
|
2397
2428
|
height: "36px",
|
|
2398
2429
|
width: shortened ? "100%" : `calc(100% - ${MONOMER_HIDE_LIBRARY_BUTTON_WIDTH})`,
|
|
2399
2430
|
marginBottom: "6px",
|
|
@@ -2404,20 +2435,20 @@ var StyledTop = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e
|
|
|
2404
2435
|
borderRadius: "4px",
|
|
2405
2436
|
overflowX: "hidden"
|
|
2406
2437
|
}));
|
|
2407
|
-
var StyledArrowScrollWrapper = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2408
|
-
var Bottom = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2438
|
+
var StyledArrowScrollWrapper = /* @__PURE__ */ (0, _emotion_styled.default)("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;");
|
|
2439
|
+
var Bottom = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm69" })("&:not(:empty){margin-bottom:15px;}");
|
|
2409
2440
|
/** Used only as the `data-testid` attribute value on the canvas area for E2E tests. */
|
|
2410
2441
|
var MACROMOLECULES_MAIN_AREA_TEST_ID = "macromolecules-main-area";
|
|
2411
2442
|
/** Used only as the `data-testid` attribute value on the layout root for E2E tests. */
|
|
2412
2443
|
var MACROMOLECULES_LAYOUT_ROOT_TEST_ID = "macromolecules-layout-root";
|
|
2413
|
-
var Main = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2444
|
+
var Main = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm610" })({
|
|
2414
2445
|
height: "100%",
|
|
2415
2446
|
width: "100%",
|
|
2416
2447
|
position: "relative",
|
|
2417
2448
|
overflow: "hidden"
|
|
2418
2449
|
});
|
|
2419
|
-
var InsideRoot = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2420
|
-
var DummyDiv = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
2450
|
+
var InsideRoot = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm611" })({});
|
|
2451
|
+
var DummyDiv = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "e7sjpm612" })({ height: "40px" });
|
|
2421
2452
|
var Top = (props) => {
|
|
2422
2453
|
const [startRef, startInView] = (0, react_intersection_observer.useInView)({ threshold: 1 });
|
|
2423
2454
|
const [endRef, endInView] = (0, react_intersection_observer.useInView)({ threshold: 1 });
|
|
@@ -2445,7 +2476,7 @@ var Top = (props) => {
|
|
|
2445
2476
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(StyledTopInnerDiv, { children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(_emotion_react_jsx_runtime.Fragment, { children }) }),
|
|
2446
2477
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("span", { ref: endRef })
|
|
2447
2478
|
]
|
|
2448
|
-
}), startInView && endInView ?
|
|
2479
|
+
}), startInView && endInView ? void 0 : /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(StyledArrowScrollWrapper, { children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(ketcher_react.ArrowScroll, {
|
|
2449
2480
|
startInView,
|
|
2450
2481
|
endInView,
|
|
2451
2482
|
scrollBack: scrollLeft,
|
|
@@ -2462,14 +2493,7 @@ var Layout = ({ children }) => {
|
|
|
2462
2493
|
const canvasCallbackRef = (0, react.useCallback)((el) => {
|
|
2463
2494
|
setCanvasElement(el);
|
|
2464
2495
|
}, [setCanvasElement]);
|
|
2465
|
-
const subcomponents = {
|
|
2466
|
-
Left: null,
|
|
2467
|
-
Main: null,
|
|
2468
|
-
Right: null,
|
|
2469
|
-
Top: null,
|
|
2470
|
-
Bottom: null,
|
|
2471
|
-
InsideRoot: null
|
|
2472
|
-
};
|
|
2496
|
+
const subcomponents = {};
|
|
2473
2497
|
react.default.Children.forEach(children, (child) => {
|
|
2474
2498
|
if (child.type === Left) subcomponents.Left = child;
|
|
2475
2499
|
else if (child.type === Right) subcomponents.Right = child;
|
|
@@ -2478,7 +2502,7 @@ var Layout = ({ children }) => {
|
|
|
2478
2502
|
else if (child.type === Main) subcomponents.Main = child;
|
|
2479
2503
|
else if (child.type === InsideRoot) subcomponents.InsideRoot = child;
|
|
2480
2504
|
});
|
|
2481
|
-
const mainWithRef = subcomponents.Main ? react.default.cloneElement(subcomponents.Main, { ref: canvasCallbackRef }) :
|
|
2505
|
+
const mainWithRef = subcomponents.Main ? react.default.cloneElement(subcomponents.Main, { ref: canvasCallbackRef }) : void 0;
|
|
2482
2506
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(RowMain, {
|
|
2483
2507
|
ref: layoutRootCallbackRef,
|
|
2484
2508
|
"data-testid": MACROMOLECULES_LAYOUT_ROOT_TEST_ID,
|
|
@@ -3259,6 +3283,14 @@ var MonomerGroup = ({ items, title, groupName, selectedMonomerUniqueKey, library
|
|
|
3259
3283
|
}, getMonomerUniqueKey(monomer));
|
|
3260
3284
|
}) })] });
|
|
3261
3285
|
};
|
|
3286
|
+
// src/helpers/resolveLocalizedTitle.ts
|
|
3287
|
+
/**
|
|
3288
|
+
* Group titles are either namespace-qualified i18n keys
|
|
3289
|
+
* ("macromolecules:library.noNaturalAnalogue") or literal codes ("A", "U").
|
|
3290
|
+
* Only the former are translated; translating a literal would log a spurious
|
|
3291
|
+
* missing-key warning.
|
|
3292
|
+
*/
|
|
3293
|
+
var resolveLocalizedTitle = (title, t) => title?.startsWith("macromolecules:") ? t(title) : title;
|
|
3262
3294
|
// src/components/monomerLibrary/monomerLibraryList/styles.ts
|
|
3263
3295
|
/****************************************************************************
|
|
3264
3296
|
* Copyright 2021 EPAM Systems
|
|
@@ -3677,7 +3709,7 @@ var RnaPresetGroup = ({ presets, duplicatePreset, editPreset }) => {
|
|
|
3677
3709
|
* limitations under the License.
|
|
3678
3710
|
***************************************************************************/
|
|
3679
3711
|
var MonomerList = ({ onItemClick, libraryName, duplicatePreset, editPreset }) => {
|
|
3680
|
-
const { t } = (0, react_i18next.useTranslation)("macromoleculesDialogs");
|
|
3712
|
+
const { t } = (0, react_i18next.useTranslation)(["macromoleculesDialogs", "macromolecules"]);
|
|
3681
3713
|
const monomers = useAppSelector(selectFilteredMonomers);
|
|
3682
3714
|
const presets = useAppSelector(selectFilteredPresets);
|
|
3683
3715
|
const isFavoriteTab = libraryName === MONOMER_LIBRARY_FAVORITES;
|
|
@@ -3690,8 +3722,9 @@ var MonomerList = ({ onItemClick, libraryName, duplicatePreset, editPreset }) =>
|
|
|
3690
3722
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(MonomerListContainer, { children: [
|
|
3691
3723
|
isFavoriteTab && monomerGroups.length > 0 && /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", { children: t("monomerLibrary.monomersSectionHeader") }),
|
|
3692
3724
|
monomerGroups.map(({ groupItems, groupTitle }, _index, groups) => {
|
|
3725
|
+
const resolvedTitle = resolveLocalizedTitle(groupTitle, t);
|
|
3693
3726
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(MonomerGroup, {
|
|
3694
|
-
title: groups.length === 1 ? void 0 :
|
|
3727
|
+
title: groups.length === 1 ? void 0 : resolvedTitle,
|
|
3695
3728
|
items: groupItems,
|
|
3696
3729
|
libraryName,
|
|
3697
3730
|
onItemClick
|
|
@@ -3703,8 +3736,9 @@ var MonomerList = ({ onItemClick, libraryName, duplicatePreset, editPreset }) =>
|
|
|
3703
3736
|
presets: items.presets
|
|
3704
3737
|
})] }),
|
|
3705
3738
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(_emotion_react_jsx_runtime.Fragment, { children: (libraryName === "PEPTIDE" || isFavoriteTab) && ambiguousMonomers.map((group) => {
|
|
3739
|
+
const resolvedTitle = resolveLocalizedTitle(group.groupTitle, t);
|
|
3706
3740
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(MonomerGroup, {
|
|
3707
|
-
title:
|
|
3741
|
+
title: resolvedTitle,
|
|
3708
3742
|
items: group.groupItems,
|
|
3709
3743
|
libraryName,
|
|
3710
3744
|
onItemClick
|
|
@@ -4099,6 +4133,14 @@ var generateSequenceSelectionName = (labeledNucleoelements) => {
|
|
|
4099
4133
|
const groupNames = generateSequenceSelectionGroupNames(labeledNucleoelements);
|
|
4100
4134
|
return `${groupNames?.Sugars}(${groupNames?.Bases})${groupNames?.Phosphates ?? ""}`;
|
|
4101
4135
|
};
|
|
4136
|
+
var applyMonomerToSequenceSelection = (sequenceSelection, field, groupItem, isBaseGroup) => sequenceSelection.map((node) => {
|
|
4137
|
+
if (node.isNucleosideConnectedAndSelectedWithPhosphate && field === "phosphateLabel" || node.type === ketcher_core.Entities.Phosphate && (field === "sugarLabel" || field === "baseLabel")) return node;
|
|
4138
|
+
return {
|
|
4139
|
+
...node,
|
|
4140
|
+
[field]: groupItem.label,
|
|
4141
|
+
rnaBaseMonomerItem: isBaseGroup ? groupItem : node.rnaBaseMonomerItem
|
|
4142
|
+
};
|
|
4143
|
+
});
|
|
4102
4144
|
// src/components/monomerLibrary/RnaBuilder/RnaEditor/RnaEditorExpanded/helpers/resetRnaBuilder.ts
|
|
4103
4145
|
var resetRnaBuilderCommon = (dispatch) => {
|
|
4104
4146
|
dispatch(setActivePresetMonomerGroup(null));
|
|
@@ -4150,13 +4192,6 @@ var RnaEditorExpanded_module_default = {
|
|
|
4150
4192
|
* See the License for the specific language governing permissions and
|
|
4151
4193
|
* limitations under the License.
|
|
4152
4194
|
***************************************************************************/
|
|
4153
|
-
function useLatestRef(value) {
|
|
4154
|
-
const ref = (0, react.useRef)(value);
|
|
4155
|
-
(0, react.useEffect)(() => {
|
|
4156
|
-
ref.current = value;
|
|
4157
|
-
}, [value]);
|
|
4158
|
-
return ref;
|
|
4159
|
-
}
|
|
4160
4195
|
var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
4161
4196
|
const { t } = (0, react_i18next.useTranslation)(["macromoleculesDialogs", "common"]);
|
|
4162
4197
|
const groupsData = [
|
|
@@ -4187,6 +4222,21 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4187
4222
|
const activePresetMonomerGroup = useAppSelector(selectActivePresetMonomerGroup);
|
|
4188
4223
|
const [newPreset, setNewPreset] = (0, react.useState)(activePreset);
|
|
4189
4224
|
const [prevActivePreset, setPrevActivePreset] = (0, react.useState)(activePreset);
|
|
4225
|
+
const pendingScrollTimeouts = (0, react.useRef)(/* @__PURE__ */ new Set());
|
|
4226
|
+
(0, react.useEffect)(() => {
|
|
4227
|
+
const timeouts = pendingScrollTimeouts.current;
|
|
4228
|
+
return () => {
|
|
4229
|
+
timeouts.forEach((timeout) => clearTimeout(timeout));
|
|
4230
|
+
timeouts.clear();
|
|
4231
|
+
};
|
|
4232
|
+
}, []);
|
|
4233
|
+
const scheduleLibraryScroll = (callback, delay) => {
|
|
4234
|
+
const timeout = setTimeout(() => {
|
|
4235
|
+
pendingScrollTimeouts.current.delete(timeout);
|
|
4236
|
+
callback();
|
|
4237
|
+
}, delay);
|
|
4238
|
+
pendingScrollTimeouts.current.add(timeout);
|
|
4239
|
+
};
|
|
4190
4240
|
const [selectedPhosphatePosition, setSelectedPhosphatePosition] = (0, react.useState)(activePreset?.connections?.length ? (0, ketcher_core.getRnaPresetPhosphatePosition)(activePreset) : void 0);
|
|
4191
4241
|
const resolvePhosphatePosition = (preset) => {
|
|
4192
4242
|
if (!preset?.phosphate) return;
|
|
@@ -4201,12 +4251,8 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4201
4251
|
if (isLeftPositionAvailable && !isRightPositionAvailable) return "left";
|
|
4202
4252
|
if (isRightPositionAvailable && !isLeftPositionAvailable) return "right";
|
|
4203
4253
|
};
|
|
4204
|
-
const activeMonomerGroupRef = useLatestRef(activeMonomerGroup);
|
|
4205
|
-
const isEditModeRef = useLatestRef(isEditMode);
|
|
4206
4254
|
const activePresetGroupItem = activePresetMonomerGroup?.groupItem;
|
|
4207
|
-
const activePresetGroupNameRef = useLatestRef(activePresetMonomerGroup?.groupName);
|
|
4208
4255
|
const sequenceSelection = useAppSelector(selectSequenceSelection);
|
|
4209
|
-
const sequenceSelectionRef = useLatestRef(sequenceSelection);
|
|
4210
4256
|
const sequenceSelectionName = useAppSelector(selectSequenceSelectionName);
|
|
4211
4257
|
const isSequenceEditInRNABuilderMode = useAppSelector(isRnaBuilderSequenceEditMode);
|
|
4212
4258
|
const isBaseModificationBlocked = useAppSelector(isRnaBaseModificationBlocked);
|
|
@@ -4219,15 +4265,16 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4219
4265
|
isSequenceEdit: isSequenceEditInRNABuilderMode
|
|
4220
4266
|
});
|
|
4221
4267
|
const sequenceSelectionGroupNames = generateSequenceSelectionGroupNames(sequenceSelection);
|
|
4268
|
+
const displayedSequenceSelectionName = sequenceSelection && getCountOfNucleoelements(sequenceSelection) === 1 ? generateSequenceSelectionName(sequenceSelection) : sequenceSelectionName;
|
|
4222
4269
|
if (isEditMode !== isPreviousEditMode) {
|
|
4223
4270
|
setIsPreviousEditMode(isEditMode);
|
|
4224
4271
|
if (isEditMode) {
|
|
4225
4272
|
setLastAppliedPresetMonomerGroupItem(activePresetGroupItem);
|
|
4226
4273
|
setIsSequenceSelectionUpdated(false);
|
|
4227
4274
|
}
|
|
4228
|
-
} else if (isEditMode &&
|
|
4275
|
+
} else if (isEditMode && activePresetGroupItem && activePresetGroupItem !== lastAppliedPresetMonomerGroupItem && activeMonomerGroup !== RnaBuilderPresetsItem.Presets) {
|
|
4229
4276
|
setLastAppliedPresetMonomerGroupItem(activePresetGroupItem);
|
|
4230
|
-
setIsSequenceSelectionUpdated(true);
|
|
4277
|
+
if (isSequenceEditInRNABuilderMode) setIsSequenceSelectionUpdated(true);
|
|
4231
4278
|
}
|
|
4232
4279
|
const phosphatePosition = resolvePhosphatePosition(newPreset);
|
|
4233
4280
|
const { is3PrimeAvailable, is5PrimeAvailable } = getPhosphatePositionAvailability(newPreset || {});
|
|
@@ -4262,30 +4309,6 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4262
4309
|
};
|
|
4263
4310
|
});
|
|
4264
4311
|
}
|
|
4265
|
-
(0, react.useEffect)(() => {
|
|
4266
|
-
if (sequenceSelection && getCountOfNucleoelements(sequenceSelection) === 1) dispatch(setSequenceSelectionName(generateSequenceSelectionName(sequenceSelection)));
|
|
4267
|
-
}, [dispatch, sequenceSelection]);
|
|
4268
|
-
(0, react.useEffect)(() => {
|
|
4269
|
-
if (!isSequenceEditInRNABuilderMode || !activePresetGroupItem || !isEditModeRef.current || activeMonomerGroupRef.current === RnaBuilderPresetsItem.Presets) return;
|
|
4270
|
-
const field = `${monomerGroupToPresetGroup[activePresetGroupNameRef.current ?? ""]}Label`;
|
|
4271
|
-
const updatedSequenceSelection = sequenceSelectionRef.current.map((node) => {
|
|
4272
|
-
if (field === "phosphateLabel" && node.isNucleosideConnectedAndSelectedWithPhosphate || node.type === ketcher_core.Entities.Phosphate && (field === "sugarLabel" || field === "baseLabel")) return node;
|
|
4273
|
-
return {
|
|
4274
|
-
...node,
|
|
4275
|
-
[field]: activePresetGroupItem.label,
|
|
4276
|
-
rnaBaseMonomerItem: activePresetGroupNameRef.current === "Bases" ? activePresetGroupItem : node.rnaBaseMonomerItem
|
|
4277
|
-
};
|
|
4278
|
-
});
|
|
4279
|
-
dispatch(setSequenceSelection(updatedSequenceSelection));
|
|
4280
|
-
}, [
|
|
4281
|
-
isSequenceEditInRNABuilderMode,
|
|
4282
|
-
activePresetGroupItem,
|
|
4283
|
-
dispatch,
|
|
4284
|
-
activeMonomerGroupRef,
|
|
4285
|
-
activePresetGroupNameRef,
|
|
4286
|
-
isEditModeRef,
|
|
4287
|
-
sequenceSelectionRef
|
|
4288
|
-
]);
|
|
4289
4312
|
const scrollToActiveItemInLibrary = (selectedGroup, selectedMonomer) => {
|
|
4290
4313
|
if (selectedGroup === RnaBuilderPresetsItem.Presets) {
|
|
4291
4314
|
scrollToSelectedPreset(newPreset?.name);
|
|
@@ -4296,7 +4319,7 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4296
4319
|
if (activeMonomerInSelectedGroup) scrollToSelectedMonomer(getMonomerUniqueKey(activeMonomerInSelectedGroup));
|
|
4297
4320
|
else if (selectedMonomer) scrollToSelectedMonomer(selectedMonomer);
|
|
4298
4321
|
};
|
|
4299
|
-
const selectGroup = (selectedGroup) =>
|
|
4322
|
+
const selectGroup = (selectedGroup) => {
|
|
4300
4323
|
if (isBaseModificationBlocked && isSequenceEditInRNABuilderMode && selectedGroup === MonomerGroups$2.BASES) editor?.events.error.dispatch(ketcher_core.BASE_MODIFICATION_DISABLED_IN_SYNC_MODE);
|
|
4301
4324
|
const selectedRNAPartMonomer = selectCurrentMonomerGroup(newPreset, selectedGroup);
|
|
4302
4325
|
if (selectedRNAPartMonomer && !isSequenceMode) editor?.events.selectMonomer.dispatch(selectedRNAPartMonomer);
|
|
@@ -4318,7 +4341,7 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4318
4341
|
}
|
|
4319
4342
|
}
|
|
4320
4343
|
}
|
|
4321
|
-
|
|
4344
|
+
scheduleLibraryScroll(() => scrollToActiveItemInLibrary(selectedGroup, selectedMonomer), 100);
|
|
4322
4345
|
};
|
|
4323
4346
|
const onChangeName = (event) => {
|
|
4324
4347
|
if (isEditMode) {
|
|
@@ -4380,7 +4403,7 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4380
4403
|
"aria-label": t("monomerLibrary.selectPhosphatePositionAriaLabel"),
|
|
4381
4404
|
children: renderPhosphateTriggerIcon(triggerPosition, isPhosphateGroupActive)
|
|
4382
4405
|
}) })
|
|
4383
|
-
}), isTriggerDisabled || shouldShowPhosphatePositionTooltip ?
|
|
4406
|
+
}), isTriggerDisabled || shouldShowPhosphatePositionTooltip ? void 0 : /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("div", {
|
|
4384
4407
|
className: RnaEditorExpanded_module_default.phosphatePositionSelector,
|
|
4385
4408
|
children: [renderPhosphatePositionOption("left", !is5PrimeAvailable), renderPhosphatePositionOption("right", !is3PrimeAvailable)]
|
|
4386
4409
|
})]
|
|
@@ -4418,7 +4441,7 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4418
4441
|
dispatch(savePreset(presetToSave));
|
|
4419
4442
|
dispatch(setActivePreset(presetToSave));
|
|
4420
4443
|
if (!isSequenceMode) editor?.events.selectPreset.dispatch(presetToSave);
|
|
4421
|
-
|
|
4444
|
+
scheduleLibraryScroll(() => {
|
|
4422
4445
|
scrollToSelectedPreset(presetName);
|
|
4423
4446
|
}, 0);
|
|
4424
4447
|
resetRnaBuilder(dispatch);
|
|
@@ -4525,17 +4548,17 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4525
4548
|
className: (0, clsx.default)(isSequenceEditInRNABuilderMode && "rna-editor-expanded--sequence-edit-mode"),
|
|
4526
4549
|
children: [
|
|
4527
4550
|
isCompactView ? /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(CompactViewName, {
|
|
4528
|
-
value: isSequenceEditInRNABuilderMode ?
|
|
4551
|
+
value: isSequenceEditInRNABuilderMode ? displayedSequenceSelectionName : newPreset?.name,
|
|
4529
4552
|
placeholder: t("monomerLibrary.nameYourStructure"),
|
|
4530
4553
|
"data-testid": "name-your-structure-editbox",
|
|
4531
4554
|
disabled: isSequenceEditInRNABuilderMode,
|
|
4532
|
-
onClick: selectGroup(RnaBuilderPresetsItem.Presets),
|
|
4555
|
+
onClick: () => selectGroup(RnaBuilderPresetsItem.Presets),
|
|
4533
4556
|
onChange: onChangeName
|
|
4534
4557
|
}) : /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(NameContainer, {
|
|
4535
4558
|
selected: activeMonomerGroup === RnaBuilderPresetsItem.Presets,
|
|
4536
|
-
onClick: selectGroup(RnaBuilderPresetsItem.Presets),
|
|
4559
|
+
onClick: () => selectGroup(RnaBuilderPresetsItem.Presets),
|
|
4537
4560
|
children: [isEditMode ? /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(NameInput, {
|
|
4538
|
-
value: isSequenceEditInRNABuilderMode ?
|
|
4561
|
+
value: isSequenceEditInRNABuilderMode ? displayedSequenceSelectionName : newPreset?.name,
|
|
4539
4562
|
placeholder: t("monomerLibrary.nameYourStructure"),
|
|
4540
4563
|
"data-testid": "name-your-structure-editbox",
|
|
4541
4564
|
disabled: isSequenceEditInRNABuilderMode,
|
|
@@ -4552,8 +4575,8 @@ var RnaEditorExpanded = ({ isEditMode, onDuplicate }) => {
|
|
|
4552
4575
|
monomerName: isSequenceEditInRNABuilderMode ? getMonomersName(groupName) : getMonomerName(groupName),
|
|
4553
4576
|
iconName,
|
|
4554
4577
|
testid: testId,
|
|
4555
|
-
onClick: selectGroup(groupName),
|
|
4556
|
-
children: isPhosphateGroup ? renderPhosphatePositionSelector(phosphatePosition) :
|
|
4578
|
+
onClick: () => selectGroup(groupName),
|
|
4579
|
+
children: isPhosphateGroup ? renderPhosphatePositionSelector(phosphatePosition) : void 0
|
|
4557
4580
|
}, groupName);
|
|
4558
4581
|
})
|
|
4559
4582
|
}),
|
|
@@ -4692,8 +4715,8 @@ var Modal_module_default = {
|
|
|
4692
4715
|
draggableHeader: "Modal-module_draggableHeader__2FY4V"
|
|
4693
4716
|
};
|
|
4694
4717
|
// src/components/shared/modal/Modal.tsx
|
|
4695
|
-
var StyledDialog = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.Dialog, { target: "
|
|
4696
|
-
var Header$1 = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.DialogTitle, { target: "
|
|
4718
|
+
var StyledDialog = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.Dialog, { target: "evy8q2c0" })(".MuiPaper-root{min-width:304px;}");
|
|
4719
|
+
var Header$1 = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.DialogTitle, { target: "evy8q2c1" })(({ theme, hideborder }) => ({
|
|
4697
4720
|
padding: "2px 4px 2px 12px",
|
|
4698
4721
|
display: "flex",
|
|
4699
4722
|
alignItems: "center",
|
|
@@ -4704,17 +4727,17 @@ var Header$1 = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.Dialog
|
|
|
4704
4727
|
textTransform: "capitalize",
|
|
4705
4728
|
borderBottom: hideborder ? "none" : "1px solid rgba(202, 211, 221, 1)"
|
|
4706
4729
|
}));
|
|
4707
|
-
var Title = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
4730
|
+
var Title = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "evy8q2c2" })({
|
|
4708
4731
|
marginInlineEnd: "10px",
|
|
4709
4732
|
fontSize: "14px"
|
|
4710
4733
|
});
|
|
4711
|
-
var StyledIcon$1 = /* @__PURE__ */ (0, _emotion_styled.default)(ketcher_react.Icon, { target: "
|
|
4734
|
+
var StyledIcon$1 = /* @__PURE__ */ (0, _emotion_styled.default)(ketcher_react.Icon, { target: "evy8q2c3" })({
|
|
4712
4735
|
width: "16px",
|
|
4713
4736
|
height: "16px",
|
|
4714
4737
|
color: "rgba(51, 51, 51, 1)"
|
|
4715
4738
|
});
|
|
4716
|
-
var Content = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.DialogContent, { target: "
|
|
4717
|
-
var Footer = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.DialogActions, { target: "
|
|
4739
|
+
var Content = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.DialogContent, { target: "evy8q2c4" })("padding:0;font-size:", ({ theme }) => theme.ketcher.font.size.medium, ";line-height:17px;color:#000000;", ({ theme }) => scrollbarThin(theme), ";");
|
|
4740
|
+
var Footer = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.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, ";}");
|
|
4718
4741
|
var Modal = ({ children, title, isOpen, showCloseButton = true, showExpandButton = false, onClose, className, modalWidth, expanded = false, setExpanded = EmptyFunction, testId, hideHeaderBorder, isDraggable = false, isResizable = true, repositionKey }) => {
|
|
4719
4742
|
const { t } = (0, react_i18next.useTranslation)("macromoleculesDialogs");
|
|
4720
4743
|
const theme = (0, _emotion_react.useTheme)();
|
|
@@ -4821,10 +4844,7 @@ var Modal = ({ children, title, isOpen, showCloseButton = true, showExpandButton
|
|
|
4821
4844
|
background: theme.ketcher.color.background.overlay,
|
|
4822
4845
|
opacity: .4
|
|
4823
4846
|
} }), [theme.ketcher.color.background.overlay]);
|
|
4824
|
-
const subcomponents = {
|
|
4825
|
-
Content: null,
|
|
4826
|
-
Footer: null
|
|
4827
|
-
};
|
|
4847
|
+
const subcomponents = {};
|
|
4828
4848
|
react.default.Children.forEach(children, (child) => {
|
|
4829
4849
|
if (child.type === Content) subcomponents.Content = child;
|
|
4830
4850
|
else if (child.type === Footer) subcomponents.Footer = child;
|
|
@@ -5191,7 +5211,7 @@ var groupNameToTabLabelKey = {
|
|
|
5191
5211
|
};
|
|
5192
5212
|
// src/components/monomerLibrary/RnaBuilder/RnaElementsView/RnaElementsTabsView.tsx
|
|
5193
5213
|
var RnaElementsTabsView = ({ activeRnaBuilderItem, groupsData, onNewPresetClick, onSelectItem, duplicatePreset, editPreset, libraryName }) => {
|
|
5194
|
-
const { t } = (0, react_i18next.useTranslation)("macromoleculesDialogs");
|
|
5214
|
+
const { t } = (0, react_i18next.useTranslation)(["macromoleculesDialogs", "macromolecules"]);
|
|
5195
5215
|
const dispatch = (0, react_redux.useDispatch)();
|
|
5196
5216
|
const presets = useAppSelector(selectFilteredPresets);
|
|
5197
5217
|
const monomers = useAppSelector(selectFilteredMonomers);
|
|
@@ -5207,7 +5227,7 @@ var RnaElementsTabsView = ({ activeRnaBuilderItem, groupsData, onNewPresetClick,
|
|
|
5207
5227
|
const variantMonomers = selectAmbiguousMonomersInCategory(monomers, groupName);
|
|
5208
5228
|
const quantity = [...groups, ...variantMonomers].reduce((acc, group) => acc + (group.groupItems.length || 0), 0);
|
|
5209
5229
|
const label = t(groupNameToTabLabelKey[groupName]);
|
|
5210
|
-
const caption = isSelected ? `${label} (${quantity})` :
|
|
5230
|
+
const caption = isSelected ? `${label} (${quantity})` : void 0;
|
|
5211
5231
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(RnaTabWrapper, {
|
|
5212
5232
|
className: (0, clsx.default)(isSelected && "rna-tab--selected"),
|
|
5213
5233
|
children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(RnaTab, {
|
|
@@ -5221,7 +5241,7 @@ var RnaElementsTabsView = ({ activeRnaBuilderItem, groupsData, onNewPresetClick,
|
|
|
5221
5241
|
}, groupName);
|
|
5222
5242
|
}) }), groupsData.map((groupData) => {
|
|
5223
5243
|
const { groupName, groups } = groupData;
|
|
5224
|
-
if (groupName !== activeRnaBuilderItem) return
|
|
5244
|
+
if (groupName !== activeRnaBuilderItem) return;
|
|
5225
5245
|
const variantMonomers = selectAmbiguousMonomersInCategory(monomers, groupName);
|
|
5226
5246
|
const details = groupName === RnaBuilderPresetsItem.Presets ? /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(DetailsContainer, {
|
|
5227
5247
|
compact: true,
|
|
@@ -5255,20 +5275,26 @@ var RnaElementsTabsView = ({ activeRnaBuilderItem, groupsData, onNewPresetClick,
|
|
|
5255
5275
|
]
|
|
5256
5276
|
}) : /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(DetailsContainer, {
|
|
5257
5277
|
compact: true,
|
|
5258
|
-
children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(_emotion_react_jsx_runtime.Fragment, { children: [groups.map(({ groupItems, groupTitle }) =>
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5278
|
+
children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(_emotion_react_jsx_runtime.Fragment, { children: [groups.map(({ groupItems, groupTitle }) => {
|
|
5279
|
+
const resolvedTitle = resolveLocalizedTitle(groupTitle, t);
|
|
5280
|
+
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(MonomerGroup, {
|
|
5281
|
+
title: [MonomerGroups$2.BASES, MonomerGroups$2.NUCLEOTIDES].includes(groupName) || groups.length > 1 ? resolvedTitle : void 0,
|
|
5282
|
+
groupName,
|
|
5283
|
+
items: groupItems,
|
|
5284
|
+
selectedMonomerUniqueKey: activeMonomerKey,
|
|
5285
|
+
onItemClick: (monomer) => onSelectItem(monomer, groupName)
|
|
5286
|
+
}, groupTitle);
|
|
5287
|
+
}), variantMonomers.map(({ groupTitle, groupItems }) => {
|
|
5288
|
+
const resolvedTitle = resolveLocalizedTitle(groupTitle, t);
|
|
5289
|
+
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(MonomerGroup, {
|
|
5290
|
+
title: resolvedTitle,
|
|
5291
|
+
items: groupItems,
|
|
5292
|
+
groupName,
|
|
5293
|
+
libraryName,
|
|
5294
|
+
selectedMonomerUniqueKey: activeMonomerKey,
|
|
5295
|
+
onItemClick: (monomer) => onSelectItem(monomer, groupName)
|
|
5296
|
+
}, groupTitle);
|
|
5297
|
+
})] })
|
|
5272
5298
|
});
|
|
5273
5299
|
const isFirstTabSelected = activeRnaBuilderItem === RnaBuilderPresetsItem.Presets;
|
|
5274
5300
|
const isLastTabSelected = activeRnaBuilderItem === MonomerGroups$2.NUCLEOTIDES;
|
|
@@ -5315,7 +5341,7 @@ var Summary = ({ groupName, label, quantity, expanded, iconName }) => {
|
|
|
5315
5341
|
};
|
|
5316
5342
|
// src/components/monomerLibrary/RnaBuilder/RnaElementsView/RnaElementsAccordionView.tsx
|
|
5317
5343
|
var RnaElementsAccordionView = ({ activeRnaBuilderItem, groupsData, newPreset, onNewPresetClick, onSelectItem, duplicatePreset, editPreset, libraryName }) => {
|
|
5318
|
-
const { t } = (0, react_i18next.useTranslation)("macromoleculesDialogs");
|
|
5344
|
+
const { t } = (0, react_i18next.useTranslation)(["macromoleculesDialogs", "macromolecules"]);
|
|
5319
5345
|
const dispatch = (0, react_redux.useDispatch)();
|
|
5320
5346
|
const presets = useAppSelector(selectFilteredPresets);
|
|
5321
5347
|
const monomers = useAppSelector(selectFilteredMonomers);
|
|
@@ -5332,7 +5358,7 @@ var RnaElementsAccordionView = ({ activeRnaBuilderItem, groupsData, newPreset, o
|
|
|
5332
5358
|
setExpandedAccordion(activeRnaBuilderItem);
|
|
5333
5359
|
}
|
|
5334
5360
|
const handleAccordionSummaryClick = (rnaBuilderItem) => {
|
|
5335
|
-
if (expandedAccordion === rnaBuilderItem) setExpandedAccordion(
|
|
5361
|
+
if (expandedAccordion === rnaBuilderItem) setExpandedAccordion(void 0);
|
|
5336
5362
|
else {
|
|
5337
5363
|
setExpandedAccordion(rnaBuilderItem);
|
|
5338
5364
|
dispatch(recalculateRnaBuilderValidations({
|
|
@@ -5385,21 +5411,25 @@ var RnaElementsAccordionView = ({ activeRnaBuilderItem, groupsData, newPreset, o
|
|
|
5385
5411
|
MonomerGroups$2.NUCLEOTIDES,
|
|
5386
5412
|
MonomerGroups$2.PEPTIDES
|
|
5387
5413
|
].includes(groupData.groupName);
|
|
5414
|
+
const resolvedTitle = resolveLocalizedTitle(groupTitle, t);
|
|
5388
5415
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(MonomerGroup, {
|
|
5389
|
-
title: shouldShowTitle ?
|
|
5416
|
+
title: shouldShowTitle ? resolvedTitle : void 0,
|
|
5390
5417
|
groupName: groupData.groupName,
|
|
5391
5418
|
items: groupItems,
|
|
5392
5419
|
selectedMonomerUniqueKey: activeMonomerKey,
|
|
5393
5420
|
onItemClick: (monomer) => onSelectItem(monomer, groupData.groupName)
|
|
5394
5421
|
}, groupTitle);
|
|
5395
|
-
}), variantMonomers.map((group) =>
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5422
|
+
}), variantMonomers.map((group) => {
|
|
5423
|
+
const resolvedTitle = resolveLocalizedTitle(group.groupTitle, t);
|
|
5424
|
+
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(MonomerGroup, {
|
|
5425
|
+
title: resolvedTitle,
|
|
5426
|
+
items: group.groupItems,
|
|
5427
|
+
groupName: groupData.groupName,
|
|
5428
|
+
libraryName,
|
|
5429
|
+
selectedMonomerUniqueKey: activeMonomerKey,
|
|
5430
|
+
onItemClick: (monomer) => onSelectItem(monomer, groupData.groupName)
|
|
5431
|
+
}, group.groupTitle);
|
|
5432
|
+
})] }) });
|
|
5403
5433
|
return groupData.groupName === RnaBuilderPresetsItem.Presets && isExpanded ? /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(StyledAccordionWrapper, { children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(StyledAccordion, {
|
|
5404
5434
|
"data-testid": "styled-accordion",
|
|
5405
5435
|
dataTestIdDetails: `rna-accordion-details-${groupData.groupName}`,
|
|
@@ -5426,6 +5456,7 @@ var RnaElements = ({ view, libraryName, duplicatePreset, editPreset }) => {
|
|
|
5426
5456
|
const isEditMode = useAppSelector(isRnaBuilderEditMode);
|
|
5427
5457
|
const editor = useAppSelector(selectEditor);
|
|
5428
5458
|
const isSequenceEditInRNABuilderMode = useAppSelector(isRnaBuilderSequenceEditMode);
|
|
5459
|
+
const sequenceSelection = useAppSelector(selectSequenceSelection);
|
|
5429
5460
|
const [newPreset, setNewPreset] = (0, react.useState)(activePreset);
|
|
5430
5461
|
const [prevBuilderState, setPrevBuilderState] = (0, react.useState)({
|
|
5431
5462
|
activePreset,
|
|
@@ -5462,12 +5493,17 @@ var RnaElements = ({ view, libraryName, duplicatePreset, editPreset }) => {
|
|
|
5462
5493
|
groupItem: monomer
|
|
5463
5494
|
}));
|
|
5464
5495
|
dispatch(setActiveRnaBuilderItem(groupName));
|
|
5496
|
+
if (isSequenceEditInRNABuilderMode && sequenceSelection) {
|
|
5497
|
+
const field = `${monomerGroupToPresetGroup[groupName]}Label`;
|
|
5498
|
+
dispatch(setSequenceSelection(applyMonomerToSequenceSelection(sequenceSelection, field, monomer, groupName === MonomerGroups$2.BASES)));
|
|
5499
|
+
}
|
|
5465
5500
|
}, [
|
|
5466
5501
|
dispatch,
|
|
5467
5502
|
editor,
|
|
5468
5503
|
isEditMode,
|
|
5469
5504
|
isSequenceEditInRNABuilderMode,
|
|
5470
|
-
newPreset
|
|
5505
|
+
newPreset,
|
|
5506
|
+
sequenceSelection
|
|
5471
5507
|
]);
|
|
5472
5508
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(RnaAccordionContainer, {
|
|
5473
5509
|
"data-testid": "rna-accordion",
|
|
@@ -5631,7 +5667,6 @@ var getDeleteConfirmation = (isOnCanvas, hasReferencingPresets) => {
|
|
|
5631
5667
|
if (isOnCanvas && hasReferencingPresets) return DELETE_CONFIRMATION.onCanvasAndInPreset;
|
|
5632
5668
|
if (isOnCanvas) return DELETE_CONFIRMATION.onCanvas;
|
|
5633
5669
|
if (hasReferencingPresets) return DELETE_CONFIRMATION.inPreset;
|
|
5634
|
-
return null;
|
|
5635
5670
|
};
|
|
5636
5671
|
// src/components/monomerLibrary/MonomerLibraryContextMenu.tsx
|
|
5637
5672
|
var MonomerLibraryContextMenu = () => {
|
|
@@ -5903,10 +5938,10 @@ var baseStyle = {
|
|
|
5903
5938
|
flexDirection: "column",
|
|
5904
5939
|
justifyContent: "space-between"
|
|
5905
5940
|
};
|
|
5906
|
-
var StyledIcon = /* @__PURE__ */ (0, _emotion_styled.default)(ketcher_react.Icon, { target: "
|
|
5941
|
+
var StyledIcon = /* @__PURE__ */ (0, _emotion_styled.default)(ketcher_react.Icon, { target: "e10arzxy0" })("filter:", ({ disabled }) => disabled ? "grayscale(1)" : "", ";opacity:", ({ disabled }) => disabled ? "0.6" : "1", ";");
|
|
5907
5942
|
var activeStyle = { backgroundColor: "#F8FEFFFF" };
|
|
5908
|
-
var ButtonContainer$1 = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
5909
|
-
var DropzoneButton = /* @__PURE__ */ (0, _emotion_styled.default)("button", { target: "
|
|
5943
|
+
var ButtonContainer$1 = /* @__PURE__ */ (0, _emotion_styled.default)("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;}");
|
|
5944
|
+
var DropzoneButton = /* @__PURE__ */ (0, _emotion_styled.default)("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;}");
|
|
5910
5945
|
var FileDrop = ({ textLabel, iconName, disabled, disabledText, ...rest }) => {
|
|
5911
5946
|
const { t } = (0, react_i18next.useTranslation)("macromoleculesDialogs");
|
|
5912
5947
|
const { getRootProps, getInputProps, isDragActive, open } = (0, react_dropzone.useDropzone)({
|
|
@@ -6053,7 +6088,7 @@ TextArea.displayName = "TextArea";
|
|
|
6053
6088
|
* See the License for the specific language governing permissions and
|
|
6054
6089
|
* limitations under the License.
|
|
6055
6090
|
***************************************************************************/
|
|
6056
|
-
var StyledTextField = /* @__PURE__ */ (0, _emotion_styled.default)(TextArea, { target: "
|
|
6091
|
+
var StyledTextField = /* @__PURE__ */ (0, _emotion_styled.default)(TextArea, { target: "e15986w80" })("width:100%;height:320px;");
|
|
6057
6092
|
var ViewSwitcher = (props) => {
|
|
6058
6093
|
if (props.isAnalyzingFile) return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(AnalyzingFile, { fileName: props.fileName });
|
|
6059
6094
|
else switch (props.currentState) {
|
|
@@ -6133,8 +6168,8 @@ var ChevronIcon = ({ className }) => /* @__PURE__ */ (0, _emotion_react_jsx_runt
|
|
|
6133
6168
|
* See the License for the specific language governing permissions and
|
|
6134
6169
|
* limitations under the License.
|
|
6135
6170
|
***************************************************************************/
|
|
6136
|
-
var StyledFormControl = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.FormControl, { target: "
|
|
6137
|
-
var DropDownSelect = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.Select, { target: "
|
|
6171
|
+
var StyledFormControl = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.FormControl, { target: "eastnt70" })("width:100%;padding:0 8px;& label{font-size:12px;line-height:unset;}");
|
|
6172
|
+
var DropDownSelect = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.Select, { target: "eastnt71" })("height:24px;border:1px solid #e1e5ea;border-radius:4px;font-size:12px;background-color:white;", ({ open }) => open && _emotion_react.css`
|
|
6138
6173
|
background-color: white;
|
|
6139
6174
|
border-end-start-radius: 0;
|
|
6140
6175
|
border-end-end-radius: 0;
|
|
@@ -6146,7 +6181,7 @@ var stylesForExpanded$1 = {
|
|
|
6146
6181
|
borderRadius: "0px 0px 2px 2px",
|
|
6147
6182
|
boxShadow: "0 6px 10px rgba(103, 104, 132, 0.15)"
|
|
6148
6183
|
};
|
|
6149
|
-
var DropDownItem = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.MenuItem, { target: "
|
|
6184
|
+
var DropDownItem = /* @__PURE__ */ (0, _emotion_styled.default)(_mui_material.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}`, "}");
|
|
6150
6185
|
var DropDown = ({ options, currentSelection, selectionHandler, className, label, testId, customStylesForExpanded = {}, disabled = false }) => {
|
|
6151
6186
|
const [expanded, setExpanded] = (0, react.useState)(false);
|
|
6152
6187
|
const portalContainer = !!document.fullscreenElement ? document.querySelector("#root") : void 0;
|
|
@@ -6253,6 +6288,16 @@ var PreviewContainer$1 = /* @__PURE__ */ (0, _emotion_styled.default)("div", { t
|
|
|
6253
6288
|
"&:focus-within button": { opacity: 0 },
|
|
6254
6289
|
"&:focus-within button:hover": { opacity: 1 }
|
|
6255
6290
|
}));
|
|
6291
|
+
// src/helpers/localizeOptions.ts
|
|
6292
|
+
/**
|
|
6293
|
+
* Returns a copy of the options where every entry that declares a `labelKey`
|
|
6294
|
+
* gets its `label` replaced by the translation. Entries without a `labelKey`
|
|
6295
|
+
* are returned as is, so the English `label` remains their fallback.
|
|
6296
|
+
*/
|
|
6297
|
+
var localizeOptions = (options, t) => options.map((option) => option.labelKey ? {
|
|
6298
|
+
...option,
|
|
6299
|
+
label: t(option.labelKey)
|
|
6300
|
+
} : option);
|
|
6256
6301
|
// src/components/modal/Open/Open.tsx
|
|
6257
6302
|
/****************************************************************************
|
|
6258
6303
|
* Copyright 2021 EPAM Systems
|
|
@@ -6269,24 +6314,24 @@ var PreviewContainer$1 = /* @__PURE__ */ (0, _emotion_styled.default)("div", { t
|
|
|
6269
6314
|
* See the License for the specific language governing permissions and
|
|
6270
6315
|
* limitations under the License.
|
|
6271
6316
|
***************************************************************************/
|
|
6272
|
-
var OpenModal = /* @__PURE__ */ (0, _emotion_styled.default)(Modal, { target: "
|
|
6317
|
+
var OpenModal = /* @__PURE__ */ (0, _emotion_styled.default)(Modal, { target: "ek5blzu0" })(({ modalWidth }) => `
|
|
6273
6318
|
.MuiPaper-root {
|
|
6274
6319
|
width: ${modalWidth};
|
|
6275
6320
|
max-width: ${modalWidth};
|
|
6276
6321
|
}`);
|
|
6277
|
-
var OpenFooter = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
6322
|
+
var OpenFooter = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "ek5blzu1" })({
|
|
6278
6323
|
width: "100%",
|
|
6279
6324
|
display: "flex",
|
|
6280
6325
|
flexDirection: "row",
|
|
6281
6326
|
justifyContent: "space-between",
|
|
6282
6327
|
alignItems: "center"
|
|
6283
6328
|
});
|
|
6284
|
-
var FooterSelectorContainer = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
6329
|
+
var FooterSelectorContainer = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "ek5blzu2" })({
|
|
6285
6330
|
display: "flex",
|
|
6286
6331
|
height: "24px",
|
|
6287
6332
|
fontSize: "12px"
|
|
6288
6333
|
});
|
|
6289
|
-
var StyledDropdown = /* @__PURE__ */ (0, _emotion_styled.default)(StyledDropdown$1, { target: "
|
|
6334
|
+
var StyledDropdown = /* @__PURE__ */ (0, _emotion_styled.default)(StyledDropdown$1, { target: "ek5blzu3" })({
|
|
6290
6335
|
padding: 0,
|
|
6291
6336
|
fontSize: "12px",
|
|
6292
6337
|
"& .MuiSelect-select": {
|
|
@@ -6299,20 +6344,20 @@ var StyledDropdown = /* @__PURE__ */ (0, _emotion_styled.default)(StyledDropdown
|
|
|
6299
6344
|
},
|
|
6300
6345
|
"& span": { fontSize: "12px" }
|
|
6301
6346
|
});
|
|
6302
|
-
var FooterFormatSelector = /* @__PURE__ */ (0, _emotion_styled.default)(StyledDropdown, { target: "
|
|
6303
|
-
var FooterSequenceSelector = /* @__PURE__ */ (0, _emotion_styled.default)(StyledDropdown, { target: "
|
|
6347
|
+
var FooterFormatSelector = /* @__PURE__ */ (0, _emotion_styled.default)(StyledDropdown, { target: "ek5blzu4" })(() => ({ width: "140px" }));
|
|
6348
|
+
var FooterSequenceSelector = /* @__PURE__ */ (0, _emotion_styled.default)(StyledDropdown, { target: "ek5blzu5" })({
|
|
6304
6349
|
width: "76px",
|
|
6305
6350
|
marginInlineStart: "8px"
|
|
6306
6351
|
});
|
|
6307
|
-
var FooterPeptideLettersSelector = /* @__PURE__ */ (0, _emotion_styled.default)(StyledDropdown, { target: "
|
|
6352
|
+
var FooterPeptideLettersSelector = /* @__PURE__ */ (0, _emotion_styled.default)(StyledDropdown, { target: "ek5blzu6" })({
|
|
6308
6353
|
width: "105px",
|
|
6309
6354
|
marginInlineStart: "8px"
|
|
6310
6355
|
});
|
|
6311
|
-
var FooterButtonContainer = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
6356
|
+
var FooterButtonContainer = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "ek5blzu7" })({
|
|
6312
6357
|
display: "flex",
|
|
6313
6358
|
gap: "10px"
|
|
6314
6359
|
});
|
|
6315
|
-
var FooterButton = /* @__PURE__ */ (0, _emotion_styled.default)(ActionButton, { target: "
|
|
6360
|
+
var FooterButton = /* @__PURE__ */ (0, _emotion_styled.default)(ActionButton, { target: "ek5blzu8" })({ width: "min-content" });
|
|
6316
6361
|
var KET = "ket";
|
|
6317
6362
|
var SEQ = "seq";
|
|
6318
6363
|
var RNA = "rna";
|
|
@@ -6320,7 +6365,7 @@ var PEPTIDE = "peptide";
|
|
|
6320
6365
|
var FASTA = "fasta";
|
|
6321
6366
|
var ONE_LETTER = "one-letter";
|
|
6322
6367
|
var THREE_LETTER = "three-letter";
|
|
6323
|
-
var
|
|
6368
|
+
var formatOptionsConfig = [
|
|
6324
6369
|
{
|
|
6325
6370
|
id: "ket",
|
|
6326
6371
|
label: "Ket Format"
|
|
@@ -6331,7 +6376,8 @@ var options$1 = [
|
|
|
6331
6376
|
},
|
|
6332
6377
|
{
|
|
6333
6378
|
id: "seq",
|
|
6334
|
-
label: "Sequence"
|
|
6379
|
+
label: "Sequence",
|
|
6380
|
+
labelKey: "open.formats.sequence"
|
|
6335
6381
|
},
|
|
6336
6382
|
{
|
|
6337
6383
|
id: "fasta",
|
|
@@ -6354,7 +6400,7 @@ var options$1 = [
|
|
|
6354
6400
|
label: "BILN"
|
|
6355
6401
|
}
|
|
6356
6402
|
];
|
|
6357
|
-
var
|
|
6403
|
+
var additionalOptionsConfig = [
|
|
6358
6404
|
{
|
|
6359
6405
|
id: RNA,
|
|
6360
6406
|
label: "RNA"
|
|
@@ -6365,15 +6411,18 @@ var additionalOptions = [
|
|
|
6365
6411
|
},
|
|
6366
6412
|
{
|
|
6367
6413
|
id: PEPTIDE,
|
|
6368
|
-
label: "Peptide"
|
|
6414
|
+
label: "Peptide",
|
|
6415
|
+
labelKey: "open.formats.peptide"
|
|
6369
6416
|
}
|
|
6370
6417
|
];
|
|
6371
|
-
var
|
|
6418
|
+
var peptideLettersFormatOptionsConfig = [{
|
|
6372
6419
|
id: ONE_LETTER,
|
|
6373
|
-
label: "1-letter code"
|
|
6420
|
+
label: "1-letter code",
|
|
6421
|
+
labelKey: "open.formats.oneLetterCode"
|
|
6374
6422
|
}, {
|
|
6375
6423
|
id: THREE_LETTER,
|
|
6376
|
-
label: "3-letter code"
|
|
6424
|
+
label: "3-letter code",
|
|
6425
|
+
labelKey: "open.formats.threeLetterCode"
|
|
6377
6426
|
}];
|
|
6378
6427
|
var inputFormats = ketcher_core.macromoleculesFilesInputFormats;
|
|
6379
6428
|
var positionStructureOnNextSequenceLine = (drawingEntitiesManager) => {
|
|
@@ -6475,6 +6524,9 @@ var isAnalyzingFile = false;
|
|
|
6475
6524
|
var errorHandler = (error) => void 0;
|
|
6476
6525
|
var Open = ({ isModalOpen, onClose }) => {
|
|
6477
6526
|
const { t } = (0, react_i18next.useTranslation)("macromoleculesDialogs");
|
|
6527
|
+
const options = (0, react.useMemo)(() => localizeOptions(formatOptionsConfig, t), [t]);
|
|
6528
|
+
const additionalOptions = (0, react.useMemo)(() => localizeOptions(additionalOptionsConfig, t), [t]);
|
|
6529
|
+
const peptideLettersFormatOptions = (0, react.useMemo)(() => localizeOptions(peptideLettersFormatOptionsConfig, t), [t]);
|
|
6478
6530
|
const dispatch = useAppDispatch();
|
|
6479
6531
|
const [structStr, setStructStr] = (0, react.useState)("");
|
|
6480
6532
|
const [fileName, setFileName] = (0, react.useState)("");
|
|
@@ -6485,9 +6537,10 @@ var Open = ({ isModalOpen, onClose }) => {
|
|
|
6485
6537
|
const [additionalSelection, setAdditionalSelection] = (0, react.useState)(RNA);
|
|
6486
6538
|
const [peptideLettersFormatSelection, setPeptideLettersFormatSelection] = (0, react.useState)(ONE_LETTER);
|
|
6487
6539
|
(0, react.useEffect)(() => {
|
|
6488
|
-
|
|
6540
|
+
(async () => {
|
|
6541
|
+
const chosenOpener = await fileOpener();
|
|
6489
6542
|
setOpener({ chosenOpener });
|
|
6490
|
-
});
|
|
6543
|
+
})();
|
|
6491
6544
|
}, []);
|
|
6492
6545
|
const onCloseCallback = (0, react.useCallback)(() => {
|
|
6493
6546
|
setCurrentState(MODAL_STATES.openOptions);
|
|
@@ -6511,11 +6564,17 @@ var Open = ({ isModalOpen, onClose }) => {
|
|
|
6511
6564
|
const fileExtension = (fileName?.split(".")).at(-1);
|
|
6512
6565
|
setFileName(fileName);
|
|
6513
6566
|
if (fileExtension) {
|
|
6514
|
-
const option =
|
|
6567
|
+
const option = formatOptionsConfig.find((el) => el.id === fileExtension);
|
|
6515
6568
|
const id = option?.id ? option.id : SEQ;
|
|
6516
6569
|
setFormatSelection(id);
|
|
6517
6570
|
}
|
|
6518
|
-
opener
|
|
6571
|
+
if (opener) (async () => {
|
|
6572
|
+
try {
|
|
6573
|
+
onLoad(await opener.chosenOpener(files[0]));
|
|
6574
|
+
} catch {
|
|
6575
|
+
onError();
|
|
6576
|
+
}
|
|
6577
|
+
})();
|
|
6519
6578
|
};
|
|
6520
6579
|
const addToCanvasHandler = () => {
|
|
6521
6580
|
onOk({
|
|
@@ -6549,7 +6608,7 @@ var Open = ({ isModalOpen, onClose }) => {
|
|
|
6549
6608
|
};
|
|
6550
6609
|
const renderFooter = () => /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(OpenFooter, { children: [/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(FooterSelectorContainer, { children: [
|
|
6551
6610
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(FooterFormatSelector, {
|
|
6552
|
-
options
|
|
6611
|
+
options,
|
|
6553
6612
|
currentSelection: formatSelection,
|
|
6554
6613
|
selectionHandler: setFormatSelection,
|
|
6555
6614
|
customStylesForExpanded: stylesForExpanded
|
|
@@ -6560,13 +6619,13 @@ var Open = ({ isModalOpen, onClose }) => {
|
|
|
6560
6619
|
selectionHandler: setAdditionalSelection,
|
|
6561
6620
|
customStylesForExpanded: stylesForExpanded,
|
|
6562
6621
|
testId: "dropdown-select-type"
|
|
6563
|
-
}, additionalSelection) :
|
|
6622
|
+
}, additionalSelection) : void 0,
|
|
6564
6623
|
formatSelection === SEQ && additionalSelection === PEPTIDE ? /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(FooterPeptideLettersSelector, {
|
|
6565
6624
|
options: peptideLettersFormatOptions,
|
|
6566
6625
|
currentSelection: peptideLettersFormatSelection,
|
|
6567
6626
|
selectionHandler: setPeptideLettersFormatSelection,
|
|
6568
6627
|
testId: "dropdown-select-peptide-letters-format"
|
|
6569
|
-
}) :
|
|
6628
|
+
}) : void 0
|
|
6570
6629
|
] }), /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(FooterButtonContainer, { children: [/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(FooterButton, {
|
|
6571
6630
|
disabled: !structStr.trim(),
|
|
6572
6631
|
clickHandler: openHandler,
|
|
@@ -6750,7 +6809,7 @@ var getPropertiesByFormat = (format) => {
|
|
|
6750
6809
|
* See the License for the specific language governing permissions and
|
|
6751
6810
|
* limitations under the License.
|
|
6752
6811
|
***************************************************************************/
|
|
6753
|
-
var
|
|
6812
|
+
var optionsConfig = [
|
|
6754
6813
|
{
|
|
6755
6814
|
id: "ket",
|
|
6756
6815
|
label: "Ket Format"
|
|
@@ -6761,11 +6820,13 @@ var options = [
|
|
|
6761
6820
|
},
|
|
6762
6821
|
{
|
|
6763
6822
|
id: "sequence",
|
|
6764
|
-
label: "Sequence (1-letter code)"
|
|
6823
|
+
label: "Sequence (1-letter code)",
|
|
6824
|
+
labelKey: "save.formats.sequence1Letter"
|
|
6765
6825
|
},
|
|
6766
6826
|
{
|
|
6767
6827
|
id: "sequence-3-letter",
|
|
6768
|
-
label: "Sequence (3-letter code)"
|
|
6828
|
+
label: "Sequence (3-letter code)",
|
|
6829
|
+
labelKey: "save.formats.sequence3Letter"
|
|
6769
6830
|
},
|
|
6770
6831
|
{
|
|
6771
6832
|
id: "fasta",
|
|
@@ -6781,7 +6842,8 @@ var options = [
|
|
|
6781
6842
|
},
|
|
6782
6843
|
{
|
|
6783
6844
|
id: "svg",
|
|
6784
|
-
label: "SVG Document"
|
|
6845
|
+
label: "SVG Document",
|
|
6846
|
+
labelKey: "save.formats.svgDocument"
|
|
6785
6847
|
},
|
|
6786
6848
|
{
|
|
6787
6849
|
id: "helm",
|
|
@@ -6802,7 +6864,7 @@ var formatDetector = {
|
|
|
6802
6864
|
helm: ketcher_core.ChemicalMimeType.HELM,
|
|
6803
6865
|
biln: ketcher_core.ChemicalMimeType.BILN
|
|
6804
6866
|
};
|
|
6805
|
-
var StyledModal$1 = /* @__PURE__ */ (0, _emotion_styled.default)(Modal, { target: "
|
|
6867
|
+
var StyledModal$1 = /* @__PURE__ */ (0, _emotion_styled.default)(Modal, { target: "e89ny8p0" })({
|
|
6806
6868
|
"& div.MuiPaper-root": {
|
|
6807
6869
|
background: "white",
|
|
6808
6870
|
minHeight: "400px",
|
|
@@ -6815,6 +6877,7 @@ var StyledModal$1 = /* @__PURE__ */ (0, _emotion_styled.default)(Modal, { target
|
|
|
6815
6877
|
});
|
|
6816
6878
|
var Save = ({ onClose, isModalOpen }) => {
|
|
6817
6879
|
const { t } = (0, react_i18next.useTranslation)("macromoleculesDialogs");
|
|
6880
|
+
const options = (0, react.useMemo)(() => localizeOptions(optionsConfig, t), [t]);
|
|
6818
6881
|
const dispatch = useAppDispatch();
|
|
6819
6882
|
const indigo = ketcher_react.IndigoProvider.getIndigo();
|
|
6820
6883
|
const editor = (0, ketcher_core.provideEditorInstance)();
|
|
@@ -7324,19 +7387,19 @@ var ConnectionOverview = ({ firstMonomer, secondMonomer, expanded, firstMonomerO
|
|
|
7324
7387
|
] }) });
|
|
7325
7388
|
};
|
|
7326
7389
|
// src/components/modal/monomerConnection/MonomerConnections.tsx
|
|
7327
|
-
var StyledModal = /* @__PURE__ */ (0, _emotion_styled.default)(Modal, { target: "
|
|
7390
|
+
var StyledModal = /* @__PURE__ */ (0, _emotion_styled.default)(Modal, { target: "eq3wxrv0" })({
|
|
7328
7391
|
"& .MuiPaper-root": { background: "#fff !important" },
|
|
7329
7392
|
"& .MuiDialogContent-root": { overflow: "hidden" }
|
|
7330
7393
|
});
|
|
7331
|
-
var ActionButtonLeft = /* @__PURE__ */ (0, _emotion_styled.default)(ActionButton, { target: "
|
|
7332
|
-
var ActionButtonRight = /* @__PURE__ */ (0, _emotion_styled.default)(ActionButton, { target: "
|
|
7394
|
+
var ActionButtonLeft = /* @__PURE__ */ (0, _emotion_styled.default)(ActionButton, { target: "eq3wxrv1" })(() => ({ width: "97px !important" }));
|
|
7395
|
+
var ActionButtonRight = /* @__PURE__ */ (0, _emotion_styled.default)(ActionButton, { target: "eq3wxrv2" })((props) => ({
|
|
7333
7396
|
width: "97px !important",
|
|
7334
7397
|
color: props.disabled ? "rgba(51, 51, 51, 0.6)" : "",
|
|
7335
7398
|
background: props.disabled ? "rgba(225, 229, 234, 1) !important" : "",
|
|
7336
7399
|
opacity: "1 !important",
|
|
7337
7400
|
minHeight: "0"
|
|
7338
7401
|
}));
|
|
7339
|
-
var ActionButtonAttachmentPoint = /* @__PURE__ */ (0, _emotion_styled.default)(ActionButton, { target: "
|
|
7402
|
+
var ActionButtonAttachmentPoint = /* @__PURE__ */ (0, _emotion_styled.default)(ActionButton, { target: "eq3wxrv3" })((props) => ({
|
|
7340
7403
|
borderRadius: 5,
|
|
7341
7404
|
minWidth: "45px !important",
|
|
7342
7405
|
padding: "4px",
|
|
@@ -7432,11 +7495,11 @@ function AttachmentPointSelectionPanel({ monomer, selectedAttachmentPoint, onSel
|
|
|
7432
7495
|
const getLeavingGroup = (attachmentPoint) => {
|
|
7433
7496
|
const MonomerCaps = monomer.monomerCaps;
|
|
7434
7497
|
const isAmbiguousMonomer = monomer instanceof ketcher_core.AmbiguousMonomer;
|
|
7435
|
-
if (!MonomerCaps) return isAmbiguousMonomer ?
|
|
7436
|
-
return MonomerCaps[attachmentPoint]
|
|
7498
|
+
if (!MonomerCaps) return isAmbiguousMonomer ? void 0 : "H";
|
|
7499
|
+
return MonomerCaps[attachmentPoint];
|
|
7437
7500
|
};
|
|
7438
7501
|
const handleSelectAttachmentPoint = (attachmentPoint) => {
|
|
7439
|
-
const selectedBond = selectedAttachmentPoint ? monomer.attachmentPointsToBonds[selectedAttachmentPoint] :
|
|
7502
|
+
const selectedBond = selectedAttachmentPoint ? monomer.attachmentPointsToBonds[selectedAttachmentPoint] : void 0;
|
|
7440
7503
|
if (selectedAttachmentPoint && selectedBond) monomer.removeBond(selectedBond);
|
|
7441
7504
|
setConnectedAttachmentPoints(getConnectedAttachmentPoints(monomer.attachmentPointsToBonds));
|
|
7442
7505
|
onSelectAttachmentPoint(attachmentPoint);
|
|
@@ -7469,7 +7532,7 @@ function AttachmentPointSelectionPanel({ monomer, selectedAttachmentPoint, onSel
|
|
|
7469
7532
|
function getDefaultAttachmentPoint(monomer) {
|
|
7470
7533
|
if (monomer.chosenFirstAttachmentPointForBond) return monomer.chosenFirstAttachmentPointForBond;
|
|
7471
7534
|
if (monomer.chosenSecondAttachmentPointForBond) return monomer.chosenSecondAttachmentPointForBond;
|
|
7472
|
-
const possibleAttachmentPoints = Object.entries(monomer.attachmentPointsToBonds).filter(([_, bond]) => bond ==
|
|
7535
|
+
const possibleAttachmentPoints = Object.entries(monomer.attachmentPointsToBonds).filter(([_, bond]) => bond == void 0);
|
|
7473
7536
|
if (possibleAttachmentPoints.length === 1) {
|
|
7474
7537
|
const [attachmentPointName] = possibleAttachmentPoints[0];
|
|
7475
7538
|
return attachmentPointName;
|
|
@@ -8132,7 +8195,7 @@ var SettingsPanelAdapter = ({ isModalOpen, onClose }) => {
|
|
|
8132
8195
|
"macromoleculesDialogs"
|
|
8133
8196
|
]);
|
|
8134
8197
|
const settingsService = globalThis.ketcher?.settingsService;
|
|
8135
|
-
const [currentSettings, setCurrentSettings] = (0, react.useState)(
|
|
8198
|
+
const [currentSettings, setCurrentSettings] = (0, react.useState)();
|
|
8136
8199
|
const [isLoading, setIsLoading] = (0, react.useState)(false);
|
|
8137
8200
|
const { canvasElement, layoutRootElement } = useLayoutBounds();
|
|
8138
8201
|
(0, react.useEffect)(() => {
|
|
@@ -8148,7 +8211,7 @@ var SettingsPanelAdapter = ({ isModalOpen, onClose }) => {
|
|
|
8148
8211
|
setCurrentSettings((previous) => previous ? {
|
|
8149
8212
|
...previous,
|
|
8150
8213
|
[name]: value
|
|
8151
|
-
} :
|
|
8214
|
+
} : void 0);
|
|
8152
8215
|
};
|
|
8153
8216
|
const handleApply = async () => {
|
|
8154
8217
|
if (!settingsService || !currentSettings) return;
|
|
@@ -9159,7 +9222,7 @@ function useSetRnaPresets() {
|
|
|
9159
9222
|
customPresets = getPresets(monomersLibrary, customLabeledPresets);
|
|
9160
9223
|
}
|
|
9161
9224
|
dispatch(loadMonomerLibrary(monomersLibrary));
|
|
9162
|
-
dispatch(setFavoriteMonomersFromLocalStorage(
|
|
9225
|
+
dispatch(setFavoriteMonomersFromLocalStorage(void 0));
|
|
9163
9226
|
dispatch(setDefaultPresets(defaultPresets));
|
|
9164
9227
|
if (customLabeledPresets) dispatch(setCustomPresets(customPresets));
|
|
9165
9228
|
dispatch(setFavoritePresetsFromLocalStorage());
|
|
@@ -9176,7 +9239,7 @@ function useSetRnaPresets() {
|
|
|
9176
9239
|
// src/hooks/useMacromoleculesHotkeys.ts
|
|
9177
9240
|
function useMacromoleculesHotkeys() {
|
|
9178
9241
|
(0, react.useEffect)(() => {
|
|
9179
|
-
const helpUrl = `https://github.com/epam/ketcher/blob/v3.23.0-dev.
|
|
9242
|
+
const helpUrl = `https://github.com/epam/ketcher/blob/v3.23.0-dev.2/documentation/help.md#ketcher-macromolecules-mode`;
|
|
9180
9243
|
const handler = (0, ketcher_core.guardForMacromoleculesEditor)((e) => {
|
|
9181
9244
|
if (e.defaultPrevented) return;
|
|
9182
9245
|
const target = e.target;
|
|
@@ -9377,7 +9440,7 @@ var SubMenu = ({ children, vertical = false, autoSize = false, disabled = false,
|
|
|
9377
9440
|
ketcher_react.KETCHER_MACROMOLECULES_ROOT_NODE_SELECTOR
|
|
9378
9441
|
]);
|
|
9379
9442
|
const selectedMenuGroupItem = useAppSelector(selectSelectedMenuGroupItem(subMenuId));
|
|
9380
|
-
const lastActiveOption = subMenuId ? selectedMenuGroupItem :
|
|
9443
|
+
const lastActiveOption = subMenuId ? selectedMenuGroupItem : void 0;
|
|
9381
9444
|
const handleDropDownClick = () => {
|
|
9382
9445
|
if (disabled) return;
|
|
9383
9446
|
setOpen((prev) => !prev);
|
|
@@ -9444,16 +9507,18 @@ var SubMenu = ({ children, vertical = false, autoSize = false, disabled = false,
|
|
|
9444
9507
|
* See the License for the specific language governing permissions and
|
|
9445
9508
|
* limitations under the License.
|
|
9446
9509
|
***************************************************************************/
|
|
9447
|
-
var MenuLayout = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
9510
|
+
var MenuLayout = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "ed4gkg0" })(({ theme, isHorizontal }) => ({
|
|
9448
9511
|
backgroundColor: theme.ketcher.color.background.primary,
|
|
9449
9512
|
borderRadius: "4px",
|
|
9513
|
+
boxShadow: isHorizontal ? "none" : theme.ketcher.shadow.mainLayoutBlocks,
|
|
9514
|
+
padding: isHorizontal ? void 0 : "2px 0",
|
|
9450
9515
|
display: "flex",
|
|
9451
9516
|
flexDirection: isHorizontal ? "row" : "column",
|
|
9452
9517
|
zIndex: theme.ketcher.zIndex.toolbar
|
|
9453
9518
|
}));
|
|
9454
|
-
var Divider = /* @__PURE__ */ (0, _emotion_styled.default)("hr", { target: "
|
|
9455
|
-
var VerticalDivider = /* @__PURE__ */ (0, _emotion_styled.default)("hr", { target: "
|
|
9456
|
-
var StyledGroup = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "
|
|
9519
|
+
var Divider = /* @__PURE__ */ (0, _emotion_styled.default)("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, ";");
|
|
9520
|
+
var VerticalDivider = /* @__PURE__ */ (0, _emotion_styled.default)("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, ";");
|
|
9521
|
+
var StyledGroup = /* @__PURE__ */ (0, _emotion_styled.default)("div", { target: "ed4gkg3" })(({ theme, isHorizontal }) => ({
|
|
9457
9522
|
display: "flex",
|
|
9458
9523
|
flexDirection: isHorizontal ? "row" : "column",
|
|
9459
9524
|
flexWrap: "nowrap",
|
|
@@ -9497,7 +9562,7 @@ var Menu = ({ children, onItemClick, activeMenuItems, testId, isHorizontal }) =>
|
|
|
9497
9562
|
}
|
|
9498
9563
|
}), [activeMenuItems, onItemClick]);
|
|
9499
9564
|
const subComponents = react.default.Children.map(children, (child) => {
|
|
9500
|
-
return child?.type === Group ? child :
|
|
9565
|
+
return child?.type === Group ? child : void 0;
|
|
9501
9566
|
});
|
|
9502
9567
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(MenuContext.Provider, {
|
|
9503
9568
|
value: context,
|
|
@@ -9826,7 +9891,7 @@ var isCycleExistsForSelectedMonomers = (selectedMonomers) => {
|
|
|
9826
9891
|
return false;
|
|
9827
9892
|
};
|
|
9828
9893
|
for (const monomer of selectedMonomers) if (!visited.has(monomer)) {
|
|
9829
|
-
if (hasCycleFromMonomer(monomer
|
|
9894
|
+
if (hasCycleFromMonomer(monomer)) return true;
|
|
9830
9895
|
}
|
|
9831
9896
|
return false;
|
|
9832
9897
|
};
|
|
@@ -10251,14 +10316,14 @@ var useAttachmentPoints = ({ monomerCaps, attachmentPointsToBonds }) => {
|
|
|
10251
10316
|
// src/components/preview/hooks/useIDTAliasesTextForMonomer.ts
|
|
10252
10317
|
var useIDTAliasesTextForMonomer = ({ idtAliases, attachmentPointsToBonds }) => {
|
|
10253
10318
|
return (0, react.useMemo)(() => {
|
|
10254
|
-
if (!idtAliases) return
|
|
10319
|
+
if (!idtAliases) return;
|
|
10255
10320
|
const { base, modifications } = idtAliases;
|
|
10256
10321
|
if (!modifications) return removeSlashesFromIdtAlias(base);
|
|
10257
10322
|
const { endpoint5, internal, endpoint3 } = modifications;
|
|
10258
10323
|
if (attachmentPointsToBonds) {
|
|
10259
10324
|
const { R1, R2 } = attachmentPointsToBonds;
|
|
10260
|
-
const hasR1Connection = R1 !=
|
|
10261
|
-
const hasR2Connection = R2 !=
|
|
10325
|
+
const hasR1Connection = R1 != void 0;
|
|
10326
|
+
const hasR2Connection = R2 != void 0;
|
|
10262
10327
|
if (hasR1Connection && !hasR2Connection) return removeSlashesFromIdtAlias(endpoint3 ?? internal);
|
|
10263
10328
|
else if (!hasR1Connection && hasR2Connection) return removeSlashesFromIdtAlias(endpoint5 ?? internal);
|
|
10264
10329
|
else if (hasR1Connection && hasR2Connection) return removeSlashesFromIdtAlias(internal ?? endpoint5 ?? endpoint3);
|
|
@@ -10440,7 +10505,7 @@ var PhosphatePositionIconWrapper = /* @__PURE__ */ (0, _emotion_styled.default)(
|
|
|
10440
10505
|
// src/components/preview/hooks/useIDTAliasesTextForPreset.ts
|
|
10441
10506
|
var useIDTAliasesTextForPreset = ({ presetName, position, idtAliases }) => {
|
|
10442
10507
|
return (0, react.useMemo)(() => {
|
|
10443
|
-
if (!presetName || !idtAliases) return
|
|
10508
|
+
if (!presetName || !idtAliases) return;
|
|
10444
10509
|
if (presetName.includes("MOE")) {
|
|
10445
10510
|
const { base, modifications } = idtAliases;
|
|
10446
10511
|
const endpoint5 = removeSlashesFromIdtAlias(modifications?.endpoint5) ?? `5${base}`;
|
|
@@ -10532,7 +10597,7 @@ var PresetPreview = ({ className }) => {
|
|
|
10532
10597
|
"data-phosphate-position": preview.phosphatePosition,
|
|
10533
10598
|
children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(PhosphatePositionIcon, { name: phosphatePositionIconName })
|
|
10534
10599
|
})
|
|
10535
|
-
] }, monomer.props.id ?? index) :
|
|
10600
|
+
] }, monomer.props.id ?? index) : void 0),
|
|
10536
10601
|
isMonomerPreviewPropertiesVisible && /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(MonomerPreviewProperties, {
|
|
10537
10602
|
preset: true,
|
|
10538
10603
|
idtAliasesText: idtAliasesText ?? void 0,
|
|
@@ -10541,7 +10606,7 @@ var PresetPreview = ({ className }) => {
|
|
|
10541
10606
|
]
|
|
10542
10607
|
});
|
|
10543
10608
|
};
|
|
10544
|
-
var PresetStyledPreview = /* @__PURE__ */ (0, _emotion_styled.default)(PresetPreview, { target: "
|
|
10609
|
+
var PresetStyledPreview = /* @__PURE__ */ (0, _emotion_styled.default)(PresetPreview, { target: "e106wyr50" })();
|
|
10545
10610
|
// src/components/preview/components/BondPreview/BondPreview.styles.ts
|
|
10546
10611
|
var Container$1 = /* @__PURE__ */ (0, _emotion_styled.default)("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, ";");
|
|
10547
10612
|
// src/components/preview/components/BondAttachmentPoints/BondAttachmentPoints.styles.ts
|
|
@@ -10777,7 +10842,7 @@ var persistSequenceType = (sequenceType) => {
|
|
|
10777
10842
|
localStorageWrapper.setItem(SEQUENCE_TYPE_STORAGE_KEY, sequenceType);
|
|
10778
10843
|
};
|
|
10779
10844
|
// src/components/ZoomControls/helpers.ts
|
|
10780
|
-
var hotkeysShortcuts = (0, ketcher_core.generateMenuShortcuts)(ketcher_core.
|
|
10845
|
+
var hotkeysShortcuts = (0, ketcher_core.generateMenuShortcuts)(ketcher_core.hotkeysConfig);
|
|
10781
10846
|
var getIntegerFromString = (zoomInput) => {
|
|
10782
10847
|
const zoomNumber = Number.parseInt(zoomInput ?? "");
|
|
10783
10848
|
if (Number.isNaN(zoomNumber)) return 0;
|
|
@@ -11905,7 +11970,7 @@ function LeftMenuComponent() {
|
|
|
11905
11970
|
testId: "hand",
|
|
11906
11971
|
disabled: isSettingsPanelOpen
|
|
11907
11972
|
}),
|
|
11908
|
-
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.
|
|
11973
|
+
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(Menu.Submenu, {
|
|
11909
11974
|
testId: "select-drop-down-button",
|
|
11910
11975
|
disabled: isSettingsPanelOpen,
|
|
11911
11976
|
subMenuId: SELECT_SUBMENU_ID,
|
|
@@ -11930,7 +11995,7 @@ function LeftMenuComponent() {
|
|
|
11930
11995
|
disabled: isSettingsPanelOpen
|
|
11931
11996
|
})
|
|
11932
11997
|
]
|
|
11933
|
-
})
|
|
11998
|
+
}),
|
|
11934
11999
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(Menu.Item, {
|
|
11935
12000
|
itemId: "erase",
|
|
11936
12001
|
title: t("leftMenu.erase", { shortcut: hotkeysShortcuts.erase }),
|
|
@@ -12030,7 +12095,7 @@ var ZoomControls = () => {
|
|
|
12030
12095
|
const { t } = (0, react_i18next.useTranslation)("macromolecules");
|
|
12031
12096
|
const [isExpanded, setIsExpanded] = (0, react.useState)(false);
|
|
12032
12097
|
const [currentZoom, setCurrentZoom] = (0, react.useState)(100);
|
|
12033
|
-
const [containerElement, setContainerElement] = (0, react.useState)(
|
|
12098
|
+
const [containerElement, setContainerElement] = (0, react.useState)();
|
|
12034
12099
|
const inputRef = (0, react.useRef)(null);
|
|
12035
12100
|
const zoomTool = useAppSelector(selectEditor)?.zoomTool;
|
|
12036
12101
|
(0, react.useEffect)(() => {
|
|
@@ -12677,7 +12742,7 @@ var SequenceSyncEditModeButton = () => {
|
|
|
12677
12742
|
};
|
|
12678
12743
|
// src/components/Ruler/useTranslateAlongXAxis.ts
|
|
12679
12744
|
var useTranslateAlongXAxis = (ref, offsetX) => {
|
|
12680
|
-
const animateRef = (0, react.useRef)(
|
|
12745
|
+
const animateRef = (0, react.useRef)(void 0);
|
|
12681
12746
|
(0, react.useLayoutEffect)(() => {
|
|
12682
12747
|
const element = ref.current;
|
|
12683
12748
|
if (!element) return;
|
|
@@ -12687,7 +12752,7 @@ var useTranslateAlongXAxis = (ref, offsetX) => {
|
|
|
12687
12752
|
return () => {
|
|
12688
12753
|
if (animateRef.current) {
|
|
12689
12754
|
cancelAnimationFrame(animateRef.current);
|
|
12690
|
-
animateRef.current =
|
|
12755
|
+
animateRef.current = void 0;
|
|
12691
12756
|
}
|
|
12692
12757
|
};
|
|
12693
12758
|
}, [ref, offsetX]);
|
|
@@ -12705,23 +12770,23 @@ var RulerInput = ({ lineLengthValue, offsetX, isDragging, layoutMode, onCommitVa
|
|
|
12705
12770
|
const ref = (0, react.useRef)(null);
|
|
12706
12771
|
useTranslateAlongXAxis(ref, offsetX);
|
|
12707
12772
|
const stringifiedLineLengthValue = lineLengthValue.toString();
|
|
12708
|
-
const [editingValue, setEditingValue] = (0, react.useState)(
|
|
12709
|
-
const displayValue = editingValue
|
|
12773
|
+
const [editingValue, setEditingValue] = (0, react.useState)();
|
|
12774
|
+
const displayValue = editingValue ?? stringifiedLineLengthValue;
|
|
12710
12775
|
const handleChange = (event) => {
|
|
12711
12776
|
setEditingValue(event.target.value);
|
|
12712
12777
|
};
|
|
12713
12778
|
const handleBlur = () => {
|
|
12714
12779
|
if (!editingValue || editingValue.trim() === "") {
|
|
12715
|
-
setEditingValue(
|
|
12780
|
+
setEditingValue(void 0);
|
|
12716
12781
|
return;
|
|
12717
12782
|
}
|
|
12718
12783
|
const newValue = Number(editingValue);
|
|
12719
12784
|
if (Number.isNaN(newValue) || newValue < 1) {
|
|
12720
|
-
setEditingValue(
|
|
12785
|
+
setEditingValue(void 0);
|
|
12721
12786
|
return;
|
|
12722
12787
|
}
|
|
12723
12788
|
const newLineLength = layoutMode === "sequence-layout-mode" ? Math.round(newValue / 10) * 10 : newValue;
|
|
12724
|
-
setEditingValue(
|
|
12789
|
+
setEditingValue(void 0);
|
|
12725
12790
|
onCommitValue(newLineLength);
|
|
12726
12791
|
};
|
|
12727
12792
|
const handleKeyDown = (event) => {
|
|
@@ -12750,7 +12815,7 @@ var RulerInput_default = (0, react.memo)(RulerInput);
|
|
|
12750
12815
|
var SnakeModeItemWidth = ketcher_core.SnakeLayoutCellWidth;
|
|
12751
12816
|
// src/components/Ruler/RulerScale.tsx
|
|
12752
12817
|
var RulerScale = ({ transform, layoutMode }) => {
|
|
12753
|
-
const [svgElement, setSvgElement] = (0, react.useState)(
|
|
12818
|
+
const [svgElement, setSvgElement] = (0, react.useState)();
|
|
12754
12819
|
const isZoomedOut = transform.k - .5 < Number.EPSILON;
|
|
12755
12820
|
const getDynamicPositions = (visibleStart, visibleEnd, step, offset) => {
|
|
12756
12821
|
const startIndex = Math.max(0, Math.floor((visibleStart - offset) / step));
|
|
@@ -12917,7 +12982,7 @@ var useZoomTransform = () => {
|
|
|
12917
12982
|
// src/components/Ruler/RulerArea.tsx
|
|
12918
12983
|
var getVisibleEdges = (canvasContainer, fallbackWidth) => {
|
|
12919
12984
|
const visibleWidth = canvasContainer?.clientWidth || fallbackWidth;
|
|
12920
|
-
if (!visibleWidth) return
|
|
12985
|
+
if (!visibleWidth) return;
|
|
12921
12986
|
const left = canvasContainer?.scrollLeft || 0;
|
|
12922
12987
|
return {
|
|
12923
12988
|
left,
|
|
@@ -13076,11 +13141,11 @@ var GhostRnaPreset = ({ preset }) => {
|
|
|
13076
13141
|
const phosphateRenderer = phosphate ? (() => {
|
|
13077
13142
|
const [PhosphateMonomer, PhosphateRenderer] = (0, ketcher_core.monomerFactory)(phosphate);
|
|
13078
13143
|
return new PhosphateRenderer(new PhosphateMonomer(phosphate));
|
|
13079
|
-
})() :
|
|
13144
|
+
})() : void 0;
|
|
13080
13145
|
const baseRenderer = base ? (() => {
|
|
13081
13146
|
const [BaseMonomer, BaseRenderer] = (0, ketcher_core.monomerFactory)(base);
|
|
13082
13147
|
return new BaseRenderer(new BaseMonomer(base));
|
|
13083
|
-
})() :
|
|
13148
|
+
})() : void 0;
|
|
13084
13149
|
const sugarSize = sugarRenderer.monomerSize;
|
|
13085
13150
|
const phosphateSize = phosphateRenderer?.monomerSize;
|
|
13086
13151
|
const baseSize = baseRenderer?.monomerSize;
|
|
@@ -13276,9 +13341,9 @@ var GhostMonomer = ({ monomerItem }) => {
|
|
|
13276
13341
|
// src/components/DragGhost/DragGhost.tsx
|
|
13277
13342
|
var DragGhost = () => {
|
|
13278
13343
|
const editor = (0, react_redux.useSelector)(selectEditor);
|
|
13279
|
-
const [libraryItemDragData, setLibraryItemDragData] = (0, react.useState)(
|
|
13344
|
+
const [libraryItemDragData, setLibraryItemDragData] = (0, react.useState)();
|
|
13280
13345
|
const ghostWrapperRef = (0, react.useRef)(null);
|
|
13281
|
-
const animateRef = (0, react.useRef)(
|
|
13346
|
+
const animateRef = (0, react.useRef)(void 0);
|
|
13282
13347
|
const canvasBBoxRef = (0, react.useRef)(null);
|
|
13283
13348
|
const transform = useZoomTransform();
|
|
13284
13349
|
(0, react.useEffect)(() => {
|
|
@@ -13313,7 +13378,7 @@ var DragGhost = () => {
|
|
|
13313
13378
|
return () => {
|
|
13314
13379
|
if (animateRef.current) {
|
|
13315
13380
|
cancelAnimationFrame(animateRef.current);
|
|
13316
|
-
animateRef.current =
|
|
13381
|
+
animateRef.current = void 0;
|
|
13317
13382
|
}
|
|
13318
13383
|
};
|
|
13319
13384
|
}, [
|
|
@@ -13607,7 +13672,7 @@ function ButtonsComponents() {
|
|
|
13607
13672
|
iconName: "help",
|
|
13608
13673
|
title: t("buttons.help"),
|
|
13609
13674
|
onClick: () => {
|
|
13610
|
-
window.open(`https://github.com/epam/ketcher/blob/v3.23.0-dev.
|
|
13675
|
+
window.open(`https://github.com/epam/ketcher/blob/v3.23.0-dev.2/documentation/help.md#ketcher-macromolecules-mode`, "_blank");
|
|
13611
13676
|
},
|
|
13612
13677
|
testId: "help-button"
|
|
13613
13678
|
}),
|
|
@@ -13775,12 +13840,13 @@ function EditorContainer({ onInit, ketcherId, theme, togglerComponent, monomersL
|
|
|
13775
13840
|
})
|
|
13776
13841
|
});
|
|
13777
13842
|
}
|
|
13778
|
-
function Editor({ theme, togglerComponent, monomersLibraryUpdate, monomersLibraryReplace, onInit }) {
|
|
13843
|
+
function Editor({ ketcherId, theme, togglerComponent, monomersLibraryUpdate, monomersLibraryReplace, onInit }) {
|
|
13779
13844
|
const dispatch = useAppDispatch();
|
|
13780
13845
|
const canvasRef = (0, react.useRef)(null);
|
|
13781
13846
|
const errorTooltips = useAppSelector(selectErrorTooltips);
|
|
13782
13847
|
const editor = useAppSelector(selectEditor);
|
|
13783
13848
|
const isHandToolSelected = useAppSelector(selectIsHandToolSelected);
|
|
13849
|
+
const layoutMode = useLayoutMode();
|
|
13784
13850
|
const isLoading = useLoading();
|
|
13785
13851
|
const [isMonomerLibraryHidden, setIsMonomerLibraryHidden] = (0, react.useState)(false);
|
|
13786
13852
|
const isSequenceEditInRNABuilderMode = useSequenceEditInRNABuilderMode();
|
|
@@ -13790,12 +13856,15 @@ function Editor({ theme, togglerComponent, monomersLibraryUpdate, monomersLibrar
|
|
|
13790
13856
|
const [isPasteAvailable, setIsPasteAvailable] = (0, react.useState)(true);
|
|
13791
13857
|
const updatePasteAvailability = (0, react.useCallback)(() => {
|
|
13792
13858
|
if (!editor) return;
|
|
13793
|
-
(
|
|
13859
|
+
(async () => {
|
|
13860
|
+
setIsPasteAvailable(await (0, ketcher_core.isPasteContentAvailable)((content) => editor.mode.isPasteContentValid(content)));
|
|
13861
|
+
})();
|
|
13794
13862
|
}, [editor]);
|
|
13795
13863
|
const { show: showSequenceContextMenu } = (0, react_contexify.useContextMenu)({ id: CONTEXT_MENU_ID.FOR_SEQUENCE });
|
|
13796
13864
|
const { show: showSelectedMonomersContextMenu } = (0, react_contexify.useContextMenu)({ id: CONTEXT_MENU_ID.FOR_SELECTED_MONOMERS });
|
|
13797
13865
|
(0, react.useEffect)(() => {
|
|
13798
13866
|
dispatch(createEditor({
|
|
13867
|
+
ketcherId,
|
|
13799
13868
|
theme,
|
|
13800
13869
|
canvas: canvasRef.current,
|
|
13801
13870
|
monomersLibraryUpdate,
|
|
@@ -13918,6 +13987,7 @@ function Editor({ theme, togglerComponent, monomersLibraryUpdate, monomersLibrar
|
|
|
13918
13987
|
id: "polymer-editor-canvas",
|
|
13919
13988
|
"data-testid": "ketcher-canvas",
|
|
13920
13989
|
"data-canvasmode": "macromolecules-mode",
|
|
13990
|
+
"data-canvaslayout": layoutMode.replace(/-layout-mode$/, ""),
|
|
13921
13991
|
preserveAspectRatio: "xMidYMid meet",
|
|
13922
13992
|
ref: canvasRef,
|
|
13923
13993
|
width: "100%",
|