mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-23 15:05:45 +00:00
1 line
13 KiB
Plaintext
1 line
13 KiB
Plaintext
{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/report/components/status_check_box.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/report/containers/status_check_box_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/ui/components/report_modal.js"],"names":["StatusCheckBox","render","this","props","status","checked","onToggle","disabled","media","get","size","some","item","getIn","video","fetchComponent","Video","loading","renderLoadingVideoPlayer","Component","preview","blurhash","src","alt","width","height","inline","sensitive","onOpenVideo","noop","MediaGallery","renderLoadingMediaGallery","onOpenMedia","className","onChange","React","PureComponent","connect","state","id","ImmutableSet","includes","dispatch","e","toggleStatusReport","target","messages","defineMessages","close","placeholder","submit","ReportModal","getAccount","makeGetAccount","accountId","isSubmitting","account","comment","forward","statusIds","OrderedSet","union","injectIntl","changeReportComment","value","changeReportForward","submitReport","keyCode","ctrlKey","metaKey","handleSubmit","componentDidMount","expandAccountTimeline","withReplies","componentWillReceiveProps","nextProps","intl","onClose","domain","split","title","formatMessage","icon","onClick","defaultMessage","values","handleCommentChange","onKeyDown","handleKeyDown","autoFocus","handleForwardChange","htmlFor","text","map","statusId","ImmutablePureComponent","PropTypes","bool","ImmutablePropTypes","orderedSet","isRequired","string","func","object"],"mappings":"kSASqBA,E,kGASnBC,OAAA,WAAW,IAAD,EACwCC,KAAKC,MAA7CC,EADA,EACAA,OAAQC,EADR,EACQA,QAASC,EADjB,EACiBA,SAAUC,EAD3B,EAC2BA,SAC/BC,EAAQ,KAEZ,GAAIJ,EAAOK,IAAI,UACb,OAAO,KAGT,GAAIL,EAAOK,IAAI,qBAAqBC,KAAO,EACzC,GAAIN,EAAOK,IAAI,qBAAqBE,MAAK,SAAAC,GAAI,MAAyB,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5BlC,UAAWuC,IAAmBC,WAAWC,WACzC3C,QAASuC,IAAUK,OAAOD,WAC1B1C,QAASsC,IAAUC,KACnBvD,SAAUsD,IAAUM,KAAKF,WACzBxB,KAAMoB,IAAUO,OAAOH,a","file":"modals/report_modal.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Toggle from 'react-toggle';\nimport noop from 'lodash/noop';\nimport StatusContent from '../../../components/status_content';\nimport { MediaGallery, Video } from '../../ui/util/async-components';\nimport Bundle from '../../ui/components/bundle';\n\nexport default class StatusCheckBox extends React.PureComponent {\n\n static propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n checked: PropTypes.bool,\n onToggle: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n };\n\n render () {\n const { status, checked, onToggle, disabled } = this.props;\n let media = null;\n\n if (status.get('reblog')) {\n return null;\n }\n\n if (status.get('media_attachments').size > 0) {\n if (status.get('media_attachments').some(item => item.get('type') === 'unknown')) {\n\n } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {\n const video = status.getIn(['media_attachments', 0]);\n\n media = (\n <Bundle fetchComponent={Video} loading={this.renderLoadingVideoPlayer} >\n {Component => (\n <Component\n preview={video.get('preview_url')}\n blurhash={video.get('blurhash')}\n src={video.get('url')}\n alt={video.get('description')}\n width={239}\n height={110}\n inline\n sensitive={status.get('sensitive')}\n onOpenVideo={noop}\n />\n )}\n </Bundle>\n );\n } else {\n media = (\n <Bundle fetchComponent={MediaGallery} loading={this.renderLoadingMediaGallery} >\n {Component => <Component media={status.get('media_attachments')} sensitive={status.get('sensitive')} height={110} onOpenMedia={noop} />}\n </Bundle>\n );\n }\n }\n\n return (\n <div className='status-check-box'>\n <div className='status-check-box__status'>\n <StatusContent status={status} />\n {media}\n </div>\n\n <div className='status-check-box-toggle'>\n <Toggle checked={checked} onChange={onToggle} disabled={disabled} />\n </div>\n </div>\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport StatusCheckBox from '../components/status_check_box';\nimport { toggleStatusReport } from '../../../actions/reports';\nimport { Set as ImmutableSet } from 'immutable';\n\nconst mapStateToProps = (state, { id }) => ({\n status: state.getIn(['statuses', id]),\n checked: state.getIn(['reports', 'new', 'status_ids'], ImmutableSet()).includes(id),\n});\n\nconst mapDispatchToProps = (dispatch, { id }) => ({\n\n onToggle (e) {\n dispatch(toggleStatusReport(id, e.target.checked));\n },\n\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(StatusCheckBox);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { changeReportComment, changeReportForward, submitReport } from '../../../actions/reports';\nimport { expandAccountTimeline } from '../../../actions/timelines';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { makeGetAccount } from '../../../selectors';\nimport { defineMessages, FormattedMessage, injectIntl } from 'react-intl';\nimport StatusCheckBox from '../../report/containers/status_check_box_container';\nimport { OrderedSet } from 'immutable';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport Button from '../../../components/button';\nimport Toggle from 'react-toggle';\nimport IconButton from '../../../components/icon_button';\n\nconst messages = defineMessages({\n close: { id: 'lightbox.close', defaultMessage: 'Close' },\n placeholder: { id: 'report.placeholder', defaultMessage: 'Additional comments' },\n submit: { id: 'report.submit', defaultMessage: 'Submit' },\n});\n\nconst makeMapStateToProps = () => {\n const getAccount = makeGetAccount();\n\n const mapStateToProps = state => {\n const accountId = state.getIn(['reports', 'new', 'account_id']);\n\n return {\n isSubmitting: state.getIn(['reports', 'new', 'isSubmitting']),\n account: getAccount(state, accountId),\n comment: state.getIn(['reports', 'new', 'comment']),\n forward: state.getIn(['reports', 'new', 'forward']),\n statusIds: OrderedSet(state.getIn(['timelines', `account:${accountId}:with_replies`, 'items'])).union(state.getIn(['reports', 'new', 'status_ids'])),\n };\n };\n\n return mapStateToProps;\n};\n\nexport default @connect(makeMapStateToProps)\n@injectIntl\nclass ReportModal extends ImmutablePureComponent {\n\n static propTypes = {\n isSubmitting: PropTypes.bool,\n account: ImmutablePropTypes.map,\n statusIds: ImmutablePropTypes.orderedSet.isRequired,\n comment: PropTypes.string.isRequired,\n forward: PropTypes.bool,\n dispatch: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n handleCommentChange = e => {\n this.props.dispatch(changeReportComment(e.target.value));\n }\n\n handleForwardChange = e => {\n this.props.dispatch(changeReportForward(e.target.checked));\n }\n\n handleSubmit = () => {\n this.props.dispatch(submitReport());\n }\n\n handleKeyDown = e => {\n if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {\n this.handleSubmit();\n }\n }\n\n componentDidMount () {\n this.props.dispatch(expandAccountTimeline(this.props.account.get('id'), { withReplies: true }));\n }\n\n componentWillReceiveProps (nextProps) {\n if (this.props.account !== nextProps.account && nextProps.account) {\n this.props.dispatch(expandAccountTimeline(nextProps.account.get('id'), { withReplies: true }));\n }\n }\n\n render () {\n const { account, comment, intl, statusIds, isSubmitting, forward, onClose } = this.props;\n\n if (!account) {\n return null;\n }\n\n const domain = account.get('acct').split('@')[1];\n\n return (\n <div className='modal-root__modal report-modal'>\n <div className='report-modal__target'>\n <IconButton className='media-modal__close' title={intl.formatMessage(messages.close)} icon='times' onClick={onClose} size={16} />\n <FormattedMessage id='report.target' defaultMessage='Report {target}' values={{ target: <strong>{account.get('acct')}</strong> }} />\n </div>\n\n <div className='report-modal__container'>\n <div className='report-modal__comment'>\n <p><FormattedMessage id='report.hint' defaultMessage='The report will be sent to your server moderators. You can provide an explanation of why you are reporting this account below:' /></p>\n\n <textarea\n className='setting-text light'\n placeholder={intl.formatMessage(messages.placeholder)}\n value={comment}\n onChange={this.handleCommentChange}\n onKeyDown={this.handleKeyDown}\n disabled={isSubmitting}\n autoFocus\n />\n\n {domain && (\n <div>\n <p><FormattedMessage id='report.forward_hint' defaultMessage='The account is from another server. Send an anonymized copy of the report there as well?' /></p>\n\n <div className='setting-toggle'>\n <Toggle id='report-forward' checked={forward} disabled={isSubmitting} onChange={this.handleForwardChange} />\n <label htmlFor='report-forward' className='setting-toggle__label'><FormattedMessage id='report.forward' defaultMessage='Forward to {target}' values={{ target: domain }} /></label>\n </div>\n </div>\n )}\n\n <Button disabled={isSubmitting} text={intl.formatMessage(messages.submit)} onClick={this.handleSubmit} />\n </div>\n\n <div className='report-modal__statuses'>\n <div>\n {statusIds.map(statusId => <StatusCheckBox id={statusId} key={statusId} disabled={isSubmitting} />)}\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n}\n"],"sourceRoot":""} |