1 line
No EOL
9 KiB
Text
1 line
No EOL
9 KiB
Text
{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/list_adder/components/list.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/list_adder/components/account.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/list_adder/index.js"],"names":["messages","defineMessages","remove","add","List","connect","state","listId","added","list","get","getIn","includes","dispatch","onRemove","removeFromListAdder","onAdd","addToListAdder","injectIntl","render","button","this","props","intl","icon","title","formatMessage","onClick","className","id","fixedWidth","ImmutablePureComponent","ImmutablePropTypes","map","isRequired","PropTypes","object","func","bool","Account","getAccount","makeGetAccount","accountId","account","size","getOrderedLists","createSelector","lists","toList","filter","item","sort","a","b","localeCompare","ListAdder","listIds","onInitialize","setupListAdder","onReset","resetListAdder","componentDidMount","componentWillUnmount","ListId","string","onClose"],"mappings":"oRAUA,I,MAAMA,EAAWC,YAAe,CAC9BC,OAAO,CAAD,6DACNC,IAAI,CAAD,uDAeCC,EAFUC,mBAVQ,SAACC,EAAD,OAAUC,EAAV,EAAUA,OAAQC,EAAlB,EAAkBA,MAAlB,MAA+B,CACrDC,KAAMH,EAAMI,IAAI,SAASA,IAAIH,GAC7BC,WAAwB,IAAVA,EAAwBF,EAAMK,MAAM,CAAC,YAAa,QAAS,UAAUC,SAASL,GAAUC,MAG7E,SAACK,EAAD,OAAaN,EAAb,EAAaA,OAAb,MAA2B,CACpDO,SAAU,kBAAMD,EAASE,YAAoBR,KAC7CS,MAAO,kBAAMH,EAASI,YAAeV,Q,GAItCW,a,gHAeCC,OAAA,WAAW,IAGLC,EAHI,EACuCC,KAAKC,MAA5Cb,EADA,EACAA,KAAMc,EADN,EACMA,KAAMT,EADZ,EACYA,SAAUE,EADtB,EACsBA,MAU9B,OALEI,EANM,EAC6BZ,MAK1B,YAAC,IAAD,CAAYgB,KA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Q,EAFUlD,mBATQ,SAAAC,GAAK,MAAK,CAChCkD,QAASX,EAAgBvC,GAAO2B,KAAI,SAAAxB,GAAI,OAAEA,EAAKC,IAAI,aAG1B,SAAAG,GAAQ,MAAK,CACtC4C,aAAc,SAAAf,GAAS,OAAI7B,EAAS6C,YAAehB,KACnDiB,QAAS,kBAAM9C,EAAS+C,mB,GAIzB1C,a,wHAYC2C,kBAAA,WAAsB,IAAD,EACiBxC,KAAKC,OACzCmC,EAFmB,EACXA,cADW,EACGf,Y,EAIxBoB,qBAAA,YAEEH,EADoBtC,KAAKC,MAAjBqC,Y,EAIVxC,OAAA,WAAW,IAAD,EACuBE,KAAKC,MAA5BoB,EADA,EACAA,UAAWc,EADX,EACWA,QAEnB,OACE,mBAAK5B,UAAU,qCAAf,EACE,mBAAKA,UAAU,4BAAf,EACE,YAAC,EAAD,CAASc,UAAWA,KAGtB,YAAC,IAAD,IAGA,mBAAKd,UAAU,0BAAf,EACG4B,EAAQvB,KAAI,SAAA8B,GAAM,OAAI,YAAC,EAAD,CAAmBxD,OAAQwD,GAAhBA,U,GAlCpBhC,K,0BAEH,CACjBW,UAAWP,IAAU6B,OAAO9B,WAC5B+B,QAAS9B,IAAUE,KAAKH,WACxBX,KAAMY,IAAUC,OAAOF,WACvBuB,aAActB,IAAUE,KAAKH,WAC7ByB,QAASxB,IAAUE,KAAKH,WACxBsB,QAASxB,IAAmBvB,KAAKyB,a","file":"features/list_adder.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport IconButton from '../../../components/icon_button';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport { removeFromListAdder, addToListAdder } from '../../../actions/lists';\nimport Icon from 'mastodon/components/icon';\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 MapStateToProps = (state, { listId, added }) => ({\n list: state.get('lists').get(listId),\n added: typeof added === 'undefined' ? state.getIn(['listAdder', 'lists', 'items']).includes(listId) : added,\n});\n\nconst mapDispatchToProps = (dispatch, { listId }) => ({\n onRemove: () => dispatch(removeFromListAdder(listId)),\n onAdd: () => dispatch(addToListAdder(listId)),\n});\n\nexport default @connect(MapStateToProps, mapDispatchToProps)\n@injectIntl\nclass List extends ImmutablePureComponent {\n\n static propTypes = {\n list: 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 { list, 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='list'>\n <div className='list__wrapper'>\n <div className='list__display-name'>\n <Icon id='list-ul' className='column-link__icon' fixedWidth />\n {list.get('title')}\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 { 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 { injectIntl } from 'react-intl';\n\nconst makeMapStateToProps = () => {\n const getAccount = makeGetAccount();\n\n const mapStateToProps = (state, { accountId }) => ({\n account: getAccount(state, accountId),\n });\n\n return mapStateToProps;\n};\n\n\nexport default @connect(makeMapStateToProps)\n@injectIntl\nclass Account extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n };\n\n render () {\n const { account } = this.props;\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 </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 { setupListAdder, resetListAdder } from '../../actions/lists';\nimport { createSelector } from 'reselect';\nimport List from './components/list';\nimport Account from './components/account';\nimport NewListForm from '../lists/components/new_list_form';\n// hack\n\nconst getOrderedLists = createSelector([state => state.get('lists')], lists => {\n if (!lists) {\n return lists;\n }\n\n return lists.toList().filter(item => !!item).sort((a, b) => a.get('title').localeCompare(b.get('title')));\n});\n\nconst mapStateToProps = state => ({\n listIds: getOrderedLists(state).map(list=>list.get('id')),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onInitialize: accountId => dispatch(setupListAdder(accountId)),\n onReset: () => dispatch(resetListAdder()),\n});\n\nexport default @connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nclass ListAdder extends ImmutablePureComponent {\n\n static propTypes = {\n accountId: PropTypes.string.isRequired,\n onClose: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n onInitialize: PropTypes.func.isRequired,\n onReset: PropTypes.func.isRequired,\n listIds: ImmutablePropTypes.list.isRequired,\n };\n\n componentDidMount () {\n const { onInitialize, accountId } = this.props;\n onInitialize(accountId);\n }\n\n componentWillUnmount () {\n const { onReset } = this.props;\n onReset();\n }\n\n render () {\n const { accountId, listIds } = this.props;\n\n return (\n <div className='modal-root__modal list-adder'>\n <div className='list-adder__account'>\n <Account accountId={accountId} />\n </div>\n\n <NewListForm />\n\n\n <div className='list-adder__lists'>\n {listIds.map(ListId => <List key={ListId} listId={ListId} />)}\n </div>\n </div>\n );\n }\n\n}\n"],"sourceRoot":""} |