oasis-editor 0.0.402 → 0.0.404
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/OasisEditorApp-DWpOSren.js +1 -0
- package/dist/assets/{importDocxWorker-gjomIN7s.js → importDocxWorker-Cza4hyf3.js} +2 -2
- package/dist/core/commands/tableOfContents.d.ts +6 -0
- package/dist/core/document/tocFields.d.ts +6 -0
- package/dist/core/document/tocLinks.d.ts +13 -0
- package/dist/core/document/tocOutline.d.ts +5 -0
- package/dist/{defaultToolbar-DEdxC5tS.js → defaultToolbar-DOUMCB_G.js} +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/package.json +1 -1
- package/dist/OasisEditorApp-BWwlRxpu.js +0 -1
|
@@ -9422,9 +9422,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9422
9422
|
const T = ot(lt(it(e, Qe, "textDirection"), "val"));
|
|
9423
9423
|
T && (r.textDirection = T);
|
|
9424
9424
|
const I = lt(it(e, Qe, "outlineLvl"), "val");
|
|
9425
|
-
if (
|
|
9425
|
+
if (null != I && /^[0-9]$/.test(I.trim())) {
|
|
9426
9426
|
const e = Number(I);
|
|
9427
|
-
Number.
|
|
9427
|
+
Number.isInteger(e) && e >= 0 && e <= 9 && (r.outlineLevel = e);
|
|
9428
9428
|
}
|
|
9429
9429
|
const _ = pt(e, "suppressLineNumbers");
|
|
9430
9430
|
void 0 !== _ && (r.suppressLineNumbers = _);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditorState, EditorLayoutDocument } from '../model.js';
|
|
2
|
+
import { TocFieldSettings } from '../document/tocFields.js';
|
|
2
3
|
/** Default TOC scope: outline levels 1–3, matching Word's `TOC \o "1-3"`. */
|
|
3
4
|
export declare const DEFAULT_TOC_MAX_LEVEL = 3;
|
|
4
5
|
/** A heading captured for a TOC entry. */
|
|
@@ -15,6 +16,11 @@ export type TocPageNumberResolver = (headingId: string) => number | string | und
|
|
|
15
16
|
* editor's own `heading1` and Word's imported `Heading1` styles qualify.
|
|
16
17
|
*/
|
|
17
18
|
export declare function collectTocHeadings(state: EditorState, maxLevel?: number): TocHeading[];
|
|
19
|
+
/** Resolve explicit TOC style names against the paragraph-style catalog.
|
|
20
|
+
* Refuse missing/ambiguous names and conflicting mappings; never silently
|
|
21
|
+
* remove an imported cache because a style could not be resolved.
|
|
22
|
+
*/
|
|
23
|
+
export declare function collectQualifiedTocHeadings(state: EditorState, options: TocFieldSettings, maxLevel?: number): TocHeading[] | undefined;
|
|
18
24
|
/**
|
|
19
25
|
* Insert a generated table of contents after the block holding the caret.
|
|
20
26
|
* Operates on section blocks (not the flattened paragraph list) so it is safe
|
|
@@ -5,6 +5,12 @@ export interface TocFieldSettings {
|
|
|
5
5
|
hyperlinks: boolean;
|
|
6
6
|
hideWebNumbers: boolean;
|
|
7
7
|
useOutline: boolean;
|
|
8
|
+
/** Present only for an explicit custom paragraph-style mapping. */
|
|
9
|
+
styleMappings?: readonly {
|
|
10
|
+
name: string;
|
|
11
|
+
level: number;
|
|
12
|
+
}[];
|
|
13
|
+
customOnly?: true;
|
|
8
14
|
}
|
|
9
15
|
export interface QualifiedTocRegion extends TocFieldSettings {
|
|
10
16
|
startBlockIndex: number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EditorState, EditorLayoutDocument } from '../model.js';
|
|
2
|
+
import { TocPaginate } from './tocConvergence.js';
|
|
3
|
+
export interface TocLinkResult {
|
|
4
|
+
state: EditorState;
|
|
5
|
+
status: "updated" | "unchanged" | "unsupported" | "unresolved";
|
|
6
|
+
layout?: EditorLayoutDocument;
|
|
7
|
+
}
|
|
8
|
+
/** Qualify an already-current flat TOC before adding internal links.
|
|
9
|
+
* Preserve paragraph/run identities and text offsets. Re-measure after adding
|
|
10
|
+
* links; do not publish a candidate whose page labels no longer match.
|
|
11
|
+
* This is an opt-in staging API, not a Ribbon command or automatic refresh.
|
|
12
|
+
*/
|
|
13
|
+
export declare function linkQualifiedTableOfContents(original: EditorState, paginate?: TocPaginate): TocLinkResult;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EditorDocument, EditorParagraphNode } from '../model.js';
|
|
2
|
+
/** Return a 1-based TOC level, null for body text, or undefined when the
|
|
3
|
+
* source style graph cannot certify the level. Unlike the general rendering
|
|
4
|
+
* cascade this bounded lookup never recurses on a malformed basedOn graph. */
|
|
5
|
+
export declare function createTocOutlineResolver(document: EditorDocument): (p: EditorParagraphNode) => number | null | undefined;
|