Merge branch 'development' of https://github.com/Stremio/stremio-web into refactor/library-infinite-scroll

This commit is contained in:
Tim 2024-03-13 18:13:28 +01:00
commit ffe420aeec
10 changed files with 103 additions and 67 deletions

8
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.46.3",
"@stremio/stremio-core-web": "0.47.0",
"@stremio/stremio-icons": "5.2.0",
"@stremio/stremio-video": "0.0.38",
"a-color-picker": "1.2.1",
@ -2969,9 +2969,9 @@
"license": "MIT"
},
"node_modules/@stremio/stremio-core-web": {
"version": "0.46.3",
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.46.3.tgz",
"integrity": "sha512-5us8KQQ0EJ2xjLukcLu3yia7fa8BIjxjOwbMebpSLGEomq6MzVQMmRGp/7rId2ggfIej2Zwf/GBVepZ2/nLE4A==",
"version": "0.47.0",
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.47.0.tgz",
"integrity": "sha512-//wXNpVFnKjVegPjAKPLz+SanGvk/p+4cuDAvZst5igi+wCw/wbsxOssq8HZbq1QvaeFQdpttW0HXbkzLcyf8Q==",
"dependencies": {
"@babel/runtime": "7.16.0"
}

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.46.3",
"@stremio/stremio-core-web": "0.47.0",
"@stremio/stremio-icons": "5.2.0",
"@stremio/stremio-video": "0.0.38",
"a-color-picker": "1.2.1",

View file

@ -184,6 +184,10 @@ html {
.toasts-container {
padding: 0 1rem;
}
.tooltip-container {
display: none;
}
}
}
}

View file

@ -28,6 +28,7 @@ function withRemoteAndLocalAddon(AddonDetails) {
id={addon.manifest.id}
name={addon.manifest.name}
version={addon.manifest.version}
background={addon.manifest.background}
logo={addon.manifest.logo}
description={addon.manifest.description}
types={addon.manifest.types}
@ -132,8 +133,11 @@ const AddonDetailsModal = ({ transportUrl, onCloseRequest }) => {
null;
return toggleButton !== null ? configureButton ? [cancelButton, configureButton, toggleButton] : [cancelButton, toggleButton] : [cancelButton];
}, [addonDetails, onCloseRequest]);
const modalBackground = React.useMemo(() => {
return addonDetails.remoteAddon?.content.type === 'Ready' ? addonDetails.remoteAddon.content.content.manifest.background : null;
}, [addonDetails.remoteAddon]);
return (
<ModalDialog className={styles['addon-details-modal-container']} title={'Stremio addon'} buttons={modalButtons} onCloseRequest={onCloseRequest}>
<ModalDialog className={styles['addon-details-modal-container']} title={'Stremio addon'} buttons={modalButtons} background={modalBackground} onCloseRequest={onCloseRequest}>
{
addonDetails.selected === null ?
<div className={styles['addon-details-message-container']}>

View file

@ -102,7 +102,7 @@ const MetaItem = React.memo(({ className, type, name, poster, posterShape, poste
{
progress > 0 ?
<div className={styles['progress-bar-layer']}>
<div className={styles['progress-bar']} style={{ width: `${Math.max(0, Math.min(1, progress)) * 100}%` }} />
<div className={styles['progress-bar']} style={{ width: `${progress}%` }} />
<div className={styles['progress-bar-background']} />
</div>
:

View file

@ -317,11 +317,14 @@
.title-label {
flex: 1;
max-height: 2.4em;
padding-left: 1.5rem;
font-weight: 600;
text-align: center;
color: var(--primary-foreground-color);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
&:only-child {
padding: 0 0.5rem;

View file

@ -9,7 +9,7 @@ const { default: Icon } = require('@stremio/stremio-icons/react');
const { Modal } = require('stremio-router');
const styles = require('./styles');
const ModalDialog = ({ className, title, buttons, children, dataset, onCloseRequest, ...props }) => {
const ModalDialog = ({ className, title, buttons, children, dataset, onCloseRequest, background, ...props }) => {
const routeFocused = useRouteFocused();
const modalsContainer = useModalsContainer();
const modalContainerRef = React.useRef(null);
@ -59,41 +59,44 @@ const ModalDialog = ({ className, title, buttons, children, dataset, onCloseRequ
return (
<Modal ref={modalContainerRef} {...props} className={classnames(className, styles['modal-container'])} onMouseDown={onModalContainerMouseDown}>
<div className={styles['modal-dialog-container']} onMouseDown={onModalDialogContainerMouseDown}>
<div className={styles['modal-dialog-background']} style={{backgroundImage: `url('${background}')`}} />
<Button className={styles['close-button-container']} title={'Close'} onClick={closeButtonOnClick}>
<Icon className={styles['icon']} name={'close'} />
</Button>
{
typeof title === 'string' && title.length > 0 ?
<div className={styles['title-container']} title={title}>{title}</div>
:
null
}
<div className={styles['modal-dialog-content']}>
{children}
{
typeof title === 'string' && title.length > 0 ?
<div className={styles['title-container']} title={title}>{title}</div>
:
null
}
<div className={styles['modal-dialog-content']}>
{children}
</div>
{
Array.isArray(buttons) && buttons.length > 0 ?
<div className={styles['buttons-container']}>
{buttons.map(({ className, label, icon, props }, index) => (
<Button title={label} {...props} key={index} className={classnames(className, styles['action-button'])}>
{
typeof icon === 'string' && icon.length > 0 ?
<Icon className={styles['icon']} name={icon} />
:
null
}
{
typeof label === 'string' && label.length > 0 ?
<div className={styles['label']}>{label}</div>
:
null
}
</Button>
))}
</div>
:
null
}
</div>
{
Array.isArray(buttons) && buttons.length > 0 ?
<div className={styles['buttons-container']}>
{buttons.map(({ className, label, icon, props }, index) => (
<Button title={label} {...props} key={index} className={classnames(className, styles['action-button'])}>
{
typeof icon === 'string' && icon.length > 0 ?
<Icon className={styles['icon']} name={icon} />
:
null
}
{
typeof label === 'string' && label.length > 0 ?
<div className={styles['label']}>{label}</div>
:
null
}
</Button>
))}
</div>
:
null
}
</div>
</Modal>
);
@ -102,6 +105,7 @@ const ModalDialog = ({ className, title, buttons, children, dataset, onCloseRequ
ModalDialog.propTypes = {
className: PropTypes.string,
title: PropTypes.string,
background: PropTypes.string,
buttons: PropTypes.arrayOf(PropTypes.shape({
className: PropTypes.string,
label: PropTypes.string,

View file

@ -21,6 +21,18 @@
background-color: var(--modal-background-color);
box-shadow: var(--outer-glow);
.modal-dialog-background {
z-index: 0;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-size: cover;
background-position: center;
opacity: 0.1;
}
.close-button-container {
position: absolute;
top: 0.5rem;
@ -38,7 +50,8 @@
opacity: 0.4;
}
&:hover, &:focus {
&:hover,
&:focus {
.icon {
opacity: 1;
color: var(--primary-foreground-color);
@ -50,36 +63,43 @@
}
}
.title-container {
flex: 1 0 auto;
display: flex;
align-items: center;
height: 4.5rem;
font-size: 1.2rem;
font-weight: 500;
color: var(--primary-foreground-color);
}
.modal-dialog-content {
flex: 1;
align-self: stretch;
overflow-y: auto;
padding: 2rem 0;
z-index: 1;
position: relative;
height: 100%;
width: 100%;
&:last-child {
margin-bottom: 2rem;
.title-container {
flex: 1 0 auto;
display: flex;
align-items: center;
height: 4.5rem;
font-size: 1.2rem;
font-weight: 500;
color: var(--primary-foreground-color);
}
}
.buttons-container {
flex: none;
align-self: stretch;
display: flex;
flex-direction: row;
flex-wrap: wrap;
.modal-dialog-content {
flex: 1;
align-self: stretch;
overflow-y: auto;
padding: 2rem 0;
&:last-child {
margin: 2rem 0;
&:last-child {
margin-bottom: 2rem;
}
}
.buttons-container {
flex: none;
align-self: stretch;
display: flex;
flex-direction: row;
flex-wrap: wrap;
&:last-child {
margin: 2rem 0;
}
}
}
}

View file

@ -22,7 +22,7 @@ const useBoard = () => {
}
}, 'board');
}, []);
const board = useModelState({ model: 'board', timeout: 1500, action });
const board = useModelState({ model: 'board', action });
return [board, loadRange];
};

View file

@ -269,7 +269,8 @@ const Player = ({ urlParams, queryParams }) => {
setError(null);
if (player.selected === null) {
video.unload();
} else if (player.selected.metaRequest === null || (player.metaItem !== null && player.metaItem.type !== 'Loading')) {
} else if (streamingServer.settings !== null && streamingServer.settings.type !== 'Loading' &&
(player.selected.metaRequest === null || (player.metaItem !== null && player.metaItem.type !== 'Loading'))) {
video.load({
stream: {
...player.selected.stream,