quill-table-up 3.2.2 → 3.3.0
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/LICENSE +21 -21
- package/dist/index.d.ts +15 -4
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +18 -17
- package/src/__tests__/e2e/table-blots.test.ts +5 -2
- package/src/__tests__/e2e/table-keyboard-handler.test.ts +32 -24
- package/src/__tests__/e2e/table-menu.test.ts +38 -0
- package/src/__tests__/e2e/table-resize.test.ts +3 -1
- package/src/__tests__/e2e/table-scrollbar.test.ts +2 -2
- package/src/__tests__/e2e/table-selection.test.ts +48 -0
- package/src/__tests__/unit/table-contenteditable.test.ts +222 -0
- package/src/formats/table-cell-format.ts +2 -2
- package/src/formats/table-cell-inner-format.ts +1 -1
- package/src/formats/table-row-format.ts +1 -1
- package/src/modules/table-align.ts +1 -0
- package/src/modules/table-dom-selector.ts +18 -3
- package/src/modules/table-menu/table-menu-common.ts +1 -0
- package/src/modules/table-menu/table-menu-contextmenu.ts +2 -3
- package/src/modules/table-menu/table-menu-select.ts +4 -2
- package/src/modules/table-resize/table-resize-box.ts +1 -0
- package/src/modules/table-resize/table-resize-line.ts +2 -1
- package/src/modules/table-resize/table-resize-scale.ts +2 -1
- package/src/modules/table-scrollbar.ts +1 -0
- package/src/modules/table-selection.ts +5 -3
- package/src/table-up.ts +44 -2
- package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 zzxming
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 zzxming
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ declare class TableCellFormat extends ContainerFormat {
|
|
|
81
81
|
static isAllowStyle(str: string): boolean;
|
|
82
82
|
static create(value: TableCellValue): HTMLTableCellElement;
|
|
83
83
|
static formats(domNode: HTMLElement): Record<string, any>;
|
|
84
|
-
isChildHeadTableCellInner(): boolean
|
|
84
|
+
isChildHeadTableCellInner(): boolean;
|
|
85
85
|
setFormatValue(name: string, value?: any): void;
|
|
86
86
|
setStyleBoder(name: string, value?: any): void;
|
|
87
87
|
getNearByCell(direction: 'left' | 'top'): TableCellFormat[];
|
|
@@ -322,16 +322,24 @@ declare const tableUpInternal: {
|
|
|
322
322
|
};
|
|
323
323
|
//#endregion
|
|
324
324
|
//#region src/modules/table-dom-selector.d.ts
|
|
325
|
-
|
|
325
|
+
interface TableModuleLifecycle {
|
|
326
|
+
hide: () => void;
|
|
327
|
+
show: () => void;
|
|
328
|
+
update: () => void;
|
|
329
|
+
destroy: () => void;
|
|
330
|
+
}
|
|
331
|
+
declare class TableDomSelector implements TableModuleLifecycle {
|
|
326
332
|
tableModule: TableUp;
|
|
327
333
|
quill: Quill;
|
|
328
334
|
table?: HTMLTableElement;
|
|
335
|
+
tableSelectMouseDownHandler: (event: MouseEvent) => void;
|
|
329
336
|
constructor(tableModule: TableUp, quill: Quill);
|
|
330
337
|
tableSelectHandler(event: MouseEvent): void;
|
|
331
338
|
setSelectionTable(table: HTMLTableElement | undefined): void;
|
|
332
339
|
hide(): void;
|
|
333
340
|
show(): void;
|
|
334
341
|
update(): void;
|
|
342
|
+
destroy(): void;
|
|
335
343
|
}
|
|
336
344
|
//#endregion
|
|
337
345
|
//#region src/modules/table-align.d.ts
|
|
@@ -901,7 +909,7 @@ declare class TableSelection extends TableDomSelector {
|
|
|
901
909
|
setSelectionData(selection: Selection, selectionData: SelectionData): void;
|
|
902
910
|
selectionDirectionUp(selection: SelectionData): boolean;
|
|
903
911
|
resolveOptions(options: Partial<TableSelectionOptions>): TableSelectionOptions;
|
|
904
|
-
selectionChangeHandler()
|
|
912
|
+
selectionChangeHandler: () => void;
|
|
905
913
|
helpLinesInitial(): HTMLDivElement;
|
|
906
914
|
computeSelectedTds(startPoint: Position, endPoint: Position): TableCellInnerFormat[];
|
|
907
915
|
getScrollPositionDiff(): Position;
|
|
@@ -1221,6 +1229,7 @@ declare class TableUp {
|
|
|
1221
1229
|
fixTableByLisenter: (this: any) => void;
|
|
1222
1230
|
selector?: HTMLElement;
|
|
1223
1231
|
resizeOb: ResizeObserver;
|
|
1232
|
+
editableObserver: MutationObserver;
|
|
1224
1233
|
modules: Record<string, Constructor>;
|
|
1225
1234
|
get statics(): any;
|
|
1226
1235
|
constructor(quill: Quill, options: Partial<TableUpOptions>);
|
|
@@ -1254,6 +1263,8 @@ declare class TableUp {
|
|
|
1254
1263
|
BorderColor: string;
|
|
1255
1264
|
} & Partial<TableTextOptions>;
|
|
1256
1265
|
initModules(): void;
|
|
1266
|
+
listenEditableChange(): void;
|
|
1267
|
+
destroyModules(): void;
|
|
1257
1268
|
getModule<T>(name: string): T | undefined;
|
|
1258
1269
|
quillHack(): void;
|
|
1259
1270
|
buildCustomSelect(customSelect: ((module: TableUp, picker: QuillThemePicker) => HTMLElement | Promise<HTMLElement>) | undefined, picker: QuillThemePicker): Promise<void>;
|
|
@@ -1279,5 +1290,5 @@ declare class TableUp {
|
|
|
1279
1290
|
convertTableBodyByCells(tableBlot: TableMainFormat, selecteds: TableCellInnerFormat[], tag: TableBodyTag): void;
|
|
1280
1291
|
}
|
|
1281
1292
|
//#endregion
|
|
1282
|
-
export { BlockEmbedOverride, BlockOverride, ClipboardOptions, Constructor, ContainerFormat, InternalModule, InternalTableMenuModule, InternalTableSelectionModule, Matcher, MenuTooltipInstance, Position, 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, TableResizeBoxOptions, TableResizeCommon, TableResizeCommonHelper, TableResizeLine, TableResizeScale, TableResizeScaleOptions, TableRowFormat, TableRowValue, TableSelection, TableSelectionOptions, TableTextOptions, TableUp, TableUp as default, TableUpExtraModule, TableUpModule, TableUpOptions, TableValue, TableVirtualScrollbar, TableWrapperFormat, Tool, ToolOption, ToolOptionBreak, Writable, applyCellUpdates, blotName, createColorPicker, createSelectBox, createTooltip, defaultCustomSelect, findParentBlot, findParentBlots, getCellPositions, getColRect, getCountByPosition, getTableCellStructure, getTableMainRect, groupCellByRow, isCellsSpan, isTableAlignRight, parsePasteDelta, pasteCells, pasteWithLoop, pasteWithStructure, prepareCellUpdate, randomId, removeOverlappingCells, tableMenuTools, tableUpEvent, tableUpInternal, tableUpSize, updateTableConstants };
|
|
1293
|
+
export { BlockEmbedOverride, BlockOverride, ClipboardOptions, Constructor, ContainerFormat, InternalModule, InternalTableMenuModule, InternalTableSelectionModule, Matcher, MenuTooltipInstance, Position, 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, TableModuleLifecycle, TableResizeBox, TableResizeBoxOptions, TableResizeCommon, TableResizeCommonHelper, TableResizeLine, TableResizeScale, TableResizeScaleOptions, TableRowFormat, TableRowValue, TableSelection, TableSelectionOptions, TableTextOptions, TableUp, TableUp as default, TableUpExtraModule, TableUpModule, TableUpOptions, TableValue, TableVirtualScrollbar, TableWrapperFormat, Tool, ToolOption, ToolOptionBreak, Writable, applyCellUpdates, blotName, createColorPicker, createSelectBox, createTooltip, defaultCustomSelect, findParentBlot, findParentBlots, getCellPositions, getColRect, getCountByPosition, getTableCellStructure, getTableMainRect, groupCellByRow, isCellsSpan, isTableAlignRight, parsePasteDelta, pasteCells, pasteWithLoop, pasteWithStructure, prepareCellUpdate, randomId, removeOverlappingCells, tableMenuTools, tableUpEvent, tableUpInternal, tableUpSize, updateTableConstants };
|
|
1283
1294
|
//# sourceMappingURL=index.d.ts.map
|