@plone-collective/volto-image-editor 1.0.1 → 1.1.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/.changelog.draft +2 -7
- package/CHANGELOG.md +6 -0
- package/package.json +3 -3
- package/src/components/ImageEditor/Editor/ImageEditor.scss +18 -1
- package/src/components/ImageEditor/Wrapper/ImageEditorWrapper.scss +6 -4
- package/src/components/ImageEditor/Wrapper/ImageEditorWrapper.tsx +1 -1
- package/src/components/ImageEditor/components/Navigation/Navigation.scss +1 -0
- package/src/components/ImageEditor/components/SettingsModal/SettingsModal.scss +8 -5
- package/src/components/ImageEditor/components/SettingsModal/SettingsModal.tsx +7 -1
- package/src/components/Widgets/FileWidget.tsx +2 -5
- package/src/icons/svg/back.svg +3 -0
- package/src/theme/variables.scss +1 -1
package/.changelog.draft
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
## 1.0
|
|
2
|
-
|
|
3
|
-
### Feature
|
|
4
|
-
|
|
5
|
-
- Added support for lazyload the widget. @sneridagh
|
|
1
|
+
## 1.1.0 (2026-10-07)
|
|
6
2
|
|
|
7
3
|
### Internal
|
|
8
4
|
|
|
9
|
-
-
|
|
10
|
-
- Use Volto 19a27. @sneridagh
|
|
5
|
+
- Updated according to the figma-design and improved styles for usage with the distributions @TimoBroeskamp
|
|
11
6
|
|
|
12
7
|
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plone-collective/volto-image-editor",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "An image editor to be used with Plone and Volto.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"react": "18.2.0",
|
|
42
42
|
"react-aria-components": "*",
|
|
43
43
|
"react-dom": "18.2.0",
|
|
44
|
-
"@plone/
|
|
45
|
-
"@plone/
|
|
44
|
+
"@plone/registry": "3.0.0-alpha.9",
|
|
45
|
+
"@plone/types": "2.0.0-alpha.14"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^20.2.5",
|
|
@@ -2,9 +2,26 @@
|
|
|
2
2
|
@import '../../../theme/variables';
|
|
3
3
|
@import '../../../theme/constants';
|
|
4
4
|
|
|
5
|
+
.image-widget .image-widget-cropper {
|
|
6
|
+
button {
|
|
7
|
+
padding: 20px 0px;
|
|
8
|
+
border: none;
|
|
9
|
+
color: rgba(0, 0, 0, 0.9);
|
|
10
|
+
text-decoration: underline;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ui.grid.image-widget-grid .file-widget-dropzone img {
|
|
15
|
+
margin-top: 0px;
|
|
16
|
+
}
|
|
17
|
+
|
|
5
18
|
.image-editor {
|
|
19
|
+
display: grid;
|
|
6
20
|
width: 100%;
|
|
21
|
+
height: 100%;
|
|
7
22
|
color: $settings-header-color;
|
|
23
|
+
grid-template-columns: 100%;
|
|
24
|
+
grid-template-rows: 1fr 80px;
|
|
8
25
|
|
|
9
26
|
&__preview {
|
|
10
27
|
position: absolute;
|
|
@@ -19,7 +36,7 @@
|
|
|
19
36
|
|
|
20
37
|
&__cropper {
|
|
21
38
|
position: relative;
|
|
22
|
-
height:
|
|
39
|
+
height: 100%;
|
|
23
40
|
max-height: 100vh;
|
|
24
41
|
background: $color-gray-dark;
|
|
25
42
|
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
@import '../../../theme/variables';
|
|
2
2
|
|
|
3
3
|
.react-aria-ModalOverlay {
|
|
4
|
+
z-index: 150;
|
|
4
5
|
.react-aria-Modal.image-cropper-modal {
|
|
5
|
-
width:
|
|
6
|
-
max-width:
|
|
6
|
+
width: 70vw;
|
|
7
|
+
max-width: unset;
|
|
8
|
+
height: 70vh;
|
|
7
9
|
border: 0;
|
|
8
10
|
background-color: $settings-header-bg;
|
|
9
11
|
|
|
10
12
|
.react-aria-Dialog {
|
|
11
|
-
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
12
15
|
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
16
|
padding: 0;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
@@ -83,7 +83,7 @@ const ImageEditorWrapper: React.FC<ImageEditorWrapperProps> = ({
|
|
|
83
83
|
<div className={`image-widget ${className || ''}`}>
|
|
84
84
|
<div className="image-widget-cropper">
|
|
85
85
|
<DialogTrigger>
|
|
86
|
-
<Button onPress={() => setOpen(true)}>
|
|
86
|
+
<Button download={false} onPress={() => setOpen(true)}>
|
|
87
87
|
{buttonText || (
|
|
88
88
|
<FormattedMessage id="Edit image" defaultMessage="Edit image" />
|
|
89
89
|
)}
|
|
@@ -33,14 +33,16 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
&__content {
|
|
36
|
-
display:
|
|
36
|
+
display: grid;
|
|
37
37
|
overflow: hidden;
|
|
38
38
|
width: 100%;
|
|
39
|
+
height: 100%;
|
|
39
40
|
max-height: 100%;
|
|
40
|
-
flex-direction: column;
|
|
41
41
|
animation: scaleIn $image-editor-transition-fast ease-out;
|
|
42
42
|
background: $settings-body-bg;
|
|
43
|
-
box-shadow: 0
|
|
43
|
+
box-shadow: 0 0px 60px rgba(0, 0, 0, 0.5);
|
|
44
|
+
grid-template-columns: 100%;
|
|
45
|
+
grid-template-rows: 80px 1fr;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
&__header {
|
|
@@ -60,7 +62,9 @@
|
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
&__close {
|
|
63
|
-
|
|
65
|
+
display: grid;
|
|
66
|
+
align-self: center;
|
|
67
|
+
padding: $image-editor-spacing-sm;
|
|
64
68
|
border: none;
|
|
65
69
|
border-radius: $image-editor-border-radius-sm;
|
|
66
70
|
background: transparent;
|
|
@@ -86,7 +90,6 @@
|
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
&__label {
|
|
89
|
-
display: block;
|
|
90
93
|
margin-bottom: $image-editor-spacing-sm;
|
|
91
94
|
color: $settings-body-color;
|
|
92
95
|
font-size: 14px;
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
RectangleStencilIcon,
|
|
33
33
|
CircleStencilIcon,
|
|
34
34
|
} from '@plone-collective/volto-image-editor/icons/StencilIcons';
|
|
35
|
+
import BackSVG from '@plone/volto/icons/back.svg';
|
|
35
36
|
import './SettingsModal.scss';
|
|
36
37
|
|
|
37
38
|
const messages = defineMessages({
|
|
@@ -205,7 +206,12 @@ export const SettingsModal: FC<Props> = ({
|
|
|
205
206
|
className="image-editor-settings-modal__close"
|
|
206
207
|
onClick={onToggle}
|
|
207
208
|
>
|
|
208
|
-
|
|
209
|
+
<Icon size="base">
|
|
210
|
+
<svg
|
|
211
|
+
{...BackSVG.attributes}
|
|
212
|
+
dangerouslySetInnerHTML={{ __html: BackSVG.content }}
|
|
213
|
+
/>
|
|
214
|
+
</Icon>
|
|
209
215
|
</Button>
|
|
210
216
|
</div>
|
|
211
217
|
|
|
@@ -150,6 +150,8 @@ const FileWidget = (props) => {
|
|
|
150
150
|
<Grid className="image-widget-grid">
|
|
151
151
|
<Grid.Row stretched>
|
|
152
152
|
<Grid.Column stretched width={mainColumnWidth}>
|
|
153
|
+
{isImage && <ImageEditorWrapper value={value} setData={setData} />}
|
|
154
|
+
|
|
153
155
|
<Dropzone
|
|
154
156
|
onDrop={onDrop}
|
|
155
157
|
{...(props.size ? { maxSize: props.size } : {})}
|
|
@@ -225,11 +227,6 @@ const FileWidget = (props) => {
|
|
|
225
227
|
)}
|
|
226
228
|
</div>
|
|
227
229
|
</Grid.Column>
|
|
228
|
-
{isImage && (
|
|
229
|
-
<Grid.Column stretched width="2" className={'image-editor-cta'}>
|
|
230
|
-
<ImageEditorWrapper value={value} setData={setData} />
|
|
231
|
-
</Grid.Column>
|
|
232
|
-
)}
|
|
233
230
|
</Grid.Row>
|
|
234
231
|
</Grid>
|
|
235
232
|
</FormFieldWrapper>
|
package/src/theme/variables.scss
CHANGED
|
@@ -15,7 +15,7 @@ $nav-button-color-hover: $color-black !default;
|
|
|
15
15
|
$nav-button-bg-active: $color-black !default;
|
|
16
16
|
$nav-button-color-active: $color-white !default;
|
|
17
17
|
|
|
18
|
-
$nav-button-close-color: $color-
|
|
18
|
+
$nav-button-close-color: $color-gray-dark !default;
|
|
19
19
|
|
|
20
20
|
$editor-button-bg: $color-gray-dark !default;
|
|
21
21
|
$editor-button-color: $color-white !default;
|