Skip to content

Commit c8567d5

Browse files
committed
dist folder
Made-with: Cursor
1 parent 58ad6ab commit c8567d5

52 files changed

Lines changed: 2069 additions & 975 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dist/actions/cyclic_voltammetry.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Object.defineProperty(exports, "__esModule", {
44
value: true
55
});
6-
exports.setWorkWithMaxPeak = exports.setCylicVoltaRefFactor = exports.setCylicVoltaRef = exports.selectRefPeaks = exports.selectPairPeak = exports.removeCylicVoltaPecker = exports.removeCylicVoltaPairPeak = exports.removeCylicVoltaMinPeak = exports.removeCylicVoltaMaxPeak = exports.addNewCylicVoltaPairPeak = exports.addCylicVoltaPecker = exports.addCylicVoltaMinPeak = exports.addCylicVoltaMaxPeak = void 0;
6+
exports.toggleCyclicVoltaDensity = exports.setWorkWithMaxPeak = exports.setCylicVoltaRefFactor = exports.setCylicVoltaRef = exports.setCyclicVoltaAreaValue = exports.setCyclicVoltaAreaUnit = exports.selectRefPeaks = exports.selectPairPeak = exports.removeCylicVoltaPecker = exports.removeCylicVoltaPairPeak = exports.removeCylicVoltaMinPeak = exports.removeCylicVoltaMaxPeak = exports.addNewCylicVoltaPairPeak = exports.addCylicVoltaPecker = exports.addCylicVoltaMinPeak = exports.addCylicVoltaMaxPeak = void 0;
77
var _action_type = require("../constants/action_type");
88
const addNewCylicVoltaPairPeak = payload => ({
99
type: _action_type.CYCLIC_VOLTA_METRY.ADD_PAIR_PEAKS,
@@ -69,4 +69,23 @@ const setCylicVoltaRef = payload => ({
6969
type: _action_type.CYCLIC_VOLTA_METRY.SET_REF,
7070
payload
7171
});
72-
exports.setCylicVoltaRef = setCylicVoltaRef;
72+
exports.setCylicVoltaRef = setCylicVoltaRef;
73+
const setCyclicVoltaAreaValue = value => ({
74+
type: _action_type.CYCLIC_VOLTA_METRY.SET_AREA_VALUE,
75+
payload: {
76+
value
77+
}
78+
});
79+
exports.setCyclicVoltaAreaValue = setCyclicVoltaAreaValue;
80+
const setCyclicVoltaAreaUnit = unit => ({
81+
type: _action_type.CYCLIC_VOLTA_METRY.SET_AREA_UNIT,
82+
payload: {
83+
unit
84+
}
85+
});
86+
exports.setCyclicVoltaAreaUnit = setCyclicVoltaAreaUnit;
87+
const toggleCyclicVoltaDensity = payload => ({
88+
type: _action_type.CYCLIC_VOLTA_METRY.TOGGLE_DENSITY,
89+
payload
90+
});
91+
exports.toggleCyclicVoltaDensity = toggleCyclicVoltaDensity;

dist/actions/hplc_ms.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@ Object.defineProperty(exports, "__esModule", {
55
});
66
exports.updateCurrentPageValue = exports.selectWavelength = exports.clearIntegrationAllHplcMs = exports.clearAllPeaksHplcMs = exports.changeTic = void 0;
77
var _action_type = require("../constants/action_type");
8+
const normalizeTicPolarity = value => {
9+
if (value === 0 || value === '0') return 'positive';
10+
if (value === 1 || value === '1') return 'negative';
11+
if (value === 2 || value === '2') return 'neutral';
12+
if (value === 'positive' || value === 'negative' || value === 'neutral') return value;
13+
return 'positive';
14+
};
815
const selectWavelength = payload => ({
916
type: _action_type.HPLC_MS.UPDATE_UVVIS_WAVE_LENGTH,
1017
payload
1118
});
1219
exports.selectWavelength = selectWavelength;
1320
const changeTic = payload => {
1421
const rawValue = payload?.target?.value ?? payload?.polarity ?? 'positive';
15-
let polarity = rawValue;
16-
if (rawValue === 0 || rawValue === '0') polarity = 'positive';
17-
if (rawValue === 1 || rawValue === '1') polarity = 'negative';
18-
if (rawValue === 2 || rawValue === '2') polarity = 'neutral';
19-
const action = {
22+
const polarity = normalizeTicPolarity(rawValue);
23+
return {
2024
type: _action_type.HPLC_MS.SELECT_TIC_CURVE,
2125
payload: {
2226
polarity
2327
}
2428
};
25-
return action;
2629
};
2730
exports.changeTic = changeTic;
2831
const updateCurrentPageValue = currentPageValue => ({

dist/app.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ const sagaMiddleware = (0, _reduxSaga.default)();
3434
const middlewares = [sagaMiddleware]; // logger
3535

3636
const store = exports.store = (0, _redux.compose)((0, _redux.applyMiddleware)(...middlewares))(_redux.createStore)(_index.default);
37-
sagaMiddleware.run(_index2.default);
37+
_fn.default.setLcmsStateGetter(() => store.getState().hplcMs);
38+
try {
39+
sagaMiddleware.run(_index2.default);
40+
} catch (error) {
41+
// Keep startup failure visible without crashing silently.
42+
console.error('[SpectraEditor] Failed to start sagas', error); // eslint-disable-line no-console
43+
}
3844

3945
// - - - helper - - -
4046
const ensureQuillDelta = descs => {
@@ -113,7 +119,7 @@ SpectraEditor.defaultProps = {
113119
others: [],
114120
addOthersCb: false
115121
},
116-
multiEntities: false,
122+
multiEntities: [],
117123
entityFileNames: [],
118124
cLabel: '',
119125
xLabel: '',

dist/components/cmd_bar/01_viewer.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,28 @@ const Viewer = ({
4040
className: "txt-sv-tp",
4141
children: "Spectrum Viewer"
4242
}),
43-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.MuButton, {
44-
className: (0, _classnames.default)((0, _common.focusStyle)(isfocusSpectrumSt, classes), 'btn-sv-bar-spctrum'),
45-
onClick: onViewSpectrum,
46-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TimelineOutlined.default, {
47-
className: classes.icon
43+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
44+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.MuButton, {
45+
className: (0, _classnames.default)((0, _common.focusStyle)(isfocusSpectrumSt, classes), 'btn-sv-bar-spctrum'),
46+
onClick: onViewSpectrum,
47+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TimelineOutlined.default, {
48+
className: classes.icon
49+
})
4850
})
4951
})
5052
}), hideCmdAnaViewerSt ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
5153
title: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
5254
className: "txt-sv-tp",
5355
children: "Analysis Viewer"
5456
}),
55-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.MuButton, {
56-
className: (0, _classnames.default)((0, _common.focusStyle)(isfocusAnalysisSt, classes), 'btn-sv-bar-analysis'),
57-
disabled: disableCmdAnaViewerSt,
58-
onClick: onViewAnalysis,
59-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpellcheckOutlined.default, {
60-
className: classes.icon
57+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
58+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.MuButton, {
59+
className: (0, _classnames.default)((0, _common.focusStyle)(isfocusAnalysisSt, classes), 'btn-sv-bar-analysis'),
60+
disabled: disableCmdAnaViewerSt,
61+
onClick: onViewAnalysis,
62+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpellcheckOutlined.default, {
63+
className: classes.icon
64+
})
6165
})
6266
})
6367
})]

dist/components/cmd_bar/03_peak.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const Peak = ({
3838
isFocusSetRefSt,
3939
disableSetRefSt,
4040
isHandleMaxAndMinPeaksSt,
41-
cyclicVotaSt,
41+
cyclicVoltaState,
4242
curveSt,
4343
clearAllPeaksAct,
4444
feature,
@@ -49,7 +49,7 @@ const Peak = ({
4949
clearAllPeaksHplcMsAct
5050
}) => {
5151
let onSweepPeakAdd = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_ADD);
52-
let onSweepPeakDELETE = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_DELETE);
52+
let onSweepPeakDelete = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_DELETE);
5353
let onSweepAnchorShift = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.ANCHOR_SHIFT);
5454
const {
5555
curveIdx
@@ -68,18 +68,18 @@ const Peak = ({
6868
if (isHandleMaxAndMinPeaksSt) {
6969
const {
7070
spectraList
71-
} = cyclicVotaSt;
71+
} = cyclicVoltaState;
7272
const spectra = spectraList[curveIdx];
7373
if (spectra) {
7474
const {
7575
isWorkMaxPeak
7676
} = spectra;
7777
if (isWorkMaxPeak) {
7878
onSweepPeakAdd = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MAX_PEAK, curveIdx);
79-
onSweepPeakDELETE = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MAX_PEAK, curveIdx);
79+
onSweepPeakDelete = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MAX_PEAK, curveIdx);
8080
} else {
8181
onSweepPeakAdd = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MIN_PEAK, curveIdx);
82-
onSweepPeakDELETE = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MIN_PEAK, curveIdx);
82+
onSweepPeakDelete = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MIN_PEAK, curveIdx);
8383
}
8484
onSweepAnchorShift = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_SET_REF, curveIdx);
8585
}
@@ -112,7 +112,7 @@ const Peak = ({
112112
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.MuButton, {
113113
className: (0, _classnames.default)((0, _common.focusStyle)(isFocusRmPeakSt, classes), 'btn-sv-bar-rmpeak'),
114114
disabled: disableRmPeakSt,
115-
onClick: onSweepPeakDELETE,
115+
onClick: onSweepPeakDelete,
116116
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
117117
className: (0, _classnames.default)(classes.txt, 'txt-sv-bar-rmpeak'),
118118
children: "P-"
@@ -160,7 +160,7 @@ const mapStateToProps = (state, props) => (
160160
isFocusSetRefSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.ANCHOR_SHIFT || state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_SET_REF,
161161
disableSetRefSt: _cfg.default.btnCmdSetRef(state.layout),
162162
isHandleMaxAndMinPeaksSt: !_cfg.default.hidePanelCyclicVolta(state.layout),
163-
cyclicVotaSt: state.cyclicvolta,
163+
cyclicVoltaState: state.cyclicvolta,
164164
curveSt: state.curve,
165165
editPeakSt: state.editPeak.present,
166166
thresSt: state.threshold.list[state.curve.curveIdx],
@@ -182,7 +182,7 @@ Peak.propTypes = {
182182
disableSetRefSt: _propTypes.default.bool.isRequired,
183183
setUiSweepTypeAct: _propTypes.default.func.isRequired,
184184
isHandleMaxAndMinPeaksSt: _propTypes.default.bool.isRequired,
185-
cyclicVotaSt: _propTypes.default.object.isRequired,
185+
cyclicVoltaState: _propTypes.default.object.isRequired,
186186
curveSt: _propTypes.default.object.isRequired,
187187
clearAllPeaksAct: _propTypes.default.func.isRequired,
188188
feature: _propTypes.default.object.isRequired,

dist/components/cmd_bar/common.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,19 @@ const useStyles = (0, _styles.makeStyles)(theme => ({
2626
color: 'black'
2727
}
2828
}));
29-
const MuButton = props => {
29+
const MuButton = exports.MuButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
3030
const classes = useStyles();
3131
const {
3232
className,
3333
...other
3434
} = props;
3535
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
36+
ref: ref,
3637
className: (0, _classnames.default)(classes.muiBtn, className),
3738
...other
3839
});
39-
};
40-
exports.MuButton = MuButton;
40+
});
41+
MuButton.displayName = 'MuButton';
4142
const commonStyle = exports.commonStyle = {
4243
card: {
4344
margin: '0 0 5px 52px',

dist/components/cmd_bar/index.js

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ var _r07_wavelength_btn = _interopRequireDefault(require("./r07_wavelength_btn")
2424
var _pecker = _interopRequireDefault(require("./07_pecker"));
2525
var _r08_change_axes = _interopRequireDefault(require("./r08_change_axes"));
2626
var _r09_detector = _interopRequireDefault(require("./r09_detector"));
27+
var _r10_cv_density = _interopRequireDefault(require("./r10_cv_density"));
28+
var _format = _interopRequireDefault(require("../../helpers/format"));
2729
var _jsxRuntime = require("react/jsx-runtime");
2830
/* eslint-disable prefer-object-spread, function-paren-newline,
2931
react/function-component-definition, react/require-default-props */
@@ -38,46 +40,52 @@ const CmdBar = ({
3840
editorOnly,
3941
jcampIdx,
4042
hideThreshold,
41-
hideMainEditTools
42-
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
43-
className: classes.card,
44-
children: [hideMainEditTools ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
45-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_viewer.default, {
46-
editorOnly: editorOnly
47-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_zoom.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_peak.default, {
48-
jcampIdx: jcampIdx,
49-
feature: feature
50-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_pecker.default, {
51-
jcampIdx: jcampIdx
52-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_integration.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_multiplicity.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_undo_redo.default, {})]
53-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r04_submit.default, {
54-
operations: operations,
55-
feature: feature,
56-
forecast: forecast,
57-
editorOnly: editorOnly,
58-
hideSwitch: false,
59-
disabled: false
60-
}), hideThreshold ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_r03_threshold.default, {
61-
feature: feature,
62-
hasEdit: hasEdit
63-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r01_layout.default, {
64-
feature: feature,
65-
hasEdit: hasEdit
66-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r07_wavelength_btn.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r08_change_axes.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r09_detector.default, {})]
67-
});
43+
hideMainEditTools,
44+
layoutSt
45+
}) => {
46+
const isCvLayout = _format.default.isCyclicVoltaLayout(layoutSt);
47+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
48+
className: classes.card,
49+
children: [hideMainEditTools ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
50+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_viewer.default, {
51+
editorOnly: editorOnly
52+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_zoom.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_peak.default, {
53+
jcampIdx: jcampIdx,
54+
feature: feature
55+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_pecker.default, {
56+
jcampIdx: jcampIdx
57+
}), isCvLayout ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_integration.default, {}), isCvLayout ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_multiplicity.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_undo_redo.default, {})]
58+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r04_submit.default, {
59+
operations: operations,
60+
feature: feature,
61+
forecast: forecast,
62+
editorOnly: editorOnly,
63+
hideSwitch: false,
64+
disabled: false
65+
}), hideThreshold ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_r03_threshold.default, {
66+
feature: feature,
67+
hasEdit: hasEdit
68+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r01_layout.default, {
69+
feature: feature,
70+
hasEdit: hasEdit
71+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r07_wavelength_btn.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r10_cv_density.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r08_change_axes.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_r09_detector.default, {})]
72+
});
73+
};
6874
const mapStateToProps = (state, _) => (
6975
// eslint-disable-line
70-
{});
71-
const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({}, dispatch);
76+
{
77+
layoutSt: state.layout
78+
});
7279
CmdBar.propTypes = {
7380
classes: _propTypes.default.object.isRequired,
7481
feature: _propTypes.default.object.isRequired,
7582
forecast: _propTypes.default.object.isRequired,
7683
hasEdit: _propTypes.default.bool.isRequired,
7784
operations: _propTypes.default.array.isRequired,
7885
editorOnly: _propTypes.default.bool.isRequired,
86+
layoutSt: _propTypes.default.string.isRequired,
7987
jcampIdx: _propTypes.default.any,
8088
hideThreshold: _propTypes.default.bool,
8189
hideMainEditTools: _propTypes.default.bool
8290
};
83-
var _default = exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _withStyles.default)(styles))(CmdBar);
91+
var _default = exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, null), (0, _withStyles.default)(styles))(CmdBar);

dist/components/cmd_bar/r01_layout.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,35 @@ const styles = () => Object.assign({
3333
width: 100
3434
}
3535
}, _common.commonStyle);
36+
const chemSubStyle = {
37+
fontSize: '0.85em',
38+
position: 'relative',
39+
top: '0.24em',
40+
lineHeight: 1
41+
};
42+
const renderReadableSubscript = (txt = '') => {
43+
if (typeof txt !== 'string') return txt;
44+
const regex = /([A-Za-z])(\d+)/g;
45+
if (!regex.test(txt)) return txt;
46+
regex.lastIndex = 0;
47+
const parts = [];
48+
let cursor = 0;
49+
let match = regex.exec(txt);
50+
while (match) {
51+
const [raw, prefix, digits] = match;
52+
const at = match.index;
53+
if (at > cursor) parts.push(txt.slice(cursor, at));
54+
parts.push(prefix);
55+
parts.push(/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
56+
style: chemSubStyle,
57+
children: digits
58+
}, `${at}-${digits}`));
59+
cursor = at + raw.length;
60+
match = regex.exec(txt);
61+
}
62+
if (cursor < txt.length) parts.push(txt.slice(cursor));
63+
return parts;
64+
};
3665
const shiftSelect = (classes, layoutSt, setShiftRefAct, shiftSt, curveSt) => {
3766
if (_cfg.default.hideSolvent(layoutSt)) {
3867
return null;
@@ -73,9 +102,9 @@ const shiftSelect = (classes, layoutSt, setShiftRefAct, shiftSt, curveSt) => {
73102
className: (0, _classnames.default)(classes.selectInput, 'input-sv-bar-shift'),
74103
children: listShift.map(ref => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
75104
value: ref.name,
76-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
105+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
77106
className: (0, _classnames.default)(classes.txtOpt, 'option-sv-bar-shift'),
78-
children: `${ref.name}: ${_format.default.strNumberFixedDecimal(ref.value, 2)} ppm`
107+
children: [renderReadableSubscript(ref.name), `: ${_format.default.strNumberFixedDecimal(ref.value, 2)} ppm`]
79108
})
80109
}, ref.name))
81110
})]

0 commit comments

Comments
 (0)