honkoma/priv/static/packs/features/list_editor.js.map

1 line
13 KiB
Plaintext

{"version":3,"sources":["webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/list_editor/components/account.js","webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/list_editor/components/search.js","webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/list_editor/index.js"],"names":["messages","defineMessages","remove","id","defaultMessage","add","Account","connect","getAccount","makeGetAccount","state","_ref","accountId","added","account","getIn","includes","dispatch","_ref2","onRemove","removeFromListEditor","onAdd","addToListEditor","injectIntl","render","button","_this$props","this","props","intl","Object","jsx","icon_button","icon","title","formatMessage","onClick","className","avatar","size","display_name","ImmutablePureComponent","ImmutablePropTypes","map","isRequired","PropTypes","object","func","bool","search","Search","value","onSubmit","fetchListSuggestions","onClear","clearListSuggestions","onChange","changeListSuggestions","e","_this","target","keyCode","hasValue","length","style","display","type","handleChange","onKeyUp","handleKeyUp","placeholder","role","tabIndex","handleClear","classNames","active","aria-label","React","PureComponent","ListEditor","accountIds","searchAccountIds","onInitialize","listId","setupListEditor","onReset","resetListEditor","componentDidMount","componentWillUnmount","_this$props2","showSearch","search_Search","account_Account","optional_motion","defaultStyle","x","spring","stiffness","damping","transform","visibility","string","onClose","list"],"mappings":"4PAYMA,EAAWC,YAAe,CAC9BC,OAAM,CAAAC,GAAA,uBAAAC,eAAA,oBACNC,IAAG,CAAAF,GAAA,oBAAAC,eAAA,iBAqBCE,EAFUC,kBAhBY,WAC1B,IAAMC,EAAaC,cAOnB,OALwB,SAACC,EAADC,GAAA,IAAUC,EAAVD,EAAUC,UAAWC,EAArBF,EAAqBE,MAArB,MAAkC,CACxDC,QAASN,EAAWE,EAAOE,GAC3BC,WAAwB,IAAVA,EAAwBH,EAAMK,MAAM,CAAC,aAAc,WAAY,UAAUC,SAASJ,GAAaC,KAMtF,SAACI,EAADC,GAAA,IAAaN,EAAbM,EAAaN,UAAb,MAA8B,CACvDO,SAAU,kBAAMF,E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EAAH,OACCjE,OAAAC,EAAA,EAAAD,CAAA,OAAKO,UAAU,yBAAyB2B,MAAO,CAAEmC,UAAiB,IAANJ,EAAU,KAAV,cAA+BA,EAA/B,KAAsCK,YAAmB,MAAPL,EAAa,SAAW,iBAAtI,EACGd,EAAiBtC,IAAI,SAAA/B,GAAS,OAAIkB,OAAAC,EAAA,EAAAD,CAAC8D,EAAD,CAAyBhF,UAAWA,GAAtBA,cA5CxC6B,+BAEJ,CACjB0C,OAAQtC,IAAUwD,OAAOzD,WACzB0D,QAASzD,IAAUE,KAAKH,WACxBf,KAAMgB,IAAUC,OAAOF,WACvBsC,aAAcrC,IAAUE,KAAKH,WAC7BU,QAAST,IAAUE,KAAKH,WACxByC,QAASxC,IAAUE,KAAKH,WACxBV,MAAOW,IAAUwD,OAAOzD,WACxBoC,WAAYtC,IAAmB6D,KAAK3D,WACpCqC,iBAAkBvC,IAAmB6D,KAAK3D","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\nexport default @connect(makeMapStateToProps, mapDispatchToProps)\n@injectIntl\nclass 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';\nimport Icon from 'mastodon/components/icon';\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\nexport default @connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nclass 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 <Icon id='search' className={classNames({ active: !hasValue })} />\n <Icon id='times-circle' aria-label={intl.formatMessage(messages.search)} className={classNames({ 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\nexport default @connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nclass 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":""}