Removed GopherJS, basic frontend completed, need backend changes for

torrent storage
This commit is contained in:
2017-11-30 18:12:11 -05:00
parent 67fdef16b1
commit e98ad2cc88
69321 changed files with 5498914 additions and 337 deletions

View File

@@ -0,0 +1,24 @@
import * as React from 'react';
import { StandardProps } from '..';
export interface ListProps extends StandardProps<
React.HTMLAttributes<HTMLUListElement>,
ListClassKey
> {
component?: React.ReactType;
dense?: boolean;
disablePadding?: boolean;
rootRef?: React.Ref<any>;
subheader?: React.ReactElement<any>;
}
export type ListClassKey =
| 'root'
| 'padding'
| 'dense'
| 'subheader'
;
declare const List: React.ComponentType<ListProps>;
export default List;

View File

@@ -0,0 +1,77 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
root: {
flex: '1 1 auto',
listStyle: 'none',
margin: 0,
padding: 0,
position: 'relative'
},
padding: {
paddingTop: theme.spacing.unit,
paddingBottom: theme.spacing.unit
},
dense: {
paddingTop: theme.spacing.unit / 2,
paddingBottom: theme.spacing.unit / 2
},
subheader: {
paddingTop: 0
}
});
class List extends React.Component {
getChildContext() {
return {
dense: this.props.dense
};
}
render() {
const _props = this.props,
{
classes,
className: classNameProp,
component: ComponentProp,
disablePadding,
children,
dense,
subheader,
rootRef
} = _props,
other = _objectWithoutProperties(_props, ['classes', 'className', 'component', 'disablePadding', 'children', 'dense', 'subheader', 'rootRef']);
const className = classNames(classes.root, {
[classes.dense]: dense && !disablePadding,
[classes.padding]: !disablePadding,
[classes.subheader]: subheader
}, classNameProp);
return React.createElement(
ComponentProp,
_extends({ className: className }, other, { ref: rootRef }),
subheader,
children
);
}
}
List.defaultProps = {
component: 'ul',
dense: false,
disablePadding: false
};
List.childContextTypes = {
dense: PropTypes.bool
};
export default withStyles(styles, { name: 'MuiList' })(List);

View File

@@ -0,0 +1,31 @@
import * as React from 'react';
import { StandardProps, Replace } from '..';
import { ButtonBaseProps, ButtonBaseClassKey } from '../ButtonBase';
export interface ListItemProps extends StandardProps<
Replace<ButtonBaseProps, React.LiHTMLAttributes<HTMLLIElement>>,
ListItemClassKey
> {
button?: boolean;
component?: React.ReactType;
dense?: boolean;
disabled?: boolean;
disableGutters?: boolean;
divider?: boolean;
}
export type ListItemClassKey =
| ButtonBaseClassKey
| 'container'
| 'keyboardFocused'
| 'default'
| 'dense'
| 'divider'
| 'gutters'
| 'button'
| 'secondaryAction'
;
declare const ListItem: React.ComponentType<ListItemProps>;
export default ListItem;

View File

@@ -0,0 +1,151 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import ButtonBase from '../ButtonBase';
import { isMuiElement } from '../utils/reactHelpers';
export const styles = theme => ({
root: {
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center',
position: 'relative',
textDecoration: 'none'
},
container: {
position: 'relative'
},
keyboardFocused: {
background: theme.palette.text.divider
},
default: {
paddingTop: 12,
paddingBottom: 12
},
dense: {
paddingTop: theme.spacing.unit,
paddingBottom: theme.spacing.unit
},
disabled: {
opacity: 0.5
},
divider: {
borderBottom: `1px solid ${theme.palette.text.lightDivider}`
},
gutters: {
paddingLeft: theme.spacing.unit * 2,
paddingRight: theme.spacing.unit * 2
},
button: {
transition: theme.transitions.create('background-color', {
duration: theme.transitions.duration.shortest
}),
'&:hover': {
textDecoration: 'none',
backgroundColor: theme.palette.text.divider,
// Reset on mouse devices
'@media (hover: none)': {
backgroundColor: 'transparent'
},
'&$disabled': {
backgroundColor: 'transparent'
}
}
},
secondaryAction: {
// Add some space to avoid collision as `ListItemSecondaryAction`
// is absolutely positionned.
paddingRight: theme.spacing.unit * 4
}
});
class ListItem extends React.Component {
getChildContext() {
return {
dense: this.props.dense || this.context.dense || false
};
}
render() {
const _props = this.props,
{
button,
children: childrenProp,
classes,
className: classNameProp,
component: componentProp,
dense,
disabled,
divider,
disableGutters
} = _props,
other = _objectWithoutProperties(_props, ['button', 'children', 'classes', 'className', 'component', 'dense', 'disabled', 'divider', 'disableGutters']);
const isDense = dense || this.context.dense || false;
const children = React.Children.toArray(childrenProp);
const hasAvatar = children.some(value => isMuiElement(value, ['ListItemAvatar']));
const hasSecondaryAction = children.length && isMuiElement(children[children.length - 1], ['ListItemSecondaryAction']);
const className = classNames(classes.root, {
[classes.gutters]: !disableGutters,
[classes.divider]: divider,
[classes.disabled]: disabled,
[classes.button]: button,
[classes.secondaryAction]: hasSecondaryAction,
[isDense || hasAvatar ? classes.dense : classes.default]: true
}, classNameProp);
const listItemProps = _extends({ className, disabled }, other);
let ComponentMain = componentProp;
if (button) {
ComponentMain = ButtonBase;
listItemProps.component = componentProp || 'li';
listItemProps.keyboardFocusedClassName = classes.keyboardFocused;
}
if (hasSecondaryAction) {
return React.createElement(
'div',
{ className: classes.container },
React.createElement(
ComponentMain,
listItemProps,
children
),
children.pop()
);
}
return React.createElement(
ComponentMain,
listItemProps,
children
);
}
}
ListItem.defaultProps = {
button: false,
component: 'li',
dense: false,
disabled: false,
disableGutters: false,
divider: false
};
ListItem.contextTypes = {
dense: PropTypes.bool
};
ListItem.childContextTypes = {
dense: PropTypes.bool
};
export default withStyles(styles, { name: 'MuiListItem' })(ListItem);

View File

@@ -0,0 +1,12 @@
import { StandardProps } from '..';
export interface ListItemAvatarProps extends StandardProps<{}, ListItemAvatarClassKey> {}
export type ListItemAvatarClassKey =
| 'root'
| 'icon'
;
declare const ListItemAvatar: React.ComponentType<ListItemAvatarProps>;
export default ListItemAvatar;

View File

@@ -0,0 +1,51 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import warning from 'warning';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
root: {
width: 36,
height: 36,
fontSize: theme.typography.pxToRem(18),
marginRight: 4
},
icon: {
width: 20,
height: 20,
fontSize: theme.typography.pxToRem(20)
}
});
/**
* It's a simple wrapper to apply the `dense` mode styles to `Avatar`.
*/
function ListItemAvatar(props, context) {
if (context.dense === undefined) {
warning(false, `Material-UI: <ListItemAvatar> is a simple wrapper to apply the dense styles
to <Avatar>. You do not need it unless you are controlling the <List> dense property.`);
return props.children;
}
const { children, classes, className: classNameProp } = props,
other = _objectWithoutProperties(props, ['children', 'classes', 'className']);
return React.cloneElement(children, _extends({
className: classNames({ [classes.root]: context.dense }, classNameProp, children.props.className),
childrenClassName: classNames({ [classes.icon]: context.dense }, children.props.childrenClassName)
}, other));
}
ListItemAvatar.contextTypes = {
dense: PropTypes.bool
};
ListItemAvatar.muiName = 'ListItemAvatar';
export default withStyles(styles, { name: 'MuiListItemAvatar' })(ListItemAvatar);

View File

@@ -0,0 +1,11 @@
import { StandardProps } from '..';
export interface ListItemIconProps extends StandardProps<{}, ListItemIconClassKey> {}
export type ListItemIconClassKey =
| 'root'
;
declare const ListItemIcon: React.ComponentType<ListItemIconProps>;
export default ListItemIcon;

View File

@@ -0,0 +1,32 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
root: {
height: 24,
marginRight: theme.spacing.unit * 2,
width: 24,
color: theme.palette.action.active,
flexShrink: 0
}
});
/**
* A simple wrapper to apply `List` styles to an `Icon` or `SvgIcon`.
*/
function ListItemIcon(props) {
const { children, classes, className: classNameProp } = props,
other = _objectWithoutProperties(props, ['children', 'classes', 'className']);
return React.cloneElement(children, _extends({
className: classNames(classes.root, classNameProp, children.props.className)
}, other));
}
export default withStyles(styles, { name: 'MuiListItemIcon' })(ListItemIcon);

View File

@@ -0,0 +1,11 @@
import { StandardProps } from '..';
export interface ListItemSecondaryActionProps extends StandardProps<{}, ListItemSecondaryActionClassKey> {}
export type ListItemSecondaryActionClassKey =
| 'root'
;
declare const ListItemSecondaryAction: React.ComponentType<ListItemSecondaryActionProps>;
export default ListItemSecondaryAction;

View File

@@ -0,0 +1,29 @@
// weak
import React from 'react';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
root: {
position: 'absolute',
right: 4,
top: '50%',
marginTop: -theme.spacing.unit * 3
}
});
function ListItemSecondaryAction(props) {
const { children, classes, className } = props;
return React.createElement(
'div',
{ className: classNames(classes.root, className) },
children
);
}
ListItemSecondaryAction.muiName = 'ListItemSecondaryAction';
export default withStyles(styles, { name: 'MuiListItemSecondaryAction' })(ListItemSecondaryAction);

View File

@@ -0,0 +1,24 @@
import * as React from 'react';
import { StandardProps } from '..';
export interface ListItemTextProps extends StandardProps<
React.HTMLAttributes<HTMLDivElement>,
ListItemTextClassKey
> {
disableTypography?: boolean;
inset?: boolean;
primary?: React.ReactNode;
secondary?: React.ReactNode;
}
export type ListItemTextClassKey =
| 'root'
| 'inset'
| 'dense'
| 'text'
| 'textDense'
;
declare const ListItemText: React.ComponentType<ListItemTextProps>;
export default ListItemText;

View File

@@ -0,0 +1,86 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
// weak
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import Typography from '../Typography';
export const styles = theme => ({
root: {
flex: '1 1 auto',
padding: '0 16px',
'&:first-child': {
paddingLeft: 0
}
},
inset: {
'&:first-child': {
paddingLeft: theme.spacing.unit * 7
}
},
dense: {
fontSize: theme.typography.pxToRem(13)
},
text: {}, // Present to allow external customization
textDense: {
fontSize: 'inherit'
}
});
function ListItemText(props, context) {
const {
classes,
className: classNameProp,
disableTypography,
primary,
secondary,
inset
} = props,
other = _objectWithoutProperties(props, ['classes', 'className', 'disableTypography', 'primary', 'secondary', 'inset']);
const { dense } = context;
const className = classNames(classes.root, {
[classes.dense]: dense,
[classes.inset]: inset
}, classNameProp);
return React.createElement(
'div',
_extends({ className: className }, other),
primary && (disableTypography ? primary : React.createElement(
Typography,
{
type: 'subheading',
className: classNames(classes.text, { [classes.textDense]: dense })
},
primary
)),
secondary && (disableTypography ? secondary : React.createElement(
Typography,
{
color: 'secondary',
type: 'body1',
className: classNames(classes.text, { [classes.textDense]: dense })
},
secondary
))
);
}
ListItemText.defaultProps = {
disableTypography: false,
primary: false,
secondary: false,
inset: false
};
ListItemText.contextTypes = {
dense: PropTypes.bool
};
export default withStyles(styles, { name: 'MuiListItemText' })(ListItemText);

View File

@@ -0,0 +1,23 @@
import * as React from 'react';
import { StandardProps } from '..';
export interface ListSubheaderProps extends StandardProps<
React.HTMLAttributes<HTMLDivElement>,
ListSubheaderClassKey
> {
color?: 'default' | 'primary' | 'inherit';
inset?: boolean;
disableSticky?: boolean;
}
export type ListSubheaderClassKey =
| 'root'
| 'colorPrimary'
| 'colorInherit'
| 'inset'
| 'sticky'
;
declare const ListSubheader: React.ComponentType<ListSubheaderProps>;
export default ListSubheader;

View File

@@ -0,0 +1,72 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
// weak
import React from 'react';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import { capitalizeFirstLetter } from '../utils/helpers';
export const styles = theme => ({
root: {
boxSizing: 'border-box',
lineHeight: '48px',
paddingLeft: theme.spacing.unit * 2,
paddingRight: theme.spacing.unit * 2,
color: theme.palette.text.secondary,
fontFamily: theme.typography.fontFamily,
fontWeight: theme.typography.fontWeightMedium,
fontSize: theme.typography.pxToRem(theme.typography.fontSize)
},
colorPrimary: {
color: theme.palette.primary[500]
},
colorInherit: {
color: 'inherit'
},
inset: {
paddingLeft: theme.spacing.unit * 9
},
sticky: {
position: 'sticky',
top: 0,
zIndex: 1,
backgroundColor: 'inherit'
}
});
function ListSubheader(props) {
const {
children,
classes,
className: classNameProp,
color,
disableSticky,
inset
} = props,
other = _objectWithoutProperties(props, ['children', 'classes', 'className', 'color', 'disableSticky', 'inset']);
const className = classNames(classes.root, {
[classes[`color${capitalizeFirstLetter(color)}`]]: color !== 'default',
[classes.inset]: inset,
[classes.sticky]: !disableSticky
}, classNameProp);
return React.createElement(
'div',
_extends({ className: className }, other),
children
);
}
ListSubheader.defaultProps = {
color: 'default',
disableSticky: false,
inset: false
};
ListSubheader.muiName = 'ListSubheader';
export default withStyles(styles, { name: 'MuiListSubheader' })(ListSubheader);

View File

@@ -0,0 +1,14 @@
export { default } from './List';
export * from './List';
export { default as ListItem } from './ListItem';
export * from './ListItem';
export { default as ListItemAvatar } from './ListItemAvatar';
export * from './ListItemAvatar';
export { default as ListItemText } from './ListItemText';
export * from './ListItemText';
export { default as ListItemIcon } from './ListItemIcon';
export * from './ListItemIcon';
export { default as ListItemSecondaryAction } from './ListItemSecondaryAction';
export * from './ListItemSecondaryAction';
export { default as ListSubheader } from './ListSubheader';
export * from './ListSubheader';

View File

@@ -0,0 +1,7 @@
export { default } from './List';
export { default as ListItem } from './ListItem';
export { default as ListItemAvatar } from './ListItemAvatar';
export { default as ListItemText } from './ListItemText';
export { default as ListItemIcon } from './ListItemIcon';
export { default as ListItemSecondaryAction } from './ListItemSecondaryAction';
export { default as ListSubheader } from './ListSubheader';