Skip to content

Commit 8881cbc

Browse files
leekelleheriOvergaard
authored andcommitted
Tiptap Link: Configured overlay size
1 parent 9b72d2a commit 8881cbc

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/packages/rte/tiptap/extensions/umb/link.extension.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { UMB_LINK_PICKER_MODAL } from '@umbraco-cms/backoffice/multi-url-picker'
44
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
55
import type { Editor } from '@umbraco-cms/backoffice/external/tiptap';
66
import type { UmbLinkPickerLink } from '@umbraco-cms/backoffice/multi-url-picker';
7+
import type { UUIModalSidebarSize } from '@umbraco-cms/backoffice/external/uui';
78

89
export default class UmbTiptapLinkExtensionApi extends UmbTiptapToolbarElementApiBase {
910
override async execute(editor?: Editor) {
@@ -12,8 +13,10 @@ export default class UmbTiptapLinkExtensionApi extends UmbTiptapToolbarElementAp
1213
const data = { config: {}, index: null };
1314
const value = { link };
1415

16+
const overlaySize = this.configuration?.getValueByAlias<UUIModalSidebarSize>('overlaySize') ?? 'small';
17+
1518
const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
16-
const modalHandler = modalManager.open(this, UMB_LINK_PICKER_MODAL, { data, value });
19+
const modalHandler = modalManager.open(this, UMB_LINK_PICKER_MODAL, { data, value, modal: { size: overlaySize } });
1720

1821
if (!modalHandler) return;
1922

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,17 @@ export const manifests: Array<ManifestPropertyEditorUi> = [
4242
weight: 40,
4343
config: [{ alias: 'min', value: 0 }],
4444
},
45+
{
46+
alias: 'overlaySize',
47+
label: 'Overlay Size',
48+
description: 'Select the width of the overlay (link picker)',
49+
propertyEditorUiAlias: 'Umb.PropertyEditorUi.OverlaySize',
50+
weight: 50,
51+
},
52+
],
53+
defaultData: [
54+
{ alias: 'overlaySize', value: 'medium' },
4555
],
46-
defaultData: [],
4756
},
4857
},
4958
},

0 commit comments

Comments
 (0)