UI Tweaks and bug fixes
This commit is contained in:
3
packages/netlify-cms-core/index.d.ts
vendored
3
packages/netlify-cms-core/index.d.ts
vendored
@ -281,6 +281,9 @@ declare module 'netlify-cms-core' {
|
||||
i18n?: boolean | CmsI18nConfig;
|
||||
media_folder?: string;
|
||||
public_folder?: string;
|
||||
editor?: {
|
||||
preview?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ViewFilter {
|
||||
|
@ -76,7 +76,7 @@
|
||||
"yaml": "^1.8.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@emotion/core": "11.0.0",
|
||||
"@emotion/react": "11.10.4",
|
||||
"@emotion/styled": "11.10.4",
|
||||
"immutable": "^3.7.6",
|
||||
"lodash": "^4.17.11",
|
||||
|
@ -37,8 +37,9 @@ TopBarProgress.config({
|
||||
const AppRoot = styled.div`
|
||||
width: 100%;
|
||||
min-width: 1200px;
|
||||
min-height: 100vh;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
`;
|
||||
|
||||
const AppWrapper = styled.div`
|
||||
|
@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import styled from '@emotion/styled';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { buttons, StyledDropdownButton, colors } from 'netlify-cms-ui-default';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { List } from 'immutable';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { connect } from 'react-redux';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import styled from '@emotion/styled';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { Icon, components, colors } from 'netlify-cms-ui-default';
|
||||
|
@ -3,7 +3,7 @@ import { bindActionCreators } from 'redux';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { ClassNames, Global, css as coreCss } from '@emotion/core';
|
||||
import { ClassNames, Global, css as coreCss } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { partial, uniqueId } from 'lodash';
|
||||
import { connect } from 'react-redux';
|
||||
@ -77,10 +77,6 @@ const styleStrings = {
|
||||
|
||||
const ControlContainer = styled.div`
|
||||
margin-top: 16px;
|
||||
|
||||
&:first-of-type {
|
||||
margin-top: 36px;
|
||||
}
|
||||
`;
|
||||
|
||||
const ControlErrorsList = styled.ul`
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import {
|
||||
buttons,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { css, Global } from '@emotion/core';
|
||||
import { css, Global } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import {
|
||||
colors,
|
||||
@ -118,9 +118,9 @@ const ControlPaneContainer = styled(PreviewPaneContainer)`
|
||||
`;
|
||||
|
||||
const ViewControls = styled.div`
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 28px;
|
||||
position: fixed;
|
||||
bottom: 3px;
|
||||
right: 12px;
|
||||
z-index: ${zIndex.zIndex299};
|
||||
`;
|
||||
|
||||
|
@ -44,6 +44,7 @@ const PreviewContent = ({ previewComponent, previewProps }: PreviewContentProps)
|
||||
<StyledPreviewContent className="preview-content">{children}</StyledPreviewContent>
|
||||
</ScrollSyncPane>,
|
||||
element,
|
||||
'preview-content'
|
||||
);
|
||||
}, [previewComponent, previewProps, element]);
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import copyToClipboard from 'copy-text-to-clipboard';
|
||||
import { isAbsolutePath } from 'netlify-cms-lib-util';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { css, Global, ClassNames } from '@emotion/core';
|
||||
import { css, Global, ClassNames } from '@emotion/react';
|
||||
import ReactModal from 'react-modal';
|
||||
import { transitions, shadows, lengths, zIndex } from 'netlify-cms-ui-default';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { Icon, Dropdown, DropdownItem, DropdownButton, colors } from 'netlify-cms-ui-default';
|
||||
|
@ -1,7 +1,7 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { css, Global } from '@emotion/core';
|
||||
import { css, Global } from '@emotion/react';
|
||||
import { translate } from 'react-polyglot';
|
||||
import reduxNotificationsStyles from 'redux-notifications/lib/styles.css';
|
||||
import { shadows, colors, lengths, zIndex } from 'netlify-cms-ui-default';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { translate } from 'react-polyglot';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { css } from '@emotion/core';
|
||||
import { css } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import moment from 'moment';
|
||||
import { translate } from 'react-polyglot';
|
||||
|
@ -210,6 +210,12 @@ function getConfigSchema() {
|
||||
file: { type: 'string' },
|
||||
preview_path: { type: 'string' },
|
||||
preview_path_date_field: { type: 'string' },
|
||||
editor: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
preview: { type: 'boolean' },
|
||||
},
|
||||
},
|
||||
fields: fieldsConfig(),
|
||||
},
|
||||
required: ['name', 'label', 'file', 'fields'],
|
||||
|
@ -114,10 +114,13 @@ function entryDraftReducer(state = Map(), action) {
|
||||
state.mergeDeepIn(['fieldsMetaData'], fromJS(metadata));
|
||||
const newData = state.getIn(['entry', ...dataPath]);
|
||||
const newMeta = state.getIn(['entry', 'meta']);
|
||||
if (entries.length === 0) {
|
||||
return;
|
||||
}
|
||||
state.set(
|
||||
'hasChanged',
|
||||
!entries.some(e => newData.equals(e.get(...dataPath))) ||
|
||||
!entries.some(e => newMeta.equals(e.get('meta'))),
|
||||
!newData.equals(entries[0].get(...dataPath)) ||
|
||||
!newMeta.equals(entries[0].get('meta')),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user