oasis-editor 0.0.115 → 0.0.116

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.
@@ -1,5 +1,6 @@
1
1
  import { EditorBlockNode, EditorLayoutPage, EditorLayoutParagraph, EditorNamedStyle, EditorPageSettings } from '../core/model.js';
2
2
  import { ITextMeasurer } from '../core/engine.js';
3
+ import { LayoutProjectionContext } from './paragraphPagination.js';
3
4
 
4
5
  export interface ProjectBlocksLayoutContext {
5
6
  blocks: EditorBlockNode[];
@@ -19,4 +20,5 @@ export interface ProjectBlocksLayoutContext {
19
20
  * by the multi-column flow to wrap at a single column's width.
20
21
  */
21
22
  contentWidthOverride?: number;
23
+ projectionContext?: LayoutProjectionContext;
22
24
  }
@@ -1,5 +1,6 @@
1
1
  import { EditorBlockNode, EditorLayoutBlock, EditorLayoutParagraph, EditorNamedStyle } from '../core/model.js';
2
2
  import { ITextMeasurer } from '../core/engine.js';
3
+ import { LayoutProjectionContext } from './paragraphPagination.js';
3
4
 
4
5
  export interface HeaderFooterLayoutContext {
5
6
  pageIndex?: number;
@@ -10,5 +11,6 @@ export interface HeaderFooterLayoutContext {
10
11
  contentWidth?: number;
11
12
  measurer?: ITextMeasurer;
12
13
  defaultTabStop?: number;
14
+ projectionContext?: LayoutProjectionContext;
13
15
  }
14
16
  export type HeaderFooterBlockProjector = (blocks: EditorBlockNode[], context?: HeaderFooterLayoutContext) => EditorLayoutBlock[];
@@ -1,6 +1,7 @@
1
1
  import { EditorLayoutBlock, EditorLayoutPage, EditorLayoutParagraph, EditorNamedStyle, EditorPageSettings } from '../core/model.js';
2
2
  import { ITextMeasurer } from '../core/engine.js';
3
3
  import { FloatingExclusionRect } from './floatingObjects.js';
4
+ import { LayoutProjectionContext } from './paragraphPagination.js';
4
5
 
5
6
  /**
6
7
  * Resolved per-run inputs shared by the paragraph and table block handlers.
@@ -16,6 +17,7 @@ export interface TrackLayoutParams {
16
17
  defaultTabStop?: number;
17
18
  measuredHeights?: Record<string, number>;
18
19
  measuredParagraphLayouts?: Record<string, EditorLayoutParagraph>;
20
+ projectionContext?: LayoutProjectionContext;
19
21
  }
20
22
  /**
21
23
  * Mutable cursor for laying blocks into a vertical sequence of "tracks" (one
@@ -3,11 +3,16 @@ import { CharRect } from '../ui/caretGeometry.js';
3
3
  import { ITextMeasurer, HyphenationLayoutOptions } from '../core/engine.js';
4
4
  import { FloatingExclusionRect, ResolveTextBoxHeight } from './floatingObjects.js';
5
5
 
6
- export declare function setActiveHyphenation(options: HyphenationLayoutOptions | undefined): void;
6
+ export interface LayoutProjectionContext {
7
+ hyphenation?: HyphenationLayoutOptions;
8
+ hyphenationSignature: string;
9
+ }
10
+ export declare const EMPTY_PROJECTION_CONTEXT: LayoutProjectionContext;
11
+ export declare function createProjectionContext(options: HyphenationLayoutOptions | undefined): LayoutProjectionContext;
7
12
  export declare function shouldCollapseContextualSpacing(previous: EditorParagraphNode | undefined, next: EditorParagraphNode | undefined, styles: Record<string, EditorNamedStyle> | undefined): boolean;
8
13
  export declare function clearProjectedParagraphLayoutCache(): void;
9
- export declare function projectParagraphLayout(paragraph: EditorParagraphNode, pageIndex?: number, totalPages?: number, styles?: Record<string, EditorNamedStyle>, contentWidth?: number, measurer?: ITextMeasurer, defaultTabStop?: number): EditorLayoutParagraph;
10
- export declare function projectParagraphLayoutWithExclusions(paragraph: EditorParagraphNode, pageSettings: EditorPageSettings | undefined, contentWidth: number | undefined, measurer?: ITextMeasurer, pageIndex?: number, totalPages?: number, styles?: Record<string, EditorNamedStyle>, defaultTabStop?: number, resolveTextBoxHeight?: ResolveTextBoxHeight, externalExclusions?: FloatingExclusionRect[]): EditorLayoutParagraph;
14
+ export declare function projectParagraphLayout(paragraph: EditorParagraphNode, pageIndex?: number, totalPages?: number, styles?: Record<string, EditorNamedStyle>, contentWidth?: number, measurer?: ITextMeasurer, defaultTabStop?: number, context?: LayoutProjectionContext): EditorLayoutParagraph;
15
+ export declare function projectParagraphLayoutWithExclusions(paragraph: EditorParagraphNode, pageSettings: EditorPageSettings | undefined, contentWidth: number | undefined, measurer?: ITextMeasurer, pageIndex?: number, totalPages?: number, styles?: Record<string, EditorNamedStyle>, defaultTabStop?: number, resolveTextBoxHeight?: ResolveTextBoxHeight, externalExclusions?: FloatingExclusionRect[], context?: LayoutProjectionContext): EditorLayoutParagraph;
11
16
  export declare function measureParagraphLayoutFromRects(paragraph: EditorParagraphNode, charRects: CharRect[], styles?: Record<string, EditorNamedStyle>): EditorLayoutParagraph;
12
17
  export declare function applyMeasuredLineGeometry(projected: EditorLayoutParagraph, measured: EditorLayoutParagraph): EditorLayoutParagraph;
13
18
  export declare function isMeasuredLayoutCurrent(projected: EditorLayoutParagraph, measured: EditorLayoutParagraph): boolean;
@@ -1,6 +1,7 @@
1
1
  import { EditorBlockNode, EditorDocument, EditorLayoutPage, EditorLayoutParagraph, EditorNamedStyle, EditorSection } from '../core/model.js';
2
2
  import { ITextMeasurer } from '../core/engine.js';
3
3
  import { HeaderFooterBlockProjector } from './headerFooterLayoutContext.js';
4
+ import { LayoutProjectionContext } from './paragraphPagination.js';
4
5
 
5
6
  export type BlocksLayoutProjector = (context: {
6
7
  blocks: EditorBlockNode[];
@@ -16,6 +17,7 @@ export type BlocksLayoutProjector = (context: {
16
17
  measurer?: ITextMeasurer;
17
18
  reservedHeightByPageIndex?: Map<number, number>;
18
19
  defaultTabStop?: number;
20
+ projectionContext?: LayoutProjectionContext;
19
21
  }) => EditorLayoutPage[];
20
22
  export interface SectionPaginationContext {
21
23
  sections: EditorSection[];
@@ -28,6 +30,7 @@ export interface SectionPaginationContext {
28
30
  needsTotalPages: boolean;
29
31
  projectBlocks: BlocksLayoutProjector;
30
32
  projectHeaderFooterBlocks: HeaderFooterBlockProjector;
33
+ projectionContext?: LayoutProjectionContext;
31
34
  }
32
35
  export interface SectionPaginationResult {
33
36
  pages: EditorLayoutPage[];
@@ -1,11 +1,12 @@
1
1
  import { EditorNamedStyle, EditorTableNode, EditorTableRowNode, TableCellBlockPosition } from '../core/model.js';
2
2
  import { ITextMeasurer } from '../core/engine.js';
3
+ import { LayoutProjectionContext } from './paragraphPagination.js';
3
4
 
4
5
  export declare function normalizeCellStartPositions(row: EditorTableRowNode, starts: TableCellBlockPosition[] | undefined, legacyStarts: number[] | undefined): TableCellBlockPosition[];
5
6
  export declare function positionsToBlockIndexes(positions: TableCellBlockPosition[] | undefined): number[] | undefined;
6
7
  export declare function hasPartialPositions(positions: TableCellBlockPosition[] | undefined): boolean;
7
8
  export declare function buildRowSliceFromPositions(row: EditorTableRowNode, starts: TableCellBlockPosition[], ends: TableCellBlockPosition[]): EditorTableRowNode;
8
- export declare function findCellSplitEndPosition(row: EditorTableRowNode, cellIndex: number, start: TableCellBlockPosition, availableHeight: number, styles: Record<string, EditorNamedStyle> | undefined, measurer: ITextMeasurer, defaultTabStop: number | undefined, contentWidth: number | undefined, table: EditorTableNode, rowIndex: number): TableCellBlockPosition;
9
+ export declare function findCellSplitEndPosition(row: EditorTableRowNode, cellIndex: number, start: TableCellBlockPosition, availableHeight: number, styles: Record<string, EditorNamedStyle> | undefined, measurer: ITextMeasurer, defaultTabStop: number | undefined, contentWidth: number | undefined, table: EditorTableNode, rowIndex: number, projectionContext?: LayoutProjectionContext): TableCellBlockPosition;
9
10
  export declare function canSplitTableRow(row: EditorTableRowNode | undefined): boolean;
10
11
  export declare function positionsProgressed(starts: TableCellBlockPosition[], ends: TableCellBlockPosition[]): boolean;
11
12
  export declare function positionsFinishedRow(row: EditorTableRowNode, ends: TableCellBlockPosition[]): boolean;
@@ -1,57 +1,57 @@
1
- import { a4, cC, cD, cE, cF, cG, ao, cH, a5, cl, cI, cJ, cK, a3, cL, cj, cM, cN, cO, cP, cQ, cx, cR, cS, cT, cU, cV, cW, cX, cY, cZ, c_, c$, d0, as, d1, cw, d2, cE as cE2, cJ as cJ2, cL as cL2, cU as cU2, cW as cW2, c$ as c$2, d3, cn, ci, d4, d5, d6, ck, d7, d8, cm } from "./index-Cq3YFYX2.js";
1
+ import { a6, cG, cH, cI, cJ, cK, aq, cL, a7, cp, cM, cN, cO, a5, cP, cn, cQ, cR, cS, cT, cU, cB, cV, cW, cX, cY, cZ, c_, c$, d0, d1, d2, d3, d4, au, d5, cA, d6, cI as cI2, cN as cN2, cP as cP2, cY as cY2, c_ as c_2, d3 as d32, d7, cr, cm, d8, d9, da, co, db, dc, cq } from "./index-DLKF27_V.js";
2
2
  export {
3
- a4 as BalloonShell,
4
- cC as Button,
5
- cD as Checkbox,
6
- cE as ColorPicker,
7
- cF as CommandRegistry,
8
- cG as DEFAULT_PALETTE,
9
- ao as Dialog,
10
- cH as DialogFooter,
11
- a5 as DocumentShell,
12
- cl as Editor,
13
- cI as FloatingActionButton,
14
- cJ as GridPicker,
15
- cK as IconButton,
16
- a3 as InlineShell,
17
- cL as Menu,
18
- cj as MenuRegistry,
19
- cM as OASIS_BUILTIN_COMMANDS,
20
- cN as OASIS_MENU_ITEMS,
21
- cO as OASIS_TOOLBAR_ITEMS,
22
- cP as OasisEditorAppLazy,
23
- cQ as OasisEditorContainer,
24
- cx as OasisEditorLoading,
25
- cR as PluginCollection,
26
- cS as Popover,
27
- cT as RIBBON_TABS,
28
- cU as Select,
29
- cV as SelectField,
30
- cW as Separator,
31
- cX as SidePanel,
32
- cY as SidePanelBody,
33
- cZ as SidePanelFooter,
34
- c_ as SidePanelHeader,
35
- c$ as SplitButton,
36
- d0 as StyleGallery,
37
- as as Tabs,
38
- d1 as TextField,
39
- cw as Toolbar,
40
- d2 as ToolbarButton,
41
- cE2 as ToolbarColorPicker,
42
- cJ2 as ToolbarGridPicker,
43
- cL2 as ToolbarMenu,
44
- cU2 as ToolbarSelect,
45
- cW2 as ToolbarSeparator,
46
- c$2 as ToolbarSplitButton,
47
- d3 as buildRibbonTabDefinitions,
48
- cn as commandRefName,
49
- ci as createDefaultToolbarPreset,
50
- d4 as createEditorCommandBus,
51
- d5 as createOasisEditor,
52
- d6 as createOasisEditorContainer,
53
- ck as createToolbarRegistry,
54
- d7 as mount,
55
- d8 as registerToolbarRenderer,
56
- cm as resolveCommandRef
3
+ a6 as BalloonShell,
4
+ cG as Button,
5
+ cH as Checkbox,
6
+ cI as ColorPicker,
7
+ cJ as CommandRegistry,
8
+ cK as DEFAULT_PALETTE,
9
+ aq as Dialog,
10
+ cL as DialogFooter,
11
+ a7 as DocumentShell,
12
+ cp as Editor,
13
+ cM as FloatingActionButton,
14
+ cN as GridPicker,
15
+ cO as IconButton,
16
+ a5 as InlineShell,
17
+ cP as Menu,
18
+ cn as MenuRegistry,
19
+ cQ as OASIS_BUILTIN_COMMANDS,
20
+ cR as OASIS_MENU_ITEMS,
21
+ cS as OASIS_TOOLBAR_ITEMS,
22
+ cT as OasisEditorAppLazy,
23
+ cU as OasisEditorContainer,
24
+ cB as OasisEditorLoading,
25
+ cV as PluginCollection,
26
+ cW as Popover,
27
+ cX as RIBBON_TABS,
28
+ cY as Select,
29
+ cZ as SelectField,
30
+ c_ as Separator,
31
+ c$ as SidePanel,
32
+ d0 as SidePanelBody,
33
+ d1 as SidePanelFooter,
34
+ d2 as SidePanelHeader,
35
+ d3 as SplitButton,
36
+ d4 as StyleGallery,
37
+ au as Tabs,
38
+ d5 as TextField,
39
+ cA as Toolbar,
40
+ d6 as ToolbarButton,
41
+ cI2 as ToolbarColorPicker,
42
+ cN2 as ToolbarGridPicker,
43
+ cP2 as ToolbarMenu,
44
+ cY2 as ToolbarSelect,
45
+ c_2 as ToolbarSeparator,
46
+ d32 as ToolbarSplitButton,
47
+ d7 as buildRibbonTabDefinitions,
48
+ cr as commandRefName,
49
+ cm as createDefaultToolbarPreset,
50
+ d8 as createEditorCommandBus,
51
+ d9 as createOasisEditor,
52
+ da as createOasisEditorContainer,
53
+ co as createToolbarRegistry,
54
+ db as mount,
55
+ dc as registerToolbarRenderer,
56
+ cq as resolveCommandRef
57
57
  };