From 0f01c1bc9786bd766a08838d84a0988c90c1f6fb Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Tue, 24 Mar 2020 23:08:43 -0400 Subject: [PATCH] Progress --- app/javascript/gabsocial/actions/compose.js | 1 - app/javascript/gabsocial/actions/streaming.js | 2 - app/javascript/gabsocial/actions/timelines.js | 1 - .../gabsocial/assets/group_add_icon.js | 26 + app/javascript/gabsocial/assets/index.js | 4 + .../gabsocial/assets/list_add_icon.js | 34 + .../gabsocial/components/account.js | 3 + .../autosuggest_textbox.js | 81 +- .../gabsocial/components/composer.js | 36 + .../{footer_bar/footer_bar.js => footer.js} | 3 - .../components/footer_bar/footer_bar.scss | 45 - .../gabsocial/components/footer_bar/index.js | 1 - app/javascript/gabsocial/components/icon.js | 4 + app/javascript/gabsocial/components/list.js | 21 +- .../modal/all_timeline_settings_modal.js | 59 - .../components/modal/block_account_modal.js | 10 - .../community_timeline_settings_modal.js | 92 + .../components/modal/group_adder_modal.js | 72 - .../components/modal/group_create_modal.js | 30 + .../components/modal/group_delete_modal.js | 55 + .../modal/home_timeline_settings_modal.js | 2 +- .../components/modal/hotkeys_modal.js | 2 - .../components/modal/list_adder_modal.js | 72 - .../components/modal/list_create_modal.js | 30 + .../components/modal/list_delete_modal.js | 55 + .../modal/list_timeline_settings_modal.js | 119 + .../components/modal/modal_layout.js | 24 +- .../gabsocial/components/modal/modal_root.js | 18 +- .../gabsocial/components/modal/mute_modal.js | 11 - .../components/modal/pro_upgrade_modal.js | 2 +- .../components/panel/list_details_panel.js | 95 +- .../components/popover/popover_base.js | 3 + .../components/popover/popover_root.js | 4 +- .../popover/profile_options_popover.js | 2 +- .../popover/status_options_popover.js | 83 +- .../popover/status_share_popover.js | 91 + .../gabsocial/components/sidebar.js | 46 +- .../gabsocial/components/status/status.js | 3 +- .../gabsocial/components/status_action_bar.js | 21 +- .../components/status_action_bar_item.js | 11 +- .../gabsocial/components/status_check_box.js | 2 +- .../status_content/status_content.js | 2 + .../gabsocial/components/status_header.js | 88 +- .../gabsocial/components/status_list.js | 2 +- app/javascript/gabsocial/constants.js | 89 +- .../components/header/header.js | 6 - .../gabsocial/features/community_timeline.js | 79 + .../community_timeline/community_timeline.js | 109 - .../column_settings/column_settings.js | 49 - .../components/column_settings/index.js | 1 - .../features/community_timeline/index.js | 1 - .../emoji_picker_dropdown.js | 2 +- .../gabsocial/features/groups_collection.js | 20 +- .../index.js => home_timeline.js} | 6 +- .../column_settings/column_settings.js | 55 - .../components/column_settings/index.js | 1 - .../gabsocial/features/introduction.js | 2 + .../gabsocial/features/list_create.js | 1 + app/javascript/gabsocial/features/mutes.js | 35 +- .../gabsocial/features/status/status.js | 2 - app/javascript/gabsocial/features/ui/ui.js | 12 +- ...sync-components.js => async_components.js} | 0 .../features/ui/util/responsive_component.js | 48 + .../gabsocial/layouts/default_layout.js | 27 +- .../gabsocial/pages/community_page.js | 60 + app/javascript/gabsocial/pages/groups_page.js | 24 +- .../gabsocial/pages/hashtag_page.js | 61 + app/javascript/gabsocial/pages/list_page.js | 43 +- app/javascript/gabsocial/pages/lists_page.js | 31 +- .../gabsocial/pages/shortcuts_page.js | 62 + app/javascript/gabsocial/reducers/compose.js | 9 - app/javascript/gabsocial/reducers/search.js | 2 - app/javascript/gabsocial/reducers/settings.js | 48 +- app/javascript/gabsocial/utils/is_mobile.js | 17 +- app/serializers/rest/list_serializer.rb | 3 +- package.json | 1 + yarn.lock | 3938 +---------------- 77 files changed, 1484 insertions(+), 4728 deletions(-) create mode 100644 app/javascript/gabsocial/assets/group_add_icon.js create mode 100644 app/javascript/gabsocial/assets/list_add_icon.js create mode 100644 app/javascript/gabsocial/components/composer.js rename app/javascript/gabsocial/components/{footer_bar/footer_bar.js => footer.js} (96%) delete mode 100644 app/javascript/gabsocial/components/footer_bar/footer_bar.scss delete mode 100644 app/javascript/gabsocial/components/footer_bar/index.js delete mode 100644 app/javascript/gabsocial/components/modal/all_timeline_settings_modal.js create mode 100644 app/javascript/gabsocial/components/modal/community_timeline_settings_modal.js delete mode 100644 app/javascript/gabsocial/components/modal/group_adder_modal.js create mode 100644 app/javascript/gabsocial/components/modal/group_create_modal.js create mode 100644 app/javascript/gabsocial/components/modal/group_delete_modal.js delete mode 100644 app/javascript/gabsocial/components/modal/list_adder_modal.js create mode 100644 app/javascript/gabsocial/components/modal/list_create_modal.js create mode 100644 app/javascript/gabsocial/components/modal/list_delete_modal.js create mode 100644 app/javascript/gabsocial/components/modal/list_timeline_settings_modal.js create mode 100644 app/javascript/gabsocial/components/popover/status_share_popover.js create mode 100644 app/javascript/gabsocial/features/community_timeline.js delete mode 100644 app/javascript/gabsocial/features/community_timeline/community_timeline.js delete mode 100644 app/javascript/gabsocial/features/community_timeline/components/column_settings/column_settings.js delete mode 100644 app/javascript/gabsocial/features/community_timeline/components/column_settings/index.js delete mode 100644 app/javascript/gabsocial/features/community_timeline/index.js rename app/javascript/gabsocial/features/{home_timeline/index.js => home_timeline.js} (92%) delete mode 100644 app/javascript/gabsocial/features/home_timeline/components/column_settings/column_settings.js delete mode 100644 app/javascript/gabsocial/features/home_timeline/components/column_settings/index.js rename app/javascript/gabsocial/features/ui/util/{async-components.js => async_components.js} (100%) create mode 100644 app/javascript/gabsocial/features/ui/util/responsive_component.js create mode 100644 app/javascript/gabsocial/pages/community_page.js create mode 100644 app/javascript/gabsocial/pages/hashtag_page.js create mode 100644 app/javascript/gabsocial/pages/shortcuts_page.js diff --git a/app/javascript/gabsocial/actions/compose.js b/app/javascript/gabsocial/actions/compose.js index 4c390258..620ad4ed 100644 --- a/app/javascript/gabsocial/actions/compose.js +++ b/app/javascript/gabsocial/actions/compose.js @@ -22,7 +22,6 @@ export const COMPOSE_SUBMIT_FAIL = 'COMPOSE_SUBMIT_FAIL'; export const COMPOSE_REPLY = 'COMPOSE_REPLY'; export const COMPOSE_QUOTE = 'COMPOSE_QUOTE'; export const COMPOSE_REPLY_CANCEL = 'COMPOSE_REPLY_CANCEL'; -export const COMPOSE_DIRECT = 'COMPOSE_DIRECT'; export const COMPOSE_MENTION = 'COMPOSE_MENTION'; export const COMPOSE_RESET = 'COMPOSE_RESET'; export const COMPOSE_UPLOAD_REQUEST = 'COMPOSE_UPLOAD_REQUEST'; diff --git a/app/javascript/gabsocial/actions/streaming.js b/app/javascript/gabsocial/actions/streaming.js index 0baf42c9..074b2f43 100644 --- a/app/javascript/gabsocial/actions/streaming.js +++ b/app/javascript/gabsocial/actions/streaming.js @@ -57,9 +57,7 @@ const refreshHomeTimelineAndNotification = (dispatch, done) => { export const connectUserStream = () => connectTimelineStream('home', 'user', refreshHomeTimelineAndNotification); export const connectCommunityStream = ({ onlyMedia } = {}) => connectTimelineStream(`community${onlyMedia ? ':media' : ''}`, `public:local${onlyMedia ? ':media' : ''}`); -export const connectPublicStream = ({ onlyMedia } = {}) => connectTimelineStream(`public${onlyMedia ? ':media' : ''}`, `public${onlyMedia ? ':media' : ''}`); export const connectHashtagStream = (id, tag, accept) => connectTimelineStream(`hashtag:${id}`, `hashtag&tag=${tag}`, null, accept); -export const connectDirectStream = () => connectTimelineStream('direct', 'direct'); export const connectListStream = id => connectTimelineStream(`list:${id}`, `list&list=${id}`); export const connectGroupStream = id => connectTimelineStream(`group:${id}`, `group&group=${id}`); diff --git a/app/javascript/gabsocial/actions/timelines.js b/app/javascript/gabsocial/actions/timelines.js index 722a4cea..5f0a4e05 100644 --- a/app/javascript/gabsocial/actions/timelines.js +++ b/app/javascript/gabsocial/actions/timelines.js @@ -153,7 +153,6 @@ export function expandTimeline(timelineId, path, params = {}, done = noOp) { }; export const expandHomeTimeline = ({ maxId } = {}, done = noOp) => expandTimeline('home', '/api/v1/timelines/home', { max_id: maxId }, done); -export const expandPublicTimeline = ({ maxId, onlyMedia } = {}, done = noOp) => expandTimeline(`public${onlyMedia ? ':media' : ''}`, '/api/v1/timelines/public', { max_id: maxId, only_media: !!onlyMedia }, done); export const expandCommunityTimeline = ({ maxId, onlyMedia } = {}, done = noOp) => expandTimeline(`community${onlyMedia ? ':media' : ''}`, '/api/v1/timelines/public', { local: true, max_id: maxId, only_media: !!onlyMedia }, done); export const expandAccountTimeline = (accountId, { maxId, withReplies } = {}) => expandTimeline(`account:${accountId}${withReplies ? ':with_replies' : ''}`, `/api/v1/accounts/${accountId}/statuses`, { exclude_replies: !withReplies, max_id: maxId }); export const expandAccountFeaturedTimeline = accountId => expandTimeline(`account:${accountId}:pinned`, `/api/v1/accounts/${accountId}/statuses`, { pinned: true }); diff --git a/app/javascript/gabsocial/assets/group_add_icon.js b/app/javascript/gabsocial/assets/group_add_icon.js new file mode 100644 index 00000000..3614f360 --- /dev/null +++ b/app/javascript/gabsocial/assets/group_add_icon.js @@ -0,0 +1,26 @@ +const GroupAddIcon = ({ + className = '', + width = '24px', + height = '24px', + viewBox = '0 0 64 64', + title = 'Group Add', +}) => ( + + + + + +) + +export default GroupAddIcon \ No newline at end of file diff --git a/app/javascript/gabsocial/assets/index.js b/app/javascript/gabsocial/assets/index.js index 642abcef..737da93b 100644 --- a/app/javascript/gabsocial/assets/index.js +++ b/app/javascript/gabsocial/assets/index.js @@ -15,11 +15,13 @@ import ErrorIcon from './error_icon' import FullscreenIcon from './fullscreen_icon' import GlobeIcon from './globe_icon' import GroupIcon from './group_icon' +import GroupAddIcon from './group_add_icon' import HappyIcon from './happy_icon' import HomeIcon from './home_icon' import LikeIcon from './like_icon' import LinkIcon from './link_icon' import ListIcon from './list_icon' +import ListAddIcon from './list_add_icon' import LoadingIcon from './loading_icon' import MediaIcon from './media_icon' import MinimizeFullscreenIcon from './minimize_fullscreen_icon' @@ -58,11 +60,13 @@ export { FullscreenIcon, GlobeIcon, GroupIcon, + GroupAddIcon, HappyIcon, HomeIcon, LikeIcon, LinkIcon, ListIcon, + ListAddIcon, LoadingIcon, MediaIcon, MinimizeFullscreenIcon, diff --git a/app/javascript/gabsocial/assets/list_add_icon.js b/app/javascript/gabsocial/assets/list_add_icon.js new file mode 100644 index 00000000..fb46321b --- /dev/null +++ b/app/javascript/gabsocial/assets/list_add_icon.js @@ -0,0 +1,34 @@ +const ListAddIcon = ({ + className = '', + width = '24px', + height = '24px', + viewBox = '0 0 24 24', + title = 'List Add', +}) => ( + + + + + + + + + + + + + +) + +export default ListAddIcon \ No newline at end of file diff --git a/app/javascript/gabsocial/components/account.js b/app/javascript/gabsocial/components/account.js index 5bd5d026..c3ab12bc 100644 --- a/app/javascript/gabsocial/components/account.js +++ b/app/javascript/gabsocial/components/account.js @@ -109,6 +109,9 @@ class Account extends ImmutablePureComponent { const requested = account.getIn(['relationship', 'requested']) const blocking = account.getIn(['relationship', 'blocking']) + // : todo : + // unmute + if (requested || blocking) { buttonText = intl.formatMessage(requested ? messages.requested : messages.unblock) buttonOptions = { diff --git a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js index 22bb4c51..23b940ac 100644 --- a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js +++ b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js @@ -9,6 +9,7 @@ import { textAtCursorMatchesToken } from '../../utils/cursor_token_match' import AutosuggestAccount from '../autosuggest_account' import AutosuggestEmoji from '../autosuggest_emoji' import Input from '../input' +import Composer from '../composer' const cx = classNames.bind(_s) @@ -52,9 +53,9 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { } onChange = (e) => { - const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart, this.props.searchTokens); + const [tokenStart, token] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart, this.props.searchTokens); - console.log('onChange', e.target.value, e.target, this.textbox, tokenStart, token) + // console.log('onChange', e.target.value, e.target, this.textbox, tokenStart, token) if (token !== null && this.state.lastToken !== token) { this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart }); @@ -80,40 +81,40 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { // e.key may be a name of the physical key even in this case (e.x. Safari / Chrome on Mac) if (e.which === 229 || e.isComposing) return; - switch(e.key) { - case 'Escape': - if (suggestions.size === 0 || suggestionsHidden) { - document.querySelector('.ui').parentElement.focus(); - } else { - e.preventDefault(); - this.setState({ suggestionsHidden: true }); - } + switch (e.key) { + case 'Escape': + if (suggestions.size === 0 || suggestionsHidden) { + document.querySelector('.ui').parentElement.focus(); + } else { + e.preventDefault(); + this.setState({ suggestionsHidden: true }); + } - break; - case 'ArrowDown': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); - } + break; + case 'ArrowDown': + if (suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); + } - break; - case 'ArrowUp': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); - } + break; + case 'ArrowUp': + if (suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); + } - break; - case 'Enter': - case 'Tab': - // Select suggestion - if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - e.stopPropagation(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); - } + break; + case 'Enter': + case 'Tab': + // Select suggestion + if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + e.stopPropagation(); + this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); + } - break; + break; } if (e.defaultPrevented || !this.props.onKeyDown) return; @@ -151,7 +152,7 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { this.textbox.focus(); } - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { this.setState({ suggestionsHidden: false }); } @@ -194,7 +195,7 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { this.textbox = c; } - render () { + render() { const { value, small, @@ -245,13 +246,18 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { // tabindex="0" // no-focuscontainer-refocus="true" // style="outline: none; user-select: text; white-space: pre-wrap; overflow-wrap: break-word;"> - + if (textarea) { return ( - +
-