oasis-editor 0.0.18 → 0.0.19
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-Cwoo0WV0.js → OasisEditorApp-xXfigQp4.js} +58 -14
- package/dist/assets/{importDocxWorker-cjz15bhS.js → importDocxWorker-D4P4_drI.js} +1 -1
- package/dist/core/model/index.d.ts +2 -2
- package/dist/core/model/pageGeometry.d.ts +13 -0
- package/dist/core/model/types/document.d.ts +20 -0
- package/dist/core/model/types/layout.d.ts +5 -0
- package/dist/{index-CBbhzffQ.js → index-C7Ftk4dm.js} +352 -143
- package/dist/layoutProjection/blocksPagination.d.ts +10 -0
- package/dist/oasis-editor.js +54 -54
- package/dist/oasis-editor.umd.cjs +4 -4
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ export type { EditorFootnote } from './types/documentFootnotes.js';
|
|
|
13
13
|
export type { EditorEndnote } from './types/documentEndnotes.js';
|
|
14
14
|
export type { EditorBookmark, EditorBookmarkAnchor, EditorBookmarks, } from './types/documentBookmarks.js';
|
|
15
15
|
export type { EditorComment, EditorCommentAnchor, EditorComments, } from './types/documentComments.js';
|
|
16
|
-
export type { EditorPageMargins, EditorPageSettings, EditorSection, EditorFootnoteSettings, EditorFootnotes, EditorEndnoteSettings, EditorEndnotes, EditorDocument, } from './types/document.js';
|
|
16
|
+
export type { EditorPageMargins, EditorPageSettings, EditorColumnsSettings, EditorSection, EditorFootnoteSettings, EditorFootnotes, EditorEndnoteSettings, EditorEndnotes, EditorDocument, } from './types/document.js';
|
|
17
17
|
export type { EditorPosition, EditorSelection, EditorEditingZone, } from './types/selection.js';
|
|
18
18
|
export type { EditorCaretSlot, EditorLayoutFragmentChar, EditorLayoutFragment, EditorLayoutLine, EditorLayoutParagraph, EditorLayoutBlock, TableCellBlockPosition, EditorLayoutPage, EditorLayoutDocument, } from './types/layout.js';
|
|
19
19
|
export type { EditorState } from './editorState.js';
|
|
@@ -24,7 +24,7 @@ export { getParagraphText, getParagraphLength, getRunIndex, getRunStartOffset, p
|
|
|
24
24
|
export { textStyleMerger, paragraphStyleMerger, mergeTextStyles, mergeParagraphStyles, resolveDefaultParagraphStyleId, resolveNamedTextStyle, resolveNamedParagraphStyle, resolveEffectiveTextStyle, resolveEffectiveTextStyleForParagraph, resolveEffectiveParagraphStyle, } from './styleResolution.js';
|
|
25
25
|
export type { StyleMerger, Mergeable } from './styleResolution.js';
|
|
26
26
|
export { resolveImageSrc } from './assets.js';
|
|
27
|
-
export { normalizePageSettings, getDocumentPageSettings, getPageContentWidth, getPageHeaderZoneTop, getPageBodyTop, getPageFooterReferenceTop, getPageBodyBottom, getPageHeaderZoneHeight, getPageFooterZoneTop, getPageFooterZoneHeight, getPageContentHeight, } from './pageGeometry.js';
|
|
27
|
+
export { normalizePageSettings, getDocumentPageSettings, getPageContentWidth, getPageColumnRects, getPageHeaderZoneTop, getPageBodyTop, getPageFooterReferenceTop, getPageBodyBottom, getPageHeaderZoneHeight, getPageFooterZoneTop, getPageFooterZoneHeight, getPageContentHeight, } from './pageGeometry.js';
|
|
28
28
|
export { getDocumentSections, getDocumentSectionsCanonical, } from './documentSections.js';
|
|
29
29
|
export { DocumentIndexBuilder, getDocumentParagraphIndex, getDocumentParagraphs, getDocumentParagraphsCanonical, getParagraphById, findParagraphLocation, findParagraphTableLocation, WeakMapDocumentIndexCache, } from './documentIndex.js';
|
|
30
30
|
export type { EditorParagraphLocation, TableLocation, DocumentParagraphIndexEntry, DocumentIndexCache, } from './documentIndex.js';
|
|
@@ -4,6 +4,19 @@ export declare const DEFAULT_EDITOR_PAGE_SETTINGS: EditorPageSettings;
|
|
|
4
4
|
export declare function normalizePageSettings(pageSettings: EditorPageSettings): EditorPageSettings;
|
|
5
5
|
export declare function getDocumentPageSettings(document: EditorDocument): EditorPageSettings;
|
|
6
6
|
export declare function getPageContentWidth(pageSettings: EditorPageSettings): number;
|
|
7
|
+
export interface PageColumnRect {
|
|
8
|
+
/** Page-relative left edge of the column's content. */
|
|
9
|
+
left: number;
|
|
10
|
+
/** Column content width. */
|
|
11
|
+
width: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Page-relative left/width for each text column. A single-column page (no
|
|
15
|
+
* `columns` or `count <= 1`) yields one rect spanning the full content width,
|
|
16
|
+
* so existing callers are unaffected. Unequal `<w:col>` widths are honored when
|
|
17
|
+
* present; otherwise columns are equal with a uniform `space` gap.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getPageColumnRects(pageSettings: EditorPageSettings): PageColumnRect[];
|
|
7
20
|
export declare function getPageHeaderZoneTop(pageSettings: EditorPageSettings): number;
|
|
8
21
|
export declare function getPageBodyTop(pageSettings: EditorPageSettings): number;
|
|
9
22
|
export declare function getPageFooterReferenceTop(pageSettings: EditorPageSettings): number;
|
|
@@ -15,11 +15,31 @@ export interface EditorPageMargins {
|
|
|
15
15
|
footer: number;
|
|
16
16
|
gutter: number;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Newspaper-style multi-column section layout (`w:cols`). Absent for ordinary
|
|
20
|
+
* single-column documents.
|
|
21
|
+
*/
|
|
22
|
+
export interface EditorColumnsSettings {
|
|
23
|
+
/** `w:num` — number of columns (only meaningful when > 1). */
|
|
24
|
+
count: number;
|
|
25
|
+
/** `w:space` — uniform gap between columns, in px. */
|
|
26
|
+
space: number;
|
|
27
|
+
/** `w:sep` — draw a vertical rule between columns. */
|
|
28
|
+
separator?: boolean;
|
|
29
|
+
/** `w:equalWidth` — defaults to true. */
|
|
30
|
+
equalWidth?: boolean;
|
|
31
|
+
/** Explicit per-column widths/spacing (`<w:col>`); only when unequal. */
|
|
32
|
+
columns?: {
|
|
33
|
+
width: number;
|
|
34
|
+
space: number;
|
|
35
|
+
}[];
|
|
36
|
+
}
|
|
18
37
|
export interface EditorPageSettings {
|
|
19
38
|
width: number;
|
|
20
39
|
height: number;
|
|
21
40
|
orientation?: "portrait" | "landscape";
|
|
22
41
|
margins: EditorPageMargins;
|
|
42
|
+
columns?: EditorColumnsSettings;
|
|
23
43
|
}
|
|
24
44
|
export interface EditorSection {
|
|
25
45
|
id: string;
|
|
@@ -65,6 +65,11 @@ export interface EditorLayoutBlock {
|
|
|
65
65
|
};
|
|
66
66
|
sourceBlockId?: string;
|
|
67
67
|
sourceBlock: EditorBlockNode;
|
|
68
|
+
/**
|
|
69
|
+
* For newspaper multi-column sections: which text column (0-based) this block
|
|
70
|
+
* was flowed into on its physical page. Undefined for single-column pages.
|
|
71
|
+
*/
|
|
72
|
+
columnIndex?: number;
|
|
68
73
|
}
|
|
69
74
|
export interface TableCellBlockPosition {
|
|
70
75
|
blockIndex: number;
|