quill-table-up 3.0.3 → 3.1.1

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.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as quill0 from "quill";
2
- import Quill, { EmitterSource, Parchment, Range } from "quill";
2
+ import Quill, { Delta, EmitterSource, Op, Parchment, Range } from "quill";
3
3
  import { Context } from "quill/modules/keyboard";
4
4
  import TypeScroll from "quill/blots/scroll";
5
5
  import TypeBlock, { BlockEmbed } from "quill/blots/block";
@@ -7,7 +7,7 @@ import TypeInline from "quill/blots/inline";
7
7
  import TypeText from "quill/blots/text";
8
8
  import BaseTheme from "quill/themes/base";
9
9
  import Picker from "quill/ui/picker";
10
- import { Delta } from "quill/core";
10
+ import { Delta as Delta$1 } from "quill/core";
11
11
  import TypeClipboard from "quill/modules/clipboard";
12
12
 
13
13
  //#region src/formats/container-format.d.ts
@@ -362,10 +362,60 @@ declare class TableAlign extends TableDomSelector {
362
362
  destroy(): void;
363
363
  }
364
364
  //#endregion
365
- //#region src/modules/table-clipboard.d.ts
365
+ //#region src/modules/table-clipboard/paste-cell-into-cell.d.ts
366
+ interface ArgumentsModule {
367
+ quill: Quill;
368
+ talbeModule: TableUp;
369
+ }
370
+ interface CellUpdate {
371
+ offset: number;
372
+ length: number;
373
+ insertDelta: Delta;
374
+ cell: TableCellInnerFormat;
375
+ rowspan?: number;
376
+ colspan?: number;
377
+ emptyRow?: string[];
378
+ }
379
+ interface TableCellValueLike {
380
+ rowId: string;
381
+ colId: string;
382
+ colspan: number;
383
+ rowspan: number;
384
+ emptyRow?: string[];
385
+ }
386
+ interface CellRecord extends TableCellValueLike {
387
+ deltaOps: Op[];
388
+ }
389
+ declare function pasteCells(modules: ArgumentsModule, selectedTds: TableCellInnerFormat[], pasteDelta: Op[]): void;
390
+ declare function getTableCellStructure(cells: TableCellInnerFormat[]): {
391
+ rows: number;
392
+ cols: number;
393
+ };
394
+ declare function parsePasteDelta(delta: Op[]): {
395
+ cells: CellRecord[];
396
+ rows: number;
397
+ cols: number;
398
+ };
399
+ declare function getCountByPosition(infos: ReturnType<typeof getCellPositions>): {
400
+ rows: number;
401
+ cols: number;
402
+ };
403
+ declare function pasteWithStructure(selectedTds: TableCellInnerFormat[], pasteCells: CellRecord[], modules: ArgumentsModule): void;
404
+ declare function getCellPositions<T extends TableCellValueLike>(cells: T[]): {
405
+ cell: T;
406
+ rowIndex: number;
407
+ colIndex: number;
408
+ }[];
409
+ declare function groupCellByRow<T extends TableCellValueLike>(cells: T[]): Map<string, T[]>;
410
+ declare function pasteWithLoop(modules: ArgumentsModule, selectedTds: TableCellInnerFormat[], pasteCells: CellRecord[]): void;
411
+ declare function prepareCellUpdate(modules: ArgumentsModule, cell: TableCellInnerFormat, deltaOps: Op[], attrs?: Pick<TableCellValue, 'rowspan' | 'colspan' | 'emptyRow'>): CellUpdate;
412
+ declare function applyCellUpdates(modules: ArgumentsModule, updates: CellUpdate[]): void;
413
+ declare function removeOverlappingCells(modules: ArgumentsModule, updateCell: CellUpdate): void;
414
+ //#endregion
415
+ //#region src/modules/table-clipboard/table-clipboard.d.ts
366
416
  declare const Clipboard: typeof TypeClipboard;
367
417
  type Selector = string | Node['TEXT_NODE'] | Node['ELEMENT_NODE'];
368
- type Matcher = (node: Node, delta: Delta, scroll: Parchment.ScrollBlot) => Delta;
418
+ type Matcher = (node: Node, delta: Delta$1, scroll: Parchment.ScrollBlot) => Delta$1;
369
419
  interface ClipboardOptions {
370
420
  matchers: [Selector, Matcher][];
371
421
  }
@@ -381,24 +431,24 @@ declare class TableClipboard extends Clipboard {
381
431
  cellCount: number;
382
432
  colCount: number;
383
433
  constructor(quill: Quill, options: Partial<ClipboardOptions>);
384
- getStyleBackgroundColor(node: Node, delta: Delta): void;
385
- matchTable(node: Node, delta: Delta): Delta;
386
- matchTbody(node: Node, delta: Delta): Delta;
387
- matchThead(node: Node, delta: Delta): Delta;
388
- matchTfoot(node: Node, delta: Delta): Delta;
389
- matchColgroup(node: Node, delta: Delta): Delta;
390
- matchCol(node: Node, _delta: Delta): Delta;
391
- matchTr(node: Node, delta: Delta): Delta;
392
- matchTd(node: Node, delta: Delta): Delta;
393
- matchTdAttributor(node: Node, delta: Delta): Delta;
434
+ getStyleBackgroundColor(node: Node, delta: Delta$1): void;
435
+ matchTable(node: Node, delta: Delta$1): Delta$1;
436
+ matchTbody(node: Node, delta: Delta$1): Delta$1;
437
+ matchThead(node: Node, delta: Delta$1): Delta$1;
438
+ matchTfoot(node: Node, delta: Delta$1): Delta$1;
439
+ matchColgroup(node: Node, delta: Delta$1): Delta$1;
440
+ matchCol(node: Node, _delta: Delta$1): Delta$1;
441
+ matchTr(node: Node, delta: Delta$1): Delta$1;
442
+ matchTd(node: Node, delta: Delta$1): Delta$1;
443
+ matchTdAttributor(node: Node, delta: Delta$1): Delta$1;
394
444
  convert({
395
445
  html,
396
446
  text
397
447
  }: {
398
448
  html?: string;
399
449
  text?: string;
400
- }, formats?: Record<string, unknown>): Delta;
401
- matchCaption(node: Node, delta: Delta): Delta;
450
+ }, formats?: Record<string, unknown>): Delta$1;
451
+ matchCaption(node: Node, delta: Delta$1): Delta$1;
402
452
  }
403
453
  //#endregion
404
454
  //#region src/modules/table-menu/constants.d.ts
@@ -839,9 +889,11 @@ declare class TableSelection extends TableDomSelector {
839
889
  set dragging(val: boolean);
840
890
  get dragging(): boolean;
841
891
  constructor(tableModule: TableUp, quill: Quill, options?: Partial<TableSelectionOptions>);
892
+ handlePaste: (event: ClipboardEvent) => void;
893
+ keyboardHandler: (e: KeyboardEvent) => Promise<void>;
842
894
  updateWhenTextChange: (eventName: string) => void;
843
895
  updateAfterEvent: () => void;
844
- removeCell: (e: KeyboardEvent) => void;
896
+ removeCellBySelectedTds(): void;
845
897
  setSelectedTds(tds: TableCellInnerFormat[]): void;
846
898
  getFirstTextNode(dom: HTMLElement | Node): Node;
847
899
  getLastTextNode(dom: HTMLElement | Node): Node;
@@ -1208,5 +1260,5 @@ declare class TableUp {
1208
1260
  convertTableBodyByCells(tableBlot: TableMainFormat, selecteds: TableCellInnerFormat[], tag: TableBodyTag): void;
1209
1261
  }
1210
1262
  //#endregion
1211
- export { BlockEmbedOverride, BlockOverride, ClipboardOptions, Constructor, ContainerFormat, InternalModule, InternalTableMenuModule, InternalTableSelectionModule, Matcher, MenuTooltipInstance, QuillTheme, QuillThemePicker, RelactiveRect, ScrollOverride, Scrollbar, SelectionData, Selector, SkipRowCount, TableAlign, TableBodyFormat, TableBodyTag, TableCaptionFormat, TableCaptionValue, TableCellFormat, TableCellInnerFormat, TableCellValue, TableClipboard, TableColFormat, TableColValue, TableColgroupFormat, TableConstantsData, TableCreatorTextOptions, TableDomSelector, TableFootFormat, TableHeadFormat, TableMainFormat, TableMenuCommon, TableMenuContextmenu, TableMenuOptions, TableMenuOptionsInput, TableMenuSelect, TableMenuTexts, TableResizeBox, TableResizeCommon, TableResizeLine, TableResizeScale, TableResizeScaleOptions, TableRowFormat, TableRowValue, TableSelection, TableSelectionOptions, TableTextOptions, TableUp, TableUpExtraModule, TableUpModule, TableUpOptions, TableValue, TableVirtualScrollbar, TableWrapperFormat, Tool, ToolOption, ToolOptionBreak, Writable, blotName, createColorPicker, createSelectBox, createTooltip, TableUp as default, defaultCustomSelect, findParentBlot, findParentBlots, getTableMainRect, isTableAlignRight, randomId, sizeChangeValue, tableMenuTools, tableUpEvent, tableUpInternal, tableUpSize, updateTableConstants };
1263
+ export { BlockEmbedOverride, BlockOverride, ClipboardOptions, Constructor, ContainerFormat, InternalModule, InternalTableMenuModule, InternalTableSelectionModule, Matcher, MenuTooltipInstance, QuillTheme, QuillThemePicker, RelactiveRect, ScrollOverride, Scrollbar, SelectionData, Selector, SkipRowCount, TableAlign, TableBodyFormat, TableBodyTag, TableCaptionFormat, TableCaptionValue, TableCellFormat, TableCellInnerFormat, TableCellValue, TableClipboard, TableColFormat, TableColValue, TableColgroupFormat, TableConstantsData, TableCreatorTextOptions, TableDomSelector, TableFootFormat, TableHeadFormat, TableMainFormat, TableMenuCommon, TableMenuContextmenu, TableMenuOptions, TableMenuOptionsInput, TableMenuSelect, TableMenuTexts, TableResizeBox, TableResizeCommon, TableResizeLine, TableResizeScale, TableResizeScaleOptions, TableRowFormat, TableRowValue, TableSelection, TableSelectionOptions, TableTextOptions, TableUp, TableUpExtraModule, TableUpModule, TableUpOptions, TableValue, TableVirtualScrollbar, TableWrapperFormat, Tool, ToolOption, ToolOptionBreak, Writable, applyCellUpdates, blotName, createColorPicker, createSelectBox, createTooltip, TableUp as default, defaultCustomSelect, findParentBlot, findParentBlots, getCellPositions, getCountByPosition, getTableCellStructure, getTableMainRect, groupCellByRow, isTableAlignRight, parsePasteDelta, pasteCells, pasteWithLoop, pasteWithStructure, prepareCellUpdate, randomId, removeOverlappingCells, sizeChangeValue, tableMenuTools, tableUpEvent, tableUpInternal, tableUpSize, updateTableConstants };
1212
1264
  //# sourceMappingURL=index.d.ts.map