From 1bac90f12dd85de4287508b9ae3eda8a1ed523ff Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Thu, 22 Sep 2022 18:44:21 -0400 Subject: [PATCH] Adjust editor width dynamically --- .../netlify-cms-core/src/components/Editor/EditorInterface.js | 2 +- .../Editor/EditorPreviewPane/EditorPreviewContent.tsx | 2 +- packages/netlify-cms-lib-util/src/index.ts | 2 ++ packages/netlify-cms-ui-default/src/ListItemTopBar.js | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/netlify-cms-core/src/components/Editor/EditorInterface.js b/packages/netlify-cms-core/src/components/Editor/EditorInterface.js index 8c4c5720..a9e27c42 100644 --- a/packages/netlify-cms-core/src/components/Editor/EditorInterface.js +++ b/packages/netlify-cms-core/src/components/Editor/EditorInterface.js @@ -70,7 +70,7 @@ function ReactSplitPaneGlobalStyles() { const StyledSplitPane = styled.div` display: grid; - grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); + grid-template-columns: min(864px, 50%) auto;; height: 100%; > div:nth-child(2)::before { diff --git a/packages/netlify-cms-core/src/components/Editor/EditorPreviewPane/EditorPreviewContent.tsx b/packages/netlify-cms-core/src/components/Editor/EditorPreviewPane/EditorPreviewContent.tsx index ce7baeca..96927d9b 100644 --- a/packages/netlify-cms-core/src/components/Editor/EditorPreviewPane/EditorPreviewContent.tsx +++ b/packages/netlify-cms-core/src/components/Editor/EditorPreviewPane/EditorPreviewContent.tsx @@ -14,7 +14,7 @@ interface PreviewContentProps { } const StyledPreviewContent = styled.div` - width: calc(50% - 2px); + width: calc(100% - min(864px, 50%)); top: 66px; right: 0; position: absolute; diff --git a/packages/netlify-cms-lib-util/src/index.ts b/packages/netlify-cms-lib-util/src/index.ts index a5c5c101..2e18957f 100644 --- a/packages/netlify-cms-lib-util/src/index.ts +++ b/packages/netlify-cms-lib-util/src/index.ts @@ -55,6 +55,7 @@ import { parsePointerFile, getPointerFileForMediaFileObj, } from './git-lfs'; +import transientOptions from './transientOptions'; import type { PointerFile as PF } from './git-lfs'; import type { FetchError as FE, ApiRequest as AR } from './API'; @@ -207,4 +208,5 @@ export { allEntriesByFolder, AccessTokenError, throwOnConflictingBranches, + transientOptions, }; diff --git a/packages/netlify-cms-ui-default/src/ListItemTopBar.js b/packages/netlify-cms-ui-default/src/ListItemTopBar.js index 7e74e460..82658580 100644 --- a/packages/netlify-cms-ui-default/src/ListItemTopBar.js +++ b/packages/netlify-cms-ui-default/src/ListItemTopBar.js @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import PropTypes from 'prop-types'; import React from 'react'; -import transientOptions from 'netlify-cms-lib-util'; +import { transientOptions } from 'netlify-cms-lib-util'; import Icon from './Icon'; import { buttons, colors, lengths } from './styles';