Merge branch 'development' of https://github.com/Stremio/stremio-web into redesign

This commit is contained in:
Tim 2023-08-22 12:23:03 +02:00
commit 0cb651b12b
312 changed files with 669 additions and 412 deletions

View file

@ -24,5 +24,5 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
destination_dir: ${{ github.ref_name != 'development' && github.ref_name || '' }}
destination_dir: ${{ github.ref_name }}
allow_empty_commit: true

View file

@ -1,7 +1,7 @@
# Stremio - Freedom to Stream
![Build](https://github.com/stremio/stremio-web/workflows/Build/badge.svg?branch=development)
[![Netlify](https://api.netlify.com/api/v1/badges/ac26d7ae-d08b-4cc4-a14d-a83ba7c3e8ca/deploy-status)](https://stremio-development.netlify.app)
[![Github Page](https://img.shields.io/website?down_message=offline&label=Page&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iOTgiIGhlaWdodD0iOTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI%2BPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00OC44NTQgMEMyMS44MzkgMCAwIDIyIDAgNDkuMjE3YzAgMjEuNzU2IDEzLjk5MyA0MC4xNzIgMzMuNDA1IDQ2LjY5IDIuNDI3LjQ5IDMuMzE2LTEuMDU5IDMuMzE2LTIuMzYyIDAtMS4xNDEtLjA4LTUuMDUyLS4wOC05LjEyNy0xMy41OSAyLjkzNC0xNi40Mi01Ljg2Ny0xNi40Mi01Ljg2Ny0yLjE4NC01LjcwNC01LjQyLTcuMTctNS40Mi03LjE3LTQuNDQ4LTMuMDE1LjMyNC0zLjAxNS4zMjQtMy4wMTUgNC45MzQuMzI2IDcuNTIzIDUuMDUyIDcuNTIzIDUuMDUyIDQuMzY3IDcuNDk2IDExLjQwNCA1LjM3OCAxNC4yMzUgNC4wNzQuNDA0LTMuMTc4IDEuNjk5LTUuMzc4IDMuMDc0LTYuNi0xMC44MzktMS4xNDEtMjIuMjQzLTUuMzc4LTIyLjI0My0yNC4yODMgMC01LjM3OCAxLjk0LTkuNzc4IDUuMDE0LTEzLjItLjQ4NS0xLjIyMi0yLjE4NC02LjI3NS40ODYtMTMuMDM4IDAgMCA0LjEyNS0xLjMwNCAxMy40MjYgNS4wNTJhNDYuOTcgNDYuOTcgMCAwIDEgMTIuMjE0LTEuNjNjNC4xMjUgMCA4LjMzLjU3MSAxMi4yMTMgMS42MyA5LjMwMi02LjM1NiAxMy40MjctNS4wNTIgMTMuNDI3LTUuMDUyIDIuNjcgNi43NjMuOTcgMTEuODE2LjQ4NSAxMy4wMzggMy4xNTUgMy40MjIgNS4wMTUgNy44MjIgNS4wMTUgMTMuMiAwIDE4LjkwNS0xMS40MDQgMjMuMDYtMjIuMzI0IDI0LjI4MyAxLjc4IDEuNTQ4IDMuMzE2IDQuNDgxIDMuMzE2IDkuMTI2IDAgNi42LS4wOCAxMS44OTctLjA4IDEzLjUyNiAwIDEuMzA0Ljg5IDIuODUzIDMuMzE2IDIuMzY0IDE5LjQxMi02LjUyIDMzLjQwNS0yNC45MzUgMzMuNDA1LTQ2LjY5MUM5Ny43MDcgMjIgNzUuNzg4IDAgNDguODU0IDB6IiBmaWxsPSIjZmZmIi8%2BPC9zdmc%2B&up_message=online&url=https%3A%2F%2Fstremio.github.io%2Fstremio-web%2F)](https://stremio.github.io/stremio-web/)
Stremio is a modern media center that's a one-stop solution for your video entertainment. You discover, watch and organize video content from easy to install addons.

49
package-lock.json generated
View file

@ -12,7 +12,7 @@
"@babel/runtime": "7.16.0",
"@sentry/browser": "6.13.3",
"@stremio/stremio-colors": "5.0.1",
"@stremio/stremio-core-web": "0.44.18",
"@stremio/stremio-core-web": "0.44.22",
"@stremio/stremio-icons": "5.0.0-beta.3",
"@stremio/stremio-video": "0.0.24",
"a-color-picker": "1.2.1",
@ -35,9 +35,10 @@
"react-focus-lock": "2.9.1",
"react-i18next": "^12.1.1",
"react-is": "18.2.0",
"spatial-navigation-polyfill": "git+https://git@github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
"stremio-translations": "git+https://git@github.com/Stremio/stremio-translations.git#92675658de92113c5888cf5e57003e468e8b8c9c",
"url": "0.11.0"
"spatial-navigation-polyfill": "https://github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
"stremio-translations": "https://github.com/Stremio/stremio-translations.git#35911ab6fbe83c34dc57268686fd9e0257d796b3",
"url": "0.11.0",
"use-long-press": "^3.1.5"
},
"devDependencies": {
"@babel/core": "7.16.0",
@ -2703,9 +2704,9 @@
"integrity": "sha512-Dt3PYmy1DZ473QNs99KYXVWQPHtpIl37VUY0+gCEvvuCqE1fRrZIJtZ9KbysUKonvO7WwdQDztgcW0iGoc1dEA=="
},
"node_modules/@stremio/stremio-core-web": {
"version": "0.44.18",
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.18.tgz",
"integrity": "sha512-g89XSIfLIsvN+FIscvBP9t5ywLP1uhGT9jED97e37ScXKCVedOL9ibnn1DJIeUj8U+ezJdbHFx4zWpnMfJdU2A==",
"version": "0.44.22",
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.22.tgz",
"integrity": "sha512-YwnCdd7vg0iyk3wZ1NkPzMTe+WA8coe497Dn/Lt/ngdkhEF7gP5TewqNzlE4BDVgly6aZfub0h1G4gyx/kb3Eg==",
"dependencies": {
"@babel/runtime": "7.16.0"
}
@ -12877,9 +12878,9 @@
}
},
"node_modules/stremio-translations": {
"version": "1.43.17",
"resolved": "git+https://git@github.com/Stremio/stremio-translations.git#92675658de92113c5888cf5e57003e468e8b8c9c",
"integrity": "sha512-7f8VK4AdM2/rQqu28tocce2uuOa0kIBrmEa21Va2+uWDGT7/tLlbm0kvKS6v8hWpalGRPcGu6W4qf6pd5UIDZw==",
"version": "1.44.0",
"resolved": "git+ssh://git@github.com/Stremio/stremio-translations.git#35911ab6fbe83c34dc57268686fd9e0257d796b3",
"integrity": "sha512-DVMWIxBrTaV5UKcexPoxT73Na2GbsKGd3BYyywgKFEw7WBOP02oAbxLJBfCFoPhcT7+MhcVqSl44YGNmSSOuwg==",
"license": "MIT"
},
"node_modules/string_decoder": {
@ -13694,6 +13695,14 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
},
"node_modules/use-long-press": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/use-long-press/-/use-long-press-3.1.5.tgz",
"integrity": "sha512-bnwk2SlvLLpeJPkNYSGkc59q5YNV9V/fLDkSOAF2p7Xt0zw3iYHEmgEGkNYkK7zEIEyRFi5CczKsT7MN99UzVQ==",
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
},
"node_modules/use-sidecar": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.2.tgz",
@ -16825,9 +16834,9 @@
"integrity": "sha512-Dt3PYmy1DZ473QNs99KYXVWQPHtpIl37VUY0+gCEvvuCqE1fRrZIJtZ9KbysUKonvO7WwdQDztgcW0iGoc1dEA=="
},
"@stremio/stremio-core-web": {
"version": "0.44.18",
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.18.tgz",
"integrity": "sha512-g89XSIfLIsvN+FIscvBP9t5ywLP1uhGT9jED97e37ScXKCVedOL9ibnn1DJIeUj8U+ezJdbHFx4zWpnMfJdU2A==",
"version": "0.44.22",
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.22.tgz",
"integrity": "sha512-YwnCdd7vg0iyk3wZ1NkPzMTe+WA8coe497Dn/Lt/ngdkhEF7gP5TewqNzlE4BDVgly6aZfub0h1G4gyx/kb3Eg==",
"requires": {
"@babel/runtime": "7.16.0"
}
@ -24502,7 +24511,7 @@
"spatial-navigation-polyfill": {
"version": "git+https://git@github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
"integrity": "sha512-zREQWdiN2VSugD90lq0uBsSBjT/YtytCijN83V6LEJTRmAe/fMYUtjUtYr7UvBrSPxfnSM54BNq9r2kKFTJvlQ==",
"from": "spatial-navigation-polyfill@git+https://git@github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6"
"from": "spatial-navigation-polyfill@https://github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6"
},
"spdy": {
"version": "4.0.2",
@ -24567,9 +24576,9 @@
"dev": true
},
"stremio-translations": {
"version": "git+https://git@github.com/Stremio/stremio-translations.git#92675658de92113c5888cf5e57003e468e8b8c9c",
"integrity": "sha512-7f8VK4AdM2/rQqu28tocce2uuOa0kIBrmEa21Va2+uWDGT7/tLlbm0kvKS6v8hWpalGRPcGu6W4qf6pd5UIDZw==",
"from": "stremio-translations@git+https://git@github.com/Stremio/stremio-translations.git#92675658de92113c5888cf5e57003e468e8b8c9c"
"version": "git+ssh://git@github.com/Stremio/stremio-translations.git#35911ab6fbe83c34dc57268686fd9e0257d796b3",
"integrity": "sha512-DVMWIxBrTaV5UKcexPoxT73Na2GbsKGd3BYyywgKFEw7WBOP02oAbxLJBfCFoPhcT7+MhcVqSl44YGNmSSOuwg==",
"from": "stremio-translations@https://github.com/Stremio/stremio-translations.git#35911ab6fbe83c34dc57268686fd9e0257d796b3"
},
"string_decoder": {
"version": "1.1.1",
@ -25163,6 +25172,12 @@
}
}
},
"use-long-press": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/use-long-press/-/use-long-press-3.1.5.tgz",
"integrity": "sha512-bnwk2SlvLLpeJPkNYSGkc59q5YNV9V/fLDkSOAF2p7Xt0zw3iYHEmgEGkNYkK7zEIEyRFi5CczKsT7MN99UzVQ==",
"requires": {}
},
"use-sidecar": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.2.tgz",

View file

@ -15,7 +15,7 @@
"@babel/runtime": "7.16.0",
"@sentry/browser": "6.13.3",
"@stremio/stremio-colors": "5.0.1",
"@stremio/stremio-core-web": "0.44.18",
"@stremio/stremio-core-web": "0.44.22",
"@stremio/stremio-icons": "5.0.0-beta.3",
"@stremio/stremio-video": "0.0.24",
"a-color-picker": "1.2.1",
@ -38,9 +38,10 @@
"react-focus-lock": "2.9.1",
"react-i18next": "^12.1.1",
"react-is": "18.2.0",
"spatial-navigation-polyfill": "git+https://git@github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
"stremio-translations": "git+https://git@github.com/Stremio/stremio-translations.git#92675658de92113c5888cf5e57003e468e8b8c9c",
"url": "0.11.0"
"spatial-navigation-polyfill": "https://github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
"stremio-translations": "https://github.com/Stremio/stremio-translations.git#35911ab6fbe83c34dc57268686fd9e0257d796b3",
"url": "0.11.0",
"use-long-press": "^3.1.5"
},
"devDependencies": {
"@babel/core": "7.16.0",

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
require('spatial-navigation-polyfill');
const React = require('react');
@ -6,13 +6,16 @@ const { useTranslation } = require('react-i18next');
const { Router } = require('stremio-router');
const { Core, Shell, Chromecast, DragAndDrop, KeyboardShortcuts, ServicesProvider } = require('stremio/services');
const { NotFound } = require('stremio/routes');
const { ToastProvider, CONSTANTS } = require('stremio/common');
const { ToastProvider, CONSTANTS, withCoreSuspender } = require('stremio/common');
const ServicesToaster = require('./ServicesToaster');
const DeepLinkHandler = require('./DeepLinkHandler');
const ErrorDialog = require('./ErrorDialog');
const withProtectedRoutes = require('./withProtectedRoutes');
const routerViewsConfig = require('./routerViewsConfig');
const styles = require('./styles');
const RouterWithProtectedRoutes = withCoreSuspender(withProtectedRoutes(Router));
const App = () => {
const { i18n } = useTranslation();
const onPathNotMatch = React.useCallback(() => {
@ -126,6 +129,12 @@ const App = () => {
action: 'SyncLibraryWithAPI'
}
});
services.core.transport.dispatch({
action: 'Ctx',
args: {
action: 'PullNotifications'
}
});
};
if (services.core.active) {
onWindowFocus();
@ -152,7 +161,7 @@ const App = () => {
<ToastProvider className={styles['toasts-container']}>
<ServicesToaster />
<DeepLinkHandler />
<Router
<RouterWithProtectedRoutes
className={styles['router']}
viewsConfig={routerViewsConfig}
onPathNotMatch={onPathNotMatch}

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const { withCoreSuspender, useStreamingServer } = require('stremio/common');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const ErrorDialog = require('./ErrorDialog');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const { useServices } = require('stremio/services');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const App = require('./App');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const routes = require('stremio/routes');
const { routesRegexp } = require('stremio/common');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~stremio/common/screen-sizes.less';
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -0,0 +1,29 @@
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const { Intro } = require('stremio/routes');
const { useProfile } = require('stremio/common');
const withProtectedRoutes = (Component) => {
return function withProtectedRoutes(props) {
const profile = useProfile();
const previousAuthRef = React.useRef(profile.auth);
React.useEffect(() => {
if (previousAuthRef.current !== null && profile.auth === null) {
window.location = '#/intro';
}
previousAuthRef.current = profile.auth;
}, [profile]);
const onRouteChange = React.useCallback((routeConfig) => {
if (profile.auth !== null && routeConfig.component === Intro) {
window.location.replace('#/');
return true;
}
}, [profile]);
return (
<Component {...props} onRouteChange={onRouteChange} />
);
};
};
module.exports = withProtectedRoutes;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const AddonDetails = require('./AddonDetails');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const AddonDetailsModal = require('./AddonDetailsModal');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const useModelState = require('stremio/common/useModelState');

View file

@ -1,18 +1,23 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');
const classnames = require('classnames');
const styles = require('./styles');
const { useLongPress } = require('use-long-press');
const Button = React.forwardRef(({ className, href, disabled, children, ...props }, ref) => {
const Button = React.forwardRef(({ className, href, disabled, children, onLongPress, ...props }, ref) => {
const longPress = useLongPress(onLongPress, { detect: 'pointer' });
const onKeyDown = React.useCallback((event) => {
if (typeof props.onKeyDown === 'function') {
props.onKeyDown(event);
}
if (event.key === 'Enter' && !event.nativeEvent.buttonClickPrevented) {
event.currentTarget.click();
if (event.key === 'Enter') {
event.preventDefault();
if (!event.nativeEvent.buttonClickPrevented) {
event.currentTarget.click();
}
}
}, [props.onKeyDown]);
const onMouseDown = React.useCallback((event) => {
@ -36,7 +41,8 @@ const Button = React.forwardRef(({ className, href, disabled, children, ...props
className: classnames(className, styles['button-container'], { 'disabled': disabled }),
href,
onKeyDown,
onMouseDown
onMouseDown,
...longPress()
},
children
);
@ -50,7 +56,8 @@ Button.propTypes = {
disabled: PropTypes.bool,
children: PropTypes.node,
onKeyDown: PropTypes.func,
onMouseDown: PropTypes.func
onMouseDown: PropTypes.func,
onLongPress: PropTypes.func,
};
module.exports = Button;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const Button = require('./Button');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const CHROMECAST_RECEIVER_APP_ID = '1634F54B';
const SUBTITLES_SIZES = [75, 100, 125, 150, 175, 200, 250];

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const Checkbox = require('./Checkbox');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const ColorPicker = require('./ColorPicker');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
.color-picker-container {
overflow: visible;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const ColorInput = require('./ColorInput');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const { useServices } = require('stremio/services');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const DelayedRenderer = require('./DelayedRenderer');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const Image = require('./Image');

View file

@ -1,9 +1,10 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const { useServices } = require('stremio/services');
const PropTypes = require('prop-types');
const MetaItem = require('stremio/common/MetaItem');
const useNotifications = require('stremio/common/useNotifications');
const { t } = require('i18next');
const OPTIONS = [
@ -15,6 +16,11 @@ const OPTIONS = [
const LibItem = ({ _id, removable, ...props }) => {
const { core } = useServices();
const notifications = useNotifications();
const newVideos = React.useMemo(() => {
const count = notifications.items?.[_id]?.length ?? 0;
return Math.min(Math.max(count, 0), 99);
}, [_id, notifications.items]);
const options = React.useMemo(() => {
return OPTIONS
.filter(({ value }) => {
@ -68,6 +74,13 @@ const LibItem = ({ _id, removable, ...props }) => {
args: _id
}
});
core.transport.dispatch({
action: 'Ctx',
args: {
action: 'DismissNotificationItem',
args: _id
}
});
}
break;
@ -91,6 +104,7 @@ const LibItem = ({ _id, removable, ...props }) => {
return (
<MetaItem
{...props}
newVideos={newVideos}
options={options}
optionOnSelect={optionOnSelect}
/>

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const LibItem = require('./LibItem');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const MainNavBars = require('./MainNavBars');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');
@ -13,7 +13,7 @@ const useBinaryState = require('stremio/common/useBinaryState');
const { ICON_FOR_TYPE } = require('stremio/common/CONSTANTS');
const styles = require('./styles');
const MetaItem = React.memo(({ className, type, name, poster, posterShape, playIcon, progress, options, deepLinks, dataset, optionOnSelect, ...props }) => {
const MetaItem = React.memo(({ className, type, name, poster, posterShape, playIcon, progress, newVideos, options, deepLinks, dataset, optionOnSelect, ...props }) => {
const [menuOpen, onMenuOpen, onMenuClose] = useBinaryState(false);
const href = React.useMemo(() => {
return deepLinks ?
@ -89,6 +89,18 @@ const MetaItem = React.memo(({ className, type, name, poster, posterShape, playI
:
null
}
{
newVideos > 0 ?
<div className={styles['new-videos']}>
<div className={styles['layer']} />
<div className={styles['layer']} />
<div className={styles['layer']}>
+{newVideos}
</div>
</div>
:
null
}
</div>
{
(typeof name === 'string' && name.length > 0) || (Array.isArray(options) && options.length > 0) ?
@ -129,6 +141,7 @@ MetaItem.propTypes = {
posterShape: PropTypes.oneOf(['poster', 'landscape', 'square']),
playIcon: PropTypes.bool,
progress: PropTypes.number,
newVideos: PropTypes.number,
options: PropTypes.array,
deepLinks: PropTypes.shape({
metaDetailsVideos: PropTypes.string,

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const MetaItem = require('./MetaItem');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';
@ -135,6 +135,45 @@
background-color: var(--primary-foreground-color);
}
}
.new-videos {
z-index: -1;
position: absolute;
top: 0;
right: 0;
overflow: visible;
.layer {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
height: 1.6rem;
width: 2.75rem;
border-radius: 0.25rem;
font-size: 1rem;
font-weight: 600;
color: @color-background-dark2-90;
&:nth-child(1) {
top: 0.5rem;
right: 0.5rem;
background-color: @color-surface-light5-40;
}
&:nth-child(2) {
top: 0.75rem;
right: 0.75rem;
background-color: @color-surface-light5-60;
}
&:nth-child(3) {
top: 1rem;
right: 1rem;
background-color: @color-surface-light5;
}
}
}
}
.title-bar-container {

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const ActionButton = require('./ActionButton');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const MetaLinks = require('./MetaLinks');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const MetaPreviewPlaceholder = require('./MetaPreviewPlaceholder');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
.meta-preview-placeholder-container {
display: flex;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const MetaPreview = require('./MetaPreview');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const ReactIs = require('react-is');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const MetaRowPlaceholder = require('./MetaRowPlaceholder');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const MetaRow = require('./MetaRow');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const ModalDialog = require('./ModalDialog');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const Multiselect = require('./Multiselect');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');
@ -54,7 +54,7 @@ const NavMenuContent = ({ onClick }) => {
<div className={styles['email-container']}>
<div className={styles['email-label']}>{profile.auth === null ? t('ANONYMOUS_USER') : profile.auth.user.email}</div>
</div>
<Button className={styles['logout-button-container']} title={profile.auth === null ? `${t('LOG_IN')} / ${t('SIGN_UP')}` : t('LOG_OUT')} href={'#/intro'} onClick={logoutButtonOnClick}>
<Button className={styles['logout-button-container']} title={profile.auth === null ? `${t('LOG_IN')} / ${t('SIGN_UP')}` : t('LOG_OUT')} href={profile.auth === null ? '#/intro' : null} onClick={profile.auth !== null ? logoutButtonOnClick : null}>
<div className={styles['logout-label']}>{profile.auth === null ? `${t('LOG_IN')} / ${t('SIGN_UP')}` : t('LOG_OUT')}</div>
</Button>
</div>

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const NavMenu = require('./NavMenu');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const SearchBar = require('./SearchBar');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const HorizontalNavBar = require('./HorizontalNavBar');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const NavTabButton = require('./NavTabButton');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const VerticalNavBar = require('./VerticalNavBar');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
@import (reference) '~stremio/common/screen-sizes.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const HorizontalNavBar = require('./HorizontalNavBar');
const VerticalNavBar = require('./VerticalNavBar');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const PaginationInput = require('./PaginationInput');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const PlayIconCircleCentered = require('./PlayIconCircleCentered');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');
@ -47,16 +47,23 @@ const Popup = ({ open, direction, renderLabel, renderMenu, dataset, onCloseReque
onCloseRequest(closeEvent);
}
break;
case 'pointerdown':
if (event.target !== document.documentElement && !labelRef.current.contains(event.target)) {
onCloseRequest(closeEvent);
}
break;
}
}
};
if (routeFocused && open) {
window.addEventListener('keydown', onCloseEvent);
window.addEventListener('mousedown', onCloseEvent);
window.addEventListener('pointerdown', onCloseEvent);
}
return () => {
window.removeEventListener('keydown', onCloseEvent);
window.removeEventListener('mousedown', onCloseEvent);
window.removeEventListener('pointerdown', onCloseEvent);
};
}, [routeFocused, open, onCloseRequest, dataset]);
React.useLayoutEffect(() => {

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const Popup = require('./Popup');

View file

@ -1,8 +1,12 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
.label-container {
// IOS specific
// prevents showing the default context-menu when long pressing an anchor in safari.
-webkit-touch-callout: none !important;
position: relative;
overflow: visible;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');

View file

@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Smart code 203358507
// Copyright (C) 2017-2023 Smart code 203358507
const SearchBarPlaceholder = require('./SearchBarPlaceholder');

Some files were not shown because too many files have changed in this diff Show more