Skip to content

Commit 9b72d2a

Browse files
leekelleheriOvergaard
authored andcommitted
Tiptap: replaced max height/width options with combined dimensions
1 parent 2fc9940 commit 9b72d2a

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

src/packages/rte/tiptap/components/input-tiptap/input-tiptap.element.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,9 @@ export class UmbInputTiptapElement extends UmbFormControlMixin<string, typeof Um
105105
const element = this.shadowRoot?.querySelector('#editor');
106106
if (!element) return;
107107

108-
const maxWidth = this.configuration?.getValueByAlias<number>('maxWidth');
109-
const maxHeight = this.configuration?.getValueByAlias<number>('maxHeight');
110-
if (maxWidth) this.setAttribute('style', `max-width: ${maxWidth}px;`);
111-
if (maxHeight) element.setAttribute('style', `max-height: ${maxHeight}px;`);
108+
const dimensions = this.configuration?.getValueByAlias<{ width?: number; height?: number }>('dimensions');
109+
if (dimensions?.width) this.setAttribute('style', `max-width: ${dimensions.width}px;`);
110+
if (dimensions?.height) element.setAttribute('style', `max-height: ${dimensions.height}px;`);
112111

113112
this._toolbar = this.configuration?.getValueByAlias<UmbTiptapToolbarValue>('toolbar') ?? [[[]]];
114113

src/packages/rte/tiptap/property-editors/tiptap/manifests.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,12 @@ export const manifests: Array<ManifestPropertyEditorUi> = [
2828
weight: 10,
2929
},
3030
{
31-
alias: 'maxWidth',
32-
label: 'MaxWidth',
33-
description: 'Editor max width',
34-
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
31+
alias: 'dimensions',
32+
label: 'Dimensions',
33+
description: 'Set the maximum width and height of the editor',
34+
propertyEditorUiAlias: 'Umb.PropertyEditorUI.TinyMCE.DimensionsConfiguration',
3535
weight: 20,
3636
},
37-
{
38-
alias: 'maxHeight',
39-
label: 'MaxHeight',
40-
description: 'Editor max height',
41-
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
42-
weight: 30,
43-
},
4437
{
4538
alias: 'maxImageSize',
4639
label: 'Maximum size for inserted images',

0 commit comments

Comments
 (0)