@peter.naydenov/shortcuts 2.0.0 → 2.1.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/Changelog.md +6 -1
- package/README.md +12 -10
- package/package.json +1 -1
- package/src/main.js +8 -1
package/Changelog.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
## Release History
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
### 2.1.0 ( 2023-10-17 )
|
|
5
|
+
- [x] Method `setDependencies` to add more external objects available in all action functions;
|
|
6
|
+
- [x] Method `getDependencies` to look at existing `dependencies` list;
|
|
7
|
+
|
|
8
|
+
|
|
4
9
|
|
|
5
|
-
### 2.0.0 ( 2023-10-
|
|
10
|
+
### 2.0.0 ( 2023-10-16 )
|
|
6
11
|
- [x] HTML attribute `data-quick-click` is available to speed up single click response;
|
|
7
12
|
- [x] Documentation on methods `pause` and `resume`;
|
|
8
13
|
- [x] Method `listShortcuts` to get names of all shortcuts defined;
|
package/README.md
CHANGED
|
@@ -281,16 +281,18 @@ function myMouseHandler ({
|
|
|
281
281
|
Description of the methods of shortcut instance:
|
|
282
282
|
|
|
283
283
|
```js
|
|
284
|
-
load
|
|
285
|
-
, unload
|
|
286
|
-
, changeContext
|
|
287
|
-
, emit
|
|
288
|
-
, pause
|
|
289
|
-
, resume
|
|
290
|
-
, listContexts
|
|
291
|
-
, getContext
|
|
292
|
-
, getNote
|
|
293
|
-
, setNote
|
|
284
|
+
load : 'Load and extend a shortcut definition.'
|
|
285
|
+
, unload : 'Remove a shortcut context with all its shortcuts.'
|
|
286
|
+
, changeContext : 'Switch to existing shortcut context.'
|
|
287
|
+
, emit : 'Trigger a shortcut or custom event programmatically.'
|
|
288
|
+
, pause : 'Stop listening for shortcuts.'
|
|
289
|
+
, resume : 'Resume listening for shortcuts.'
|
|
290
|
+
, listContexts : 'Return list of available contexts.'
|
|
291
|
+
, getContext : 'Return a name of current context or null if there is no context selected'
|
|
292
|
+
, getNote : `Return a name of current note or null if note isn't set`
|
|
293
|
+
, setNote : 'Set a note to current context.'
|
|
294
|
+
, setDependencies : 'Set dependencies that will be available in action functions.'
|
|
295
|
+
, getDependencies : 'Return dependencies object.'
|
|
294
296
|
```
|
|
295
297
|
|
|
296
298
|
### How to 'pause' and 'resume'?
|
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - Development was started on June 21st, 2023
|
|
11
11
|
* - First version was published on August 14th, 2023
|
|
12
12
|
* - Method 'emit' was added on September 30st, 2023
|
|
13
|
-
* - Version 2.0.0 was published on October
|
|
13
|
+
* - Version 2.0.0 was published on October 16th, 2023
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
|
|
@@ -112,6 +112,13 @@ function main ( options = {} ) {
|
|
|
112
112
|
*/
|
|
113
113
|
API.setDependencies = (deps) => dependencies.extra = { ...dependencies.extra, ...deps }
|
|
114
114
|
|
|
115
|
+
/**
|
|
116
|
+
* @function getDependencies
|
|
117
|
+
* @description Get a dependency package that will be provided to each action function
|
|
118
|
+
* @returns {object} - Enumerate external dependencies
|
|
119
|
+
**/
|
|
120
|
+
API.getDependencies = () => dependencies.extra
|
|
121
|
+
|
|
115
122
|
|
|
116
123
|
|
|
117
124
|
Object.entries ( methods ).forEach ( ([ name, method ]) => {
|