@docx4j/core-ts 0.5.0 → 0.7.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/NOTICE +4 -0
- package/README.md +92 -4
- package/dist/html/convert.mjs +2 -1
- package/dist/html/elements.mjs +2 -1
- package/dist/model/color/ColorMath.d.mts +29 -0
- package/dist/model/color/ColorMath.mjs +146 -0
- package/dist/model/color/ColorTables.d.mts +6 -0
- package/dist/model/color/ColorTables.mjs +83 -0
- package/dist/model/color/DrawingMLColors.d.mts +52 -0
- package/dist/model/color/DrawingMLColors.mjs +374 -0
- package/dist/model/color/ResolvedColor.d.mts +36 -0
- package/dist/model/color/ResolvedColor.mjs +65 -0
- package/dist/model/color/SpreadsheetColors.d.mts +36 -0
- package/dist/model/color/SpreadsheetColors.mjs +84 -0
- package/dist/model/color/StyleFill.d.mts +28 -0
- package/dist/model/color/StyleFill.mjs +21 -0
- package/dist/model/color/ThemeColors.d.mts +86 -0
- package/dist/model/color/ThemeColors.mjs +304 -0
- package/dist/model/color/WordColors.d.mts +71 -0
- package/dist/model/color/WordColors.mjs +121 -0
- package/dist/model/color/index.d.mts +6 -0
- package/dist/model/color/index.mjs +30 -0
- package/dist/model/content/Body.d.mts +145 -23
- package/dist/model/content/Body.mjs +507 -150
- package/dist/model/content/Comment.d.mts +23 -5
- package/dist/model/content/Comment.mjs +207 -26
- package/dist/model/content/ContentControl.d.mts +198 -19
- package/dist/model/content/ContentControl.mjs +672 -99
- package/dist/model/content/Font.d.mts +70 -17
- package/dist/model/content/Font.mjs +119 -36
- package/dist/model/content/InlinePicture.d.mts +11 -0
- package/dist/model/content/InlinePicture.mjs +21 -1
- package/dist/model/content/List.d.mts +6 -3
- package/dist/model/content/List.mjs +18 -8
- package/dist/model/content/Paragraph.d.mts +200 -14
- package/dist/model/content/Paragraph.mjs +898 -82
- package/dist/model/content/Range.d.mts +227 -12
- package/dist/model/content/Range.mjs +785 -59
- package/dist/model/content/ResolvedView.d.mts +104 -0
- package/dist/model/content/ResolvedView.mjs +596 -0
- package/dist/model/content/Table.d.mts +29 -3
- package/dist/model/content/Table.mjs +135 -49
- package/dist/model/content/TrackedChange.d.mts +174 -15
- package/dist/model/content/TrackedChange.mjs +734 -170
- package/dist/model/content/comments.d.mts +20 -6
- package/dist/model/content/comments.mjs +67 -57
- package/dist/model/content/generalException.d.mts +18 -0
- package/dist/model/content/generalException.mjs +24 -0
- package/dist/model/content/index.d.mts +10 -3
- package/dist/model/content/index.mjs +10 -2
- package/dist/model/content/mathText.d.mts +21 -0
- package/dist/model/content/mathText.mjs +267 -0
- package/dist/model/content/officeText.d.mts +27 -0
- package/dist/model/content/officeText.mjs +74 -0
- package/dist/model/content/ooxml.mjs +12 -1
- package/dist/model/content/outline.d.mts +5 -0
- package/dist/model/content/outline.mjs +13 -0
- package/dist/model/content/paraIds.d.mts +5 -0
- package/dist/model/content/paraIds.mjs +54 -0
- package/dist/model/content/placeholders.d.mts +110 -0
- package/dist/model/content/placeholders.mjs +253 -0
- package/dist/model/content/search.d.mts +74 -0
- package/dist/model/content/search.mjs +255 -9
- package/dist/model/content/spanEdits.d.mts +159 -0
- package/dist/model/content/spanEdits.mjs +728 -0
- package/dist/model/content/story.d.mts +47 -0
- package/dist/model/content/story.mjs +95 -0
- package/dist/model/content/tableColumns.d.mts +1 -1
- package/dist/model/content/tableColumns.mjs +108 -80
- package/dist/model/content/tableRevisions.d.mts +11 -3
- package/dist/model/content/tableRevisions.mjs +72 -42
- package/dist/model/content/tableRules.d.mts +30 -0
- package/dist/model/content/tableRules.mjs +102 -0
- package/dist/model/content/textBoxes.d.mts +18 -0
- package/dist/model/content/textBoxes.mjs +105 -0
- package/dist/model/content/trackedChangeFilter.d.mts +39 -0
- package/dist/model/content/trackedChangeFilter.mjs +81 -0
- package/dist/model/content/tracking.d.mts +63 -6
- package/dist/model/content/tracking.mjs +242 -22
- package/dist/model/content/tree.d.mts +172 -24
- package/dist/model/content/tree.mjs +328 -54
- package/dist/model/content/wordRange.d.mts +48 -0
- package/dist/model/content/wordRange.mjs +97 -0
- package/dist/model/customxml/CustomXmlPartCollection.d.mts +30 -1
- package/dist/model/customxml/CustomXmlPartCollection.mjs +81 -12
- package/dist/model/customxml/XmlMapping.d.mts +32 -8
- package/dist/model/customxml/XmlMapping.mjs +64 -10
- package/dist/model/customxml/bindings.d.mts +33 -4
- package/dist/model/customxml/bindings.mjs +171 -45
- package/dist/model/customxml/index.d.mts +1 -0
- package/dist/model/customxml/index.mjs +1 -0
- package/dist/model/customxml/kinds.d.mts +8 -3
- package/dist/model/customxml/kinds.mjs +26 -5
- package/dist/model/customxml/opendope.d.mts +4 -1
- package/dist/model/customxml/opendope.mjs +9 -6
- package/dist/model/customxml/picturePlaceholder.d.mts +17 -0
- package/dist/model/customxml/picturePlaceholder.mjs +32 -0
- package/dist/model/customxml/pictures.d.mts +4 -3
- package/dist/model/customxml/pictures.mjs +22 -8
- package/dist/model/customxml/storeItems.d.mts +57 -0
- package/dist/model/customxml/storeItems.mjs +122 -0
- package/dist/model/customxml/xhtml.mjs +23 -22
- package/dist/model/dateZone.d.mts +25 -0
- package/dist/model/dateZone.mjs +57 -0
- package/dist/model/index.d.mts +3 -0
- package/dist/model/index.mjs +5 -0
- package/dist/model/listnumbering/Emulator.d.mts +37 -5
- package/dist/model/listnumbering/Emulator.mjs +63 -9
- package/dist/model/properties/PropertyResolver.d.mts +74 -2
- package/dist/model/properties/PropertyResolver.mjs +133 -5
- package/dist/model/properties/catalogue.d.mts +19 -5
- package/dist/model/properties/catalogue.mjs +41 -15
- package/dist/model/properties/index.d.mts +1 -1
- package/dist/model/properties/log.d.mts +1 -1
- package/dist/model/properties/log.mjs +5 -5
- package/dist/model/properties/styleUtil.d.mts +3 -1
- package/dist/model/properties/styleUtil.mjs +20 -24
- package/dist/model/properties/table.mjs +4 -2
- package/dist/model/text/CaseMapping.d.mts +38 -0
- package/dist/model/text/CaseMapping.mjs +86 -0
- package/dist/model/text/Extractor.d.mts +349 -0
- package/dist/model/text/Extractor.mjs +2406 -0
- package/dist/model/text/LinkTargets.d.mts +45 -0
- package/dist/model/text/LinkTargets.mjs +170 -0
- package/dist/model/text/MarkdownExporter.d.mts +140 -0
- package/dist/model/text/MarkdownExporter.mjs +255 -0
- package/dist/model/text/PlainText.d.mts +29 -0
- package/dist/model/text/PlainText.mjs +542 -0
- package/dist/model/text/TextContext.d.mts +256 -0
- package/dist/model/text/TextContext.mjs +600 -0
- package/dist/model/text/TextOptions.d.mts +233 -0
- package/dist/model/text/TextOptions.mjs +419 -0
- package/dist/model/text/TextResult.d.mts +621 -0
- package/dist/model/text/TextResult.mjs +629 -0
- package/dist/model/text/Texts.d.mts +99 -0
- package/dist/model/text/Texts.mjs +187 -0
- package/dist/model/text/WmlToMarkdown.d.mts +120 -0
- package/dist/model/text/WmlToMarkdown.mjs +936 -0
- package/dist/model/text/caseMapping.generated.d.mts +7 -0
- package/dist/model/text/caseMapping.generated.mjs +214 -0
- package/dist/model/text/commonmark.d.mts +121 -0
- package/dist/model/text/commonmark.mjs +655 -0
- package/dist/model/text/index.d.mts +8 -0
- package/dist/model/text/index.mjs +9 -0
- package/dist/model/text/normalize.d.mts +8 -0
- package/dist/model/text/normalize.mjs +13 -0
- package/dist/model/text/outline.d.mts +4 -0
- package/dist/model/text/outline.mjs +71 -0
- package/dist/model/wordIntegers.d.mts +29 -0
- package/dist/model/wordIntegers.mjs +78 -0
- package/dist/office-js/document.mjs +15 -1
- package/dist/office-js/fragment.d.mts +7 -5
- package/dist/office-js/fragment.mjs +63 -14
- package/dist/office-js/proxy.d.mts +8 -0
- package/dist/office-js/proxy.mjs +29 -0
- package/dist/office-js/run.mjs +2 -0
- package/dist/office-js/supported.generated.mjs +16 -0
- package/dist/office-js/toApiScript.mjs +29 -12
- package/dist/opc/DirectoryPartStore.d.mts +6 -2
- package/dist/opc/DirectoryPartStore.mjs +11 -4
- package/dist/opc/FlatOpcPartStore.d.mts +4 -2
- package/dist/opc/FlatOpcPartStore.mjs +11 -8
- package/dist/opc/Load.d.mts +32 -0
- package/dist/opc/Load.mjs +115 -5
- package/dist/opc/PartStore.d.mts +34 -1
- package/dist/opc/PartStore.mjs +71 -8
- package/dist/opc/Save.d.mts +32 -0
- package/dist/opc/Save.mjs +110 -4
- package/dist/opc/ZipPartStore.d.mts +4 -2
- package/dist/opc/ZipPartStore.mjs +12 -7
- package/dist/opc/exceptions.d.mts +140 -0
- package/dist/opc/exceptions.mjs +108 -0
- package/dist/opc/index.d.mts +8 -5
- package/dist/opc/index.mjs +5 -3
- package/dist/opc/mce/preprocessor.d.mts +141 -5
- package/dist/opc/mce/preprocessor.mjs +119 -18
- package/dist/opc/mce/understood.d.mts +3 -11
- package/dist/opc/mce/understood.mjs +27 -23
- package/dist/opc/repair/breaks.d.mts +23 -0
- package/dist/opc/repair/breaks.mjs +288 -0
- package/dist/opc/repair/hosts.d.mts +12 -0
- package/dist/opc/repair/hosts.mjs +33 -0
- package/dist/opc/repair/mainRoot.d.mts +19 -0
- package/dist/opc/repair/mainRoot.mjs +168 -0
- package/dist/opc/repair/unknownElements.d.mts +8 -0
- package/dist/opc/repair/unknownElements.mjs +180 -0
- package/dist/opc/repair/wmlNames.generated.d.mts +2 -0
- package/dist/opc/repair/wmlNames.generated.mjs +80 -0
- package/dist/opc/skipped.d.mts +50 -0
- package/dist/opc/skipped.mjs +140 -0
- package/dist/packages/OpcPackage.d.mts +110 -4
- package/dist/packages/OpcPackage.mjs +123 -7
- package/dist/packages/WordprocessingMLPackage.d.mts +45 -8
- package/dist/packages/WordprocessingMLPackage.mjs +158 -21
- package/dist/packages/index.d.mts +1 -1
- package/dist/parts/DefaultXmlPart.mjs +2 -2
- package/dist/parts/Part.d.mts +14 -2
- package/dist/parts/RelationshipsPart.d.mts +15 -0
- package/dist/parts/RelationshipsPart.mjs +66 -1
- package/dist/parts/XmlPart.d.mts +63 -32
- package/dist/parts/XmlPart.mjs +240 -96
- package/dist/parts/wml/comments.mjs +30 -0
- package/dist/parts/wml/index.d.mts +12 -1
- package/dist/parts/wml/index.mjs +37 -1
- package/dist/xml/dom.d.mts +7 -0
- package/dist/xml/dom.mjs +18 -0
- package/package.json +2 -2
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type * as wml from '@docx4j/generated-objects-ts/modules/org_docx4j_wml';
|
|
2
|
+
import { type Element } from './tree.mjs';
|
|
3
|
+
import { type Body } from './Body.mjs';
|
|
4
|
+
/**
|
|
5
|
+
* What Word's Accept All or Reject All would leave of a document, as `acceptAllRevisions` and
|
|
6
|
+
* `rejectAllRevisions` leave it, worked out without resolving anything: the content each removes and the
|
|
7
|
+
* paragraphs each joins. A reader walks the unresolved tree and asks this view what is there, so that the
|
|
8
|
+
* text it reads in a view is the text of the resolved document (WD REQ-402), and the package is untouched
|
|
9
|
+
* (REQ-204). docx4j `org.docx4j.model.revisions.ResolvedView`.
|
|
10
|
+
*
|
|
11
|
+
* It lists each story's changes (`trackedChangesOfStory`, text boxes in their selected branch) and
|
|
12
|
+
* records, change by change, what the resolution would do to the text: a revision taken away, a move's
|
|
13
|
+
* halves and the text typed into a rejected move's destination, an inserted field rejected whole, a row
|
|
14
|
+
* or cell taken away, an equation's run-level revision or structure, a paragraph mark taken away, and an
|
|
15
|
+
* inserted content control rejected (its content left in its place). What a resolution does to
|
|
16
|
+
* properties, range markers, comments' entries and parts is not recorded; the comments a resolution takes
|
|
17
|
+
* whole are (CR-002 section 54).
|
|
18
|
+
*
|
|
19
|
+
* A snapshot over the trees it was made from: valid until they change.
|
|
20
|
+
*/
|
|
21
|
+
export declare class ResolvedView {
|
|
22
|
+
readonly accepted: boolean;
|
|
23
|
+
/** List members gone, by identity of their values. */
|
|
24
|
+
private readonly removed;
|
|
25
|
+
/** Content controls and custom XML elements gone, their content standing in their place. */
|
|
26
|
+
private readonly unwrapped;
|
|
27
|
+
/** Paragraphs whose mark is gone. */
|
|
28
|
+
private readonly marksGone;
|
|
29
|
+
/** Moved paragraphs whose mark is gone: gone themselves when nothing is left in them, else joined. */
|
|
30
|
+
private readonly movedMarksGone;
|
|
31
|
+
private readonly commentCandidates;
|
|
32
|
+
private readonly spanCandidates;
|
|
33
|
+
private readonly commentsGone;
|
|
34
|
+
/** Move halves whose story has no piece for them (a text box's, whose paragraphs' story is the body around it). */
|
|
35
|
+
private readonly unreplayed;
|
|
36
|
+
private constructor();
|
|
37
|
+
/** The document after Accept All, over these stories (each a `Body` over the tree a reader walks). */
|
|
38
|
+
static accepted(stories: readonly Body[]): ResolvedView;
|
|
39
|
+
/** The document after Reject All. */
|
|
40
|
+
static original(stories: readonly Body[]): ResolvedView;
|
|
41
|
+
private collectMoves;
|
|
42
|
+
/**
|
|
43
|
+
* Whether a list member is gone in this view: a run-level revision taken away with its content, a run,
|
|
44
|
+
* a row, a cell, a paragraph, an equation's run-level revision or structure. A revision that is not
|
|
45
|
+
* gone is kept: its content is read as if it were not there. An element pair and its value alike.
|
|
46
|
+
*/
|
|
47
|
+
removes(item: unknown): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The table a paragraph with text left joins into, where its mark is gone and a table is the next block in its list
|
|
50
|
+
* (Word 365's Accept All, docx4j CR-043 section 17, the text-left probe's case 1: its content lands at the front of the
|
|
51
|
+
* first cell's first paragraph, which keeps its own properties); undefined otherwise. docx4j `joinsIntoTable`.
|
|
52
|
+
*/
|
|
53
|
+
joinsIntoTable(p: wml.P): wml.Tbl | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* A paragraph's properties in this view, where its mark is gone and no paragraph follows it in its list (Word 365's
|
|
56
|
+
* Accept All, check 54; docx4j CR-043 section 17): a block control next gives it the control's first paragraph's
|
|
57
|
+
* properties, as a join would have (case 19); a control's last paragraph keeps a bare mark, its properties gone, its
|
|
58
|
+
* text left or not (case 13, the text-left probe's case 2); otherwise its own. docx4j `paragraphPropertiesOf`.
|
|
59
|
+
*/
|
|
60
|
+
paragraphPropertiesOf(p: wml.P): wml.PPr | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* A table whose every row this view removes is gone with them, as the resolution removes an emptied table
|
|
63
|
+
* (check 54 case 6: a deletion from a heading across a whole table joins the heading with the paragraph after it).
|
|
64
|
+
*/
|
|
65
|
+
private emptiedTable;
|
|
66
|
+
/** The block after `p` in its list, past range markers and what this view removes; undefined at the end. */
|
|
67
|
+
private nextBlockAfter;
|
|
68
|
+
private nextBlock;
|
|
69
|
+
/** Whether a content control or custom XML element is gone with its content left in its place (one inserted, rejected). */
|
|
70
|
+
unwraps(item: unknown): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether a paragraph's mark is gone in this view: a deletion accepted, an insertion rejected, a move's
|
|
73
|
+
* mark on the side not kept. Such a paragraph joins the next one in its list, past range markers and
|
|
74
|
+
* what this view removes, when that is a paragraph; with no paragraph next only the mark goes.
|
|
75
|
+
*/
|
|
76
|
+
removesMark(p: wml.P | undefined): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether a comment goes in this view, entry and reference: one whose range started on a revision taken
|
|
79
|
+
* away, or whose markers lie either side of one, once nothing with text is left in its range (CR-002
|
|
80
|
+
* section 54).
|
|
81
|
+
*/
|
|
82
|
+
removesComment(id: unknown): boolean;
|
|
83
|
+
private plan;
|
|
84
|
+
/**
|
|
85
|
+
* `removeRevision`: the revision goes, and the comments whose range started on it, or whose markers
|
|
86
|
+
* lie either side of it in its list, are candidates; so is one with a marker in its list on the
|
|
87
|
+
* revision's side and the other in another paragraph (docx4j's U23).
|
|
88
|
+
*/
|
|
89
|
+
removeRevision(item: Element, owner: Element[]): void;
|
|
90
|
+
/** Records a list member gone (a move's half, the text typed into a rejected move's destination). */
|
|
91
|
+
remove(value: unknown): void;
|
|
92
|
+
/** Records a paragraph mark gone. */
|
|
93
|
+
markGone(p: wml.P): void;
|
|
94
|
+
/** Records a moved paragraph's mark gone. */
|
|
95
|
+
movedMarkGone(p: wml.P): void;
|
|
96
|
+
/** Whether run-level content has text in this view, once its removals are made. */
|
|
97
|
+
hasText(item: unknown): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Whether anything is left in a paragraph once this view's removals are made: the resolution removes
|
|
100
|
+
* an emptied moved paragraph and joins one that is not. A comment's range markers inside a revision
|
|
101
|
+
* taken away stay behind it.
|
|
102
|
+
*/
|
|
103
|
+
private remainsIn;
|
|
104
|
+
}
|