@windoc/core 0.3.23 → 0.3.25

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/index.d.mts CHANGED
@@ -728,6 +728,7 @@ interface IDrawOption {
728
728
  isInit?: boolean;
729
729
  isSourceHistory?: boolean;
730
730
  isFirstRender?: boolean;
731
+ dirtyStartIndex?: number;
731
732
  }
732
733
  interface IForceUpdateOption {
733
734
  isSubmitHistory?: boolean;
@@ -785,6 +786,11 @@ interface IComputeRowListPayload {
785
786
  mainOuterHeight?: number;
786
787
  surroundElementList?: IElement[];
787
788
  initialListState?: IListStateSeed;
789
+ hasListElement?: boolean;
790
+ fromIndex?: number;
791
+ initialY?: number;
792
+ initialPageNo?: number;
793
+ initialRowIndex?: number;
788
794
  }
789
795
 
790
796
  interface ICurrentPosition {
@@ -1325,6 +1331,12 @@ interface IEditorResult {
1325
1331
  data: IEditorData;
1326
1332
  options: IEditorOption;
1327
1333
  }
1334
+ interface IExportDocxOption {
1335
+ fileName?: string;
1336
+ }
1337
+ interface IExportPdfOption {
1338
+ fileName?: string;
1339
+ }
1328
1340
  interface IEditorHTML {
1329
1341
  header: string;
1330
1342
  main: string;
@@ -1524,6 +1536,9 @@ declare class GlobalEvent {
1524
1536
  private _handleDprChange;
1525
1537
  }
1526
1538
 
1539
+ interface IHistoryEntry {
1540
+ restore: Function;
1541
+ }
1527
1542
  declare class HistoryManager {
1528
1543
  private undoStack;
1529
1544
  private redoStack;
@@ -1532,8 +1547,8 @@ declare class HistoryManager {
1532
1547
  constructor(draw: Draw);
1533
1548
  undo(): void;
1534
1549
  redo(): void;
1535
- execute(fn: Function): void;
1536
- replaceLatest(fn: Function): void;
1550
+ execute(entry: IHistoryEntry | Function): void;
1551
+ replaceLatest(entry: IHistoryEntry | Function): void;
1537
1552
  isInputGroupable(): boolean;
1538
1553
  recordInputTime(): void;
1539
1554
  resetInputTime(): void;
@@ -1541,7 +1556,8 @@ declare class HistoryManager {
1541
1556
  isCanRedo(): boolean;
1542
1557
  isStackEmpty(): boolean;
1543
1558
  recovery(): void;
1544
- popUndo(): Function | undefined;
1559
+ popUndo(): IHistoryEntry | undefined;
1560
+ private _normalizeEntry;
1545
1561
  }
1546
1562
 
1547
1563
  interface IRangeStyle {
@@ -2342,6 +2358,7 @@ declare class Area {
2342
2358
  private areaInfoMap;
2343
2359
  constructor(draw: Draw);
2344
2360
  getAreaInfo(): Map<string, IAreaInfo>;
2361
+ clear(): void;
2345
2362
  getActiveAreaId(): string | null;
2346
2363
  getActiveAreaInfo(): IAreaInfo | null;
2347
2364
  isReadonly(): boolean;
@@ -2393,6 +2410,7 @@ declare class Draw {
2393
2410
  private pageContainer;
2394
2411
  private pageList;
2395
2412
  private ctxList;
2413
+ private measureCtx;
2396
2414
  private pageNo;
2397
2415
  private renderCount;
2398
2416
  private pagePixelRatio;
@@ -2457,6 +2475,9 @@ declare class Draw {
2457
2475
  private WORD_LIKE_REG;
2458
2476
  private rowList;
2459
2477
  private pageRowList;
2478
+ private pageRenderVersionList;
2479
+ private elementFontCache;
2480
+ private elementRowMarginCache;
2460
2481
  private painterStyle;
2461
2482
  private painterOptions;
2462
2483
  private visiblePageNoList;
@@ -2608,6 +2629,7 @@ declare class Draw {
2608
2629
  private _formatContainer;
2609
2630
  private _createPageContainer;
2610
2631
  private _createPage;
2632
+ private _createMeasureContext;
2611
2633
  private _initPageContext;
2612
2634
  getElementFont(el: IElement, scale?: number): string;
2613
2635
  getElementSize(el: IElement): number;
@@ -2625,8 +2647,10 @@ declare class Draw {
2625
2647
  private _drawColumnGuide;
2626
2648
  private _drawPage;
2627
2649
  private _disconnectLazyRender;
2628
- private _lazyRender;
2629
2650
  private _immediateRender;
2651
+ private _collectMainRenderMeta;
2652
+ private _getIncrementalRestartState;
2653
+ renderVisiblePages(pageNoList?: number[]): void;
2630
2654
  render(payload?: IDrawOption): void;
2631
2655
  setCursor(curIndex: number | undefined): number | undefined;
2632
2656
  submitHistory(curIndex: number | undefined, isInput?: boolean): void;
@@ -2728,6 +2752,8 @@ declare class CommandAdapt {
2728
2752
  getSearchNavigateInfo(): null | INavigateInfo;
2729
2753
  replace(payload: string, option?: IReplaceOption): void;
2730
2754
  print(): Promise<void>;
2755
+ exportDocx(payload?: IExportDocxOption): Promise<void>;
2756
+ exportPdf(payload?: IExportPdfOption): Promise<void>;
2731
2757
  replaceImageElement(payload: string): void;
2732
2758
  saveAsImageElement(): void;
2733
2759
  setImageCrop(crop: IImageCrop): void;
@@ -2879,6 +2905,8 @@ declare class Command {
2879
2905
  executeSearchNavigateNext: CommandAdapt['searchNavigateNext'];
2880
2906
  executeReplace: CommandAdapt['replace'];
2881
2907
  executePrint: CommandAdapt['print'];
2908
+ executeExportDocx: CommandAdapt['exportDocx'];
2909
+ executeExportPdf: CommandAdapt['exportPdf'];
2882
2910
  executeReplaceImageElement: CommandAdapt['replaceImageElement'];
2883
2911
  executeSaveAsImageElement: CommandAdapt['saveAsImageElement'];
2884
2912
  executeSetImageCrop: CommandAdapt['setImageCrop'];
@@ -3316,4 +3344,4 @@ declare class Editor {
3316
3344
  constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
3317
3345
  }
3318
3346
 
3319
- export { AreaMode, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType, Dialog, EDITOR_CLIPBOARD, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, FlexDirection, type IBadge, type IBlock, type ICatalog, type ICatalogItem, type IContextMenuContext, type IEditorData, type IEditorOption, type IEditorResult, type IElement, type IGetElementListByHTMLOption, type ILang, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, type INavigateInfo, type IRange, type IRangeStyle, type IRegisterContextMenu, type IWatermark, ImageDisplay, KeyMap, LETTER_CLASS, LineNumberType, ListStyle, ListType, LocationPosition, MaxHeightRatio, NumberType, OlPreset, PageMode, PaperDirection, RenderMode, RowFlex, Signature, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, UlPreset, VerticalAlign, WatermarkType, WordBreak, cm, cmToPx, createDomFromElementList, Editor as default, getElementListByHTML, getTextFromElementList, inch, mm, pxToCm, splitText };
3347
+ export { AreaMode, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType, Dialog, EDITOR_CLIPBOARD, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, FlexDirection, type IBadge, type IBlock, type ICatalog, type ICatalogItem, type IContextMenuContext, type IEditorData, type IEditorOption, type IEditorResult, type IElement, type IExportDocxOption, type IExportPdfOption, type IGetElementListByHTMLOption, type ILang, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, type INavigateInfo, type IRange, type IRangeStyle, type IRegisterContextMenu, type IWatermark, ImageDisplay, KeyMap, LETTER_CLASS, LineNumberType, ListStyle, ListType, LocationPosition, MaxHeightRatio, NumberType, OlPreset, PageMode, PaperDirection, RenderMode, RowFlex, Signature, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, UlPreset, VerticalAlign, WatermarkType, WordBreak, cm, cmToPx, createDomFromElementList, Editor as default, getElementListByHTML, getTextFromElementList, inch, mm, pxToCm, splitText };
package/dist/index.d.ts CHANGED
@@ -728,6 +728,7 @@ interface IDrawOption {
728
728
  isInit?: boolean;
729
729
  isSourceHistory?: boolean;
730
730
  isFirstRender?: boolean;
731
+ dirtyStartIndex?: number;
731
732
  }
732
733
  interface IForceUpdateOption {
733
734
  isSubmitHistory?: boolean;
@@ -785,6 +786,11 @@ interface IComputeRowListPayload {
785
786
  mainOuterHeight?: number;
786
787
  surroundElementList?: IElement[];
787
788
  initialListState?: IListStateSeed;
789
+ hasListElement?: boolean;
790
+ fromIndex?: number;
791
+ initialY?: number;
792
+ initialPageNo?: number;
793
+ initialRowIndex?: number;
788
794
  }
789
795
 
790
796
  interface ICurrentPosition {
@@ -1325,6 +1331,12 @@ interface IEditorResult {
1325
1331
  data: IEditorData;
1326
1332
  options: IEditorOption;
1327
1333
  }
1334
+ interface IExportDocxOption {
1335
+ fileName?: string;
1336
+ }
1337
+ interface IExportPdfOption {
1338
+ fileName?: string;
1339
+ }
1328
1340
  interface IEditorHTML {
1329
1341
  header: string;
1330
1342
  main: string;
@@ -1524,6 +1536,9 @@ declare class GlobalEvent {
1524
1536
  private _handleDprChange;
1525
1537
  }
1526
1538
 
1539
+ interface IHistoryEntry {
1540
+ restore: Function;
1541
+ }
1527
1542
  declare class HistoryManager {
1528
1543
  private undoStack;
1529
1544
  private redoStack;
@@ -1532,8 +1547,8 @@ declare class HistoryManager {
1532
1547
  constructor(draw: Draw);
1533
1548
  undo(): void;
1534
1549
  redo(): void;
1535
- execute(fn: Function): void;
1536
- replaceLatest(fn: Function): void;
1550
+ execute(entry: IHistoryEntry | Function): void;
1551
+ replaceLatest(entry: IHistoryEntry | Function): void;
1537
1552
  isInputGroupable(): boolean;
1538
1553
  recordInputTime(): void;
1539
1554
  resetInputTime(): void;
@@ -1541,7 +1556,8 @@ declare class HistoryManager {
1541
1556
  isCanRedo(): boolean;
1542
1557
  isStackEmpty(): boolean;
1543
1558
  recovery(): void;
1544
- popUndo(): Function | undefined;
1559
+ popUndo(): IHistoryEntry | undefined;
1560
+ private _normalizeEntry;
1545
1561
  }
1546
1562
 
1547
1563
  interface IRangeStyle {
@@ -2342,6 +2358,7 @@ declare class Area {
2342
2358
  private areaInfoMap;
2343
2359
  constructor(draw: Draw);
2344
2360
  getAreaInfo(): Map<string, IAreaInfo>;
2361
+ clear(): void;
2345
2362
  getActiveAreaId(): string | null;
2346
2363
  getActiveAreaInfo(): IAreaInfo | null;
2347
2364
  isReadonly(): boolean;
@@ -2393,6 +2410,7 @@ declare class Draw {
2393
2410
  private pageContainer;
2394
2411
  private pageList;
2395
2412
  private ctxList;
2413
+ private measureCtx;
2396
2414
  private pageNo;
2397
2415
  private renderCount;
2398
2416
  private pagePixelRatio;
@@ -2457,6 +2475,9 @@ declare class Draw {
2457
2475
  private WORD_LIKE_REG;
2458
2476
  private rowList;
2459
2477
  private pageRowList;
2478
+ private pageRenderVersionList;
2479
+ private elementFontCache;
2480
+ private elementRowMarginCache;
2460
2481
  private painterStyle;
2461
2482
  private painterOptions;
2462
2483
  private visiblePageNoList;
@@ -2608,6 +2629,7 @@ declare class Draw {
2608
2629
  private _formatContainer;
2609
2630
  private _createPageContainer;
2610
2631
  private _createPage;
2632
+ private _createMeasureContext;
2611
2633
  private _initPageContext;
2612
2634
  getElementFont(el: IElement, scale?: number): string;
2613
2635
  getElementSize(el: IElement): number;
@@ -2625,8 +2647,10 @@ declare class Draw {
2625
2647
  private _drawColumnGuide;
2626
2648
  private _drawPage;
2627
2649
  private _disconnectLazyRender;
2628
- private _lazyRender;
2629
2650
  private _immediateRender;
2651
+ private _collectMainRenderMeta;
2652
+ private _getIncrementalRestartState;
2653
+ renderVisiblePages(pageNoList?: number[]): void;
2630
2654
  render(payload?: IDrawOption): void;
2631
2655
  setCursor(curIndex: number | undefined): number | undefined;
2632
2656
  submitHistory(curIndex: number | undefined, isInput?: boolean): void;
@@ -2728,6 +2752,8 @@ declare class CommandAdapt {
2728
2752
  getSearchNavigateInfo(): null | INavigateInfo;
2729
2753
  replace(payload: string, option?: IReplaceOption): void;
2730
2754
  print(): Promise<void>;
2755
+ exportDocx(payload?: IExportDocxOption): Promise<void>;
2756
+ exportPdf(payload?: IExportPdfOption): Promise<void>;
2731
2757
  replaceImageElement(payload: string): void;
2732
2758
  saveAsImageElement(): void;
2733
2759
  setImageCrop(crop: IImageCrop): void;
@@ -2879,6 +2905,8 @@ declare class Command {
2879
2905
  executeSearchNavigateNext: CommandAdapt['searchNavigateNext'];
2880
2906
  executeReplace: CommandAdapt['replace'];
2881
2907
  executePrint: CommandAdapt['print'];
2908
+ executeExportDocx: CommandAdapt['exportDocx'];
2909
+ executeExportPdf: CommandAdapt['exportPdf'];
2882
2910
  executeReplaceImageElement: CommandAdapt['replaceImageElement'];
2883
2911
  executeSaveAsImageElement: CommandAdapt['saveAsImageElement'];
2884
2912
  executeSetImageCrop: CommandAdapt['setImageCrop'];
@@ -3316,4 +3344,4 @@ declare class Editor {
3316
3344
  constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
3317
3345
  }
3318
3346
 
3319
- export { AreaMode, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType, Dialog, EDITOR_CLIPBOARD, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, FlexDirection, type IBadge, type IBlock, type ICatalog, type ICatalogItem, type IContextMenuContext, type IEditorData, type IEditorOption, type IEditorResult, type IElement, type IGetElementListByHTMLOption, type ILang, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, type INavigateInfo, type IRange, type IRangeStyle, type IRegisterContextMenu, type IWatermark, ImageDisplay, KeyMap, LETTER_CLASS, LineNumberType, ListStyle, ListType, LocationPosition, MaxHeightRatio, NumberType, OlPreset, PageMode, PaperDirection, RenderMode, RowFlex, Signature, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, UlPreset, VerticalAlign, WatermarkType, WordBreak, cm, cmToPx, createDomFromElementList, Editor as default, getElementListByHTML, getTextFromElementList, inch, mm, pxToCm, splitText };
3347
+ export { AreaMode, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType, Dialog, EDITOR_CLIPBOARD, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, FlexDirection, type IBadge, type IBlock, type ICatalog, type ICatalogItem, type IContextMenuContext, type IEditorData, type IEditorOption, type IEditorResult, type IElement, type IExportDocxOption, type IExportPdfOption, type IGetElementListByHTMLOption, type ILang, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, type INavigateInfo, type IRange, type IRangeStyle, type IRegisterContextMenu, type IWatermark, ImageDisplay, KeyMap, LETTER_CLASS, LineNumberType, ListStyle, ListType, LocationPosition, MaxHeightRatio, NumberType, OlPreset, PageMode, PaperDirection, RenderMode, RowFlex, Signature, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, UlPreset, VerticalAlign, WatermarkType, WordBreak, cm, cmToPx, createDomFromElementList, Editor as default, getElementListByHTML, getTextFromElementList, inch, mm, pxToCm, splitText };