@@ -27,13 +27,18 @@ const markerActions: {
2727 action ?: ( currentEditor : {
2828 reference : ScriptureReference ;
2929 editor : LexicalEditor ;
30+ autoNumbering ?: boolean ;
31+ newVerseRChapterNum ?: number ;
32+ noteText ?: string ;
3033 } ) => MarkerContent [ ] ;
3134 } ;
3235} = {
3336 c : {
3437 action : ( currentEditor ) => {
3538 const { book, chapterNum } = currentEditor . reference ;
36- const nextChapter = chapterNum + 1 ;
39+ const nextChapter = currentEditor . autoNumbering
40+ ? chapterNum + 1
41+ : currentEditor . newVerseRChapterNum ;
3742 const content : MarkerContent = {
3843 type : "chapter" ,
3944 marker : "c" ,
@@ -46,7 +51,9 @@ const markerActions: {
4651 v : {
4752 action : ( currentEditor ) => {
4853 const { book, chapterNum, verseNum, verse } = currentEditor . reference ;
49- const nextVerse = getNextVerse ( verseNum , verse ) ;
54+ const nextVerse = currentEditor . autoNumbering
55+ ? getNextVerse ( verseNum , verse )
56+ : currentEditor . newVerseRChapterNum ;
5057 const content : MarkerContent = {
5158 type : "verse" ,
5259 marker : "v" ,
@@ -68,7 +75,7 @@ const markerActions: {
6875 {
6976 type : "char" ,
7077 marker : "ft" ,
71- content : [ " " ] ,
78+ content : [ currentEditor . noteText ?? " " ] ,
7279 } ,
7380 ] ,
7481 } ;
@@ -87,7 +94,7 @@ const markerActions: {
8794 {
8895 type : "char" ,
8996 marker : "xt" ,
90- content : [ " " ] ,
97+ content : [ currentEditor . noteText ?? " " ] ,
9198 } ,
9299 ] ,
93100 } ;
@@ -103,9 +110,17 @@ export function getUsjMarkerAction(
103110 viewOptions ?: ViewOptions ,
104111) : MarkerAction {
105112 const markerAction = getMarkerAction ( marker ) ;
106- const action = ( currentEditor : { reference : ScriptureReference ; editor : LexicalEditor } ) => {
113+ const action = ( currentEditor : {
114+ reference : ScriptureReference ;
115+ editor : LexicalEditor ;
116+ autoNumbering ?: boolean ;
117+ newVerseRChapterNum ?: number ;
118+ noteText ?: string ;
119+ } ) => {
107120 currentEditor . editor . update ( ( ) => {
108- const content = markerAction ?. action ?.( currentEditor ) ;
121+ const content = currentEditor . autoNumbering
122+ ? markerAction ?. action ?.( currentEditor )
123+ : markerAction ?. action ?.( currentEditor ) ;
109124 if ( ! content ) return ;
110125
111126 const serializedLexicalNode = createLexicalUsjNode ( content , usjEditorAdaptor , viewOptions ) ;
0 commit comments