akkoma/priv/static/packs/flavours/glitch/async/community_timeline.js.map
2019-01-31 10:35:44 +01:00

1 line
9.2 KiB
Plaintext

{"version":3,"sources":["webpack:///app/javascript/seagate/sources/git/hacktivis.me/git/mastofe/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js","webpack:///app/javascript/seagate/sources/git/hacktivis.me/git/mastofe/app/javascript/flavours/glitch/features/community_timeline/index.js"],"names":["connect","state","_ref","uuid","columnId","columns","getIn","index","findIndex","c","get","settings","dispatch","_ref2","onChange","key","checked","changeColumnParams","changeSetting","concat","ColumnSettings","messages","defineMessages","title","id","defaultMessage","CommunityTimeline","onlyMedia","hasUnread","injectIntl","_this$props","_this","props","removeColumn","addColumn","other","dir","_this$props2","moveColumn","column","scrollTop","maxId","_this$props3","expandCommunityTimeline","prevRouterProps","location","mastodonModalOpen","componentDidMount","_this$props4","this","disconnect","connectCommunityStream","componentDidUpdate","prevProps","_this$props5","componentWillUnmount","render","_this$props6","intl","multiColumn","pinned","react_default","a","createElement","ref","setRef","name","label","formatMessage","Object","jsx","column_header","icon","active","onPin","handlePin","onMove","handleMove","onClick","handleHeaderClick","column_settings_container","status_list_container","trackScroll","scrollKey","shouldUpdateScroll","timelineId","onLoadMore","handleLoadMore","emptyMessage","index_es","React","PureComponent","router","PropTypes","object"],"mappings":"oPA0BeA,oBAtBS,SAACC,EAADC,GAAyB,IACzCC,EADyCD,EAAfE,SAE1BC,EAAUJ,EAAMK,MAAM,CAAC,WAAY,YACnCC,EAAQF,EAAQG,UAAU,SAAAC,GAAC,OAAIA,EAAEC,IAAI,UAAYP,IAEvD,MAAO,CACLQ,SAAWR,GAAiB,GAATI,EAAcF,EAAQK,IAAIH,GAAOG,IAAI,UAAYT,EAAMK,MAAM,CAAC,WAAY,gBAItE,SAACM,EAADC,GAA4B,IAAfT,EAAeS,EAAfT,SACtC,MAAO,CACLU,SADK,SACKC,EAAKC,GAEXJ,EADER,EACOa,mBAAmBb,EAAUW,EAAKC,GAElCE,YAAa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AAe,0FArGtCiE,IAAMC,4CAE7B,CACpBhE,WAAW,iCAGS,CACpBiE,OAAQC,IAAUC","file":"flavours/glitch/async/community_timeline.js","sourcesContent":["import { connect } from 'react-redux';\nimport ColumnSettings from '../components/column_settings';\nimport { changeSetting } from 'flavours/glitch/actions/settings';\n\nconst mapStateToProps = (state, { columnId }) => {\n const uuid = columnId;\n const columns = state.getIn(['settings', 'columns']);\n const index = columns.findIndex(c => c.get('uuid') === uuid);\n\n return {\n settings: (uuid && index >= 0) ? columns.get(index).get('params') : state.getIn(['settings', 'community']),\n };\n};\n \nconst mapDispatchToProps = (dispatch, { columnId }) => {\n return {\n onChange (key, checked) {\n if (columnId) {\n dispatch(changeColumnParams(columnId, key, checked));\n } else {\n dispatch(changeSetting(['community', ...key], checked));\n }\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\nimport StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container';\nimport Column from 'flavours/glitch/components/column';\nimport ColumnHeader from 'flavours/glitch/components/column_header';\nimport { expandCommunityTimeline } from 'flavours/glitch/actions/timelines';\nimport { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns';\nimport ColumnSettingsContainer from './containers/column_settings_container';\nimport { connectCommunityStream } from 'flavours/glitch/actions/streaming';\n\nconst messages = defineMessages({\n title: { id: 'column.community', defaultMessage: 'Local timeline' },\n});\n\nconst mapStateToProps = (state, { onlyMedia, columnId }) => {\n const uuid = columnId;\n const columns = state.getIn(['settings', 'columns']);\n const index = columns.findIndex(c => c.get('uuid') === uuid);\n\n return {\n hasUnread: state.getIn(['timelines', `community${onlyMedia ? ':media' : ''}`, 'unread']) > 0,\n onlyMedia: (columnId && index >= 0) ? columns.get(index).getIn(['params', 'other', 'onlyMedia']) : state.getIn(['settings', 'community', 'other', 'onlyMedia']),\n };\n};\n\n@connect(mapStateToProps)\n@injectIntl\nexport default class CommunityTimeline extends React.PureComponent {\n\n static defaultProps = {\n onlyMedia: false,\n };\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n dispatch: PropTypes.func.isRequired,\n columnId: PropTypes.string,\n intl: PropTypes.object.isRequired,\n hasUnread: PropTypes.bool,\n multiColumn: PropTypes.bool,\n onlyMedia: PropTypes.bool,\n };\n\n handlePin = () => {\n const { columnId, dispatch, onlyMedia } = this.props;\n\n if (columnId) {\n dispatch(removeColumn(columnId));\n } else {\n dispatch(addColumn('COMMUNITY', { other: { onlyMedia } }));\n }\n }\n\n handleMove = (dir) => {\n const { columnId, dispatch } = this.props;\n dispatch(moveColumn(columnId, dir));\n }\n\n handleHeaderClick = () => {\n this.column.scrollTop();\n }\n\n componentDidMount () {\n const { dispatch, onlyMedia } = this.props;\n\n dispatch(expandCommunityTimeline({ onlyMedia }));\n this.disconnect = dispatch(connectCommunityStream({ onlyMedia }));\n }\n\n componentDidUpdate (prevProps) {\n if (prevProps.onlyMedia !== this.props.onlyMedia) {\n const { dispatch, onlyMedia } = this.props;\n\n this.disconnect();\n dispatch(expandCommunityTimeline({ onlyMedia }));\n this.disconnect = dispatch(connectCommunityStream({ onlyMedia }));\n }\n }\n\n componentWillUnmount () {\n if (this.disconnect) {\n this.disconnect();\n this.disconnect = null;\n }\n }\n\n setRef = c => {\n this.column = c;\n }\n\n handleLoadMore = maxId => {\n const { dispatch, onlyMedia } = this.props;\n\n dispatch(expandCommunityTimeline({ maxId, onlyMedia }));\n }\n\n shouldUpdateScroll = (prevRouterProps, { location }) => {\n return !(location.state && location.state.mastodonModalOpen)\n }\n\n render () {\n const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props;\n const pinned = !!columnId;\n\n return (\n <Column ref={this.setRef} name='local' label={intl.formatMessage(messages.title)}>\n <ColumnHeader\n icon='users'\n active={hasUnread}\n title={intl.formatMessage(messages.title)}\n onPin={this.handlePin}\n onMove={this.handleMove}\n onClick={this.handleHeaderClick}\n pinned={pinned}\n multiColumn={multiColumn}\n >\n <ColumnSettingsContainer columnId={columnId} />\n </ColumnHeader>\n\n <StatusListContainer\n trackScroll={!pinned}\n scrollKey={`community_timeline-${columnId}`}\n shouldUpdateScroll={this.shouldUpdateScroll}\n timelineId={`community${onlyMedia ? ':media' : ''}`}\n onLoadMore={this.handleLoadMore}\n emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />}\n />\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""}