@lvce-editor/file-search-worker 5.18.0 → 5.19.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.
@@ -987,8 +987,13 @@ const minimumSliderSize = 20;
987
987
  const Default$1 = 0;
988
988
  const Finished = 2;
989
989
 
990
+ const toCommandId = key => {
991
+ const dotIndex = key.indexOf('.');
992
+ return key.slice(dotIndex + 1);
993
+ };
990
994
  const create$2 = () => {
991
995
  const states = Object.create(null);
996
+ const commandMapRef = {};
992
997
  return {
993
998
  get(uid) {
994
999
  return states[uid];
@@ -1029,6 +1034,15 @@ const create$2 = () => {
1029
1034
  };
1030
1035
  return wrapped;
1031
1036
  },
1037
+ wrapGetter(fn) {
1038
+ const wrapped = (uid, ...args) => {
1039
+ const {
1040
+ newState
1041
+ } = states[uid];
1042
+ return fn(newState, ...args);
1043
+ };
1044
+ return wrapped;
1045
+ },
1032
1046
  diff(uid, modules, numbers) {
1033
1047
  const {
1034
1048
  oldState,
@@ -1042,6 +1056,14 @@ const create$2 = () => {
1042
1056
  }
1043
1057
  }
1044
1058
  return diffResult;
1059
+ },
1060
+ getCommandIds() {
1061
+ const keys = Object.keys(commandMapRef);
1062
+ const ids = keys.map(toCommandId);
1063
+ return ids;
1064
+ },
1065
+ registerCommands(commandMap) {
1066
+ Object.assign(commandMapRef, commandMap);
1045
1067
  }
1046
1068
  };
1047
1069
  };
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-search-worker",
3
- "version": "5.18.0",
4
- "description": "",
3
+ "version": "5.19.0",
5
4
  "keywords": [
6
5
  "text-search"
7
6
  ],