lhcb-ntuple-wizard-test 1.1.13 → 1.2.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/components/ConfigDict.js +39 -38
- package/dist/components/ConfigList.js +33 -29
- package/dist/components/ConfigNode.js +134 -135
- package/dist/components/ConfigValue.js +22 -18
- package/dist/components/Dataset.js +7 -3
- package/dist/components/Decay.js +1 -2
- package/dist/components/DecayItem.js +49 -45
- package/dist/components/DecayTag.js +10 -7
- package/dist/components/DecayTree.js +149 -146
- package/dist/components/DecaysList.js +38 -35
- package/dist/components/DescriptorsSearch.js +192 -187
- package/dist/components/EventTypeBadge.js +9 -6
- package/dist/components/ItemSearch.js +15 -10
- package/dist/components/LinesTable.js +464 -462
- package/dist/components/NtupleWizard.js +32 -27
- package/dist/components/ParticleTag.js +10 -7
- package/dist/components/SearchItem.js +34 -31
- package/dist/components/SelectParticle.js +14 -10
- package/dist/components/SelectTag.js +10 -9
- package/dist/components/SelectTool.js +10 -9
- package/dist/components/SelectVariables.js +24 -22
- package/dist/components/StrippingBadge.js +10 -7
- package/dist/components/StrippingLine.js +8 -6
- package/dist/components/TupleTool.js +4 -3
- package/dist/components/VariablesSearch.js +15 -10
- package/dist/components/loki/LokiDict.js +64 -60
- package/dist/components/loki/LokiEditor.js +1 -2
- package/dist/components/loki/LokiForm.js +32 -28
- package/dist/{lib → components}/semantic.js +1 -3
- package/dist/components/semform.js +8 -6
- package/dist/{lib → components}/worker.js +1 -1
- package/dist/contexts/MetadataContext.js +8 -7
- package/dist/lib/DTTConfig.js +8 -8
- package/package.json +18 -19
|
@@ -5,15 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _LokiEditor = _interopRequireDefault(require("./LokiEditor"));
|
|
8
|
+
var _LokiEditor = _interopRequireDefault(require("./LokiEditor.jsx"));
|
|
9
9
|
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _reactBootstrap = require("react-bootstrap");
|
|
12
12
|
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
13
|
-
var _LokiForm = _interopRequireDefault(require("./LokiForm"));
|
|
13
|
+
var _LokiForm = _interopRequireDefault(require("./LokiForm.jsx"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
|
|
16
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
|
|
17
19
|
* (c) Copyright 2024 CERN for the benefit of the LHCb Collaboration *
|
|
18
20
|
* *
|
|
19
21
|
* This software is distributed under the terms of the GNU General Public *
|
|
@@ -23,73 +25,75 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
23
25
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
24
26
|
* or submit itself to any jurisdiction. *
|
|
25
27
|
\*****************************************************************************/
|
|
26
|
-
|
|
27
28
|
class LokiDict extends _react.default.Component {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.setState({
|
|
37
|
-
add: false
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
_defineProperty(this, "state", {
|
|
32
|
+
lines: this.props.value,
|
|
33
|
+
error: "",
|
|
34
|
+
add: false,
|
|
35
|
+
currentKey: "",
|
|
36
|
+
currentValue: ""
|
|
38
37
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const value = this.state.currentValue;
|
|
44
|
-
lines[key] = value;
|
|
45
|
-
this.setState({
|
|
46
|
-
lines: lines
|
|
38
|
+
_defineProperty(this, "handleClose", () => {
|
|
39
|
+
this.setState({
|
|
40
|
+
add: false
|
|
41
|
+
});
|
|
47
42
|
});
|
|
48
|
-
this
|
|
49
|
-
|
|
43
|
+
_defineProperty(this, "handleAdd", () => {
|
|
44
|
+
var lines = this.state.lines;
|
|
45
|
+
const key = this.state.currentKey;
|
|
46
|
+
const value = this.state.currentValue;
|
|
47
|
+
lines[key] = value;
|
|
48
|
+
this.setState({
|
|
49
|
+
lines: lines
|
|
50
|
+
});
|
|
51
|
+
this.setState({
|
|
52
|
+
currentKey: ""
|
|
53
|
+
});
|
|
54
|
+
this.setState({
|
|
55
|
+
currentValue: ""
|
|
56
|
+
});
|
|
57
|
+
this.props.callback(this.state.lines);
|
|
50
58
|
});
|
|
51
|
-
this
|
|
52
|
-
|
|
59
|
+
_defineProperty(this, "handleRemove", key => {
|
|
60
|
+
var lines = this.state.lines;
|
|
61
|
+
delete lines[key];
|
|
62
|
+
this.setState({
|
|
63
|
+
lines: lines
|
|
64
|
+
});
|
|
65
|
+
this.props.callback(this.state.lines);
|
|
53
66
|
});
|
|
54
|
-
this
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
lines
|
|
67
|
+
_defineProperty(this, "setValueByKey", (key, value) => {
|
|
68
|
+
var lines = this.state.lines;
|
|
69
|
+
lines[key] = value;
|
|
70
|
+
this.setState({
|
|
71
|
+
lines: lines
|
|
72
|
+
});
|
|
73
|
+
this.props.callback(this.state.lines);
|
|
61
74
|
});
|
|
62
|
-
this
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
lines[key] = value;
|
|
67
|
-
this.setState({
|
|
68
|
-
lines: lines
|
|
75
|
+
_defineProperty(this, "setAddLine", () => {
|
|
76
|
+
this.setState({
|
|
77
|
+
add: true
|
|
78
|
+
});
|
|
69
79
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
add: true
|
|
80
|
+
_defineProperty(this, "changeKey", value => {
|
|
81
|
+
this.setState({
|
|
82
|
+
currentKey: value
|
|
83
|
+
});
|
|
75
84
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
_defineProperty(this, "validKey", value => {
|
|
86
|
+
if (value in this.state.lines) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
return true;
|
|
80
90
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
return true;
|
|
87
|
-
};
|
|
88
|
-
changeValue = value => {
|
|
89
|
-
this.setState({
|
|
90
|
-
currentValue: value
|
|
91
|
+
_defineProperty(this, "changeValue", value => {
|
|
92
|
+
this.setState({
|
|
93
|
+
currentValue: value
|
|
94
|
+
});
|
|
91
95
|
});
|
|
92
|
-
}
|
|
96
|
+
}
|
|
93
97
|
render() {
|
|
94
98
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Card, {
|
|
95
99
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Card.Header, {
|
|
@@ -11,8 +11,7 @@ var _react2 = require("@monaco-editor/react");
|
|
|
11
11
|
var _Spinner = _interopRequireDefault(require("react-bootstrap/Spinner"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
16
|
/*****************************************************************************\
|
|
18
17
|
* (c) Copyright 2024 CERN for the benefit of the LHCb Collaboration *
|
|
@@ -5,13 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _LokiEditor = _interopRequireDefault(require("./LokiEditor"));
|
|
8
|
+
var _LokiEditor = _interopRequireDefault(require("./LokiEditor.jsx"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _reactBootstrap = require("react-bootstrap");
|
|
11
11
|
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
|
|
15
17
|
* (c) Copyright 2024 CERN for the benefit of the LHCb Collaboration *
|
|
16
18
|
* *
|
|
17
19
|
* This software is distributed under the terms of the GNU General Public *
|
|
@@ -21,38 +23,40 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
21
23
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
22
24
|
* or submit itself to any jurisdiction. *
|
|
23
25
|
\*****************************************************************************/
|
|
24
|
-
|
|
25
26
|
class LokiForm extends _react.default.Component {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
_defineProperty(this, "state", {
|
|
30
|
+
key: this.props.key,
|
|
31
|
+
value: this.props.value,
|
|
32
|
+
err: false,
|
|
33
|
+
errMsg: ""
|
|
34
|
+
});
|
|
35
|
+
_defineProperty(this, "keyCallback", event => {
|
|
36
|
+
const key = event.target.value.replaceAll(/[^\w]/g, "");
|
|
37
|
+
if (!this.props.validateKey(key)) {
|
|
38
|
+
this.setState({
|
|
39
|
+
err: true,
|
|
40
|
+
errMsg: "Key must be unique and not empty!"
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
this.setState({
|
|
44
|
+
err: false,
|
|
45
|
+
errMsg: ""
|
|
46
|
+
});
|
|
47
|
+
}
|
|
35
48
|
this.setState({
|
|
36
|
-
|
|
37
|
-
errMsg: "Key must be unique and not empty!"
|
|
49
|
+
key: key
|
|
38
50
|
});
|
|
39
|
-
|
|
51
|
+
this.props.keyCallback(key);
|
|
52
|
+
});
|
|
53
|
+
_defineProperty(this, "valueCallback", value => {
|
|
40
54
|
this.setState({
|
|
41
|
-
|
|
42
|
-
errMsg: ""
|
|
55
|
+
value: value
|
|
43
56
|
});
|
|
44
|
-
|
|
45
|
-
this.setState({
|
|
46
|
-
key: key
|
|
57
|
+
this.props.valueCallback(value);
|
|
47
58
|
});
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
valueCallback = value => {
|
|
51
|
-
this.setState({
|
|
52
|
-
value: value
|
|
53
|
-
});
|
|
54
|
-
this.props.valueCallback(value);
|
|
55
|
-
};
|
|
59
|
+
}
|
|
56
60
|
render() {
|
|
57
61
|
const errorMessage = this.state.err ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Alert, {
|
|
58
62
|
variant: "danger",
|
|
@@ -22,10 +22,9 @@ var _transformers = require("@xenova/transformers");
|
|
|
22
22
|
_transformers.env.allowLocalModels = false;
|
|
23
23
|
_transformers.env.useBrowserCache = false;
|
|
24
24
|
// Create a new worker
|
|
25
|
-
const worker = new Worker(new URL("./worker.
|
|
25
|
+
const worker = new Worker(new URL("./worker.jsx", import.meta.url), {
|
|
26
26
|
type: "module"
|
|
27
27
|
});
|
|
28
|
-
|
|
29
28
|
/**
|
|
30
29
|
* @type {function}
|
|
31
30
|
* Promise resolve function for loading the model
|
|
@@ -71,7 +70,6 @@ async function loadModel(modelname) {
|
|
|
71
70
|
* Passes corpus embedding from backend to the worker
|
|
72
71
|
* @returns
|
|
73
72
|
*/
|
|
74
|
-
|
|
75
73
|
async function embedCorpus(metadata) {
|
|
76
74
|
worker.postMessage({
|
|
77
75
|
type: "corpus",
|
|
@@ -6,14 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _Form = _interopRequireDefault(require("react-bootstrap/Form"));
|
|
8
8
|
var _Button = _interopRequireDefault(require("react-bootstrap/Button"));
|
|
9
|
-
var _semantic = require("
|
|
9
|
+
var _semantic = require("./semantic");
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _MetadataContext = _interopRequireDefault(require("../contexts/MetadataContext"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _DeleteButton = _interopRequireDefault(require("./DeleteButton"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
20
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
|
|
17
21
|
* (c) Copyright 2024 CERN for the benefit of the LHCb Collaboration *
|
|
18
22
|
* *
|
|
19
23
|
* This software is distributed under the terms of the GNU General Public *
|
|
@@ -23,7 +27,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
23
27
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
24
28
|
* or submit itself to any jurisdiction. *
|
|
25
29
|
\*****************************************************************************/
|
|
26
|
-
|
|
27
30
|
function getmetafromcontext() {
|
|
28
31
|
const context = (0, _react.useContext)(_MetadataContext.default);
|
|
29
32
|
return context;
|
|
@@ -137,10 +140,9 @@ const SearchTTool = () => {
|
|
|
137
140
|
await (0, _semantic.embedCorpus)(metadata);
|
|
138
141
|
}, []);
|
|
139
142
|
const handleChange = event => {
|
|
140
|
-
setInputData({
|
|
141
|
-
...inputData,
|
|
143
|
+
setInputData(_objectSpread(_objectSpread({}, inputData), {}, {
|
|
142
144
|
query: event.target.value
|
|
143
|
-
});
|
|
145
|
+
}));
|
|
144
146
|
};
|
|
145
147
|
const handleSubmit = async event => {
|
|
146
148
|
event.preventDefault();
|
|
@@ -88,7 +88,7 @@ function readJsonFile(data) {
|
|
|
88
88
|
const iterateObject = function (obj) {
|
|
89
89
|
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
90
90
|
Object.keys(obj).forEach(key => {
|
|
91
|
-
const currentPath = path ?
|
|
91
|
+
const currentPath = path ? "".concat(path, ".").concat(key) : key;
|
|
92
92
|
if (obj[key] instanceof Object) {
|
|
93
93
|
iterateObject(obj[key], currentPath);
|
|
94
94
|
} else {
|
|
@@ -16,7 +16,11 @@ var _utils = require("../lib/utils");
|
|
|
16
16
|
var _config2 = _interopRequireDefault(require("../config"));
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
-
|
|
19
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
|
|
20
24
|
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
21
25
|
* *
|
|
22
26
|
* This software is distributed under the terms of the GNU General Public *
|
|
@@ -26,7 +30,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
26
30
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
27
31
|
* or submit itself to any jurisdiction. *
|
|
28
32
|
\*****************************************************************************/
|
|
29
|
-
|
|
30
33
|
const MetadataContext = exports.MetadataContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
31
34
|
var _default = exports.default = MetadataContext;
|
|
32
35
|
const useMetadataContext = _init => (0, _react.useContext)(MetadataContext);
|
|
@@ -49,12 +52,10 @@ function createMetadataProvider(_config, _ref) {
|
|
|
49
52
|
const getMetadata = async () => {
|
|
50
53
|
Object.keys(_config.metadata_files).forEach((key, _index) => {
|
|
51
54
|
(0, _utils.loadDict)(_config.metadata_files[key]).then(result => {
|
|
52
|
-
setMetadata(prevState => ({
|
|
53
|
-
...prevState,
|
|
55
|
+
setMetadata(prevState => _objectSpread(_objectSpread({}, prevState), {}, {
|
|
54
56
|
[key]: result
|
|
55
57
|
}));
|
|
56
|
-
setLoaded(prevState => ({
|
|
57
|
-
...prevState,
|
|
58
|
+
setLoaded(prevState => _objectSpread(_objectSpread({}, prevState), {}, {
|
|
58
59
|
[key]: true
|
|
59
60
|
}));
|
|
60
61
|
}, e => {
|
|
@@ -67,7 +68,7 @@ function createMetadataProvider(_config, _ref) {
|
|
|
67
68
|
}, []);
|
|
68
69
|
if (error) {
|
|
69
70
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("h1", {
|
|
70
|
-
children: ["Oops: ",
|
|
71
|
+
children: ["Oops: ", "".concat(error)]
|
|
71
72
|
});
|
|
72
73
|
} else {
|
|
73
74
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MetadataContext.Provider, {
|
package/dist/lib/DTTConfig.js
CHANGED
|
@@ -64,7 +64,7 @@ class DTTConfig {
|
|
|
64
64
|
// Set the class+name combination
|
|
65
65
|
setName(name) {
|
|
66
66
|
const safeName = name.replace(/\W/g, "");
|
|
67
|
-
this.config.name =
|
|
67
|
+
this.config.name = "DecayTreeTuple/".concat(safeName);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// Return the name of the DecayTreeTuple algorithm
|
|
@@ -89,16 +89,16 @@ class DTTConfig {
|
|
|
89
89
|
this.pruneGroups();
|
|
90
90
|
if (branch.length === 0) {
|
|
91
91
|
return this.config;
|
|
92
|
-
} else if (
|
|
92
|
+
} else if ("".concat(branch) in this.config.branches) {
|
|
93
93
|
return this.config.branches[branch];
|
|
94
94
|
} else {
|
|
95
|
-
if (!(
|
|
96
|
-
this.config.groups[
|
|
95
|
+
if (!("".concat(branch) in this.config.groups)) {
|
|
96
|
+
this.config.groups["".concat(branch)] = {
|
|
97
97
|
particles: branch.map(element => this.config.branches[element].particle),
|
|
98
98
|
tools: []
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
return this.config.groups[
|
|
101
|
+
return this.config.groups["".concat(branch)];
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -106,7 +106,7 @@ class DTTConfig {
|
|
|
106
106
|
findTool(target, toolString) {
|
|
107
107
|
const index = target.tools.findIndex(tool => toolString in tool);
|
|
108
108
|
if (index < 0) {
|
|
109
|
-
throw new Error(
|
|
109
|
+
throw new Error("".concat(toolString, " not found in ").concat(target));
|
|
110
110
|
}
|
|
111
111
|
return index;
|
|
112
112
|
}
|
|
@@ -117,7 +117,7 @@ class DTTConfig {
|
|
|
117
117
|
let target = this.getTarget(branch);
|
|
118
118
|
// The toolString identifies the tool in the target's tool list
|
|
119
119
|
// If the tool is given a name (recommended), append it following a slash
|
|
120
|
-
const toolString = toolName.length ?
|
|
120
|
+
const toolString = toolName.length ? "".concat(toolClass, "/").concat(toolName) : toolClass;
|
|
121
121
|
// Add the tool to the list if not already there
|
|
122
122
|
try {
|
|
123
123
|
this.findTool(target, toolString);
|
|
@@ -128,7 +128,7 @@ class DTTConfig {
|
|
|
128
128
|
target.tools.push(toolConfig);
|
|
129
129
|
return true;
|
|
130
130
|
}
|
|
131
|
-
throw new Error(
|
|
131
|
+
throw new Error("".concat(toolString, " already exists in ").concat(target));
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
// Return a dict containing the default configuration of a TupleTool
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lhcb-ntuple-wizard-test",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "An application to access large-scale open data from LHCb",
|
|
5
5
|
"url": "https://gitlab.cern.ch/lhcb-dpa/wp6-analysis-preservation-and-open-data/lhcb-ntuple-wizard-frontend/issues",
|
|
6
6
|
"private": false,
|
|
7
|
-
"type": "module",
|
|
8
7
|
"main": "dist/index.js",
|
|
9
8
|
"module": "dist/index.js",
|
|
10
9
|
"files": [
|
|
@@ -17,15 +16,7 @@
|
|
|
17
16
|
"os": false
|
|
18
17
|
},
|
|
19
18
|
"dependencies": {
|
|
20
|
-
"@avcs/autosuggest": "latest",
|
|
21
|
-
"@emotion/react": "latest",
|
|
22
|
-
"@emotion/styled": "latest",
|
|
23
|
-
"@monaco-editor/react": "^4.6.0",
|
|
24
|
-
"@mui/joy": "latest",
|
|
25
|
-
"@mui/material": "latest",
|
|
26
19
|
"@vitejs/plugin-react": "^4.2.1",
|
|
27
|
-
"@webscopeio/react-textarea-autocomplete": "^4.9.2",
|
|
28
|
-
"@xenova/transformers": "^2.16.1",
|
|
29
20
|
"bootstrap": "^5.1.3",
|
|
30
21
|
"email-validator": "^2.0.4",
|
|
31
22
|
"js-yaml": "^4.1.0",
|
|
@@ -33,25 +24,33 @@
|
|
|
33
24
|
"lodash": "^4.17.21",
|
|
34
25
|
"lodash.memoize": "^4.1.2",
|
|
35
26
|
"mathjax-react": "^2.0.1",
|
|
36
|
-
"monaco-editor": "^0.44.0",
|
|
37
|
-
"monaco-editor-core": "^0.44.0",
|
|
38
|
-
"monaco-editor-nls": "^3.1.0",
|
|
39
|
-
"monaco-editor-webpack-plugin": "^7.1.0",
|
|
40
|
-
"monaco-languageclient": "0.13.1-next.9",
|
|
41
27
|
"pako": "^2.1.0",
|
|
42
28
|
"react": "^17.0.2",
|
|
43
|
-
"react-app-polyfill": "^3.0.0",
|
|
44
29
|
"react-bootstrap": "^2.0.3",
|
|
45
30
|
"react-bootstrap-icons": "^1.6.1",
|
|
46
|
-
"react-dev-utils": "^12.0.1",
|
|
47
31
|
"react-dom": "^17.0.2",
|
|
32
|
+
"react-app-polyfill": "^3.0.0",
|
|
33
|
+
"react-dev-utils": "^12.0.1",
|
|
48
34
|
"react-graph-vis": "^1.0.7",
|
|
49
35
|
"react-infinite-scroll-component": "^6.1.0",
|
|
50
|
-
"react-monaco-editor": "^0.55.0",
|
|
51
|
-
"react-overlays": "5.2.1",
|
|
52
36
|
"react-router-dom": "^5.2.0",
|
|
53
37
|
"react-select": "^4.3.1",
|
|
38
|
+
"react-overlays": "5.2.1",
|
|
39
|
+
"@mui/material": "latest",
|
|
40
|
+
"@emotion/react": "latest",
|
|
41
|
+
"@emotion/styled": "latest",
|
|
42
|
+
"@mui/joy": "latest",
|
|
43
|
+
"@avcs/autosuggest": "latest",
|
|
44
|
+
"@webscopeio/react-textarea-autocomplete": "^4.9.2",
|
|
45
|
+
"@monaco-editor/react": "^4.6.0",
|
|
46
|
+
"monaco-editor-nls": "^3.1.0",
|
|
47
|
+
"monaco-editor": "^0.44.0",
|
|
48
|
+
"monaco-editor-core": "^0.44.0",
|
|
49
|
+
"monaco-languageclient": "0.13.1-next.9",
|
|
50
|
+
"react-monaco-editor": "^0.55.0",
|
|
51
|
+
"monaco-editor-webpack-plugin": "^7.1.0",
|
|
54
52
|
"vite": "^5.1.1",
|
|
53
|
+
"@xenova/transformers": "^2.16.1",
|
|
55
54
|
"web-vitals": "^2.1.4"
|
|
56
55
|
},
|
|
57
56
|
"overrides": {
|