diff --git a/dist/components/3d_editor/advanced_geometry/PythonTransformation.d.ts b/dist/components/3d_editor/advanced_geometry/PythonTransformation.d.ts deleted file mode 100644 index a25d12e5..00000000 --- a/dist/components/3d_editor/advanced_geometry/PythonTransformation.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 584ce305..00000000 --- a/dist/components/3d_editor/advanced_geometry/PythonTransformation.js +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 83fc66e9..00000000 --- a/dist/components/include/SAlertContentTmpl.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index ecdb9d8a..00000000 --- a/dist/components/include/SAlertContentTmpl.js +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index fe416640..00000000 --- a/dist/components/include/StandataImportModal.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index d6575dd2..00000000 --- a/dist/components/include/StandataImportModal.js +++ /dev/null @@ -1,84 +0,0 @@ -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/material-ui/theme.d.ts b/dist/components/include/material-ui/theme.d.ts deleted file mode 100644 index 9abe2c1c..00000000 --- a/dist/components/include/material-ui/theme.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 3ee97970..00000000 --- a/dist/components/include/material-ui/theme.js +++ /dev/null @@ -1,34 +0,0 @@ -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/tests-legacy/cucumber/support/step_definitions/Then I see DefaultImportModalDialog.js b/dist/tests-legacy/cucumber/support/step_definitions/Then I see DefaultImportModalDialog.js deleted file mode 100644 index 50b41582..00000000 --- a/dist/tests-legacy/cucumber/support/step_definitions/Then I see DefaultImportModalDialog.js +++ /dev/null @@ -1,12 +0,0 @@ -"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 deleted file mode 100644 index 28ed304f..00000000 --- a/dist/tests-legacy/cucumber/support/step_definitions/Then the DefaultImportModalDialog should be closed.js +++ /dev/null @@ -1,12 +0,0 @@ -"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 genarate interpolated set with # intermediate images.js b/dist/tests-legacy/cucumber/support/step_definitions/When I genarate interpolated set with # intermediate images.js deleted file mode 100644 index 97905e5e..00000000 --- a/dist/tests-legacy/cucumber/support/step_definitions/When I genarate interpolated set with # intermediate images.js +++ /dev/null @@ -1,12 +0,0 @@ -"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 generate interpolated set with "([^"]*)" intermediate images$/, nImages => { - _material_designer_page.materialDesignerPage.designerWidget.generateInterpolatedSet(parseInt(nImages)); - }); -} \ 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 deleted file mode 100644 index cd55a095..00000000 --- a/dist/tests-legacy/cucumber/support/step_definitions/When I open DefaultImportModalDialog.js +++ /dev/null @@ -1,12 +0,0 @@ -"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 deleted file mode 100644 index 31b0f356..00000000 --- a/dist/tests-legacy/cucumber/support/widgets/alert/s_alert_widget.js +++ /dev/null @@ -1,35 +0,0 @@ -"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.json b/package.json index f2bad72c..315df50b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "prepare": "husky install", "transpile-tests": "babel --presets @babel/preset-env --out-dir dist/tests-legacy/cucumber tests-legacy/cucumber", "transpile": "tsc && npm run copy-css", - "copy-css": "cp src/stylesheets/* dist/stylesheets/", + "copy-css": "mkdir -p dist/stylesheets && cp src/stylesheets/* dist/stylesheets/", "test": "echo 'Tests are in the tests subfolder. Use Node 20 (`nvm use 20`) and run `npm i` && `npm test` there'", "lint": "eslint src tests-legacy && prettier --write src tests-legacy", "lint:fix": "eslint src tests-legacy --fix && prettier --write src tests-legacy",