decap-cms-core 3.14.0 → 3.16.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/decap-cms-core.js +19 -19
- package/dist/decap-cms-core.js.LICENSE.txt +0 -2
- package/dist/decap-cms-core.js.map +1 -1
- package/dist/esm/bootstrap.js +2 -2
- package/dist/esm/components/App/App.js +6 -6
- package/dist/esm/components/Collection/Collection.js +7 -7
- package/dist/esm/components/Collection/CollectionControls.js +1 -1
- package/dist/esm/components/Collection/CollectionTop.js +13 -9
- package/dist/esm/components/Collection/ControlButton.js +2 -2
- package/dist/esm/components/Collection/Entries/Entries.js +2 -2
- package/dist/esm/components/Collection/Sidebar.js +6 -6
- package/dist/esm/components/MediaLibrary/MediaLibraryButtons.js +48 -9
- package/dist/esm/components/MediaLibrary/MediaLibraryCard.js +7 -9
- package/dist/esm/components/MediaLibrary/MediaLibraryCardGrid.js +5 -5
- package/dist/esm/components/MediaLibrary/MediaLibraryHeader.js +15 -3
- package/dist/esm/components/MediaLibrary/MediaLibraryModal.js +4 -1
- package/dist/esm/components/MediaLibrary/MediaLibrarySearch.js +6 -6
- package/dist/esm/components/MediaLibrary/MediaLibraryTop.js +14 -24
- package/dist/esm/components/UI/ErrorBoundary.js +2 -2
- package/dist/esm/components/UI/Modal.js +11 -4
- package/dist/esm/components/Workflow/Workflow.js +5 -5
- package/dist/esm/components/Workflow/WorkflowCard.js +14 -14
- package/dist/esm/components/Workflow/WorkflowList.js +18 -42
- package/dist/esm/constants/configSchema.js +1 -2
- package/dist/esm/lib/urlHelper.js +3 -7
- package/dist/esm/reducers/entries.js +9 -7
- package/dist/esm/reducers/entryDraft.js +3 -4
- package/dist/esm/reducers/mediaLibrary.js +2 -3
- package/dist/esm/reducers/notifications.js +1 -2
- package/index.d.ts +2 -2
- package/package.json +7 -9
- package/src/actions/__tests__/editorialWorkflow.spec.js +1 -3
- package/src/components/App/App.js +0 -1
- package/src/components/Collection/Collection.js +10 -3
- package/src/components/Collection/CollectionControls.js +4 -3
- package/src/components/Collection/CollectionTop.js +10 -3
- package/src/components/Collection/ControlButton.js +1 -0
- package/src/components/Collection/Entries/Entries.js +1 -0
- package/src/components/Collection/Sidebar.js +8 -7
- package/src/components/Collection/__tests__/__snapshots__/Collection.spec.js.snap +76 -12
- package/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap +76 -16
- package/src/components/MediaLibrary/MediaLibraryButtons.js +39 -7
- package/src/components/MediaLibrary/MediaLibraryCard.js +1 -3
- package/src/components/MediaLibrary/MediaLibraryCardGrid.js +2 -2
- package/src/components/MediaLibrary/MediaLibraryHeader.js +32 -17
- package/src/components/MediaLibrary/MediaLibraryModal.js +8 -4
- package/src/components/MediaLibrary/MediaLibrarySearch.js +3 -1
- package/src/components/MediaLibrary/MediaLibraryTop.js +19 -1
- package/src/components/MediaLibrary/__tests__/__snapshots__/MediaLibraryCard.spec.js.snap +6 -6
- package/src/components/UI/Modal.js +10 -3
- package/src/components/Workflow/Workflow.js +7 -1
- package/src/components/Workflow/WorkflowCard.js +52 -14
- package/src/components/Workflow/WorkflowList.js +50 -31
- package/src/constants/configSchema.js +1 -2
- package/src/lib/urlHelper.ts +3 -4
- package/src/reducers/__tests__/entryDraft.spec.js +1 -1
- package/src/reducers/__tests__/mediaLibrary.spec.js +0 -1
- package/src/reducers/entries.ts +9 -7
- package/src/reducers/entryDraft.js +3 -4
- package/src/reducers/mediaLibrary.ts +2 -3
- package/src/reducers/notifications.ts +1 -2
- package/src/types/redux.ts +3 -3
- package/src/lib/textHelper.js +0 -11
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
5
|
import { isAbsolutePath } from 'decap-cms-lib-util';
|
|
6
|
-
import { buttons, shadows, zIndex } from 'decap-cms-ui-default';
|
|
6
|
+
import { buttons, Icon, shadows, zIndex } from 'decap-cms-ui-default';
|
|
7
7
|
|
|
8
8
|
import { FileUploadButton } from '../UI';
|
|
9
9
|
|
|
@@ -11,15 +11,25 @@ const styles = {
|
|
|
11
11
|
button: css`
|
|
12
12
|
${buttons.button};
|
|
13
13
|
${buttons.default};
|
|
14
|
-
display: inline-
|
|
15
|
-
|
|
16
|
-
margin-right: 2px;
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
17
16
|
|
|
18
17
|
&[disabled] {
|
|
19
18
|
${buttons.disabled};
|
|
20
19
|
cursor: default;
|
|
21
20
|
}
|
|
22
21
|
`,
|
|
22
|
+
// Hides an element without removing it from the accessibility tree.
|
|
23
|
+
visuallyHidden: css`
|
|
24
|
+
position: absolute;
|
|
25
|
+
width: 1px;
|
|
26
|
+
height: 1px;
|
|
27
|
+
padding: 0;
|
|
28
|
+
margin: -1px;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
clip: rect(0, 0, 0, 0);
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
`,
|
|
23
33
|
};
|
|
24
34
|
|
|
25
35
|
export const UploadButton = styled(FileUploadButton)`
|
|
@@ -68,7 +78,27 @@ const ActionButton = styled.button`
|
|
|
68
78
|
`}
|
|
69
79
|
`;
|
|
70
80
|
|
|
71
|
-
|
|
81
|
+
function ResponsiveActionButton({ children, icon, ...props }) {
|
|
82
|
+
return (
|
|
83
|
+
<ActionButton {...props}>
|
|
84
|
+
<Icon
|
|
85
|
+
type={icon}
|
|
86
|
+
size="small"
|
|
87
|
+
aria-hidden="true"
|
|
88
|
+
css={{ '@media (min-width: 600px)': styles.visuallyHidden }}
|
|
89
|
+
/>
|
|
90
|
+
<span css={{ '@media (max-width: 599px)': styles.visuallyHidden }}>{children}</span>
|
|
91
|
+
</ActionButton>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function DownloadButton({ children, ...props }) {
|
|
96
|
+
return (
|
|
97
|
+
<ResponsiveActionButton {...props} icon="download">
|
|
98
|
+
{children}
|
|
99
|
+
</ResponsiveActionButton>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
72
102
|
|
|
73
103
|
export class CopyToClipBoardButton extends React.Component {
|
|
74
104
|
mounted = false;
|
|
@@ -115,13 +145,15 @@ export class CopyToClipBoardButton extends React.Component {
|
|
|
115
145
|
return t('mediaLibrary.mediaLibraryCard.copyPath');
|
|
116
146
|
};
|
|
117
147
|
|
|
148
|
+
getIcon = () => (this.state.copied ? 'check' : 'copy');
|
|
149
|
+
|
|
118
150
|
render() {
|
|
119
151
|
const { disabled } = this.props;
|
|
120
152
|
|
|
121
153
|
return (
|
|
122
|
-
<
|
|
154
|
+
<ResponsiveActionButton disabled={disabled} onClick={this.handleCopy} icon={this.getIcon()}>
|
|
123
155
|
{this.getTitle()}
|
|
124
|
-
</
|
|
156
|
+
</ResponsiveActionButton>
|
|
125
157
|
);
|
|
126
158
|
}
|
|
127
159
|
}
|
|
@@ -70,7 +70,6 @@ class MediaLibraryCard extends React.Component {
|
|
|
70
70
|
text,
|
|
71
71
|
onClick,
|
|
72
72
|
draftText,
|
|
73
|
-
width,
|
|
74
73
|
height,
|
|
75
74
|
margin,
|
|
76
75
|
isPrivate,
|
|
@@ -83,7 +82,7 @@ class MediaLibraryCard extends React.Component {
|
|
|
83
82
|
<Card
|
|
84
83
|
isSelected={isSelected}
|
|
85
84
|
onClick={onClick}
|
|
86
|
-
width=
|
|
85
|
+
width="100%"
|
|
87
86
|
height={height}
|
|
88
87
|
margin={margin}
|
|
89
88
|
tabIndex="-1"
|
|
@@ -115,7 +114,6 @@ MediaLibraryCard.propTypes = {
|
|
|
115
114
|
text: PropTypes.string.isRequired,
|
|
116
115
|
onClick: PropTypes.func.isRequired,
|
|
117
116
|
draftText: PropTypes.string.isRequired,
|
|
118
|
-
width: PropTypes.string.isRequired,
|
|
119
117
|
height: PropTypes.string.isRequired,
|
|
120
118
|
margin: PropTypes.string.isRequired,
|
|
121
119
|
isPrivate: PropTypes.bool,
|
|
@@ -75,9 +75,9 @@ function VirtualizedGrid(props) {
|
|
|
75
75
|
const cardWidth = parseInt(props.cardWidth, 10);
|
|
76
76
|
const cardHeight = parseInt(props.cardHeight, 10);
|
|
77
77
|
const gutter = parseInt(props.cardMargin, 10);
|
|
78
|
-
const columnWidth = cardWidth + gutter;
|
|
78
|
+
const columnWidth = Math.min(width, cardWidth + gutter);
|
|
79
79
|
const rowHeight = cardHeight + gutter;
|
|
80
|
-
const columnCount = Math.floor(width / columnWidth);
|
|
80
|
+
const columnCount = Math.max(1, Math.floor(width / columnWidth));
|
|
81
81
|
const rowCount = Math.ceil(mediaItems.length / columnCount);
|
|
82
82
|
return (
|
|
83
83
|
<Grid
|
|
@@ -3,39 +3,54 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { Icon, shadows, colors, buttons } from 'decap-cms-ui-default';
|
|
5
5
|
|
|
6
|
+
const HeaderContainer = styled.div`
|
|
7
|
+
@media (max-width: 499px) {
|
|
8
|
+
width: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
flex-direction: row-reverse;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
|
|
6
15
|
const CloseButton = styled.button`
|
|
7
16
|
${buttons.button};
|
|
8
|
-
${shadows.dropMiddle};
|
|
9
|
-
position: absolute;
|
|
10
|
-
margin-right: -40px;
|
|
11
|
-
left: -40px;
|
|
12
|
-
top: -40px;
|
|
13
|
-
width: 40px;
|
|
14
|
-
height: 40px;
|
|
15
|
-
border-radius: 50%;
|
|
16
17
|
background-color: white;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
@media (min-width: 500px) {
|
|
19
|
+
${shadows.dropMiddle};
|
|
20
|
+
position: absolute;
|
|
21
|
+
margin-right: -40px;
|
|
22
|
+
left: -40px;
|
|
23
|
+
top: -40px;
|
|
24
|
+
width: 40px;
|
|
25
|
+
height: 40px;
|
|
26
|
+
border-radius: 50%;
|
|
27
|
+
padding: 0;
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
21
32
|
`;
|
|
22
33
|
|
|
23
34
|
const LibraryTitle = styled.h1`
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
font-size: 18px;
|
|
36
|
+
line-height: 28px;
|
|
26
37
|
text-align: left;
|
|
27
|
-
|
|
38
|
+
@media (min-width: 500px) {
|
|
39
|
+
font-size: 22px;
|
|
40
|
+
line-height: 36px;
|
|
41
|
+
}
|
|
42
|
+
margin-bottom: 0;
|
|
28
43
|
color: ${props => props.isPrivate && colors.textFieldBorder};
|
|
29
44
|
`;
|
|
30
45
|
|
|
31
46
|
function MediaLibraryHeader({ onClose, title, isPrivate, t }) {
|
|
32
47
|
return (
|
|
33
|
-
<
|
|
48
|
+
<HeaderContainer>
|
|
34
49
|
<CloseButton aria-label={t('mediaLibrary.mediaLibraryModal.close')} onClick={onClose}>
|
|
35
50
|
<Icon type="close" />
|
|
36
51
|
</CloseButton>
|
|
37
52
|
<LibraryTitle isPrivate={isPrivate}>{title}</LibraryTitle>
|
|
38
|
-
</
|
|
53
|
+
</HeaderContainer>
|
|
39
54
|
);
|
|
40
55
|
}
|
|
41
56
|
|
|
@@ -25,14 +25,18 @@ const cardMargin = `10px`;
|
|
|
25
25
|
*/
|
|
26
26
|
const cardOutsideWidth = `300px`;
|
|
27
27
|
|
|
28
|
+
/** Calculated to be as wide as possible without cutting off the 40px-wide close button. */
|
|
29
|
+
const minimumCardWidth = `calc(100% - 40px)`;
|
|
30
|
+
|
|
28
31
|
const StyledModal = styled(Modal)`
|
|
29
32
|
display: grid;
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
width: 100%;
|
|
34
|
+
grid-template-rows: auto 1fr;
|
|
35
|
+
gap: 20px;
|
|
32
36
|
background-color: ${props => props.isPrivate && colors.grayDark};
|
|
33
37
|
|
|
34
|
-
@media (min-width:
|
|
35
|
-
width: calc(${cardOutsideWidth} * 2 + 20px);
|
|
38
|
+
@media (min-width: 500px) {
|
|
39
|
+
width: min(${minimumCardWidth}, calc(${cardOutsideWidth} * 2 + 20px));
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
@media (min-width: 1120px) {
|
|
@@ -8,7 +8,8 @@ const SearchContainer = styled.div`
|
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
position: relative;
|
|
11
|
-
|
|
11
|
+
flex: 1 1 150px;
|
|
12
|
+
max-width: 460px;
|
|
12
13
|
`;
|
|
13
14
|
|
|
14
15
|
const SearchInput = styled.input`
|
|
@@ -33,6 +34,7 @@ const SearchIcon = styled(Icon)`
|
|
|
33
34
|
left: 6px;
|
|
34
35
|
z-index: ${zIndex.zIndex2};
|
|
35
36
|
transform: translate(0, -50%);
|
|
37
|
+
pointer-events: none;
|
|
36
38
|
`;
|
|
37
39
|
|
|
38
40
|
function MediaLibrarySearch({ value, onChange, onKeyDown, placeholder, disabled }) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
3
4
|
import styled from '@emotion/styled';
|
|
4
5
|
|
|
5
6
|
import MediaLibrarySearch from './MediaLibrarySearch';
|
|
@@ -12,19 +13,36 @@ import {
|
|
|
12
13
|
InsertButton,
|
|
13
14
|
} from './MediaLibraryButtons';
|
|
14
15
|
|
|
16
|
+
const styles = {
|
|
17
|
+
flexSpacing: css`
|
|
18
|
+
gap: 8px;
|
|
19
|
+
@media (min-width: 500px) {
|
|
20
|
+
gap: 15px;
|
|
21
|
+
}
|
|
22
|
+
`,
|
|
23
|
+
};
|
|
24
|
+
|
|
15
25
|
const LibraryTop = styled.div`
|
|
16
26
|
position: relative;
|
|
17
27
|
display: flex;
|
|
18
28
|
flex-direction: column;
|
|
29
|
+
${styles.flexSpacing};
|
|
19
30
|
`;
|
|
20
31
|
|
|
21
32
|
const RowContainer = styled.div`
|
|
22
33
|
display: flex;
|
|
34
|
+
align-items: center;
|
|
23
35
|
justify-content: space-between;
|
|
36
|
+
flex-wrap: wrap;
|
|
37
|
+
${styles.flexSpacing};
|
|
24
38
|
`;
|
|
25
39
|
|
|
26
40
|
const ButtonsContainer = styled.div`
|
|
27
|
-
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: stretch;
|
|
44
|
+
flex-wrap: wrap;
|
|
45
|
+
${styles.flexSpacing};
|
|
28
46
|
`;
|
|
29
47
|
|
|
30
48
|
function MediaLibraryTop({
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`MediaLibraryCard should match snapshot for draft image 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
.emotion-0 {
|
|
6
|
-
width:
|
|
6
|
+
width: 100%;
|
|
7
7
|
height: 240px;
|
|
8
8
|
margin: 10px;
|
|
9
9
|
border: solid 2px #dfdfe3;
|
|
@@ -70,7 +70,7 @@ exports[`MediaLibraryCard should match snapshot for draft image 1`] = `
|
|
|
70
70
|
class="emotion-0 emotion-1"
|
|
71
71
|
height="240px"
|
|
72
72
|
tabindex="-1"
|
|
73
|
-
width="
|
|
73
|
+
width="100%"
|
|
74
74
|
>
|
|
75
75
|
<div
|
|
76
76
|
class="emotion-2 emotion-3"
|
|
@@ -99,7 +99,7 @@ exports[`MediaLibraryCard should match snapshot for draft image 1`] = `
|
|
|
99
99
|
exports[`MediaLibraryCard should match snapshot for non draft image 1`] = `
|
|
100
100
|
<DocumentFragment>
|
|
101
101
|
.emotion-0 {
|
|
102
|
-
width:
|
|
102
|
+
width: 100%;
|
|
103
103
|
height: 240px;
|
|
104
104
|
margin: 10px;
|
|
105
105
|
border: solid 2px #dfdfe3;
|
|
@@ -158,7 +158,7 @@ exports[`MediaLibraryCard should match snapshot for non draft image 1`] = `
|
|
|
158
158
|
class="emotion-0 emotion-1"
|
|
159
159
|
height="240px"
|
|
160
160
|
tabindex="-1"
|
|
161
|
-
width="
|
|
161
|
+
width="100%"
|
|
162
162
|
>
|
|
163
163
|
<div
|
|
164
164
|
class="emotion-2 emotion-3"
|
|
@@ -181,7 +181,7 @@ exports[`MediaLibraryCard should match snapshot for non draft image 1`] = `
|
|
|
181
181
|
exports[`MediaLibraryCard should match snapshot for non viewable image 1`] = `
|
|
182
182
|
<DocumentFragment>
|
|
183
183
|
.emotion-0 {
|
|
184
|
-
width:
|
|
184
|
+
width: 100%;
|
|
185
185
|
height: 240px;
|
|
186
186
|
margin: 10px;
|
|
187
187
|
border: solid 2px #dfdfe3;
|
|
@@ -242,7 +242,7 @@ exports[`MediaLibraryCard should match snapshot for non viewable image 1`] = `
|
|
|
242
242
|
class="emotion-0 emotion-1"
|
|
243
243
|
height="240px"
|
|
244
244
|
tabindex="-1"
|
|
245
|
-
width="
|
|
245
|
+
width="100%"
|
|
246
246
|
>
|
|
247
247
|
<div
|
|
248
248
|
class="emotion-2 emotion-3"
|
|
@@ -20,8 +20,12 @@ const styleStrings = {
|
|
|
20
20
|
modalBody: `
|
|
21
21
|
${shadows.dropDeep};
|
|
22
22
|
background-color: #fff;
|
|
23
|
-
border-radius: ${lengths.borderRadius};
|
|
24
|
-
height:
|
|
23
|
+
border-radius: ${lengths.borderRadius} ${lengths.borderRadius} 0 0;
|
|
24
|
+
height: 90%;
|
|
25
|
+
@media (min-width: 500px) {
|
|
26
|
+
border-radius: ${lengths.borderRadius};
|
|
27
|
+
height: 80%;
|
|
28
|
+
}
|
|
25
29
|
text-align: center;
|
|
26
30
|
max-width: 2200px;
|
|
27
31
|
padding: 20px;
|
|
@@ -39,7 +43,10 @@ const styleStrings = {
|
|
|
39
43
|
bottom: 0;
|
|
40
44
|
display: flex;
|
|
41
45
|
justify-content: center;
|
|
42
|
-
align-items:
|
|
46
|
+
align-items: flex-end;
|
|
47
|
+
@media (min-width: 500px) {
|
|
48
|
+
align-items: center;
|
|
49
|
+
}
|
|
43
50
|
opacity: 0;
|
|
44
51
|
background-color: rgba(0, 0, 0, 0);
|
|
45
52
|
transition: background-color ${transitions.main}, opacity ${transitions.main};
|
|
@@ -27,8 +27,11 @@ import { EDITORIAL_WORKFLOW, status } from '../../constants/publishModes';
|
|
|
27
27
|
import WorkflowList from './WorkflowList';
|
|
28
28
|
|
|
29
29
|
const WorkflowContainer = styled.div`
|
|
30
|
-
padding: ${lengths.pageMargin} 0;
|
|
31
30
|
height: 100vh;
|
|
31
|
+
margin: ${lengths.pageMarginMobile};
|
|
32
|
+
@media (min-width: 500px) {
|
|
33
|
+
margin: ${lengths.pageMargin};
|
|
34
|
+
}
|
|
32
35
|
`;
|
|
33
36
|
|
|
34
37
|
const WorkflowTop = styled.div`
|
|
@@ -37,6 +40,9 @@ const WorkflowTop = styled.div`
|
|
|
37
40
|
|
|
38
41
|
const WorkflowTopRow = styled.div`
|
|
39
42
|
display: flex;
|
|
43
|
+
flex-wrap: wrap;
|
|
44
|
+
gap: 8px;
|
|
45
|
+
align-items: center;
|
|
40
46
|
justify-content: space-between;
|
|
41
47
|
|
|
42
48
|
span[role='button'] {
|
|
@@ -17,30 +17,46 @@ const styles = {
|
|
|
17
17
|
width: auto;
|
|
18
18
|
flex: 1 0 0;
|
|
19
19
|
font-size: 13px;
|
|
20
|
-
padding: 6px
|
|
20
|
+
padding: 6px;
|
|
21
21
|
`,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const WorkflowLink = styled(Link)`
|
|
25
25
|
display: block;
|
|
26
|
-
padding:
|
|
27
|
-
height:
|
|
26
|
+
padding: 8px;
|
|
27
|
+
height: 140px;
|
|
28
28
|
overflow: hidden;
|
|
29
|
+
|
|
30
|
+
@media (min-width: 800px) {
|
|
31
|
+
height: 200px;
|
|
32
|
+
padding: 12px 18px 18px;
|
|
33
|
+
}
|
|
29
34
|
`;
|
|
30
35
|
|
|
31
36
|
const CardCollection = styled.div`
|
|
32
|
-
font-size:
|
|
37
|
+
font-size: 12px;
|
|
33
38
|
color: ${colors.textLead};
|
|
34
39
|
text-transform: uppercase;
|
|
35
|
-
margin-top: 12px;
|
|
36
40
|
text-overflow: ellipsis;
|
|
37
41
|
overflow: hidden;
|
|
38
42
|
white-space: nowrap;
|
|
43
|
+
@media (min-width: 800px) {
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
}
|
|
39
46
|
`;
|
|
40
47
|
|
|
41
48
|
const CardTitle = styled.h2`
|
|
42
|
-
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
line-height: 17px;
|
|
51
|
+
margin: 10px 0 0;
|
|
43
52
|
color: ${colors.textLead};
|
|
53
|
+
word-break: break-word;
|
|
54
|
+
|
|
55
|
+
@media (min-width: 800px) {
|
|
56
|
+
font-size: 15px;
|
|
57
|
+
line-height: 18px;
|
|
58
|
+
margin-top: 28px;
|
|
59
|
+
}
|
|
44
60
|
`;
|
|
45
61
|
|
|
46
62
|
const CardDateContainer = styled.div`
|
|
@@ -49,11 +65,16 @@ const CardDateContainer = styled.div`
|
|
|
49
65
|
|
|
50
66
|
const CardBody = styled.p`
|
|
51
67
|
${styles.text};
|
|
68
|
+
line-height: 17px;
|
|
52
69
|
color: ${colors.text};
|
|
53
|
-
margin:
|
|
70
|
+
margin: 10px 0 0;
|
|
54
71
|
overflow-wrap: break-word;
|
|
55
72
|
word-break: break-word;
|
|
56
73
|
hyphens: auto;
|
|
74
|
+
|
|
75
|
+
@media (min-width: 800px) {
|
|
76
|
+
margin-top: 24px;
|
|
77
|
+
}
|
|
57
78
|
`;
|
|
58
79
|
|
|
59
80
|
const CardButtonContainer = styled.div`
|
|
@@ -61,25 +82,38 @@ const CardButtonContainer = styled.div`
|
|
|
61
82
|
position: absolute;
|
|
62
83
|
bottom: 0;
|
|
63
84
|
width: 100%;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
85
|
+
display: none;
|
|
86
|
+
padding: 8px;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: 6px;
|
|
67
89
|
transition: opacity ${transitions.main};
|
|
68
90
|
cursor: pointer;
|
|
91
|
+
|
|
92
|
+
@media (min-width: 500px) {
|
|
93
|
+
display: flex;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media (min-width: 800px) {
|
|
97
|
+
padding: 12px 18px;
|
|
98
|
+
flex-direction: row;
|
|
99
|
+
gap: 12px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (hover: hover) {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
}
|
|
69
105
|
`;
|
|
70
106
|
|
|
71
107
|
const DeleteButton = styled.button`
|
|
72
108
|
${styles.button};
|
|
73
109
|
background-color: ${colorsRaw.redLight};
|
|
74
110
|
color: ${colorsRaw.red};
|
|
75
|
-
margin-right: 6px;
|
|
76
111
|
`;
|
|
77
112
|
|
|
78
113
|
const PublishButton = styled.button`
|
|
79
114
|
${styles.button};
|
|
80
115
|
background-color: ${colorsRaw.teal};
|
|
81
116
|
color: ${colors.textLight};
|
|
82
|
-
margin-left: 6px;
|
|
83
117
|
|
|
84
118
|
&[disabled] {
|
|
85
119
|
${buttons.disabled};
|
|
@@ -88,13 +122,17 @@ const PublishButton = styled.button`
|
|
|
88
122
|
|
|
89
123
|
const WorkflowCardContainer = styled.div`
|
|
90
124
|
${components.card};
|
|
91
|
-
margin-bottom:
|
|
125
|
+
margin-bottom: 10px;
|
|
92
126
|
position: relative;
|
|
93
127
|
overflow: hidden;
|
|
94
128
|
|
|
95
|
-
&:hover ${CardButtonContainer} {
|
|
129
|
+
&:hover ${CardButtonContainer}, &:has(:focus-visible) ${CardButtonContainer} {
|
|
96
130
|
opacity: 1;
|
|
97
131
|
}
|
|
132
|
+
|
|
133
|
+
@media (min-width: 800px) {
|
|
134
|
+
margin-bottom: 24px;
|
|
135
|
+
}
|
|
98
136
|
`;
|
|
99
137
|
|
|
100
138
|
function lastChangePhraseKey(date, author) {
|
|
@@ -15,47 +15,57 @@ import { selectEntryCollectionTitle } from '../../reducers/collections';
|
|
|
15
15
|
const WorkflowListContainer = styled.div`
|
|
16
16
|
min-height: 60%;
|
|
17
17
|
display: grid;
|
|
18
|
-
grid-template-columns:
|
|
18
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
19
|
+
gap: 8px;
|
|
20
|
+
@media (min-width: 500px) {
|
|
21
|
+
gap: 14px;
|
|
22
|
+
}
|
|
23
|
+
@media (min-width: 800px) {
|
|
24
|
+
gap: 40px;
|
|
25
|
+
}
|
|
19
26
|
`;
|
|
20
27
|
|
|
21
28
|
const WorkflowListContainerOpenAuthoring = styled.div`
|
|
22
29
|
min-height: 60%;
|
|
23
30
|
display: grid;
|
|
24
|
-
grid-template-columns:
|
|
31
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
32
|
+
gap: 8px;
|
|
33
|
+
@media (min-width: 500px) {
|
|
34
|
+
gap: 14px;
|
|
35
|
+
}
|
|
36
|
+
@media (min-width: 800px) {
|
|
37
|
+
gap: 40px;
|
|
38
|
+
}
|
|
25
39
|
`;
|
|
26
40
|
|
|
27
41
|
const styles = {
|
|
28
42
|
columnPosition: idx =>
|
|
29
|
-
|
|
30
|
-
css`
|
|
31
|
-
margin-left: 0;
|
|
32
|
-
`) ||
|
|
33
|
-
(idx === 2 &&
|
|
34
|
-
css`
|
|
35
|
-
margin-right: 0;
|
|
36
|
-
`) ||
|
|
43
|
+
idx > 0 &&
|
|
37
44
|
css`
|
|
38
|
-
&:before
|
|
39
|
-
&:after {
|
|
45
|
+
&:before {
|
|
40
46
|
content: '';
|
|
41
47
|
display: block;
|
|
42
48
|
position: absolute;
|
|
43
49
|
width: 2px;
|
|
44
50
|
height: 80%;
|
|
45
|
-
top:
|
|
51
|
+
top: 36px;
|
|
46
52
|
background-color: ${colors.textFieldBorder};
|
|
53
|
+
@media (min-width: 800px) {
|
|
54
|
+
top: 76px;
|
|
55
|
+
}
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
&:before {
|
|
50
|
-
left: -
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
left: -7px;
|
|
60
|
+
@media (min-width: 500px) {
|
|
61
|
+
left: -10px;
|
|
62
|
+
}
|
|
63
|
+
@media (min-width: 800px) {
|
|
64
|
+
left: -23px;
|
|
65
|
+
}
|
|
55
66
|
}
|
|
56
67
|
`,
|
|
57
68
|
column: css`
|
|
58
|
-
margin: 0 20px;
|
|
59
69
|
transition: background-color 0.5s ease;
|
|
60
70
|
border: 2px dashed transparent;
|
|
61
71
|
border-radius: 4px;
|
|
@@ -68,21 +78,21 @@ const styles = {
|
|
|
68
78
|
hiddenColumn: css`
|
|
69
79
|
display: none;
|
|
70
80
|
`,
|
|
71
|
-
hiddenRightBorder: css`
|
|
72
|
-
&:not(:first-child):not(:last-child) {
|
|
73
|
-
&:after {
|
|
74
|
-
display: none;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
`,
|
|
78
81
|
};
|
|
79
82
|
|
|
80
83
|
const ColumnHeader = styled.h2`
|
|
81
|
-
font-size:
|
|
84
|
+
font-size: 16px;
|
|
82
85
|
font-weight: normal;
|
|
83
|
-
padding:
|
|
86
|
+
padding: 2px 6px;
|
|
84
87
|
border-radius: ${lengths.borderRadius};
|
|
85
|
-
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
margin-bottom: 6px;
|
|
90
|
+
|
|
91
|
+
@media (min-width: 800px) {
|
|
92
|
+
font-size: 20px;
|
|
93
|
+
padding: 4px 12px;
|
|
94
|
+
margin-bottom: 28px;
|
|
95
|
+
}
|
|
86
96
|
|
|
87
97
|
${props =>
|
|
88
98
|
props.name === 'draft' &&
|
|
@@ -107,11 +117,21 @@ const ColumnHeader = styled.h2`
|
|
|
107
117
|
`;
|
|
108
118
|
|
|
109
119
|
const ColumnCount = styled.p`
|
|
110
|
-
font-size:
|
|
120
|
+
font-size: 11px;
|
|
111
121
|
font-weight: 500;
|
|
112
122
|
color: ${colors.text};
|
|
113
123
|
text-transform: uppercase;
|
|
114
124
|
margin-bottom: 6px;
|
|
125
|
+
padding-inline: 6px;
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
text-overflow: ellipsis;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
min-width: 0;
|
|
130
|
+
|
|
131
|
+
@media (min-width: 800px) {
|
|
132
|
+
font-size: 13px;
|
|
133
|
+
padding-inline: 12px;
|
|
134
|
+
}
|
|
115
135
|
`;
|
|
116
136
|
|
|
117
137
|
// This is a namespace so that we can only drop these elements on a DropTarget with the same
|
|
@@ -188,7 +208,6 @@ class WorkflowList extends React.Component {
|
|
|
188
208
|
styles.columnPosition(idx),
|
|
189
209
|
isHovered && styles.columnHovered,
|
|
190
210
|
isOpenAuthoring && currColumn === 'pending_publish' && styles.hiddenColumn,
|
|
191
|
-
isOpenAuthoring && currColumn === 'pending_review' && styles.hiddenRightBorder,
|
|
192
211
|
]}
|
|
193
212
|
>
|
|
194
213
|
<ColumnHeader name={currColumn}>
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
prohibited,
|
|
7
7
|
} from 'ajv-keywords/dist/keywords';
|
|
8
8
|
import ajvErrors from 'ajv-errors';
|
|
9
|
-
import { v4 as uuid } from 'uuid';
|
|
10
9
|
|
|
11
10
|
import { frontmatterFormats, extensionFormatters } from '../formats/formats';
|
|
12
11
|
import { getWidgets } from '../lib/registry';
|
|
@@ -45,7 +44,7 @@ const i18nField = {
|
|
|
45
44
|
* Config for fields in both file and folder collections.
|
|
46
45
|
*/
|
|
47
46
|
function fieldsConfig() {
|
|
48
|
-
const id =
|
|
47
|
+
const id = crypto.randomUUID();
|
|
49
48
|
return {
|
|
50
49
|
$id: `fields_${id}`,
|
|
51
50
|
type: 'array',
|
package/src/lib/urlHelper.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import url from 'url';
|
|
2
1
|
import urlJoin from 'url-join';
|
|
3
2
|
import diacritics from 'diacritics';
|
|
4
3
|
import sanitizeFilename from 'sanitize-filename';
|
|
@@ -22,9 +21,9 @@ export function getNewEntryUrl(collectionName: string, direct?: boolean) {
|
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
export function addParams(urlString: string, params: Record<string, string>) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
return url.
|
|
24
|
+
const url = new URL(urlString);
|
|
25
|
+
Object.keys(params).forEach(key => url.searchParams.set(key, params[key]));
|
|
26
|
+
return url.toString();
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
export function stripProtocol(urlString: string) {
|