diff --git a/dist/components/3d_editor/advanced_geometry/PythonTransformation.d.ts b/dist/components/3d_editor/advanced_geometry/PythonTransformation.d.ts new file mode 100644 index 00000000..a25d12e5 --- /dev/null +++ b/dist/components/3d_editor/advanced_geometry/PythonTransformation.d.ts @@ -0,0 +1,17 @@ +export default PythonTransformation; +declare class PythonTransformation extends React.Component { + constructor(props: any); + state: { + pyodide: null; + }; + onLoad: (pyodideInstance: any) => void; + render(): React.JSX.Element; +} +declare namespace PythonTransformation { + namespace propTypes { + const show: PropTypes.Validator; + const onHide: PropTypes.Validator<(...args: any[]) => any>; + } +} +import React from "react"; +import PropTypes from "prop-types"; diff --git a/dist/components/3d_editor/advanced_geometry/PythonTransformation.js b/dist/components/3d_editor/advanced_geometry/PythonTransformation.js new file mode 100644 index 00000000..584ce305 --- /dev/null +++ b/dist/components/3d_editor/advanced_geometry/PythonTransformation.js @@ -0,0 +1,27 @@ +import PyodideLoader from "@exabyte-io/cove.js/dist/other/pyodide"; +import Dialog from "@mui/material/Dialog"; +import PropTypes from "prop-types"; +import React from "react"; +class PythonTransformation extends React.Component { + constructor(props) { + super(props); + this.onLoad = (pyodideInstance) => { + this.setState({ pyodide: pyodideInstance }); + }; + this.state = { + pyodide: null, + }; + } + render() { + const { show, onHide } = this.props; + return (React.createElement(React.Fragment, null, + React.createElement(PyodideLoader, { onLoad: this.onLoad, triggerLoad: show }), + React.createElement(Dialog, { open: show, onClose: onHide, fullWidth: true, maxWidth: "lg", PaperProps: { sx: { width: "60vw", height: "60vh", padding: "20px" } } }, + React.createElement("div", null, this.state.pyodide ? "Pyodide is loaded" : "Pyodide is not loaded")))); + } +} +PythonTransformation.propTypes = { + show: PropTypes.bool.isRequired, + onHide: PropTypes.func.isRequired, +}; +export default PythonTransformation; diff --git a/dist/components/include/SAlertContentTmpl.d.ts b/dist/components/include/SAlertContentTmpl.d.ts new file mode 100644 index 00000000..83fc66e9 --- /dev/null +++ b/dist/components/include/SAlertContentTmpl.d.ts @@ -0,0 +1,20 @@ +export default SAlertContentTmpl; +declare function SAlertContentTmpl({ id, classNames, condition, styles, message, handleClose, }: { + id: any; + classNames: any; + condition: any; + styles: any; + message: any; + handleClose: any; +}): import("react/jsx-runtime").JSX.Element; +declare namespace SAlertContentTmpl { + namespace propTypes { + const id: PropTypes.Validator; + const classNames: PropTypes.Validator; + const condition: PropTypes.Validator; + const styles: PropTypes.Validator; + const message: PropTypes.Validator>>; + const handleClose: PropTypes.Validator<(...args: any[]) => any>; + } +} +import PropTypes from "prop-types"; diff --git a/dist/components/include/SAlertContentTmpl.js b/dist/components/include/SAlertContentTmpl.js new file mode 100644 index 00000000..ecdb9d8a --- /dev/null +++ b/dist/components/include/SAlertContentTmpl.js @@ -0,0 +1,18 @@ +import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; +/* eslint-disable jsx-a11y/label-has-associated-control, jsx-a11y/control-has-associated-label */ +import PropTypes from "prop-types"; +import React from "react"; +const SAlertContentTmpl = function SAlertContentTmpl({ id, classNames, condition, styles, message, handleClose, }) { + return (_jsxs("div", { id: id, style: styles, className: `alert alert-${condition} ${classNames} growl-animated animated`, children: [_jsx("button", { type: "button", "data-growl": "dismiss", className: "close s-alert-close", onClick: handleClose }), _jsx("span", { children: message })] })); +}; +SAlertContentTmpl.propTypes = { + id: PropTypes.string.isRequired, + classNames: PropTypes.string.isRequired, + condition: PropTypes.string.isRequired, + // eslint-disable-next-line react/forbid-prop-types + styles: PropTypes.object.isRequired, + // eslint-disable-next-line react/forbid-prop-types + message: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired, + handleClose: PropTypes.func.isRequired, +}; +export default SAlertContentTmpl; diff --git a/dist/components/include/StandataImportModal.d.ts b/dist/components/include/StandataImportModal.d.ts new file mode 100644 index 00000000..fe416640 --- /dev/null +++ b/dist/components/include/StandataImportModal.d.ts @@ -0,0 +1,20 @@ +import { MaterialSchema } from "@exabyte-io/code.js/dist/types"; +import { Made } from "@exabyte-io/made.js"; +import React from "react"; +interface StandataImportModalProps { + show: boolean; + onClose: () => void; + onSubmit: (materials: Made.Material[]) => void; + defaultMaterialConfigs: MaterialSchema[]; +} +interface StandataImportModalState { + selectedMaterialConfigs: MaterialSchema[]; +} +declare class StandataImportModal extends React.Component { + constructor(props: StandataImportModalProps); + handleMaterialSelect: (materialConfigs: MaterialSchema[] | []) => void; + handleRemoveMaterial: (index: number) => void; + addMaterials: () => void; + render(): import("react/jsx-runtime").JSX.Element; +} +export default StandataImportModal; diff --git a/dist/components/include/StandataImportModal.js b/dist/components/include/StandataImportModal.js new file mode 100644 index 00000000..d6575dd2 --- /dev/null +++ b/dist/components/include/StandataImportModal.js @@ -0,0 +1,84 @@ +import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; +import Dialog from "@exabyte-io/cove.js/dist/mui/components/dialog/Dialog"; +import IconByName from "@exabyte-io/cove.js/dist/mui/components/icon/IconByName"; +import { Made } from "@exabyte-io/made.js"; +import CheckBoxOutlineBlank from "@mui/icons-material/CheckBoxOutlineBlank"; +import Autocomplete from "@mui/material/Autocomplete"; +import Checkbox from "@mui/material/Checkbox"; +import Grid from "@mui/material/Grid"; +import IconButton from "@mui/material/IconButton"; +import TextField from "@mui/material/TextField"; +import { DataGrid } from "@mui/x-data-grid"; +import React from "react"; +class StandataImportModal extends React.Component { + constructor(props) { + super(props); + this.handleMaterialSelect = (materialConfigs) => { + this.setState({ + selectedMaterialConfigs: [...materialConfigs], + }); + }; + this.handleRemoveMaterial = (index) => { + this.setState((prevState) => ({ + selectedMaterialConfigs: prevState.selectedMaterialConfigs.filter((_, i) => i !== index), + })); + }; + this.addMaterials = () => { + const { selectedMaterialConfigs } = this.state; + const materials = selectedMaterialConfigs.map((config) => new Made.Material(config)); + const { onSubmit } = this.props; + onSubmit(materials); + this.setState({ selectedMaterialConfigs: [] }); + }; + this.state = { + selectedMaterialConfigs: [], + }; + } + render() { + const { show, onClose, defaultMaterialConfigs } = this.props; + const { selectedMaterialConfigs } = this.state; + const selectedMaterials = selectedMaterialConfigs.map((config) => new Made.Material(config)); + const columns = [ + { field: "name", headerName: "Name", flex: 1, headerAlign: "center", align: "center" }, + { + field: "lattice", + headerName: "Lattice", + flex: 1, + headerAlign: "center", + align: "center", + }, + { + field: "formula", + headerName: "Formula", + flex: 1, + headerAlign: "center", + align: "center", + }, + { + field: "actions", + headerName: "Actions", + headerAlign: "center", + align: "center", + flex: 1, + sortable: false, + filterable: false, + disableColumnMenu: true, + renderCell: (params) => (_jsx(IconButton, { id: `${params.row.name.replace(/\s+/g, "-")}-remove-button`, color: "inherit", onClick: () => this.handleRemoveMaterial(params.row.id), children: _jsx(IconByName, { name: "actions.remove", fontSize: "small" }) })), + }, + ]; + return (_jsx(Dialog, { open: show, id: "standataImportModalDialog", title: "Import from Standata", onClose: onClose, onSubmit: this.addMaterials, children: _jsxs(Grid, { container: true, spacing: 2, children: [_jsx(Grid, { item: true, xs: 12, children: _jsx(Autocomplete, { multiple: true, id: "materials-autocomplete", "data-tid": "materials-selector", disableCloseOnSelect: true, options: defaultMaterialConfigs || [], value: selectedMaterialConfigs || null, getOptionLabel: (material) => material.name || "Not available", onChange: (event, newValues) => this.handleMaterialSelect(newValues), renderOption: (props, option, { selected }) => ( + // eslint-disable-next-line react/jsx-props-no-spreading + _jsxs("li", { ...props, "data-tid": "select-material", children: [_jsx(Checkbox, { icon: _jsx(CheckBoxOutlineBlank, { fontSize: "small" }), checkedIcon: _jsx(IconByName, { name: "shapes.check", fontSize: "small" }), checked: selected }), option.name] })), renderInput: (params) => (_jsx(TextField + // eslint-disable-next-line react/jsx-props-no-spreading + , { ...params, label: "Selected Materials", placeholder: "Select materials" })) }) }), _jsx(Grid, { item: true, xs: 12, style: { minHeight: 300 }, children: _jsx(DataGrid, { "data-name": "data-grid", hideFooter: true, rows: selectedMaterials.map((material, index) => { + var _a; + return ({ + name: material.name, + lattice: ((_a = material.lattice) === null || _a === void 0 ? void 0 : _a.type) || "TRI", + formula: material.formula || "Not available", + id: index, + }); + }), columns: columns }) })] }) })); + } +} +export default StandataImportModal; diff --git a/dist/components/include/jupyterlite/BaseJupyterLiteComponent.js b/dist/components/include/jupyterlite/BaseJupyterLiteComponent.js index 65e3b362..321c2772 100644 --- a/dist/components/include/jupyterlite/BaseJupyterLiteComponent.js +++ b/dist/components/include/jupyterlite/BaseJupyterLiteComponent.js @@ -1,5 +1,6 @@ import { jsx as _jsx } from "react/jsx-runtime"; import JupyterLiteSession from "@exabyte-io/cove.js/dist/other/jupyterlite/JupyterLiteSession"; +import { Action } from "@mat3ra/esse/dist/js/types"; import { Made } from "@mat3ra/made"; import { enqueueSnackbar } from "notistack"; import React from "react"; @@ -52,11 +53,11 @@ class BaseJupyterLiteSessionComponent extends React.Component { // eslint-disable-next-line react/sort-comp this.messageHandlerConfigs = [ { - action: "set-data", + action: Action.setData, handlers: [this.handleSetMaterials], }, { - action: "get-data", + action: Action.getData, handlers: [this.getMaterialsForMessage], }, ]; diff --git a/dist/components/include/material-ui/theme.d.ts b/dist/components/include/material-ui/theme.d.ts new file mode 100644 index 00000000..9abe2c1c --- /dev/null +++ b/dist/components/include/material-ui/theme.d.ts @@ -0,0 +1,2 @@ +export const DarkMaterialUITheme: import("@mui/material").Theme; +export const LightMaterialUITheme: import("@mui/material").Theme; diff --git a/dist/components/include/material-ui/theme.js b/dist/components/include/material-ui/theme.js new file mode 100644 index 00000000..3ee97970 --- /dev/null +++ b/dist/components/include/material-ui/theme.js @@ -0,0 +1,34 @@ +import { createTheme } from "@mui/material"; +// adopted from: https://material-ui.com/customization/themes/#theme-configuration-variables +const DarkThemeConfig = { + palette: { + // Switching the dark mode on is a single property value change. + mode: "dark", + }, + typography: { + // Tell Material-UI what's the font-size on the html element is. + htmlFontSize: 12, + }, + overrides: { + MuiFormControl: { + root: { + margin: 10, + minWidth: 120, + }, + }, + MuiOutlinedInput: { + root: { + "& .MuiOutlinedInput-notchedOutline": { + border: "none", + }, + }, + }, + }, +}; +export const DarkMaterialUITheme = createTheme(DarkThemeConfig); +export const LightMaterialUITheme = createTheme({ + typography: DarkThemeConfig.typography, + palette: { + mode: "light", + }, +}); diff --git a/dist/material.d.ts b/dist/material.d.ts index 0532fa9d..81f26d56 100644 --- a/dist/material.d.ts +++ b/dist/material.d.ts @@ -256,21 +256,21 @@ export class Material extends Material_base { }, { id?: number | undefined; }] | undefined; - bondType?: "double" | "single" | "triple" | "quadruple" | "aromatic" | "tautomeric" | "dative" | "other" | undefined; + bondType?: "double" | "other" | "single" | "triple" | "quadruple" | "aromatic" | "tautomeric" | "dative" | undefined; }[] | undefined; }; lattice: { name?: "lattice" | undefined; vectors?: { alat?: number | undefined; - units?: "m" | "alat" | "bohr" | "angstrom" | "crystal" | "km" | "pm" | "nm" | "a.u." | "fractional" | "cartesian" | undefined; + units?: "m" | "angstrom" | "crystal" | "km" | "pm" | "nm" | "a.u." | "bohr" | "fractional" | "cartesian" | "alat" | undefined; a: [number, number, number]; b: [number, number, number]; c: [number, number, number]; } | undefined; type: "CUB" | "BCC" | "FCC" | "TET" | "MCL" | "ORC" | "ORCC" | "ORCF" | "ORCI" | "HEX" | "BCT" | "TRI" | "MCLC" | "RHL"; units?: { - length?: "bohr" | "angstrom" | undefined; + length?: "angstrom" | "bohr" | undefined; angle?: "degree" | "radian" | undefined; } | undefined; a: number; @@ -333,7 +333,7 @@ export class Material extends Material_base { consistencyChecks?: { key: string; name: "default" | "atomsTooClose" | "atomsOverlap"; - severity: "info" | "warning" | "error"; + severity: "error" | "warning" | "info"; message: string; }[] | undefined; schemaVersion?: string | undefined; diff --git a/dist/tests-legacy/cucumber/support/step_definitions/Then I see DefaultImportModalDialog.js b/dist/tests-legacy/cucumber/support/step_definitions/Then I see DefaultImportModalDialog.js new file mode 100644 index 00000000..50b41582 --- /dev/null +++ b/dist/tests-legacy/cucumber/support/step_definitions/Then I see DefaultImportModalDialog.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; +var _material_designer_page = require("../widgets/material_designer_page"); +function _default() { + this.Then(/^I see UploadDialog$/, () => { + _material_designer_page.materialDesignerPage.designerWidget.defaultImportModalDialog.isVisible(); + }); +} \ No newline at end of file diff --git a/dist/tests-legacy/cucumber/support/step_definitions/Then the DefaultImportModalDialog should be closed.js b/dist/tests-legacy/cucumber/support/step_definitions/Then the DefaultImportModalDialog should be closed.js new file mode 100644 index 00000000..28ed304f --- /dev/null +++ b/dist/tests-legacy/cucumber/support/step_definitions/Then the DefaultImportModalDialog should be closed.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; +var _material_designer_page = require("../widgets/material_designer_page"); +function _default() { + this.Then(/^the UploadDialog should be closed$/, () => { + _material_designer_page.materialDesignerPage.designerWidget.defaultImportModalDialog.waitForDisappear(); + }); +} \ No newline at end of file diff --git a/dist/tests-legacy/cucumber/support/step_definitions/When I open DefaultImportModalDialog.js b/dist/tests-legacy/cucumber/support/step_definitions/When I open DefaultImportModalDialog.js new file mode 100644 index 00000000..cd55a095 --- /dev/null +++ b/dist/tests-legacy/cucumber/support/step_definitions/When I open DefaultImportModalDialog.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; +var _material_designer_page = require("../widgets/material_designer_page"); +function _default() { + this.When(/^I open UploadDialog/, () => { + _material_designer_page.materialDesignerPage.designerWidget.headerMenu.selectMenuItemByNameAndItemNumber("Input/Output", 1); + }); +} \ No newline at end of file diff --git a/dist/tests-legacy/cucumber/support/widgets/alert/s_alert_widget.js b/dist/tests-legacy/cucumber/support/widgets/alert/s_alert_widget.js new file mode 100644 index 00000000..31b0f356 --- /dev/null +++ b/dist/tests-legacy/cucumber/support/widgets/alert/s_alert_widget.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SAlertWidget = void 0; +var _logger = require("../../logger"); +var _selectors = require("../../selectors"); +var _utils = require("../../utils"); +var _alert_widget = require("./alert_widget"); +class SAlertWidget extends _alert_widget.AlertWidget { + getAlertSelectorByType(type) { + return this.getWrappedSelector(_selectors.SELECTORS.sAlertWidget.alertByType(type), ""); + } + isVisibleByType(type) { + return exabrowser.isVisible(this.getAlertSelectorByType(type)); + } + isVisibleSuccess() { + return this.isVisibleByType("success"); + } + close() { + exabrowser.scrollAndClick(this.getWrappedSelector(_selectors.SELECTORS.sAlertWidget.closeButton)); + } + closeAllSuccess() { + (0, _utils.retry)(() => { + if (this.isVisible()) { + _logger.logger.debug("sAlertSuccess closed"); + this.close(); + // eslint-disable-next-line no-throw-literal + throw "Something is wrong: there should be no sAlertSuccess shown!"; + } + }); + } +} +exports.SAlertWidget = SAlertWidget; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e09157be..0bbd6afd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1446,9 +1446,9 @@ } }, "@codemirror/legacy-modes": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.3.3.tgz", - "integrity": "sha512-X0Z48odJ0KIoh/HY8Ltz75/4tDYc9msQf1E/2trlxFaFFhgjpVHjZ/BCXe1Lk7s4Gd67LL/CeEEHNI+xHOiESg==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.4.0.tgz", + "integrity": "sha512-5m/K+1A6gYR0e+h/dEde7LoGimMjRtWXZFg4Lo70cc8HzjSdHe3fLwjWMR0VRl5KFT1SxalSap7uMgPKF28wBA==", "dev": true, "requires": { "@codemirror/language": "^6.0.0" @@ -1760,8 +1760,9 @@ } }, "@exabyte-io/cove.js": { - "version": "git+https://github.com/Exabyte-io/cove.git#395d8bb0ac51e50493834672131cc8a10dcc3ae5", - "from": "git+https://github.com/Exabyte-io/cove.git#395d8bb0ac51e50493834672131cc8a10dcc3ae5", + "version": "2024.4.14-0", + "resolved": "https://registry.npmjs.org/@exabyte-io/cove.js/-/cove.js-2024.4.14-0.tgz", + "integrity": "sha512-C308vt0M5la/OsW4BXLTgbeQ8lG6XC7zszR9gG401IaYUlvZ1U3gIfyAKnPZGwObZ815mUkseU5974bRgxknQw==", "dev": true, "requires": { "@babel/eslint-parser": "^7.16.3", @@ -2659,9 +2660,9 @@ } }, "@mat3ra/esse": { - "version": "2024.3.25-6", - "resolved": "https://registry.npmjs.org/@mat3ra/esse/-/esse-2024.3.25-6.tgz", - "integrity": "sha512-V9Xt2JI0sWJc3ZTeSu1neOWBMOKiZPUgioVLnpigv7uy44seC8fQbzMD0lqqm69GzPOi82XOvaM8wuLnE0mYxg==", + "version": "2024.4.9-0", + "resolved": "https://registry.npmjs.org/@mat3ra/esse/-/esse-2024.4.9-0.tgz", + "integrity": "sha512-/lGbnVX6h/CfIBYEMd4p8DvQEVUWJdh8aBwRLwyy4rsZtVfmRG29cJ29a1ueqCb9NfUpymJrjZpyqfoJ4QrtWA==", "dev": true, "requires": { "@babel/cli": "7.16.0", @@ -2721,9 +2722,9 @@ } }, "@babel/generator": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz", - "integrity": "sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.4.tgz", + "integrity": "sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==", "dev": true, "requires": { "@babel/types": "^7.24.0", @@ -2733,9 +2734,9 @@ } }, "@babel/helpers": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.1.tgz", - "integrity": "sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.4.tgz", + "integrity": "sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==", "dev": true, "requires": { "@babel/template": "^7.24.0", @@ -2756,9 +2757,9 @@ } }, "@babel/parser": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz", - "integrity": "sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.4.tgz", + "integrity": "sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==", "dev": true }, "@babel/template": { @@ -3727,15 +3728,15 @@ "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==" }, "@rjsf/mui": { - "version": "5.18.1", - "resolved": "https://registry.npmjs.org/@rjsf/mui/-/mui-5.18.1.tgz", - "integrity": "sha512-QVu62jWmFLJD/16F11frSAIp6JpR5TGLsNbpgYp8r7d+SxnIfUPzzhlIplNBcVXqzBujWYkSd+cGQH8bevw/MA==", + "version": "5.18.2", + "resolved": "https://registry.npmjs.org/@rjsf/mui/-/mui-5.18.2.tgz", + "integrity": "sha512-ELxgZ7rKitAv3pp2bA2gu1QEq764Qu/w2DtOIKompHP3yq1jK3byf5gy81qORzuP9B/B2s7MHUwHwfPHUErgzw==", "dev": true }, "@rjsf/utils": { - "version": "5.18.1", - "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.18.1.tgz", - "integrity": "sha512-BxXd5C8gxOSDCSgfDT+XZHpBZtu4F0jJZsnMQstWJ+9QKpmTiuvbkjk3c1J4zZ3CRNgGghVH5otU5gvzVWIxpQ==", + "version": "5.18.2", + "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.18.2.tgz", + "integrity": "sha512-iDqwBTispZ7mAgwBuHIM0emK+Ft2xRgKD9TzB68VEUhr2hqlDRpwtH6/AgAWUKmJl4kUj3cRKVqqhIvamGLpXw==", "dev": true, "requires": { "json-schema-merge-allof": "^0.8.1", @@ -3754,9 +3755,9 @@ } }, "@rjsf/validator-ajv8": { - "version": "5.18.1", - "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.18.1.tgz", - "integrity": "sha512-Cb4++kru+XL8q5FJDWMpongtY7zLUoNqZaHDbYdkPWLl0Q7duGMfYOIRAhPpWhaI9KAjj19kCpAjQicA8gEgaw==", + "version": "5.18.2", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.18.2.tgz", + "integrity": "sha512-TG2PP6wp1DSLBEF+v49fgGj3VCzxKewxvQvfycEZUkEvmWggca4vYzJdSm0RtMxyOGT80i54oKGnyDv13wxJkg==", "dev": true, "requires": { "ajv": "^8.12.0", @@ -8327,9 +8328,9 @@ } }, "dompurify": { - "version": "2.4.9", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.9.tgz", - "integrity": "sha512-iHtnxYMotKgOTvxIqq677JsKHvCOkAFqj9x8Mek2zdeHW1XjuFKwjpmZeMaXQRQ8AbJZDbcRz/+r1QhwvFtmQg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.5.0.tgz", + "integrity": "sha512-5RXhAXSCrKTqt9pSbobT9PVRX+oPpENplTZqCiK1l0ya+ZOzwo9kqsGLbYRsAhzIiLCwKEy99XKSSrqnRTLVcw==", "dev": true }, "domutils": { @@ -10384,6 +10385,12 @@ "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==" }, + "get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -13362,12 +13369,6 @@ "prettier": "^2.6.2" }, "dependencies": { - "get-stdin": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", - "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", - "dev": true - }, "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -16615,9 +16616,9 @@ } }, "prosemirror-model": { - "version": "1.19.4", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.19.4.tgz", - "integrity": "sha512-RPmVXxUfOhyFdayHawjuZCxiROsm9L4FCUA6pWI+l7n2yCBsWy9VpdE1hpDHUS8Vad661YLY9AzqfjLhAKQ4iQ==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.20.0.tgz", + "integrity": "sha512-q7AY7vMjKYqDCeoedgUiAgrLabliXxndJuuFmcmc2+YU1SblvnOiG2WEACF2lwAZsMlfLpiAilA3L+TWlDqIsQ==", "dev": true, "requires": { "orderedmap": "^2.0.0" @@ -16644,12 +16645,12 @@ } }, "prosemirror-view": { - "version": "1.33.3", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.33.3.tgz", - "integrity": "sha512-P4Ao/bc4OrU/2yLIf8dL4lJaEtjLR3QjIvQHgJYp2jUS7kYM4bSR6okbBjkqzOs/FwUon6UGjTLdKMnPL1MZqw==", + "version": "1.33.4", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.33.4.tgz", + "integrity": "sha512-xQqAhH8/HGleVpKDhQsrd+oqdyeKMxFtdCWDxWMmP+n0k27fBpyUqa8pA+RB5cFY8rqDDc1hll69aRZQa7UaAw==", "dev": true, "requires": { - "prosemirror-model": "^1.16.0", + "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } @@ -20016,10 +20017,39 @@ } }, "traverse": { - "version": "0.6.8", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", - "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", - "dev": true + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.9.tgz", + "integrity": "sha512-7bBrcF+/LQzSgFmT0X5YclVqQxtv7TDJ1f8Wj7ibBu/U6BMLeOpUxuZjV7rMc44UtKxlnMFigdhFAIszSX1DMg==", + "dev": true, + "requires": { + "gopd": "^1.0.1", + "typedarray.prototype.slice": "^1.0.3", + "which-typed-array": "^1.1.15" + }, + "dependencies": { + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + } + } + } }, "tryer": { "version": "1.0.1", @@ -20222,6 +20252,178 @@ "is-typedarray": "^1.0.0" } }, + "typedarray.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typedarray.prototype.slice/-/typedarray.prototype.slice-1.0.3.tgz", + "integrity": "sha512-8WbVAQAUlENo1q3c3zZYuy5k9VzBQvp8AX9WOtbvyWlLM1v5JaSRmjubLjzHF4JFtptjH/5c/i95yaElvcjC0A==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-errors": "^1.3.0", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-offset": "^1.0.2" + }, + "dependencies": { + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + } + }, + "string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + } + }, + "which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + } + } + } + }, "typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", diff --git a/package.json b/package.json index 9f9507ec..9ab71a8e 100644 --- a/package.json +++ b/package.json @@ -68,9 +68,9 @@ "react-dom": "^17.0.0" }, "devDependencies": { - "@exabyte-io/cove.js": "https://github.com/Exabyte-io/cove.git#395d8bb0ac51e50493834672131cc8a10dcc3ae5", + "@exabyte-io/cove.js": "2024.4.14-0", "@exabyte-io/eslint-config": "^2023.8.29-1", - "@mat3ra/esse": "2024.3.25-6", + "@mat3ra/esse": "2024.4.9-0", "@mat3ra/code": "2024.3.25-3", "@mat3ra/made": "2024.3.27-1", "@mat3ra/standata": "^2024.2.21-0", diff --git a/src/components/include/jupyterlite/BaseJupyterLiteComponent.tsx b/src/components/include/jupyterlite/BaseJupyterLiteComponent.tsx index 48e69198..360d98f6 100644 --- a/src/components/include/jupyterlite/BaseJupyterLiteComponent.tsx +++ b/src/components/include/jupyterlite/BaseJupyterLiteComponent.tsx @@ -1,7 +1,7 @@ import JupyterLiteSession, { IMessageHandlerConfigItem, } from "@exabyte-io/cove.js/dist/other/jupyterlite/JupyterLiteSession"; -import { MaterialSchema } from "@mat3ra/esse/dist/js/types"; +import { Action, MaterialSchema } from "@mat3ra/esse/dist/js/types"; import { Made } from "@mat3ra/made"; import { enqueueSnackbar } from "notistack"; import React from "react"; @@ -81,11 +81,11 @@ class BaseJupyterLiteSessionComponent

extends React.Compon // eslint-disable-next-line react/sort-comp messageHandlerConfigs: IMessageHandlerConfigItem[] = [ { - action: "set-data", + action: Action.setData, handlers: [this.handleSetMaterials], }, { - action: "get-data", + action: Action.getData, handlers: [this.getMaterialsForMessage], }, ];