quill-table-up 3.0.1 → 3.0.3
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/README.md +5 -7
- package/dist/index.d.ts +4 -2
- package/dist/index.js +27 -26
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +27 -26
- package/dist/index.umd.js.map +1 -1
- package/package.json +19 -19
- package/src/__tests__/e2e/table-keyboard-handler.test.ts +2 -2
- package/src/__tests__/e2e/table-menu.test.ts +4 -5
- package/src/__tests__/unit/table-blots.test.ts +341 -2
- package/src/__tests__/unit/table-clipboard.test.ts +225 -59
- package/src/__tests__/unit/table-hack.test.ts +2 -2
- package/src/__tests__/unit/table-insert.test.ts +50 -0
- package/src/__tests__/unit/table-redo-undo.test.ts +270 -26
- package/src/__tests__/unit/table-remove.test.ts +3 -1
- package/src/__tests__/unit/utils.ts +15 -7
- package/src/formats/overrides/block-embed.ts +1 -2
- package/src/formats/overrides/block.ts +7 -2
- package/src/formats/table-cell-inner-format.ts +20 -4
- package/src/formats/table-col-format.ts +26 -30
- package/src/formats/table-wrapper-format.ts +9 -1
- package/src/modules/table-clipboard.ts +24 -9
- package/src/modules/table-menu/constants.ts +24 -0
- package/src/modules/table-selection.ts +4 -1
- package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/src/table-up.ts +61 -10
- package/src/utils/blot-helper.ts +1 -1
- package/src/utils/is.ts +1 -0
package/README.md
CHANGED
|
@@ -63,11 +63,9 @@ const quill = new Quill('#editor', {
|
|
|
63
63
|
|
|
64
64
|
## Options
|
|
65
65
|
|
|
66
|
-
### TableUp Options
|
|
67
|
-
|
|
68
66
|
**Full options usage see [demo](https://github.com/zzxming/quill-table-up/blob/master/docs/index.js#L38)**
|
|
69
67
|
|
|
70
|
-
|
|
|
68
|
+
| Attribute | Description | Type | Default |
|
|
71
69
|
| ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------ |
|
|
72
70
|
| full | if set `true`. width max will be 100% | `boolean` | `false` |
|
|
73
71
|
| fullSwitch | enable to choose insert a full width table | `boolean` | `true` |
|
|
@@ -126,7 +124,7 @@ The table cell selection handler
|
|
|
126
124
|
|
|
127
125
|
#### Options
|
|
128
126
|
|
|
129
|
-
|
|
|
127
|
+
| Attribute | Description | Type | Default |
|
|
130
128
|
| ----------- | --------------------- | -------- | --------- |
|
|
131
129
|
| selectColor | selector border color | `string` | `#0589f3` |
|
|
132
130
|
|
|
@@ -142,7 +140,7 @@ The table operate menu
|
|
|
142
140
|
|
|
143
141
|
#### Options
|
|
144
142
|
|
|
145
|
-
|
|
|
143
|
+
| Attribute | Description | Type | Default |
|
|
146
144
|
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------------------- |
|
|
147
145
|
| tipText | when `tableMenuClass` set `TableUp.TableMenuSelect`, display tip text when hover icon. when `tableMenuClass` set `TableUp.TableMenuContextmenu`, display tip text after icon | `boolean` | `true` |
|
|
148
146
|
| localstorageKey | used color save localstorage key | `string` | `__table-bg-used-color` |
|
|
@@ -297,7 +295,7 @@ Equal scale table cell handler
|
|
|
297
295
|
|
|
298
296
|
#### Options
|
|
299
297
|
|
|
300
|
-
|
|
|
298
|
+
| Attribute | Description | Type | Default |
|
|
301
299
|
| --------- | ------------------------ | -------- | ------- |
|
|
302
300
|
| blockSize | resize handle block size | `number` | `12` |
|
|
303
301
|
|
|
@@ -366,7 +364,7 @@ class ScrollBlot extends ScrollOverride {
|
|
|
366
364
|
|
|
367
365
|
## Other
|
|
368
366
|
|
|
369
|
-
### Change
|
|
367
|
+
### Change Internal Constants Variable
|
|
370
368
|
|
|
371
369
|
If it's not necessary, you should import constants variable from `quill-table-up` directly but not edit it.
|
|
372
370
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as quill0 from "quill";
|
|
2
2
|
import Quill, { EmitterSource, Parchment, Range } from "quill";
|
|
3
3
|
import { Context } from "quill/modules/keyboard";
|
|
4
4
|
import TypeScroll from "quill/blots/scroll";
|
|
@@ -210,7 +210,7 @@ declare class BlockOverride extends Block {
|
|
|
210
210
|
//#region src/formats/overrides/block-embed.d.ts
|
|
211
211
|
declare const BlockEmbed$1: typeof BlockEmbed;
|
|
212
212
|
declare class BlockEmbedOverride extends BlockEmbed$1 {
|
|
213
|
-
delta():
|
|
213
|
+
delta(): quill0.Delta;
|
|
214
214
|
length(): number;
|
|
215
215
|
formatAt(index: number, length: number, name: string, value: unknown): void;
|
|
216
216
|
}
|
|
@@ -271,6 +271,7 @@ declare class TableWrapperFormat extends ContainerFormat {
|
|
|
271
271
|
constructor(scroll: any, node: Node, _value: string);
|
|
272
272
|
get tableId(): string;
|
|
273
273
|
checkMerge(): boolean;
|
|
274
|
+
optimize(context: Record<string, any>): void;
|
|
274
275
|
deleteAt(index: number, length: number): void;
|
|
275
276
|
remove(): void;
|
|
276
277
|
isBlockLine(blot: Parchment.Blot): boolean;
|
|
@@ -1204,6 +1205,7 @@ declare class TableUp {
|
|
|
1204
1205
|
removeCol(selectedTds: TableCellInnerFormat[]): void;
|
|
1205
1206
|
mergeCells(selectedTds: TableCellInnerFormat[]): void;
|
|
1206
1207
|
splitCell(selectedTds: TableCellInnerFormat[]): void;
|
|
1208
|
+
convertTableBodyByCells(tableBlot: TableMainFormat, selecteds: TableCellInnerFormat[], tag: TableBodyTag): void;
|
|
1207
1209
|
}
|
|
1208
1210
|
//#endregion
|
|
1209
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 };
|