Skip to content

Commit

Permalink
#6344 - Excessive scroll appears in macromolecules mode in canvas if …
Browse files Browse the repository at this point in the history
…Ketcher is inside dialog window (#6352)

* #6344 - Excessive scroll appears in macromolecules mode in canvas if Ketcher is inside dialog window
- fixed styles for Ketcher in popup
- fixed layout for right column
- updated screenshot

* #6351 - Update indigo to 1.28.0-rc.3 in browser module
  • Loading branch information
rrodionov91 authored Jan 24, 2025
1 parent b92d109 commit eca9147
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 28 deletions.
2 changes: 1 addition & 1 deletion example/public/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
width="784"
height="624"
id="iframe"
src="env_url"
src="index.html"
sandbox="allow-scripts allow-same-origin"
></iframe>
</div>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ketcher-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-core",
"version": "3.0.0-rc.3",
"version": "3.0.0-rc.4",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
2 changes: 1 addition & 1 deletion packages/ketcher-macromolecules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-macromolecules",
"version": "3.0.0-rc.3",
"version": "3.0.0-rc.4",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
10 changes: 6 additions & 4 deletions packages/ketcher-macromolecules/src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,13 @@ function Editor({
<Layout.Right hide={isMonomerLibraryHidden}>
<MonomerLibrary />
</Layout.Right>
<Layout.InsideRoot>
<MonomerLibraryToggle
isHidden={isMonomerLibraryHidden}
onClick={() => setIsMonomerLibraryHidden((prev) => !prev)}
/>
</Layout.InsideRoot>
</Layout>
<MonomerLibraryToggle
isHidden={isMonomerLibraryHidden}
onClick={() => setIsMonomerLibraryHidden((prev) => !prev)}
/>
<Preview />
<SequenceItemContextMenu selections={selections} />
<PolymerBondContextMenu />
Expand Down
30 changes: 20 additions & 10 deletions packages/ketcher-macromolecules/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,27 @@ interface LayoutProps {
children: JSX.Element | Array<JSX.Element>;
}

const Column = styled.div<{ fullWidth?: boolean }>(({ fullWidth }) => ({
width: fullWidth ? '100%' : 'fit-content',
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between',
}));
const Column = styled.div<{ fullWidth?: boolean; withPaddingRight?: boolean }>(
({ fullWidth, withPaddingRight }) => ({
width: fullWidth ? '100%' : 'fit-content',
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between',
paddingRight: withPaddingRight ? '12px' : 0,
}),
);

const RowMain = styled.div(({ theme }) => ({
height: '100vh',
height: '100%',
width: '100%',
position: 'relative',
padding: '12px',
paddingBottom: 0,
backgroundColor: theme.ketcher.color.background.canvas,
display: 'flex',
justifyContent: 'space-between',
columnGap: '12px',
containerType: 'size',
overflow: 'hidden',
}));

const Row = styled.div(({ theme }) => ({
Expand Down Expand Up @@ -84,18 +87,21 @@ const Main = styled.div({
position: 'relative',
});

const InsideRoot = styled.div({});

const DummyDiv = styled.div({
height: '40px',
});

type LayoutSection = 'Left' | 'Right' | 'Main' | 'Top';
type LayoutSection = 'Left' | 'Right' | 'Main' | 'Top' | 'InsideRoot';

export const Layout = ({ children }: LayoutProps) => {
const subcomponents: Record<LayoutSection, JSX.Element | null> = {
Left: null,
Main: null,
Right: null,
Top: null,
InsideRoot: null,
};
React.Children.forEach(children, (child) => {
if (child.type === Left) {
Expand All @@ -106,12 +112,14 @@ export const Layout = ({ children }: LayoutProps) => {
subcomponents.Top = child;
} else if (child.type === Main) {
subcomponents.Main = child;
} else if (child.type === InsideRoot) {
subcomponents.InsideRoot = child;
}
});

return (
<RowMain>
<Column fullWidth>
<Column fullWidth withPaddingRight>
{subcomponents.Top}
<Row>
{subcomponents.Left}
Expand All @@ -120,6 +128,7 @@ export const Layout = ({ children }: LayoutProps) => {
</Row>
</Column>
<Column>{subcomponents.Right}</Column>
{subcomponents.InsideRoot}
</RowMain>
);
};
Expand All @@ -128,3 +137,4 @@ Layout.Left = Left;
Layout.Top = Top;
Layout.Right = Right;
Layout.Main = Main;
Layout.InsideRoot = InsideRoot;
2 changes: 1 addition & 1 deletion packages/ketcher-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-react",
"version": "3.0.0-rc.3",
"version": "3.0.0-rc.4",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
4 changes: 2 additions & 2 deletions packages/ketcher-standalone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-standalone",
"version": "3.0.0-rc.3",
"version": "3.0.0-rc.4",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@babel/runtime": "^7.17.9",
"indigo-ketcher": "1.28.0-rc.2",
"indigo-ketcher": "1.28.0-rc.3",
"ketcher-core": "*"
},
"devDependencies": {
Expand Down

0 comments on commit eca9147

Please sign in to comment.