@@ -66,10 +66,6 @@ export function RichTextBubbleIframe() {
6666 window . open ( src , '_blank' ) ;
6767 } , [ src ] ) ;
6868
69- const openEditLinkModal = useCallback ( ( ) => {
70- toggleVisible ( true ) ;
71- } , [ toggleVisible ] ) ;
72-
7369 const setSize = useCallback (
7470 ( size : any ) => {
7571 editor . chain ( ) . updateAttributes ( Iframe . name , size ) . setNodeSelection ( editor . state . selection . from ) . focus ( ) . run ( ) ;
@@ -101,11 +97,47 @@ export function RichTextBubbleIframe() {
10197 tooltip = "Visit Link"
10298 />
10399
104- < ActionButton
105- action = { openEditLinkModal }
106- icon = "Pencil"
107- tooltip = "Open Edit Link"
108- />
100+ < Dialog
101+ onOpenChange = { toggleVisible }
102+ open = { visible }
103+ >
104+ < DialogTrigger asChild >
105+ < ActionButton
106+ icon = "Pencil"
107+ tooltip = "Open Edit Link"
108+ />
109+ </ DialogTrigger >
110+
111+ < DialogContent >
112+ < DialogHeader >
113+ < DialogTitle >
114+ Edit Link Iframe
115+ </ DialogTitle >
116+ </ DialogHeader >
117+
118+ < Input
119+ autoFocus
120+ onInput = { ( e : any ) => setFormUrl ( e . target . value ) }
121+ placeholder = "Enter link"
122+ type = "url"
123+ value = { formUrl }
124+ />
125+
126+ < DialogFooter >
127+ < Button onClick = { handleCancel }
128+ type = 'button'
129+ >
130+ Cancel
131+ </ Button >
132+
133+ < Button onClick = { handleOk }
134+ type = 'button'
135+ >
136+ OK
137+ </ Button >
138+ </ DialogFooter >
139+ </ DialogContent >
140+ </ Dialog >
109141
110142 < SizeSetter height = { height as any }
111143 onOk = { setSize }
@@ -122,45 +154,10 @@ export function RichTextBubbleIframe() {
122154 icon = "Trash2"
123155 tooltip = { t ( 'editor.delete' ) }
124156 />
157+
125158 </ div >
126159 </ BubbleMenu >
127160
128- < Dialog
129- onOpenChange = { toggleVisible }
130- open = { visible }
131- >
132- < DialogTrigger />
133-
134- < DialogContent >
135- < DialogHeader >
136- < DialogTitle >
137- Edit Link Iframe
138- </ DialogTitle >
139- </ DialogHeader >
140-
141- < Input
142- autoFocus
143- onInput = { ( e : any ) => setFormUrl ( e . target . value ) }
144- placeholder = "Enter link"
145- type = "url"
146- value = { formUrl }
147- />
148-
149- < DialogFooter >
150- < Button onClick = { handleCancel }
151- type = 'button'
152- >
153- Cancel
154- </ Button >
155-
156- < Button onClick = { handleOk }
157- type = 'button'
158- >
159- OK
160- </ Button >
161- </ DialogFooter >
162- </ DialogContent >
163- </ Dialog >
164161 </ >
165162 ) ;
166163}
0 commit comments