Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
273d531
fix(layout-engine): use section-aware page number for odd/even header…
luccas-harbour May 11, 2026
0afd1dc
fix(layout-bridge): handle negative odd header parity
luccas-harbour May 11, 2026
d5654de
fix(layout-resolved): expose header footer display numbers
luccas-harbour May 11, 2026
993efda
test(super-editor): cover header footer display parity
luccas-harbour May 11, 2026
a23cd0d
fix(layout-bridge): allow section parity override
luccas-harbour May 11, 2026
332e3f1
feat(super-editor): honor PAGE/NUMPAGES field format switches
luccas-harbour May 11, 2026
f4b988e
fix(super-editor): format NUMPAGES cached exports
luccas-harbour May 11, 2026
e2f51cc
fix(super-editor): pass display number to rId header layouts
luccas-harbour May 11, 2026
cbe45e9
fix(layout-bridge): avoid bucketing formatted page tokens
luccas-harbour May 11, 2026
afd1cb4
fix(super-editor): preserve field-run page number styling
luccas-harbour May 11, 2026
e5c5e3f
fix(contracts): centralize page number formatting
luccas-harbour May 12, 2026
29f2363
refactor(pm-adapter): share page field format extraction
luccas-harbour May 12, 2026
0db3bc1
fix(super-editor): pass page field options explicitly
luccas-harbour May 12, 2026
aa89627
refactor(super-editor): use field processor options object
luccas-harbour May 12, 2026
f5c6591
refactor(contracts): move page number formatting
luccas-harbour May 12, 2026
cf24abf
fix(super-editor): preserve active header display numbers
luccas-harbour May 12, 2026
831588f
fix(contracts): remove duplicate display number fields
luccas-harbour May 12, 2026
0dfe4c4
fix(layout-bridge): bucket zero-padded page numbers
luccas-harbour May 12, 2026
975e586
fix(super-editor): parse numeric page switch casing
luccas-harbour May 13, 2026
9612c6b
fix(converter): parse field dispatch whitespace
luccas-harbour Jun 3, 2026
15c6cf1
fix(header-footer): centralize OOXML ref inheritance for first-page h…
luccas-harbour Jun 3, 2026
985f183
refactor(layout): centralize header/footer ref resolution in a shared…
luccas-harbour Jun 3, 2026
c557c8f
refactor(layout-engine): centralize header/footer ref inheritance
luccas-harbour May 12, 2026
392ec7d
fix(contracts): preserve header footer fallback refs
luccas-harbour May 12, 2026
aa1880c
fix(contracts): ignore later refs for fallback resolution
luccas-harbour May 12, 2026
c2ae9cf
fix(contracts): inherit converter fallback refs
luccas-harbour May 12, 2026
e900a4d
test(contracts): cover header footer inheritance helper
luccas-harbour May 12, 2026
bca3a17
fix(layout-bridge): drop unused inheritance re-export
luccas-harbour May 12, 2026
bfe39fe
fix(layout): preserve converter title page refs
luccas-harbour Jun 1, 2026
1648f3b
fix(layout): stop leaking converter fallback refs into section resolu…
luccas-harbour Jun 2, 2026
efede9d
feat(super-converter): match field dispatch keywords case-insensitively
luccas-harbour Jun 1, 2026
adfbeb9
fix(super-converter): trust header footer field keyword
luccas-harbour Jun 1, 2026
30a7c9b
fix(painter): rebuild drawing page fields on context changes
luccas-harbour Jun 1, 2026
eb74b1e
fix(layout): remove duplicate displayNumber fields and fix page signa…
luccas-harbour Jun 3, 2026
94f1b75
feat(page-number): add SECTIONPAGES field support
luccas-harbour Jun 2, 2026
1d3bd28
fix(super-converter): preserve SECTIONPAGES field styling
luccas-harbour Jun 2, 2026
ba142fc
fix(layout-bridge): keep page resolver section count optional
luccas-harbour Jun 2, 2026
f9da5bb
fix(super-converter): preserve header SECTIONPAGES styling
luccas-harbour Jun 2, 2026
82b3e17
fix(super-editor): import page formatter from contracts
luccas-harbour Jun 2, 2026
b1bfa49
fix(painter): format PAGE fields in drawing text
luccas-harbour Jun 2, 2026
19f79e4
fix(fields): refresh SECTIONPAGES cached values
luccas-harbour Jun 2, 2026
933bbbb
fix(fields): preserve SECTIONPAGES without context
luccas-harbour Jun 2, 2026
4469aaa
fix(page-number): show section PAGE text in edit mode
luccas-harbour Jun 2, 2026
2fd95a2
fix(super-converter): filter root SECTIONPAGES nodes
luccas-harbour Jun 2, 2026
79ec44d
fix(page-number): format PAGE from display number
luccas-harbour Jun 2, 2026
ec45b0d
fix(page-number): preserve SECTIONPAGES cached display
luccas-harbour Jun 2, 2026
3c1f179
fix(story-editor): keep section count context optional
luccas-harbour Jun 2, 2026
e30090d
fix(header-footer): preserve SECTIONPAGES display on refresh
luccas-harbour Jun 2, 2026
9230479
fix(shape-text): preserve SECTIONPAGES cached text
luccas-harbour Jun 2, 2026
af3df9f
fix(header-footer): avoid synthetic section count
luccas-harbour Jun 2, 2026
c66d87d
fix(layout-bridge): aggregate header metrics
luccas-harbour Jun 2, 2026
2cbacf7
fix(super-converter): drop dead section alias
luccas-harbour Jun 2, 2026
15734ae
fix(painter): preserve section pages shape text
luccas-harbour Jun 2, 2026
cb3994e
fix(fields): share section pages resolver
luccas-harbour Jun 2, 2026
1a3c0ce
fix(layout): trim dead section token branch
luccas-harbour Jun 2, 2026
ae91936
test(header-footer): cover section count refresh
luccas-harbour Jun 2, 2026
4e7a4fe
chore(contracts): bump layout contracts version
luccas-harbour Jun 2, 2026
49f5569
fix(painter): preserve cached SECTIONPAGES fallback
luccas-harbour Jun 2, 2026
a995878
fix(painter): use correct display page number for shape PAGE fields
luccas-harbour Jun 3, 2026
e2a88d6
refactor(fields): accept generic options in SECTIONPAGES preprocessor
luccas-harbour Jun 3, 2026
1de645b
feat(page-number): chapter-prefixed section page numbering (SD-3029) …
luccas-harbour Jun 4, 2026
1288eab
Merge branch 'main' into luccas/sd-3349-bug-numbering-issues
harbournick Jun 4, 2026
0a2aea6
chore: fixes
harbournick Jun 4, 2026
bc297ae
chore: ci fixes
harbournick Jun 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1078,5 +1078,5 @@
}
],
"marker": "{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}",
"sourceHash": "5f439c4117bbb2e55f227e7711df415c1173f8c476954c6e412a4b8b45edd1a3"
"sourceHash": "fc2e513626b5bfc6383d968b9bffdcea0f086469bf867a588dd7319c8b75c7de"
}
2 changes: 1 addition & 1 deletion apps/docs/document-api/reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ The tables below are grouped by namespace.
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/sections/set-page-setup"><code>sections.setPageSetup</code></a></span> | <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.sections.setPageSetup(...)</code></span> | Set page size/orientation properties for a section. |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/sections/set-columns"><code>sections.setColumns</code></a></span> | <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.sections.setColumns(...)</code></span> | Set column configuration for a section. |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/sections/set-line-numbering"><code>sections.setLineNumbering</code></a></span> | <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.sections.setLineNumbering(...)</code></span> | Enable or configure line numbering for a section. |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/sections/set-page-numbering"><code>sections.setPageNumbering</code></a></span> | <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.sections.setPageNumbering(...)</code></span> | Set page numbering format/start for a section. |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/sections/set-page-numbering"><code>sections.setPageNumbering</code></a></span> | <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.sections.setPageNumbering(...)</code></span> | Set page numbering format/start and chapter numbering settings for a section. |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/sections/set-title-page"><code>sections.setTitlePage</code></a></span> | <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.sections.setTitlePage(...)</code></span> | Enable or disable title-page behavior for a section. |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/sections/set-odd-even-headers-footers"><code>sections.setOddEvenHeadersFooters</code></a></span> | <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.sections.setOddEvenHeadersFooters(...)</code></span> | Enable or disable odd/even header-footer mode in document settings. |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/sections/set-vertical-align"><code>sections.setVerticalAlign</code></a></span> | <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.sections.setVerticalAlign(...)</code></span> | Set vertical page alignment for a section. |
Expand Down
16 changes: 16 additions & 0 deletions apps/docs/document-api/reference/sections/get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Returns a SectionInfo object with full section properties including margins, col
| `pageBorders.top.style` | string | no | |
| `pageBorders.zOrder` | enum | no | `"front"`, `"back"` |
| `pageNumbering` | object | no | |
| `pageNumbering.chapterSeparator` | enum | no | `"hyphen"`, `"period"`, `"colon"`, `"emDash"`, `"enDash"` |
| `pageNumbering.chapterStyle` | integer | no | |
| `pageNumbering.format` | enum | no | `"decimal"`, `"lowerLetter"`, `"upperLetter"`, `"lowerRoman"`, `"upperRoman"`, `"numberInDash"` |
| `pageNumbering.start` | integer | no | |
| `pageSetup` | object | no | |
Expand Down Expand Up @@ -614,6 +616,20 @@ Returns a SectionInfo object with full section properties including margins, col
"pageNumbering": {
"additionalProperties": false,
"properties": {
"chapterSeparator": {
"enum": [
"hyphen",
"period",
"colon",
"emDash",
"enDash"
],
"type": "string"
},
"chapterStyle": {
"minimum": 1,
"type": "integer"
},
"format": {
"enum": [
"decimal",
Expand Down
14 changes: 14 additions & 0 deletions apps/docs/document-api/reference/sections/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,20 @@ Returns a SectionsListResult with an ordered array of section summaries and thei
"pageNumbering": {
"additionalProperties": false,
"properties": {
"chapterSeparator": {
"enum": [
"hyphen",
"period",
"colon",
"emDash",
"enDash"
],
"type": "string"
},
"chapterStyle": {
"minimum": 1,
"type": "integer"
},
"format": {
"enum": [
"decimal",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: sections.setPageNumbering
sidebarTitle: sections.setPageNumbering
description: Set page numbering format/start for a section.
description: Set page numbering format/start and chapter numbering settings for a section.
---

{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}

## Summary

Set page numbering format/start for a section.
Set page numbering format/start and chapter numbering settings for a section.

- Operation ID: `sections.setPageNumbering`
- API member path: `editor.doc.sections.setPageNumbering(...)`
Expand All @@ -20,7 +20,7 @@ Set page numbering format/start for a section.

## Expected result

Returns a SectionMutationResult receipt; reports NO_OP if page numbering format already matches.
Returns a SectionMutationResult receipt; reports NO_OP if page numbering settings already match.

## Input fields

Expand All @@ -42,6 +42,24 @@ Returns a SectionMutationResult receipt; reports NO_OP if page numbering format
| `target.kind` | `"section"` | yes | Constant: `"section"` |
| `target.sectionId` | string | yes | |

### Variant 3 (target.kind="section")

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `chapterStyle` | integer | yes | |
| `target` | SectionAddress | yes | SectionAddress |
| `target.kind` | `"section"` | yes | Constant: `"section"` |
| `target.sectionId` | string | yes | |

### Variant 4 (target.kind="section")

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `chapterSeparator` | enum | yes | `"hyphen"`, `"period"`, `"colon"`, `"emDash"`, `"enDash"` |
| `target` | SectionAddress | yes | SectionAddress |
| `target.kind` | `"section"` | yes | Constant: `"section"` |
| `target.sectionId` | string | yes | |

### Example request

```json
Expand Down Expand Up @@ -107,7 +125,7 @@ Returns a SectionMutationResult receipt; reports NO_OP if page numbering format
```json
{
"additionalProperties": false,
"oneOf": [
"anyOf": [
{
"required": [
"target",
Expand All @@ -119,9 +137,35 @@ Returns a SectionMutationResult receipt; reports NO_OP if page numbering format
"target",
"format"
]
},
{
"required": [
"target",
"chapterStyle"
]
},
{
"required": [
"target",
"chapterSeparator"
]
}
],
"properties": {
"chapterSeparator": {
"enum": [
"hyphen",
"period",
"colon",
"emDash",
"enDash"
],
"type": "string"
},
"chapterStyle": {
"minimum": 1,
"type": "integer"
},
"format": {
"enum": [
"decimal",
Expand Down
4 changes: 2 additions & 2 deletions packages/document-api/src/contract/operation-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,8 @@ export const OPERATION_DEFINITIONS = {
},
'sections.setPageNumbering': {
memberPath: 'sections.setPageNumbering',
description: 'Set page numbering format/start for a section.',
expectedResult: 'Returns a SectionMutationResult receipt; reports NO_OP if page numbering format already matches.',
description: 'Set page numbering format/start and chapter numbering settings for a section.',
expectedResult: 'Returns a SectionMutationResult receipt; reports NO_OP if page numbering settings already match.',
requiresDocumentContext: true,
metadata: mutationOperation({
idempotency: 'conditional',
Expand Down
11 changes: 10 additions & 1 deletion packages/document-api/src/contract/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@
const entityAddressSchema = ref('EntityAddress');
const selectionTargetSchema = ref('SelectionTarget');
const commentTrackedChangeLinkSchema = ref('CommentTrackedChangeLink');
const targetLocatorSchema = ref('TargetLocator');

Check warning on line 647 in packages/document-api/src/contract/schemas.ts

View workflow job for this annotation

GitHub Actions / build

'targetLocatorSchema' is assigned a value but never used. Allowed unused vars must match /^_/u
const deleteBehaviorSchema = ref('DeleteBehavior');
const resolvedHandleSchema = ref('ResolvedHandle');
const pageInfoSchema = ref('PageInfo');
Expand Down Expand Up @@ -926,7 +926,7 @@
text: { type: 'string' },
});

const nodeInfoSchema: JsonSchema = {

Check warning on line 929 in packages/document-api/src/contract/schemas.ts

View workflow job for this annotation

GitHub Actions / build

'nodeInfoSchema' is assigned a value but never used. Allowed unused vars must match /^_/u
type: 'object',
required: ['nodeType', 'kind'],
properties: {
Expand All @@ -942,7 +942,7 @@
additionalProperties: false,
};

const matchContextSchema = objectSchema(

Check warning on line 945 in packages/document-api/src/contract/schemas.ts

View workflow job for this annotation

GitHub Actions / build

'matchContextSchema' is assigned a value but never used. Allowed unused vars must match /^_/u
{
address: nodeAddressSchema,
snippet: { type: 'string' },
Expand All @@ -953,7 +953,7 @@
['address', 'snippet', 'highlightRange'],
);

const unknownNodeDiagnosticSchema = objectSchema(

Check warning on line 956 in packages/document-api/src/contract/schemas.ts

View workflow job for this annotation

GitHub Actions / build

'unknownNodeDiagnosticSchema' is assigned a value but never used. Allowed unused vars must match /^_/u
{
message: { type: 'string' },
address: nodeAddressSchema,
Expand Down Expand Up @@ -1281,6 +1281,8 @@
const sectionPageNumberingSchema = objectSchema({
start: { type: 'integer', minimum: 1 },
format: sectionPageNumberFormatSchema,
chapterStyle: { type: 'integer', minimum: 1 },
chapterSeparator: { type: 'string', enum: ['hyphen', 'period', 'colon', 'emDash', 'enDash'] },
});

const sectionHeaderFooterRefsSchema = objectSchema({
Expand Down Expand Up @@ -4018,10 +4020,17 @@
target: sectionAddressSchema,
start: { type: 'integer', minimum: 1 },
format: sectionPageNumberFormatSchema,
chapterStyle: { type: 'integer', minimum: 1 },
chapterSeparator: { type: 'string', enum: ['hyphen', 'period', 'colon', 'emDash', 'enDash'] },
},
['target'],
),
oneOf: [{ required: ['target', 'start'] }, { required: ['target', 'format'] }],
anyOf: [
{ required: ['target', 'start'] },
{ required: ['target', 'format'] },
{ required: ['target', 'chapterStyle'] },
{ required: ['target', 'chapterSeparator'] },
],
},
output: sectionMutationResultSchemaFor('sections.setPageNumbering'),
success: sectionMutationSuccessSchema,
Expand Down
1 change: 1 addition & 0 deletions packages/document-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,7 @@ export type {
SectionPageBorders,
SectionPageMargins,
SectionPageNumbering,
SectionPageNumberingChapterSeparator,
SectionPageNumberingFormat,
SectionPageSetup,
SectionRangeDomain,
Expand Down
52 changes: 51 additions & 1 deletion packages/document-api/src/sections/sections.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,57 @@ describe('sections API validation', () => {
executeSectionsSetPageNumbering(adapter, {
target: { kind: 'section', sectionId: 'section-0' },
}),
).toThrow(/requires at least one of start or format/i);
).toThrow(/requires at least one of start, format, chapterStyle, or chapterSeparator/i);
});

it('accepts chapterStyle for setPageNumbering', () => {
const setPageNumbering = mock(makeAdapter().setPageNumbering);
const adapter = makeAdapter({ setPageNumbering });

executeSectionsSetPageNumbering(adapter, {
target: { kind: 'section', sectionId: 'section-0' },
chapterStyle: 1,
});

expect(setPageNumbering).toHaveBeenCalledWith(
{ target: { kind: 'section', sectionId: 'section-0' }, chapterStyle: 1 },
{ changeMode: 'direct', dryRun: false, expectedRevision: undefined },
);
});

it('accepts valid chapterSeparator for setPageNumbering', () => {
const setPageNumbering = mock(makeAdapter().setPageNumbering);
const adapter = makeAdapter({ setPageNumbering });

executeSectionsSetPageNumbering(adapter, {
target: { kind: 'section', sectionId: 'section-0' },
chapterSeparator: 'enDash',
});

expect(setPageNumbering).toHaveBeenCalledWith(
{ target: { kind: 'section', sectionId: 'section-0' }, chapterSeparator: 'enDash' },
{ changeMode: 'direct', dryRun: false, expectedRevision: undefined },
);
});

it('rejects invalid chapterSeparator for setPageNumbering', () => {
const adapter = makeAdapter();
expect(() =>
executeSectionsSetPageNumbering(adapter, {
target: { kind: 'section', sectionId: 'section-0' },
chapterSeparator: 'slash' as any,
}),
).toThrow(/chapterSeparator/i);
});

it('rejects chapterStyle less than 1 for setPageNumbering', () => {
const adapter = makeAdapter();
expect(() =>
executeSectionsSetPageNumbering(adapter, {
target: { kind: 'section', sectionId: 'section-0' },
chapterStyle: 0,
}),
).toThrow(/chapterStyle/i);
});

it('requires at least one field for setPageBorders', () => {
Expand Down
21 changes: 19 additions & 2 deletions packages/document-api/src/sections/sections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
SectionHeaderFooterVariant,
SectionDirection,
SectionOrientation,
SectionPageNumberingChapterSeparator,
SectionVerticalAlign,
SectionsClearHeaderFooterRefInput,
SectionsClearPageBordersInput,
Expand Down Expand Up @@ -41,6 +42,7 @@ export type {
SectionBreakType,
SectionHeaderFooterKind,
SectionHeaderFooterVariant,
SectionPageNumberingChapterSeparator,
SectionsClearHeaderFooterRefInput,
SectionsClearPageBordersInput,
SectionsGetInput,
Expand Down Expand Up @@ -81,6 +83,13 @@ const PAGE_NUMBER_FORMATS = [
'upperRoman',
'numberInDash',
] as const;
const PAGE_NUMBER_CHAPTER_SEPARATORS: readonly SectionPageNumberingChapterSeparator[] = [
'hyphen',
'period',
'colon',
'emDash',
'enDash',
] as const;
const PAGE_BORDER_DISPLAYS = ['allPages', 'firstPage', 'notFirstPage'] as const;
const PAGE_BORDER_OFFSET_FROM_VALUES = ['page', 'text'] as const;
const PAGE_BORDER_Z_ORDER_VALUES = ['front', 'back'] as const;
Expand Down Expand Up @@ -390,17 +399,25 @@ export function executeSectionsSetPageNumbering(
options?: MutationOptions,
): SectionMutationResult {
assertSectionTarget(input, 'sections.setPageNumbering');
if (!hasAnyDefined(input as unknown as Record<string, unknown>, ['start', 'format'])) {
if (
!hasAnyDefined(input as unknown as Record<string, unknown>, ['start', 'format', 'chapterStyle', 'chapterSeparator'])
) {
throw new DocumentApiValidationError(
'INVALID_INPUT',
'sections.setPageNumbering requires at least one of start or format.',
'sections.setPageNumbering requires at least one of start, format, chapterStyle, or chapterSeparator.',
);
}

if (input.start !== undefined) assertPositiveInteger(input.start, 'sections.setPageNumbering.start');
if (input.format !== undefined) {
assertOneOf(input.format, 'sections.setPageNumbering.format', PAGE_NUMBER_FORMATS);
}
if (input.chapterStyle !== undefined) {
assertPositiveInteger(input.chapterStyle, 'sections.setPageNumbering.chapterStyle');
}
if (input.chapterSeparator !== undefined) {
assertOneOf(input.chapterSeparator, 'sections.setPageNumbering.chapterSeparator', PAGE_NUMBER_CHAPTER_SEPARATORS);
}

return adapter.setPageNumbering(input, normalizeMutationOptions(options));
}
Expand Down
6 changes: 6 additions & 0 deletions packages/document-api/src/sections/sections.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export type SectionPageNumberingFormat =
| 'upperRoman'
| 'numberInDash';

export type SectionPageNumberingChapterSeparator = 'hyphen' | 'period' | 'colon' | 'emDash' | 'enDash';

export interface SectionPageMargins {
top?: number;
right?: number;
Expand Down Expand Up @@ -73,6 +75,8 @@ export interface SectionLineNumbering {
export interface SectionPageNumbering {
start?: number;
format?: SectionPageNumberingFormat;
chapterStyle?: number;
chapterSeparator?: SectionPageNumberingChapterSeparator;
}

export interface SectionHeaderFooterRefs {
Expand Down Expand Up @@ -227,6 +231,8 @@ export interface SectionsSetLineNumberingInput extends SectionTargetInput {
export interface SectionsSetPageNumberingInput extends SectionTargetInput {
start?: number;
format?: SectionPageNumberingFormat;
chapterStyle?: number;
chapterSeparator?: SectionPageNumberingChapterSeparator;
}

export interface SectionsSetTitlePageInput extends SectionTargetInput {
Expand Down
2 changes: 2 additions & 0 deletions packages/document-api/src/types/sd-sections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export interface SDSection {
pageNumbering?: {
start?: number;
format?: 'decimal' | 'lowerLetter' | 'upperLetter' | 'lowerRoman' | 'upperRoman' | 'numberInDash';
chapterStyle?: number;
chapterSeparator?: 'hyphen' | 'period' | 'colon' | 'emDash' | 'enDash';
};
titlePage?: boolean;
oddEvenHeadersFooters?: boolean;
Expand Down
Loading
Loading