myrole-docx-editor 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -87,6 +87,8 @@ editor.setZoom(1.25) editor.setTheme('dark') editor.setRead
87
87
  editor.showPanel('variables') editor.fileName('contrat.docx') editor.pages()
88
88
  editor.variables.tags() editor.variables.preview(true, values)
89
89
  editor.comments() editor.showComments(false)
90
+ editor.addComment('Review', 'Author') // nonempty body selection → ID or null
91
+ editor.updateComment(id, 'Updated') editor.deleteComment(id)
90
92
  editor.on('change' | 'selection' | 'render' | 'save' | 'load' | 'zoom', fn)
91
93
  await editor.saveNow() editor.isDirty() editor.saveState()
92
94
  editor.fitZoom('width') // or 'page'; follows host resizing
@@ -106,6 +108,34 @@ overrides covering more than half the paragraph, preserving local emphasis,
106
108
  character styles and structural XML. `styleId: null` restores the document's
107
109
  default style; `'Normal'` selects that named style. Unknown IDs are ignored.
108
110
 
111
+ ```ts
112
+ const editing = editor.editor
113
+ if (!editing) throw new Error('Load a document first')
114
+ editing.selectRange({ para: 2, off: 0 }, { para: 2, off: 8 })
115
+ editing.setLink('https://example.org') // selected text; null removes the current link
116
+ const styleId = editing.defineStyle('My heading') // create and apply from the selection
117
+ if (styleId) editing.defineStyle('My heading', styleId) // update the same style
118
+ editing.setList(true) // numbered; false for bullets; null removes it
119
+ editing.setListLevel(1) // levels 0–8
120
+ editing.restartList(1) // body list, from the current item
121
+ editing.undo()
122
+ ```
123
+
124
+ These actions are also available in the ribbon and refuse edits in read-only
125
+ mode. Comments, styles, links and numbering definitions participate in undo/redo,
126
+ including their package relationships. Classic comments support creation on a
127
+ nonempty body range, editing and deletion, without threaded replies or resolution.
128
+ Documents with extended/threaded comment metadata remain readable; their comment
129
+ writes are refused to preserve the linked metadata.
130
+ Links support HTTP(S), mailto and `#bookmark`, within one paragraph and inline
131
+ container. Styles created here are paragraph styles. List restart currently
132
+ requires a body list with direct numbering properties.
133
+
134
+ Header/footer addresses use `{ para, off, part: 'word/header1.xml' }` (or the
135
+ actual part name). Enter, Backspace/Delete and range deletion stay in that part;
136
+ undo retains the story. Splitting inside a complex field, revision or content
137
+ control is refused without altering the document.
138
+
109
139
  ## Display and context actions
110
140
 
111
141
  **Document brut**, under **Affichage** and **Réglages**, shows the original