Merge branch 'master' into enhance/debug

This commit is contained in:
Taso authored and GitHub committed 2021-02-14 17:15:01 -05:00
commit 1f07a469d8
54 files changed
+1029 -1082

No files matched your search

+5 -2
View File
@@ -21,6 +21,7 @@
"@types/jest": "^26.0.14",
"core-js": "^3.6.5",
"dayjs": "^1.10.4",
"dompurify": "^2.2.6",
"emoji-mart": "^3.0.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
@@ -56,6 +57,7 @@
"babel-plugin-styled-components": "^1.10.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"copy-webpack-plugin": "6.2.1",
"cp-cli": "^2.0.0",
"cra-build-watch": "^3.2.0",
"cross-env": "^7.0.2",
"css-loader": "^2.1.1",
@@ -75,10 +77,11 @@
"webpack-cli": "^3.3.12"
},
"scripts": {
"start": "react-scripts start",
"copy:config": "cp-cli ../config.json ./src/config.autogen.json",
"start": "yarn copy:config && react-scripts start",
"watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js",
"format": "prettier --write src/**/*.{js,jsx,ts,tsx,json,css,scss,md}",
"build": "cross-env NODE_ENV=production webpack --config webpack/prod.config.js --color -p --progress --hide-modules --display-optimization-bailout",
"build": "yarn copy:config && cross-env NODE_ENV=production webpack --config webpack/webpack.resources.js --color -p --progress --hide-modules --display-optimization-bailout",
"build:dev": "cross-env NODE_ENV=development webpack --config webpack/dev.config.js --color -p --progress --hide-modules --display-optimization-bailout --analyze",
"test": "react-scripts test --watchAll=false --testMatch **/src/**/*.test.{ts,js,tsx}",
"test:watch": "react-scripts test --watchAll --testMatch **/src/**/*.test.{ts,js,tsx}",
+37 -56
View File
@@ -1,8 +1,9 @@
import React, { useMemo } from 'react';
import './Phone.css';
import './i18n';
import { Route, useHistory } from 'react-router-dom';
import { Route } from 'react-router-dom';
import { CallModal } from './modal/components/CallModal';
import { Alert } from './ui/components/Alert';
import { HomeApp } from './apps/home/components/Home';
import { createMuiTheme, ThemeProvider } from '@material-ui/core';
import { useInitKeyboard } from './os/keyboard/hooks/useKeyboard';
@@ -32,51 +33,8 @@ import { useModal } from './modal/hooks/useModal';
import { useDialService } from './apps/dialer/hooks/useDialService';
import InjectDebugData from './os/debug/InjectDebugData';
import { useQuickAccess } from './os/notifications/hooks/useQuickAccess';
InjectDebugData([
{
app: 'PHONE',
method: 'phoneConfig',
data: {
Locale: 'en',
KeyTogglePhone: 288,
KeyTakeCall: 38,
PhoneAsItem: false,
SwimDestroy: false,
RunRate: 10,
DestoryChance: 100,
DestroyPhoneReCheck: 3,
notificationPosition: {
horizontal: 'right',
vertical: 'top',
},
general: {
useDashNumber: true,
},
twitter: {
showNotifications: true,
generateProfileNameFromUsers: true,
allowEdtiableProfileName: true,
allowDeleteTweets: true,
allowReportTweets: true,
characterLimit: 160,
newLineLimit: 10,
enableAvatars: true,
enableEmojis: true,
enableImages: true,
maxImages: 3,
},
bank: {
showNotifications: true,
},
},
},
{
app: 'PHONE',
method: 'setVisibility',
data: true,
},
]);
import { useSnackbar } from './ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
function Phone() {
const quickAccess = useQuickAccess();
@@ -95,6 +53,9 @@ function Phone() {
usePhotoService();
useCallService();
useDialService();
const { t } = useTranslation()
const { alert } = useSnackbar();
const { modal } = useModal(); // the calling modal
@@ -151,16 +112,28 @@ function Phone() {
}))}
/>
<div className='PhoneAppContainer'>
{modal ? (
<CallModal />
) : (
<>
<Route exact path='/' component={HomeApp} />
{allApps.map((App) => (
<App.Route key={App.id} />
))}
</>
)}
{modal ? (
<CallModal />
) : (
<>
<Route exact path='/' component={HomeApp} />
{allApps.map((App) => (
<App.Route key={App.id} />
))}
</>
)}
{alert ? (
<div style={{
marginTop: '-100px',
display: 'flex',
justifyContent: 'center',
alignItems: 'center'
}}>
<Alert severity={alert.type} variant="filled">
{t("APPS_"+alert.message)}
</Alert>
</div>
) : null}
</div>
<Navigation />
</>
@@ -173,3 +146,11 @@ function Phone() {
}
export default Phone;
InjectDebugData([
{
app: 'PHONE',
method: 'setVisibility',
data: true,
},
]);
@@ -1,4 +1,4 @@
import React, {useEffect} from 'react';
import React from 'react';
import { Box, Button } from '@material-ui/core';
import useStyles from './grid.styles';
import { usePhotos } from '../../hooks/usePhotos';
@@ -1,85 +0,0 @@
import React, { useState } from 'react';
import { Button, TextField } from '@material-ui/core';
import Nui from '../../../os/nui-events/utils/Nui';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import Modal from '../../../ui/components/Modal';
import { useModal } from '../hooks/useModal';
import PersonIcon from '@material-ui/icons/Person';
import PhoneIcon from '@material-ui/icons/Phone';
import AccountCircleIcon from '@material-ui/icons/AccountCircle';
import useStyles from './styles.contactmodal';
import { useTranslation } from 'react-i18next';
export const AddContactModal = () => {
const [name, setName] = useState('');
const [number, setNumber] = useState('');
const [avatar, setAvatar] = useState('');
const classes = useStyles();
const { t } = useTranslation();
const { showModal, setShowModal } = useModal();
const addContact = () => {
if (name === '' || number === '') {
console.log('You need to pass in values');
} else {
Nui.send('contacts:add', {
name,
number,
avatar,
});
setShowModal(false)
}
};
const _handleClose = () => {
setShowModal(false);
};
return (
<Modal visible={showModal} handleClose={_handleClose}>
<List style={{ marginTop: 30 }}>
<ListItem>
<PersonIcon className={classes.icons} />
<TextField
value={name}
inputProps={{ className: classes.textInputField }}
onChange={(e) => setName(e.target.value)}
fullWidth
variant='standard'
placeholder={t('APPS_CONTACT_MODAL_PLACEHOLDER_NAME')}
/>
</ListItem>
<ListItem>
<PhoneIcon className={classes.icons} />
<TextField
value={number}
inputProps={{ className: classes.textInputField }}
onChange={(e) => setNumber(e.target.value)}
fullWidth
placeholder={t('APPS_CONTACT_MODAL_PLACEHOLDER_NUMBER')}
variant='standard'
type='text'
/>
</ListItem>
<ListItem>
<AccountCircleIcon className={classes.icons} />
<TextField
value={avatar}
inputProps={{ className: classes.textInputField }}
onChange={(e) => setAvatar(e.target.value)}
fullWidth
placeholder={t('APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR')}
variant='standard'
type='text'
/>
</ListItem>
</List>
<Button className={classes.addBtn} onClick={addContact}>
{t('APPS_CONTACT_MODAL_BUTTON_ADD')}
</Button>
</Modal>
);
};
@@ -1,13 +0,0 @@
import React from 'react';
import Paper from '@material-ui/core/Paper';
import ContactsIcon from '@material-ui/icons/Contacts';
import useStyles from './styles.contacts';
export const ContactTitle = () => {
const classes = useStyles();
return (
<Paper className={classes.root} square variant='outlined' elevation={24}>
<ContactsIcon className={classes.icon} />
</Paper>
);
};
@@ -2,18 +2,12 @@ import React from 'react';
import { AppWrapper } from '../../../ui/components';
import { AppTitle } from '../../../ui/components/AppTitle';
import { AppContent } from '../../../ui/components/AppContent';
import { ContactList } from './List/ContactList';
import { useApp } from '../../../os/apps/hooks/useApps';
import { AddContactModal } from './ContactModal';
import { useModal } from '../hooks/useModal';
import PersonAddIcon from '@material-ui/icons/PersonAdd';
import Fab from '@material-ui/core/Fab';
import { InfoModal } from './modal/InfoModal';
import { useContactDetail } from '../hooks/useContactDetail';
import { ContactAlert } from './alert/ContactAlert';
import useStyles from './styles.contacts';
import InjectDebugData from '../../../os/debug/InjectDebugData';
import { Route } from 'react-router-dom';
import ContactsInfoPage from './views/ContactInfo';
import { ContactPage } from './views/ContactsPage';
InjectDebugData([
{
@@ -23,43 +17,32 @@ InjectDebugData([
{
id: 1,
display: 'Ruqen',
number: '43534444',
number: '555-15196',
},
{
id: 1,
id: 2,
display: 'Taso',
number: '456466',
number: '215-8139',
avatar: 'http://i.tasoagc.dev/i9Ig',
},
{
id: 3,
display: 'Chip',
number: '417-8792',
},
],
},
]);
export const ContactsApp = () => {
const classes = useStyles();
const { showModal, setShowModal } = useModal();
const contacts = useApp('CONTACTS');
const { contactDetail } = useContactDetail();
const openModal = () => {
setShowModal(true);
};
return (
<AppWrapper id='contact-app'>
<AppTitle app={contacts} />
<AddContactModal />
<InfoModal key={contactDetail?.id} />
<div className={showModal ? classes.backgroundModal : undefined} />
<AppContent>
<ContactList />
<Fab
onClick={openModal}
style={{ backgroundColor: '#2196f3', color: '#fff' }}
className={classes.absolute}
>
<PersonAddIcon />
</Fab>
<ContactAlert />
<Route path='/contacts/' exact component={ContactPage} />
<Route path='/contacts/:id' exact component={ContactsInfoPage} />
</AppContent>
</AppWrapper>
);
@@ -14,78 +14,84 @@ import PhoneIcon from '@material-ui/icons/Phone';
import ChatIcon from '@material-ui/icons/Chat';
import MoreVertIcon from '@material-ui/icons/MoreVert';
import { useContacts } from '../../hooks/useContacts';
import { useContactModal } from '../../hooks/useContactModal';
import { useContactDetail } from '../../hooks/useContactDetail';
import Nui from '../../../../os/nui-events/utils/Nui';
import '../Contact.css';
import { SearchContacts } from './SearchContacts';
import { useHistory } from 'react-router-dom';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
export const ContactList = () => {
const { filteredContacts } = useFilteredContacts();
const { setShowContactModal } = useContactModal();
const { setContactDetail } = useContactDetail();
const history = useHistory();
const contacts = useContacts();
const { contacts } = useContacts();
const openContactInfo = (contact) => {
setShowContactModal(true);
setContactDetail(contact);
const openContactInfo = (contactId: number) => {
history.push(`/contacts/${contactId}`);
};
const startCall = (number) => {
console.log(number);
const startCall = (number: string) => {
LogDebugEvent({
action: 'Emitting `Start Call` to Scripts',
level: 2,
data: true,
});
Nui.send('phone:beginCall', {
number,
});
};
const handleMessage = () => {
LogDebugEvent({
action: 'Routing to Message',
level: 1,
data: true,
});
// TODO: Integrate to send to message event when route becomes available
};
const filteredRegEx = new RegExp(filteredContacts, 'gi');
return (
<>
<SearchContacts />
<List>
{contacts.contacts
{contacts
.filter(
(contact) =>
contact.display.match(filteredRegEx) ||
contact.number.match(filteredRegEx)
)
.map((contact) => (
<>
<ListItem key={contact.id} divider>
<ListItemAvatar>
{contact.avatar ? (
<MuiAvatar src={contact.avatar} />
) : (
<MuiAvatar>
{contact.display.slice(0, 1).toUpperCase()}
</MuiAvatar>
)}
</ListItemAvatar>
<ListItemText
primary={contact.display}
secondary={contact.number}
/>
<Button onClick={() => startCall(contact.number)}>
<PhoneIcon />
</Button>
<Button
onClick={() =>
console.log('Message: ' + contact.display, contact.number)
}
>
<ChatIcon />
</Button>
<Button
style={{ margin: -15 }}
onClick={() => openContactInfo(contact)}
>
<MoreVertIcon />
</Button>
</ListItem>
</>
<ListItem key={contact.id} divider>
<ListItemAvatar>
{contact.avatar ? (
<MuiAvatar src={contact.avatar} />
) : (
<MuiAvatar>
{contact.display.slice(0, 1).toUpperCase()}
</MuiAvatar>
)}
</ListItemAvatar>
<ListItemText
primary={contact.display}
secondary={contact.number}
/>
<Button onClick={() => startCall(contact.number)}>
<PhoneIcon />
</Button>
<Button onClick={() => handleMessage()}>
<ChatIcon />
</Button>
<Button
style={{ margin: -15 }}
onClick={() => openContactInfo(contact.id)}
>
<MoreVertIcon />
</Button>
</ListItem>
))}
</List>
</>
@@ -1,65 +0,0 @@
import { Snackbar } from '@material-ui/core';
import React, { useState, useEffect, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { Alert } from '../../../../ui/components/Alert';
import { useContactAlert } from '../../hooks/useAlert';
import { AlertCategory } from '../../../../common/typings/contact';
// Used as a prefix for referencing the locales
// Needed to make code cleaner
const LOCALE_PREFIX = 'APPS_';
export const ContactAlert = () => {
const { t } = useTranslation();
const { alert, setAlert } = useContactAlert();
const [open, setOpen] = useState(false);
const [message, setMessage] = useState(null);
const [severity, setSeverity] = useState('');
const _handleClose = () => {
setOpen(false);
setAlert(null);
};
const setMessageAlert = useCallback((type: AlertCategory, severity: 'success' | 'error') => {
setMessage(t(LOCALE_PREFIX + type));
setSeverity(severity);
setOpen(true);
}, [t]);
useEffect(() => {
switch (alert) {
case 'CONTACT_ADD_FAILED':
setMessageAlert(alert, 'error');
break;
case 'CONTACT_ADD_SUCCESS':
setMessageAlert(alert, 'success');
break;
case 'CONTACT_DELETE_FAILED':
setMessageAlert(alert, 'error');
break;
case 'CONTACT_DELETE_SUCCESS':
setMessageAlert(alert, 'success');
break;
case 'CONTACT_UPDATE_FAILED':
setMessageAlert(alert, 'error');
break;
case 'CONTACT_UPDATE_SUCCESS':
setMessageAlert(alert, 'success');
break;
}
}, [alert, setMessageAlert]);
return (
<Snackbar
style={{ width: '80%', position: 'absolute', bottom: '10%' }}
autoHideDuration={6000}
open={open}
onClose={_handleClose}
>
<Alert severity={severity} variant='filled'>
{message}
</Alert>
</Snackbar>
);
};
@@ -1,112 +0,0 @@
import React, { useState } from 'react';
import {
Paper,
Slide,
Button,
TextField,
Avatar as MuiAvatar,
} from '@material-ui/core';
import useStyles from './modal.styles';
import { useContactModal } from '../../hooks/useContactModal';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import { useTranslation } from 'react-i18next';
import { useContactDetail } from '../../hooks/useContactDetail';
import Nui from '../../../../os/nui-events/utils/Nui';
export const InfoModal = () => {
const classes = useStyles();
const { showContactModal, setShowContactModal } = useContactModal();
const { t } = useTranslation();
const { contactDetail, setContactDetail } = useContactDetail();
const [display, setDisplay] = useState(
contactDetail ? contactDetail.display : ''
);
console.log(contactDetail);
const [number, setNumber] = useState(
contactDetail ? contactDetail.number : ''
);
const [avatar, setAvatar] = useState(
contactDetail ? contactDetail.avatar : ''
);
const closeModal = () => {
setShowContactModal(false);
setContactDetail(null);
};
const updateContact = () => {
Nui.send('phone:updateContact', {
id: contactDetail.id,
display,
number,
avatar,
});
setContactDetail(null);
setShowContactModal(false);
};
const deleteContact = () => {
Nui.send('phone:deleteContact', {
id: contactDetail.id,
});
setContactDetail(null);
setShowContactModal(false);
};
return (
<Slide direction='up' in={showContactModal}>
<Paper
className={showContactModal ? classes.modalRoot : classes.modalHide}
square
>
<Button style={{ margin: 10 }} onClick={closeModal}>
<ArrowBackIcon fontSize='large' />
</Button>
<div className={classes.listContainer}>
<MuiAvatar className={classes.avatar} src={avatar} />
<TextField
className={classes.input}
value={display}
onChange={(e) => setDisplay(e.target.value)}
placeholder={t('APPS_CONTACT_FORM_NAME')}
fullWidth
inputProps={{
className: classes.inputProps,
}}
/>
<TextField
className={classes.input}
value={number}
onChange={(e) => setNumber(e.target.value)}
placeholder={t('APPS_CONTACT_FORM_NUMBER')}
fullWidth
inputProps={{
className: classes.inputProps,
}}
/>
<TextField
className={classes.input}
placeholder={t('APPS_CONTACT_FORM_AVATAR')}
fullWidth
value={avatar}
onChange={(e) => setAvatar(e.target.value)}
inputProps={{
className: classes.inputProps,
}}
/>
<div style={{ display: 'block' }}>
<Button onClick={updateContact} className={classes.updateButton}>
{t('GENERIC_UPDATE')}
</Button>
<Button onClick={deleteContact} className={classes.deleteButton}>
{t('GENERIC_DELETE')}
</Button>
</div>
</div>
</Paper>
</Slide>
);
};
@@ -1,49 +0,0 @@
import { makeStyles } from '@material-ui/core';
const useStyles = makeStyles((theme) => ({
modalRoot: {
zIndex: 10,
position: 'absolute',
height: '100%',
width: '100%',
},
modalHide: {
display: 'none',
},
listContainer: {
marginTop: 30,
width: '75%',
margin: '0 auto',
textAlign: 'center',
},
avatar: {
margin: 'auto',
height: '125px',
width: '124px',
marginBottom: 29,
},
input: {
marginBottom: 20,
margin: 'auto',
textAlign: 'center',
},
inputProps: {
fontSize: 22,
},
updateButton: {
background: '#2196f3',
width: 150,
height: 45,
fontSize: 16,
marginTop: 29,
marginBottom: 29,
},
deleteButton: {
background: '#d32f2f',
width: 150,
height: 40,
fontSize: 16,
},
}));
export default useStyles;
@@ -1,45 +0,0 @@
import { makeStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => ({
button: {
margin: 5,
marginTop: 20,
},
root: {
position: 'fixed',
bottom: 380,
zIndex: 2,
background: '#232323',
marginLeft: '-4em',
height: '20%',
},
clearButton: {
width: '10%',
position: 'absolute',
right: 0,
},
textInputField: {
fontSize: 20,
borderBottomColor: 'red',
},
addBtn: {
margin: 'auto',
fontSize: 16,
width: 150,
background: '#2196f3',
marginBottom: 10,
padding: 8,
},
cancelBtn: {
margin: 'auto',
width: 150,
background: '#232323',
marginBottom: 20,
padding: 8,
},
icons: {
marginRight: 5,
},
}));
export default useStyles;
@@ -1,35 +0,0 @@
import { makeStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => ({
backgroundModal: {
background: 'black',
opacity: '0.6',
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
zIndex: 5,
},
absolute: {
position: 'absolute',
bottom: theme.spacing(2),
left: theme.spacing(3),
},
// title
root: {
height: '60px',
width: '100%',
display: 'flex',
flexFlow: 'row nowrap',
justifyContent: 'center',
alignItems: 'center',
background: '#424242',
},
icon: {
color: '#fff',
fontSize: 30,
},
}));
export default useStyles;
@@ -0,0 +1,197 @@
import React, { useState } from 'react';
import {
Avatar as MuiAvatar,
Button,
Paper,
TextField,
} from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { useTranslation } from 'react-i18next';
import { useHistory, useParams } from 'react-router-dom';
import { useContacts } from '../../hooks/useContacts';
import Nui from '../../../../os/nui-events/utils/Nui';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
interface ContactInfoRouteParams {
mode: string;
id: string;
}
const useStyles = makeStyles((theme: Theme) => ({
root: {
height: '100%',
width: '100%',
},
listContainer: {
marginTop: 30,
width: '75%',
margin: '0 auto',
textAlign: 'center',
},
avatar: {
margin: 'auto',
height: '125px',
width: '124px',
marginBottom: 29,
},
input: {
marginBottom: 20,
margin: 'auto',
textAlign: 'center',
},
inputProps: {
fontSize: 22,
},
updateButton: {
background: '#2196f3',
width: 150,
height: 45,
fontSize: 16,
marginTop: 29,
marginBottom: 29,
},
deleteButton: {
background: '#d32f2f',
width: 150,
height: 40,
fontSize: 16,
},
saveButton: {
background: theme.palette.success.dark,
color: '#fff',
width: 150,
height: 45,
fontsize: 22,
marginTop: theme.spacing(2),
},
}));
const ContactsInfoPage = () => {
const classes = useStyles();
const history = useHistory();
const { getContact } = useContacts();
const { id } = useParams<ContactInfoRouteParams>();
const contact = getContact(parseInt(id));
// Set state after checking if null
const [name, setName] = useState(contact ? contact.display : contact);
const [number, setNumber] = useState(contact ? contact.number : contact);
const [avatar, setAvatar] = useState(contact ? contact.avatar : contact);
const { t } = useTranslation();
const handleContactAdd = () => {
LogDebugEvent({
action: 'Handling Contact Add',
data: contact,
level: 2,
});
Nui.send('phone:addContact', {
name,
number,
avatar,
});
};
const handleContactSave = () => {
LogDebugEvent({
action: 'Handling Contact Update',
data: contact,
level: 2,
});
Nui.send('phone:updateContact', {
id: contact.id,
display: name,
number,
avatar,
});
};
const handleContactDelete = () => {
LogDebugEvent({
action: 'Handling Contact Delete',
data: contact,
level: 2,
});
Nui.send('phone:deleteContact', {
id: contact.id,
});
};
return (
<Paper className={classes.root} square>
<Button style={{ margin: 10 }} onClick={() => history.goBack()}>
<ArrowBackIcon fontSize='large' />
</Button>
<div className={classes.listContainer}>
{avatar ? (
<MuiAvatar className={classes.avatar} src={contact.avatar} />
) : (
<MuiAvatar className={classes.avatar} />
)}
<TextField
className={classes.input}
value={name}
onChange={(e) => setName(e.target.value)}
placeholder={t('APPS_CONTACT_FORM_NAME')}
fullWidth
inputProps={{
className: classes.inputProps,
}}
/>
<TextField
className={classes.input}
value={number}
onChange={(e) => setNumber(e.target.value)}
placeholder={t('APPS_CONTACT_FORM_NUMBER')}
fullWidth
inputProps={{
className: classes.inputProps,
}}
/>
<TextField
className={classes.input}
placeholder={t('APPS_CONTACT_FORM_AVATAR')}
fullWidth
value={avatar}
onChange={(e) => setAvatar(e.target.value)}
inputProps={{
className: classes.inputProps,
}}
/>
{/* Display if fetched contact */}
{contact && (
<div style={{ display: 'block' }}>
<Button
onClick={handleContactSave}
className={classes.updateButton}
>
{t('GENERIC_UPDATE')}
</Button>
<Button
onClick={handleContactDelete}
className={classes.deleteButton}
>
{t('GENERIC_DELETE')}
</Button>
</div>
)}
{/* Display if no fetched contact */}
{!contact && (
<div style={{ display: 'block' }}>
<Button onClick={handleContactAdd} className={classes.saveButton}>
{t('APPS_CONTACT_MODAL_BUTTON_ADD')}
</Button>
</div>
)}
</div>
</Paper>
);
};
export default ContactsInfoPage;
@@ -0,0 +1,37 @@
import React from 'react';
import { ContactList } from '../List/ContactList';
import Fab from '@material-ui/core/Fab';
import PersonAddIcon from '@material-ui/icons/PersonAdd';
import { useHistory } from 'react-router-dom';
import { makeStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => ({
absolute: {
position: 'absolute',
bottom: theme.spacing(2),
right: theme.spacing(2),
},
icon: {
color: '#fff',
fontSize: 30,
},
}));
export const ContactPage = () => {
const history = useHistory();
const classes = useStyles();
return (
<>
<ContactList />
<Fab
onClick={() => history.push('/contacts/add')}
style={{ backgroundColor: '#2196f3', color: '#fff' }}
className={classes.absolute}
>
<PersonAddIcon />
</Fab>
</>
);
};
@@ -1,15 +0,0 @@
import { useRecoilState } from 'recoil';
import { ContactProps } from '../../../common/typings/contact';
import { contactsState } from './state';
interface ContactDetailProps {
contactDetail: ContactProps;
setContactDetail: (contact: object) => void;
}
export const useContactDetail = (): ContactDetailProps => {
const [ contactDetail, setContactDetail ] = useRecoilState(contactsState.contactDetail);
return { contactDetail, setContactDetail };
};
@@ -1,12 +0,0 @@
import { useRecoilState } from 'recoil';
import { contactsState } from './state';
interface ModalProps {
showContactModal: boolean;
setShowContactModal: (show: boolean) => void;
}
export const useContactModal = (): ModalProps => {
const [ showContactModal, setShowContactModal ] = useRecoilState(contactsState.showContactsModal);
return { showContactModal, setShowContactModal };
};
+19 -7
View File
@@ -1,19 +1,31 @@
import { useRecoilValue } from 'recoil';
import { contactsState } from './state';
import { ContactProps } from '../../../common/typings/contact';
import { Contact } from '../../../common/typings/contact';
import { useCallback } from 'react';
interface IUseContacts {
contacts: ContactProps[]
contacts: Contact[];
getDisplayByNumber: (number: string) => string;
getContact: (id: number) => Contact;
}
export const useContacts = (): IUseContacts => {
const contacts = useRecoilValue(contactsState.contacts);
const getDisplayByNumber = useCallback((number: string) => {
const found = contacts.find((contact) => contact.number === number)
return found ? found.display : number
}, [contacts])
return { contacts, getDisplayByNumber };
const getDisplayByNumber = useCallback(
(number: string) => {
const found = contacts.find((contact) => contact.number === number);
return found ? found.display : number;
},
[contacts]
);
const getContact = useCallback(
(id: number): Contact | null => {
for (const contact of contacts) {
if (contact.id === id) return contact;
}
},
[contacts]
);
return { contacts, getDisplayByNumber, getContact };
};
@@ -1,20 +1,20 @@
import React from 'react';
import { AppWrapper } from '../../../ui/components';
import { AppTitle } from '../../../ui/components/AppTitle';
import { AppContent } from '../../../ui/components/AppContent';
import { useApp } from '../../../os/apps/hooks/useApps';
import { useExample } from '../hooks/useExample';
export const ExampleApp = () => {
// calling the example hook, and we assign the value to a variable
const exampleString = useExample();
const example = useApp('EXAMPLE');
return (
<AppWrapper>
<AppTitle app={example} />
<AppContent>
<h1>This is an example</h1>
<h2>{example.id}</h2>
{/* Here we are using the value in a h3 tag */}
<h3>{exampleString}</h3>
</AppContent>
+10 -12
View File
@@ -15,7 +15,6 @@ import { useNoteDetail } from './hooks/useNoteDetail';
import useStyles from './notes.styles';
import InjectDebugData from '../../os/debug/InjectDebugData';
import { NotesAlert } from './alert/NotesAlert';
InjectDebugData([
{
@@ -33,7 +32,7 @@ InjectDebugData([
content: 'Hello, this is another shitty note',
},
],
}
},
]);
export const NotesApp = () => {
@@ -57,16 +56,15 @@ export const NotesApp = () => {
<NoteList notes={notes} />
</AppContent>
<Fab
className={classes.absolute}
onClick={handleModal}
style={{
background: '#f9a825',
color: '#fff',
}}
>
<AddIcon />
</Fab>
<NotesAlert />
className={classes.absolute}
onClick={handleModal}
style={{
background: '#f9a825',
color: '#fff',
}}
>
<AddIcon />
</Fab>
</AppWrapper>
);
};
-62
View File
@@ -1,62 +0,0 @@
import React, { useState, useEffect, useCallback } from 'react'
import { Snackbar } from '@material-ui/core';
import { Alert } from '../../../ui/components/Alert';
import { AlertCategory } from '../../../common/typings/notes';
import { useTranslation } from 'react-i18next';
import { useNotesAlert } from '../hooks/useNoteAlert';
const LOCALE_PREFIX = 'APPS_';
export const NotesAlert = () => {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
const { alert, setAlert } = useNotesAlert();
const [message, setMessage] = useState(null);
const [severity, setSeverity] = useState('');
const _handleClose = () => {
setOpen(false)
setAlert(null)
}
const setMessageAlert = useCallback((type: AlertCategory, severity: 'success' | 'error') => {
setMessage(t(LOCALE_PREFIX + type));
setSeverity(severity)
setOpen(true)
}, [t])
useEffect(() => {
switch (alert) {
case 'NOTES_ADD_SUCCESS':
setMessageAlert(alert, 'success');
break;
case 'NOTES_ADD_FAILED':
setMessageAlert(alert, 'error');
break;
case 'NOTES_UPDATE_SUCCESS':
setMessageAlert(alert, 'success');
break;
case 'NOTES_UPDATE_FAILED':
setMessageAlert(alert, 'error');
break;
case 'NOTES_DELETE_SUCCESS':
setMessageAlert(alert, 'success');
break;
case 'NOTES_DELETE_FAILED':
setMessageAlert(alert, 'error')
}
}, [alert, setMessageAlert])
return (
<Snackbar
style={{ width: '80%', position: 'absolute', bottom: '10%' }}
autoHideDuration={1500}
open={open}
onClose={_handleClose}
>
<Alert severity={severity} variant='filled'>
{message}
</Alert>
</Snackbar>
)
}
@@ -1,8 +0,0 @@
import { useRecoilState } from 'recoil';
import { INotesAlert } from '../../../common/typings/notes';
import { noteStates } from './state';
export const useNotesAlert = (): INotesAlert => {
const [alert, setAlert] = useRecoilState(noteStates.alert)
return { alert, setAlert }
}
@@ -2,12 +2,13 @@ import { useSetRecoilState } from 'recoil';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { useNotes } from './useNotes';
import { noteStates } from './state';
import { useNotesAlert } from './useNoteAlert';
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
export const useNotesService = () => {
const { addAlert } = useSnackbar();
const setNotes = useSetRecoilState(noteStates.noteItems);
const setAlert = useSetRecoilState(noteStates.alert);
useNuiEvent('NOTES', 'setNotes', setNotes);
useNuiEvent('NOTES', 'setAlert', setAlert)
return { useNotes, useNotesAlert };
useNuiEvent('NOTES', 'setAlert', addAlert);
return useNotes();
};
+1 -1
View File
@@ -1,5 +1,5 @@
import { Button, TextField, Slide } from '@material-ui/core';
import React, { useState, useEffect } from 'react';
import React, { useState } from 'react';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import { useNoteModal } from '../hooks/useNoteModal';
@@ -37,6 +37,18 @@ InjectDebugData([
app: 'TWITTER',
method: 'fetchTweets',
data: [
{
id: 59,
message: 'XSS\n<script src="test.js">Test</script>\nBro',
avatar_url: 'http://i.tasoagc.dev/jtKL',
seconds_since_tweet: 500,
isMine: false,
updateAt: '2021-02-08 14:37:46',
visible: 1,
likes: 50000,
profile_name: 'jQuery Main',
images: 'http://i.tasoagc.dev/0xdp',
},
{
id: 2,
message: 'GCPhone will never die',
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { makeStyles } from '@material-ui/core/styles';
import { TextField } from '@material-ui/core';
const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles({
textField: {
flex: '1 1 100%',
padding: '10px 15px',
@@ -12,7 +12,7 @@ const useStyles = makeStyles((theme) => ({
textFieldInput: {
fontSize: '22px',
},
}));
});
export const ImagePrompt = ({ visible, value, handleChange }) => {
const textFieldRef = useRef(null);
@@ -23,7 +23,10 @@ export const ImagePrompt = ({ visible, value, handleChange }) => {
textFieldRef.current && textFieldRef.current.focus();
}, [visible]);
const handleImageChange = useCallback(e => handleChange(e.target.value), []);
const handleImageChange = useCallback(
(e) => handleChange(e.target.value),
[handleChange]
);
if (!visible) return null;
return (
@@ -7,7 +7,6 @@ import {
ListItem,
Typography,
} from '@material-ui/core';
import { secondsToHumanReadable } from '../../utils/time';
import LikeButton from '../buttons/LikeButton';
import ReplyButton from '../buttons/ReplyButton';
@@ -16,6 +15,7 @@ import Avatar from '../Avatar';
import ShowMore from './ShowMore';
import { QuoteButton } from '../buttons/QuoteButton';
import { usePhone } from '../../../../os/phone/hooks/usePhone';
import DOMPurify from 'dompurify';
const useStyles = makeStyles(() => ({
root: {
@@ -80,7 +80,16 @@ export const Tweet = (tweet) => {
// this is a workaround to transfer string new lines and returns that
// are stored into the database into html for the UI to render
// We are replacing with <br /> to eventually render in HTML
const formattedMessage = message.replace(/\n\r?/g, '<br />');
// Therefore we need to sanitize this message to protect against XSS
const sanitizedMessage = DOMPurify.sanitize(formattedMessage, {
// Be as strict as possible, whitelisting <br> tag
ALLOWED_TAGS: ['br'],
});
const profileName = profile_name ? `@${profile_name}` : '';
return (
@@ -106,7 +115,9 @@ export const Tweet = (tweet) => {
</div>
<div
className={classes.message}
dangerouslySetInnerHTML={{ __html: formattedMessage }}
dangerouslySetInnerHTML={{
__html: sanitizedMessage,
}}
/>
{enableImages && <ImageDisplay visible images={images} small />}
<div className={classes.buttonContainer}>
@@ -43,9 +43,6 @@ export const useTwitterService = () => {
);
const setNotification = useSetRecoilState(twitterState.notification);
const _setProfile = (profile) => {
setProfile(profile);
};
const _setUpdateProfileSuccess = (isSuccessful) => {
setUpdateProfileSuccess(isSuccessful);
setUpdateProfileLoading(false); // on any result we should set loading to false
@@ -56,10 +53,6 @@ export const useTwitterService = () => {
setCreateLoading(false);
};
const _setNotification = (tweet) => {
setNotification(tweet);
};
const _setTweets = (tweets) => {
setTweets(tweets.map(processTweet));
};
@@ -67,12 +60,12 @@ export const useTwitterService = () => {
setFilteredTweets(tweets.map(processTweet));
};
useNuiEvent(APP_TWITTER, 'getOrCreateTwitterProfile', _setProfile);
useNuiEvent(APP_TWITTER, 'getOrCreateTwitterProfile', setProfile);
useNuiEvent(APP_TWITTER, 'updateProfileLoading', setUpdateProfileLoading);
useNuiEvent(APP_TWITTER, 'updateProfileResult', _setUpdateProfileSuccess);
useNuiEvent(APP_TWITTER, 'fetchTweets', _setTweets);
useNuiEvent(APP_TWITTER, 'fetchTweetsFiltered', _setFilteredTweets);
useNuiEvent(APP_TWITTER, 'createTweetLoading', setCreateLoading);
useNuiEvent(APP_TWITTER, 'createTweetResult', _setCreateSuccess);
useNuiEvent(APP_TWITTER, 'createTweetBroadcast', _setNotification);
useNuiEvent(APP_TWITTER, 'createTweetBroadcast', setNotification);
};
+1 -1
View File
@@ -25,7 +25,7 @@ interface BankConfig {
showNotifications: boolean;
}
export interface ServerConfig {
export interface IServerConfig {
Locale: string;
KeyTogglePhone: number;
KeyTakeCall: number;
+4 -4
View File
@@ -11,9 +11,9 @@ export interface IContactAlert {
setAlert: (type: string) => void;
}
export interface ContactProps {
id: string;
export interface Contact {
id: number;
display: string;
number: string;
avatar?: string
}
avatar?: string;
}
+33
View File
@@ -0,0 +1,33 @@
{
"Locale": "en",
"KeyTogglePhone": 288,
"KeyTakeCall": 38,
"PhoneAsItem": false,
"SwimDestroy": false,
"RunRate": 10,
"DestoryChance": 100,
"DestroyPhoneReCheck": 3,
"notificationPosition": {
"horizontal": "right",
"vertical": "top"
},
"general": {
"useDashNumber": true
},
"twitter": {
"showNotifications": true,
"generateProfileNameFromUsers": true,
"allowEdtiableProfileName": true,
"allowDeleteTweets": true,
"allowReportTweets": true,
"characterLimit": 160,
"newLineLimit": 10,
"enableAvatars": true,
"enableEmojis": true,
"enableImages": true,
"maxImages": 3
},
"bank": {
"showNotifications": true
}
}
+4 -1
View File
@@ -10,6 +10,7 @@ import Phone from './Phone';
import TwitterNotification from './apps/twitter/components/notification/TwitterNotification';
import { BankNotification } from './apps/bank/components/notification/BankNotification';
import PhoneConfig from './config/default.json';
import SnackbarProvider from './ui/components/SnackbarProvider';
// Enable Sentry when config setting is true
if (PhoneConfig.SentryErrorMetrics) {
@@ -29,7 +30,9 @@ ReactDOM.render(
<RecoilRoot>
<TwitterNotification />
<BankNotification />
<Phone />
<SnackbarProvider>
<Phone />
</SnackbarProvider>
</RecoilRoot>
</HashRouter>,
document.getElementById('root')
+16
View File
@@ -1,6 +1,10 @@
{
"translation": {
"DATE_FORMAT": "DD/MM/AAAA",
"DATE_TIME_FORMAT": "DD/MM/AAAA hh:mm A",
"COMING_SOON": "En cours...",
"APPS_DIALER": "Téléphone",
"APPS_CONTACTS": "Contacts",
"APPS_MESSAGES": "Messages",
@@ -9,6 +13,10 @@
"APPS_BANK": "WhoDis Banque",
"APPS_NOTES": "Notes",
"APPS_EXAMPLE": "App test",
"APPS_TWITTER": "Twitter",
"APPS_SELLOUT": "Marché",
"APPS_CAMERA": "Caméra",
"APPS_BANK_TRANSFER": "Transfert",
"APPS_SETTINGS_OPTIONS_WALLPAPER": "Fond d'écran",
"APPS_SETTINGS_OPTIONS_FRAME": "Cadre/Coque",
@@ -75,6 +83,13 @@
"APPS_CONTACT_MODAL_PLACEHOLDER_NUMBER": "Numéro",
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Photo",
"APPS_CONTACT_MODAL_BUTTON_ADD": "Ajouter un contact",
"APPS_NOTES_ADD_SUCCESS": "Note sauvegardée avec succès.",
"APPS_NOTES_ADD_FAILED": "Erreur lors de la suppression d'une note.",
"APPS_NOTES_UPDATE_SUCCESS": "Mise à jour d'une note réalisée avec succès.",
"APPS_NOTES_UPDATE_FAILED": "Erreur lors de la mise à jour d'une note.",
"APPS_NOTES_DELETE_SUCCESS": "Note supprimée avec succès.",
"APPS_NOTES_DELETE_FAILED": "Erreur lors de la suppression d'une note.",
"APPS_SETTINGS_PHONE_NUMBER": "Numéro de téléphone",
"APPS_SETTINGS_OPTION_WALLPAPER": "Fond d'écran",
@@ -84,6 +99,7 @@
"APPS_SETTINGS_OPTION_RINGTONE": "Sonnerie",
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Volume de la sonnerie",
"GENERIC_SAVE": "Sauvegarder",
"GENERIC_UPDATE": "Mettre à jour",
"GENERIC_DELETE": "Supprimer"
}
+1 -1
View File
@@ -55,7 +55,7 @@ type AppsRepository = { preinstalled: IAppConfig[] };
const AppWithStartup = ({ children, id }) => {
useEffect(() => {
Nui.send(`phone:app:${id}`);
}, []);
}, [id]);
return children;
};
@@ -23,6 +23,7 @@ export const useNuiEvent = (
options: IOptions = {},
currentState?: Record<string, unknown>
) => {
const savedHandler: MutableRefObject<any> = useRef();
// Destructure passed options
const { capture, passive, once } = options;
+1 -1
View File
@@ -2,7 +2,7 @@
export default {
async send(event: any, data = {}) {
/* eslint-disable no-unreachable */
return fetch(`http://new-phone-who-dis/${event}`, {
return fetch(`https://new-phone-who-dis/${event}`, {
method: 'post',
headers: {
'Content-Type': 'application/json; charset=UTF-8',
+4 -4
View File
@@ -1,14 +1,14 @@
import { useRecoilValue } from 'recoil';
import { phoneState } from './state';
import { ServerConfig } from '../../../common/typings/config';
import { IServerConfig } from '../../../common/typings/config';
import ServerConfig from '../../../config.autogen.json';
interface IUsePhone {
visibility: boolean;
config?: ServerConfig;
config?: IServerConfig;
}
export const usePhone = (): IUsePhone => {
const visibility = useRecoilValue(phoneState.visibility);
const config = useRecoilValue(phoneState.phoneConfig);
return { visibility, config };
return { visibility, config: ServerConfig as any };
};
+1 -1
View File
@@ -2,7 +2,7 @@ import React from 'react';
import MuiAlert from '@material-ui/lab/Alert';
export function Alert(props) {
return <MuiAlert elevation={6} variant='filled' {...props} />;
return <MuiAlert style={{ zIndex: 10000 }} elevation={6} variant='filled' {...props} />;
}
export default Alert;
-1
View File
@@ -3,7 +3,6 @@ import { makeStyles } from '@material-ui/core/styles';
import Avatar from '@material-ui/core/Avatar';
import { green } from '@material-ui/core/colors';
import { Button } from '@material-ui/core';
import Nui from '../../os/nui-events/utils/Nui';
interface IStyles {
root: any;
@@ -0,0 +1,33 @@
import React, { createContext, useState, useEffect, useRef } from 'react';
export const SnackbarContext = createContext(null);
function SnackbarProvider({ children }) {
const [alert, setAlert] = useState(null);
const timer = useRef(null);
useEffect(() => {
if (alert) {
clearTimeout(timer.current)
timer.current = setTimeout(() => {
setAlert(null)
}, 1000);
}
return () => clearTimeout(timer.current)
}, [alert]);
const addAlert = (value) => setAlert(value);
const value = { addAlert, alert }
return (
<SnackbarContext.Provider value={value}>
<>
{children}
</>
</SnackbarContext.Provider>
)
}
export default SnackbarProvider;
+15
View File
@@ -0,0 +1,15 @@
import { useContext } from 'react';
import { SnackbarContext } from '../components/SnackbarProvider';
export interface IAlert {
message: string;
type: 'success' | 'error'
}
interface ISnackBar {
addAlert: ({ message, type}: IAlert) => void;
alert: IAlert | null;
}
export const useSnackbar = (): ISnackBar => useContext(SnackbarContext);
+1 -1
View File
@@ -12,4 +12,4 @@ export interface AppWrapperTypes {
children?: JSX.Element | JSX.Element[];
style?: CSSProperties;
handleClickAway?: (...args: any[]) => void;
}
}
+153 -9
View File
@@ -3649,6 +3649,15 @@ cli-width@^3.0.0:
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6"
integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==
cliui@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49"
integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==
dependencies:
string-width "^2.1.1"
strip-ansi "^4.0.0"
wrap-ansi "^2.0.0"
cliui@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5"
@@ -3709,6 +3718,11 @@ coa@^2.0.2:
chalk "^2.4.1"
q "^1.1.2"
code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
collection-visit@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
@@ -4024,6 +4038,14 @@ cosmiconfig@^7.0.0:
path-type "^4.0.0"
yaml "^1.10.0"
cp-cli@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/cp-cli/-/cp-cli-2.0.0.tgz#0707ca60bcbf20884b16c2c110484263fa7f922d"
integrity sha512-UfGOwpKeEVfdT+RFBGqlXTPZfHSJn31vaIOvr/YXLk494k6/xWUbN8+YZ2EvM6G8C8dGaU2Hy0nBmYCR5ux15g==
dependencies:
fs-extra "7.0.1"
yargs "12.0.5"
cra-build-watch@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/cra-build-watch/-/cra-build-watch-3.2.0.tgz#a7bbd470fd3239214d4d64b20aae40d2c39c5622"
@@ -4790,6 +4812,11 @@ domhandler@^2.3.0:
dependencies:
domelementtype "1"
dompurify@^2.2.6:
version "2.2.6"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.2.6.tgz#54945dc5c0b45ce5ae228705777e8e59d7b2edc4"
integrity sha512-7b7ZArhhH0SP6W2R9cqK6RjaU82FZ2UPM7RO8qN1b1wyvC/NY1FNWcX1Pu00fFOAnzEORtwXe4bPaClg6pUybQ==
[email protected]:
version "1.5.1"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
@@ -5939,19 +5966,19 @@ from2@^2.1.0:
inherits "^2.0.1"
readable-stream "^2.0.0"
fs-extra@^4.0.2:
version "4.0.3"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==
[email protected], fs-extra@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
dependencies:
graceful-fs "^4.1.2"
jsonfile "^4.0.0"
universalify "^0.1.0"
fs-extra@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
fs-extra@^4.0.2:
version "4.0.3"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==
dependencies:
graceful-fs "^4.1.2"
jsonfile "^4.0.0"
@@ -6040,6 +6067,11 @@ gensync@^1.0.0-beta.1:
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269"
integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==
get-caller-file@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
get-caller-file@^2.0.1:
version "2.0.5"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
@@ -6931,6 +6963,11 @@ invariant@^2.2.2, invariant@^2.2.4:
dependencies:
loose-envify "^1.0.0"
invert-kv@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==
ip-regex@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
@@ -7104,6 +7141,13 @@ is-extglob@^2.1.0, is-extglob@^2.1.1:
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
is-fullwidth-code-point@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs=
dependencies:
number-is-nan "^1.0.0"
is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
@@ -8136,6 +8180,13 @@ lazy-cache@^1.0.3:
resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4=
lcid@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf"
integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==
dependencies:
invert-kv "^2.0.0"
left-pad@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
@@ -8463,6 +8514,13 @@ mamacro@^0.0.3:
resolved "https://registry.yarnpkg.com/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4"
integrity sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==
map-age-cleaner@^0.1.1:
version "0.1.3"
resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a"
integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==
dependencies:
p-defer "^1.0.0"
map-cache@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
@@ -8516,6 +8574,15 @@ [email protected]:
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
mem@^4.0.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178"
integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==
dependencies:
map-age-cleaner "^0.1.1"
mimic-fn "^2.0.0"
p-is-promise "^2.0.0"
memory-fs@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552"
@@ -8645,7 +8712,7 @@ mime@^2.0.3, mime@^2.4.4:
resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.6.tgz#e5b407c90db442f2beb5b162373d07b69affa4d1"
integrity sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==
mimic-fn@^2.1.0:
mimic-fn@^2.0.0, mimic-fn@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
@@ -9053,6 +9120,11 @@ num2fraction@^1.2.2:
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"
integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=
number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
nwsapi@^2.0.7, nwsapi@^2.1.3:
version "2.2.0"
resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7"
@@ -9258,6 +9330,15 @@ os-browserify@^0.3.0:
resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=
os-locale@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a"
integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==
dependencies:
execa "^1.0.0"
lcid "^2.0.0"
mem "^4.0.0"
os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
@@ -9267,6 +9348,11 @@ p-cancelable@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc"
integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==
p-defer@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c"
integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=
p-each-series@^1.0.0:
version "1.0.0"
@@ -9280,6 +9366,11 @@ p-finally@^1.0.0:
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=
p-is-promise@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e"
integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==
p-limit@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
@@ -11261,6 +11352,11 @@ require-directory@^2.1.1:
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
require-main-filename@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=
require-main-filename@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
@@ -12146,6 +12242,15 @@ string-length@^3.1.0:
astral-regex "^1.0.0"
strip-ansi "^5.2.0"
string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
dependencies:
code-point-at "^1.0.0"
is-fullwidth-code-point "^1.0.0"
strip-ansi "^3.0.0"
string-width@^2.0.0, string-width@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
@@ -13459,6 +13564,14 @@ worker-rpc@^0.1.0:
dependencies:
microevent.ts "~0.1.1"
wrap-ansi@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=
dependencies:
string-width "^1.0.1"
strip-ansi "^3.0.1"
wrap-ansi@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09"
@@ -13553,6 +13666,11 @@ xtend@^4.0.0, xtend@~4.0.1:
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
"y18n@^3.2.1 || ^4.0.0":
version "4.0.1"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4"
integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==
y18n@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
@@ -13578,6 +13696,14 @@ yaml@^1.10.0, yaml@^1.7.2:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e"
integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==
yargs-parser@^11.1.1:
version "11.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4"
integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"
yargs-parser@^13.1.2:
version "13.1.2"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38"
@@ -13594,6 +13720,24 @@ yargs-parser@^16.1.0:
camelcase "^5.0.0"
decamelize "^1.2.0"
[email protected]:
version "12.0.5"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13"
integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==
dependencies:
cliui "^4.0.0"
decamelize "^1.2.0"
find-up "^3.0.0"
get-caller-file "^1.0.1"
os-locale "^3.0.0"
require-directory "^2.1.1"
require-main-filename "^1.0.1"
set-blocking "^2.0.0"
string-width "^2.0.0"
which-module "^2.0.0"
y18n "^3.2.1 || ^4.0.0"
yargs-parser "^11.1.1"
yargs@^13.3.0, yargs@^13.3.2:
version "13.3.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"