From c02b20c4bbe64af3b6e931b8b80230497509154d Mon Sep 17 00:00:00 2001 From: Marquis Kurt Date: Mon, 17 Feb 2020 17:38:08 -0500 Subject: [PATCH] Revert "Merge pull request #173 from hyperspacedev/develop-1.1.0-feed-bug-masonry" This reverts commit dc83c5c2245fd3468e2e11d760c7fe3160fabeb9, reversing changes made to 9966aec3121521a1d0414511610b5b7496ba9054. --- .github/workflows/ci-win.yml | 21 +- LICENSE.txt => LICENSE | 53 +- README.md | 6 +- package-lock.json | 117 +--- package.json | 215 ++++--- public/config.json | 8 +- public/electron.js | 17 +- src/App.tsx | 53 +- src/components/AppLayout/AppLayout.styles.tsx | 7 +- src/components/AppLayout/AppLayout.tsx | 152 +---- src/components/Attachment/Attachment.tsx | 66 +- .../AudioPlayer/AudioPlayer.styles.tsx | 17 - src/components/AudioPlayer/AudioPlayer.tsx | 141 ---- src/components/AudioPlayer/index.tsx | 3 - src/components/Post/Post.styles.tsx | 9 - src/components/Post/Post.tsx | 602 +++++++++--------- src/interfaces/overrides.tsx | 11 +- src/interfaces/utils.tsx | 8 - src/pages/Activity.tsx | 344 ---------- src/pages/Compose.styles.tsx | 20 - src/pages/Compose.tsx | 393 ++---------- src/pages/Home.tsx | 66 +- src/pages/Local.tsx | 69 +- src/pages/Messages.tsx | 129 ++-- src/pages/Notifications.tsx | 253 +------- src/pages/PageLayout.styles.tsx | 18 +- src/pages/ProfilePage.tsx | 46 +- src/pages/Public.tsx | 69 +- src/pages/Recommendations.tsx | 166 ++++- src/pages/Requests.tsx | 215 ------- src/pages/Search.tsx | 67 +- src/pages/Settings.tsx | 128 +--- src/pages/Timeline.tsx | 440 ------------- src/pages/Welcome.tsx | 81 ++- src/types/Account.tsx | 1 - src/types/Attachment.tsx | 2 +- src/types/Draft.tsx | 13 - src/types/History.tsx | 5 - src/types/Tag.tsx | 3 - src/utilities/appbar.tsx | 26 - src/utilities/compose.tsx | 43 -- src/utilities/login.tsx | 8 +- src/utilities/settings.tsx | 9 +- 43 files changed, 915 insertions(+), 3205 deletions(-) rename LICENSE.txt => LICENSE (92%) delete mode 100644 src/components/AudioPlayer/AudioPlayer.styles.tsx delete mode 100644 src/components/AudioPlayer/AudioPlayer.tsx delete mode 100644 src/components/AudioPlayer/index.tsx delete mode 100644 src/interfaces/utils.tsx delete mode 100644 src/pages/Activity.tsx delete mode 100644 src/pages/Requests.tsx delete mode 100644 src/pages/Timeline.tsx delete mode 100644 src/types/Draft.tsx delete mode 100644 src/types/History.tsx delete mode 100644 src/utilities/compose.tsx diff --git a/.github/workflows/ci-win.yml b/.github/workflows/ci-win.yml index 17b1736..0e82160 100644 --- a/.github/workflows/ci-win.yml +++ b/.github/workflows/ci-win.yml @@ -12,27 +12,8 @@ jobs: uses: actions/setup-node@v1 with: node-version: 10.x - - name: Change desktop field - run: | - from json import load, dump - - json_dict = {} - with open('public/config.json', 'r') as file: - json_dict = load(file) - - json_dict["location"] = "desktop" - - with open('public/config.json', 'w+') as out: - dump(json_dict, out) - shell: python - name: Install dependencies and build run: | npm install npm run build --if-present - npm run build-desktop-win - - name: Upload Windows executable - uses: actions/upload-artifact@v1 - if: success() - with: - name: 'Windows executable (output dir)' - path: dist \ No newline at end of file + npm run build-desktop-win \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE similarity index 92% rename from LICENSE.txt rename to LICENSE index 2cf2ae0..b9a2340 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -1,24 +1,10 @@ -Hyperspace Desktop -Copyright Hyperspace Developers 2020 +Hyperspace +Copyright Hyperspace developers 2019 -NON-VIOLENT PUBLIC LICENSE v4 - -Preamble - -The Non-Violent Public license is a freedom-respecting sharealike license -for both the author of a work as well as those subject to a work. It aims -to protect the basic rights of human beings from exploitation and the earth -from plunder. It aims to ensure a copyrighted work is forever available -for public use, modification, and redistribution under the same terms so -long as the work is not used for harm. For more information about the NPL -refer to the official webpage - -Official Webpage: https://thufie.lain.haus/NPL.html - -Terms and Conditions +NON-VIOLENT PUBLIC LICENSE v1 THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -NON-VIOLENT PUBLIC LICENSE v4 ("LICENSE"). THE WORK IS PROTECTED BY +NON-VIOLENT PUBLIC LICENSE v1 ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND ALL OTHER APPLICABLE LAWS. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED IN THIS LICENSE, YOU AGREE @@ -52,9 +38,8 @@ AND CONDITIONS OF THIS LICENSE. timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. - c. "Bodily Harm" means any physical hurt or injury to a person that - interferes with the health or comfort of the person and that is more - more than merely transient or trifling in nature. + c. "Bodily Harm" means any action of one person towards another + in an intentional manner. d. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, @@ -76,7 +61,8 @@ AND CONDITIONS OF THIS LICENSE. f. "Incarceration" means confinement in a jail, prison, or any other place where individuals of any kind are held against - either their will or the will of their legal guardians. + either their will or the will of their legal guardians by physical + means. g. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. @@ -148,23 +134,13 @@ AND CONDITIONS OF THIS LICENSE. through which the Original Author and/or Distributor originally created, derived, and/or modified it. - o. "Surveilling" means the use of the Work to either - overtly or covertly observe and record persons and or their - activities. + o. "Surveilling" means the use of the Work to + overtly or covertly observe persons or their activities. p. "Web Service" means the use of a piece of Software to interpret or modify information that is subsequently and directly served to users over the Internet. - q. "Discriminate" means the use of a work to differentiate between - humans in a such a way which prioritizes some above others on the - basis of percieved membership within certain groups. - - r. "Hate Speech" means communication or any form - of expression which is solely for the purpose of expressing hatred - for some group or advocating a form of Discrimination - (to Discriminate per definition in (q)) between humans. - 2. FAIR DEALING RIGHTS Nothing in this License is intended to reduce, limit, or restrict any @@ -201,6 +177,7 @@ AND CONDITIONS OF THIS LICENSE. exercise the rights in other media and formats. Subject to Section 8(g), all rights not expressly granted by Licensor are hereby reserved. + 4. RESTRICTIONS @@ -255,15 +232,15 @@ AND CONDITIONS OF THIS LICENSE. or tracking individuals for financial gain. iii. You do not use the Work in an Act of War. iv. You do not use the Work for the purpose of supporting - or profiting from an Act of War. + an Act of War. v. You do not use the Work for the purpose of Incarceration. vi. You do not use the Work for the purpose of extracting oil, gas, or coal. vii. You do not use the Work for the purpose of expediting, coordinating, or facilitating paid work undertaken by individuals under the age of 12 years. - viii. You do not use the Work to either Discriminate or - spread Hate Speech on the basis of sex, sexual orientation, + viii. You do not use the Work to either discriminate or + spread hate speech on the basis of sex, sexual orientation, gender identity, race, age, disability, color, national origin, religion, or lower economic status. @@ -442,4 +419,4 @@ AND CONDITIONS OF THIS LICENSE. additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights - under applicable law. + under applicable law. \ No newline at end of file diff --git a/README.md b/README.md index 43b8f21..4c4bfaf 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Matrix room](https://img.shields.io/matrix/hypermasto:matrix.org.svg)](https://matrix.to/#/#hypermasto:matrix.org) [![Discord server](https://img.shields.io/discord/554108687434907660.svg?color=blueviolet&label=discord)](https://discord.gg/c69AXwk) -![Build Status](https://github.com/hyperspacedev/hyperspace/workflows/Node%20CI/badge.svg) [![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/hyperspacedev/hyperspace?include_prereleases)](https://github.com/hyperspacedev/hyperspace/releases) [![License: NPLv4+](https://img.shields.io/badge/license-NPLv4%2B-blue.svg)](LICENSE.txt) [![Hyperspace](https://snapcraft.io/hyperspace/badge.svg)](https://snapcraft.io/hyperspace) +![Build Status](https://github.com/hyperspacedev/hyperspace/workflows/Node%20CI/badge.svg) [![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/hyperspacedev/hyperspace?include_prereleases)](https://github.com/hyperspacedev/hyperspace/releases) [![Hyperspace](https://snapcraft.io/hyperspace/badge.svg)](https://snapcraft.io/hyperspace) Hyperspace is the fluffiest client for Mastodon and other fediverse networks written in TypeScript and React. Hyperspace offers a fun, clean, fast, and responsive design that scales beautifully across devices and enhances the fediverse experience. @@ -127,12 +127,12 @@ You'll also want to modify the `notarize.js` file to change the details from the ## Licensing and Credits -Hyperspace is licensed under the [Non-violent Public License v4+](LICENSE.txt), a permissive license under the conditions that you do not use this for any unethical purposes and to file patent claims. Please read what your rights are as a Hyperspace user/developer in the license for more information. +Hyperspace is licensed under the [Non-violent Public License](LICENSE), a permissive license under the conditions that you do not use this for any unethical purposes and to file patent claims. Please read what your rights are as a Hyperspace user/developer in the license for more information. Hyperspace has been made possible by the React, TypeScript, Megalodon, and Material-UI projects as well our [Patrons](patreon.md) and our contributors on GitHub. ## Contribute -Contribution guidelines are available in the [contributing file](.github/contributing.md) and when you make an issue/pull request. Additionally, you can access our [Code of Conduct](.github/code_of_conduct.md). +Contrubition guidelines are available in the [contributing file](.github/contributing.md) and when you make an issue/pull request. Additionally, you can access our [Code of Conduct](.github/code_of_conduct.md). If you want to aid the project in other ways, consider supporting the project on [Patreon](https://patreon.com/hyperspacedev). diff --git a/package-lock.json b/package-lock.json index 1fbea6f..ad6ab43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "hyperspace", - "version": "1.1.0-beta2", + "version": "1.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1055,23 +1055,13 @@ } }, "@material-ui/icons": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@material-ui/icons/-/icons-4.5.1.tgz", - "integrity": "sha512-YZ/BgJbXX4a0gOuKWb30mBaHaoXRqPanlePam83JQPZ/y4kl+3aW0Wv9tlR70hB5EGAkEJGW5m4ktJwMgxQAeA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@material-ui/icons/-/icons-3.0.2.tgz", + "integrity": "sha512-QY/3gJnObZQ3O/e6WjH+0ah2M3MOgLOzCy8HTUoUx9B6dDrS18vP7Ycw3qrDEKlB6q1KNxy6CZHm5FCauWGy2g==", "dev": true, "requires": { - "@babel/runtime": "^7.4.4" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.2.tgz", - "integrity": "sha512-JONRbXbTXc9WQE2mAZd1p0Z3DZ/6vaQIkgYMSTP3KjRCyd7rCZCcfhCyX+YjwcKxcZ82UrxbRD358bpExNgrjw==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.2" - } - } + "@babel/runtime": "^7.2.0", + "recompose": "0.28.0 - 0.30.0" } }, "@material-ui/system": { @@ -9461,9 +9451,9 @@ "dev": true }, "handlebars": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", - "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.0.tgz", + "integrity": "sha512-xkRtOt3/3DzTKMOt3xahj2M/EqNhY988T+imYSlMgs5fVhLN2fmKVVj0LtEGmb+3UUYV5Qmm1052Mm3dIQxOvw==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -10448,9 +10438,9 @@ } }, "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, "ip": { @@ -11848,12 +11838,12 @@ "integrity": "sha512-u93kb2fPbIrfzBuLjZE+w+fJbUUMhNDXxNmMfaqNgpfQf1CO5ZSe2LfsnBqVAk7i/2NF48OSoRj+Xe2VT+lE8Q==" }, "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { - "invert-kv": "^2.0.0" + "invert-kv": "^1.0.0" } }, "left-pad": { @@ -12275,22 +12265,12 @@ } }, "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - }, - "dependencies": { - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - } + "mimic-fn": "^1.0.0" } }, "memory-fs": { @@ -13256,40 +13236,14 @@ "dev": true }, "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "dev": true, "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - }, - "dependencies": { - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - } + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "os-tmpdir": { @@ -16822,11 +16776,6 @@ "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", "dev": true }, - "react-masonry-css": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/react-masonry-css/-/react-masonry-css-1.0.14.tgz", - "integrity": "sha512-oAPVOCMApTT0HkxZJy84yU1EWaaQNZnJE0DjDMy/L+LxZoJEph4RRXsT9ppPKbFSo/tCzj+cCLwiBHjZmZ2eXA==" - }, "react-router": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.1.2.tgz", @@ -19912,9 +19861,9 @@ } }, "typescript": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz", - "integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.1.tgz", + "integrity": "sha512-3NSMb2VzDQm8oBTLH6Nj55VVtUEpe/rgkIzMir0qVoLyjDZlnMBva0U6vDiV3IH+sl/Yu6oP5QwsAQtHPmDd2Q==", "dev": true }, "ua-parser-js": { @@ -21476,16 +21425,16 @@ "dev": true }, "yargs": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.1.tgz", - "integrity": "sha512-PRU7gJrJaXv3q3yQZ/+/X6KBswZiaQ+zOmdprZcouPYtQgvNU35i+68M4b1ZHLZtYFT5QObFLV+ZkmJYcwKdiw==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", "dev": true, "requires": { "cliui": "^4.0.0", "decamelize": "^1.1.1", "find-up": "^2.1.0", "get-caller-file": "^1.0.1", - "os-locale": "^3.1.0", + "os-locale": "^2.0.0", "require-directory": "^2.1.1", "require-main-filename": "^1.0.1", "set-blocking": "^2.0.0", diff --git a/package.json b/package.json index 03fc26b..d195ba7 100644 --- a/package.json +++ b/package.json @@ -1,115 +1,114 @@ { - "name": "hyperspace", - "productName": "Hyperspace Desktop", - "version": "1.1.0-beta4", - "description": "A beautiful, fluffy client for the fediverse", - "author": "Marquis Kurt ", - "repository": "https://github.com/hyperspacedev/hyperspace.git", - "private": true, - "homepage": "./", - "devDependencies": { - "@date-io/moment": "^1.3.11", - "@material-ui/core": "^3.9.3", - "@material-ui/icons": "^4.5.1", - "@types/emoji-mart": "^2.11.0", - "@types/jest": "^24.0.18", - "@types/node": "11.11.6", - "@types/react": "16.8.8", - "@types/react-dom": "16.8.3", - "@types/react-router-dom": "^4.3.5", - "@types/react-swipeable-views": "latest", - "axios": "^0.19.0", - "electron": "^6.0.11", - "electron-builder": "^21.2.0", - "emoji-mart": "^2.11.1", - "file-dialog": "^0.0.7", - "material-ui-pickers": "^2.2.4", - "mdi-material-ui": "^5.18.0", - "megalodon": "^0.6.4", - "moment": "^2.24.0", - "notistack": "^0.5.1", - "prettier": "1.18.2", - "query-string": "^6.8.3", - "react": "^16.10.2", - "react-dom": "^16.10.2", - "react-router-dom": "^5.1.2", - "react-scripts": "^2.1.8", - "react-swipeable-views": "^0.13.3", - "react-web-share-api": "^0.0.2", - "typescript": "^3.7.2" + "name": "hyperspace", + "productName": "Hyperspace Desktop", + "version": "1.0.4", + "description": "A beautiful, fluffy client for the fediverse", + "author": "Marquis Kurt ", + "repository": "https://github.com/hyperspacedev/hyperspace.git", + "private": true, + "homepage": "./", + "devDependencies": { + "@date-io/moment": "^1.3.11", + "@material-ui/core": "^3.9.3", + "@material-ui/icons": "^3.0.2", + "@types/emoji-mart": "^2.11.0", + "@types/jest": "^24.0.18", + "@types/node": "11.11.6", + "@types/react": "16.8.8", + "@types/react-dom": "16.8.3", + "@types/react-router-dom": "^4.3.5", + "@types/react-swipeable-views": "latest", + "axios": "^0.19.0", + "electron": "^6.0.11", + "electron-builder": "^21.2.0", + "emoji-mart": "^2.11.1", + "file-dialog": "^0.0.7", + "material-ui-pickers": "^2.2.4", + "mdi-material-ui": "^5.18.0", + "megalodon": "^0.6.4", + "moment": "^2.24.0", + "notistack": "^0.5.1", + "prettier": "1.18.2", + "query-string": "^6.8.3", + "react": "^16.10.2", + "react-dom": "^16.10.2", + "react-router-dom": "^5.1.2", + "react-scripts": "^2.1.8", + "react-swipeable-views": "^0.13.3", + "react-web-share-api": "^0.0.2", + "typescript": "3.4.1" + }, + "dependencies": { + "electron-notarize": "^0.1.1", + "electron-updater": "^4.1.2", + "electron-window-state": "^5.0.3" + }, + "main": "public/electron.js", + "scripts": { + "start": "HTTPS=true react-scripts start", + "electrify": "npm run build; electron .", + "electrify-nobuild": "electron .", + "build": "react-scripts build", + "create-mac-icon": "cd desktop; iconutil -c icns app.iconset; cd ..", + "build-desktop": "npm run build; npm run create-mac-icon; electron-builder -p 'never' -mwl deb AppImage snap", + "build-desktop-win": "electron-builder -p 'never' -w", + "build-desktop-darwin": "npm run create-mac-icon; electron-builder -p 'never' -m", + "build-desktop-darwin-nosign": "npm run create-mac-icon; electron-builder -p 'never' -m dmg -c.mac.identity=null -c.afterSign=\"desktop/donothing.js\"", + "build-desktop-linux": "electron-builder -p 'never' -l deb AppImage snap", + "build-desktop-linux-select": "electron-builder -p 'never' -l ", + "check-prettier": "prettier --check src/**/**.tsx", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": [ + ">0.2%", + "not dead", + "not ie <= 11", + "not op_mini all" + ], + "build": { + "appId": "net.marquiskurt.hyperspace", + "afterSign": "desktop/notarize.js", + "directories": { + "buildResources": "desktop" }, - "dependencies": { - "electron-notarize": "^0.1.1", - "electron-updater": "^4.1.2", - "electron-window-state": "^5.0.3", - "react-masonry-css": "^1.0.14" + "mac": { + "category": "public.app-category.social-networking", + "icon": "desktop/app.icns", + "target": [ + "dmg", + "mas" + ], + "darkModeSupport": true, + "hardenedRuntime": true }, - "main": "public/electron.js", - "scripts": { - "start": "react-scripts start", - "electrify": "npm run build; electron .", - "electrify-nobuild": "electron .", - "build": "react-scripts build", - "create-mac-icon": "cd desktop; iconutil -c icns app.iconset; cd ..", - "build-desktop": "npm run build; npm run create-mac-icon; electron-builder -p 'never' -mwl deb AppImage snap", - "build-desktop-win": "electron-builder -p 'never' -w", - "build-desktop-darwin": "npm run create-mac-icon; electron-builder -p 'never' -m", - "build-desktop-darwin-nosign": "npm run create-mac-icon; electron-builder -p 'never' -m dmg -c.mac.identity=null -c.afterSign=\"desktop/donothing.js\"", - "build-desktop-linux": "electron-builder -p 'never' -l deb AppImage snap", - "build-desktop-linux-select": "electron-builder -p 'never' -l ", - "check-prettier": "prettier --check src/**/**.tsx", - "test": "react-scripts test", - "eject": "react-scripts eject" + "mas": { + "entitlements": "desktop/entitlements.mas.plist", + "entitlementsInherit": "desktop/entitlements.mas.inherit.plist", + "provisioningProfile": "desktop/embedded.provisionprofile" }, - "eslintConfig": { - "extends": "react-app" + "dmg": { + "sign": false }, - "browserslist": [ - ">0.2%", - "not dead", - "not ie <= 11", - "not op_mini all" - ], - "build": { - "appId": "net.marquiskurt.hyperspace", - "afterSign": "desktop/notarize.js", - "directories": { - "buildResources": "desktop" - }, - "mac": { - "category": "public.app-category.social-networking", - "icon": "desktop/app.icns", - "target": [ - "dmg", - "mas" - ], - "darkModeSupport": true, - "hardenedRuntime": true - }, - "mas": { - "entitlements": "desktop/entitlements.mas.plist", - "entitlementsInherit": "desktop/entitlements.mas.inherit.plist", - "provisioningProfile": "desktop/embedded.provisionprofile" - }, - "dmg": { - "sign": false - }, - "win": { - "target": [ - "nsis" - ], - "icon": "desktop/app.ico" - }, - "linux": { - "target": [ - "${@:1}" - ], - "icon": "linux", - "category": "Network" - }, - "snap": { - "confinement": "strict", - "summary": "A beautiful, fluffy client for the fediverse" - } + "win": { + "target": [ + "nsis" + ], + "icon": "desktop/app.ico" + }, + "linux": { + "target": [ + "${@:1}" + ], + "icon": "linux", + "category": "Network" + }, + "snap": { + "confinement": "strict", + "summary": "A beautiful, fluffy client for the fediverse" } + } } diff --git a/public/config.json b/public/config.json index d3da563..22ba951 100644 --- a/public/config.json +++ b/public/config.json @@ -1,12 +1,12 @@ { - "version": "1.1.0", - "location": "https://hyperspaceapp-next.herokuapp.com", + "version": "1.0.4", + "location": "https://hyperspaceapp.herokuapp.com", "branding": { "name": "Hyperspace", "logo": "logo.svg", "background": "background.png" }, - "developer": true, + "developer": false, "federation": { "universalLogin": true, "allowPublicPosts": true, @@ -20,7 +20,7 @@ "account": "774314" }, "license": { - "name": "Non-violent Public License v4+", + "name": "Non-violent Public License", "url": "https://thufie.lain.haus/NPL.html" }, "repository": "https://github.com/hyperspacedev/hyperspace" diff --git a/public/electron.js b/public/electron.js index 547afe6..69ecaec 100644 --- a/public/electron.js +++ b/public/electron.js @@ -312,14 +312,6 @@ function createMenubar() { click() { safelyGoTo("hyperspace://hyperspace/app/#/messages") } - }, - { type: 'separator' }, - { - label: 'Activity', - accelerator: 'Alt+CmdOrCtrl+A', - click() { - safelyGoTo("hyperspace://hyperspace/app/#/activity") - } } ] }, @@ -334,7 +326,7 @@ function createMenubar() { } }, { - label: 'Recommendations', + label: 'Recommendations...', accelerator: "Alt+CmdOrCtrl+R", click() { safelyGoTo("hyperspace://hyperspace/app/#/recommended") @@ -348,13 +340,6 @@ function createMenubar() { safelyGoTo("hyperspace://hyperspace/app/#/you") } }, - { - label: 'Follow Requests', - accelerator: "Alt+CmdOrCtrl+E", - click() { - safelyGoTo("hyperspace://hyperspace/app/#/requests") - } - }, { label: 'Blocked Servers', accelerator: "Shift+CmdOrCtrl+B", diff --git a/src/App.tsx b/src/App.tsx index b9efc6e..da77bbb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,7 +8,9 @@ import AboutPage from "./pages/About"; import Settings from "./pages/Settings"; import { getUserDefaultBool, getUserDefaultTheme } from "./utilities/settings"; import ProfilePage from "./pages/ProfilePage"; -import TimelinePage from "./pages/Timeline"; +import HomePage from "./pages/Home"; +import LocalPage from "./pages/Local"; +import PublicPage from "./pages/Public"; import Conversation from "./pages/Conversation"; import NotificationsPage from "./pages/Notifications"; import SearchPage from "./pages/Search"; @@ -19,8 +21,6 @@ import RecommendationsPage from "./pages/Recommendations"; import Missingno from "./pages/Missingno"; import Blocked from "./pages/Blocked"; import You from "./pages/You"; -import RequestsPage from "./pages/Requests"; -import ActivityPage from "./pages/Activity"; import { withSnackbar } from "notistack"; import { PrivateRoute } from "./interfaces/overrides"; import { userLoggedIn } from "./utilities/accounts"; @@ -96,47 +96,10 @@ class App extends Component {
{this.state.showLayout ? : null} - ( - - )} - /> - ( - - )} - /> - ( - - )} - /> - ( - - )} - /> + + + + { path="/recommended" component={RecommendationsPage} /> - -
); diff --git a/src/components/AppLayout/AppLayout.styles.tsx b/src/components/AppLayout/AppLayout.styles.tsx index fd820ed..8c9824d 100644 --- a/src/components/AppLayout/AppLayout.styles.tsx +++ b/src/components/AppLayout/AppLayout.styles.tsx @@ -35,8 +35,7 @@ export const styles = (theme: Theme) => titleBarText: { fontSize: 12, paddingTop: 2, - paddingBottom: 1, - color: theme.palette.getContrastText(theme.palette.primary.main) + paddingBottom: 1 }, appBar: { zIndex: 1000, @@ -58,10 +57,6 @@ export const styles = (theme: Theme) => display: "none" } }, - appBarBackButton: { - marginLeft: -12, - marginRight: 20 - }, appBarTitle: { display: "none", [theme.breakpoints.up("md")]: { diff --git a/src/components/AppLayout/AppLayout.tsx b/src/components/AppLayout/AppLayout.tsx index bec8751..ffba805 100644 --- a/src/components/AppLayout/AppLayout.tsx +++ b/src/components/AppLayout/AppLayout.tsx @@ -28,7 +28,6 @@ import { ListItem, Tooltip } from "@material-ui/core"; - import MenuIcon from "@material-ui/icons/Menu"; import SearchIcon from "@material-ui/icons/Search"; import NotificationsIcon from "@material-ui/icons/Notifications"; @@ -42,10 +41,6 @@ import InfoIcon from "@material-ui/icons/Info"; import CreateIcon from "@material-ui/icons/Create"; import SupervisedUserCircleIcon from "@material-ui/icons/SupervisedUserCircle"; import ExitToAppIcon from "@material-ui/icons/ExitToApp"; -import TrendingUpIcon from "@material-ui/icons/TrendingUp"; -import BuildIcon from "@material-ui/icons/Build"; -import ArrowBackIcon from "@material-ui/icons/ArrowBack"; - import { styles } from "./AppLayout.styles"; import { MultiAccount, UAccount } from "../../types/Account"; import { @@ -68,81 +63,30 @@ import { getAccountRegistry, removeAccountFromRegistry } from "../../utilities/accounts"; -import { isChildView } from "../../utilities/appbar"; -/** - * The pre-define state interface for the app layout. - */ interface IAppLayoutState { - /** - * Whether the account menu is open or not. - */ acctMenuOpen: boolean; - - /** - * Whether the drawer is open (mobile-only). - */ drawerOpenOnMobile: boolean; - - /** - * The current user signed in. - */ currentUser?: UAccount; - - /** - * The number of notifications received. - */ notificationCount: number; - - /** - * Whether the log out dialog is open. - */ logOutOpen: boolean; - - /** - * Whether federation has been enabled in the config. - */ enableFederation?: boolean; - - /** - * The brand name of the app, if not "Hyperspace". - */ brandName?: string; - - /** - * Whether the app is in development mode. - */ developerMode?: boolean; } -/** - * The base app layout class. Responsible for the search bar, navigation menus, etc. - */ export class AppLayout extends Component { - /** - * The Mastodon client to operate with. - */ client: Mastodon; - - /** - * A stream listener to listen for new streaming events from Mastodon. - */ streamListener: any; - /** - * Construct the app layout. - * @param props The properties to pass in. - */ constructor(props: any) { super(props); - // Create the Mastodon client this.client = new Mastodon( localStorage.getItem("access_token") as string, (localStorage.getItem("baseurl") as string) + "/api/v1" ); - // Initialize the state this.state = { drawerOpenOnMobile: false, acctMenuOpen: false, @@ -150,20 +94,14 @@ export class AppLayout extends Component { logOutOpen: false }; - // Bind functions as properties to this class for reference this.toggleDrawerOnMobile = this.toggleDrawerOnMobile.bind(this); this.toggleAcctMenu = this.toggleAcctMenu.bind(this); this.clearBadge = this.clearBadge.bind(this); } - /** - * Run post-mount tasks such as getting account data and refreshing the config file. - */ componentDidMount() { - // Get the account data. this.getAccountData(); - // Read the config file and then update the state. getConfig().then((result: any) => { if (result !== undefined) { let config: Config = result; @@ -177,25 +115,18 @@ export class AppLayout extends Component { } }); - // Listen for notifications. this.streamNotifications(); } - /** - * Get updated credentials from Mastodon or pull information from local storage. - */ getAccountData() { - // Try to get updated credentials from Mastodon. this.client .get("/accounts/verify_credentials") .then((resp: any) => { - // Update the account if possible. let data: UAccount = resp.data; this.setState({ currentUser: data }); sessionStorage.setItem("id", data.id); }) .catch((err: Error) => { - // Otherwise, pull from local storage. this.props.enqueueSnackbar( "Couldn't find profile info: " + err.name ); @@ -205,14 +136,9 @@ export class AppLayout extends Component { }); } - /** - * Set up a stream listener and listen for notifications. - */ streamNotifications() { - // Set up the stream listener. this.streamListener = this.client.stream("/streaming/user"); - // Set the count if the user asked to display the total count. if (getUserDefaultBool("displayAllOnNotificationBadge")) { this.client.get("/notifications").then((resp: any) => { let notifArray = resp.data; @@ -220,17 +146,14 @@ export class AppLayout extends Component { }); } - // Listen for notifications. this.streamListener.on("notification", (notif: Notification) => { const notificationCount = this.state.notificationCount + 1; this.setState({ notificationCount }); - // Update the badge on the desktop. if (isDesktopApp()) { getElectronApp().setBadgeCount(notificationCount); } - // Set up a push notification if the window isn't in focus. if (!document.hasFocus()) { let primaryMessage = ""; let secondaryMessage = ""; @@ -289,54 +212,34 @@ export class AppLayout extends Component { break; } - // Respectfully send the notification request. sendNotificationRequest(primaryMessage, secondaryMessage); } }); } - /** - * Toggle the account menu. - */ toggleAcctMenu() { this.setState({ acctMenuOpen: !this.state.acctMenuOpen }); } - /** - * Toggle the app drawer, if on mobile. - */ toggleDrawerOnMobile() { this.setState({ drawerOpenOnMobile: !this.state.drawerOpenOnMobile }); } - /** - * Toggle the logout dialog. - */ toggleLogOutDialog() { this.setState({ logOutOpen: !this.state.logOutOpen }); } - /** - * Perform a search and redirect to the search page. - * @param what The query input from the search box - */ searchForQuery(what: string) { - what = what.replace(/^#/g, "tag:"); - console.log(what); window.location.href = isDesktopApp() ? "hyperspace://hyperspace/app/index.html#/search?query=" + what : "/#/search?query=" + what; } - /** - * Clear login information, remove the account from the registry, and reload the web page. - */ logOutAndRestart() { let loginData = localStorage.getItem("login"); if (loginData) { - // Remove account from the registry. let registry = getAccountRegistry(); registry.forEach((registryItem: MultiAccount, index: number) => { @@ -348,20 +251,15 @@ export class AppLayout extends Component { } }); - // Clear some of the local storage fields. let items = ["login", "account", "baseurl", "access_token"]; items.forEach(entry => { localStorage.removeItem(entry); }); - // Finally, reload. window.location.reload(); } } - /** - * Clear the notifications badge. - */ clearBadge() { if (!getUserDefaultBool("displayAllOnNotificationBadge")) { this.setState({ notificationCount: 0 }); @@ -372,9 +270,6 @@ export class AppLayout extends Component { } } - /** - * Render the title bar. - */ titlebar() { const { classes } = this.props; if (isDarwinApp()) { @@ -395,20 +290,13 @@ export class AppLayout extends Component { return (
- {" "} - Careful: you're running in developer mode. + 🛠 Careful: you're running in developer mode.
); } } - /** - * Render the app drawer. On the desktop, this appears as a sidebar in larger layouts. - */ appDrawer() { const { classes } = this.props; return ( @@ -542,13 +430,7 @@ export class AppLayout extends Component { - Community - - - - - - + More { - + - - More @@ -578,9 +458,6 @@ export class AppLayout extends Component { ); } - /** - * Render the entire layout. - */ render() { const { classes } = this.props; return ( @@ -589,18 +466,6 @@ export class AppLayout extends Component { {this.titlebar()} - {isDesktopApp() && - isChildView(window.location.hash) ? ( - window.history.back()} - > - - - ) : null} - { Edit profile - - - Manage follow requests - - - { variant="temporary" anchor={"left"} open={this.state.drawerOpenOnMobile} - onClick={this.toggleDrawerOnMobile} + onClose={this.toggleDrawerOnMobile} classes={{ paper: classes.drawerPaper }} > {this.appDrawer()} diff --git a/src/components/Attachment/Attachment.tsx b/src/components/Attachment/Attachment.tsx index 874bf31..348cc2e 100644 --- a/src/components/Attachment/Attachment.tsx +++ b/src/components/Attachment/Attachment.tsx @@ -7,7 +7,6 @@ import { } from "@material-ui/core"; import { styles } from "./Attachment.styles"; import { Attachment } from "../../types/Attachment"; -import AudioPlayer from "../AudioPlayer"; import SwipeableViews from "react-swipeable-views"; interface IAttachmentProps { @@ -77,15 +76,11 @@ class AttachmentComponent extends Component< className={classes.mediaObject} /> ); - case "audio": - return ; case "gifv": return ( -