vim-web 0.4.1-dev.0 → 0.4.1-dev.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.
package/dist/vim-web.js CHANGED
@@ -46838,7 +46838,7 @@ let Vim$1 = class Vim {
46838
46838
  return this._onDispose;
46839
46839
  }
46840
46840
  getBoundingBox() {
46841
- const box = this.getFullSet().getBoundingBox();
46841
+ const box = this.scene.getBoundingBox();
46842
46842
  return Promise.resolve(box);
46843
46843
  }
46844
46844
  /**
@@ -52569,15 +52569,18 @@ class CaptureHandler {
52569
52569
  this._id = -1;
52570
52570
  }
52571
52571
  onPointerDown(event) {
52572
- if (this._id >= 0) {
52573
- this._canvas.releasePointerCapture(this._id);
52574
- }
52572
+ this.release();
52575
52573
  this._canvas.setPointerCapture(event.pointerId);
52576
52574
  this._id = event.pointerId;
52577
52575
  }
52578
52576
  onPointerUp(event) {
52579
- this._canvas.releasePointerCapture(this._id);
52580
- this._id = -1;
52577
+ this.release();
52578
+ }
52579
+ release() {
52580
+ if (this._id >= 0) {
52581
+ this._canvas.releasePointerCapture(this._id);
52582
+ this._id = -1;
52583
+ }
52581
52584
  }
52582
52585
  }
52583
52586
  class DoubleClickHandler {
@@ -68562,8 +68565,8 @@ var InteractionMode;
68562
68565
  InteractionMode2["ClickItemToExpand"] = "click-item-to-expand";
68563
68566
  InteractionMode2["ClickArrowToExpand"] = "click-arrow-to-expand";
68564
68567
  })(InteractionMode || (InteractionMode = {}));
68565
- var __assign$d = function() {
68566
- __assign$d = Object.assign || function(t) {
68568
+ var __assign$c = function() {
68569
+ __assign$c = Object.assign || function(t) {
68567
68570
  for (var s, i = 1, n = arguments.length; i < n; i++) {
68568
68571
  s = arguments[i];
68569
68572
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -68571,13 +68574,13 @@ var __assign$d = function() {
68571
68574
  }
68572
68575
  return t;
68573
68576
  };
68574
- return __assign$d.apply(this, arguments);
68577
+ return __assign$c.apply(this, arguments);
68575
68578
  };
68576
68579
  var mergeInteractionManagers = function(main, fallback) {
68577
68580
  return {
68578
68581
  mode: main.mode,
68579
68582
  createInteractiveElementProps: function(item, treeId, actions, renderFlags) {
68580
- return __assign$d(__assign$d({}, fallback.createInteractiveElementProps(item, treeId, actions, renderFlags)), main.createInteractiveElementProps(item, treeId, actions, renderFlags));
68583
+ return __assign$c(__assign$c({}, fallback.createInteractiveElementProps(item, treeId, actions, renderFlags)), main.createInteractiveElementProps(item, treeId, actions, renderFlags));
68581
68584
  }
68582
68585
  };
68583
68586
  };
@@ -68595,10 +68598,11 @@ var DoubleClickItemToExpandInteractionManager = (
68595
68598
  var _this = this;
68596
68599
  return {
68597
68600
  onClick: function(e) {
68601
+ var isSpacebarEvent = e.detail === 0;
68598
68602
  actions.focusItem();
68599
- if (e.shiftKey) {
68603
+ if (e.shiftKey && !isSpacebarEvent) {
68600
68604
  actions.selectUpTo(!isControlKey$1(e));
68601
- } else if (isControlKey$1(e)) {
68605
+ } else if (isControlKey$1(e) && !isSpacebarEvent) {
68602
68606
  if (renderFlags.isSelected) {
68603
68607
  actions.unselectItem();
68604
68608
  } else {
@@ -68646,10 +68650,11 @@ var ClickItemToExpandInteractionManager = (
68646
68650
  var _this = this;
68647
68651
  return {
68648
68652
  onClick: function(e) {
68653
+ var isSpacebarEvent = e.detail === 0;
68649
68654
  actions.focusItem();
68650
- if (e.shiftKey) {
68655
+ if (e.shiftKey && !isSpacebarEvent) {
68651
68656
  actions.selectUpTo(!isControlKey$1(e));
68652
- } else if (isControlKey$1(e)) {
68657
+ } else if (isControlKey$1(e) && !isSpacebarEvent) {
68653
68658
  if (renderFlags.isSelected) {
68654
68659
  actions.unselectItem();
68655
68660
  } else {
@@ -68693,10 +68698,11 @@ var ClickArrowToExpandInteractionManager = (
68693
68698
  var _this = this;
68694
68699
  return {
68695
68700
  onClick: function(e) {
68701
+ var isSpacebarEvent = e.detail === 0;
68696
68702
  actions.focusItem();
68697
- if (e.shiftKey) {
68703
+ if (e.shiftKey && !isSpacebarEvent) {
68698
68704
  actions.selectUpTo(!isControlKey$1(e));
68699
- } else if (isControlKey$1(e)) {
68705
+ } else if (isControlKey$1(e) && !isSpacebarEvent) {
68700
68706
  if (renderFlags.isSelected) {
68701
68707
  actions.unselectItem();
68702
68708
  } else {
@@ -68814,7 +68820,7 @@ var useGetViableDragPositions = function() {
68814
68820
  return isDescendant(treeId, parentLinearIndex, potentialParents);
68815
68821
  }, [getParentOfLinearItem]);
68816
68822
  return useCallback(function(treeId, draggingItems) {
68817
- var _a3, _b2;
68823
+ var _a3, _b2, _c, _d;
68818
68824
  var linearItems = environment.linearItems[treeId];
68819
68825
  var targets = [];
68820
68826
  var skipUntilDepthIsLowerThan = -1;
@@ -68824,7 +68830,7 @@ var useGetViableDragPositions = function() {
68824
68830
  // eslint-disable-next-line no-plusplus
68825
68831
  linearIndex++
68826
68832
  ) {
68827
- var _c = linearItems[linearIndex], item = _c.item, depth = _c.depth;
68833
+ var _e = linearItems[linearIndex], item = _e.item, depth = _e.depth;
68828
68834
  if (skipUntilDepthIsLowerThan !== -1 && depth > skipUntilDepthIsLowerThan) {
68829
68835
  continue;
68830
68836
  } else {
@@ -68862,14 +68868,17 @@ var useGetViableDragPositions = function() {
68862
68868
  depth,
68863
68869
  treeId
68864
68870
  };
68865
- var skipTopPosition = depth === ((_b2 = (_a3 = linearItems[linearIndex - 1]) === null || _a3 === void 0 ? void 0 : _a3.depth) !== null && _b2 !== void 0 ? _b2 : -1);
68866
- if (!skipTopPosition && canDropAt(topPosition, draggingItems)) {
68871
+ var depthOfItemAbove = (_b2 = (_a3 = linearItems[linearIndex - 1]) === null || _a3 === void 0 ? void 0 : _a3.depth) !== null && _b2 !== void 0 ? _b2 : -1;
68872
+ var depthOfItemBelow = (_d = (_c = linearItems[linearIndex + 1]) === null || _c === void 0 ? void 0 : _c.depth) !== null && _d !== void 0 ? _d : -1;
68873
+ var isWithinFolder = depth === depthOfItemAbove;
68874
+ var isBelowOpenFolder = depth === depthOfItemBelow - 1;
68875
+ if (!isWithinFolder && canDropAt(topPosition, draggingItems)) {
68867
68876
  targets.push(topPosition);
68868
68877
  }
68869
68878
  if (canDropAt(itemPosition, draggingItems)) {
68870
68879
  targets.push(itemPosition);
68871
68880
  }
68872
- if (canDropAt(bottomPosition, draggingItems)) {
68881
+ if (!isBelowOpenFolder && canDropAt(bottomPosition, draggingItems)) {
68873
68882
  targets.push(bottomPosition);
68874
68883
  }
68875
68884
  }
@@ -68908,8 +68917,8 @@ var useSideEffect = function(effect, deps, changeOn) {
68908
68917
  }
68909
68918
  }, __spreadArray$4(__spreadArray$4([], deps, true), changeOn, true));
68910
68919
  };
68911
- var __assign$c = function() {
68912
- __assign$c = Object.assign || function(t) {
68920
+ var __assign$b = function() {
68921
+ __assign$b = Object.assign || function(t) {
68913
68922
  for (var s, i = 1, n = arguments.length; i < n; i++) {
68914
68923
  s = arguments[i];
68915
68924
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -68917,7 +68926,7 @@ var __assign$c = function() {
68917
68926
  }
68918
68927
  return t;
68919
68928
  };
68920
- return __assign$c.apply(this, arguments);
68929
+ return __assign$b.apply(this, arguments);
68921
68930
  };
68922
68931
  var buildMapForTrees = function(treeIds, build) {
68923
68932
  return treeIds.map(function(id2) {
@@ -68925,7 +68934,7 @@ var buildMapForTrees = function(treeIds, build) {
68925
68934
  }).reduce(function(a, _a3) {
68926
68935
  var _b2;
68927
68936
  var id2 = _a3[0], obj = _a3[1];
68928
- return __assign$c(__assign$c({}, a), (_b2 = {}, _b2[id2] = obj, _b2));
68937
+ return __assign$b(__assign$b({}, a), (_b2 = {}, _b2[id2] = obj, _b2));
68929
68938
  }, {});
68930
68939
  };
68931
68940
  var getDocument = function() {
@@ -69432,7 +69441,7 @@ var DragAndDropProvider = function(_a3) {
69432
69441
  var programmaticDragDown = useCallback(function() {
69433
69442
  if (environment.activeTreeId) {
69434
69443
  setProgrammaticDragIndex(function(oldIndex) {
69435
- return Math.min(viableDragPositions[environment.activeTreeId].length, oldIndex + 1);
69444
+ return Math.min(viableDragPositions[environment.activeTreeId].length - 1, oldIndex + 1);
69436
69445
  });
69437
69446
  }
69438
69447
  }, [environment.activeTreeId, viableDragPositions]);
@@ -69477,8 +69486,8 @@ var DragAndDropProvider = function(_a3) {
69477
69486
  }, [onDropHandler, resetState]);
69478
69487
  return React.createElement(DragAndDropContext.Provider, { value: dnd }, children);
69479
69488
  };
69480
- var __assign$b = function() {
69481
- __assign$b = Object.assign || function(t) {
69489
+ var __assign$a = function() {
69490
+ __assign$a = Object.assign || function(t) {
69482
69491
  for (var s, i = 1, n = arguments.length; i < n; i++) {
69483
69492
  s = arguments[i];
69484
69493
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -69486,13 +69495,13 @@ var __assign$b = function() {
69486
69495
  }
69487
69496
  return t;
69488
69497
  };
69489
- return __assign$b.apply(this, arguments);
69498
+ return __assign$a.apply(this, arguments);
69490
69499
  };
69491
69500
  var useCreatedEnvironmentRef = function(ref, actions) {
69492
69501
  var environment = useTreeEnvironment();
69493
69502
  var dnd = useDragAndDrop();
69494
69503
  useImperativeHandle(ref, function() {
69495
- return __assign$b(__assign$b(__assign$b({}, actions), environment), { treeEnvironmentContext: environment, dragAndDropContext: dnd });
69504
+ return __assign$a(__assign$a(__assign$a({}, actions), environment), { treeEnvironmentContext: environment, dragAndDropContext: dnd });
69496
69505
  });
69497
69506
  };
69498
69507
  var waitFor = function(check2, intervalMs, timeoutMs) {
@@ -69848,8 +69857,8 @@ var scrollIntoView = function(element) {
69848
69857
  }
69849
69858
  }
69850
69859
  };
69851
- var __assign$a = function() {
69852
- __assign$a = Object.assign || function(t) {
69860
+ var __assign$9 = function() {
69861
+ __assign$9 = Object.assign || function(t) {
69853
69862
  for (var s, i = 1, n = arguments.length; i < n; i++) {
69854
69863
  s = arguments[i];
69855
69864
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -69857,7 +69866,7 @@ var __assign$a = function() {
69857
69866
  }
69858
69867
  return t;
69859
69868
  };
69860
- return __assign$a.apply(this, arguments);
69869
+ return __assign$9.apply(this, arguments);
69861
69870
  };
69862
69871
  var cx$1 = function() {
69863
69872
  var classNames = [];
@@ -69888,7 +69897,7 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
69888
69897
  var item = _a3.item, context = _a3.context;
69889
69898
  return (
69890
69899
  // Icons from https://blueprintjs.com/docs/#icons
69891
- React__default.createElement("div", __assign$a({ className: cx$1(item.isFolder && "rct-tree-item-arrow-isFolder", context.isExpanded && "rct-tree-item-arrow-expanded", "rct-tree-item-arrow") }, context.arrowProps), item.isFolder && (context.isExpanded ? React__default.createElement(
69900
+ React__default.createElement("div", __assign$9({ className: cx$1(item.isFolder && "rct-tree-item-arrow-isFolder", context.isExpanded && "rct-tree-item-arrow-expanded", "rct-tree-item-arrow") }, context.arrowProps), item.isFolder && (context.isExpanded ? React__default.createElement(
69892
69901
  "svg",
69893
69902
  { version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", x: "0px", y: "0px", viewBox: "0 0 16 16", enableBackground: "new 0 0 16 16", xmlSpace: "preserve" },
69894
69903
  React__default.createElement(
@@ -69921,12 +69930,12 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
69921
69930
  var type = context.isRenaming ? void 0 : "button";
69922
69931
  return React__default.createElement(
69923
69932
  "li",
69924
- __assign$a({}, context.itemContainerWithChildrenProps, { className: cx$1("rct-tree-item-li", item.isFolder && "rct-tree-item-li-isFolder", context.isSelected && "rct-tree-item-li-selected", context.isExpanded && "rct-tree-item-li-expanded", context.isFocused && "rct-tree-item-li-focused", context.isDraggingOver && "rct-tree-item-li-dragging-over", context.isSearchMatching && "rct-tree-item-li-search-match") }),
69933
+ __assign$9({}, context.itemContainerWithChildrenProps, { className: cx$1("rct-tree-item-li", item.isFolder && "rct-tree-item-li-isFolder", context.isSelected && "rct-tree-item-li-selected", context.isExpanded && "rct-tree-item-li-expanded", context.isFocused && "rct-tree-item-li-focused", context.isDraggingOver && "rct-tree-item-li-dragging-over", context.isSearchMatching && "rct-tree-item-li-search-match") }),
69925
69934
  React__default.createElement(
69926
69935
  "div",
69927
- __assign$a({}, context.itemContainerWithoutChildrenProps, { style: { "--depthOffset": "".concat((depth + 1) * renderDepthOffset, "px") }, className: cx$1("rct-tree-item-title-container", item.isFolder && "rct-tree-item-title-container-isFolder", context.isSelected && "rct-tree-item-title-container-selected", context.isExpanded && "rct-tree-item-title-container-expanded", context.isFocused && "rct-tree-item-title-container-focused", context.isDraggingOver && "rct-tree-item-title-container-dragging-over", context.isSearchMatching && "rct-tree-item-title-container-search-match") }),
69936
+ __assign$9({}, context.itemContainerWithoutChildrenProps, { style: { "--depthOffset": "".concat((depth + 1) * renderDepthOffset, "px") }, className: cx$1("rct-tree-item-title-container", item.isFolder && "rct-tree-item-title-container-isFolder", context.isSelected && "rct-tree-item-title-container-selected", context.isExpanded && "rct-tree-item-title-container-expanded", context.isFocused && "rct-tree-item-title-container-focused", context.isDraggingOver && "rct-tree-item-title-container-dragging-over", context.isSearchMatching && "rct-tree-item-title-container-search-match") }),
69928
69937
  arrow,
69929
- React__default.createElement(InteractiveComponent, __assign$a({ type }, context.interactiveElementProps, { className: cx$1("rct-tree-item-button", item.isFolder && "rct-tree-item-button-isFolder", context.isSelected && "rct-tree-item-button-selected", context.isExpanded && "rct-tree-item-button-expanded", context.isFocused && "rct-tree-item-button-focused", context.isDraggingOver && "rct-tree-item-button-dragging-over", context.isSearchMatching && "rct-tree-item-button-search-match") }), title2)
69938
+ React__default.createElement(InteractiveComponent, __assign$9({ type }, context.interactiveElementProps, { className: cx$1("rct-tree-item-button", item.isFolder && "rct-tree-item-button-isFolder", context.isSelected && "rct-tree-item-button-selected", context.isExpanded && "rct-tree-item-button-expanded", context.isFocused && "rct-tree-item-button-focused", context.isDraggingOver && "rct-tree-item-button-dragging-over", context.isSearchMatching && "rct-tree-item-button-search-match") }), title2)
69930
69939
  ),
69931
69940
  children
69932
69941
  );
@@ -69935,9 +69944,9 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
69935
69944
  var inputProps = _a3.inputProps, inputRef = _a3.inputRef, submitButtonProps = _a3.submitButtonProps, submitButtonRef = _a3.submitButtonRef, formProps = _a3.formProps;
69936
69945
  return React__default.createElement(
69937
69946
  "form",
69938
- __assign$a({}, formProps, { className: "rct-tree-item-renaming-form" }),
69939
- React__default.createElement("input", __assign$a({}, inputProps, { ref: inputRef, className: "rct-tree-item-renaming-input" })),
69940
- React__default.createElement("input", __assign$a({}, submitButtonProps, { ref: submitButtonRef, type: "submit", className: "rct-tree-item-renaming-submit-button", value: "🗸" }))
69947
+ __assign$9({}, formProps, { className: "rct-tree-item-renaming-form" }),
69948
+ React__default.createElement("input", __assign$9({}, inputProps, { ref: inputRef, className: "rct-tree-item-renaming-input" })),
69949
+ React__default.createElement("input", __assign$9({}, submitButtonProps, { ref: submitButtonRef, type: "submit", className: "rct-tree-item-renaming-submit-button", value: "🗸" }))
69941
69950
  );
69942
69951
  },
69943
69952
  renderTreeContainer: function(_a3) {
@@ -69945,16 +69954,16 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
69945
69954
  return React__default.createElement(
69946
69955
  "div",
69947
69956
  { className: cx$1("rct-tree-root", info.isFocused && "rct-tree-root-focus", info.isRenaming && "rct-tree-root-renaming", info.areItemsSelected && "rct-tree-root-itemsselected", rtl) },
69948
- React__default.createElement("div", __assign$a({}, containerProps, { style: __assign$a({ minHeight: "30px" }, containerProps.style) }), children)
69957
+ React__default.createElement("div", __assign$9({}, containerProps, { style: __assign$9({ minHeight: "30px" }, containerProps.style) }), children)
69949
69958
  );
69950
69959
  },
69951
69960
  renderItemsContainer: function(_a3) {
69952
69961
  var children = _a3.children, containerProps = _a3.containerProps;
69953
- return React__default.createElement("ul", __assign$a({}, containerProps, { className: "rct-tree-items-container" }), children);
69962
+ return React__default.createElement("ul", __assign$9({}, containerProps, { className: "rct-tree-items-container" }), children);
69954
69963
  },
69955
69964
  renderDragBetweenLine: function(_a3) {
69956
69965
  var draggingPosition = _a3.draggingPosition, lineProps = _a3.lineProps;
69957
- return React__default.createElement("div", __assign$a({}, lineProps, { style: { left: "".concat(draggingPosition.depth * renderDepthOffset, "px") }, className: cx$1("rct-tree-drag-between-line", draggingPosition.targetType === "between-items" && draggingPosition.linePosition === "top" && "rct-tree-drag-between-line-top", draggingPosition.targetType === "between-items" && draggingPosition.linePosition === "bottom" && "rct-tree-drag-between-line-bottom") }));
69966
+ return React__default.createElement("div", __assign$9({}, lineProps, { style: { left: "".concat(draggingPosition.depth * renderDepthOffset, "px") }, className: cx$1("rct-tree-drag-between-line", draggingPosition.targetType === "between-items" && draggingPosition.linePosition === "top" && "rct-tree-drag-between-line-top", draggingPosition.targetType === "between-items" && draggingPosition.linePosition === "bottom" && "rct-tree-drag-between-line-bottom") }));
69958
69967
  },
69959
69968
  renderSearchInput: function(_a3) {
69960
69969
  var inputProps = _a3.inputProps;
@@ -69962,7 +69971,7 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
69962
69971
  "div",
69963
69972
  { className: cx$1("rct-tree-search-input-container") },
69964
69973
  React__default.createElement("span", { className: "rct-tree-input-icon" }),
69965
- React__default.createElement("input", __assign$a({}, inputProps, { className: cx$1("rct-tree-search-input") }))
69974
+ React__default.createElement("input", __assign$9({}, inputProps, { className: cx$1("rct-tree-search-input") }))
69966
69975
  );
69967
69976
  },
69968
69977
  renderLiveDescriptorContainer: function(_a3) {
@@ -70033,8 +70042,8 @@ var getItemsLinearly = function(rootItem, viewState, items, depth) {
70033
70042
  }
70034
70043
  return itemIds;
70035
70044
  };
70036
- var __assign$9 = function() {
70037
- __assign$9 = Object.assign || function(t) {
70045
+ var __assign$8 = function() {
70046
+ __assign$8 = Object.assign || function(t) {
70038
70047
  for (var s, i = 1, n = arguments.length; i < n; i++) {
70039
70048
  s = arguments[i];
70040
70049
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -70042,7 +70051,7 @@ var __assign$9 = function() {
70042
70051
  }
70043
70052
  return t;
70044
70053
  };
70045
- return __assign$9.apply(this, arguments);
70054
+ return __assign$8.apply(this, arguments);
70046
70055
  };
70047
70056
  var __rest = function(s, e) {
70048
70057
  var t = {};
@@ -70092,7 +70101,7 @@ var useControlledTreeEnvironmentProps = function(_a3) {
70092
70101
  var registerTree = useCallback(function(tree) {
70093
70102
  setTrees(function(trees3) {
70094
70103
  var _a4;
70095
- return __assign$9(__assign$9({}, trees3), (_a4 = {}, _a4[tree.treeId] = tree, _a4));
70104
+ return __assign$8(__assign$8({}, trees3), (_a4 = {}, _a4[tree.treeId] = tree, _a4));
70096
70105
  });
70097
70106
  onRegisterTree === null || onRegisterTree === void 0 ? void 0 : onRegisterTree(tree);
70098
70107
  }, [onRegisterTree]);
@@ -70149,33 +70158,26 @@ var useControlledTreeEnvironmentProps = function(_a3) {
70149
70158
  }
70150
70159
  }, [autoFocus, focusTree]);
70151
70160
  var renderers = useRenderers(props);
70152
- return __assign$9(__assign$9(__assign$9({}, renderers), props), { onFocusItem: onFocusItemHandler, registerTree, unregisterTree, onExpandItem, onCollapseItem, onDrop, setActiveTree, treeIds, trees: trees2, activeTreeId, linearItems });
70153
- };
70154
- var __assign$8 = function() {
70155
- __assign$8 = Object.assign || function(t) {
70156
- for (var s, i = 1, n = arguments.length; i < n; i++) {
70157
- s = arguments[i];
70158
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
70159
- t[p] = s[p];
70160
- }
70161
- return t;
70162
- };
70163
- return __assign$8.apply(this, arguments);
70161
+ return __assign$8(__assign$8(__assign$8({}, renderers), props), { onFocusItem: onFocusItemHandler, registerTree, unregisterTree, onExpandItem, onCollapseItem, onDrop, setActiveTree, treeIds, trees: trees2, activeTreeId, linearItems });
70164
70162
  };
70165
70163
  var TreeEnvironmentContext = React.createContext(null);
70166
70164
  var useTreeEnvironment = function() {
70167
70165
  return useContext(TreeEnvironmentContext);
70168
70166
  };
70169
70167
  var ControlledTreeEnvironment = React.forwardRef(function(props, ref) {
70170
- var _a3, _b2, _c;
70171
70168
  var environmentContextProps = useControlledTreeEnvironmentProps(props);
70172
- var viewState = props.viewState;
70173
- for (var _i = 0, _d = Object.keys(environmentContextProps.trees); _i < _d.length; _i++) {
70174
- var treeId = _d[_i];
70175
- if (!((_a3 = viewState[treeId]) === null || _a3 === void 0 ? void 0 : _a3.focusedItem) && environmentContextProps.trees[treeId]) {
70176
- viewState[treeId] = __assign$8(__assign$8({}, viewState[treeId]), { focusedItem: (_c = (_b2 = props.items[environmentContextProps.trees[treeId].rootItem]) === null || _b2 === void 0 ? void 0 : _b2.children) === null || _c === void 0 ? void 0 : _c[0] });
70169
+ var viewState = props.viewState, onFocusItem = props.onFocusItem;
70170
+ useEffect(function() {
70171
+ var _a3, _b2, _c;
70172
+ for (var _i = 0, _d = Object.keys(environmentContextProps.trees); _i < _d.length; _i++) {
70173
+ var treeId = _d[_i];
70174
+ var firstItemIndex = (_b2 = (_a3 = props.items[environmentContextProps.trees[treeId].rootItem]) === null || _a3 === void 0 ? void 0 : _a3.children) === null || _b2 === void 0 ? void 0 : _b2[0];
70175
+ var firstItem = firstItemIndex && props.items[firstItemIndex];
70176
+ if (!((_c = viewState[treeId]) === null || _c === void 0 ? void 0 : _c.focusedItem) && environmentContextProps.trees[treeId] && firstItem) {
70177
+ onFocusItem === null || onFocusItem === void 0 ? void 0 : onFocusItem(firstItem, treeId, false);
70178
+ }
70177
70179
  }
70178
- }
70180
+ }, [environmentContextProps.trees, onFocusItem, props.items, viewState]);
70179
70181
  return React.createElement(
70180
70182
  TreeEnvironmentContext.Provider,
70181
70183
  { value: environmentContextProps },
@@ -70270,11 +70272,11 @@ var defaultKeyboardBindings = {
70270
70272
  primaryAction: ["enter"],
70271
70273
  renameItem: ["f2"],
70272
70274
  abortRenameItem: ["escape"],
70273
- toggleSelectItem: ["control+space"],
70275
+ toggleSelectItem: ["control+ "],
70274
70276
  abortSearch: ["escape", "enter"],
70275
70277
  startSearch: [],
70276
70278
  selectAll: ["control+a"],
70277
- startProgrammaticDnd: ["control+d"],
70279
+ startProgrammaticDnd: ["control+shift+d"],
70278
70280
  completeProgrammaticDnd: ["enter"],
70279
70281
  abortProgrammaticDnd: ["escape"]
70280
70282
  };
@@ -70334,7 +70336,7 @@ var useHotkey = function(combinationName, onHit, active, activatableWhileFocusin
70334
70336
  return a || b;
70335
70337
  }, false);
70336
70338
  if (partialMatch) {
70337
- if (pressedKeys.current.length > 1 || !/^[a-zA-Z]$/.test(e.key)) {
70339
+ if (pressedKeys.current.length > 1 || !/^[a-zA-Z\s]$/.test(e.key)) {
70338
70340
  e.preventDefault();
70339
70341
  }
70340
70342
  }
@@ -70568,6 +70570,7 @@ var useTreeKeyboardBindings = function() {
70568
70570
  useHotkey("toggleSelectItem", function(e) {
70569
70571
  var _a4, _b3, _c;
70570
70572
  e.preventDefault();
70573
+ e.stopPropagation();
70571
70574
  if (viewState.focusedItem !== void 0) {
70572
70575
  if (viewState.selectedItems && viewState.selectedItems.includes(viewState.focusedItem)) {
70573
70576
  (_a4 = environment.onSelectItems) === null || _a4 === void 0 ? void 0 : _a4.call(environment, viewState.selectedItems.filter(function(item) {