forked from AkkomaGang/akkoma
1 line
No EOL
10 KiB
Text
1 line
No EOL
10 KiB
Text
{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/list_editor/containers/account_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/list_editor/containers/search_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/list_editor/index.js"],"names":["injectIntl","connect","getAccount","makeGetAccount","state","accountId","added","account","getIn","includes","dispatch","onRemove","removeFromListEditor","onAdd","addToListEditor","Account","value","onSubmit","fetchListSuggestions","onClear","clearListSuggestions","onChange","changeListSuggestions","Search","messages","defineMessages","title","ListForm","disabled","changeListEditorTitle","submitListEditor","e","props","target","preventDefault","render","this","intl","formatMessage","className","handleSubmit","handleChange","icon","onClick","handleClick","React","PureComponent","ListEditor","accountIds","searchAccountIds","onInitialize","listId","setupListEditor","onReset","resetListEditor","componentDidMount","componentWillUnmount","showSearch","size","map","role","tabIndex","defaultStyle","x","style","spring","stiffness","damping","transform","visibility","ImmutablePureComponent","PropTypes","string","isRequired","onClose","func","object","ImmutablePropTypes","list"],"mappings":"oRAuBeA,cAAWC,mBAhBE,WAC1B,IAAMC,EAAaC,cAOnB,OALwB,SAACC,EAAD,OAAUC,EAAV,EAAUA,UAAWC,EAArB,EAAqBA,MAArB,MAAkC,CACxDC,QAASL,EAAWE,EAAOC,GAC3BC,WAAwB,IAAVA,EAAwBF,EAAMI,MAAM,CAAC,aAAc,WAAY,UAAUC,SAASJ,GAAaC,OAMtF,SAACI,EAAD,OAAaL,EAAb,EAAaA,UAAb,MAA8B,CACvDM,SAAU,kBAAMD,EAASE,YAAqBP,KAC9CQ,MAAO,kBAAMH,EAASI,YAAgBT,QAGdJ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AcqB,IAAUI,KAAKF,WAC7BtD,QAASoD,IAAUI,KAAKF,WACxBpB,QAASkB,IAAUI,KAAKF,WACxBzB,WAAY6B,IAAmBC,KAAKL,WACpCxB,iBAAkB4B,IAAmBC,KAAKL,a","file":"flavours/glitch/async/list_editor.js","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport { makeGetAccount } from 'flavours/glitch/selectors';\nimport { injectIntl } from 'react-intl';\nimport { removeFromListEditor, addToListEditor } from 'flavours/glitch/actions/lists';\nimport Account from '../components/account';\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 injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Account));\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { injectIntl } from 'react-intl';\nimport { fetchListSuggestions, clearListSuggestions, changeListSuggestions } from '../../../actions/lists';\nimport Search from '../components/search';\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 injectIntl(connect(mapStateToProps, mapDispatchToProps)(Search));\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { changeListEditorTitle, submitListEditor } from 'flavours/glitch/actions/lists';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n title: { id: 'lists.edit.submit', defaultMessage: 'Change title' },\n});\n\nconst mapStateToProps = state => ({\n value: state.getIn(['listEditor', 'title']),\n disabled: !state.getIn(['listEditor', 'isChanged']) || !state.getIn(['listEditor', 'title']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onChange: value => dispatch(changeListEditorTitle(value)),\n onSubmit: () => dispatch(submitListEditor(false)),\n});\n\nexport default @connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nclass ListForm extends React.PureComponent {\n\n static propTypes = {\n value: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n };\n\n handleChange = e => {\n this.props.onChange(e.target.value);\n }\n\n handleSubmit = e => {\n e.preventDefault();\n this.props.onSubmit();\n }\n\n handleClick = () => {\n this.props.onSubmit();\n }\n\n render () {\n const { value, disabled, intl } = this.props;\n\n const title = intl.formatMessage(messages.title);\n\n return (\n <form className='column-inline-form' onSubmit={this.handleSubmit}>\n <input\n className='setting-text'\n value={value}\n onChange={this.handleChange}\n />\n\n <IconButton\n disabled={disabled}\n icon='check'\n title={title}\n onClick={this.handleClick}\n />\n </form>\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 'flavours/glitch/actions/lists';\nimport AccountContainer from './containers/account_container';\nimport SearchContainer from './containers/search_container';\nimport EditListForm from './components/edit_list_form';\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\n\nconst mapStateToProps = state => ({\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 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 { accountIds, searchAccountIds, onClear } = this.props;\n const showSearch = searchAccountIds.size > 0;\n\n return (\n <div className='modal-root__modal list-editor'>\n <EditListForm />\n\n <SearchContainer />\n\n <div className='drawer__pager'>\n <div className='drawer__inner list-editor__accounts'>\n {accountIds.map(accountId => <AccountContainer 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 => <AccountContainer key={accountId} accountId={accountId} />)}\n </div>)\n }\n </Motion>\n </div>\n </div>\n );\n }\n\n}\n"],"sourceRoot":""} |