myrole-docx-editor 0.1.5 → 0.3.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 +30 -0
- package/dist/chunks/{sdk-BVyUd7P0.js → sdk-CU9i-NwD.js} +9202 -8422
- package/dist/chunks/sdk-CU9i-NwD.js.map +1 -0
- package/dist/chunks/{vars-blockly-CBeNXS0X.js → vars-blockly-CBim6Ow0.js} +2 -2
- package/dist/chunks/{vars-blockly-CBeNXS0X.js.map → vars-blockly-CBim6Ow0.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/react.js +1 -1
- package/dist/types/packages/docx-editor/src/authoring-ui.d.ts +3 -0
- package/dist/types/packages/docx-editor/src/commands.d.ts +1 -1
- package/dist/types/packages/docx-editor/src/comment-ui.d.ts +4 -0
- package/dist/types/packages/docx-editor/src/comments.d.ts +2 -24
- package/dist/types/packages/docx-editor/src/editor.d.ts +22 -3
- package/dist/types/packages/docx-editor/src/html.d.ts +3 -2
- package/dist/types/packages/docx-editor/src/sdk.d.ts +5 -0
- package/dist/types/packages/docx-editor/src/vars-complete.d.ts +3 -3
- package/dist/types/packages/docx-editor/src/vars-library.d.ts +14 -0
- package/dist/types/packages/docx-editor/src/vars-panel.d.ts +2 -0
- package/dist/types/packages/docx-model/src/authoring.d.ts +10 -0
- package/dist/types/packages/docx-model/src/comments.d.ts +30 -0
- package/dist/types/packages/docx-model/src/editor.d.ts +3 -1
- package/dist/types/packages/docx-model/src/index.d.ts +2 -0
- package/dist/types/packages/docx-model/src/insert.d.ts +8 -1
- package/dist/types/packages/docx-model/src/paste.d.ts +6 -0
- package/dist/types/packages/docx-model/src/spans.d.ts +2 -0
- package/dist/types/packages/docx-render/src/index.d.ts +1 -1
- package/dist/types/packages/docx-render/src/render-api.d.ts +2 -1
- package/dist/types/packages/docx-render/src/types.d.ts +16 -0
- package/dist/types/packages/docx-tags/src/grammar.d.ts +1 -0
- package/package.json +4 -3
- package/dist/chunks/sdk-BVyUd7P0.js.map +0 -1
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
|