@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.
Files changed (72) hide show
  1. package/README.md +8 -2
  2. package/esm/editor/src/CoreEditor.d.ts +11 -5
  3. package/esm/editor/src/CoreEditor.d.ts.map +1 -1
  4. package/esm/editor/src/CoreEditor.js +64 -61
  5. package/esm/editor/src/DummyEditorView.d.ts +60 -0
  6. package/esm/editor/src/DummyEditorView.d.ts.map +1 -0
  7. package/esm/editor/src/DummyEditorView.js +277 -0
  8. package/esm/editor/src/Extension.d.ts +9 -9
  9. package/esm/editor/src/Extension.d.ts.map +1 -1
  10. package/esm/editor/src/Extension.js +2 -2
  11. package/esm/editor/src/ExtensionManager.d.ts +8 -7
  12. package/esm/editor/src/ExtensionManager.d.ts.map +1 -1
  13. package/esm/editor/src/ExtensionManager.js +58 -39
  14. package/esm/editor/src/Mark.d.ts +8 -6
  15. package/esm/editor/src/Mark.d.ts.map +1 -1
  16. package/esm/editor/src/Mark.js +8 -2
  17. package/esm/editor/src/Node.d.ts +14 -12
  18. package/esm/editor/src/Node.d.ts.map +1 -1
  19. package/esm/editor/src/Node.js +10 -4
  20. package/esm/editor/src/commands/CommandManager.d.ts +5 -9
  21. package/esm/editor/src/commands/CommandManager.d.ts.map +1 -1
  22. package/esm/editor/src/commands/CommandManager.js +7 -6
  23. package/esm/editor/src/commands/mod.d.ts +12 -6
  24. package/esm/editor/src/commands/mod.d.ts.map +1 -1
  25. package/esm/editor/src/commands/mod.js +0 -45
  26. package/esm/editor/src/mod.d.ts +1 -0
  27. package/esm/editor/src/mod.d.ts.map +1 -1
  28. package/esm/editor/src/mod.js +1 -0
  29. package/esm/editor/src/nodeToTreeString.d.ts +8 -2
  30. package/esm/editor/src/nodeToTreeString.d.ts.map +1 -1
  31. package/esm/editor/src/nodeToTreeString.js +47 -29
  32. package/esm/editor/src/plugins/input-rules/InputRulesPlugin.js +2 -2
  33. package/esm/editor/src/plugins/keymap/keymap.d.ts +11 -0
  34. package/esm/editor/src/plugins/keymap/keymap.d.ts.map +1 -0
  35. package/esm/editor/src/plugins/keymap/keymap.js +125 -0
  36. package/esm/editor/src/plugins/keymap/mod.d.ts +2 -0
  37. package/esm/editor/src/plugins/keymap/mod.d.ts.map +1 -0
  38. package/esm/editor/src/plugins/keymap/mod.js +1 -0
  39. package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts +4 -0
  40. package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts.map +1 -0
  41. package/esm/editor/src/plugins/keymap/w3c-keyname.js +124 -0
  42. package/esm/editor/src/types.d.ts +10 -5
  43. package/esm/editor/src/types.d.ts.map +1 -1
  44. package/esm/editor/src/utilities/SmartOutput.d.ts +39 -0
  45. package/esm/editor/src/utilities/SmartOutput.d.ts.map +1 -0
  46. package/esm/editor/src/utilities/SmartOutput.js +213 -0
  47. package/esm/editor/src/utilities/createNodeFromContent.d.ts +4 -3
  48. package/esm/editor/src/utilities/createNodeFromContent.d.ts.map +1 -1
  49. package/esm/editor/src/utilities/createNodeFromContent.js +4 -5
  50. package/esm/editor/src/utilities/getHtmlAttributes.d.ts +8 -3
  51. package/esm/editor/src/utilities/getHtmlAttributes.d.ts.map +1 -1
  52. package/esm/editor/src/utilities/mod.d.ts +1 -0
  53. package/esm/editor/src/utilities/mod.d.ts.map +1 -1
  54. package/esm/editor/src/utilities/mod.js +1 -0
  55. package/esm/extension-tables/src/NodeTable.d.ts +2 -5
  56. package/esm/extension-tables/src/NodeTable.d.ts.map +1 -1
  57. package/esm/extension-tables/src/NodeTable.js +5 -16
  58. package/esm/extension-tables/src/NodeTableCell.d.ts +2 -5
  59. package/esm/extension-tables/src/NodeTableCell.d.ts.map +1 -1
  60. package/esm/extension-tables/src/NodeTableCell.js +1 -9
  61. package/esm/extension-tables/src/NodeTableHeader.d.ts +2 -10
  62. package/esm/extension-tables/src/NodeTableHeader.d.ts.map +1 -1
  63. package/esm/extension-tables/src/NodeTableHeader.js +0 -19
  64. package/esm/extension-tables/src/NodeTableRow.d.ts +2 -5
  65. package/esm/extension-tables/src/NodeTableRow.d.ts.map +1 -1
  66. package/esm/extension-tables/src/NodeTableRow.js +1 -9
  67. package/esm/extension-tables/src/utilities/commands.d.ts +6 -8
  68. package/esm/extension-tables/src/utilities/commands.d.ts.map +1 -1
  69. package/esm/extension-tables/src/utilities/commands.js +8 -8
  70. package/esm/extension-tables/src/utilities/input.d.ts.map +1 -1
  71. package/esm/extension-tables/src/utilities/input.js +1 -1
  72. package/package.json +2 -3
@@ -376,7 +376,7 @@ export function splitCell(state, dispatch) {
376
376
  *
377
377
  * @public
378
378
  */
379
- export function splitCellWithType(getCellType) {
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 function setCellAttr(name, value) {
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 function toggleHeader(type, options) {
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 function goToNextCell(direction) {
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":"AAIA,OAAO,EAAyB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,OAAO,EAKR,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAe9C,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAE/B,eAAO,MAAM,aAAa,4BAmCpB,aAAa,YApBjB,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
+ {"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.2.1",
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-keymap": "1.2.2",
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"