ketcher-react 3.6.0-rc.1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +511 -366
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{index.modern-4c4698fb.js → index.modern-44fde8a2.js} +26 -20
- package/dist/{index.modern-b7795f49.js.map → cjs/index.modern-44fde8a2.js.map} +1 -1
- package/dist/index.js +511 -366
- package/dist/index.js.map +1 -1
- package/dist/{index.modern-b7795f49.js → index.modern-3204c52a.js} +26 -20
- package/dist/index.modern-3204c52a.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/index.modern-4c4698fb.js.map +0 -1
|
@@ -7533,8 +7533,8 @@ var useLibraryItemDrag = function useLibraryItemDrag(item, itemRef) {
|
|
|
7533
7533
|
right = canvasWrapperBoundingClientRect.right,
|
|
7534
7534
|
bottom = canvasWrapperBoundingClientRect.bottom;
|
|
7535
7535
|
var transform = ketcherCore.ZoomTool.instance.zoomTransform;
|
|
7536
|
-
var adjustedX = x - left + 15;
|
|
7537
|
-
var adjustedY = y - top + 15;
|
|
7536
|
+
var adjustedX = x - left + transform.k * 15;
|
|
7537
|
+
var adjustedY = y - top + transform.k * 15;
|
|
7538
7538
|
var _transform$invert = transform.invert([adjustedX, adjustedY]),
|
|
7539
7539
|
_transform$invert2 = _slicedToArray__default["default"](_transform$invert, 2),
|
|
7540
7540
|
scaledX = _transform$invert2[0],
|
|
@@ -12922,9 +12922,9 @@ function useLoading() {
|
|
|
12922
12922
|
|
|
12923
12923
|
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12924
12924
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12925
|
-
function _createForOfIteratorHelper$2(
|
|
12926
|
-
function _unsupportedIterableToArray$2(
|
|
12927
|
-
function _arrayLikeToArray$2(
|
|
12925
|
+
function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12926
|
+
function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }
|
|
12927
|
+
function _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12928
12928
|
function useSetRnaPresets() {
|
|
12929
12929
|
var dispatch = useAppDispatch();
|
|
12930
12930
|
var editor = useAppSelector(selectEditor);
|
|
@@ -13434,9 +13434,9 @@ var LayoutModeButton = function LayoutModeButton() {
|
|
|
13434
13434
|
});
|
|
13435
13435
|
};
|
|
13436
13436
|
|
|
13437
|
-
function _createForOfIteratorHelper$1(
|
|
13438
|
-
function _unsupportedIterableToArray$1(
|
|
13439
|
-
function _arrayLikeToArray$1(
|
|
13437
|
+
function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13438
|
+
function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
|
|
13439
|
+
function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13440
13440
|
var generateLabeledNodes = function generateLabeledNodes(selectionsFlatten) {
|
|
13441
13441
|
var labeledNodes = [];
|
|
13442
13442
|
var _iterator = _createForOfIteratorHelper$1(selectionsFlatten),
|
|
@@ -14899,9 +14899,9 @@ var useRecalculateMacromoleculeProperties = function useRecalculateMacromolecule
|
|
|
14899
14899
|
};
|
|
14900
14900
|
|
|
14901
14901
|
var _excluded = ["className"];
|
|
14902
|
-
function _createForOfIteratorHelper(
|
|
14903
|
-
function _unsupportedIterableToArray(
|
|
14904
|
-
function _arrayLikeToArray(
|
|
14902
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
14903
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14904
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14905
14905
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14906
14906
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14907
14907
|
var OTHER_MONOMER_COUNT_NAME = 'Other';
|
|
@@ -17293,8 +17293,7 @@ var RulerArea = function RulerArea() {
|
|
|
17293
17293
|
var styles = {"dragGhost":"DragGhost-module_dragGhost__m5lHf"};
|
|
17294
17294
|
|
|
17295
17295
|
var GhostRnaPreset = function GhostRnaPreset(_ref) {
|
|
17296
|
-
var preset = _ref.preset
|
|
17297
|
-
zoomFactor = _ref.zoomFactor;
|
|
17296
|
+
var preset = _ref.preset;
|
|
17298
17297
|
var sugar = preset.sugar,
|
|
17299
17298
|
phosphate = preset.phosphate,
|
|
17300
17299
|
base = preset.base;
|
|
@@ -17326,9 +17325,8 @@ var GhostRnaPreset = function GhostRnaPreset(_ref) {
|
|
|
17326
17325
|
var sugarSize = sugarRenderer.monomerSize;
|
|
17327
17326
|
var phosphateSize = phosphateRenderer === null || phosphateRenderer === void 0 ? void 0 : phosphateRenderer.monomerSize;
|
|
17328
17327
|
var baseSize = baseRenderer === null || baseRenderer === void 0 ? void 0 : baseRenderer.monomerSize;
|
|
17329
|
-
var
|
|
17330
|
-
var
|
|
17331
|
-
var sugarY = scaledOffset;
|
|
17328
|
+
var sugarX = 0;
|
|
17329
|
+
var sugarY = 0;
|
|
17332
17330
|
var phosphateX = phosphateSize ? sugarX + sugarSize.width + 30 : 0;
|
|
17333
17331
|
var phosphateY = sugarY;
|
|
17334
17332
|
var baseX = sugarX + (sugarSize.width - ((baseSize === null || baseSize === void 0 ? void 0 : baseSize.width) || 0)) / 2;
|
|
@@ -17496,7 +17494,16 @@ var DragGhost = function DragGhost() {
|
|
|
17496
17494
|
return;
|
|
17497
17495
|
}
|
|
17498
17496
|
animateRef.current = requestAnimationFrame(function () {
|
|
17499
|
-
|
|
17497
|
+
var _libraryItemDragData$ = libraryItemDragData.position,
|
|
17498
|
+
x = _libraryItemDragData$.x,
|
|
17499
|
+
y = _libraryItemDragData$.y;
|
|
17500
|
+
if (dragOverCanvas && canvasBBoxRef.current) {
|
|
17501
|
+
var scale = transform.k;
|
|
17502
|
+
element.style.transformOrigin = '0 0';
|
|
17503
|
+
element.style.transform = "translate(".concat(x, "px, ").concat(y, "px) scale(").concat(scale, ")");
|
|
17504
|
+
} else {
|
|
17505
|
+
element.style.transform = "translate(".concat(x, "px, ").concat(y, "px)");
|
|
17506
|
+
}
|
|
17500
17507
|
});
|
|
17501
17508
|
return function () {
|
|
17502
17509
|
if (animateRef.current) {
|
|
@@ -17512,8 +17519,7 @@ var DragGhost = function DragGhost() {
|
|
|
17512
17519
|
className: styles.dragGhost,
|
|
17513
17520
|
ref: ghostWrapperRef,
|
|
17514
17521
|
children: ketcherCore.isLibraryItemRnaPreset(libraryItemDragData.item) ? jsxRuntime.jsx(GhostRnaPreset, {
|
|
17515
|
-
preset: libraryItemDragData.item
|
|
17516
|
-
zoomFactor: transform.k
|
|
17522
|
+
preset: libraryItemDragData.item
|
|
17517
17523
|
}) : jsxRuntime.jsx(GhostMonomer, {
|
|
17518
17524
|
monomerItem: libraryItemDragData.item
|
|
17519
17525
|
})
|
|
@@ -17781,4 +17787,4 @@ function Editor(_ref2) {
|
|
|
17781
17787
|
}
|
|
17782
17788
|
|
|
17783
17789
|
exports["default"] = EditorContainer;
|
|
17784
|
-
//# sourceMappingURL=index.modern-
|
|
17790
|
+
//# sourceMappingURL=index.modern-44fde8a2.js.map
|