@jbrowse/core 3.6.4 → 3.6.5
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/package.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/CascadingMenu.js +8 -1
- package/util/index.js +8 -2
- package/util/types/index.d.ts +2 -2
package/ui/CascadingMenu.js
CHANGED
|
@@ -36,7 +36,14 @@ function CascadingSubmenu({ title, Icon, inset, ...props }) {
|
|
|
36
36
|
const popupState = (0, hooks_1.usePopupState)({
|
|
37
37
|
parentPopupState,
|
|
38
38
|
});
|
|
39
|
-
|
|
39
|
+
const { onMouseOver: originalOnMouseOver, ...hoverProps } = (0, hooks_1.bindHover)(popupState);
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, { ...(0, hooks_1.bindFocus)(popupState), ...hoverProps, onMouseOver: event => {
|
|
41
|
+
if (parentPopupState === null || parentPopupState === void 0 ? void 0 : parentPopupState.childHandle) {
|
|
42
|
+
parentPopupState.childHandle.close();
|
|
43
|
+
parentPopupState.setChildHandle(undefined);
|
|
44
|
+
}
|
|
45
|
+
originalOnMouseOver(event);
|
|
46
|
+
}, children: [Icon ? ((0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(Icon, {}) })) : null, (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: title, inset: inset }), (0, jsx_runtime_1.jsx)(ChevronRight_1.default, {})] }), (0, jsx_runtime_1.jsx)(CascadingSubmenuHover, { ...props, anchorOrigin: { vertical: 'top', horizontal: 'right' }, transformOrigin: { vertical: 'top', horizontal: 'left' }, popupState: popupState })] }));
|
|
40
47
|
}
|
|
41
48
|
function CascadingSubmenuHover({ popupState, onMenuItemClick, menuItems, classes, ...props }) {
|
|
42
49
|
const { rootPopupState } = (0, react_1.useContext)(CascadingContext);
|
package/util/index.js
CHANGED
|
@@ -129,11 +129,17 @@ function useDebounce(value, delay) {
|
|
|
129
129
|
function useWidthSetter(view, padding) {
|
|
130
130
|
const [ref, { width }] = (0, useMeasure_1.default)();
|
|
131
131
|
(0, react_1.useEffect)(() => {
|
|
132
|
+
let token;
|
|
132
133
|
if (width && (0, mobx_state_tree_1.isAlive)(view)) {
|
|
133
|
-
requestAnimationFrame(() => {
|
|
134
|
-
view.setWidth(width
|
|
134
|
+
token = requestAnimationFrame(() => {
|
|
135
|
+
view.setWidth(width);
|
|
135
136
|
});
|
|
136
137
|
}
|
|
138
|
+
return () => {
|
|
139
|
+
if (token) {
|
|
140
|
+
cancelAnimationFrame(token);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
137
143
|
}, [padding, view, width]);
|
|
138
144
|
return ref;
|
|
139
145
|
}
|
package/util/types/index.d.ts
CHANGED
|
@@ -132,11 +132,11 @@ export interface SessionWithDrawerWidgets extends SessionWithWidgets {
|
|
|
132
132
|
setDrawerPosition(arg: string): void;
|
|
133
133
|
}
|
|
134
134
|
export declare function isSessionModelWithWidgets(thing: unknown): thing is SessionWithWidgets;
|
|
135
|
-
interface SessionWithConnections {
|
|
135
|
+
export interface SessionWithConnections {
|
|
136
136
|
makeConnection: (arg: AnyConfigurationModel) => void;
|
|
137
137
|
}
|
|
138
138
|
export declare function isSessionModelWithConnections(thing: unknown): thing is SessionWithConnections;
|
|
139
|
-
interface SessionWithConnectionEditing {
|
|
139
|
+
export interface SessionWithConnectionEditing {
|
|
140
140
|
addConnectionConf: (arg: AnyConfigurationModel) => void;
|
|
141
141
|
}
|
|
142
142
|
export declare function isSessionModelWithConnectionEditing(thing: unknown): thing is SessionWithConnectionEditing;
|