docx-diff-editor 1.0.28 → 1.0.29

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/dist/index.d.mts CHANGED
@@ -158,6 +158,8 @@ interface DocxDiffEditorRef {
158
158
  exportDocx(): Promise<Blob>;
159
159
  /** Reset to source state (clear comparison) */
160
160
  resetComparison(): void;
161
+ /** Accept all track changes and return the clean document */
162
+ acceptAllChanges(): Promise<ProseMirrorJSON>;
161
163
  /** Check if editor is ready */
162
164
  isReady(): boolean;
163
165
  }
package/dist/index.d.ts CHANGED
@@ -158,6 +158,8 @@ interface DocxDiffEditorRef {
158
158
  exportDocx(): Promise<Blob>;
159
159
  /** Reset to source state (clear comparison) */
160
160
  resetComparison(): void;
161
+ /** Accept all track changes and return the clean document */
162
+ acceptAllChanges(): Promise<ProseMirrorJSON>;
161
163
  /** Check if editor is ready */
162
164
  isReady(): boolean;
163
165
  }
package/dist/index.js CHANGED
@@ -1108,6 +1108,20 @@ var DocxDiffEditor = react.forwardRef(
1108
1108
  setDiffResult(null);
1109
1109
  }
1110
1110
  },
1111
+ /**
1112
+ * Accept all track changes and return the clean document
1113
+ */
1114
+ async acceptAllChanges() {
1115
+ const editor = superdocRef.current?.activeEditor;
1116
+ if (!editor) {
1117
+ throw new Error("Editor not ready");
1118
+ }
1119
+ editor.commands.acceptAllChanges();
1120
+ const cleanJson = editor.getJSON();
1121
+ setMergedJson(null);
1122
+ setDiffResult(null);
1123
+ return cleanJson;
1124
+ },
1111
1125
  /**
1112
1126
  * Check if editor is ready
1113
1127
  */