oasis-editor 0.0.167 → 0.0.169

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.
@@ -6,7 +6,7 @@
6
6
  * statements that pointed there continue to work via the barrel
7
7
  * re-export in `src/core/model.ts`.
8
8
  */
9
- export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageCropShape, EditorImageCropFit, EditorImageFillMode, EditorLineDash, EditorImageBorder, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, EditorRevision, EditorRevisionMetadata, EditorStructuralRevision, EditorPropertyRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, EditorGradientStop, EditorTextFill, EditorTextOutline, EditorTextShadow, EditorGlow, EditorReflection, } from './types/primitives.js';
9
+ export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageCropShape, EditorImageCropFit, EditorImageFillMode, EditorLineDash, EditorImageBorder, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, EditorRevision, EditorRevisionMetadata, EditorNumberingRevision, EditorStructuralRevision, EditorPropertyRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, EditorGradientStop, EditorTextFill, EditorTextOutline, EditorTextShadow, EditorGlow, EditorReflection, } from './types/primitives.js';
10
10
  export type { EditorTextStyle, EditorParagraphStyle, EditorTableStyle, EditorTableFloatingLayout, EditorTableConditionalFormat, EditorConditionalRowStyle, EditorTableConditionalType, EditorTableConditionalFlags, EditorTableCellStyle, EditorNamedStyle, } from './types/styles.js';
11
11
  export type { EditorRunBase, EditorTextRun, EditorTextBoxShape, EditorTextBoxBody, EditorTextBoxData, EditorDropCap, EditorSdtBlockWrapper, EditorSdtPr, EditorSdtSubtype, EditorSdtListItem, EditorSdtDataBinding, EditorParagraphNode, EditorTableCellNode, EditorTableRowStyle, EditorTableRowNode, EditorTableNode, EditorBlockNode, } from './types/nodes.js';
12
12
  export type { EditorMathNode, EditorMathText, EditorMathFraction, EditorMathRadical, EditorMathScript, EditorMathDelimiter, EditorMathAccent, EditorMathNary, EditorMathLimit, EditorMathMatrix, EditorMathBox, EditorMathGroup, EditorMathRaw, EditorMathStyle, EditorMathExpression, } from './types/math.js';
@@ -18,7 +18,7 @@ export type { EditorEndnote } from './types/documentEndnotes.js';
18
18
  export type { EditorBookmark, EditorBookmarkAnchor, EditorBookmarks, } from './types/documentBookmarks.js';
19
19
  export type { EditorComment, EditorCommentAnchor, EditorComments, } from './types/documentComments.js';
20
20
  export type { EditorOpcPartKind, EditorOpcPartEncoding, EditorOpcRelationship, EditorOpcContentTypes, EditorOpcPart, EditorDocxDiagnostic, EditorDocxSourcePackage, } from './types/docxSourcePackage.js';
21
- export type { EditorPageMargins, EditorPageSettings, EditorColumnsSettings, EditorSection, EditorPageNumbering, EditorSectionVerticalAlign, EditorFontInfo, EditorFootnoteSettings, EditorFootnotes, EditorEndnoteSettings, EditorEndnotes, EditorDocumentDesign, EditorThemeData, EditorWatermark, EditorPageBorder, EditorDocument, } from './types/document.js';
21
+ export type { EditorPageMargins, EditorPageSettings, EditorColumnsSettings, EditorSection, EditorSectionBreakType, EditorSectionPropertiesSnapshot, EditorPageNumbering, EditorSectionVerticalAlign, EditorFontInfo, EditorFootnoteSettings, EditorFootnotes, EditorEndnoteSettings, EditorEndnotes, EditorDocumentDesign, EditorThemeData, EditorWatermark, EditorPageBorder, EditorDocument, } from './types/document.js';
22
22
  export type { EditorPosition, EditorSelection, EditorEditingZone, } from './types/selection.js';
23
23
  export type { EditorCaretSlot, EditorLayoutFragmentChar, EditorLayoutFragment, EditorLayoutLine, EditorLayoutParagraph, EditorLayoutBlock, TableCellBlockPosition, EditorLayoutPage, EditorLayoutDocument, } from './types/layout.js';
24
24
  export type { EditorState } from './editorState.js';
@@ -1,4 +1,4 @@
1
- import { EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart } from './primitives.js';
1
+ import { EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorPropertyRevision } from './primitives.js';
2
2
  import { EditorBlockNode } from './nodes.js';
3
3
  import { EditorFootnote } from './documentFootnotes.js';
4
4
  import { EditorEndnote } from './documentEndnotes.js';
@@ -105,6 +105,17 @@ export interface EditorPageNumbering {
105
105
  * `top` is the Word default and is omitted on export.
106
106
  */
107
107
  export type EditorSectionVerticalAlign = "top" | "center" | "both" | "bottom";
108
+ export type EditorSectionBreakType = "nextPage" | "continuous" | "evenPage" | "oddPage" | "nextColumn";
109
+ /** Previous semantic section properties stored by `w:sectPrChange`. */
110
+ export interface EditorSectionPropertiesSnapshot {
111
+ pageSettings: EditorPageSettings;
112
+ pageBorder?: EditorPageBorder | null;
113
+ pageNumbering?: EditorPageNumbering;
114
+ verticalAlignment?: EditorSectionVerticalAlign;
115
+ bidi?: boolean;
116
+ /** Previous `w:type`; semantically this controls how the following section begins. */
117
+ nextBreakType?: EditorSectionBreakType;
118
+ }
108
119
  export interface EditorSection {
109
120
  id: string;
110
121
  blocks: EditorBlockNode[];
@@ -124,13 +135,15 @@ export interface EditorSection {
124
135
  * is omitted on export. Only `continuous` currently affects layout rendering;
125
136
  * `evenPage`/`oddPage`/`nextColumn` are preserved for round-trip.
126
137
  */
127
- breakType?: "nextPage" | "continuous" | "evenPage" | "oddPage" | "nextColumn";
138
+ breakType?: EditorSectionBreakType;
128
139
  /** `w:pgNumType` — page numbering format/start/chapter. Round-trip only. */
129
140
  pageNumbering?: EditorPageNumbering;
130
141
  /** `w:vAlign` — vertical justification of page contents. Round-trip only. */
131
142
  verticalAlignment?: EditorSectionVerticalAlign;
132
143
  /** `w:bidi` — right-to-left section layout. Round-trip only. */
133
144
  bidi?: boolean;
145
+ /** Previous section-property snapshot from `w:sectPrChange`. */
146
+ propertyRevision?: EditorPropertyRevision<EditorSectionPropertiesSnapshot>;
134
147
  }
135
148
  /**
136
149
  * One `w:font` entry from `word/fontTable.xml`: the document's declaration of a
@@ -1,4 +1,4 @@
1
- import { EditorDocxWidthValue, EditorEndnoteReferenceData, EditorFieldChar, EditorFieldData, EditorFootnoteReferenceData, EditorImageFloatingLayout, EditorImageRunData, EditorParagraphListStyle, EditorRevision, EditorPropertyRevision, EditorStructuralRevision, EditorTableRowHeightRule } from './primitives.js';
1
+ import { EditorDocxWidthValue, EditorEndnoteReferenceData, EditorFieldChar, EditorFieldData, EditorFootnoteReferenceData, EditorImageFloatingLayout, EditorImageRunData, EditorParagraphListStyle, EditorNumberingRevision, EditorRevision, EditorPropertyRevision, EditorStructuralRevision, EditorTableRowHeightRule } from './primitives.js';
2
2
  import { EditorMathExpression } from './math.js';
3
3
  import { EditorParagraphStyle, EditorTableCellStyle, EditorTableStyle, EditorTableConditionalFlags, EditorTextStyle } from './styles.js';
4
4
 
@@ -287,6 +287,8 @@ export interface EditorParagraphNode {
287
287
  runs: EditorTextRun[];
288
288
  style?: EditorParagraphStyle;
289
289
  list?: EditorParagraphListStyle;
290
+ /** Tracked previous numbering metadata from `w:numPr/w:numberingChange`. */
291
+ numberingRevision?: EditorNumberingRevision;
290
292
  /** Drop cap that body text in this paragraph wraps around, when present. */
291
293
  dropCap?: EditorDropCap;
292
294
  /** Enclosing block-level `w:sdt` content controls, preserved for round-trip. */
@@ -225,6 +225,10 @@ export interface EditorRevisionMetadata {
225
225
  author: string;
226
226
  date: number;
227
227
  }
228
+ /** Previous paragraph numbering cache from `w:numberingChange`. */
229
+ export interface EditorNumberingRevision extends EditorRevisionMetadata {
230
+ original?: string;
231
+ }
228
232
  export interface EditorStructuralRevision extends EditorRevisionMetadata {
229
233
  type: "insert" | "delete" | "merge";
230
234
  previous?: {
@@ -1,5 +1,5 @@
1
1
  import { Element as XmlElement } from '@xmldom/xmldom';
2
- import { EditorParagraphListStyle } from '../../core/model.js';
2
+ import { EditorNumberingRevision, EditorParagraphListStyle } from '../../core/model.js';
3
3
 
4
4
  type ListFormat = NonNullable<EditorParagraphListStyle["format"]>;
5
5
  interface NumberingLevel {
@@ -28,6 +28,7 @@ export interface NumberingMaps {
28
28
  seenInstances: Set<string>;
29
29
  }
30
30
  export declare function parseNumbering(numberingXml: string | null): NumberingMaps;
31
+ export declare function parseParagraphNumberingRevision(paragraphProperties: XmlElement | null): EditorNumberingRevision | undefined;
31
32
  export declare function parseParagraphList(paragraphProperties: XmlElement | null, numberingMaps: NumberingMaps): {
32
33
  list: EditorParagraphListStyle;
33
34
  indent?: NumberingLevel["indent"];
@@ -1,5 +1,5 @@
1
1
  import { Element as XmlElement } from '@xmldom/xmldom';
2
- import { EditorBlockNode, EditorNamedStyle, EditorPageNumbering, EditorPageSettings, EditorPageBorder, EditorParagraphNode, EditorSectionVerticalAlign } from '../../core/model.js';
2
+ import { EditorBlockNode, EditorNamedStyle, EditorPageNumbering, EditorPageSettings, EditorPageBorder, EditorParagraphNode, EditorSectionVerticalAlign, EditorSectionPropertiesSnapshot, EditorPropertyRevision } from '../../core/model.js';
3
3
  import { DocxSettings } from './settings.js';
4
4
 
5
5
  export interface SectionProperties {
@@ -22,6 +22,7 @@ export interface SectionProperties {
22
22
  verticalAlignment?: EditorSectionVerticalAlign;
23
23
  /** `w:bidi` — right-to-left section layout. Round-trip only. */
24
24
  bidi?: boolean;
25
+ propertyRevision?: EditorPropertyRevision<EditorSectionPropertiesSnapshot>;
25
26
  }
26
27
  export declare function parseSectionProperties(sectPr: XmlElement): SectionProperties;
27
28
  export declare function parsePageSettings(body: XmlElement | undefined): EditorPageSettings | undefined;
@@ -2863,7 +2863,7 @@ function OasisEditorAppLazy(props = {}) {
2863
2863
  onCleanup(() => {
2864
2864
  cancelled = true;
2865
2865
  });
2866
- import("./OasisEditorApp-C1GkmD_B.js").then((m) => {
2866
+ import("./OasisEditorApp-Dit2WRPL.js").then((m) => {
2867
2867
  cancelled = true;
2868
2868
  setProgress(1);
2869
2869
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -36601,6 +36601,16 @@ function getEffectiveEditorListOoxmlFormat(list) {
36601
36601
  }
36602
36602
  return metadata.format;
36603
36603
  }
36604
+ function parseRevisionMetadata$1(element) {
36605
+ if (!element) return void 0;
36606
+ const id = getAttributeValue(element, "id");
36607
+ const author = getAttributeValue(element, "author");
36608
+ const rawDate = getAttributeValue(element, "date");
36609
+ if (!id || !author || !rawDate) return void 0;
36610
+ const date = Date.parse(rawDate);
36611
+ if (!Number.isFinite(date)) return void 0;
36612
+ return { id, author, date };
36613
+ }
36604
36614
  const FORMAT_MAP = {
36605
36615
  decimal: "decimal",
36606
36616
  lowerLetter: "lowerLetter",
@@ -36756,6 +36766,18 @@ function effectiveLevel(numberingMaps, numId, ilvl) {
36756
36766
  const override = numberingMaps.numOverrideLevels.get(`${numId}:${ilvl}`);
36757
36767
  return override ?? base ?? {};
36758
36768
  }
36769
+ function parseParagraphNumberingRevision(paragraphProperties) {
36770
+ if (!paragraphProperties) return void 0;
36771
+ const numPr = getFirstChildByTagNameNS(paragraphProperties, WORD_NS$3, "numPr");
36772
+ const change = getFirstChildByTagNameNS(numPr, WORD_NS$3, "numberingChange");
36773
+ const metadata = parseRevisionMetadata$1(change);
36774
+ if (!metadata) return void 0;
36775
+ const original = getAttributeValue(change, "original") ?? void 0;
36776
+ return {
36777
+ ...metadata,
36778
+ ...original !== void 0 ? { original } : {}
36779
+ };
36780
+ }
36759
36781
  function parseParagraphList(paragraphProperties, numberingMaps) {
36760
36782
  if (!paragraphProperties) return void 0;
36761
36783
  const numPr = getFirstChildByTagNameNS(paragraphProperties, WORD_NS$3, "numPr");
@@ -36897,16 +36919,6 @@ function parseShdFill(element, colors) {
36897
36919
  if (colors) return resolveThemeColor(element, colors);
36898
36920
  return void 0;
36899
36921
  }
36900
- function parseRevisionMetadata$1(element) {
36901
- if (!element) return void 0;
36902
- const id = getAttributeValue(element, "id");
36903
- const author = getAttributeValue(element, "author");
36904
- const rawDate = getAttributeValue(element, "date");
36905
- if (!id || !author || !rawDate) return void 0;
36906
- const date = Date.parse(rawDate);
36907
- if (!Number.isFinite(date)) return void 0;
36908
- return { id, author, date };
36909
- }
36910
36922
  function parseW14SolidFillColor(solidFillEl) {
36911
36923
  const srgbClr = getFirstChildByTagNameNS(solidFillEl, WORD14_NS$1, "srgbClr");
36912
36924
  if (!srgbClr) return null;
@@ -38582,6 +38594,30 @@ function parseFontTable(xml) {
38582
38594
  }
38583
38595
  return fonts.length > 0 ? fonts : void 0;
38584
38596
  }
38597
+ const DEFAULT_SECTION_PAGE_SETTINGS = {
38598
+ width: 816,
38599
+ height: 1056,
38600
+ orientation: "portrait",
38601
+ margins: {
38602
+ top: 96,
38603
+ right: 96,
38604
+ bottom: 96,
38605
+ left: 96,
38606
+ header: 48,
38607
+ footer: 48,
38608
+ gutter: 0
38609
+ }
38610
+ };
38611
+ function sectionPropertiesSnapshot(properties, fallbackPageSettings) {
38612
+ return {
38613
+ pageSettings: properties.pageSettings ?? fallbackPageSettings ?? DEFAULT_SECTION_PAGE_SETTINGS,
38614
+ ...properties.pageBorder ? { pageBorder: properties.pageBorder } : {},
38615
+ ...properties.pageNumbering ? { pageNumbering: properties.pageNumbering } : {},
38616
+ ...properties.verticalAlignment ? { verticalAlignment: properties.verticalAlignment } : {},
38617
+ ...properties.bidi !== void 0 ? { bidi: properties.bidi } : {},
38618
+ ...properties.breakType ? { nextBreakType: properties.breakType } : {}
38619
+ };
38620
+ }
38585
38621
  function isXmlTrue(value2) {
38586
38622
  return value2 === "1" || value2 === "true" || value2 === "on";
38587
38623
  }
@@ -38696,6 +38732,25 @@ function parseSectionProperties(sectPr) {
38696
38732
  const vAlignValue = getAttributeValue(vAlignElement, "val");
38697
38733
  const verticalAlignment = vAlignValue === "center" || vAlignValue === "both" || vAlignValue === "bottom" ? vAlignValue : void 0;
38698
38734
  const bidi = parseOnOffProperty(sectPr, "bidi");
38735
+ const propertyChange = getFirstChildByTagNameNS(
38736
+ sectPr,
38737
+ WORD_NS$3,
38738
+ "sectPrChange"
38739
+ );
38740
+ const revisionMetadata = parseRevisionMetadata$1(propertyChange);
38741
+ const previousSectPr = getFirstChildByTagNameNS(
38742
+ propertyChange,
38743
+ WORD_NS$3,
38744
+ "sectPr"
38745
+ );
38746
+ const propertyRevision = revisionMetadata && previousSectPr ? {
38747
+ ...revisionMetadata,
38748
+ type: "property",
38749
+ previous: sectionPropertiesSnapshot(
38750
+ parseSectionProperties(previousSectPr),
38751
+ pageSettings
38752
+ )
38753
+ } : void 0;
38699
38754
  return {
38700
38755
  pageSettings,
38701
38756
  ...pageBorder ? { pageBorder } : {},
@@ -38712,7 +38767,8 @@ function parseSectionProperties(sectPr) {
38712
38767
  breakType,
38713
38768
  pageNumbering,
38714
38769
  verticalAlignment,
38715
- bidi
38770
+ bidi,
38771
+ propertyRevision
38716
38772
  };
38717
38773
  }
38718
38774
  function parsePageSettings(body) {
@@ -40421,7 +40477,8 @@ function createEditorParagraphSemanticSignature(paragraph) {
40421
40477
  function createEditorParagraphPropertiesSignature(paragraph) {
40422
40478
  return stableSemanticString({
40423
40479
  style: paragraph.style,
40424
- list: paragraph.list
40480
+ list: paragraph.list,
40481
+ numberingRevision: paragraph.numberingRevision
40425
40482
  });
40426
40483
  }
40427
40484
  function setEditorParagraphOoxmlSource(paragraph, source) {
@@ -40721,7 +40778,7 @@ function importedRunToEditorRun(run) {
40721
40778
  }
40722
40779
  return withMarkers;
40723
40780
  }
40724
- function createImportedParagraph(runs, paragraphStyle, list, markRunStyle, source) {
40781
+ function createImportedParagraph(runs, paragraphStyle, list, numberingRevision, markRunStyle, source) {
40725
40782
  var _a2, _b2;
40726
40783
  const editorRuns = runs.length > 0 ? runs.map(importedRunToEditorRun) : [
40727
40784
  {
@@ -40744,6 +40801,7 @@ function createImportedParagraph(runs, paragraphStyle, list, markRunStyle, sourc
40744
40801
  );
40745
40802
  }
40746
40803
  paragraph.list = list ? { ...list } : void 0;
40804
+ paragraph.numberingRevision = numberingRevision ? { ...numberingRevision } : void 0;
40747
40805
  if (((_b2 = source == null ? void 0 : source.runXml) == null ? void 0 : _b2.length) === paragraph.runs.length) {
40748
40806
  for (let index = 0; index < paragraph.runs.length; index += 1) {
40749
40807
  setEditorRunOoxmlSource(paragraph.runs[index], source.runXml[index]);
@@ -40812,6 +40870,7 @@ async function parseParagraphNodes(paragraphNode, numberingMaps, zip, relsMap, a
40812
40870
  );
40813
40871
  const listResult = parseParagraphList(paragraphProperties, numberingMaps);
40814
40872
  const list = listResult == null ? void 0 : listResult.list;
40873
+ const numberingRevision = parseParagraphNumberingRevision(paragraphProperties);
40815
40874
  let styleWithListIndent = parsedStyle;
40816
40875
  if (listResult == null ? void 0 : listResult.indent) {
40817
40876
  const { left, hanging } = listResult.indent;
@@ -40842,6 +40901,7 @@ async function parseParagraphNodes(paragraphNode, numberingMaps, zip, relsMap, a
40842
40901
  runs,
40843
40902
  paragraphStyle,
40844
40903
  list,
40904
+ numberingRevision,
40845
40905
  markRunStyle,
40846
40906
  source
40847
40907
  )
@@ -40861,7 +40921,13 @@ async function parseParagraphNodes(paragraphNode, numberingMaps, zip, relsMap, a
40861
40921
  }
40862
40922
  const style2 = pendingPageBreakBefore ? { ...paragraphStyle ?? {}, pageBreakBefore: true } : paragraphStyle;
40863
40923
  paragraphs.push(
40864
- createImportedParagraph(segment, style2, list, markRunStyle)
40924
+ createImportedParagraph(
40925
+ segment,
40926
+ style2,
40927
+ list,
40928
+ numberingRevision,
40929
+ markRunStyle
40930
+ )
40865
40931
  );
40866
40932
  pendingPageBreakBefore = false;
40867
40933
  }
@@ -42009,6 +42075,15 @@ async function importDocxToEditorDocument(buffer, options = {}) {
42009
42075
  const pageNumbering = props.pageNumbering;
42010
42076
  const verticalAlignment = props.verticalAlignment;
42011
42077
  const bidi = props.bidi;
42078
+ const propertyRevision = props.propertyRevision ? {
42079
+ ...props.propertyRevision,
42080
+ previous: {
42081
+ ...props.propertyRevision.previous,
42082
+ pageSettings: normalizePageSettings(
42083
+ props.propertyRevision.previous.pageSettings
42084
+ )
42085
+ }
42086
+ } : void 0;
42012
42087
  sections.push({
42013
42088
  id: `section:${i + 1}`,
42014
42089
  blocks: blocks.length > 0 ? blocks : [createEditorParagraphFromRuns([{ text: "" }])],
@@ -42023,7 +42098,8 @@ async function importDocxToEditorDocument(buffer, options = {}) {
42023
42098
  ...breakType ? { breakType } : {},
42024
42099
  ...pageNumbering ? { pageNumbering } : {},
42025
42100
  ...verticalAlignment ? { verticalAlignment } : {},
42026
- ...bidi ? { bidi } : {}
42101
+ ...bidi ? { bidi } : {},
42102
+ ...propertyRevision ? { propertyRevision } : {}
42027
42103
  });
42028
42104
  }
42029
42105
  const footnotesXml = await ((_l = zip.file("word/footnotes.xml")) == null ? void 0 : _l.async("string")) ?? null;
@@ -44435,10 +44511,12 @@ function serializeParagraphProperties(paragraph, numberingInfo, styles, override
44435
44511
  }
44436
44512
  parts.push(...serializeParagraphDecorations(style2));
44437
44513
  const numbering = numberingInfo.get(paragraph.id);
44438
- if (numbering) {
44439
- parts.push(
44440
- `<w:numPr><w:ilvl w:val="${numbering.level}"/><w:numId w:val="${numbering.numId}"/></w:numPr>`
44441
- );
44514
+ const numberingChange = paragraph.numberingRevision ? `<w:numberingChange ${serializeRevisionMetadataAttributes(
44515
+ paragraph.numberingRevision
44516
+ )}${paragraph.numberingRevision.original !== void 0 ? ` w:original="${escapeXml(paragraph.numberingRevision.original)}"` : ""}/>` : "";
44517
+ if (numbering || numberingChange) {
44518
+ const currentNumbering = numbering ? `<w:ilvl w:val="${numbering.level}"/><w:numId w:val="${numbering.numId}"/>` : "";
44519
+ parts.push(`<w:numPr>${currentNumbering}${numberingChange}</w:numPr>`);
44442
44520
  }
44443
44521
  if ((_c = paragraph.style) == null ? void 0 : _c.propertyRevision) {
44444
44522
  parts.push(
@@ -46751,6 +46829,17 @@ function buildNumberingXml(definitions) {
46751
46829
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:numbering xmlns:w="${WORD_NS$1}">${abstractNums}${nums}</w:numbering>`;
46752
46830
  }
46753
46831
  const DOCUMENT_XMLNS = `xmlns:w="${WORD_NS$1}" xmlns:w14="${WORD14_NS}" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:r="${OFFICE_REL_NS}"`;
46832
+ function sectionFromSnapshot(snapshot) {
46833
+ return {
46834
+ id: "section:revision",
46835
+ blocks: [],
46836
+ pageSettings: snapshot.pageSettings,
46837
+ ...snapshot.pageBorder !== void 0 ? { pageBorder: snapshot.pageBorder } : {},
46838
+ ...snapshot.pageNumbering ? { pageNumbering: snapshot.pageNumbering } : {},
46839
+ ...snapshot.verticalAlignment ? { verticalAlignment: snapshot.verticalAlignment } : {},
46840
+ ...snapshot.bidi !== void 0 ? { bidi: snapshot.bidi } : {}
46841
+ };
46842
+ }
46754
46843
  function serializeSectionPropertiesWithReferences(pageSettings, references, section, nextBreakType) {
46755
46844
  var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
46756
46845
  const width = pxToTwips(pageSettings.width, 12240);
@@ -46800,7 +46889,13 @@ function serializeSectionPropertiesWithReferences(pageSettings, references, sect
46800
46889
  const border = section.pageBorder;
46801
46890
  const borderColor = border == null ? void 0 : border.color.replace("#", "").toUpperCase();
46802
46891
  const borderXml = border ? `<w:pgBorders w:offsetFrom="page"><w:top w:val="${border.style}" w:sz="${Math.max(1, Math.round(border.width * 8))}" w:space="${Math.max(0, Math.round(border.distance ?? 0))}" w:color="${borderColor}"/><w:left w:val="${border.style}" w:sz="${Math.max(1, Math.round(border.width * 8))}" w:space="${Math.max(0, Math.round(border.distance ?? 0))}" w:color="${borderColor}"/><w:bottom w:val="${border.style}" w:sz="${Math.max(1, Math.round(border.width * 8))}" w:space="${Math.max(0, Math.round(border.distance ?? 0))}" w:color="${borderColor}"/><w:right w:val="${border.style}" w:sz="${Math.max(1, Math.round(border.width * 8))}" w:space="${Math.max(0, Math.round(border.distance ?? 0))}" w:color="${borderColor}"/></w:pgBorders>` : "";
46803
- return `<w:sectPr>${referencesXml}${titlePageXml}${typeXml}<w:pgSz w:w="${width}" w:h="${height}"${orientationAttr}/><w:pgMar w:top="${pxToTwips(margins.top, 1440)}" w:right="${pxToTwips(margins.right, 1440)}" w:bottom="${pxToTwips(margins.bottom, 1440)}" w:left="${pxToTwips(margins.left, 1440)}" w:header="${pxToTwips(margins.header, 720)}" w:footer="${pxToTwips(margins.footer, 720)}" w:gutter="${pxToTwips(margins.gutter, 0)}"/>${pgNumTypeXml}${columnsXml}${vAlignXml}${bidiXml}${borderXml}</w:sectPr>`;
46892
+ const propertyRevisionXml = section.propertyRevision ? `<w:sectPrChange ${serializeRevisionMetadataAttributes(section.propertyRevision)}>${serializeSectionPropertiesWithReferences(
46893
+ section.propertyRevision.previous.pageSettings,
46894
+ void 0,
46895
+ sectionFromSnapshot(section.propertyRevision.previous),
46896
+ section.propertyRevision.previous.nextBreakType
46897
+ )}</w:sectPrChange>` : "";
46898
+ return `<w:sectPr>${referencesXml}${titlePageXml}${typeXml}<w:pgSz w:w="${width}" w:h="${height}"${orientationAttr}/><w:pgMar w:top="${pxToTwips(margins.top, 1440)}" w:right="${pxToTwips(margins.right, 1440)}" w:bottom="${pxToTwips(margins.bottom, 1440)}" w:left="${pxToTwips(margins.left, 1440)}" w:header="${pxToTwips(margins.header, 720)}" w:footer="${pxToTwips(margins.footer, 720)}" w:gutter="${pxToTwips(margins.gutter, 0)}"/>${pgNumTypeXml}${columnsXml}${vAlignXml}${bidiXml}${borderXml}${propertyRevisionXml}</w:sectPr>`;
46804
46899
  }
46805
46900
  function buildDocumentXml(document2, context2, sectionReferences) {
46806
46901
  var _a2, _b2;
@@ -46957,7 +47052,8 @@ function cloneParagraph(paragraph) {
46957
47052
  ...paragraph,
46958
47053
  runs: paragraph.runs.map(cloneRun),
46959
47054
  style: cloneParagraphStyle(paragraph.style),
46960
- list: paragraph.list ? { ...paragraph.list } : void 0
47055
+ list: paragraph.list ? { ...paragraph.list } : void 0,
47056
+ numberingRevision: paragraph.numberingRevision ? { ...paragraph.numberingRevision } : void 0
46961
47057
  };
46962
47058
  }
46963
47059
  function cloneParagraphList(list) {
@@ -47893,7 +47989,7 @@ async function importDocxInWorker(buffer, options = {}) {
47893
47989
  const worker = new Worker(
47894
47990
  new URL(
47895
47991
  /* @vite-ignore */
47896
- "" + new URL("assets/importDocxWorker-C5IkKe2t.js", import.meta.url).href,
47992
+ "" + new URL("assets/importDocxWorker-BPMw_A0Z.js", import.meta.url).href,
47897
47993
  import.meta.url
47898
47994
  ),
47899
47995
  {
@@ -1,4 +1,4 @@
1
- import { dK, ah, aw, aM, aG, dL, dM, dN, aA, dO, ai, dP, dt, aN, dQ, dR, aL, aD, dS, dT, dU, ag, dV, dr, aP, dW, dX, dY, dZ, d_, dF, d$, e0, e1, aU, aT, e2, aE, e3, e4, e5, e6, e7, e8, aI, aF, e9, b3, aO, b2, aV, az, aK, dE, ea, dL as dL2, dS as dS2, dV as dV2, e2 as e22, e3 as e32, e8 as e82, eb, ec, dv, dq, ed, ee, ef, eg, eh, ei, ej, ds, ek, el, em, du, en } from "./index-BvpHK9s2.js";
1
+ import { dK, ah, aw, aM, aG, dL, dM, dN, aA, dO, ai, dP, dt, aN, dQ, dR, aL, aD, dS, dT, dU, ag, dV, dr, aP, dW, dX, dY, dZ, d_, dF, d$, e0, e1, aU, aT, e2, aE, e3, e4, e5, e6, e7, e8, aI, aF, e9, b3, aO, b2, aV, az, aK, dE, ea, dL as dL2, dS as dS2, dV as dV2, e2 as e22, e3 as e32, e8 as e82, eb, ec, dv, dq, ed, ee, ef, eg, eh, ei, ej, ds, ek, el, em, du, en } from "./index-CcenIM2p.js";
2
2
  export {
3
3
  dK as ActionRow,
4
4
  ah as BalloonShell,