Skip to content

Commit

Permalink
Merge pull request #27 from technote-space/release/next-v0.3.0
Browse files Browse the repository at this point in the history
release: v0.3.1
  • Loading branch information
technote-space authored Jun 15, 2020
2 parents bc4e848 + a98d781 commit f72dab1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@technote-space/ga-framework",
"version": "0.3.0",
"version": "0.3.1",
"description": "GA Framework",
"author": {
"name": "Technote",
Expand Down Expand Up @@ -42,9 +42,9 @@
"react-dom": "^16.13.1",
"react-helmet": "^6.1.0",
"styled-components": "^5.1.1",
"vis-data": "^6.5.3",
"vis-data": "^6.6.0",
"vis-network": "^7.6.10",
"vis-util": "^4.2.0"
"vis-util": "^4.3.0"
},
"devDependencies": {
"@babel/core": "^7.10.2",
Expand Down
7 changes: 6 additions & 1 deletion src/app/Store.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {useReducer, createContext, useContext, useCallback, useMemo, useEffect, FC} from 'react';
import {AppOptions} from '../types';
import {getProcessContext} from './common';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getReducer = (options: AppOptions) => (store, action): any => {
Expand Down Expand Up @@ -30,14 +31,18 @@ const DispatchContext = createContext({});
export const useDispatchContext = (): any => useContext(DispatchContext);

export const StoreContextProvider: FC<{
children;
options: AppOptions;
}> = ({children, options}) => {
const initialState = {
page: options.firstPage ?? Object.keys(options.pages)[0],
themeColor: 'dark',
status: 'none',
worker: null,
control: {
reset: store => async(): Promise<void> => store.worker?.reset(await getProcessContext(options, store)),
start: store => (): void => store.worker?.start(),
stop: store => (): void => store.worker?.stop(),
},
};
const [store, dispatch] = useReducer(getReducer(options), options.store?.state ? options.store.state(initialState) : initialState);

Expand Down
17 changes: 8 additions & 9 deletions src/app/templates/NavContentEx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {useSidebar} from '@mui-treasury/layout/hooks';
import clsx from 'clsx';
import {useStoreContext, useDispatchContext} from '../Store';
import {AppOptions} from '../../types';
import {getProcessContext} from '../common';

const useStyles = makeStyles((theme: Theme) => createStyles({
list: {
Expand Down Expand Up @@ -46,11 +45,11 @@ const useStyles = makeStyles((theme: Theme) => createStyles({
const NavContentEx: FC<{
options: AppOptions;
}> = ({options}) => {
const {store: {page, status, worker}, store} = useStoreContext();
const {dispatch} = useDispatchContext();
const classes = useStyles();
const {setOpen} = useSidebar('primarySidebar');
const [controller, setController] = useState<JSX.Element | null>(null);
const {store: {page, status, worker, control}, store} = useStoreContext();
const {dispatch} = useDispatchContext();
const classes = useStyles();
const {setOpen} = useSidebar('primarySidebar');
const [controller, setController] = useState<JSX.Element | null>(null);

const switchPerspective = next => (): void => {
if (next !== page) {
Expand Down Expand Up @@ -83,15 +82,15 @@ const NavContentEx: FC<{
<div className={classes.wrapButtons}>
<Button
className={classes.button}
onClick={async(): Promise<void> => worker.reset(await getProcessContext(options, store))}
onClick={control.reset(store)}
disabled={status !== 'initialized' && status !== 'finished' && status !== 'canceled'}
>
Reset
</Button>
<Button className={classes.button} onClick={(): void => worker.start()} disabled={status !== 'initialized' && status !== 'canceled'}>
<Button className={classes.button} onClick={control.start(store)} disabled={status !== 'initialized' && status !== 'canceled'}>
Start
</Button>
<Button className={classes.button} onClick={(): void => worker.stop()} disabled={status !== 'started'}>
<Button className={classes.button} onClick={control.stop(store)} disabled={status !== 'started'}>
Stop
</Button>
</div>
Expand Down
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3827,9 +3827,9 @@ ini@^1.3.4:
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==

inquirer@^7.0.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.1.0.tgz#1298a01859883e17c7264b82870ae1034f92dd29"
integrity sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==
version "7.2.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.2.0.tgz#63ce99d823090de7eb420e4bb05e6f3449aa389a"
integrity sha512-E0c4rPwr9ByePfNlTIB8z51kK1s2n6jrHuJeEHENl/sbq2G/S1auvibgEwNR4uSyiU+PiYHqSwsgGiXjG8p5ZQ==
dependencies:
ansi-escapes "^4.2.1"
chalk "^3.0.0"
Expand Down Expand Up @@ -6582,20 +6582,20 @@ validate-npm-package-license@^3.0.1:
spdx-correct "^3.0.0"
spdx-expression-parse "^3.0.0"

vis-data@^6.5.3:
version "6.5.3"
resolved "https://registry.yarnpkg.com/vis-data/-/vis-data-6.5.3.tgz#39b3b66f93a393b9f2a61416e0185505e210d6f2"
integrity sha512-y7NlLWKnzEfVVUT6LYZrTbZGrFummHlHlRa/cv8OWL5O52fi9l0qUsHk/VhBkEEuoQRR+u6ZMyriFauvXXtSKQ==
vis-data@^6.6.0:
version "6.6.0"
resolved "https://registry.yarnpkg.com/vis-data/-/vis-data-6.6.0.tgz#68e9ab4936c6cddcda32b9d025b46cb0b1ea489a"
integrity sha512-qbFYARIYNt76AA/uYR/kcqatHsUdSGUNzg4Te2+x5ftcLPnbVyhbsL1E6ukzU84/1ua4XRMssdNaainShBHHWg==

vis-network@^7.6.10:
version "7.6.10"
resolved "https://registry.yarnpkg.com/vis-network/-/vis-network-7.6.10.tgz#85fe40b0dfca17c9ff886f6ac98a7b1f182a62bd"
integrity sha512-wL1dHBWWpzxvUaM0miccDuSLQ2tkw93jCA3j4Zizh4ruph+UXnjkouayaOyJIx43wULUSoKGWkhE6na1q208TA==

vis-util@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/vis-util/-/vis-util-4.2.0.tgz#b53e243a4c05dbf1a95be2a0a175ccab69076ed3"
integrity sha512-8cE7FKiLCuu+khzDzHhszpAJQR0DP8k9+cIqXKiI86hK4vmilUQEp4vflyGYJp3YvSrsBwUSFgDvtezjO/IYFQ==
vis-util@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/vis-util/-/vis-util-4.3.0.tgz#784357d9b2d9a7e8ce9c1ef3a5fe05493bfdbbbb"
integrity sha512-k/eKWwSK1VX/clp9L+LqFDXKoNHKM5zyHDJvHujfQiltVYNG7njlE2Qlh9+vkXYKznJKKrczTwGGme8E+Xg3uQ==

vm-browserify@^1.0.1:
version "1.1.2"
Expand Down

0 comments on commit f72dab1

Please sign in to comment.