-
-
-
- ${this.localize.term('mediaPicker_changeMedia')}
-
-
- ${this.localize.term('mediaPicker_openMedia')}
-
-
-
+
+
+ Change Media Item
+
+
+
+ Open in Media Library
+
+ `;
+ }
+
+ #renderImageCropper() {
+ if (!this._imageCropperValue) return nothing;
+ return html`
+
+ ${this.#renderActions()}
+
+ `;
+ }
+
+ #renderFilePreview() {
+ return html`
+
+ ${when(
+ this._imageCropperValue?.src,
+ (path) => html``,
+ () => this.#renderFileNotFound(),
+ )}
+
+ ${this.#renderActions()}
+ `;
+ }
+
+ #renderFileNotFound() {
+ const args = [this.localize.term('general_media')];
+ return html`
+
+
+ Item not found
+
+ The requested item could not be found.
`;
}
static override styles = [
+ UmbTextStyles,
css`
#layout {
height: 100%;
@@ -179,35 +246,42 @@ export class UmbImageCropperEditorModalElement extends UmbModalBaseElement<
flex-direction: column;
justify-content: space-between;
}
+
umb-image-cropper-editor-field {
- flex-grow: 1;
+ flex: 1;
+ }
+
+ #main {
+ flex: 1;
+ background-color: var(--uui-color-surface);
+ outline: 1px solid var(--uui-color-border);
}
#actions {
- display: inline-flex;
- gap: var(--uui-size-space-3);
- }
- uui-icon {
- padding-right: var(--uui-size-3);
- }
-
- #options {
display: flex;
- justify-content: center;
+ margin-top: 0.5rem;
+
+ uui-icon {
+ padding-right: var(--uui-size-1);
+ }
}
- img {
- max-width: 80%;
- background-image: url('data:image/svg+xml;charset=utf-8,');
- background-size: 10px 10px;
- background-repeat: repeat;
+ .uui-text {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ height: 100%;
}
`,
];
}
+/** @deprecated Should be exported as `element` only; to be removed in Umbraco 18. */
export default UmbImageCropperEditorModalElement;
+export { UmbImageCropperEditorModalElement as element };
+
declare global {
interface HTMLElementTagNameMap {
'umb-image-cropper-editor-modal': UmbImageCropperEditorModalElement;
diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/modals/media-picker/media-picker-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/modals/media-picker/media-picker-modal.element.ts
index 95eb58308f..a2823f1e24 100644
--- a/src/Umbraco.Web.UI.Client/src/packages/media/media/modals/media-picker/media-picker-modal.element.ts
+++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/modals/media-picker/media-picker-modal.element.ts
@@ -459,11 +459,6 @@ export class UmbMediaPickerModalElement extends UmbModalBaseElement`;
+ return html`
+
+
+ `;
}
}