File tree Expand file tree Collapse file tree
packages/template-builder/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ const SuperDocTemplateBuilder = forwardRef<Types.SuperDocTemplateBuilderHandle,
139139 } )
140140 : undefined ;
141141
142- const success =
142+ const success = (
143143 mode === 'inline'
144144 ? editor . commands . insertStructuredContentInline ?.( {
145145 attrs : {
@@ -154,7 +154,8 @@ const SuperDocTemplateBuilder = forwardRef<Types.SuperDocTemplateBuilderHandle,
154154 tag : tagData ,
155155 } ,
156156 text : field . defaultValue || field . alias ,
157- } ) ;
157+ } )
158+ ) as boolean | undefined ;
158159
159160 if ( success ) {
160161 const updatedFields = getTemplateFieldsFromEditor ( editor ) ;
@@ -183,7 +184,7 @@ const SuperDocTemplateBuilder = forwardRef<Types.SuperDocTemplateBuilderHandle,
183184 const editor = superdocRef . current . activeEditor ;
184185 const success = editor . commands . updateStructuredContentById ?.( id , {
185186 attrs : updates ,
186- } ) ;
187+ } ) as boolean | undefined ;
187188
188189 if ( success ) {
189190 setTemplateFields ( ( prev ) => {
@@ -228,7 +229,7 @@ const SuperDocTemplateBuilder = forwardRef<Types.SuperDocTemplateBuilderHandle,
228229
229230 let commandResult = false ;
230231 try {
231- commandResult = editor . commands . deleteStructuredContentById ?.( id ) ?? false ;
232+ commandResult = ( editor . commands . deleteStructuredContentById ?.( id ) as boolean | undefined ) ?? false ;
232233 } catch ( err ) {
233234 console . warn ( '[TemplateBuilder] Failed to delete structured content:' , id , err ) ;
234235 commandResult = false ;
You can’t perform that action at this time.
0 commit comments