vim-web 0.4.1-dev.0 → 0.4.1-dev.2
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
|
@@ -45581,7 +45581,7 @@ let Element3D$1 = class Element3D {
|
|
|
45581
45581
|
}
|
|
45582
45582
|
/**
|
|
45583
45583
|
* Retrieves the bounding box of the object from cache or computes it if needed.
|
|
45584
|
-
* Returns undefined if the
|
|
45584
|
+
* Returns undefined if the element is abstract.
|
|
45585
45585
|
* @returns {THREE.Box3 | undefined} The bounding box of the object, or undefined if the object has no geometry.
|
|
45586
45586
|
*/
|
|
45587
45587
|
async getBoundingBox() {
|
|
@@ -46838,7 +46838,7 @@ let Vim$1 = class Vim {
|
|
|
46838
46838
|
return this._onDispose;
|
|
46839
46839
|
}
|
|
46840
46840
|
getBoundingBox() {
|
|
46841
|
-
const box = this.
|
|
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
|
-
|
|
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.
|
|
52580
|
-
|
|
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 {
|
|
@@ -60989,6 +60992,7 @@ class Element3D2 {
|
|
|
60989
60992
|
}
|
|
60990
60993
|
/**
|
|
60991
60994
|
* Computes and returns the bounding box of the element.
|
|
60995
|
+
* Returns undefined if the element is abstract.
|
|
60992
60996
|
* @returns A promise resolving to the element's bounding box.
|
|
60993
60997
|
*/
|
|
60994
60998
|
async getBoundingBox() {
|
|
@@ -68562,8 +68566,8 @@ var InteractionMode;
|
|
|
68562
68566
|
InteractionMode2["ClickItemToExpand"] = "click-item-to-expand";
|
|
68563
68567
|
InteractionMode2["ClickArrowToExpand"] = "click-arrow-to-expand";
|
|
68564
68568
|
})(InteractionMode || (InteractionMode = {}));
|
|
68565
|
-
var __assign$
|
|
68566
|
-
__assign$
|
|
68569
|
+
var __assign$c = function() {
|
|
68570
|
+
__assign$c = Object.assign || function(t) {
|
|
68567
68571
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
68568
68572
|
s = arguments[i];
|
|
68569
68573
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -68571,13 +68575,13 @@ var __assign$d = function() {
|
|
|
68571
68575
|
}
|
|
68572
68576
|
return t;
|
|
68573
68577
|
};
|
|
68574
|
-
return __assign$
|
|
68578
|
+
return __assign$c.apply(this, arguments);
|
|
68575
68579
|
};
|
|
68576
68580
|
var mergeInteractionManagers = function(main, fallback) {
|
|
68577
68581
|
return {
|
|
68578
68582
|
mode: main.mode,
|
|
68579
68583
|
createInteractiveElementProps: function(item, treeId, actions, renderFlags) {
|
|
68580
|
-
return __assign$
|
|
68584
|
+
return __assign$c(__assign$c({}, fallback.createInteractiveElementProps(item, treeId, actions, renderFlags)), main.createInteractiveElementProps(item, treeId, actions, renderFlags));
|
|
68581
68585
|
}
|
|
68582
68586
|
};
|
|
68583
68587
|
};
|
|
@@ -68595,10 +68599,11 @@ var DoubleClickItemToExpandInteractionManager = (
|
|
|
68595
68599
|
var _this = this;
|
|
68596
68600
|
return {
|
|
68597
68601
|
onClick: function(e) {
|
|
68602
|
+
var isSpacebarEvent = e.detail === 0;
|
|
68598
68603
|
actions.focusItem();
|
|
68599
|
-
if (e.shiftKey) {
|
|
68604
|
+
if (e.shiftKey && !isSpacebarEvent) {
|
|
68600
68605
|
actions.selectUpTo(!isControlKey$1(e));
|
|
68601
|
-
} else if (isControlKey$1(e)) {
|
|
68606
|
+
} else if (isControlKey$1(e) && !isSpacebarEvent) {
|
|
68602
68607
|
if (renderFlags.isSelected) {
|
|
68603
68608
|
actions.unselectItem();
|
|
68604
68609
|
} else {
|
|
@@ -68646,10 +68651,11 @@ var ClickItemToExpandInteractionManager = (
|
|
|
68646
68651
|
var _this = this;
|
|
68647
68652
|
return {
|
|
68648
68653
|
onClick: function(e) {
|
|
68654
|
+
var isSpacebarEvent = e.detail === 0;
|
|
68649
68655
|
actions.focusItem();
|
|
68650
|
-
if (e.shiftKey) {
|
|
68656
|
+
if (e.shiftKey && !isSpacebarEvent) {
|
|
68651
68657
|
actions.selectUpTo(!isControlKey$1(e));
|
|
68652
|
-
} else if (isControlKey$1(e)) {
|
|
68658
|
+
} else if (isControlKey$1(e) && !isSpacebarEvent) {
|
|
68653
68659
|
if (renderFlags.isSelected) {
|
|
68654
68660
|
actions.unselectItem();
|
|
68655
68661
|
} else {
|
|
@@ -68693,10 +68699,11 @@ var ClickArrowToExpandInteractionManager = (
|
|
|
68693
68699
|
var _this = this;
|
|
68694
68700
|
return {
|
|
68695
68701
|
onClick: function(e) {
|
|
68702
|
+
var isSpacebarEvent = e.detail === 0;
|
|
68696
68703
|
actions.focusItem();
|
|
68697
|
-
if (e.shiftKey) {
|
|
68704
|
+
if (e.shiftKey && !isSpacebarEvent) {
|
|
68698
68705
|
actions.selectUpTo(!isControlKey$1(e));
|
|
68699
|
-
} else if (isControlKey$1(e)) {
|
|
68706
|
+
} else if (isControlKey$1(e) && !isSpacebarEvent) {
|
|
68700
68707
|
if (renderFlags.isSelected) {
|
|
68701
68708
|
actions.unselectItem();
|
|
68702
68709
|
} else {
|
|
@@ -68814,7 +68821,7 @@ var useGetViableDragPositions = function() {
|
|
|
68814
68821
|
return isDescendant(treeId, parentLinearIndex, potentialParents);
|
|
68815
68822
|
}, [getParentOfLinearItem]);
|
|
68816
68823
|
return useCallback(function(treeId, draggingItems) {
|
|
68817
|
-
var _a3, _b2;
|
|
68824
|
+
var _a3, _b2, _c, _d;
|
|
68818
68825
|
var linearItems = environment.linearItems[treeId];
|
|
68819
68826
|
var targets = [];
|
|
68820
68827
|
var skipUntilDepthIsLowerThan = -1;
|
|
@@ -68824,7 +68831,7 @@ var useGetViableDragPositions = function() {
|
|
|
68824
68831
|
// eslint-disable-next-line no-plusplus
|
|
68825
68832
|
linearIndex++
|
|
68826
68833
|
) {
|
|
68827
|
-
var
|
|
68834
|
+
var _e = linearItems[linearIndex], item = _e.item, depth = _e.depth;
|
|
68828
68835
|
if (skipUntilDepthIsLowerThan !== -1 && depth > skipUntilDepthIsLowerThan) {
|
|
68829
68836
|
continue;
|
|
68830
68837
|
} else {
|
|
@@ -68862,14 +68869,17 @@ var useGetViableDragPositions = function() {
|
|
|
68862
68869
|
depth,
|
|
68863
68870
|
treeId
|
|
68864
68871
|
};
|
|
68865
|
-
var
|
|
68866
|
-
|
|
68872
|
+
var depthOfItemAbove = (_b2 = (_a3 = linearItems[linearIndex - 1]) === null || _a3 === void 0 ? void 0 : _a3.depth) !== null && _b2 !== void 0 ? _b2 : -1;
|
|
68873
|
+
var depthOfItemBelow = (_d = (_c = linearItems[linearIndex + 1]) === null || _c === void 0 ? void 0 : _c.depth) !== null && _d !== void 0 ? _d : -1;
|
|
68874
|
+
var isWithinFolder = depth === depthOfItemAbove;
|
|
68875
|
+
var isBelowOpenFolder = depth === depthOfItemBelow - 1;
|
|
68876
|
+
if (!isWithinFolder && canDropAt(topPosition, draggingItems)) {
|
|
68867
68877
|
targets.push(topPosition);
|
|
68868
68878
|
}
|
|
68869
68879
|
if (canDropAt(itemPosition, draggingItems)) {
|
|
68870
68880
|
targets.push(itemPosition);
|
|
68871
68881
|
}
|
|
68872
|
-
if (canDropAt(bottomPosition, draggingItems)) {
|
|
68882
|
+
if (!isBelowOpenFolder && canDropAt(bottomPosition, draggingItems)) {
|
|
68873
68883
|
targets.push(bottomPosition);
|
|
68874
68884
|
}
|
|
68875
68885
|
}
|
|
@@ -68908,8 +68918,8 @@ var useSideEffect = function(effect, deps, changeOn) {
|
|
|
68908
68918
|
}
|
|
68909
68919
|
}, __spreadArray$4(__spreadArray$4([], deps, true), changeOn, true));
|
|
68910
68920
|
};
|
|
68911
|
-
var __assign$
|
|
68912
|
-
__assign$
|
|
68921
|
+
var __assign$b = function() {
|
|
68922
|
+
__assign$b = Object.assign || function(t) {
|
|
68913
68923
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
68914
68924
|
s = arguments[i];
|
|
68915
68925
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -68917,7 +68927,7 @@ var __assign$c = function() {
|
|
|
68917
68927
|
}
|
|
68918
68928
|
return t;
|
|
68919
68929
|
};
|
|
68920
|
-
return __assign$
|
|
68930
|
+
return __assign$b.apply(this, arguments);
|
|
68921
68931
|
};
|
|
68922
68932
|
var buildMapForTrees = function(treeIds, build) {
|
|
68923
68933
|
return treeIds.map(function(id2) {
|
|
@@ -68925,7 +68935,7 @@ var buildMapForTrees = function(treeIds, build) {
|
|
|
68925
68935
|
}).reduce(function(a, _a3) {
|
|
68926
68936
|
var _b2;
|
|
68927
68937
|
var id2 = _a3[0], obj = _a3[1];
|
|
68928
|
-
return __assign$
|
|
68938
|
+
return __assign$b(__assign$b({}, a), (_b2 = {}, _b2[id2] = obj, _b2));
|
|
68929
68939
|
}, {});
|
|
68930
68940
|
};
|
|
68931
68941
|
var getDocument = function() {
|
|
@@ -69432,7 +69442,7 @@ var DragAndDropProvider = function(_a3) {
|
|
|
69432
69442
|
var programmaticDragDown = useCallback(function() {
|
|
69433
69443
|
if (environment.activeTreeId) {
|
|
69434
69444
|
setProgrammaticDragIndex(function(oldIndex) {
|
|
69435
|
-
return Math.min(viableDragPositions[environment.activeTreeId].length, oldIndex + 1);
|
|
69445
|
+
return Math.min(viableDragPositions[environment.activeTreeId].length - 1, oldIndex + 1);
|
|
69436
69446
|
});
|
|
69437
69447
|
}
|
|
69438
69448
|
}, [environment.activeTreeId, viableDragPositions]);
|
|
@@ -69477,8 +69487,8 @@ var DragAndDropProvider = function(_a3) {
|
|
|
69477
69487
|
}, [onDropHandler, resetState]);
|
|
69478
69488
|
return React.createElement(DragAndDropContext.Provider, { value: dnd }, children);
|
|
69479
69489
|
};
|
|
69480
|
-
var __assign$
|
|
69481
|
-
__assign$
|
|
69490
|
+
var __assign$a = function() {
|
|
69491
|
+
__assign$a = Object.assign || function(t) {
|
|
69482
69492
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
69483
69493
|
s = arguments[i];
|
|
69484
69494
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -69486,13 +69496,13 @@ var __assign$b = function() {
|
|
|
69486
69496
|
}
|
|
69487
69497
|
return t;
|
|
69488
69498
|
};
|
|
69489
|
-
return __assign$
|
|
69499
|
+
return __assign$a.apply(this, arguments);
|
|
69490
69500
|
};
|
|
69491
69501
|
var useCreatedEnvironmentRef = function(ref, actions) {
|
|
69492
69502
|
var environment = useTreeEnvironment();
|
|
69493
69503
|
var dnd = useDragAndDrop();
|
|
69494
69504
|
useImperativeHandle(ref, function() {
|
|
69495
|
-
return __assign$
|
|
69505
|
+
return __assign$a(__assign$a(__assign$a({}, actions), environment), { treeEnvironmentContext: environment, dragAndDropContext: dnd });
|
|
69496
69506
|
});
|
|
69497
69507
|
};
|
|
69498
69508
|
var waitFor = function(check2, intervalMs, timeoutMs) {
|
|
@@ -69848,8 +69858,8 @@ var scrollIntoView = function(element) {
|
|
|
69848
69858
|
}
|
|
69849
69859
|
}
|
|
69850
69860
|
};
|
|
69851
|
-
var __assign$
|
|
69852
|
-
__assign$
|
|
69861
|
+
var __assign$9 = function() {
|
|
69862
|
+
__assign$9 = Object.assign || function(t) {
|
|
69853
69863
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
69854
69864
|
s = arguments[i];
|
|
69855
69865
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -69857,7 +69867,7 @@ var __assign$a = function() {
|
|
|
69857
69867
|
}
|
|
69858
69868
|
return t;
|
|
69859
69869
|
};
|
|
69860
|
-
return __assign$
|
|
69870
|
+
return __assign$9.apply(this, arguments);
|
|
69861
69871
|
};
|
|
69862
69872
|
var cx$1 = function() {
|
|
69863
69873
|
var classNames = [];
|
|
@@ -69888,7 +69898,7 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
|
|
|
69888
69898
|
var item = _a3.item, context = _a3.context;
|
|
69889
69899
|
return (
|
|
69890
69900
|
// Icons from https://blueprintjs.com/docs/#icons
|
|
69891
|
-
React__default.createElement("div", __assign$
|
|
69901
|
+
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
69902
|
"svg",
|
|
69893
69903
|
{ 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
69904
|
React__default.createElement(
|
|
@@ -69921,12 +69931,12 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
|
|
|
69921
69931
|
var type = context.isRenaming ? void 0 : "button";
|
|
69922
69932
|
return React__default.createElement(
|
|
69923
69933
|
"li",
|
|
69924
|
-
__assign$
|
|
69934
|
+
__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
69935
|
React__default.createElement(
|
|
69926
69936
|
"div",
|
|
69927
|
-
__assign$
|
|
69937
|
+
__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
69938
|
arrow,
|
|
69929
|
-
React__default.createElement(InteractiveComponent, __assign$
|
|
69939
|
+
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
69940
|
),
|
|
69931
69941
|
children
|
|
69932
69942
|
);
|
|
@@ -69935,9 +69945,9 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
|
|
|
69935
69945
|
var inputProps = _a3.inputProps, inputRef = _a3.inputRef, submitButtonProps = _a3.submitButtonProps, submitButtonRef = _a3.submitButtonRef, formProps = _a3.formProps;
|
|
69936
69946
|
return React__default.createElement(
|
|
69937
69947
|
"form",
|
|
69938
|
-
__assign$
|
|
69939
|
-
React__default.createElement("input", __assign$
|
|
69940
|
-
React__default.createElement("input", __assign$
|
|
69948
|
+
__assign$9({}, formProps, { className: "rct-tree-item-renaming-form" }),
|
|
69949
|
+
React__default.createElement("input", __assign$9({}, inputProps, { ref: inputRef, className: "rct-tree-item-renaming-input" })),
|
|
69950
|
+
React__default.createElement("input", __assign$9({}, submitButtonProps, { ref: submitButtonRef, type: "submit", className: "rct-tree-item-renaming-submit-button", value: "🗸" }))
|
|
69941
69951
|
);
|
|
69942
69952
|
},
|
|
69943
69953
|
renderTreeContainer: function(_a3) {
|
|
@@ -69945,16 +69955,16 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
|
|
|
69945
69955
|
return React__default.createElement(
|
|
69946
69956
|
"div",
|
|
69947
69957
|
{ 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$
|
|
69958
|
+
React__default.createElement("div", __assign$9({}, containerProps, { style: __assign$9({ minHeight: "30px" }, containerProps.style) }), children)
|
|
69949
69959
|
);
|
|
69950
69960
|
},
|
|
69951
69961
|
renderItemsContainer: function(_a3) {
|
|
69952
69962
|
var children = _a3.children, containerProps = _a3.containerProps;
|
|
69953
|
-
return React__default.createElement("ul", __assign$
|
|
69963
|
+
return React__default.createElement("ul", __assign$9({}, containerProps, { className: "rct-tree-items-container" }), children);
|
|
69954
69964
|
},
|
|
69955
69965
|
renderDragBetweenLine: function(_a3) {
|
|
69956
69966
|
var draggingPosition = _a3.draggingPosition, lineProps = _a3.lineProps;
|
|
69957
|
-
return React__default.createElement("div", __assign$
|
|
69967
|
+
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
69968
|
},
|
|
69959
69969
|
renderSearchInput: function(_a3) {
|
|
69960
69970
|
var inputProps = _a3.inputProps;
|
|
@@ -69962,7 +69972,7 @@ var createDefaultRenderers = function(renderDepthOffset, rtl) {
|
|
|
69962
69972
|
"div",
|
|
69963
69973
|
{ className: cx$1("rct-tree-search-input-container") },
|
|
69964
69974
|
React__default.createElement("span", { className: "rct-tree-input-icon" }),
|
|
69965
|
-
React__default.createElement("input", __assign$
|
|
69975
|
+
React__default.createElement("input", __assign$9({}, inputProps, { className: cx$1("rct-tree-search-input") }))
|
|
69966
69976
|
);
|
|
69967
69977
|
},
|
|
69968
69978
|
renderLiveDescriptorContainer: function(_a3) {
|
|
@@ -70033,8 +70043,8 @@ var getItemsLinearly = function(rootItem, viewState, items, depth) {
|
|
|
70033
70043
|
}
|
|
70034
70044
|
return itemIds;
|
|
70035
70045
|
};
|
|
70036
|
-
var __assign$
|
|
70037
|
-
__assign$
|
|
70046
|
+
var __assign$8 = function() {
|
|
70047
|
+
__assign$8 = Object.assign || function(t) {
|
|
70038
70048
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
70039
70049
|
s = arguments[i];
|
|
70040
70050
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -70042,7 +70052,7 @@ var __assign$9 = function() {
|
|
|
70042
70052
|
}
|
|
70043
70053
|
return t;
|
|
70044
70054
|
};
|
|
70045
|
-
return __assign$
|
|
70055
|
+
return __assign$8.apply(this, arguments);
|
|
70046
70056
|
};
|
|
70047
70057
|
var __rest = function(s, e) {
|
|
70048
70058
|
var t = {};
|
|
@@ -70092,7 +70102,7 @@ var useControlledTreeEnvironmentProps = function(_a3) {
|
|
|
70092
70102
|
var registerTree = useCallback(function(tree) {
|
|
70093
70103
|
setTrees(function(trees3) {
|
|
70094
70104
|
var _a4;
|
|
70095
|
-
return __assign$
|
|
70105
|
+
return __assign$8(__assign$8({}, trees3), (_a4 = {}, _a4[tree.treeId] = tree, _a4));
|
|
70096
70106
|
});
|
|
70097
70107
|
onRegisterTree === null || onRegisterTree === void 0 ? void 0 : onRegisterTree(tree);
|
|
70098
70108
|
}, [onRegisterTree]);
|
|
@@ -70149,33 +70159,26 @@ var useControlledTreeEnvironmentProps = function(_a3) {
|
|
|
70149
70159
|
}
|
|
70150
70160
|
}, [autoFocus, focusTree]);
|
|
70151
70161
|
var renderers = useRenderers(props);
|
|
70152
|
-
return __assign$
|
|
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);
|
|
70162
|
+
return __assign$8(__assign$8(__assign$8({}, renderers), props), { onFocusItem: onFocusItemHandler, registerTree, unregisterTree, onExpandItem, onCollapseItem, onDrop, setActiveTree, treeIds, trees: trees2, activeTreeId, linearItems });
|
|
70164
70163
|
};
|
|
70165
70164
|
var TreeEnvironmentContext = React.createContext(null);
|
|
70166
70165
|
var useTreeEnvironment = function() {
|
|
70167
70166
|
return useContext(TreeEnvironmentContext);
|
|
70168
70167
|
};
|
|
70169
70168
|
var ControlledTreeEnvironment = React.forwardRef(function(props, ref) {
|
|
70170
|
-
var _a3, _b2, _c;
|
|
70171
70169
|
var environmentContextProps = useControlledTreeEnvironmentProps(props);
|
|
70172
|
-
var viewState = props.viewState;
|
|
70173
|
-
|
|
70174
|
-
var
|
|
70175
|
-
|
|
70176
|
-
|
|
70170
|
+
var viewState = props.viewState, onFocusItem = props.onFocusItem;
|
|
70171
|
+
useEffect(function() {
|
|
70172
|
+
var _a3, _b2, _c;
|
|
70173
|
+
for (var _i = 0, _d = Object.keys(environmentContextProps.trees); _i < _d.length; _i++) {
|
|
70174
|
+
var treeId = _d[_i];
|
|
70175
|
+
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];
|
|
70176
|
+
var firstItem = firstItemIndex && props.items[firstItemIndex];
|
|
70177
|
+
if (!((_c = viewState[treeId]) === null || _c === void 0 ? void 0 : _c.focusedItem) && environmentContextProps.trees[treeId] && firstItem) {
|
|
70178
|
+
onFocusItem === null || onFocusItem === void 0 ? void 0 : onFocusItem(firstItem, treeId, false);
|
|
70179
|
+
}
|
|
70177
70180
|
}
|
|
70178
|
-
}
|
|
70181
|
+
}, [environmentContextProps.trees, onFocusItem, props.items, viewState]);
|
|
70179
70182
|
return React.createElement(
|
|
70180
70183
|
TreeEnvironmentContext.Provider,
|
|
70181
70184
|
{ value: environmentContextProps },
|
|
@@ -70270,11 +70273,11 @@ var defaultKeyboardBindings = {
|
|
|
70270
70273
|
primaryAction: ["enter"],
|
|
70271
70274
|
renameItem: ["f2"],
|
|
70272
70275
|
abortRenameItem: ["escape"],
|
|
70273
|
-
toggleSelectItem: ["control+
|
|
70276
|
+
toggleSelectItem: ["control+ "],
|
|
70274
70277
|
abortSearch: ["escape", "enter"],
|
|
70275
70278
|
startSearch: [],
|
|
70276
70279
|
selectAll: ["control+a"],
|
|
70277
|
-
startProgrammaticDnd: ["control+d"],
|
|
70280
|
+
startProgrammaticDnd: ["control+shift+d"],
|
|
70278
70281
|
completeProgrammaticDnd: ["enter"],
|
|
70279
70282
|
abortProgrammaticDnd: ["escape"]
|
|
70280
70283
|
};
|
|
@@ -70334,7 +70337,7 @@ var useHotkey = function(combinationName, onHit, active, activatableWhileFocusin
|
|
|
70334
70337
|
return a || b;
|
|
70335
70338
|
}, false);
|
|
70336
70339
|
if (partialMatch) {
|
|
70337
|
-
if (pressedKeys.current.length > 1 || !/^[a-zA-Z]$/.test(e.key)) {
|
|
70340
|
+
if (pressedKeys.current.length > 1 || !/^[a-zA-Z\s]$/.test(e.key)) {
|
|
70338
70341
|
e.preventDefault();
|
|
70339
70342
|
}
|
|
70340
70343
|
}
|
|
@@ -70568,6 +70571,7 @@ var useTreeKeyboardBindings = function() {
|
|
|
70568
70571
|
useHotkey("toggleSelectItem", function(e) {
|
|
70569
70572
|
var _a4, _b3, _c;
|
|
70570
70573
|
e.preventDefault();
|
|
70574
|
+
e.stopPropagation();
|
|
70571
70575
|
if (viewState.focusedItem !== void 0) {
|
|
70572
70576
|
if (viewState.selectedItems && viewState.selectedItems.includes(viewState.focusedItem)) {
|
|
70573
70577
|
(_a4 = environment.onSelectItems) === null || _a4 === void 0 ? void 0 : _a4.call(environment, viewState.selectedItems.filter(function(item) {
|
|
@@ -75806,11 +75810,15 @@ function useSectionBox(adapter) {
|
|
|
75806
75810
|
adapter.setBox(newBox);
|
|
75807
75811
|
});
|
|
75808
75812
|
const sectionSelection2 = useFuncRef(async () => {
|
|
75813
|
+
const currentBox = boxRef.current.clone();
|
|
75809
75814
|
const box = await getSelectionBox.call() ?? await getSceneBox.call();
|
|
75815
|
+
if (!currentBox.equals(boxRef.current)) return;
|
|
75810
75816
|
sectionBox2.call(box);
|
|
75811
75817
|
});
|
|
75812
75818
|
const sectionScene = useFuncRef(async () => {
|
|
75819
|
+
const currentBox = boxRef.current.clone();
|
|
75813
75820
|
const box = await getSceneBox.call();
|
|
75821
|
+
if (!currentBox.equals(boxRef.current)) return;
|
|
75814
75822
|
sectionBox2.call(box);
|
|
75815
75823
|
});
|
|
75816
75824
|
return {
|