This repository was archived by the owner on Jan 30, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -414,7 +414,7 @@ const SuperDocTemplateBuilder = forwardRef<
414414 if ( ! editor ) return ;
415415 const currentPos = editor . state . selection . from ;
416416 const tr = editor . state . tr . delete ( triggerStart , currentPos ) ;
417- editor . view . dispatch ( tr ) ;
417+ ( editor as any ) . view . dispatch ( tr ) ;
418418 } ;
419419
420420 triggerCleanupRef . current = cleanup ;
@@ -628,6 +628,7 @@ const SuperDocTemplateBuilder = forwardRef<
628628 previousField,
629629 getFields : ( ) => templateFields ,
630630 exportTemplate,
631+ getSuperDoc : ( ) => superdocRef . current ,
631632 } ) ) ;
632633
633634 // Components
Original file line number Diff line number Diff line change @@ -135,4 +135,14 @@ export interface SuperDocTemplateBuilderHandle {
135135 previousField : ( ) => void ;
136136 getFields : ( ) => TemplateField [ ] ;
137137 exportTemplate : ( config ?: ExportConfig ) => Promise < void | Blob > ;
138+ /**
139+ * Returns the SuperDoc instance.
140+ * Use this to access the full SuperDoc API, including:
141+ * - The active editor: `getSuperDoc()?.activeEditor`
142+ * - Editor commands: `getSuperDoc()?.activeEditor?.commands.*`
143+ * - Editor state and helpers: `getSuperDoc()?.activeEditor?.state`
144+ *
145+ * Note: Full TypeScript types for SuperDoc will be available in a future update.
146+ */
147+ getSuperDoc : ( ) => SuperDoc | null ;
138148}
You can’t perform that action at this time.
0 commit comments