X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=priv%2Fstatic%2Fpacks%2Ffeatures%2Faccount_gallery.js.map;h=6c6a30c9439795078d54a90f3f24a9838494bad9;hb=59680f27ff0e1da2eb3c0506e3655f5c7b86a7ec;hp=c3ca6a4d6697020089c164fed9a510b9704a5730;hpb=90986667cedb20b316ae4e160729d78d692d0c0e;p=akkoma
diff --git a/priv/static/packs/features/account_gallery.js.map b/priv/static/packs/features/account_gallery.js.map
index c3ca6a4d6..6c6a30c94 100644
--- a/priv/static/packs/features/account_gallery.js.map
+++ b/priv/static/packs/features/account_gallery.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/account_gallery/components/media_item.js","webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/account_gallery/index.js"],"names":["MediaItem","visible","displayMedia","_this","props","media","getIn","state","setState","render","label","icon","this","status","get","x","y","style","Object","jsx","className","backgroundImage","backgroundPosition","components_icon","id","permalink","to","href","onInterceptClick","handleClick","ImmutablePureComponent","ImmutablePropTypes","map","isRequired","LoadMoreMedia","onLoadMore","maxId","load_more","disabled","onClick","handleLoadMore","shouldUpdateScroll","PropTypes","func","string","AccountGallery","connect","isAccount","params","accountId","medias","getAccountGallery","isLoading","hasMore","_this2","size","last","undefined","e","_e$target","target","scrollTop","scrollHeight","clientHeight","handleScrollToBottom","dispatch","expandAccountMediaTimeline","preventDefault","componentDidMount","fetchAccount","componentWillReceiveProps","nextProps","_this3","_this$props","column","missing_indicator","loadOlder","loading_indicator","handleLoadOlder","column_back_button","react_router_scroll_4_es","scrollKey","onScroll","handleScroll","header_container","role","index","account_gallery_LoadMoreMedia","media_item_MediaItem","object","list","bool"],"mappings":"uQAOqBA,wLAMX,CACNC,QAA0B,aAAjBC,MAAgCC,EAAKC,MAAMC,MAAMC,MAAM,CAAC,SAAU,eAAkC,aAAjBJ,+CAGhF,WACZ,OAAKC,EAAKI,MAAMN,UACd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OAAKE,UAAU,2BAAf,EACEF,OAAAC,EAAA,EAAAD,CAAC2D,EAAA,EAAD,aAlGa/C,+BAER,CACjBkB,OAAQN,IAAU+C,OAAOxD,WACzBgC,SAAUvB,IAAUC,KAAKV,WACzBiB,OAAQnB,IAAmB2D,KAAKzD,WAChCmB,UAAWV,IAAUiD,KACrBtC,QAASX,IAAUiD,KACnB5C,UAAWL,IAAUiD","file":"features/account_gallery.js","sourcesContent":["import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport Permalink from '../../../components/permalink';\nimport { displayMedia } from '../../../initial_state';\nimport Icon from 'mastodon/components/icon';\n\nexport default class MediaItem extends ImmutablePureComponent {\n\n static propTypes = {\n media: ImmutablePropTypes.map.isRequired,\n };\n\n state = {\n visible: displayMedia !== 'hide_all' && !this.props.media.getIn(['status', 'sensitive']) || displayMedia === 'show_all',\n };\n\n handleClick = () => {\n if (!this.state.visible) {\n this.setState({ visible: true });\n return true;\n }\n\n return false;\n }\n\n render () {\n const { media } = this.props;\n const { visible } = this.state;\n const status = media.get('status');\n const focusX = media.getIn(['meta', 'focus', 'x']);\n const focusY = media.getIn(['meta', 'focus', 'y']);\n const x = ((focusX / 2) + .5) * 100;\n const y = ((focusY / -2) + .5) * 100;\n const style = {};\n\n let label, icon;\n\n if (media.get('type') === 'gifv') {\n label = GIF;\n }\n\n if (visible) {\n style.backgroundImage = `url(${media.get('preview_url')})`;\n style.backgroundPosition = `${x}% ${y}%`;\n } else {\n icon = (\n \n \n \n );\n }\n\n return (\n
\n
\n {icon}\n {label}\n \n
\n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport { fetchAccount } from '../../actions/accounts';\nimport { expandAccountMediaTimeline } from '../../actions/timelines';\nimport LoadingIndicator from '../../components/loading_indicator';\nimport Column from '../ui/components/column';\nimport ColumnBackButton from '../../components/column_back_button';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { getAccountGallery } from '../../selectors';\nimport MediaItem from './components/media_item';\nimport HeaderContainer from '../account_timeline/containers/header_container';\nimport { ScrollContainer } from 'react-router-scroll-4';\nimport LoadMore from '../../components/load_more';\nimport MissingIndicator from 'mastodon/components/missing_indicator';\n\nconst mapStateToProps = (state, props) => ({\n isAccount: !!state.getIn(['accounts', props.params.accountId]),\n medias: getAccountGallery(state, props.params.accountId),\n isLoading: state.getIn(['timelines', `account:${props.params.accountId}:media`, 'isLoading']),\n hasMore: state.getIn(['timelines', `account:${props.params.accountId}:media`, 'hasMore']),\n});\n\nclass LoadMoreMedia extends ImmutablePureComponent {\n\n static propTypes = {\n shouldUpdateScroll: PropTypes.func,\n maxId: PropTypes.string,\n onLoadMore: PropTypes.func.isRequired,\n };\n\n handleLoadMore = () => {\n this.props.onLoadMore(this.props.maxId);\n }\n\n render () {\n return (\n \n );\n }\n\n}\n\nexport default @connect(mapStateToProps)\nclass AccountGallery extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n medias: ImmutablePropTypes.list.isRequired,\n isLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n isAccount: PropTypes.bool,\n };\n\n componentDidMount () {\n this.props.dispatch(fetchAccount(this.props.params.accountId));\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId));\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {\n this.props.dispatch(fetchAccount(nextProps.params.accountId));\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId));\n }\n }\n\n handleScrollToBottom = () => {\n if (this.props.hasMore) {\n this.handleLoadMore(this.props.medias.size > 0 ? this.props.medias.last().getIn(['status', 'id']) : undefined);\n }\n }\n\n handleScroll = (e) => {\n const { scrollTop, scrollHeight, clientHeight } = e.target;\n const offset = scrollHeight - scrollTop - clientHeight;\n\n if (150 > offset && !this.props.isLoading) {\n this.handleScrollToBottom();\n }\n }\n\n handleLoadMore = maxId => {\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId, { maxId }));\n };\n\n handleLoadOlder = (e) => {\n e.preventDefault();\n this.handleScrollToBottom();\n }\n\n render () {\n const { medias, shouldUpdateScroll, isLoading, hasMore, isAccount } = this.props;\n\n if (!isAccount) {\n return (\n \n \n \n );\n }\n\n let loadOlder = null;\n\n if (!medias && isLoading) {\n return (\n \n \n \n );\n }\n\n if (hasMore && !(isLoading && medias.size === 0)) {\n loadOlder = ;\n }\n\n return (\n \n \n\n \n \n
\n\n
\n {medias.map((media, index) => media === null ? (\n 0 ? medias.getIn(index - 1, 'id') : null}\n onLoadMore={this.handleLoadMore}\n />\n ) : (\n \n ))}\n {loadOlder}\n
\n\n {isLoading && medias.size === 0 && (\n
\n \n
\n )}\n
\n \n \n );\n }\n\n}\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/account_gallery/components/media_item.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/account_gallery/index.js"],"names":["MediaItem","visible","displayMedia","props","attachment","getIn","loaded","c","canvas","setState","e","hoverToPlay","target","play","pause","currentTime","button","ctrlKey","metaKey","preventDefault","state","onOpenMedia","componentDidMount","this","get","_decode","componentDidUpdate","prevProps","hash","pixels","decode","ctx","getContext","imageData","ImageData","putImageData","autoPlayGif","indexOf","render","icon","displayWidth","width","Math","floor","height","status","title","thumbnail","className","id","x","y","src","alt","style","objectPosition","onLoad","handleImageLoad","autoPlay","isIOS","label","classNames","autoplay","aria-label","role","onMouseEnter","handleMouseEnter","onMouseLeave","handleMouseLeave","loop","muted","href","onClick","handleClick","rel","ref","setCanvasRef","ImmutablePureComponent","ImmutablePropTypes","map","isRequired","PropTypes","number","func","LoadMoreMedia","onLoadMore","maxId","disabled","handleLoadMore","shouldUpdateScroll","string","AccountGallery","connect","isAccount","params","accountId","attachments","getAccountGallery","isLoading","hasMore","size","last","undefined","scrollTop","scrollHeight","clientHeight","handleScrollToBottom","dispatch","expandAccountMediaTimeline","openModal","media","index","findIndex","offsetWidth","fetchAccount","componentWillReceiveProps","nextProps","multiColumn","loadOlder","handleLoadOlder","scrollKey","onScroll","handleScroll","handleRef","handleOpenMedia","object","list","bool"],"mappings":"oWAUqBA,E,iNAQX,CACNC,QAA0B,aAAjBC,MAAgC,EAAKC,MAAMC,WAAWC,MAAM,CAAC,SAAU,eAAkC,aAAjBH,IACjGI,QAAQ,I,2CA2BK,SAAAC,GACb,EAAKC,OAASD,K,8CAGE,WAChB,EAAKE,SAAS,CAAEH,QAAQ,O,+CAGP,SAAAI,GACb,EAAKC,eACPD,EAAEE,OAAOC,U,+CAIM,SAAAH,GACb,EAAKC,gBACPD,EAAEE,OAAOE,QACTJ,EAAEE,OAAOG,YAAc,M,0CAQb,SAAAL,GACK,IAAbA,EAAEM,QAAkBN,EAAEO,SAAWP,EAAEQ,UACrCR,EAAES,iBAEE,EAAKC,MAAMnB,QACb,EAAKE,MAAMkB,YAAY,EAAKlB,MAAMC,YAElC,EAAKK,SAAS,CAAER,SAAS,Q,6BAxD/BqB,kBAAA,WACMC,KAAKpB,MAAMC,WAAWoB,IAAI,aAC5BD,KAAKE,W,EAITC,mBAAA,SAAoBC,GACdA,EAAUvB,WAAWoB,IAAI,cAAgBD,KAAKpB,MAAMC,WAAWoB,IAAI,aAAeD,KAAKpB,MAAMC,WAAWoB,IAAI,aAC9GD,KAAKE,W,EAITA,QAAA,WACE,IAAMG,EAASL,KAAKpB,MAAMC,WAAWoB,IAAI,YACnCK,EAASC,iBAAOF,EAAM,GAAI,IAEhC,GAAIC,EAAQ,CACV,IAAME,EAAYR,KAAKf,OAAOwB,WAAW,MACnCC,EAAY,IAAIC,UAAUL,EAAQ,GAAI,IAE5CE,EAAII,aAAaF,EAAW,EA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EAAY3F,MAAM0G,EAAQ,EAAG,OAE3D,YAAC,EAAD,CAAsC3G,WAAYA,EAAYoC,aAAcC,EAAOpB,YAAa,EAAKuG,iBAArFxH,EAAWoB,IAAI,UAGhC8F,GAGFpB,GAAkC,IAArBF,EAAYI,MACxB,mBAAKpD,UAAU,2BAAf,EACE,YAAC,IAAD,S,GArHa6B,K,0BAER,CACjBiB,OAAQb,IAAU4C,OAAO7C,WACzB2B,SAAU1B,IAAUE,KAAKH,WACzBgB,YAAalB,IAAmBgD,KAAK9C,WACrCkB,UAAWjB,IAAU8C,KACrB5B,QAASlB,IAAU8C,KACnBlC,UAAWZ,IAAU8C,KACrBV,YAAapC,IAAU8C,O","file":"features/account_gallery.js","sourcesContent":["import { decode } from 'blurhash';\nimport classNames from 'classnames';\nimport Icon from 'mastodon/components/icon';\nimport { autoPlayGif, displayMedia } from 'mastodon/initial_state';\nimport { isIOS } from 'mastodon/is_mobile';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\n\nexport default class MediaItem extends ImmutablePureComponent {\n\n static propTypes = {\n attachment: ImmutablePropTypes.map.isRequired,\n displayWidth: PropTypes.number.isRequired,\n onOpenMedia: PropTypes.func.isRequired,\n };\n\n state = {\n visible: displayMedia !== 'hide_all' && !this.props.attachment.getIn(['status', 'sensitive']) || displayMedia === 'show_all',\n loaded: false,\n };\n\n componentDidMount () {\n if (this.props.attachment.get('blurhash')) {\n this._decode();\n }\n }\n\n componentDidUpdate (prevProps) {\n if (prevProps.attachment.get('blurhash') !== this.props.attachment.get('blurhash') && this.props.attachment.get('blurhash')) {\n this._decode();\n }\n }\n\n _decode () {\n const hash = this.props.attachment.get('blurhash');\n const pixels = decode(hash, 32, 32);\n\n if (pixels) {\n const ctx = this.canvas.getContext('2d');\n const imageData = new ImageData(pixels, 32, 32);\n\n ctx.putImageData(imageData, 0, 0);\n }\n }\n\n setCanvasRef = c => {\n this.canvas = c;\n }\n\n handleImageLoad = () => {\n this.setState({ loaded: true });\n }\n\n handleMouseEnter = e => {\n if (this.hoverToPlay()) {\n e.target.play();\n }\n }\n\n handleMouseLeave = e => {\n if (this.hoverToPlay()) {\n e.target.pause();\n e.target.currentTime = 0;\n }\n }\n\n hoverToPlay () {\n return !autoPlayGif && ['gifv', 'video'].indexOf(this.props.attachment.get('type')) !== -1;\n }\n\n handleClick = e => {\n if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n e.preventDefault();\n\n if (this.state.visible) {\n this.props.onOpenMedia(this.props.attachment);\n } else {\n this.setState({ visible: true });\n }\n }\n }\n\n render () {\n const { attachment, displayWidth } = this.props;\n const { visible, loaded } = this.state;\n\n const width = `${Math.floor((displayWidth - 4) / 3) - 4}px`;\n const height = width;\n const status = attachment.get('status');\n const title = status.get('spoiler_text') || attachment.get('description');\n\n let thumbnail = '';\n let icon;\n\n if (attachment.get('type') === 'unknown') {\n // Skip\n } else if (attachment.get('type') === 'audio') {\n thumbnail = (\n \n \n \n );\n } else if (attachment.get('type') === 'image') {\n const focusX = attachment.getIn(['meta', 'focus', 'x']) || 0;\n const focusY = attachment.getIn(['meta', 'focus', 'y']) || 0;\n const x = ((focusX / 2) + .5) * 100;\n const y = ((focusY / -2) + .5) * 100;\n\n thumbnail = (\n
\n );\n } else if (['gifv', 'video'].indexOf(attachment.get('type')) !== -1) {\n const autoPlay = !isIOS() && autoPlayGif;\n const label = attachment.get('type') === 'video' ? : 'GIF';\n\n thumbnail = (\n \n \n\n {label}\n
\n );\n }\n\n if (!visible) {\n icon = (\n \n \n \n );\n }\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport { fetchAccount } from 'mastodon/actions/accounts';\nimport { expandAccountMediaTimeline } from '../../actions/timelines';\nimport LoadingIndicator from 'mastodon/components/loading_indicator';\nimport Column from '../ui/components/column';\nimport ColumnBackButton from 'mastodon/components/column_back_button';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { getAccountGallery } from 'mastodon/selectors';\nimport MediaItem from './components/media_item';\nimport HeaderContainer from '../account_timeline/containers/header_container';\nimport { ScrollContainer } from 'react-router-scroll-4';\nimport LoadMore from 'mastodon/components/load_more';\nimport MissingIndicator from 'mastodon/components/missing_indicator';\nimport { openModal } from 'mastodon/actions/modal';\n\nconst mapStateToProps = (state, props) => ({\n isAccount: !!state.getIn(['accounts', props.params.accountId]),\n attachments: getAccountGallery(state, props.params.accountId),\n isLoading: state.getIn(['timelines', `account:${props.params.accountId}:media`, 'isLoading']),\n hasMore: state.getIn(['timelines', `account:${props.params.accountId}:media`, 'hasMore']),\n});\n\nclass LoadMoreMedia extends ImmutablePureComponent {\n\n static propTypes = {\n shouldUpdateScroll: PropTypes.func,\n maxId: PropTypes.string,\n onLoadMore: PropTypes.func.isRequired,\n };\n\n handleLoadMore = () => {\n this.props.onLoadMore(this.props.maxId);\n }\n\n render () {\n return (\n \n );\n }\n\n}\n\nexport default @connect(mapStateToProps)\nclass AccountGallery extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n attachments: ImmutablePropTypes.list.isRequired,\n isLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n isAccount: PropTypes.bool,\n multiColumn: PropTypes.bool,\n };\n\n state = {\n width: 323,\n };\n\n componentDidMount () {\n this.props.dispatch(fetchAccount(this.props.params.accountId));\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId));\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {\n this.props.dispatch(fetchAccount(nextProps.params.accountId));\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId));\n }\n }\n\n handleScrollToBottom = () => {\n if (this.props.hasMore) {\n this.handleLoadMore(this.props.attachments.size > 0 ? this.props.attachments.last().getIn(['status', 'id']) : undefined);\n }\n }\n\n handleScroll = e => {\n const { scrollTop, scrollHeight, clientHeight } = e.target;\n const offset = scrollHeight - scrollTop - clientHeight;\n\n if (150 > offset && !this.props.isLoading) {\n this.handleScrollToBottom();\n }\n }\n\n handleLoadMore = maxId => {\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId, { maxId }));\n };\n\n handleLoadOlder = e => {\n e.preventDefault();\n this.handleScrollToBottom();\n }\n\n handleOpenMedia = attachment => {\n if (attachment.get('type') === 'video') {\n this.props.dispatch(openModal('VIDEO', { media: attachment, status: attachment.get('status') }));\n } else if (attachment.get('type') === 'audio') {\n this.props.dispatch(openModal('AUDIO', { media: attachment, status: attachment.get('status') }));\n } else {\n const media = attachment.getIn(['status', 'media_attachments']);\n const index = media.findIndex(x => x.get('id') === attachment.get('id'));\n\n this.props.dispatch(openModal('MEDIA', { media, index, status: attachment.get('status') }));\n }\n }\n\n handleRef = c => {\n if (c) {\n this.setState({ width: c.offsetWidth });\n }\n }\n\n render () {\n const { attachments, shouldUpdateScroll, isLoading, hasMore, isAccount, multiColumn } = this.props;\n const { width } = this.state;\n\n if (!isAccount) {\n return (\n \n \n \n );\n }\n\n if (!attachments && isLoading) {\n return (\n \n \n \n );\n }\n\n let loadOlder = null;\n\n if (hasMore && !(isLoading && attachments.size === 0)) {\n loadOlder = ;\n }\n\n return (\n \n \n\n \n \n
\n\n
\n {attachments.map((attachment, index) => attachment === null ? (\n 0 ? attachments.getIn(index - 1, 'id') : null} onLoadMore={this.handleLoadMore} />\n ) : (\n \n ))}\n\n {loadOlder}\n
\n\n {isLoading && attachments.size === 0 && (\n
\n \n
\n )}\n
\n \n \n );\n }\n\n}\n"],"sourceRoot":""}
\ No newline at end of file