1 line
No EOL
13 KiB
Text
1 line
No EOL
13 KiB
Text
{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/list_editor/components/account.js","webpack:///./app/javascript/mastodon/features/list_editor/components/search.js","webpack:///./app/javascript/mastodon/features/list_editor/index.js"],"names":["messages","Object","index_es","remove","id","defaultMessage","add","account_Account","es","getAccount","selectors","state","_ref","accountId","added","account","getIn","includes","dispatch","_ref2","onRemove","lists","onAdd","render","_props","this","props","intl","button","jsx_default","icon_button","icon","title","formatMessage","onClick","className","avatar","size","display_name","react_immutable_pure_component_es","propTypes","ImmutablePropTypes_default","a","map","isRequired","prop_types_default","object","func","bool","defaultProps","search_messages","search","search_Search","value","onSubmit","onClear","onChange","handleChange","e","_this","target","handleKeyUp","keyCode","handleClear","hasValue","length","style","display","type","onKeyUp","placeholder","role","tabIndex","classnames_default","active","aria-label","react_default","PureComponent","list_editor_ListEditor","accountIds","searchAccountIds","onInitialize","listId","onReset","componentDidMount","componentWillUnmount","_props2","showSearch","optional_motion","defaultStyle","x","spring_default","stiffness","damping","transform","visibility","string","onClose","list"],"mappings":"mSAYMA,EAAWC,OAAAC,EAAA,EAAAD,EACfE,QAAAC,GAAA,uBAAAC,eAAA,oBACAC,KAAAF,GAAA,oBAAAC,eAAA,iBAqBmBE,EAFpBN,OAAAO,EAAA,QAAAP,CAhB2B,WAC1B,IAAMQ,EAAaR,OAAAS,EAAA,EAAAT,GAOnB,OALwB,SAACU,EAADC,GAAA,IAAUC,EAAVD,EAAUC,UAAWC,EAArBF,EAAqBE,MAArB,OACtBC,QAASN,EAAWE,EAAOE,GAC3BC,WAAwB,IAAVA,EAAwBH,EAAMK,OAAO,aAAc,WAAY,UAAUC,SAASJ,GAAaC,KAMtF,SAACI,EAADC,GAAA,IAAaN,EAAbM,EAAaN,UAAb,OACzBO,SAAU,kBAAMF,EAASjB,OAAAoB,EAAA,EAAApB,CAAqBY,KAC9CS,MAAO,kBAAMJ,EAASjB,OAAAoB,EAAA,EAAApB,CAAgBY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AAH,EAAUI,OAAOF,WACvBqC,aAAcpC,EAAAH,EAAUK,KAAKH,WAC7BW,QAASV,EAAAH,EAAUK,KAAKH,WACxBuC,QAAStC,EAAAH,EAAUK,KAAKH,WACxBZ,MAAOa,EAAAH,EAAUsD,OAAOpD,WACxBmC,WAAYtC,EAAAC,EAAmBwD,KAAKtD,WACpCoC,iBAAkBvC,EAAAC,EAAmBwD,KAAKtD","file":"features/list_editor.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { makeGetAccount } from '../../../selectors';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Avatar from '../../../components/avatar';\nimport DisplayName from '../../../components/display_name';\nimport IconButton from '../../../components/icon_button';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport { removeFromListEditor, addToListEditor } from '../../../actions/lists';\n\nconst messages = defineMessages({\n remove: { id: 'lists.account.remove', defaultMessage: 'Remove from list' },\n add: { id: 'lists.account.add', defaultMessage: 'Add to list' },\n});\n\nconst makeMapStateToProps = () => {\n const getAccount = makeGetAccount();\n\n const mapStateToProps = (state, { accountId, added }) => ({\n account: getAccount(state, accountId),\n added: typeof added === 'undefined' ? state.getIn(['listEditor', 'accounts', 'items']).includes(accountId) : added,\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { accountId }) => ({\n onRemove: () => dispatch(removeFromListEditor(accountId)),\n onAdd: () => dispatch(addToListEditor(accountId)),\n});\n\n@connect(makeMapStateToProps, mapDispatchToProps)\n@injectIntl\nexport default class Account extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n intl: PropTypes.object.isRequired,\n onRemove: PropTypes.func.isRequired,\n onAdd: PropTypes.func.isRequired,\n added: PropTypes.bool,\n };\n\n static defaultProps = {\n added: false,\n };\n\n render () {\n const { account, intl, onRemove, onAdd, added } = this.props;\n\n let button;\n\n if (added) {\n button = <IconButton icon='times' title={intl.formatMessage(messages.remove)} onClick={onRemove} />;\n } else {\n button = <IconButton icon='plus' title={intl.formatMessage(messages.add)} onClick={onAdd} />;\n }\n\n return (\n <div className='account'>\n <div className='account__wrapper'>\n <div className='account__display-name'>\n <div className='account__avatar-wrapper'><Avatar account={account} size={36} /></div>\n <DisplayName account={account} />\n </div>\n\n <div className='account__relationship'>\n {button}\n </div>\n </div>\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport { fetchListSuggestions, clearListSuggestions, changeListSuggestions } from '../../../actions/lists';\nimport classNames from 'classnames';\n\nconst messages = defineMessages({\n search: { id: 'lists.search', defaultMessage: 'Search among people you follow' },\n});\n\nconst mapStateToProps = state => ({\n value: state.getIn(['listEditor', 'suggestions', 'value']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onSubmit: value => dispatch(fetchListSuggestions(value)),\n onClear: () => dispatch(clearListSuggestions()),\n onChange: value => dispatch(changeListSuggestions(value)),\n});\n\n@connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nexport default class Search extends React.PureComponent {\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n };\n\n handleChange = e => {\n this.props.onChange(e.target.value);\n }\n\n handleKeyUp = e => {\n if (e.keyCode === 13) {\n this.props.onSubmit(this.props.value);\n }\n }\n\n handleClear = () => {\n this.props.onClear();\n }\n\n render () {\n const { value, intl } = this.props;\n const hasValue = value.length > 0;\n\n return (\n <div className='list-editor__search search'>\n <label>\n <span style={{ display: 'none' }}>{intl.formatMessage(messages.search)}</span>\n\n <input\n className='search__input'\n type='text'\n value={value}\n onChange={this.handleChange}\n onKeyUp={this.handleKeyUp}\n placeholder={intl.formatMessage(messages.search)}\n />\n </label>\n\n <div role='button' tabIndex='0' className='search__icon' onClick={this.handleClear}>\n <i className={classNames('fa fa-search', { active: !hasValue })} />\n <i aria-label={intl.formatMessage(messages.search)} className={classNames('fa fa-times-circle', { active: hasValue })} />\n </div>\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { connect } from 'react-redux';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { injectIntl } from 'react-intl';\nimport { setupListEditor, clearListSuggestions, resetListEditor } from '../../actions/lists';\nimport Account from './components/account';\nimport Search from './components/search';\nimport Motion from '../ui/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\n\nconst mapStateToProps = state => ({\n title: state.getIn(['listEditor', 'title']),\n accountIds: state.getIn(['listEditor', 'accounts', 'items']),\n searchAccountIds: state.getIn(['listEditor', 'suggestions', 'items']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onInitialize: listId => dispatch(setupListEditor(listId)),\n onClear: () => dispatch(clearListSuggestions()),\n onReset: () => dispatch(resetListEditor()),\n});\n\n@connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nexport default class ListEditor extends ImmutablePureComponent {\n\n static propTypes = {\n listId: PropTypes.string.isRequired,\n onClose: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n onInitialize: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n onReset: PropTypes.func.isRequired,\n title: PropTypes.string.isRequired,\n accountIds: ImmutablePropTypes.list.isRequired,\n searchAccountIds: ImmutablePropTypes.list.isRequired,\n };\n\n componentDidMount () {\n const { onInitialize, listId } = this.props;\n onInitialize(listId);\n }\n\n componentWillUnmount () {\n const { onReset } = this.props;\n onReset();\n }\n\n render () {\n const { title, accountIds, searchAccountIds, onClear } = this.props;\n const showSearch = searchAccountIds.size > 0;\n\n return (\n <div className='modal-root__modal list-editor'>\n <h4>{title}</h4>\n\n <Search />\n\n <div className='drawer__pager'>\n <div className='drawer__inner list-editor__accounts'>\n {accountIds.map(accountId => <Account key={accountId} accountId={accountId} added />)}\n </div>\n\n {showSearch && <div role='button' tabIndex='-1' className='drawer__backdrop' onClick={onClear} />}\n\n <Motion defaultStyle={{ x: -100 }} style={{ x: spring(showSearch ? 0 : -100, { stiffness: 210, damping: 20 }) }}>\n {({ x }) => (\n <div className='drawer__inner backdrop' style={{ transform: x === 0 ? null : `translateX(${x}%)`, visibility: x === -100 ? 'hidden' : 'visible' }}>\n {searchAccountIds.map(accountId => <Account key={accountId} accountId={accountId} />)}\n </div>\n )}\n </Motion>\n </div>\n </div>\n );\n }\n\n}\n"],"sourceRoot":""} |