@kerebron/extension-tables 0.2.1 → 0.3.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/README.md +8 -2
- package/esm/editor/src/CoreEditor.d.ts +11 -5
- package/esm/editor/src/CoreEditor.d.ts.map +1 -1
- package/esm/editor/src/CoreEditor.js +64 -61
- package/esm/editor/src/DummyEditorView.d.ts +60 -0
- package/esm/editor/src/DummyEditorView.d.ts.map +1 -0
- package/esm/editor/src/DummyEditorView.js +277 -0
- package/esm/editor/src/Extension.d.ts +9 -9
- package/esm/editor/src/Extension.d.ts.map +1 -1
- package/esm/editor/src/Extension.js +2 -2
- package/esm/editor/src/ExtensionManager.d.ts +8 -7
- package/esm/editor/src/ExtensionManager.d.ts.map +1 -1
- package/esm/editor/src/ExtensionManager.js +58 -39
- package/esm/editor/src/Mark.d.ts +8 -6
- package/esm/editor/src/Mark.d.ts.map +1 -1
- package/esm/editor/src/Mark.js +8 -2
- package/esm/editor/src/Node.d.ts +14 -12
- package/esm/editor/src/Node.d.ts.map +1 -1
- package/esm/editor/src/Node.js +10 -4
- package/esm/editor/src/commands/CommandManager.d.ts +5 -9
- package/esm/editor/src/commands/CommandManager.d.ts.map +1 -1
- package/esm/editor/src/commands/CommandManager.js +7 -6
- package/esm/editor/src/commands/mod.d.ts +12 -6
- package/esm/editor/src/commands/mod.d.ts.map +1 -1
- package/esm/editor/src/commands/mod.js +0 -45
- package/esm/editor/src/mod.d.ts +1 -0
- package/esm/editor/src/mod.d.ts.map +1 -1
- package/esm/editor/src/mod.js +1 -0
- package/esm/editor/src/nodeToTreeString.d.ts +8 -2
- package/esm/editor/src/nodeToTreeString.d.ts.map +1 -1
- package/esm/editor/src/nodeToTreeString.js +47 -29
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.js +2 -2
- package/esm/editor/src/plugins/keymap/keymap.d.ts +11 -0
- package/esm/editor/src/plugins/keymap/keymap.d.ts.map +1 -0
- package/esm/editor/src/plugins/keymap/keymap.js +125 -0
- package/esm/editor/src/plugins/keymap/mod.d.ts +2 -0
- package/esm/editor/src/plugins/keymap/mod.d.ts.map +1 -0
- package/esm/editor/src/plugins/keymap/mod.js +1 -0
- package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts +4 -0
- package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts.map +1 -0
- package/esm/editor/src/plugins/keymap/w3c-keyname.js +124 -0
- package/esm/editor/src/types.d.ts +10 -5
- package/esm/editor/src/types.d.ts.map +1 -1
- package/esm/editor/src/utilities/SmartOutput.d.ts +39 -0
- package/esm/editor/src/utilities/SmartOutput.d.ts.map +1 -0
- package/esm/editor/src/utilities/SmartOutput.js +213 -0
- package/esm/editor/src/utilities/createNodeFromContent.d.ts +4 -3
- package/esm/editor/src/utilities/createNodeFromContent.d.ts.map +1 -1
- package/esm/editor/src/utilities/createNodeFromContent.js +4 -5
- package/esm/editor/src/utilities/getHtmlAttributes.d.ts +8 -3
- package/esm/editor/src/utilities/getHtmlAttributes.d.ts.map +1 -1
- package/esm/editor/src/utilities/mod.d.ts +1 -0
- package/esm/editor/src/utilities/mod.d.ts.map +1 -1
- package/esm/editor/src/utilities/mod.js +1 -0
- package/esm/extension-tables/src/NodeTable.d.ts +2 -5
- package/esm/extension-tables/src/NodeTable.d.ts.map +1 -1
- package/esm/extension-tables/src/NodeTable.js +5 -16
- package/esm/extension-tables/src/NodeTableCell.d.ts +2 -5
- package/esm/extension-tables/src/NodeTableCell.d.ts.map +1 -1
- package/esm/extension-tables/src/NodeTableCell.js +1 -9
- package/esm/extension-tables/src/NodeTableHeader.d.ts +2 -10
- package/esm/extension-tables/src/NodeTableHeader.d.ts.map +1 -1
- package/esm/extension-tables/src/NodeTableHeader.js +0 -19
- package/esm/extension-tables/src/NodeTableRow.d.ts +2 -5
- package/esm/extension-tables/src/NodeTableRow.d.ts.map +1 -1
- package/esm/extension-tables/src/NodeTableRow.js +1 -9
- package/esm/extension-tables/src/utilities/commands.d.ts +6 -8
- package/esm/extension-tables/src/utilities/commands.d.ts.map +1 -1
- package/esm/extension-tables/src/utilities/commands.js +8 -8
- package/esm/extension-tables/src/utilities/input.d.ts.map +1 -1
- package/esm/extension-tables/src/utilities/input.js +1 -1
- package/package.json +2 -3
|
@@ -376,7 +376,7 @@ export function splitCell(state, dispatch) {
|
|
|
376
376
|
*
|
|
377
377
|
* @public
|
|
378
378
|
*/
|
|
379
|
-
export
|
|
379
|
+
export const splitCellWithType = (getCellType) => {
|
|
380
380
|
return (state, dispatch) => {
|
|
381
381
|
const sel = state.selection;
|
|
382
382
|
let cellNode;
|
|
@@ -435,7 +435,7 @@ export function splitCellWithType(getCellType) {
|
|
|
435
435
|
}
|
|
436
436
|
return true;
|
|
437
437
|
};
|
|
438
|
-
}
|
|
438
|
+
};
|
|
439
439
|
/**
|
|
440
440
|
* Returns a command that sets the given attribute to the given value,
|
|
441
441
|
* and is only available when the currently selected cell doesn't
|
|
@@ -443,7 +443,7 @@ export function splitCellWithType(getCellType) {
|
|
|
443
443
|
*
|
|
444
444
|
* @public
|
|
445
445
|
*/
|
|
446
|
-
export
|
|
446
|
+
export const setCellAttr = (name, value) => {
|
|
447
447
|
return function (state, dispatch) {
|
|
448
448
|
if (!isInTable(state))
|
|
449
449
|
return false;
|
|
@@ -472,7 +472,7 @@ export function setCellAttr(name, value) {
|
|
|
472
472
|
}
|
|
473
473
|
return true;
|
|
474
474
|
};
|
|
475
|
-
}
|
|
475
|
+
};
|
|
476
476
|
function deprecated_toggleHeader(type) {
|
|
477
477
|
return function (state, dispatch) {
|
|
478
478
|
if (!isInTable(state))
|
|
@@ -535,7 +535,7 @@ function isHeaderEnabledByType(type, rect, types) {
|
|
|
535
535
|
*
|
|
536
536
|
* @public
|
|
537
537
|
*/
|
|
538
|
-
export
|
|
538
|
+
export const toggleHeader = (type, options) => {
|
|
539
539
|
options = options || { useDeprecatedLogic: false };
|
|
540
540
|
if (options.useDeprecatedLogic)
|
|
541
541
|
return deprecated_toggleHeader(type);
|
|
@@ -584,7 +584,7 @@ export function toggleHeader(type, options) {
|
|
|
584
584
|
}
|
|
585
585
|
return true;
|
|
586
586
|
};
|
|
587
|
-
}
|
|
587
|
+
};
|
|
588
588
|
/**
|
|
589
589
|
* Toggles whether the selected row contains header cells.
|
|
590
590
|
*
|
|
@@ -643,7 +643,7 @@ function findNextCell($cell, dir) {
|
|
|
643
643
|
*
|
|
644
644
|
* @public
|
|
645
645
|
*/
|
|
646
|
-
export
|
|
646
|
+
export const goToNextCell = (direction) => {
|
|
647
647
|
return function (state, dispatch) {
|
|
648
648
|
if (!isInTable(state))
|
|
649
649
|
return false;
|
|
@@ -658,7 +658,7 @@ export function goToNextCell(direction) {
|
|
|
658
658
|
}
|
|
659
659
|
return true;
|
|
660
660
|
};
|
|
661
|
-
}
|
|
661
|
+
};
|
|
662
662
|
/**
|
|
663
663
|
* Deletes the table around the selection, if any.
|
|
664
664
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/extension-tables/src/utilities/input.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/extension-tables/src/utilities/input.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,OAAO,EAKR,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAkB9C,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAE/B,eAAO,MAAM,aAAa,4BAwFpB,aAAc,YAzElB,CAAC;AAYH;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CA+BzD;AAyBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAMxE;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,cAAc,EACjB,KAAK,EAAE,KAAK,GACX,OAAO,CAuCT;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,UAAU,GACrB,IAAI,CAqEN"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// This file defines a number of helpers for wiring up user input to
|
|
2
2
|
// table-related functionality.
|
|
3
|
-
import { keydownHandler } from 'prosemirror-keymap';
|
|
4
3
|
import { Fragment } from 'prosemirror-model';
|
|
5
4
|
import { Selection, TextSelection, } from 'prosemirror-state';
|
|
5
|
+
import { keydownHandler } from '../../../editor/src/plugins/keymap/mod.js';
|
|
6
6
|
import { CellSelection } from './CellSelection.js';
|
|
7
7
|
import { deleteCellSelection } from './commands.js';
|
|
8
8
|
import { clipCells, fitSlice, insertCells, pastedCells } from './copypaste.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kerebron/extension-tables",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "./esm/extension-tables/src/ExtensionTables.js",
|
|
6
6
|
"exports": {
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"prosemirror-
|
|
26
|
-
"prosemirror-model": "1.25.1",
|
|
25
|
+
"prosemirror-model": "1.25.2",
|
|
27
26
|
"prosemirror-state": "1.4.3",
|
|
28
27
|
"prosemirror-transform": "1.10.4",
|
|
29
28
|
"prosemirror-view": "1.40.0"
|