@windoc/core 0.3.21 → 0.3.22
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 +45 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +746 -96
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +746 -96
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -259,6 +259,19 @@ interface IPlaceholder {
|
|
|
259
259
|
font?: string;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
interface ISplitCellSelection {
|
|
263
|
+
pagingId: string;
|
|
264
|
+
rootTrId: string;
|
|
265
|
+
colIndex: number;
|
|
266
|
+
}
|
|
267
|
+
interface ITableCellSelection {
|
|
268
|
+
tableId?: string;
|
|
269
|
+
trId?: string;
|
|
270
|
+
tdId?: string;
|
|
271
|
+
pagingId?: string;
|
|
272
|
+
rootTrId?: string;
|
|
273
|
+
colIndex?: number;
|
|
274
|
+
}
|
|
262
275
|
interface IRange {
|
|
263
276
|
startIndex: number;
|
|
264
277
|
endIndex: number;
|
|
@@ -269,6 +282,8 @@ interface IRange {
|
|
|
269
282
|
startTrIndex?: number;
|
|
270
283
|
endTrIndex?: number;
|
|
271
284
|
zone?: EditorZone;
|
|
285
|
+
splitCellSelection?: ISplitCellSelection;
|
|
286
|
+
tableCellSelection?: ITableCellSelection;
|
|
272
287
|
}
|
|
273
288
|
type RangeRowArray = Map<number, number[]>;
|
|
274
289
|
type RangeRowMap = Map<number, Set<number>>;
|
|
@@ -791,6 +806,7 @@ interface ICurrentPosition {
|
|
|
791
806
|
tableId?: string;
|
|
792
807
|
zone?: EditorZone;
|
|
793
808
|
hitLineStartIndex?: number;
|
|
809
|
+
splitCellSelection?: ISplitCellSelection;
|
|
794
810
|
}
|
|
795
811
|
interface IGetPositionByXYPayload {
|
|
796
812
|
x: number;
|
|
@@ -1654,6 +1670,10 @@ declare class RangeManager {
|
|
|
1654
1670
|
constructor(draw: Draw);
|
|
1655
1671
|
getRange(): IRange;
|
|
1656
1672
|
clearRange(): void;
|
|
1673
|
+
getSplitCellSelection(): ISplitCellSelection | undefined;
|
|
1674
|
+
setSplitCellSelection(payload?: ISplitCellSelection | null): void;
|
|
1675
|
+
getTableCellSelection(): ITableCellSelection | undefined;
|
|
1676
|
+
setTableCellSelection(payload?: ITableCellSelection | null): void;
|
|
1657
1677
|
setDefaultStyle(style: IRangeElementStyle | null): void;
|
|
1658
1678
|
getDefaultStyle(): IRangeElementStyle | null;
|
|
1659
1679
|
getRangeAnchorStyle(elementList: IElement[], anchorIndex: number): IElement | null;
|
|
@@ -1775,6 +1795,8 @@ declare class TableParticle {
|
|
|
1775
1795
|
getTdListByRowIndex(trList: ITr[], rowIndex: number): ITd[];
|
|
1776
1796
|
computeRowColInfo(element: IElement): void;
|
|
1777
1797
|
drawRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
|
|
1798
|
+
private _isSelectedCell;
|
|
1799
|
+
drawCellRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number, selection: ITableCellSelection): void;
|
|
1778
1800
|
render(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
|
|
1779
1801
|
}
|
|
1780
1802
|
|
|
@@ -2197,6 +2219,8 @@ declare class ListParticle {
|
|
|
2197
2219
|
outdent(): void;
|
|
2198
2220
|
unsetList(): void;
|
|
2199
2221
|
getListIndentWidth(element: IElement): number;
|
|
2222
|
+
private _getListMarkerStyleElement;
|
|
2223
|
+
private _getListMarkerText;
|
|
2200
2224
|
computeListStyle(ctx: CanvasRenderingContext2D, elementList: IElement[]): Map<string, number>;
|
|
2201
2225
|
getListStyleWidth(ctx: CanvasRenderingContext2D, listElementList: IElement[]): number;
|
|
2202
2226
|
private _getOlStyleForLevel;
|
|
@@ -2281,6 +2305,9 @@ declare class TableOperate {
|
|
|
2281
2305
|
private tableParticle;
|
|
2282
2306
|
private options;
|
|
2283
2307
|
constructor(draw: Draw);
|
|
2308
|
+
private getActiveTableElements;
|
|
2309
|
+
private getSplitCellStyleSelection;
|
|
2310
|
+
private getStyleTargetRowCol;
|
|
2284
2311
|
insertTable(row: number, col: number): void;
|
|
2285
2312
|
insertTableTopRow(): void;
|
|
2286
2313
|
insertTableBottomRow(): void;
|
|
@@ -2303,6 +2330,7 @@ declare class TableOperate {
|
|
|
2303
2330
|
tableTdBorderColor(payload: string): void;
|
|
2304
2331
|
tableTdPadding(payload: IPadding): void;
|
|
2305
2332
|
tableSelectAll(): void;
|
|
2333
|
+
tableTdSelectAll(): void;
|
|
2306
2334
|
}
|
|
2307
2335
|
|
|
2308
2336
|
declare class Area {
|
|
@@ -2506,6 +2534,21 @@ declare class Draw {
|
|
|
2506
2534
|
getTextParticle(): TextParticle;
|
|
2507
2535
|
getHeaderElementList(): IElement[];
|
|
2508
2536
|
getTableElementList(sourceElementList: IElement[]): IElement[];
|
|
2537
|
+
getSplitCellSelectionContext(sourceElementList?: IElement[], splitCellSelection?: ISplitCellSelection | undefined): {
|
|
2538
|
+
value: IElement[];
|
|
2539
|
+
positionList: IElementPosition[];
|
|
2540
|
+
cellContextList: Array<{
|
|
2541
|
+
tableIndex: number;
|
|
2542
|
+
trIndex: number;
|
|
2543
|
+
tdIndex: number;
|
|
2544
|
+
element: IElement;
|
|
2545
|
+
tr: ITr;
|
|
2546
|
+
td: ITd;
|
|
2547
|
+
}>;
|
|
2548
|
+
} | null;
|
|
2549
|
+
private syncTableElementContext;
|
|
2550
|
+
private getCollapsedSplitTableCursorContext;
|
|
2551
|
+
private applyCollapsedSplitTableCursor;
|
|
2509
2552
|
getElementList(): IElement[];
|
|
2510
2553
|
getMainElementList(): IElement[];
|
|
2511
2554
|
getOriginalElementList(): IElement[];
|
|
@@ -2515,6 +2558,7 @@ declare class Draw {
|
|
|
2515
2558
|
insertElementList(payload: IElement[], options?: IInsertElementListOption): void;
|
|
2516
2559
|
appendElementList(elementList: IElement[], options?: IAppendElementListOption): void;
|
|
2517
2560
|
spliceElementList(elementList: IElement[], start: number, deleteCount: number, items?: IElement[], options?: ISpliceElementListOption): void;
|
|
2561
|
+
replaceSplitCellSelection(payload: IElement[], splitCellSelection?: ISplitCellSelection): number;
|
|
2518
2562
|
getCanvasEvent(): CanvasEvent;
|
|
2519
2563
|
getGlobalEvent(): GlobalEvent;
|
|
2520
2564
|
getListener(): Listener;
|
|
@@ -2608,6 +2652,7 @@ declare class CommandAdapt {
|
|
|
2608
2652
|
private zone;
|
|
2609
2653
|
private tableOperate;
|
|
2610
2654
|
constructor(draw: Draw);
|
|
2655
|
+
private getStyleSelectionElementList;
|
|
2611
2656
|
mode(payload: EditorMode): void;
|
|
2612
2657
|
cut(): Promise<void>;
|
|
2613
2658
|
copy(payload?: ICopyOption): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -259,6 +259,19 @@ interface IPlaceholder {
|
|
|
259
259
|
font?: string;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
interface ISplitCellSelection {
|
|
263
|
+
pagingId: string;
|
|
264
|
+
rootTrId: string;
|
|
265
|
+
colIndex: number;
|
|
266
|
+
}
|
|
267
|
+
interface ITableCellSelection {
|
|
268
|
+
tableId?: string;
|
|
269
|
+
trId?: string;
|
|
270
|
+
tdId?: string;
|
|
271
|
+
pagingId?: string;
|
|
272
|
+
rootTrId?: string;
|
|
273
|
+
colIndex?: number;
|
|
274
|
+
}
|
|
262
275
|
interface IRange {
|
|
263
276
|
startIndex: number;
|
|
264
277
|
endIndex: number;
|
|
@@ -269,6 +282,8 @@ interface IRange {
|
|
|
269
282
|
startTrIndex?: number;
|
|
270
283
|
endTrIndex?: number;
|
|
271
284
|
zone?: EditorZone;
|
|
285
|
+
splitCellSelection?: ISplitCellSelection;
|
|
286
|
+
tableCellSelection?: ITableCellSelection;
|
|
272
287
|
}
|
|
273
288
|
type RangeRowArray = Map<number, number[]>;
|
|
274
289
|
type RangeRowMap = Map<number, Set<number>>;
|
|
@@ -791,6 +806,7 @@ interface ICurrentPosition {
|
|
|
791
806
|
tableId?: string;
|
|
792
807
|
zone?: EditorZone;
|
|
793
808
|
hitLineStartIndex?: number;
|
|
809
|
+
splitCellSelection?: ISplitCellSelection;
|
|
794
810
|
}
|
|
795
811
|
interface IGetPositionByXYPayload {
|
|
796
812
|
x: number;
|
|
@@ -1654,6 +1670,10 @@ declare class RangeManager {
|
|
|
1654
1670
|
constructor(draw: Draw);
|
|
1655
1671
|
getRange(): IRange;
|
|
1656
1672
|
clearRange(): void;
|
|
1673
|
+
getSplitCellSelection(): ISplitCellSelection | undefined;
|
|
1674
|
+
setSplitCellSelection(payload?: ISplitCellSelection | null): void;
|
|
1675
|
+
getTableCellSelection(): ITableCellSelection | undefined;
|
|
1676
|
+
setTableCellSelection(payload?: ITableCellSelection | null): void;
|
|
1657
1677
|
setDefaultStyle(style: IRangeElementStyle | null): void;
|
|
1658
1678
|
getDefaultStyle(): IRangeElementStyle | null;
|
|
1659
1679
|
getRangeAnchorStyle(elementList: IElement[], anchorIndex: number): IElement | null;
|
|
@@ -1775,6 +1795,8 @@ declare class TableParticle {
|
|
|
1775
1795
|
getTdListByRowIndex(trList: ITr[], rowIndex: number): ITd[];
|
|
1776
1796
|
computeRowColInfo(element: IElement): void;
|
|
1777
1797
|
drawRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
|
|
1798
|
+
private _isSelectedCell;
|
|
1799
|
+
drawCellRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number, selection: ITableCellSelection): void;
|
|
1778
1800
|
render(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
|
|
1779
1801
|
}
|
|
1780
1802
|
|
|
@@ -2197,6 +2219,8 @@ declare class ListParticle {
|
|
|
2197
2219
|
outdent(): void;
|
|
2198
2220
|
unsetList(): void;
|
|
2199
2221
|
getListIndentWidth(element: IElement): number;
|
|
2222
|
+
private _getListMarkerStyleElement;
|
|
2223
|
+
private _getListMarkerText;
|
|
2200
2224
|
computeListStyle(ctx: CanvasRenderingContext2D, elementList: IElement[]): Map<string, number>;
|
|
2201
2225
|
getListStyleWidth(ctx: CanvasRenderingContext2D, listElementList: IElement[]): number;
|
|
2202
2226
|
private _getOlStyleForLevel;
|
|
@@ -2281,6 +2305,9 @@ declare class TableOperate {
|
|
|
2281
2305
|
private tableParticle;
|
|
2282
2306
|
private options;
|
|
2283
2307
|
constructor(draw: Draw);
|
|
2308
|
+
private getActiveTableElements;
|
|
2309
|
+
private getSplitCellStyleSelection;
|
|
2310
|
+
private getStyleTargetRowCol;
|
|
2284
2311
|
insertTable(row: number, col: number): void;
|
|
2285
2312
|
insertTableTopRow(): void;
|
|
2286
2313
|
insertTableBottomRow(): void;
|
|
@@ -2303,6 +2330,7 @@ declare class TableOperate {
|
|
|
2303
2330
|
tableTdBorderColor(payload: string): void;
|
|
2304
2331
|
tableTdPadding(payload: IPadding): void;
|
|
2305
2332
|
tableSelectAll(): void;
|
|
2333
|
+
tableTdSelectAll(): void;
|
|
2306
2334
|
}
|
|
2307
2335
|
|
|
2308
2336
|
declare class Area {
|
|
@@ -2506,6 +2534,21 @@ declare class Draw {
|
|
|
2506
2534
|
getTextParticle(): TextParticle;
|
|
2507
2535
|
getHeaderElementList(): IElement[];
|
|
2508
2536
|
getTableElementList(sourceElementList: IElement[]): IElement[];
|
|
2537
|
+
getSplitCellSelectionContext(sourceElementList?: IElement[], splitCellSelection?: ISplitCellSelection | undefined): {
|
|
2538
|
+
value: IElement[];
|
|
2539
|
+
positionList: IElementPosition[];
|
|
2540
|
+
cellContextList: Array<{
|
|
2541
|
+
tableIndex: number;
|
|
2542
|
+
trIndex: number;
|
|
2543
|
+
tdIndex: number;
|
|
2544
|
+
element: IElement;
|
|
2545
|
+
tr: ITr;
|
|
2546
|
+
td: ITd;
|
|
2547
|
+
}>;
|
|
2548
|
+
} | null;
|
|
2549
|
+
private syncTableElementContext;
|
|
2550
|
+
private getCollapsedSplitTableCursorContext;
|
|
2551
|
+
private applyCollapsedSplitTableCursor;
|
|
2509
2552
|
getElementList(): IElement[];
|
|
2510
2553
|
getMainElementList(): IElement[];
|
|
2511
2554
|
getOriginalElementList(): IElement[];
|
|
@@ -2515,6 +2558,7 @@ declare class Draw {
|
|
|
2515
2558
|
insertElementList(payload: IElement[], options?: IInsertElementListOption): void;
|
|
2516
2559
|
appendElementList(elementList: IElement[], options?: IAppendElementListOption): void;
|
|
2517
2560
|
spliceElementList(elementList: IElement[], start: number, deleteCount: number, items?: IElement[], options?: ISpliceElementListOption): void;
|
|
2561
|
+
replaceSplitCellSelection(payload: IElement[], splitCellSelection?: ISplitCellSelection): number;
|
|
2518
2562
|
getCanvasEvent(): CanvasEvent;
|
|
2519
2563
|
getGlobalEvent(): GlobalEvent;
|
|
2520
2564
|
getListener(): Listener;
|
|
@@ -2608,6 +2652,7 @@ declare class CommandAdapt {
|
|
|
2608
2652
|
private zone;
|
|
2609
2653
|
private tableOperate;
|
|
2610
2654
|
constructor(draw: Draw);
|
|
2655
|
+
private getStyleSelectionElementList;
|
|
2611
2656
|
mode(payload: EditorMode): void;
|
|
2612
2657
|
cut(): Promise<void>;
|
|
2613
2658
|
copy(payload?: ICopyOption): Promise<void>;
|