From e30810442a198b92509c96adf9d5651484a69c63 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Wed, 3 Apr 2024 18:36:08 -0700 Subject: [PATCH] update: npm run transpile --- dist/index.d.ts | 1 - dist/index.js | 2 - .../custom/alert/AlertContextProvider.d.ts | 15 ----- .../custom/alert/AlertContextProvider.js | 45 --------------- .../custom/alert/hooks/useAlert.d.ts | 3 - .../components/custom/alert/hooks/useAlert.js | 5 -- dist/mui/components/custom/alert/index.d.ts | 1 - dist/mui/components/custom/alert/index.js | 1 - dist/mui/components/stepper/StepIcon.d.ts | 7 --- dist/mui/components/stepper/StepIcon.js | 56 ------------------ .../components/stepper/Stepper.styled.d.ts | 2 - dist/mui/components/stepper/Stepper.styled.js | 45 --------------- .../components/textField/BasicTextField.d.ts | 19 ------- .../components/textField/BasicTextField.js | 8 --- dist/mui/components/textField/index.d.ts | 2 - dist/mui/components/textField/index.js | 2 - dist/other/fullscreen/test.d.ts | 1 - dist/other/fullscreen/test.js | 8 --- dist/other/iframe-messaging/index.d.ts | 1 - dist/other/iframe-messaging/index.js | 1 - dist/other/jupyterlite/MessageHandler.d.ts | 14 ----- dist/other/jupyterlite/MessageHandler.js | 57 ------------------- dist/other/jupyterlite/index.d.ts | 1 - dist/other/jupyterlite/index.js | 1 - .../other/rjsf/CustomObjectFieldTemplate.d.ts | 10 ---- dist/other/rjsf/CustomObjectFieldTemplate.js | 32 ----------- 26 files changed, 340 deletions(-) delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/mui/components/custom/alert/AlertContextProvider.d.ts delete mode 100644 dist/mui/components/custom/alert/AlertContextProvider.js delete mode 100644 dist/mui/components/custom/alert/hooks/useAlert.d.ts delete mode 100644 dist/mui/components/custom/alert/hooks/useAlert.js delete mode 100644 dist/mui/components/custom/alert/index.d.ts delete mode 100644 dist/mui/components/custom/alert/index.js delete mode 100644 dist/mui/components/stepper/StepIcon.d.ts delete mode 100644 dist/mui/components/stepper/StepIcon.js delete mode 100644 dist/mui/components/stepper/Stepper.styled.d.ts delete mode 100644 dist/mui/components/stepper/Stepper.styled.js delete mode 100644 dist/mui/components/textField/BasicTextField.d.ts delete mode 100644 dist/mui/components/textField/BasicTextField.js delete mode 100644 dist/mui/components/textField/index.d.ts delete mode 100644 dist/mui/components/textField/index.js delete mode 100644 dist/other/fullscreen/test.d.ts delete mode 100644 dist/other/fullscreen/test.js delete mode 100644 dist/other/iframe-messaging/index.d.ts delete mode 100644 dist/other/iframe-messaging/index.js delete mode 100644 dist/other/jupyterlite/MessageHandler.d.ts delete mode 100644 dist/other/jupyterlite/MessageHandler.js delete mode 100644 dist/other/jupyterlite/index.d.ts delete mode 100644 dist/other/jupyterlite/index.js delete mode 100644 dist/other/rjsf/CustomObjectFieldTemplate.d.ts delete mode 100644 dist/other/rjsf/CustomObjectFieldTemplate.js diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/dist/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 93e97b2f..00000000 --- a/dist/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import { hello_python } from "./other/fullscreen/test"; -console.log(hello_python()); diff --git a/dist/mui/components/custom/alert/AlertContextProvider.d.ts b/dist/mui/components/custom/alert/AlertContextProvider.d.ts deleted file mode 100644 index 5d10f26f..00000000 --- a/dist/mui/components/custom/alert/AlertContextProvider.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AlertProps } from "@mui/material/Alert"; -import { SnackbarProps } from "@mui/material/Snackbar"; -import React from "react"; -export type ExtendedAlertProps = AlertProps & { - content: string; -}; -export declare const AlertContext: React.Context<{ - show: (alertProps: ExtendedAlertProps, snackbarProps?: SnackbarProps) => void; -} | null>; -export interface AlertProvider { - children: React.ReactNode; -} -declare function AlertProvider({ children }: AlertProvider): React.JSX.Element; -export declare const AlertContextProvider: React.MemoExoticComponent; -export {}; diff --git a/dist/mui/components/custom/alert/AlertContextProvider.js b/dist/mui/components/custom/alert/AlertContextProvider.js deleted file mode 100644 index 607eb085..00000000 --- a/dist/mui/components/custom/alert/AlertContextProvider.js +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint-disable no-shadow */ -/* eslint-disable react/jsx-props-no-spreading */ -import Alert from "@mui/material/Alert"; -import AlertTitle from "@mui/material/AlertTitle"; -import Snackbar from "@mui/material/Snackbar"; -import React, { createContext, memo, useCallback, useState } from "react"; -export const AlertContext = createContext(null); -const defaultSnackbarProps = { - anchorOrigin: { - vertical: "bottom", - horizontal: "right", - }, - autoHideDuration: 3000, -}; -const defaultAlertProps = { - content: "Success Alert", - severity: "success", - variant: "filled", -}; -// eslint-disable-next-line react/prop-types -function AlertProvider({ children }) { - const [isAlertShown, setShownAlert] = useState(false); - const [snackbarProps, setSnackbarProps] = useState(defaultSnackbarProps); - const [alertProps, setAlertProps] = useState(defaultAlertProps); - const showAlert = useCallback((alertProps, snackbarProps) => { - if (alertProps) - setAlertProps((prev) => ({ ...prev, ...alertProps })); - if (snackbarProps) - setSnackbarProps((prev) => ({ ...prev, ...snackbarProps })); - setShownAlert(true); - }, []); - const closeAlert = useCallback(() => { - setShownAlert(false); - }, []); - const { content, severity, variant, ...restAlertProps } = alertProps; - /* eslint-disable react/jsx-no-constructed-context-values */ - return (React.createElement(AlertContext.Provider, { value: { show: showAlert } }, - children, - React.createElement(Snackbar, { ...snackbarProps, open: isAlertShown, onClose: closeAlert }, - React.createElement(Alert, { onClose: closeAlert, variant: variant, severity: severity, ...restAlertProps }, - React.createElement(AlertTitle, null, severity), - content)))); - /* eslint-enable react/jsx-no-constructed-context-values */ -} -export const AlertContextProvider = memo(AlertProvider); diff --git a/dist/mui/components/custom/alert/hooks/useAlert.d.ts b/dist/mui/components/custom/alert/hooks/useAlert.d.ts deleted file mode 100644 index 4d2bbd70..00000000 --- a/dist/mui/components/custom/alert/hooks/useAlert.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const useAlert: () => { - show: (alertProps: import("../AlertContextProvider").ExtendedAlertProps, snackbarProps?: import("@mui/material").SnackbarProps | undefined) => void; -} | null; diff --git a/dist/mui/components/custom/alert/hooks/useAlert.js b/dist/mui/components/custom/alert/hooks/useAlert.js deleted file mode 100644 index f20c02a4..00000000 --- a/dist/mui/components/custom/alert/hooks/useAlert.js +++ /dev/null @@ -1,5 +0,0 @@ -import { useContext } from "react"; -import { AlertContext } from "../AlertContextProvider"; -export const useAlert = () => { - return useContext(AlertContext); -}; diff --git a/dist/mui/components/custom/alert/index.d.ts b/dist/mui/components/custom/alert/index.d.ts deleted file mode 100644 index f1a34026..00000000 --- a/dist/mui/components/custom/alert/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./hooks/useAlert"; diff --git a/dist/mui/components/custom/alert/index.js b/dist/mui/components/custom/alert/index.js deleted file mode 100644 index f1a34026..00000000 --- a/dist/mui/components/custom/alert/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from "./hooks/useAlert"; diff --git a/dist/mui/components/stepper/StepIcon.d.ts b/dist/mui/components/stepper/StepIcon.d.ts deleted file mode 100644 index 93f79a0f..00000000 --- a/dist/mui/components/stepper/StepIcon.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; -export interface StepIconProps { - active: boolean; - icon: React.ReactNode; -} -declare function StepIcon(props: StepIconProps): React.JSX.Element; -export default StepIcon; diff --git a/dist/mui/components/stepper/StepIcon.js b/dist/mui/components/stepper/StepIcon.js deleted file mode 100644 index a905703c..00000000 --- a/dist/mui/components/stepper/StepIcon.js +++ /dev/null @@ -1,56 +0,0 @@ -import { styled } from "@mui/material/styles"; -import classNames from "classnames"; -import React from "react"; -const StyledStepIcon = styled("div")(({ theme }) => ({ - display: "flex", - justifyContent: "center", - alignItems: "center", - width: 50, - height: 50, - border: `1px solid ${theme.palette.primary.dark}`, - borderRadius: "50%", - color: theme.palette.common.white, - ".internal-circle": { - display: "flex", - flexDirection: "column", - justifyContent: "center", - alignItems: "center", - width: 44, - height: 44, - background: "transparent", - borderRadius: "50%", - border: `1px solid ${theme.palette.primary.dark}`, - lineHeight: 1.2, - ".step-number": { - fontSize: 13, - color: theme.palette.primary.dark, - }, - ".step-label": { - fontSize: 10, - color: theme.palette.primary.dark, - }, - }, - "&.active": { - border: `1px solid ${theme.palette.primary.dark}`, - color: theme.palette.common.white, - ".internal-circle": { - background: theme.palette.primary.dark, - ".step-number": { - fontSize: 13, - color: theme.palette.common.white, - }, - ".step-label": { - fontSize: 10, - color: theme.palette.common.white, - }, - }, - }, -})); -function StepIcon(props) { - const { active, icon } = props; - return (React.createElement(StyledStepIcon, { className: classNames({ active }) }, - React.createElement("div", { className: "internal-circle" }, - React.createElement("span", { className: "step-number" }, icon), - React.createElement("span", { className: "step-label" }, "STEP")))); -} -export default StepIcon; diff --git a/dist/mui/components/stepper/Stepper.styled.d.ts b/dist/mui/components/stepper/Stepper.styled.d.ts deleted file mode 100644 index 6bea702c..00000000 --- a/dist/mui/components/stepper/Stepper.styled.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const StyledConnector: StyledComponent; -export declare const StepMsg: StyledComponent; diff --git a/dist/mui/components/stepper/Stepper.styled.js b/dist/mui/components/stepper/Stepper.styled.js deleted file mode 100644 index 6a699b4c..00000000 --- a/dist/mui/components/stepper/Stepper.styled.js +++ /dev/null @@ -1,45 +0,0 @@ -import StepConnector, { stepConnectorClasses } from "@mui/material/StepConnector"; -import { styled } from "@mui/material/styles"; -import Typography from "@mui/material/Typography"; -export const StyledConnector = styled(StepConnector)(({ theme }) => ({ - [`&.${stepConnectorClasses.alternativeLabel}`]: { - top: 24, - left: "calc(-50% + 25px)", - right: "calc(50% + 25px)", - }, - [`&.${stepConnectorClasses.active}`]: { - [`& .${stepConnectorClasses.line}`]: { - backgroundColor: theme.palette.primary.dark, - "&::after": { - backgroundColor: theme.palette.primary.dark, - }, - }, - }, - [`&.${stepConnectorClasses.completed}`]: { - [`& .${stepConnectorClasses.line}`]: { - backgroundColor: theme.palette.primary.dark, - "&::after": { - backgroundColor: theme.palette.primary.dark, - }, - }, - }, - [`& .${stepConnectorClasses.line}`]: { - height: 2, - border: 0, - backgroundColor: theme.palette.border.dark, - "&::after": { - position: "absolute", - right: "-3px", - top: "-2px", - display: "block", - content: '""', - width: "6px", - height: "6px", - backgroundColor: theme.palette.border.dark, - borderRadius: "50%", - }, - }, -})); -export const StepMsg = styled(Typography)(() => ({ - marginTop: "15px", -})); diff --git a/dist/mui/components/textField/BasicTextField.d.ts b/dist/mui/components/textField/BasicTextField.d.ts deleted file mode 100644 index f566486a..00000000 --- a/dist/mui/components/textField/BasicTextField.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SxProps } from "@mui/material"; -import React, { HTMLInputTypeAttribute } from "react"; -type BasicTextFieldProps = { - label: string; - value?: string | number; - defaultValue?: string | number; - onChange?: (newValue: string | number) => void; - disabled?: boolean; - fullWidth?: boolean; - size?: "small" | "medium"; - labelAsPlaceholder?: boolean; - sx?: SxProps; - type?: HTMLInputTypeAttribute; - variant?: "standard" | "filled" | "outlined"; - required?: boolean; -}; -declare function BasicTextField({ label, value, defaultValue, onChange, // eslint-disable-line @typescript-eslint/no-empty-function -disabled, fullWidth, size, labelAsPlaceholder, sx, type, variant, required, }: BasicTextFieldProps): React.JSX.Element; -export default BasicTextField; diff --git a/dist/mui/components/textField/BasicTextField.js b/dist/mui/components/textField/BasicTextField.js deleted file mode 100644 index ace6ab3d..00000000 --- a/dist/mui/components/textField/BasicTextField.js +++ /dev/null @@ -1,8 +0,0 @@ -import TextField from "@mui/material/TextField"; -import React from "react"; -function BasicTextField({ label, value, defaultValue, onChange = () => { }, // eslint-disable-line @typescript-eslint/no-empty-function -disabled = false, fullWidth = true, size = "medium", labelAsPlaceholder = true, sx = {}, type = "text", variant = "outlined", required = false, }) { - const inputLabelProps = labelAsPlaceholder ? {} : { shrink: true }; - return (React.createElement(TextField, { type: type, sx: sx, label: label, value: value, defaultValue: defaultValue, fullWidth: fullWidth, disabled: disabled, variant: variant, size: size, required: required, InputLabelProps: inputLabelProps, onChange: (e) => onChange(e.target.value) })); -} -export default BasicTextField; diff --git a/dist/mui/components/textField/index.d.ts b/dist/mui/components/textField/index.d.ts deleted file mode 100644 index 060a300d..00000000 --- a/dist/mui/components/textField/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import BasicTextField from "./BasicTextField"; -export { BasicTextField }; diff --git a/dist/mui/components/textField/index.js b/dist/mui/components/textField/index.js deleted file mode 100644 index 060a300d..00000000 --- a/dist/mui/components/textField/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import BasicTextField from "./BasicTextField"; -export { BasicTextField }; diff --git a/dist/other/fullscreen/test.d.ts b/dist/other/fullscreen/test.d.ts deleted file mode 100644 index f29b2f7d..00000000 --- a/dist/other/fullscreen/test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function hello_python(): Promise; diff --git a/dist/other/fullscreen/test.js b/dist/other/fullscreen/test.js deleted file mode 100644 index 01dc8cdc..00000000 --- a/dist/other/fullscreen/test.js +++ /dev/null @@ -1,8 +0,0 @@ -// import { loadPyodide } from "pyodide"; -// const { loadPyodide } = require("pyodide"); -export async function hello_python() { - // const pyodide = await loadPyodide({ - // indexURL: "", - // }); - // return pyodide.runPythonAsync("1+1"); -} diff --git a/dist/other/iframe-messaging/index.d.ts b/dist/other/iframe-messaging/index.d.ts deleted file mode 100644 index 06a94b4e..00000000 --- a/dist/other/iframe-messaging/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./IframeToFromHostMessageHandler"; diff --git a/dist/other/iframe-messaging/index.js b/dist/other/iframe-messaging/index.js deleted file mode 100644 index 06a94b4e..00000000 --- a/dist/other/iframe-messaging/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./IframeToFromHostMessageHandler"; diff --git a/dist/other/jupyterlite/MessageHandler.d.ts b/dist/other/jupyterlite/MessageHandler.d.ts deleted file mode 100644 index fdffbf94..00000000 --- a/dist/other/jupyterlite/MessageHandler.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IframeMessageSchema } from "@mat3ra/esse/lib/js/types"; -type HandlerFunction = (...args: IframeMessageSchema["payload"][]) => void | any; -declare class MessageHandler { - private handlers; - private iframeOriginURL; - private hostOriginURL; - private iframeId; - init(iframeOriginURL: string, iframeId: string): void; - destroy(): void; - addHandlers(action: IframeMessageSchema["action"], handlers: HandlerFunction[]): void; - private receiveMessage; - sendData(data: object): void; -} -export default MessageHandler; diff --git a/dist/other/jupyterlite/MessageHandler.js b/dist/other/jupyterlite/MessageHandler.js deleted file mode 100644 index f636956a..00000000 --- a/dist/other/jupyterlite/MessageHandler.js +++ /dev/null @@ -1,57 +0,0 @@ -class MessageHandler { - constructor() { - this.handlers = { "get-data": [], "set-data": [], info: [] }; - this.iframeOriginURL = "*"; - this.hostOriginURL = "*"; - this.iframeId = ""; - this.receiveMessage = (event) => { - if (this.iframeOriginURL !== "*" && - event.origin !== this.iframeOriginURL && - event.origin !== this.hostOriginURL) { - return; - } - if (event.data.type === "from-iframe-to-host") { - const { action, payload } = event.data; - // @ts-ignore - if (this.handlers[action]) { - // @ts-ignore - this.handlers["set-data"].forEach((handler) => { - handler(payload); - }); - this.handlers["get-data"].forEach((handler) => { - const data = handler(); - this.sendData(data); - }); - } - } - }; - } - init(iframeOriginURL, iframeId) { - window.addEventListener("message", this.receiveMessage); - this.iframeOriginURL = iframeOriginURL; - this.hostOriginURL = window.location.origin; - this.iframeId = iframeId; - } - destroy() { - window.removeEventListener("message", this.receiveMessage); - } - addHandlers(action, handlers) { - if (!this.handlers[action]) { - this.handlers[action] = []; - } - this.handlers[action].push(...handlers); - } - sendData(data) { - const message = { - type: "from-host-to-iframe", - action: "set-data", - payload: data, - }; - const iframe = document.getElementById(this.iframeId); - if (iframe) { - // @ts-ignore - iframe.contentWindow.postMessage(message, this.iframeOriginURL); - } - } -} -export default MessageHandler; diff --git a/dist/other/jupyterlite/index.d.ts b/dist/other/jupyterlite/index.d.ts deleted file mode 100644 index eb2fa101..00000000 --- a/dist/other/jupyterlite/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./JupyterLiteSession"; diff --git a/dist/other/jupyterlite/index.js b/dist/other/jupyterlite/index.js deleted file mode 100644 index eb2fa101..00000000 --- a/dist/other/jupyterlite/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./JupyterLiteSession"; diff --git a/dist/other/rjsf/CustomObjectFieldTemplate.d.ts b/dist/other/rjsf/CustomObjectFieldTemplate.d.ts deleted file mode 100644 index 8bf995ec..00000000 --- a/dist/other/rjsf/CustomObjectFieldTemplate.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FormContextType, ObjectFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from "@rjsf/utils"; -import React from "react"; -/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the - * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all - * the properties. - * - * @param props - The `ObjectFieldTemplateProps` for this component - */ -declare function ObjectFieldTemplate({ description, title, properties, required, disabled, readonly, uiSchema, idSchema, schema, formData, onAddClick, registry, }: ObjectFieldTemplateProps): React.JSX.Element; -export default ObjectFieldTemplate; diff --git a/dist/other/rjsf/CustomObjectFieldTemplate.js b/dist/other/rjsf/CustomObjectFieldTemplate.js deleted file mode 100644 index 487e2286..00000000 --- a/dist/other/rjsf/CustomObjectFieldTemplate.js +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-disable react/no-array-index-key */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import Grid from "@mui/material/Grid"; -import { useTheme } from "@mui/material/styles"; -import { canExpand, descriptionId, getTemplate, getUiOptions, titleId, } from "@rjsf/utils"; -import React from "react"; -/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the - * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all - * the properties. - * - * @param props - The `ObjectFieldTemplateProps` for this component - */ -function ObjectFieldTemplate({ description, title, properties, required, disabled, readonly, uiSchema, idSchema, schema, formData, onAddClick, registry, }) { - const theme = useTheme(); - const uiOptions = getUiOptions(uiSchema); - const TitleFieldTemplate = getTemplate("TitleFieldTemplate", registry, uiOptions); - const DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, uiOptions); - // Button templates are not overridden in the uiSchema - const { ButtonTemplates: { AddButton }, } = registry.templates; - return (React.createElement(React.Fragment, null, - title && (React.createElement(TitleFieldTemplate, { id: titleId(idSchema), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry })), - description && (React.createElement(DescriptionFieldTemplate, { id: descriptionId(idSchema), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), - React.createElement(Grid, { container: true, spacing: 2 }, - properties.map((element, index) => - // Remove the if the inner element is hidden as the - // itself would otherwise still take up space. - element.hidden ? (element.content) : (React.createElement(Grid, { item: true, xs: 12, sm: 6, md: 4, lg: 3, xl: 2, key: index, rowSpacing: theme.spacing(1.25) }, element.content))), - canExpand(schema, uiSchema, formData) && (React.createElement(Grid, { container: true, justifyContent: "flex-end" }, - React.createElement(Grid, { item: true }, - React.createElement(AddButton, { className: "object-property-expand", onClick: onAddClick(schema), disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }))))))); -} -export default ObjectFieldTemplate;