ketcher-react 2.25.0-rc.1 → 2.25.0-rc.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.
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
16
  import { IStructRenderProps } from './types';
17
- declare const StructRender: ({ struct, options, className, update, }: IStructRenderProps) => import("react/jsx-runtime").JSX.Element;
17
+ declare const StructRender: ({ struct, options, className, fullsize, update, }: IStructRenderProps) => import("react/jsx-runtime").JSX.Element;
18
18
  export default StructRender;
@@ -17,4 +17,6 @@
17
17
  export declare const Container: import("@emotion/styled").StyledComponent<{
18
18
  theme?: import("@emotion/react").Theme | undefined;
19
19
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
+ } & {
21
+ fullsize?: boolean | undefined;
20
22
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -24,5 +24,6 @@ export interface IStructRenderProps {
24
24
  options?: (RenderOptions & CasheOptions) | CasheOptions;
25
25
  className?: string;
26
26
  update?: boolean;
27
+ fullsize?: boolean;
27
28
  }
28
29
  export {};
package/dist/index.js CHANGED
@@ -3766,7 +3766,7 @@ var zoom = {
3766
3766
 
3767
3767
  var openHelpLink = function openHelpLink() {
3768
3768
  var _window$open;
3769
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.25.0-rc.1\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3769
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.25.0-rc.2\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3770
3770
  };
3771
3771
  var help = {
3772
3772
  help: {
@@ -8096,7 +8096,13 @@ var Button = function Button(_ref) {
8096
8096
  };
8097
8097
 
8098
8098
  var _templateObject$b;
8099
- var Container$2 = styled__default["default"].div(_templateObject$b || (_templateObject$b = _taggedTemplateLiteral__default["default"](["\n > svg {\n height: 100%;\n width: 100%;\n }\n"])));
8099
+ var Container$2 = styled__default["default"].div(_templateObject$b || (_templateObject$b = _taggedTemplateLiteral__default["default"](["\n ", "\n"])), function (props) {
8100
+ if (props.fullsize) {
8101
+ return "\n > svg {\n height: 100%;\n width: 100%;\n }\n ";
8102
+ } else {
8103
+ return "\n display: flex;\n justify-content: center;\n align-items: center;\n ";
8104
+ }
8105
+ });
8100
8106
 
8101
8107
  var normalizeStruct = function normalizeStruct(molV2000StringOrStruct) {
8102
8108
  if (molV2000StringOrStruct instanceof ketcherCore.Struct) {
@@ -8113,6 +8119,7 @@ var StructRender = function StructRender(_ref) {
8113
8119
  var struct = _ref.struct,
8114
8120
  options = _ref.options,
8115
8121
  className = _ref.className,
8122
+ fullsize = _ref.fullsize,
8116
8123
  update = _ref.update;
8117
8124
  var renderRef = React.useRef(null);
8118
8125
  React.useEffect(function () {
@@ -8125,7 +8132,8 @@ var StructRender = function StructRender(_ref) {
8125
8132
  }, [struct, options, update]);
8126
8133
  return jsxRuntime.jsx(Container$2, {
8127
8134
  ref: renderRef,
8128
- className: className
8135
+ className: className,
8136
+ fullsize: fullsize
8129
8137
  });
8130
8138
  };
8131
8139
 
@@ -8413,6 +8421,14 @@ var UnstyledAmbiguousMonomerPreview = function UnstyledAmbiguousMonomerPreview(_
8413
8421
  return b.ratio - a.ratio;
8414
8422
  }
8415
8423
  });
8424
+ if (!isAlternatives) {
8425
+ var overallRatio = sortedData.reduce(function (acc, item) {
8426
+ return acc + (item.ratio || 1);
8427
+ }, 0);
8428
+ sortedData.forEach(function (entry) {
8429
+ entry.ratio = Math.round((entry.ratio || 1) / overallRatio * 100);
8430
+ });
8431
+ }
8416
8432
  return sortedData.slice(0, 5);
8417
8433
  }, [previewData, isAlternatives]);
8418
8434
  return jsxRuntime.jsxs(ContainerDynamic, {
@@ -32532,6 +32548,7 @@ var TemplateTable = function TemplateTable(props) {
32532
32548
  children: [jsxRuntime.jsx(StructRender, {
32533
32549
  struct: tmpl.struct,
32534
32550
  className: classes$8.struct,
32551
+ fullsize: true,
32535
32552
  options: _objectSpread$7(_objectSpread$7({}, renderOptions), {}, {
32536
32553
  autoScaleMargin: 10,
32537
32554
  cachePrefix: 'templates',
@@ -34186,8 +34203,8 @@ var KetcherBuilder = function () {
34186
34203
  cleanup = initApp(element, appRoot, staticResourcesUrl, {
34187
34204
  buttons: buttons || {},
34188
34205
  errorHandler: errorHandler || null,
34189
- version: "2.25.0-rc.1" ,
34190
- buildDate: "2024-09-03T15:37:44" ,
34206
+ version: "2.25.0-rc.2" ,
34207
+ buildDate: "2024-09-14T10:49:21" ,
34191
34208
  buildNumber: ''
34192
34209
  }, structService, resolve, togglerComponent);
34193
34210
  });