mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-26 18:54:11 +00:00
1 line
8.7 KiB
Plaintext
1 line
8.7 KiB
Plaintext
{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/community_timeline/index.js"],"names":["connect","state","uuid","columnId","columns","getIn","index","findIndex","c","get","settings","dispatch","onChange","key","checked","changeColumnParams","changeSetting","ColumnSettings","messages","defineMessages","title","CommunityTimeline","onlyMedia","timelineState","hasUnread","injectIntl","props","removeColumn","addColumn","other","dir","moveColumn","column","scrollTop","maxId","expandCommunityTimeline","componentDidMount","this","disconnect","connectCommunityStream","componentDidUpdate","prevProps","componentWillUnmount","render","intl","multiColumn","pinned","ref","setRef","name","bindToDocument","label","formatMessage","icon","active","onPin","handlePin","onMove","handleMove","onClick","handleHeaderClick","trackScroll","scrollKey","timelineId","onLoadMore","handleLoadMore","emptyMessage","id","defaultMessage","React","PureComponent","router","PropTypes","object"],"mappings":"0SA2BeA,qBAtBS,SAACC,EAAD,GAA0B,IAC1CC,EADyC,EAAfC,SAE1BC,EAAUH,EAAMI,MAAM,CAAC,WAAY,YACnCC,EAAQF,EAAQG,WAAU,SAAAC,GAAC,OAAIA,EAAEC,IAAI,UAAYP,KAEvD,MAAO,CACLQ,SAAWR,GAAQI,GAAS,EAAKF,EAAQK,IAAIH,GAAOG,IAAI,UAAYR,EAAMI,MAAM,CAAC,WAAY,kBAItE,SAACM,EAAD,GAA6B,IAAhBR,EAAe,EAAfA,SACtC,MAAO,CACLS,SADK,SACKC,EAAKC,GAEXH,EADER,EACOY,YAAmBZ,EAAUU,EAAKC,GAElCE,YAAc,CAAC,aAAF,OAAkBH,GAAMC,QAMvCd,CAA6CiB,K,SCf5D,IAAMC,EAAWC,YAAe,CAC9BC,MAAM,CAAD,yDAk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UAElBe,KAAKC,aACL3B,EAASwB,YAAwB,CAAEb,eACnCe,KAAKC,WAAa3B,EAAS4B,YAAuB,CAAEjB,iB,EAIxDoB,qBAAA,WACML,KAAKC,aACPD,KAAKC,aACLD,KAAKC,WAAa,O,EActBK,OAAA,WAAW,IAAD,EACsDN,KAAKX,MAA3DkB,EADA,EACAA,KAAMpB,EADN,EACMA,UAAWrB,EADjB,EACiBA,SAAU0C,EAD3B,EAC2BA,YAAavB,EADxC,EACwCA,UAC1CwB,IAAW3C,EAEjB,OACE,kBAAC,IAAD,CAAQ4C,IAAKV,KAAKW,OAAQC,KAAK,QAAQC,gBAAiBL,EAAaM,MAAOP,EAAKQ,cAAclC,EAASE,QACtG,YAAC,IAAD,CACEiC,KAAK,QACLC,OAAQ9B,EACRJ,MAAOwB,EAAKQ,cAAclC,EAASE,OACnCmC,MAAOlB,KAAKmB,UACZC,OAAQpB,KAAKqB,WACbC,QAAStB,KAAKuB,kBACdd,OAAQA,EACRD,YAAaA,QARf,EAUE,YAAC,EAAD,CAAyB1C,SAAUA,KAGrC,YAAC,IAAD,CACE0D,aAAcf,EACdgB,UAAS,sBAAwB3D,EACjC4D,WAAU,aAAczC,EAAY,SAAW,IAC/C0C,WAAY3B,KAAK4B,eACjBC,aAAc,YAAC,IAAD,CAAkBC,GAAG,yBAAyBC,eAAe,mFAC3ElB,gBAAiBL,M,GAjGKwB,IAAMC,e,6BAEd,CACpBhD,WAAW,I,6BAGS,CACpBiD,OAAQC,IAAUC,S","file":"flavours/glitch/async/community_timeline.js","sourcesContent":["import { connect } from 'react-redux';\nimport ColumnSettings from '../components/column_settings';\nimport { changeColumnParams } from 'flavours/glitch/actions/columns';\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, { columnId }) => {\n const uuid = columnId;\n const columns = state.getIn(['settings', 'columns']);\n const index = columns.findIndex(c => c.get('uuid') === uuid);\n const onlyMedia = (columnId && index >= 0) ? columns.get(index).getIn(['params', 'other', 'onlyMedia']) : state.getIn(['settings', 'community', 'other', 'onlyMedia']);\n const timelineState = state.getIn(['timelines', `community${onlyMedia ? ':media' : ''}`]);\n\n return {\n hasUnread: !!timelineState && timelineState.get('unread') > 0,\n onlyMedia,\n };\n};\n\nexport default @connect(mapStateToProps)\n@injectIntl\nclass 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 render () {\n const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props;\n const pinned = !!columnId;\n\n return (\n <Column ref={this.setRef} name='local' bindToDocument={!multiColumn} 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 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 bindToDocument={!multiColumn}\n />\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""} |