@lvce-editor/title-bar-worker 2.19.0 → 2.21.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/dist/titleBarWorkerMain.js +13 -10
- package/package.json +1 -1
|
@@ -1259,6 +1259,7 @@ const Img = 17;
|
|
|
1259
1259
|
const Button = 'event.button';
|
|
1260
1260
|
const ClientX = 'event.clientX';
|
|
1261
1261
|
const ClientY = 'event.clientY';
|
|
1262
|
+
const TargetName = 'event.target.name';
|
|
1262
1263
|
|
|
1263
1264
|
const Backspace$1 = 1;
|
|
1264
1265
|
const Tab$1 = 2;
|
|
@@ -2815,14 +2816,11 @@ const handleMouseOverMenuOpen = async (state, index) => {
|
|
|
2815
2816
|
|
|
2816
2817
|
const handleMouseOver = ifElse(handleMouseOverMenuOpen, handleMouseOverMenuClosed);
|
|
2817
2818
|
|
|
2818
|
-
const handlePointerOver = (state,
|
|
2819
|
+
const handlePointerOver = (state, name) => {
|
|
2819
2820
|
const {
|
|
2820
|
-
titleBarEntries
|
|
2821
|
-
x,
|
|
2822
|
-
iconWidth
|
|
2821
|
+
titleBarEntries
|
|
2823
2822
|
} = state;
|
|
2824
|
-
const
|
|
2825
|
-
const index = getTitleBarIndexFromPosition(titleBarEntries, menuOffset);
|
|
2823
|
+
const index = titleBarEntries.findIndex(item => item.label === name);
|
|
2826
2824
|
if (index === -1) {
|
|
2827
2825
|
return state;
|
|
2828
2826
|
}
|
|
@@ -2886,7 +2884,10 @@ const getTitle = workspaceUri => {
|
|
|
2886
2884
|
return '';
|
|
2887
2885
|
}
|
|
2888
2886
|
const slashIndex = workspaceUri.lastIndexOf('/');
|
|
2889
|
-
|
|
2887
|
+
if (slashIndex === -1) {
|
|
2888
|
+
return '';
|
|
2889
|
+
}
|
|
2890
|
+
const baseName = workspaceUri.slice(slashIndex + 1);
|
|
2890
2891
|
return baseName;
|
|
2891
2892
|
};
|
|
2892
2893
|
|
|
@@ -2911,6 +2912,7 @@ const loadContent2 = async state => {
|
|
|
2911
2912
|
return {
|
|
2912
2913
|
...state,
|
|
2913
2914
|
titleBarEntries: withWidths,
|
|
2915
|
+
titleBarButtons: buttons,
|
|
2914
2916
|
buttons,
|
|
2915
2917
|
title,
|
|
2916
2918
|
iconWidth
|
|
@@ -3250,13 +3252,14 @@ const getItemVirtualDom = item => {
|
|
|
3250
3252
|
// TODO avoid mutation
|
|
3251
3253
|
const dom = [];
|
|
3252
3254
|
dom.push({
|
|
3253
|
-
type:
|
|
3255
|
+
type: Button$1,
|
|
3254
3256
|
className: TitleBarTopLevelEntry,
|
|
3255
3257
|
ariaHasPopup: true,
|
|
3256
3258
|
ariaExpanded: isOpen,
|
|
3257
3259
|
role: MenuItem$1,
|
|
3258
3260
|
childCount: 1,
|
|
3259
|
-
ariaKeyShortcuts: keyboardShortCut
|
|
3261
|
+
ariaKeyShortcuts: keyboardShortCut,
|
|
3262
|
+
name: label // TODO have separate name attribute
|
|
3260
3263
|
});
|
|
3261
3264
|
if (isOpen) {
|
|
3262
3265
|
// @ts-ignore
|
|
@@ -3456,7 +3459,7 @@ const renderEventListeners = () => {
|
|
|
3456
3459
|
params: ['handlePointerOut', ClientX, ClientY]
|
|
3457
3460
|
}, {
|
|
3458
3461
|
name: HandlePointerOver,
|
|
3459
|
-
params: ['handlePointerOver',
|
|
3462
|
+
params: ['handlePointerOver', TargetName]
|
|
3460
3463
|
}, {
|
|
3461
3464
|
name: HandleFocusOut,
|
|
3462
3465
|
params: ['handleFocusOut', ClientX, ClientY] // TODO maybe check relatedTarget
|