docx-diff-editor 1.0.1 → 1.0.4
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 +13 -34
- package/dist/index.d.ts +13 -34
- package/dist/index.js +210 -223
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +211 -222
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -22,13 +22,6 @@ type ProseMirrorNode = any;
|
|
|
22
22
|
* - ProseMirrorJSON: Direct JSON structure
|
|
23
23
|
*/
|
|
24
24
|
type DocxContent = File | ProseMirrorJSON | string;
|
|
25
|
-
/**
|
|
26
|
-
* Result of content resolution (converting any input to JSON)
|
|
27
|
-
*/
|
|
28
|
-
interface ResolvedContent {
|
|
29
|
-
json: ProseMirrorJSON;
|
|
30
|
-
type: 'file' | 'html' | 'json';
|
|
31
|
-
}
|
|
32
25
|
/**
|
|
33
26
|
* A segment from the diff algorithm
|
|
34
27
|
*/
|
|
@@ -176,11 +169,11 @@ declare const DocxDiffEditor: react.ForwardRefExoticComponent<DocxDiffEditorProp
|
|
|
176
169
|
|
|
177
170
|
/**
|
|
178
171
|
* Content Resolver Service
|
|
179
|
-
* Detects content type and
|
|
172
|
+
* Detects content type and parses DOCX files to ProseMirror JSON.
|
|
180
173
|
*
|
|
181
174
|
* Supports three input formats:
|
|
182
175
|
* - File: DOCX file parsed by SuperDoc
|
|
183
|
-
* - string: HTML content
|
|
176
|
+
* - string: HTML content (handled directly by SuperDoc in the component)
|
|
184
177
|
* - object: Direct ProseMirror JSON (passed through)
|
|
185
178
|
*/
|
|
186
179
|
|
|
@@ -197,18 +190,6 @@ declare function isProseMirrorJSON(content: unknown): boolean;
|
|
|
197
190
|
* Parse a DOCX File into ProseMirror JSON using a hidden SuperDoc instance.
|
|
198
191
|
*/
|
|
199
192
|
declare function parseDocxFile(file: File, SuperDoc: SuperDocConstructor): Promise<ProseMirrorJSON>;
|
|
200
|
-
/**
|
|
201
|
-
* Parse HTML content into ProseMirror JSON using SuperDoc's html option.
|
|
202
|
-
*/
|
|
203
|
-
declare function parseHtmlContent(html: string, SuperDoc: SuperDocConstructor, templateDocx?: File): Promise<ProseMirrorJSON>;
|
|
204
|
-
/**
|
|
205
|
-
* Resolve any content type to ProseMirror JSON.
|
|
206
|
-
*
|
|
207
|
-
* @param content - File, HTML string, or ProseMirror JSON
|
|
208
|
-
* @param SuperDoc - The SuperDoc constructor (passed in to avoid bundling)
|
|
209
|
-
* @param templateDocx - Optional template DOCX for HTML content
|
|
210
|
-
*/
|
|
211
|
-
declare function resolveContent(content: DocxContent, SuperDoc: SuperDocConstructor, templateDocx?: File): Promise<ResolvedContent>;
|
|
212
193
|
|
|
213
194
|
/**
|
|
214
195
|
* Document Differ Service
|
|
@@ -290,26 +271,24 @@ declare const DEFAULT_SUPERDOC_USER: {
|
|
|
290
271
|
declare const CSS_PREFIX = "dde";
|
|
291
272
|
|
|
292
273
|
/**
|
|
293
|
-
* Embedded
|
|
294
|
-
*
|
|
295
|
-
* This is a base64-encoded minimal DOCX file that provides the basic
|
|
296
|
-
* schema, styles, and fonts needed to initialize SuperDoc when working
|
|
297
|
-
* with HTML or JSON content.
|
|
274
|
+
* Embedded DOCX template
|
|
298
275
|
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
* - Common font definitions (Calibri, Times New Roman, Arial)
|
|
303
|
-
* - Empty content (to be replaced with user content)
|
|
276
|
+
* This is a base64-encoded blank DOCX file created with Microsoft Word.
|
|
277
|
+
* It provides the complete schema, styles, themes, and fonts needed to
|
|
278
|
+
* initialize SuperDoc when working with HTML or JSON content.
|
|
304
279
|
*
|
|
305
|
-
*
|
|
280
|
+
* The DOCX contains all standard Word document components:
|
|
306
281
|
* - [Content_Types].xml
|
|
307
282
|
* - _rels/.rels
|
|
308
283
|
* - word/document.xml
|
|
309
284
|
* - word/_rels/document.xml.rels
|
|
310
|
-
* - word/styles.xml
|
|
285
|
+
* - word/styles.xml (full Word styles)
|
|
311
286
|
* - word/settings.xml
|
|
312
287
|
* - word/fontTable.xml
|
|
288
|
+
* - word/webSettings.xml
|
|
289
|
+
* - word/theme/theme1.xml
|
|
290
|
+
* - docProps/core.xml
|
|
291
|
+
* - docProps/app.xml
|
|
313
292
|
*/
|
|
314
293
|
/**
|
|
315
294
|
* Get the blank DOCX template as a File object
|
|
@@ -324,4 +303,4 @@ declare function getBlankTemplateBlob(): Blob;
|
|
|
324
303
|
*/
|
|
325
304
|
declare function isValidDocxFile(file: File): boolean;
|
|
326
305
|
|
|
327
|
-
export { CSS_PREFIX, type ChangeLocation, type ComparisonResult, DEFAULT_AUTHOR, DEFAULT_SUPERDOC_USER, type DiffResult, type DiffSegment, type DocxContent, DocxDiffEditor, type DocxDiffEditorProps, type DocxDiffEditorRef, type EnrichedChange, type FormatChange, type FormatDetails, type ProseMirrorJSON, type ProseMirrorMark, type ProseMirrorNode, type TrackChangeAuthor, createTrackDeleteMark, createTrackFormatMark, createTrackInsertMark, DocxDiffEditor as default, detectContentType, diffDocuments, extractEnrichedChanges, getBlankTemplateBlob, getBlankTemplateFile, isProseMirrorJSON, isValidDocxFile, mergeDocuments, parseDocxFile
|
|
306
|
+
export { CSS_PREFIX, type ChangeLocation, type ComparisonResult, DEFAULT_AUTHOR, DEFAULT_SUPERDOC_USER, type DiffResult, type DiffSegment, type DocxContent, DocxDiffEditor, type DocxDiffEditorProps, type DocxDiffEditorRef, type EnrichedChange, type FormatChange, type FormatDetails, type ProseMirrorJSON, type ProseMirrorMark, type ProseMirrorNode, type TrackChangeAuthor, createTrackDeleteMark, createTrackFormatMark, createTrackInsertMark, DocxDiffEditor as default, detectContentType, diffDocuments, extractEnrichedChanges, getBlankTemplateBlob, getBlankTemplateFile, isProseMirrorJSON, isValidDocxFile, mergeDocuments, parseDocxFile };
|
package/dist/index.d.ts
CHANGED
|
@@ -22,13 +22,6 @@ type ProseMirrorNode = any;
|
|
|
22
22
|
* - ProseMirrorJSON: Direct JSON structure
|
|
23
23
|
*/
|
|
24
24
|
type DocxContent = File | ProseMirrorJSON | string;
|
|
25
|
-
/**
|
|
26
|
-
* Result of content resolution (converting any input to JSON)
|
|
27
|
-
*/
|
|
28
|
-
interface ResolvedContent {
|
|
29
|
-
json: ProseMirrorJSON;
|
|
30
|
-
type: 'file' | 'html' | 'json';
|
|
31
|
-
}
|
|
32
25
|
/**
|
|
33
26
|
* A segment from the diff algorithm
|
|
34
27
|
*/
|
|
@@ -176,11 +169,11 @@ declare const DocxDiffEditor: react.ForwardRefExoticComponent<DocxDiffEditorProp
|
|
|
176
169
|
|
|
177
170
|
/**
|
|
178
171
|
* Content Resolver Service
|
|
179
|
-
* Detects content type and
|
|
172
|
+
* Detects content type and parses DOCX files to ProseMirror JSON.
|
|
180
173
|
*
|
|
181
174
|
* Supports three input formats:
|
|
182
175
|
* - File: DOCX file parsed by SuperDoc
|
|
183
|
-
* - string: HTML content
|
|
176
|
+
* - string: HTML content (handled directly by SuperDoc in the component)
|
|
184
177
|
* - object: Direct ProseMirror JSON (passed through)
|
|
185
178
|
*/
|
|
186
179
|
|
|
@@ -197,18 +190,6 @@ declare function isProseMirrorJSON(content: unknown): boolean;
|
|
|
197
190
|
* Parse a DOCX File into ProseMirror JSON using a hidden SuperDoc instance.
|
|
198
191
|
*/
|
|
199
192
|
declare function parseDocxFile(file: File, SuperDoc: SuperDocConstructor): Promise<ProseMirrorJSON>;
|
|
200
|
-
/**
|
|
201
|
-
* Parse HTML content into ProseMirror JSON using SuperDoc's html option.
|
|
202
|
-
*/
|
|
203
|
-
declare function parseHtmlContent(html: string, SuperDoc: SuperDocConstructor, templateDocx?: File): Promise<ProseMirrorJSON>;
|
|
204
|
-
/**
|
|
205
|
-
* Resolve any content type to ProseMirror JSON.
|
|
206
|
-
*
|
|
207
|
-
* @param content - File, HTML string, or ProseMirror JSON
|
|
208
|
-
* @param SuperDoc - The SuperDoc constructor (passed in to avoid bundling)
|
|
209
|
-
* @param templateDocx - Optional template DOCX for HTML content
|
|
210
|
-
*/
|
|
211
|
-
declare function resolveContent(content: DocxContent, SuperDoc: SuperDocConstructor, templateDocx?: File): Promise<ResolvedContent>;
|
|
212
193
|
|
|
213
194
|
/**
|
|
214
195
|
* Document Differ Service
|
|
@@ -290,26 +271,24 @@ declare const DEFAULT_SUPERDOC_USER: {
|
|
|
290
271
|
declare const CSS_PREFIX = "dde";
|
|
291
272
|
|
|
292
273
|
/**
|
|
293
|
-
* Embedded
|
|
294
|
-
*
|
|
295
|
-
* This is a base64-encoded minimal DOCX file that provides the basic
|
|
296
|
-
* schema, styles, and fonts needed to initialize SuperDoc when working
|
|
297
|
-
* with HTML or JSON content.
|
|
274
|
+
* Embedded DOCX template
|
|
298
275
|
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
* - Common font definitions (Calibri, Times New Roman, Arial)
|
|
303
|
-
* - Empty content (to be replaced with user content)
|
|
276
|
+
* This is a base64-encoded blank DOCX file created with Microsoft Word.
|
|
277
|
+
* It provides the complete schema, styles, themes, and fonts needed to
|
|
278
|
+
* initialize SuperDoc when working with HTML or JSON content.
|
|
304
279
|
*
|
|
305
|
-
*
|
|
280
|
+
* The DOCX contains all standard Word document components:
|
|
306
281
|
* - [Content_Types].xml
|
|
307
282
|
* - _rels/.rels
|
|
308
283
|
* - word/document.xml
|
|
309
284
|
* - word/_rels/document.xml.rels
|
|
310
|
-
* - word/styles.xml
|
|
285
|
+
* - word/styles.xml (full Word styles)
|
|
311
286
|
* - word/settings.xml
|
|
312
287
|
* - word/fontTable.xml
|
|
288
|
+
* - word/webSettings.xml
|
|
289
|
+
* - word/theme/theme1.xml
|
|
290
|
+
* - docProps/core.xml
|
|
291
|
+
* - docProps/app.xml
|
|
313
292
|
*/
|
|
314
293
|
/**
|
|
315
294
|
* Get the blank DOCX template as a File object
|
|
@@ -324,4 +303,4 @@ declare function getBlankTemplateBlob(): Blob;
|
|
|
324
303
|
*/
|
|
325
304
|
declare function isValidDocxFile(file: File): boolean;
|
|
326
305
|
|
|
327
|
-
export { CSS_PREFIX, type ChangeLocation, type ComparisonResult, DEFAULT_AUTHOR, DEFAULT_SUPERDOC_USER, type DiffResult, type DiffSegment, type DocxContent, DocxDiffEditor, type DocxDiffEditorProps, type DocxDiffEditorRef, type EnrichedChange, type FormatChange, type FormatDetails, type ProseMirrorJSON, type ProseMirrorMark, type ProseMirrorNode, type TrackChangeAuthor, createTrackDeleteMark, createTrackFormatMark, createTrackInsertMark, DocxDiffEditor as default, detectContentType, diffDocuments, extractEnrichedChanges, getBlankTemplateBlob, getBlankTemplateFile, isProseMirrorJSON, isValidDocxFile, mergeDocuments, parseDocxFile
|
|
306
|
+
export { CSS_PREFIX, type ChangeLocation, type ComparisonResult, DEFAULT_AUTHOR, DEFAULT_SUPERDOC_USER, type DiffResult, type DiffSegment, type DocxContent, DocxDiffEditor, type DocxDiffEditorProps, type DocxDiffEditorRef, type EnrichedChange, type FormatChange, type FormatDetails, type ProseMirrorJSON, type ProseMirrorMark, type ProseMirrorNode, type TrackChangeAuthor, createTrackDeleteMark, createTrackFormatMark, createTrackInsertMark, DocxDiffEditor as default, detectContentType, diffDocuments, extractEnrichedChanges, getBlankTemplateBlob, getBlankTemplateFile, isProseMirrorJSON, isValidDocxFile, mergeDocuments, parseDocxFile };
|