updated all packages to latest
This commit is contained in:
1 parent
f1b24ec783
commit
e22f64dd51
18 files changed
+3455
-3751
No files matched your search
@@ -1,4 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
|
'core': {
|
||||||
|
builder: 'webpack5'
|
||||||
|
},
|
||||||
"stories": [
|
"stories": [
|
||||||
"../src/**/*.stories.mdx",
|
"../src/**/*.stories.mdx",
|
||||||
"../src/**/*.stories.@(js|jsx|ts|tsx)"
|
"../src/**/*.stories.@(js|jsx|ts|tsx)"
|
||||||
|
|||||||
+19
-14
@@ -8,24 +8,25 @@
|
|||||||
"@emotion/styled": "^11.8.1",
|
"@emotion/styled": "^11.8.1",
|
||||||
"@mui/material": "^5.8.0",
|
"@mui/material": "^5.8.0",
|
||||||
"@mui/styles": "^5.8.0",
|
"@mui/styles": "^5.8.0",
|
||||||
"@types/jest": "^26.0.15",
|
"@types/jest": "^27.5.1",
|
||||||
"@types/node": "^12.0.0",
|
"@types/node": "^17.0.36",
|
||||||
"@types/react": "^17.0.0",
|
"@types/react": "^18.0.9",
|
||||||
"@types/react-dom": "^17.0.0",
|
"@types/react-dom": "^18.0.5",
|
||||||
"@uiw/react-codemirror": "^4.7.0",
|
"@uiw/react-codemirror": "^4.7.0",
|
||||||
"autosuggest-highlight": "^3.2.1",
|
"autosuggest-highlight": "^3.2.1",
|
||||||
"home-assistant-js-websocket": "^7.1.0",
|
"home-assistant-js-websocket": "^7.1.0",
|
||||||
"jss": "^10.8.2",
|
"jss": "^10.8.2",
|
||||||
"react": "^17.0.2",
|
"notistack": "^2.0.5",
|
||||||
"react-dom": "^17.0.2",
|
"react": "^18.1.0",
|
||||||
|
"react-dom": "^18.1.0",
|
||||||
"react-flow-renderer": "^10.1.2",
|
"react-flow-renderer": "^10.1.2",
|
||||||
"react-jss": "^10.8.2",
|
"react-jss": "^10.8.2",
|
||||||
"react-router-dom": "6",
|
"react-router-dom": "6",
|
||||||
"react-scripts": "4.0.3",
|
"react-scripts": "5.0.1",
|
||||||
"superstruct": "^0.15.4",
|
"superstruct": "^0.15.4",
|
||||||
"theming": "^3.3.0",
|
"theming": "^3.3.0",
|
||||||
"typescript": "^4.1.2",
|
"typescript": "^4.1.2",
|
||||||
"web-vitals": "^1.0.1",
|
"web-vitals": "^2.1.4",
|
||||||
"yarn": "^1.22.17"
|
"yarn": "^1.22.17"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -73,20 +74,24 @@
|
|||||||
"@storybook/addon-essentials": "^6.4.22",
|
"@storybook/addon-essentials": "^6.4.22",
|
||||||
"@storybook/addon-links": "^6.4.22",
|
"@storybook/addon-links": "^6.4.22",
|
||||||
"@storybook/addon-queryparams": "^6.2.9",
|
"@storybook/addon-queryparams": "^6.2.9",
|
||||||
|
"@storybook/builder-webpack5": "^6.5.6",
|
||||||
|
"@storybook/manager-webpack5": "^6.5.6",
|
||||||
"@storybook/node-logger": "^6.4.22",
|
"@storybook/node-logger": "^6.4.22",
|
||||||
"@storybook/preset-create-react-app": "^3.2.0",
|
"@storybook/preset-create-react-app": "^4.1.1",
|
||||||
"@storybook/react": "^6.4.22",
|
"@storybook/react": "^6.4.22",
|
||||||
"@testing-library/jest-dom": "^5.11.4",
|
"@testing-library/jest-dom": "^5.11.4",
|
||||||
"@testing-library/react": "^11.1.0",
|
"@testing-library/react": "^13.3.0",
|
||||||
"@testing-library/user-event": "^12.1.10",
|
"@testing-library/user-event": "^14.2.0",
|
||||||
"@types/autosuggest-highlight": "^3.2.0",
|
"@types/autosuggest-highlight": "^3.2.0",
|
||||||
"@types/chroma-js": "^2.1.3",
|
"@types/chroma-js": "^2.1.3",
|
||||||
"@types/js-yaml": "^4.0.5",
|
"@types/js-yaml": "^4.0.5",
|
||||||
"jest-environment-jsdom": "^27.5.1",
|
"jest-environment-jsdom": "^28.1.0",
|
||||||
"ts-node": "^10.8.0"
|
"ts-node": "^10.8.0",
|
||||||
|
"webpack": "^5.72.1",
|
||||||
|
"webpack-dev-server": "^4.9.0"
|
||||||
},
|
},
|
||||||
"moduleDirectories": [
|
"moduleDirectories": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"src"
|
"src"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@ import "./AutoInfoBox.css";
|
|||||||
import { AutomationMetadata } from "types/automations";
|
import { AutomationMetadata } from "types/automations";
|
||||||
import { InputList } from "components/Inputs/InputList";
|
import { InputList } from "components/Inputs/InputList";
|
||||||
import InputText from "components/Inputs/InputText";
|
import InputText from "components/Inputs/InputText";
|
||||||
import { FC, useRef, useState } from 'react';
|
import { FC, ReactNode, useRef, useState } from 'react';
|
||||||
import { AddIcon, TrashIcon } from "components/Icons";
|
import { AddIcon, TrashIcon } from "components/Icons";
|
||||||
import { Button } from "components/Inputs/Button";
|
import { Button } from "components/Inputs/Button";
|
||||||
import InputAutoText from "components/Inputs/InputAutoText";
|
import InputAutoText from "components/Inputs/InputAutoText";
|
||||||
@@ -14,6 +14,7 @@ interface Props {
|
|||||||
tags: Array<[string, string]>;
|
tags: Array<[string, string]>;
|
||||||
onUpdate: (m: AutomationMetadata, tags: Array<[string, string]>) => void;
|
onUpdate: (m: AutomationMetadata, tags: Array<[string, string]>) => void;
|
||||||
tagDB: TagDB;
|
tagDB: TagDB;
|
||||||
|
children?: ReactNode;
|
||||||
}
|
}
|
||||||
export const AutoInfoBox: FC<Props> = ({
|
export const AutoInfoBox: FC<Props> = ({
|
||||||
metadata,
|
metadata,
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ export const AutomationEditor: FC<Props> = ({
|
|||||||
className="automation-editor--info-box--icon"
|
className="automation-editor--info-box--icon"
|
||||||
onClick={() => setCloseInfo(!closeInfo)}
|
onClick={() => setCloseInfo(!closeInfo)}
|
||||||
title={closeInfo ? "Show Metadata" : "Hide Metadata"}
|
title={closeInfo ? "Show Metadata" : "Hide Metadata"}
|
||||||
>{ArrowIcon}</ButtonIcon>
|
Icon={ArrowIcon}
|
||||||
|
/>
|
||||||
</AutoInfoBox>
|
</AutoInfoBox>
|
||||||
|
|
||||||
<div className={["automation-editor--flow-wrapper", state.status].join(" ")}>
|
<div className={["automation-editor--flow-wrapper", state.status].join(" ")}>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import "./index.mobile.css";
|
import "./index.mobile.css";
|
||||||
import { AutomationEditor } from "components/AutomationEditor";
|
import { AutomationEditor } from "components/AutomationEditor";
|
||||||
import { FC, useState } from "react";
|
import { FC, ReactNode, useState } from "react";
|
||||||
import { AutomationData } from "types/automations";
|
import { AutomationData } from "types/automations";
|
||||||
import { defaultAutomation } from 'utils/defaults';
|
import { defaultAutomation } from 'utils/defaults';
|
||||||
import { ArrowIcon } from "components/Icons";
|
import { ArrowIcon } from "components/Icons";
|
||||||
@@ -21,6 +21,7 @@ interface AutomationListParams {
|
|||||||
onAdd: (auto: AutomationData) => void;
|
onAdd: (auto: AutomationData) => void;
|
||||||
onRemove: (i: number) => void;
|
onRemove: (i: number) => void;
|
||||||
dims: DAGAutomationFlowDims;
|
dims: DAGAutomationFlowDims;
|
||||||
|
children?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AutomationList: FC<AutomationListParams> = ({
|
export const AutomationList: FC<AutomationListParams> = ({
|
||||||
@@ -59,9 +60,8 @@ export const AutomationList: FC<AutomationListParams> = ({
|
|||||||
<ButtonIcon
|
<ButtonIcon
|
||||||
onClick={() => setHideList(!hideList)}
|
onClick={() => setHideList(!hideList)}
|
||||||
className="automation-list--list-hide"
|
className="automation-list--list-hide"
|
||||||
>
|
Icon={ArrowIcon}
|
||||||
{ArrowIcon}
|
/>
|
||||||
</ButtonIcon>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="automation-list--viewer">
|
<div className="automation-list--viewer">
|
||||||
{currentAuto ? <AutomationEditor
|
{currentAuto ? <AutomationEditor
|
||||||
|
|||||||
@@ -85,47 +85,49 @@ export const ConditionNode: FC<{
|
|||||||
<button className={p.isRoot ? classes.deleteBtnRoot : classes.deleteBtn} onClick={p?.onClick}>X</button>
|
<button className={p.isRoot ? classes.deleteBtnRoot : classes.deleteBtn} onClick={p?.onClick}>X</button>
|
||||||
|
|
||||||
return <div className={classes.root}>
|
return <div className={classes.root}>
|
||||||
{(showDelete && !effectiveDM) && <DeleteButton isRoot onClick={() => onDelete('root')} />}
|
<>
|
||||||
<div className={classes.title}>
|
{(showDelete && !effectiveDM) && <DeleteButton isRoot onClick={() => onDelete('root')} />}
|
||||||
<InputList
|
<div className={classes.title}>
|
||||||
label=""
|
<InputList
|
||||||
className={classes.titleText}
|
label=""
|
||||||
current={condition.condition}
|
className={classes.titleText}
|
||||||
options={[
|
current={condition.condition}
|
||||||
'or', 'not', 'and',
|
options={[
|
||||||
'template',
|
'or', 'not', 'and',
|
||||||
'numeric_state',
|
'template',
|
||||||
'state',
|
'numeric_state',
|
||||||
'time',
|
'state',
|
||||||
'trigger',
|
'time',
|
||||||
'zone',
|
'trigger',
|
||||||
]}
|
'zone',
|
||||||
onChange={(n: any) => onUpdate({
|
]}
|
||||||
...getConditionDefaultValues(n),
|
onChange={(n: any) => onUpdate({
|
||||||
...condition,
|
...getConditionDefaultValues(n),
|
||||||
condition: n,
|
...condition,
|
||||||
} as any)}
|
condition: n,
|
||||||
/>
|
} as any)}
|
||||||
{effectiveDM && <button className={classes.yamlBtn} onClick={() => setYamlMode(!yamlMode)}>
|
/>
|
||||||
{yamlMode ? 'visual' : 'yaml'}
|
{effectiveDM && <button className={classes.yamlBtn} onClick={() => setYamlMode(!yamlMode)}>
|
||||||
</button>}
|
{yamlMode ? 'visual' : 'yaml'}
|
||||||
{!yamlMode && <button className={classes.modifyBtn} onClick={() => setInternalDisplayMode(!effectiveDM)}>
|
</button>}
|
||||||
{effectiveDM ? <PencilIcon className={classes.icon} /> : <CheckMarkIcon className={classes.icon} />}
|
{!yamlMode && <button className={classes.modifyBtn} onClick={() => setInternalDisplayMode(!effectiveDM)}>
|
||||||
</button>}
|
{effectiveDM ? <PencilIcon className={classes.icon} /> : <CheckMarkIcon className={classes.icon} />}
|
||||||
</div>
|
</button>}
|
||||||
<div className={classes.children}>
|
|
||||||
{yamlMode && <InputYaml
|
|
||||||
label=""
|
|
||||||
value={condition}
|
|
||||||
onChange={update => onUpdate(update as any)}
|
|
||||||
/>}
|
|
||||||
<div className={classes.conditionWrap}>
|
|
||||||
{!yamlMode && childrenConditions}
|
|
||||||
</div>
|
</div>
|
||||||
{!yamlMode && hasChildren && <div className={classes.addBtnContainer}>
|
<div className={classes.children}>
|
||||||
<button className={classes.addBtn} onClick={() => onAddChild()}>Add</button>
|
{yamlMode && <InputYaml
|
||||||
</div>}
|
label=""
|
||||||
</div>
|
value={condition}
|
||||||
{children({ classes })}
|
onChange={update => onUpdate(update as any)}
|
||||||
|
/>}
|
||||||
|
<div className={classes.conditionWrap}>
|
||||||
|
{!yamlMode && childrenConditions}
|
||||||
|
</div>
|
||||||
|
{!yamlMode && hasChildren && <div className={classes.addBtnContainer}>
|
||||||
|
<button className={classes.addBtn} onClick={() => onAddChild()}>Add</button>
|
||||||
|
</div>}
|
||||||
|
</div>
|
||||||
|
{children({ classes })}
|
||||||
|
</>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { Component, ErrorInfo } from "react";
|
import { Component, ErrorInfo, ReactNode } from "react";
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
hasError: false;
|
hasError: false;
|
||||||
@@ -8,7 +8,9 @@ type State = {
|
|||||||
error: any,
|
error: any,
|
||||||
errorInfo?: ErrorInfo,
|
errorInfo?: ErrorInfo,
|
||||||
}
|
}
|
||||||
export class ErrorBoundary extends Component<{}, State> {
|
export class ErrorBoundary extends Component<{
|
||||||
|
children: ReactNode
|
||||||
|
}, State> {
|
||||||
|
|
||||||
state: State = {
|
state: State = {
|
||||||
hasError: false
|
hasError: false
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createAppUseStyles } from 'styles/theme';
|
|||||||
export interface ButtonIconStyleProps {
|
export interface ButtonIconStyleProps {
|
||||||
}
|
}
|
||||||
export interface ButtonIconProps extends IconBaseProps, ButtonIconStyleProps {
|
export interface ButtonIconProps extends IconBaseProps, ButtonIconStyleProps {
|
||||||
children: FC<IconBaseProps>;
|
Icon: FC<IconBaseProps>;
|
||||||
}
|
}
|
||||||
const useButtonIconStyles = createAppUseStyles(theme => ({
|
const useButtonIconStyles = createAppUseStyles(theme => ({
|
||||||
buttonIcon: {
|
buttonIcon: {
|
||||||
@@ -22,9 +22,9 @@ const useButtonIconStyles = createAppUseStyles(theme => ({
|
|||||||
|
|
||||||
|
|
||||||
export const ButtonIcon: FC<ButtonIconProps> = ({
|
export const ButtonIcon: FC<ButtonIconProps> = ({
|
||||||
children: Child,
|
Icon,
|
||||||
className,
|
className,
|
||||||
...props
|
...props
|
||||||
}) => <Child
|
}) => <Icon
|
||||||
className={`${useButtonIconStyles({}).classes.buttonIcon} ${className}`} {...props}
|
className={`${useButtonIconStyles({}).classes.buttonIcon} ${className}`} {...props}
|
||||||
/>
|
/>
|
||||||
@@ -32,7 +32,7 @@ IconList.args = {
|
|||||||
export const ButtonIconExample: ComponentStory<typeof IconBase> = (args) => {
|
export const ButtonIconExample: ComponentStory<typeof IconBase> = (args) => {
|
||||||
|
|
||||||
return <Page>
|
return <Page>
|
||||||
<ButtonIcon {...args}>{ArrowIcon}</ButtonIcon>
|
<ButtonIcon {...args} Icon={ArrowIcon} />
|
||||||
</Page>
|
</Page>
|
||||||
}
|
}
|
||||||
ButtonIconExample.args = {
|
ButtonIconExample.args = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import "./InputEntities.css";
|
import "./InputEntities.css";
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import { DeviceRegistryOption, useHADeviceRegistry } from 'haService';
|
import { useHADeviceRegistry } from 'haService';
|
||||||
import Autocomplete from '@mui/material/Autocomplete';
|
import Autocomplete from '@mui/material/Autocomplete';
|
||||||
import TextField from '@mui/material/TextField';
|
import TextField from '@mui/material/TextField';
|
||||||
import Chip from '@mui/material/Chip';
|
import Chip from '@mui/material/Chip';
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import Chip from "@mui/material/Chip";
|
import Chip from "@mui/material/Chip";
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import Autocomplete from "@mui/material/Autocomplete";
|
import Autocomplete from "@mui/material/Autocomplete";
|
||||||
import { FC } from "react";
|
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
label: string;
|
label: string;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FC } from "react";
|
import { FC, ReactNode } from "react";
|
||||||
import { useInputWrapperStyles } from "./styles";
|
import { useInputWrapperStyles } from "./styles";
|
||||||
|
|
||||||
|
|
||||||
@@ -8,6 +8,7 @@ export interface Props {
|
|||||||
noMargin?: boolean;
|
noMargin?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
error?: string;
|
error?: string;
|
||||||
|
children: ReactNode;
|
||||||
}
|
}
|
||||||
const InputWrapper: FC<Props> = ({ error, label, children, labelSize = 'normal', noMargin = false, className = "" }) => {
|
const InputWrapper: FC<Props> = ({ error, label, children, labelSize = 'normal', noMargin = false, className = "" }) => {
|
||||||
const { classes } = useInputWrapperStyles({ labelSize, noMargin, hasError: !!error })
|
const { classes } = useInputWrapperStyles({ labelSize, noMargin, hasError: !!error })
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { FC } from "react";
|
import { FC, ReactNode } from "react";
|
||||||
import { createAppUseStyles } from "styles/theme";
|
import { createAppUseStyles } from "styles/theme";
|
||||||
|
|
||||||
export interface ModalStyleProps {
|
export interface ModalStyleProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
}
|
}
|
||||||
export interface Props extends ModalStyleProps {
|
export interface Props extends ModalStyleProps {
|
||||||
|
children: ReactNode;
|
||||||
}
|
}
|
||||||
const useModalStyle = createAppUseStyles<ModalStyleProps>(theme => ({
|
const useModalStyle = createAppUseStyles<ModalStyleProps>(theme => ({
|
||||||
root: ({ open }) => ({
|
root: ({ open }) => ({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
import { FC } from 'react';
|
import { FC, ReactNode } from 'react';
|
||||||
import { AutomationNode, AutomationNodeMapping } from 'types/automations/index';
|
import { AutomationNode, AutomationNodeMapping } from 'types/automations/index';
|
||||||
import { useEditorNodeState } from "./OptionManager";
|
import { useEditorNodeState } from "./OptionManager";
|
||||||
import { InputList } from "components/Inputs/InputList";
|
import { InputList } from "components/Inputs/InputList";
|
||||||
@@ -15,6 +15,7 @@ export interface NodeEditorProps {
|
|||||||
onFlags?: (isReady: boolean, isModified: boolean) => void;
|
onFlags?: (isReady: boolean, isModified: boolean) => void;
|
||||||
saveBtnCreateText?: boolean;
|
saveBtnCreateText?: boolean;
|
||||||
isErrored?: boolean;
|
isErrored?: boolean;
|
||||||
|
children?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NodeEditor: FC<NodeEditorProps> = ({
|
export const NodeEditor: FC<NodeEditorProps> = ({
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { FC } from 'react';
|
import { FC, ReactNode } from 'react';
|
||||||
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
||||||
import { VersionBox } from "components/VersionBox";
|
import { VersionBox } from "components/VersionBox";
|
||||||
|
import { SnackbarProvider } from 'notistack';
|
||||||
|
|
||||||
const theme = createTheme({
|
const theme = createTheme({
|
||||||
palette: {
|
palette: {
|
||||||
@@ -10,14 +11,18 @@ const theme = createTheme({
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export const Page: FC = ({ children }) => {
|
export const Page: FC<{
|
||||||
|
children: ReactNode
|
||||||
|
}> = ({ children }) => {
|
||||||
return <ThemeProvider theme={theme}>
|
return <ThemeProvider theme={theme}>
|
||||||
<main className="page" style={{
|
<SnackbarProvider>
|
||||||
color: theme.palette.text.primary,
|
<main className="page" style={{
|
||||||
background: theme.palette.background.default,
|
color: theme.palette.text.primary,
|
||||||
}}>
|
background: theme.palette.background.default,
|
||||||
<VersionBox />
|
}}>
|
||||||
{children}
|
<VersionBox />
|
||||||
</main>
|
{children}
|
||||||
|
</main>
|
||||||
|
</SnackbarProvider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Connection, getCollection } from "home-assistant-js-websocket";
|
import { Connection, getCollection } from "home-assistant-js-websocket";
|
||||||
import { HassDevices, HassEntitiesRegistry } from './types';
|
import { HassEntitiesRegistry } from './types';
|
||||||
|
|
||||||
|
|
||||||
export const fetchEntityRegistry = (conn: Connection) => conn.sendMessagePromise<HassEntitiesRegistry>({
|
export const fetchEntityRegistry = (conn: Connection) => conn.sendMessagePromise<HassEntitiesRegistry>({
|
||||||
|
|||||||
@@ -123,6 +123,6 @@ export const prettyEntityId = (entityId: string | string[]) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const prettyName = (n: string) => {
|
export const prettyName = (n: string) => {
|
||||||
const clean = n.replaceAll(/[\.-_]/g, ' ');
|
const clean = n.replaceAll(/[.-_]/g, ' ');
|
||||||
return clean.split(' ').map(x => x.slice(0, 1).toUpperCase() + x.slice(1)).join(' ')
|
return clean.split(' ').map(x => x.slice(0, 1).toUpperCase() + x.slice(1)).join(' ')
|
||||||
}
|
}
|
||||||
+3351
-3668
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user