@peter.naydenov/shortcuts 2.1.0 → 3.0.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.
Files changed (39) hide show
  1. package/Changelog.md +24 -0
  2. package/How..to.make.plugins.md +41 -0
  3. package/Migration.guide.md +77 -0
  4. package/README-v.2.x.x.md +375 -0
  5. package/README.md +108 -58
  6. package/cypress/fixtures/example.json +5 -0
  7. package/cypress/support/commands.js +25 -0
  8. package/cypress/support/component-index.html +14 -0
  9. package/cypress/support/component.js +27 -0
  10. package/cypress/support/e2e.js +20 -0
  11. package/dist/shortcuts.cjs +1 -0
  12. package/dist/shortcuts.esm.mjs +1 -0
  13. package/dist/shortcuts.umd.js +1 -0
  14. package/package.json +32 -19
  15. package/rollup.config.js +40 -0
  16. package/src/main.js +81 -30
  17. package/src/methods/_normalizeWithPlugins.js +25 -0
  18. package/src/methods/_readShortcutWithPlugins.js +24 -0
  19. package/src/methods/_systemAction.js +25 -0
  20. package/src/methods/changeContext.js +20 -26
  21. package/src/methods/index.js +7 -13
  22. package/src/methods/load.js +21 -14
  23. package/src/plugins/click/_findTarget.js +20 -0
  24. package/src/plugins/click/_listenDOM.js +117 -0
  25. package/src/plugins/click/_normalizeShortcutName.js +44 -0
  26. package/src/plugins/click/_readClickEvent.js +24 -0
  27. package/src/plugins/click/_registerShortcutEvents.js +30 -0
  28. package/src/plugins/click/index.js +74 -0
  29. package/src/plugins/key/_listenDOM.js +138 -0
  30. package/src/plugins/key/_normalizeShortcutName.js +31 -0
  31. package/src/{methods → plugins/key}/_readKeyEvent.js +2 -3
  32. package/src/plugins/key/_registerShortcutEvents.js +28 -0
  33. package/src/plugins/key/index.js +76 -0
  34. package/test/01-general.cy.js +189 -154
  35. package/src/methods/_findTarget.js +0 -19
  36. package/src/methods/_listen.js +0 -210
  37. package/src/methods/_readMouseEvent.js +0 -24
  38. package/src/methods/_readShortcut.js +0 -17
  39. /package/src/{methods → plugins/key}/_specialChars.js +0 -0
@@ -1,17 +0,0 @@
1
- 'use strict'
2
- // [ crtl+s, shift+alt+o]
3
- function _readShortcut () {
4
- return function _readShortcut ( txt ) {
5
- const r = txt
6
- .split ( ',' )
7
- .map ( (x) => x.trim() )
8
- .map ( (x) => x.split ( '+' ).map(x => x.toUpperCase()).sort().join('+') )
9
- .join ( ',' );
10
- return r
11
- }} // _readShortcut func.
12
-
13
-
14
-
15
- export default _readShortcut
16
-
17
-
File without changes