1 line
31 KiB
Plaintext
1 line
31 KiB
Plaintext
{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/containers/column_settings_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/containers/conversation_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/index.js"],"names":["messages","defineMessages","filter_regex","settings","ColumnSettings","injectIntl","render","this","props","onChange","intl","className","id","defaultMessage","settingPath","label","formatMessage","React","PureComponent","connect","state","getIn","dispatch","path","checked","changeSetting","more","open","reply","markAsRead","delete","muteConversation","unmuteConversation","Conversation","isExpanded","undefined","e","destination","router","context","lastStatus","unread","markRead","button","ctrlKey","altKey","metaKey","get","history","location","mastodonBackSteps","push","preventDefault","onMoveUp","conversationId","onMoveDown","onMute","setExpansion","value","setState","accounts","menu","text","action","handleClick","handleConversationMute","handleMarkAsRead","handleDelete","names","map","a","to","href","title","dangerouslySetInnerHTML","__html","reduce","prev","cur","handlers","handleReply","moveUp","handleHotkeyMoveUp","moveDown","handleHotkeyMoveDown","toggleHidden","handleShowMore","media","size","compact","tabIndex","timestamp","values","status","parseClick","expanded","onExpandedToggle","collapsable","icon","onClick","items","direction","ImmutablePureComponent","PropTypes","object","string","isRequired","ImmutablePropTypes","list","bool","func","replyConfirm","replyMessage","getStatus","makeGetStatus","conversation","find","x","lastStatusId","accountId","markConversationRead","_","getState","trim","length","openModal","message","confirm","onConfirm","replyCompose","deleteConversation","unmuteStatus","muteStatus","onToggleHidden","revealStatus","hideStatus","ConversationsList","conversations","findIndex","elementIndex","getCurrentIndex","_selectChild","c","node","last","onLoadMore","leading","index","align_top","container","element","querySelector","scrollTop","offsetTop","scrollIntoView","clientHeight","offsetHeight","focus","other","handleLoadOlder","scrollKey","ref","setRef","item","handleMoveUp","handleMoveDown","hasMore","isLoading","maxId","expandConversations","DirectTimeline","hasUnread","conversationsMode","columnId","removeColumn","addColumn","dir","moveColumn","column","expandDirectTimeline","componentDidMount","mountConversations","disconnect","connectDirectStream","componentDidUpdate","prevProps","componentWillUnmount","unmountConversations","contents","multiColumn","pinned","trackScroll","timelineId","handleLoadMore","emptyMessage","handleLoadMoreTimeline","active","onPin","handlePin","onMove","handleMove","handleHeaderClick","handleConversationsClick","handleTimelineClick"],"mappings":"wOAMMA,EAAWC,YAAe,CAC9BC,aAAa,CAAD,2FACZC,SAAS,CAAD,uDAIJC,EADUC,Y,oGASdC,OAAA,WAAW,IAAD,EAC6BC,KAAKC,MAAlCL,EADA,EACAA,SAAUM,EADV,EACUA,SAAUC,EADpB,EACoBA,KAE5B,OACE,4BACE,oBAAMC,UAAU,iCAAhB,EAA2C,YAAC,IAAD,CAAkBC,GAAG,gCAAgCC,eAAe,cAE/G,mBAAKF,UAAU,6BAAf,EACE,YAAC,IAAD,CAAaR,SAAUA,EAAUW,YAAa,CAAC,QAAS,QAASL,SAAUA,EAAUM,MAAOL,EAAKM,cAAchB,EAASE,mB,GAhBrGe,IAAMC,iB,UCIpBC,oBAZS,SAAAC,GAAK,MAAK,CAChCjB,SAAUiB,EAAMC,MAAM,CAAC,WAAY,aAGV,SAAAC,GAAQ,MAAK,CAEtCb,SAFsC,SAE5Bc,EAAMC,GACdF,EAASG,YAAc,CAAC,UAAF,OAAeF,GAAOC,OAKjCL,C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BAFhB,EAIE,YAAC,IAAD,CACE9L,GAAG,4BACHC,eAAe,mBAGnB,sBACEF,UAAWiK,EAAoB,GAAK,SACpCzE,QAAS5F,KAAKoM,0BAFhB,EAIE,YAAC,IAAD,CACE/L,GAAG,uBACHC,eAAe,eAKpB+K,I,GAlJoB3K,IAAMC,iB","file":"flavours/glitch/async/direct_timeline.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport SettingText from '../../../components/setting_text';\n\nconst messages = defineMessages({\n filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },\n settings: { id: 'home.settings', defaultMessage: 'Column settings' },\n});\n\nexport default @injectIntl\nclass ColumnSettings extends React.PureComponent {\n\n static propTypes = {\n settings: ImmutablePropTypes.map.isRequired,\n onChange: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n render () {\n const { settings, onChange, intl } = this.props;\n\n return (\n <div>\n <span className='column-settings__section'><FormattedMessage id='home.column_settings.advanced' defaultMessage='Advanced' /></span>\n\n <div className='column-settings__row'>\n <SettingText settings={settings} settingPath={['regex', 'body']} onChange={onChange} label={intl.formatMessage(messages.filter_regex)} />\n </div>\n </div>\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport ColumnSettings from '../components/column_settings';\nimport { changeSetting } from 'flavours/glitch/actions/settings';\n\nconst mapStateToProps = state => ({\n settings: state.getIn(['settings', 'direct']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n\n onChange (path, checked) {\n dispatch(changeSetting(['direct', ...path], checked));\n },\n\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport StatusContent from 'flavours/glitch/components/status_content';\nimport AttachmentList from 'flavours/glitch/components/attachment_list';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';\nimport AvatarComposite from 'flavours/glitch/components/avatar_composite';\nimport Permalink from 'flavours/glitch/components/permalink';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport RelativeTimestamp from 'flavours/glitch/components/relative_timestamp';\nimport { HotKeys } from 'react-hotkeys';\n\nconst messages = defineMessages({\n more: { id: 'status.more', defaultMessage: 'More' },\n open: { id: 'conversation.open', defaultMessage: 'View conversation' },\n reply: { id: 'status.reply', defaultMessage: 'Reply' },\n markAsRead: { id: 'conversation.mark_as_read', defaultMessage: 'Mark as read' },\n delete: { id: 'conversation.delete', defaultMessage: 'Delete conversation' },\n muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },\n unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },\n});\n\nexport default @injectIntl\nclass Conversation extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n conversationId: PropTypes.string.isRequired,\n accounts: ImmutablePropTypes.list.isRequired,\n lastStatus: ImmutablePropTypes.map,\n unread:PropTypes.bool.isRequired,\n onMoveUp: PropTypes.func,\n onMoveDown: PropTypes.func,\n markRead: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n isExpanded: undefined,\n };\n\n parseClick = (e, destination) => {\n const { router } = this.context;\n const { lastStatus, unread, markRead } = this.props;\n if (!router) return;\n\n if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) {\n if (destination === undefined) {\n if (unread) {\n markRead();\n }\n destination = `/statuses/${lastStatus.get('id')}`;\n }\n let state = {...router.history.location.state};\n state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;\n router.history.push(destination, state);\n e.preventDefault();\n }\n }\n\n handleClick = () => {\n if (!this.context.router) {\n return;\n }\n\n const { lastStatus, unread, markRead } = this.props;\n\n if (unread) {\n markRead();\n }\n\n this.context.router.history.push(`/statuses/${lastStatus.get('id')}`);\n }\n\n handleMarkAsRead = () => {\n this.props.markRead();\n }\n\n handleReply = () => {\n this.props.reply(this.props.lastStatus, this.context.router.history);\n }\n\n handleDelete = () => {\n this.props.delete();\n }\n\n handleHotkeyMoveUp = () => {\n this.props.onMoveUp(this.props.conversationId);\n }\n\n handleHotkeyMoveDown = () => {\n this.props.onMoveDown(this.props.conversationId);\n }\n\n handleConversationMute = () => {\n this.props.onMute(this.props.lastStatus);\n }\n\n handleShowMore = () => {\n if (this.props.lastStatus.get('spoiler_text')) {\n this.setExpansion(!this.state.isExpanded);\n }\n };\n\n setExpansion = value => {\n this.setState({ isExpanded: value });\n }\n\n render () {\n const { accounts, lastStatus, unread, intl } = this.props;\n const { isExpanded } = this.state;\n\n if (lastStatus === null) {\n return null;\n }\n\n const menu = [\n { text: intl.formatMessage(messages.open), action: this.handleClick },\n null,\n ];\n\n menu.push({ text: intl.formatMessage(lastStatus.get('muted') ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMute });\n\n if (unread) {\n menu.push({ text: intl.formatMessage(messages.markAsRead), action: this.handleMarkAsRead });\n menu.push(null);\n }\n\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDelete });\n\n const names = accounts.map(a => <Permalink to={`/accounts/${a.get('id')}`} href={a.get('url')} key={a.get('id')} title={a.get('acct')}><bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: a.get('display_name_html') }} /></bdi></Permalink>).reduce((prev, cur) => [prev, ', ', cur]);\n\n const handlers = {\n reply: this.handleReply,\n open: this.handleClick,\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n toggleHidden: this.handleShowMore,\n };\n\n let media = null;\n if (lastStatus.get('media_attachments').size > 0) {\n media = <AttachmentList compact media={lastStatus.get('media_attachments')} />;\n }\n\n return (\n <HotKeys handlers={handlers}>\n <div className='conversation focusable muted' tabIndex='0'>\n <div className='conversation__avatar'>\n <AvatarComposite accounts={accounts} size={48} />\n </div>\n\n <div className='conversation__content'>\n <div className='conversation__content__info'>\n <div className='conversation__content__relative-time'>\n <RelativeTimestamp timestamp={lastStatus.get('created_at')} />\n </div>\n\n <div className='conversation__content__names'>\n <FormattedMessage id='conversation.with' defaultMessage='With {names}' values={{ names: <span>{names}</span> }} />\n </div>\n </div>\n\n <StatusContent\n status={lastStatus}\n parseClick={this.parseClick}\n expanded={isExpanded}\n onExpandedToggle={this.handleShowMore}\n collapsable\n media={media}\n />\n\n <div className='status__action-bar'>\n <IconButton className='status__action-bar-button' title={intl.formatMessage(messages.reply)} icon='reply' onClick={this.handleReply} />\n\n <div className='status__action-bar-dropdown'>\n <DropdownMenuContainer status={lastStatus} items={menu} icon='ellipsis-h' size={18} direction='right' title={intl.formatMessage(messages.more)} />\n </div>\n </div>\n </div>\n </div>\n </HotKeys>\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport Conversation from '../components/conversation';\nimport { markConversationRead, deleteConversation } from 'flavours/glitch/actions/conversations';\nimport { makeGetStatus } from 'flavours/glitch/selectors';\nimport { replyCompose } from 'flavours/glitch/actions/compose';\nimport { openModal } from 'flavours/glitch/actions/modal';\nimport { muteStatus, unmuteStatus, hideStatus, revealStatus } from 'flavours/glitch/actions/statuses';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },\n replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },\n});\n\nconst mapStateToProps = () => {\n const getStatus = makeGetStatus();\n\n return (state, { conversationId }) => {\n const conversation = state.getIn(['conversations', 'items']).find(x => x.get('id') === conversationId);\n const lastStatusId = conversation.get('last_status', null);\n\n return {\n accounts: conversation.get('accounts').map(accountId => state.getIn(['accounts', accountId], null)),\n unread: conversation.get('unread'),\n lastStatus: lastStatusId && getStatus(state, { id: lastStatusId }),\n };\n };\n};\n\nconst mapDispatchToProps = (dispatch, { intl, conversationId }) => ({\n\n markRead () {\n dispatch(markConversationRead(conversationId));\n },\n\n reply (status, router) {\n dispatch((_, getState) => {\n let state = getState();\n\n if (state.getIn(['compose', 'text']).trim().length !== 0) {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(messages.replyMessage),\n confirm: intl.formatMessage(messages.replyConfirm),\n onConfirm: () => dispatch(replyCompose(status, router)),\n }));\n } else {\n dispatch(replyCompose(status, router));\n }\n });\n },\n\n delete () {\n dispatch(deleteConversation(conversationId));\n },\n\n onMute (status) {\n if (status.get('muted')) {\n dispatch(unmuteStatus(status.get('id')));\n } else {\n dispatch(muteStatus(status.get('id')));\n }\n },\n\n onToggleHidden (status) {\n if (status.get('hidden')) {\n dispatch(revealStatus(status.get('id')));\n } else {\n dispatch(hideStatus(status.get('id')));\n }\n },\n\n});\n\nexport default injectIntl(connect(mapStateToProps, mapDispatchToProps)(Conversation));\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ConversationContainer from '../containers/conversation_container';\nimport ScrollableList from 'flavours/glitch/components/scrollable_list';\nimport { debounce } from 'lodash';\n\nexport default class ConversationsList extends ImmutablePureComponent {\n\n static propTypes = {\n conversations: ImmutablePropTypes.list.isRequired,\n hasMore: PropTypes.bool,\n isLoading: PropTypes.bool,\n onLoadMore: PropTypes.func,\n };\n\n getCurrentIndex = id => this.props.conversations.findIndex(x => x.get('id') === id)\n\n handleMoveUp = id => {\n const elementIndex = this.getCurrentIndex(id) - 1;\n this._selectChild(elementIndex, true);\n }\n\n handleMoveDown = id => {\n const elementIndex = this.getCurrentIndex(id) + 1;\n this._selectChild(elementIndex, false);\n }\n\n _selectChild (index, align_top) {\n const container = this.node.node;\n const element = container.querySelector(`article:nth-of-type(${index + 1}) .focusable`);\n\n if (element) {\n if (align_top && container.scrollTop > element.offsetTop) {\n element.scrollIntoView(true);\n } else if (!align_top && container.scrollTop + container.clientHeight < element.offsetTop + element.offsetHeight) {\n element.scrollIntoView(false);\n }\n element.focus();\n }\n }\n\n setRef = c => {\n this.node = c;\n }\n\n handleLoadOlder = debounce(() => {\n const last = this.props.conversations.last();\n\n if (last && last.get('last_status')) {\n this.props.onLoadMore(last.get('last_status'));\n }\n }, 300, { leading: true })\n\n render () {\n const { conversations, onLoadMore, ...other } = this.props;\n\n return (\n <ScrollableList {...other} onLoadMore={onLoadMore && this.handleLoadOlder} scrollKey='direct' ref={this.setRef}>\n {conversations.map(item => (\n <ConversationContainer\n key={item.get('id')}\n conversationId={item.get('id')}\n onMoveUp={this.handleMoveUp}\n onMoveDown={this.handleMoveDown}\n />\n ))}\n </ScrollableList>\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport ConversationsList from '../components/conversations_list';\nimport { expandConversations } from 'flavours/glitch/actions/conversations';\n\nconst mapStateToProps = state => ({\n conversations: state.getIn(['conversations', 'items']),\n isLoading: state.getIn(['conversations', 'isLoading'], true),\n hasMore: state.getIn(['conversations', 'hasMore'], false),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onLoadMore: maxId => dispatch(expandConversations({ maxId })),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ConversationsList);\n","import React from 'react';\nimport { connect } from 'react-redux';\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 { expandDirectTimeline } from 'flavours/glitch/actions/timelines';\nimport { mountConversations, unmountConversations, expandConversations } from 'flavours/glitch/actions/conversations';\nimport { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport ColumnSettingsContainer from './containers/column_settings_container';\nimport { connectDirectStream } from 'flavours/glitch/actions/streaming';\nimport { changeSetting } from 'flavours/glitch/actions/settings';\nimport ConversationsListContainer from './containers/conversations_list_container';\n\nconst messages = defineMessages({\n title: { id: 'column.direct', defaultMessage: 'Direct messages' },\n});\n\nconst mapStateToProps = state => ({\n hasUnread: state.getIn(['timelines', 'direct', 'unread']) > 0,\n conversationsMode: state.getIn(['settings', 'direct', 'conversations']),\n});\n\nexport default @connect(mapStateToProps)\n@injectIntl\nclass DirectTimeline extends React.PureComponent {\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 conversationsMode: PropTypes.bool,\n };\n\n handlePin = () => {\n const { columnId, dispatch } = this.props;\n\n if (columnId) {\n dispatch(removeColumn(columnId));\n } else {\n dispatch(addColumn('DIRECT', {}));\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, conversationsMode } = this.props;\n\n dispatch(mountConversations());\n\n if (conversationsMode) {\n dispatch(expandConversations());\n } else {\n dispatch(expandDirectTimeline());\n }\n\n this.disconnect = dispatch(connectDirectStream());\n }\n\n componentDidUpdate(prevProps) {\n const { dispatch, conversationsMode } = this.props;\n\n if (prevProps.conversationsMode && !conversationsMode) {\n dispatch(expandDirectTimeline());\n } else if (!prevProps.conversationsMode && conversationsMode) {\n dispatch(expandConversations());\n }\n }\n\n componentWillUnmount () {\n this.props.dispatch(unmountConversations());\n\n if (this.disconnect) {\n this.disconnect();\n this.disconnect = null;\n }\n }\n\n setRef = c => {\n this.column = c;\n }\n\n handleLoadMoreTimeline = maxId => {\n this.props.dispatch(expandDirectTimeline({ maxId }));\n }\n\n handleLoadMoreConversations = maxId => {\n this.props.dispatch(expandConversations({ maxId }));\n }\n\n handleTimelineClick = () => {\n this.props.dispatch(changeSetting(['direct', 'conversations'], false));\n }\n\n handleConversationsClick = () => {\n this.props.dispatch(changeSetting(['direct', 'conversations'], true));\n }\n\n render () {\n const { intl, hasUnread, columnId, multiColumn, conversationsMode } = this.props;\n const pinned = !!columnId;\n\n let contents;\n if (conversationsMode) {\n contents = (\n <ConversationsListContainer\n trackScroll={!pinned}\n scrollKey={`direct_timeline-${columnId}`}\n timelineId='direct'\n onLoadMore={this.handleLoadMore}\n emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage=\"You don't have any direct messages yet. When you send or receive one, it will show up here.\" />}\n />\n );\n } else {\n contents = (\n <StatusListContainer\n trackScroll={!pinned}\n scrollKey={`direct_timeline-${columnId}`}\n timelineId='direct'\n onLoadMore={this.handleLoadMoreTimeline}\n emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage=\"You don't have any direct messages yet. When you send or receive one, it will show up here.\" />}\n />\n );\n }\n\n return (\n <Column ref={this.setRef} label={intl.formatMessage(messages.title)}>\n <ColumnHeader\n icon='envelope'\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 />\n </ColumnHeader>\n\n <div className='notification__filter-bar'>\n <button\n className={conversationsMode ? 'active' : ''}\n onClick={this.handleConversationsClick}\n >\n <FormattedMessage\n id='direct.conversations_mode'\n defaultMessage='Conversations'\n />\n </button>\n <button\n className={conversationsMode ? '' : 'active'}\n onClick={this.handleTimelineClick}\n >\n <FormattedMessage\n id='direct.timeline_mode'\n defaultMessage='Timeline'\n />\n </button>\n </div>\n\n {contents}\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""} |