@lvce-editor/explorer-view 3.12.0 → 3.13.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.
@@ -1032,6 +1032,9 @@ const createMockRpc = ({
1032
1032
  const invoke = (method, ...params) => {
1033
1033
  invocations.push([method, ...params]);
1034
1034
  const command = commandMap[method];
1035
+ if (!command) {
1036
+ throw new Error(`command ${method} not found`);
1037
+ }
1035
1038
  return command(...params);
1036
1039
  };
1037
1040
  const mockRpc = {
@@ -2618,7 +2621,8 @@ const {
2618
2621
  set,
2619
2622
  wrapCommand,
2620
2623
  registerCommands,
2621
- getCommandIds
2624
+ getCommandIds,
2625
+ wrapGetter
2622
2626
  } = create$1();
2623
2627
 
2624
2628
  const ListItem = 22;
@@ -3748,11 +3752,11 @@ const toggleIndividualSelection = async (state, index) => {
3748
3752
  };
3749
3753
  };
3750
3754
 
3751
- const handleClickAt = async (state, defaultPrevented, button, ctrlKey, shiftKey, x, y) => {
3755
+ const handleClickAt = async (state, defaultPrevented, button, ctrlKey, shiftKey, eventX, eventY) => {
3752
3756
  if (defaultPrevented || button !== LeftClick) {
3753
3757
  return state;
3754
3758
  }
3755
- const index = getIndexFromPosition(state, x, y);
3759
+ const index = getIndexFromPosition(state, eventX, eventY);
3756
3760
  if (index === -1) {
3757
3761
  return {
3758
3762
  ...state,
@@ -6166,19 +6170,14 @@ const isExpandedDirectory = dirent => {
6166
6170
  return dirent.type === DirectoryExpanded;
6167
6171
  };
6168
6172
 
6169
- const saveState = uid => {
6170
- number(uid);
6171
- const value = get(uid);
6172
- const {
6173
- newState
6174
- } = value;
6173
+ const saveState = state => {
6175
6174
  const {
6176
6175
  items,
6177
6176
  root,
6178
6177
  deltaY,
6179
6178
  minLineY,
6180
6179
  maxLineY
6181
- } = newState;
6180
+ } = state;
6182
6181
  const expandedPaths = items.filter(isExpandedDirectory).map(getPath);
6183
6182
  return {
6184
6183
  expandedPaths,
@@ -6387,7 +6386,7 @@ const commandMap = {
6387
6386
  'Explorer.render2': render2,
6388
6387
  'Explorer.renderActions2': renderActions,
6389
6388
  'Explorer.renderEventListeners': renderEventListeners,
6390
- 'Explorer.saveState': saveState,
6389
+ 'Explorer.saveState': wrapGetter(saveState),
6391
6390
  'Explorer.terminate': terminate,
6392
6391
  'Explorer.initialize': initialize,
6393
6392
  // deprecated
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",