react-science 0.27.0 → 0.27.1-pre.1696432898
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/lib/app/about/AboutDialogToolbarButton.js +3 -3
- package/lib/app/kinds/iv/plot-view/IvPlotView.js +5 -6
- package/lib/components/fullscreen/FullscreenToolbarButton.js +2 -3
- package/lib/components/modal/ConfirmModal.js +3 -1
- package/lib/components/root-layout/RootLayout.js +4 -2
- package/lib/components/split-pane/SplitPane.js +5 -4
- package/lib/components/split-pane/useSplitPaneSize.js +8 -8
- package/lib/components/tabs/Tabs.js +1 -0
- package/lib/components/toolbar/Toolbar.js +27 -83
- package/lib/components/toolbar/toolbarContext.js +13 -0
- package/lib-esm/app/about/AboutDialogToolbarButton.d.ts +2 -1
- package/lib-esm/app/about/AboutDialogToolbarButton.d.ts.map +1 -1
- package/lib-esm/app/about/AboutDialogToolbarButton.js +2 -2
- package/lib-esm/app/about/AboutDialogToolbarButton.js.map +1 -1
- package/lib-esm/app/kinds/iv/plot-view/IvPlotView.d.ts.map +1 -1
- package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js +3 -4
- package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js.map +1 -1
- package/lib-esm/components/fullscreen/FullscreenToolbarButton.d.ts.map +1 -1
- package/lib-esm/components/fullscreen/FullscreenToolbarButton.js +2 -3
- package/lib-esm/components/fullscreen/FullscreenToolbarButton.js.map +1 -1
- package/lib-esm/components/modal/ConfirmModal.d.ts.map +1 -1
- package/lib-esm/components/modal/ConfirmModal.js +3 -1
- package/lib-esm/components/modal/ConfirmModal.js.map +1 -1
- package/lib-esm/components/root-layout/RootLayout.d.ts +1 -1
- package/lib-esm/components/root-layout/RootLayout.d.ts.map +1 -1
- package/lib-esm/components/root-layout/RootLayout.js +4 -2
- package/lib-esm/components/root-layout/RootLayout.js.map +1 -1
- package/lib-esm/components/split-pane/SplitPane.js +5 -4
- package/lib-esm/components/split-pane/SplitPane.js.map +1 -1
- package/lib-esm/components/split-pane/useSplitPaneSize.d.ts +1 -1
- package/lib-esm/components/split-pane/useSplitPaneSize.js +8 -8
- package/lib-esm/components/split-pane/useSplitPaneSize.js.map +1 -1
- package/lib-esm/components/tabs/Tabs.js +1 -0
- package/lib-esm/components/tabs/Tabs.js.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.d.ts +9 -7
- package/lib-esm/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.js +29 -85
- package/lib-esm/components/toolbar/Toolbar.js.map +1 -1
- package/lib-esm/components/toolbar/toolbarContext.d.ts +11 -0
- package/lib-esm/components/toolbar/toolbarContext.d.ts.map +1 -0
- package/lib-esm/components/toolbar/toolbarContext.js +10 -0
- package/lib-esm/components/toolbar/toolbarContext.js.map +1 -0
- package/package.json +3 -1
- package/src/app/about/AboutDialogToolbarButton.tsx +4 -9
- package/src/app/kinds/iv/plot-view/IvPlotView.tsx +4 -7
- package/src/components/fullscreen/FullscreenToolbarButton.tsx +2 -6
- package/src/components/modal/ConfirmModal.tsx +3 -1
- package/src/components/root-layout/RootLayout.tsx +5 -2
- package/src/components/split-pane/SplitPane.tsx +13 -7
- package/src/components/split-pane/useSplitPaneSize.tsx +8 -8
- package/src/components/tabs/Tabs.tsx +1 -0
- package/src/components/toolbar/Toolbar.tsx +81 -122
- package/src/components/toolbar/toolbarContext.ts +21 -0
- package/lib/components/toolbar/ToolbarContext.js +0 -18
- package/lib-esm/components/toolbar/ToolbarContext.d.ts +0 -8
- package/lib-esm/components/toolbar/ToolbarContext.d.ts.map +0 -1
- package/lib-esm/components/toolbar/ToolbarContext.js +0 -14
- package/lib-esm/components/toolbar/ToolbarContext.js.map +0 -1
- package/src/components/toolbar/ToolbarContext.tsx +0 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSplitPaneSize.js","sourceRoot":"","sources":["../../../src/components/split-pane/useSplitPaneSize.tsx"],"names":[],"mappings":"AAkBA,M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AAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IAClE,OAAO,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,SAAS,CAAC,KAAa,EAAE,OAAqC;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -87,6 +87,7 @@ function TabsHorizontal(props) {
|
|
|
87
87
|
flexDirection: 'row',
|
|
88
88
|
borderBottom: '1px solid hsl(0deg, 0%, 80%)',
|
|
89
89
|
overflowX: 'auto',
|
|
90
|
+
overflowY: 'hidden',
|
|
90
91
|
}, css: styles.scroll, children: items.map((item) => (_jsx(TabsItem, { orientation: "horizontal", id: item.id, title: item.title, onClick: () => {
|
|
91
92
|
onClick?.(item.id);
|
|
92
93
|
} }, item.id))) }), item && (_jsx("div", { style: { flex: '1 1 0%', overflowX: 'auto' }, children: item.content }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/components/tabs/Tabs.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAa,OAAO,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAuB7D,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,GAAG,CAAC;QACV,sBAAsB,EAAE;YACtB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,KAAK;SACb;QACD,4BAA4B,EAAE;YAC5B,eAAe,EAAE,iBAAiB;SACnC;QACD,4BAA4B,EAAE;YAC5B,eAAe,EAAE,gBAA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AQ;YACnB,MAAM,EAAE,MAAM;SACf,aAED,cACE,KAAK,EAAE;oBACL,OAAO,EAAE,MAAM;oBACf,aAAa,EAAE,KAAK;oBACpB,YAAY,EAAE,8BAA8B;oBAC5C,SAAS,EAAE,MAAM;oBACjB,SAAS,EAAE,QAAQ;iBACpB,EACD,GAAG,EAAE,MAAM,CAAC,MAAM,YAEjB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,KAAC,QAAQ,IAEP,WAAW,EAAC,YAAY,EACxB,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,GAAG,EAAE;wBACZ,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACrB,CAAC,IANI,IAAI,CAAC,EAAE,CAOZ,CACH,CAAC,GACE,EACL,IAAI,IAAI,CACP,cAAK,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,YAAG,IAAI,CAAC,OAAO,GAAO,CACxE,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { ButtonProps, Intent } from '@blueprintjs/core';
|
|
3
|
+
import { ReactElement, ReactNode } from 'react';
|
|
4
4
|
export interface ToolbarProps {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
vertical?: boolean;
|
|
6
|
+
large?: boolean;
|
|
7
|
+
intent?: Intent;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
children?: Array<ReactElement<ToolbarItemProps>> | ReactElement<ToolbarItemProps> | Iterable<ReactNode> | boolean | null;
|
|
7
10
|
}
|
|
8
11
|
export interface ToolbarItemProps {
|
|
9
12
|
id?: string;
|
|
10
13
|
title: string;
|
|
11
|
-
|
|
14
|
+
icon: ButtonProps['icon'];
|
|
12
15
|
active?: boolean;
|
|
13
|
-
titleOrientation?: ToolbarItemOrientation;
|
|
14
16
|
onClick?: (item: ToolbarItemProps) => void;
|
|
15
17
|
className?: string;
|
|
16
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAGL,WAAW,EAGX,MAAM,EAEP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,YAAY,EACZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAQf,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EACL,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,GACrC,YAAY,CAAC,gBAAgB,CAAC,GAC9B,QAAQ,CAAC,SAAS,CAAC,GACnB,OAAO,GACP,IAAI,CAAC;CACV;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,oDAoD1C;yBApDe,OAAO"}
|
|
@@ -1,81 +1,20 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Button, ButtonGroup, Classes, Colors, Tooltip, } from '@blueprintjs/core';
|
|
3
4
|
import { css } from '@emotion/react';
|
|
4
|
-
import { useLayoutEffect, useRef, } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { useLayoutEffect, useMemo, useRef, } from 'react';
|
|
6
|
+
import { toolbarContext, useToolbarContext, } from './toolbarContext';
|
|
6
7
|
const border = '1px solid rgb(247, 247, 247)';
|
|
7
|
-
const styles = {
|
|
8
|
-
toolbar: (orientation) => {
|
|
9
|
-
return css([
|
|
10
|
-
{ display: 'flex', flexWrap: 'wrap' },
|
|
11
|
-
orientation === 'vertical'
|
|
12
|
-
? {
|
|
13
|
-
flexDirection: 'column',
|
|
14
|
-
minHeight: '100%',
|
|
15
|
-
borderRight: border,
|
|
16
|
-
}
|
|
17
|
-
: {
|
|
18
|
-
flexDirection: 'row',
|
|
19
|
-
minWidth: '100%',
|
|
20
|
-
},
|
|
21
|
-
]);
|
|
22
|
-
},
|
|
23
|
-
item: (active) => {
|
|
24
|
-
return css([
|
|
25
|
-
active && { backgroundColor: 'rgb(247, 247, 247)', borderRadius: 5 },
|
|
26
|
-
{
|
|
27
|
-
width: 30,
|
|
28
|
-
height: 30,
|
|
29
|
-
outline: 'none',
|
|
30
|
-
alignItems: 'center',
|
|
31
|
-
justifyContent: 'center',
|
|
32
|
-
display: 'flex',
|
|
33
|
-
'&:hover + .content': { display: 'flex' },
|
|
34
|
-
},
|
|
35
|
-
]);
|
|
36
|
-
},
|
|
37
|
-
tooltip: (orientation, itemOrientation) => {
|
|
38
|
-
const common = {
|
|
39
|
-
display: 'none',
|
|
40
|
-
position: 'absolute',
|
|
41
|
-
backgroundColor: 'gray',
|
|
42
|
-
borderRadius: '2px',
|
|
43
|
-
color: 'white',
|
|
44
|
-
bottom: '0px',
|
|
45
|
-
right: '0px',
|
|
46
|
-
width: 'fit-content',
|
|
47
|
-
height: '50%',
|
|
48
|
-
fontSize: '0.875em',
|
|
49
|
-
whiteSpace: 'nowrap',
|
|
50
|
-
paddingLeft: '3px',
|
|
51
|
-
paddingRight: '3px',
|
|
52
|
-
zIndex: 50,
|
|
53
|
-
};
|
|
54
|
-
if (itemOrientation === 'auto') {
|
|
55
|
-
return css([
|
|
56
|
-
common,
|
|
57
|
-
orientation === 'vertical' && { margin: 'auto', marginLeft: 5 },
|
|
58
|
-
orientation === 'horizontal'
|
|
59
|
-
? { top: '100%' }
|
|
60
|
-
: { top: '0px', left: '100%' },
|
|
61
|
-
]);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
return css([
|
|
65
|
-
common,
|
|
66
|
-
itemOrientation === 'horizontal' && { margin: 'auto', marginLeft: 5 },
|
|
67
|
-
itemOrientation === 'vertical'
|
|
68
|
-
? { top: '100%' }
|
|
69
|
-
: { top: '0px', left: '100%' },
|
|
70
|
-
]);
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
8
|
export function Toolbar(props) {
|
|
75
|
-
const { children,
|
|
9
|
+
const { children, disabled, intent, large, vertical } = props;
|
|
10
|
+
const contextValue = useMemo(() => ({ intent, large, vertical, disabled }), [intent, large, vertical, disabled]);
|
|
76
11
|
const ref = useRef(null);
|
|
12
|
+
// Work around wrong width on vertical flex when wrapping
|
|
13
|
+
// In Chrome: recently fixed (https://bugs.chromium.org/p/chromium/issues/detail?id=507397)
|
|
14
|
+
// In Firefox: work-around needed (https://bugzilla.mozilla.org/show_bug.cgi?id=995020)
|
|
15
|
+
// In Safari: work-around needed
|
|
77
16
|
useLayoutEffect(() => {
|
|
78
|
-
if (
|
|
17
|
+
if (!vertical) {
|
|
79
18
|
return;
|
|
80
19
|
}
|
|
81
20
|
function update() {
|
|
@@ -97,20 +36,25 @@ export function Toolbar(props) {
|
|
|
97
36
|
observer.observe(element);
|
|
98
37
|
return () => observer.unobserve(element);
|
|
99
38
|
}
|
|
100
|
-
}, [
|
|
101
|
-
return (_jsx(
|
|
39
|
+
}, [vertical]);
|
|
40
|
+
return (_jsx(ToolbarProvider, { value: contextValue, children: _jsx(ButtonGroup, { ref: ref, vertical: vertical, large: large, style: { flexWrap: 'wrap', borderRight: vertical ? border : undefined }, children: children }) }));
|
|
102
41
|
}
|
|
103
42
|
Toolbar.Item = function ToolbarItem(props) {
|
|
104
|
-
const
|
|
105
|
-
const {
|
|
106
|
-
return (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
43
|
+
const { active = false, icon, onClick, title, id, ...other } = props;
|
|
44
|
+
const { intent, large, vertical, disabled } = useToolbarContext();
|
|
45
|
+
return (_jsx(Tooltip, { css: css `
|
|
46
|
+
flex-grow: 0 !important;
|
|
47
|
+
`, compact: !large, intent: intent, content: title, placement: vertical ? 'right' : 'bottom', children: _jsx(Button, { minimal: true, disabled: disabled, css: css `
|
|
48
|
+
.${Classes.ICON} {
|
|
49
|
+
color: ${Colors.DARK_GRAY3};
|
|
50
|
+
}
|
|
51
|
+
`, intent: intent, style: { position: 'relative', fontSize: '1.25em' }, type: "button", active: active, icon: icon, onClick: () => {
|
|
52
|
+
if (onClick) {
|
|
53
|
+
onClick(props);
|
|
54
|
+
}
|
|
55
|
+
}, ...other }) }));
|
|
115
56
|
};
|
|
57
|
+
function ToolbarProvider(props) {
|
|
58
|
+
return (_jsx(toolbarContext.Provider, { value: props.value, children: props.children }));
|
|
59
|
+
}
|
|
116
60
|
//# sourceMappingURL=Toolbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[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,KAAK,EACd,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,YAExC,KAAC,MAAM,IACL,OAAO,QACP,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,CAAA;aACH,OAAO,CAAC,IAAI;qBACJ,MAAM,CAAC,UAAU;;SAE7B,EACD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,EACnD,IAAI,EAAC,QAAQ,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,OAAO,EAAE;oBACX,OAAO,CAAC,KAAK,CAAC,CAAC;iBAChB;YACH,CAAC,KACG,KAAK,GACT,GACM,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,eAAe,CAAC,KAGxB;IACC,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YACxC,KAAK,CAAC,QAAQ,GACS,CAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Intent } from '@blueprintjs/core';
|
|
3
|
+
export interface ToolbarContext {
|
|
4
|
+
intent?: Intent;
|
|
5
|
+
large?: boolean;
|
|
6
|
+
vertical?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const toolbarContext: import("react").Context<ToolbarContext | null>;
|
|
10
|
+
export declare function useToolbarContext(): ToolbarContext;
|
|
11
|
+
//# sourceMappingURL=toolbarContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbarContext.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/toolbarContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,gDAA6C,CAAC;AAEzE,wBAAgB,iBAAiB,mBAQhC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
export const toolbarContext = createContext(null);
|
|
3
|
+
export function useToolbarContext() {
|
|
4
|
+
const ctx = useContext(toolbarContext);
|
|
5
|
+
if (!ctx) {
|
|
6
|
+
throw new Error('useToolbarContext must be used within a ToolbarContextProvider');
|
|
7
|
+
}
|
|
8
|
+
return ctx;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=toolbarContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbarContext.js","sourceRoot":"","sources":["../../../src/components/toolbar/toolbarContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AASlD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAwB,IAAI,CAAC,CAAC;AAEzE,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IACvC,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;KACH;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-science",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.1-pre.1696432898",
|
|
4
4
|
"description": "React components to build scientific applications UI",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./app": {
|
|
@@ -62,6 +62,8 @@
|
|
|
62
62
|
"react-dom": ">=18.0.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
+
"@blueprintjs/core": "^5.3.2",
|
|
66
|
+
"@blueprintjs/icons": "^5.1.7",
|
|
65
67
|
"@emotion/react": "^11.11.1",
|
|
66
68
|
"@emotion/styled": "^11.11.0",
|
|
67
69
|
"@headlessui/react": "^1.7.16",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { ButtonProps } from '@blueprintjs/core';
|
|
1
2
|
import styled from '@emotion/styled';
|
|
2
3
|
import { ReactNode } from 'react';
|
|
3
4
|
|
|
4
|
-
import { Modal, Toolbar, useOnOff } from '../../components
|
|
5
|
+
import { Modal, Toolbar, useOnOff } from '../../components';
|
|
5
6
|
|
|
6
7
|
interface AboutDialogToolbarButtonProps {
|
|
7
8
|
name: string;
|
|
8
|
-
icon:
|
|
9
|
+
icon: ButtonProps['icon'];
|
|
9
10
|
body: ReactNode;
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -20,13 +21,7 @@ export function AboutDialogToolbarButton(props: AboutDialogToolbarButtonProps) {
|
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
23
|
<>
|
|
23
|
-
<Toolbar.Item
|
|
24
|
-
titleOrientation="horizontal"
|
|
25
|
-
title={`About ${name}`}
|
|
26
|
-
onClick={openDialog}
|
|
27
|
-
>
|
|
28
|
-
{icon}
|
|
29
|
-
</Toolbar.Item>
|
|
24
|
+
<Toolbar.Item title={`About ${name}`} onClick={openDialog} icon={icon} />
|
|
30
25
|
<Modal isOpen={isOpenDialog} onRequestClose={closeDialog}>
|
|
31
26
|
<Modal.Header>{name}</Modal.Header>
|
|
32
27
|
<Modal.Body>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import { FaCompress } from 'react-icons/fa';
|
|
3
2
|
import { PlotController } from 'react-plot';
|
|
4
3
|
|
|
5
|
-
import { useAppDispatch, useAppState } from '../../../../app-data
|
|
6
|
-
import { Toolbar } from '../../../../components
|
|
4
|
+
import { useAppDispatch, useAppState } from '../../../../app-data';
|
|
5
|
+
import { Toolbar } from '../../../../components';
|
|
7
6
|
|
|
8
7
|
import IvMeasurementsPlot from './IvMeasurementsPlot';
|
|
9
8
|
import IvPlotVariablesSelector from './IvPlotVariablesSelector';
|
|
@@ -49,10 +48,8 @@ function VerticalToolbar() {
|
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
return (
|
|
52
|
-
<Toolbar
|
|
53
|
-
<Toolbar.Item onClick={onZoomOut} title="Zoom out"
|
|
54
|
-
<FaCompress />
|
|
55
|
-
</Toolbar.Item>
|
|
51
|
+
<Toolbar vertical>
|
|
52
|
+
<Toolbar.Item onClick={onZoomOut} title="Zoom out" icon="zoom-out" />
|
|
56
53
|
</Toolbar>
|
|
57
54
|
);
|
|
58
55
|
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { Toolbar } from '../toolbar/Toolbar';
|
|
1
|
+
import { Toolbar } from '../toolbar';
|
|
4
2
|
|
|
5
3
|
import { useFullscreen } from './FullscreenContext';
|
|
6
4
|
|
|
7
5
|
export function FullscreenToolbarButton() {
|
|
8
6
|
const { toggle } = useFullscreen();
|
|
9
7
|
return (
|
|
10
|
-
<Toolbar.Item title="Full screen" onClick={toggle}
|
|
11
|
-
<FaExpand />
|
|
12
|
-
</Toolbar.Item>
|
|
8
|
+
<Toolbar.Item icon="fullscreen" title="Full screen" onClick={toggle} />
|
|
13
9
|
);
|
|
14
10
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { FocusStyleManager } from '@blueprintjs/core';
|
|
1
2
|
import { QueryClientProvider } from '@tanstack/react-query';
|
|
2
|
-
import { ReactNode,
|
|
3
|
+
import { CSSProperties, ReactNode, useCallback, useState } from 'react';
|
|
3
4
|
|
|
4
|
-
import { AccordionProvider } from '../accordion
|
|
5
|
+
import { AccordionProvider } from '../accordion';
|
|
5
6
|
|
|
6
7
|
import { RootLayoutProvider } from './RootLayoutContext';
|
|
7
8
|
import { CustomDivPreflight } from './css-reset/customPreflight';
|
|
8
9
|
import { queryClient } from './queryClient';
|
|
9
10
|
|
|
11
|
+
FocusStyleManager.onlyShowFocusOnTabs();
|
|
12
|
+
|
|
10
13
|
interface RootLayoutProps {
|
|
11
14
|
style?: CSSProperties;
|
|
12
15
|
children: ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
PointerEvent as ReactPointerEvent,
|
|
5
5
|
createContext,
|
|
6
6
|
CSSProperties,
|
|
7
7
|
ReactNode,
|
|
@@ -114,7 +114,7 @@ export function SplitPane(props: SplitPaneProps) {
|
|
|
114
114
|
}, [closePane, closed, openPane]);
|
|
115
115
|
|
|
116
116
|
const splitterRef = useRef<HTMLDivElement>(null);
|
|
117
|
-
const {
|
|
117
|
+
const { onPointerDown } = useSplitPaneSize({
|
|
118
118
|
controlledSide,
|
|
119
119
|
direction,
|
|
120
120
|
splitterRef,
|
|
@@ -183,7 +183,7 @@ export function SplitPane(props: SplitPaneProps) {
|
|
|
183
183
|
|
|
184
184
|
<Splitter
|
|
185
185
|
onDoubleClick={handleToggle}
|
|
186
|
-
|
|
186
|
+
onPointerDown={isFinalClosed ? undefined : onPointerDown}
|
|
187
187
|
isFinalClosed={isFinalClosed}
|
|
188
188
|
direction={direction}
|
|
189
189
|
splitterRef={splitterRef}
|
|
@@ -196,19 +196,24 @@ export function SplitPane(props: SplitPaneProps) {
|
|
|
196
196
|
|
|
197
197
|
interface SplitterProps {
|
|
198
198
|
onDoubleClick: () => void;
|
|
199
|
-
|
|
199
|
+
onPointerDown?: (event: ReactPointerEvent) => void;
|
|
200
200
|
direction: SplitPaneDirection;
|
|
201
201
|
isFinalClosed: boolean;
|
|
202
202
|
splitterRef: RefObject<HTMLDivElement>;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
function Splitter(props: SplitterProps) {
|
|
206
|
-
const {
|
|
207
|
-
|
|
206
|
+
const {
|
|
207
|
+
onDoubleClick,
|
|
208
|
+
onPointerDown,
|
|
209
|
+
direction,
|
|
210
|
+
isFinalClosed,
|
|
211
|
+
splitterRef,
|
|
212
|
+
} = props;
|
|
208
213
|
return (
|
|
209
214
|
<div
|
|
210
215
|
onDoubleClick={onDoubleClick}
|
|
211
|
-
|
|
216
|
+
onPointerDown={onPointerDown}
|
|
212
217
|
css={getSeparatorStyle(direction, !isFinalClosed)}
|
|
213
218
|
ref={splitterRef}
|
|
214
219
|
>
|
|
@@ -298,6 +303,7 @@ function getSeparatorStyle(direction: SplitPaneDirection, enabled: boolean) {
|
|
|
298
303
|
alignItems: 'center',
|
|
299
304
|
userSelect: 'none',
|
|
300
305
|
minWidth: 11,
|
|
306
|
+
touchAction: 'none',
|
|
301
307
|
':hover': {
|
|
302
308
|
backgroundColor: 'rgb(223, 223, 223)',
|
|
303
309
|
},
|
|
@@ -26,9 +26,9 @@ export function useSplitPaneSize(options: UseSplitPaneSizeOptions) {
|
|
|
26
26
|
onResize,
|
|
27
27
|
} = options;
|
|
28
28
|
|
|
29
|
-
function
|
|
29
|
+
function downCallback() {
|
|
30
30
|
let lastSize: [number, SplitPaneType] | null = null;
|
|
31
|
-
function
|
|
31
|
+
function moveCallback(event: PointerEvent) {
|
|
32
32
|
if (!splitterRef.current) return;
|
|
33
33
|
const { clientX, clientY } = event;
|
|
34
34
|
const parentDiv = splitterRef.current.parentElement as HTMLDivElement;
|
|
@@ -69,20 +69,20 @@ export function useSplitPaneSize(options: UseSplitPaneSizeOptions) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
function
|
|
73
|
-
window.removeEventListener('
|
|
74
|
-
window.removeEventListener('
|
|
72
|
+
function upCallback() {
|
|
73
|
+
window.removeEventListener('pointermove', moveCallback);
|
|
74
|
+
window.removeEventListener('pointerup', upCallback);
|
|
75
75
|
if (lastSize && onResize) {
|
|
76
76
|
onResize(`${lastSize[0]}${lastSize[1]}`);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
window.addEventListener('
|
|
81
|
-
window.addEventListener('
|
|
80
|
+
window.addEventListener('pointermove', moveCallback);
|
|
81
|
+
window.addEventListener('pointerup', upCallback);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
return {
|
|
85
|
-
|
|
85
|
+
onPointerDown: downCallback,
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
|