akkoma/priv/static/packs/features/direct_timeline.js

2 lines
No EOL
5.2 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{692:function(e,t,n){"use strict";n.r(t);var i=n(0),c=n(3),r=n(7),s=n(1),o=n(2),u=n.n(o),a=n(24),d=n(631),l=n(627),p=n(100),h=n(223),b=n(6),f=n(633),v=n(42),j=n(73),O=n(56),M=n.n(O),g=n(5),m=n.n(g),y=n(27),I=n.n(y),w=n(25),k=n(897),C=function(o){function e(){for(var a,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a=o.call.apply(o,[this].concat(t))||this,Object(s.a)(Object(c.a)(a),"handleClick",function(){if(a.context.router){var e=a.props,t=e.lastStatusId,n=e.unread,o=e.markRead;n&&o(),a.context.router.history.push("/statuses/"+t)}}),Object(s.a)(Object(c.a)(a),"handleHotkeyMoveUp",function(){a.props.onMoveUp(a.props.conversationId)}),Object(s.a)(Object(c.a)(a),"handleHotkeyMoveDown",function(){a.props.onMoveDown(a.props.conversationId)}),a}return Object(r.a)(e,o),e.prototype.render=function(){var e=this.props,t=e.accounts,n=e.lastStatusId,o=e.unread;return null===n?null:Object(i.a)(k.a,{id:n,unread:o,otherAccounts:t,onMoveUp:this.handleHotkeyMoveUp,onMoveDown:this.handleHotkeyMoveDown,onClick:this.handleClick})},e}(w.a);Object(s.a)(C,"contextTypes",{router:m.a.object}),Object(s.a)(C,"propTypes",{conversationId:m.a.string.isRequired,accounts:I.a.list.isRequired,lastStatusId:m.a.string,unread:m.a.bool.isRequired,onMoveUp:m.a.func,onMoveDown:m.a.func,markRead:m.a.func.isRequired});var L=Object(a.connect)(function(t,e){var n=e.conversationId,o=t.getIn(["conversations","items"]).find(function(e){return e.get("id")===n});return{accounts:o.get("accounts").map(function(e){return t.getIn(["accounts",e],null)}),unread:o.get("unread"),lastStatusId:o.get("last_status",null)}},function(e,t){var n=t.conversationId;return{markRead:function(){return e(Object(p.i)(n))}}})(C),R=n(889),U=function(a){function e(){for(var n,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return n=a.call.apply(a,[this].concat(t))||this,Object(s.a)(Object(c.a)(n),"getCurrentIndex",function(t){return n.props.conversations.findIndex(function(e){return e.get("id")===t})}),Object(s.a)(Object(c.a)(n),"handleMoveUp",function(e){var t=n.getCurrentIndex(e)-1;n._selectChild(t)}),Object(s.a)(Object(c.a)(n),"handleMoveDown",function(e){var t=n.getCurrentIndex(e)+1;n._selectChild(t)}),Object(s.a)(Object(c.a)(n),"setRef",function(e){n.node=e}),Object(s.a)(Object(c.a)(n),"handleLoadOlder",M()(function(){var e=n.props.conversations.last();e&&e.get("last_status")&&n.props.onLoadMore(e.get("last_status"))},300,{leading:!0})),n}Object(r.a)(e,a);var t=e.prototype;return t._selectChild=function(e){var t=this.node.node.querySelector("article:nth-of-type("+(e+1)+") .focusable");t&&t.focus()},t.render=function(){var t=this,e=this.props,n=e.conversations,o=e.onLoadMore,a=Object(j.a)(e,["conversations","onLoadMore"]);return u.a.createElement(R.a,Object(v.a)({},a,{onLoadMore:o&&this.handleLoadOlder,scrollKey:"direct",ref:this.setRef}),n.map(function(e){return Object(i.a)(L,{conversationId:e.get("id"),onMoveUp:t.handleMoveUp,onMoveDown:t.handleMoveDown},e.get("id"))}))},e}(w.a);Object(s.a)(U,"propTypes",{conversations:I.a.list.isRequired,hasMore:m.a.bool,isLoading:m.a.bool,onLoadMore:m.a.func,shouldUpdateScroll:m.a.func});var D,x=Object(a.connect)(function(e){return{conversations:e.getIn(["conversations","items"]),isLoading:e.getIn(["conversations","isLoading"],!0),hasMore:e.getIn(["conversations","hasMore"],!1)}},function(t){return{onLoadMore:function(e){return t(Object(p.h)({maxId:e}))}}})(U);n.d(t,"default",function(){return _});var S=Object(b.f)({title:{id:"column.direct",defaultMessage:"Direct messages"}}),_=Object(a.connect)()(D=Object(b.g)(D=function(a){function e(){for(var o,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o=a.call.apply(a,[this].concat(t))||this,Object(s.a)(Object(c.a)(o),"handlePin",function(){var e=o.props,t=e.columnId,n=e.dispatch;n(t?Object(h.h)(t):Object(h.e)("DIRECT",{}))}),Object(s.a)(Object(c.a)(o),"handleMove",function(e){var t=o.props,n=t.columnId;(0,t.dispatch)(Object(h.g)(n,e))}),Object(s.a)(Object(c.a)(o),"handleHeaderClick",function(){o.column.scrollTop()}),Object(s.a)(Object(c.a)(o),"setRef",function(e){o.column=e}),Object(s.a)(Object(c.a)(o),"handleLoadMore",function(e){o.props.dispatch(Object(p.h)({maxId:e}))}),o}Object(r.a)(e,a);var t=e.prototype;return t.componentDidMount=function(){var e=this.props.dispatch;e(Object(p.j)()),e(Object(p.h)()),this.disconnect=e(Object(f.b)())},t.componentWillUnmount=function(){this.props.dispatch(Object(p.k)()),this.disconnect&&(this.disconnect(),this.disconnect=null)},t.render=function(){var e=this.props,t=e.intl,n=e.hasUnread,o=e.columnId,a=e.multiColumn,c=e.shouldUpdateScroll,r=!!o;return u.a.createElement(d.a,{ref:this.setRef,label:t.formatMessage(S.title)},Object(i.a)(l.a,{icon:"envelope",active:n,title:t.formatMessage(S.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:r,multiColumn:a}),Object(i.a)(x,{trackScroll:!r,scrollKey:"direct_timeline-"+o,timelineId:"direct",onLoadMore:this.handleLoadMore,emptyMessage:Object(i.a)(b.b,{id:"empty_column.direct",defaultMessage:"You don't have any direct messages yet. When you send or receive one, it will show up here."}),shouldUpdateScroll:c}))},e}(u.a.PureComponent))||D)||D}}]);
//# sourceMappingURL=direct_timeline.js.map