@@ -57,23 +57,25 @@ const TOOL_DEFINITIONS: Array<{ icon: string; id: RichTextToolId; label: string
5757 { id: ' numbered-list' , icon: ' format_list_numbered' , label: ' Numbered list' },
5858 { id: ' image' , icon: ' image' , label: ' Image' },
5959 { id: ' table' , icon: ' table_rows' , label: ' Table' },
60- { id: ' quote' , icon: ' format_quote' , label: ' Quote' },
60+ { id: ' quote' , icon: ' format_quote' , label: ' Quote' }
6161];
6262const ACTIVE_TOOL_NAMES: Partial <Record <RichTextToolId , string >> = {
6363 ' bold' : ' bold' ,
6464 ' italic' : ' italic' ,
6565 ' link' : ' link' ,
6666 ' bullet-list' : ' bulletList' ,
6767 ' numbered-list' : ' orderedList' ,
68- ' quote' : ' blockquote' ,
68+ ' image' : ' image' ,
69+ ' table' : ' table' ,
70+ ' quote' : ' blockquote'
6971};
7072const activeToolIds = ref <Set <RichTextToolId >>(new Set ());
7173const lastEditorModelValue = ref (model .value );
7274const tools = computed (() =>
7375 TOOL_DEFINITIONS .map (tool => ({
7476 ... tool ,
75- active: activeToolIds .value .has (tool .id ),
76- })),
77+ active: activeToolIds .value .has (tool .id )
78+ }))
7779);
7880
7981const editor = useEditor ({
@@ -84,21 +86,21 @@ const editor = useEditor({
8486 link: {
8587 openOnClick: false ,
8688 autolink: true ,
87- defaultProtocol: ' https' ,
88- },
89+ defaultProtocol: ' https'
90+ }
8991 }),
9092 Image ,
9193 Table .configure ({
92- resizable: false ,
94+ resizable: false
9395 }),
9496 TableRow ,
9597 TableHeader ,
96- TableCell ,
98+ TableCell
9799 ],
98100 editorProps: {
99101 attributes: {
100- class: ' project-wizard-rich-text-editor-surface project-wizard-rich-text-content' ,
101- },
102+ class: ' project-wizard-rich-text-editor-surface project-wizard-rich-text-content'
103+ }
102104 },
103105 onUpdate({ editor : currentEditor }) {
104106 const nextValue = currentEditor .isEmpty ? ' ' : currentEditor .getHTML ();
@@ -110,7 +112,7 @@ const editor = useEditor({
110112 },
111113 onTransaction({ editor : currentEditor }) {
112114 updateActiveTools (currentEditor );
113- },
115+ }
114116});
115117
116118watch (
@@ -133,7 +135,7 @@ watch(
133135
134136 currentEditor .commands .setContent (nextValue , { emitUpdate: false });
135137 lastEditorModelValue .value = value ;
136- },
138+ }
137139);
138140
139141function updateActiveTools(currentEditor : Editor ) {
@@ -143,7 +145,7 @@ function updateActiveTools(currentEditor: Editor) {
143145 const activeToolName = ACTIVE_TOOL_NAMES [id ];
144146 return activeToolName ? currentEditor .isActive (activeToolName ) : false ;
145147 })
146- .map (({ id }) => id ),
148+ .map (({ id }) => id )
147149 );
148150}
149151
0 commit comments