1- import type { UmbImageCropperElement } from '../../../components/input-image-cropper/image-cropper.element.js' ;
21import type {
32 UmbImageCropperCrop ,
43 UmbImageCropperCrops ,
54 UmbImageCropperFocalPoint ,
65 UmbImageCropperPropertyEditorValue ,
7- } from './types.js' ;
6+ } from '../../../components/index.js' ;
7+ import type { UmbImageCropperElement } from '../../../components/input-image-cropper/image-cropper.element.js' ;
88import { css , customElement , html , property , repeat , state , when } from '@umbraco-cms/backoffice/external/lit' ;
99import { UmbChangeEvent } from '@umbraco-cms/backoffice/event' ;
1010import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element' ;
1111
12+ /** TODO Do we want to combine this with the original image-cropper-field element? Element is very similar, but with a few UI changes... */
1213@customElement ( 'umb-image-cropper-editor-field' )
1314export class UmbImageCropperEditorFieldElement extends UmbLitElement {
1415 @property ( { attribute : false } )
@@ -170,14 +171,15 @@ export class UmbImageCropperEditorFieldElement extends UmbLitElement {
170171 return html ` <uui- menu- item
171172 id= "reset-current-crop"
172173 @click = ${ this . #resetCurrentCrop}
173- ?current= ${ ! this . currentCrop }
174- label= "Media" > </ uui- menu- item>
174+ ?active= ${ ! this . currentCrop }
175+ label= ${ this . localize . term ( 'general_media' ) } > </ uui- menu- item>
176+
175177 ${ repeat (
176178 this . crops ,
177179 ( crop ) => crop . alias + JSON . stringify ( crop . coordinates ) ,
178180 ( crop ) =>
179181 html ` <umb- image-cropper- preview
180- ?current = ${ this . currentCrop ?. alias === crop . alias }
182+ ?active = ${ this . currentCrop ?. alias === crop . alias }
181183 @click = ${ ( ) => this . #onCropClick( crop ) }
182184 .crop = ${ crop }
183185 .focalPoint = ${ this . focalPoint }
@@ -215,6 +217,8 @@ export class UmbImageCropperEditorFieldElement extends UmbLitElement {
215217
216218 # reset-current-crop {
217219 --uui-menu-item-flat-structure : 1 ;
220+ --uui-menu-item-border-radius : var (--uui-border-radius );
221+ border-radius : var (--uui-border-radius );
218222 width : 100% ;
219223 background-color : var (--uui-color-surface );
220224 }
@@ -224,9 +228,9 @@ export class UmbImageCropperEditorFieldElement extends UmbLitElement {
224228 flex : 1 ;
225229 }
226230
227- [ current ],
228- # reset-current-crop [ current ] {
229- background-color : var (--uui-color-surface-alt );
231+ # reset- current-crop [ active ],
232+ [ active ] {
233+ background-color : var (--uui-color-current );
230234 }
231235
232236 umb-image-cropper-focus-setter {
0 commit comments