mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Fix some deprecation warnings
This commit is contained in:
parent
8fb46099d4
commit
e7c878b30a
@ -2,6 +2,7 @@
|
|||||||
"name": "mobile",
|
"name": "mobile",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "index.tsx",
|
"main": "index.tsx",
|
||||||
|
"sideEffects": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "expo start",
|
"dev": "expo start",
|
||||||
"android": "expo start --android",
|
"android": "expo start --android",
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
"name": "web",
|
"name": "web",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"sideEffects": ["./src/polyfill.ts"],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
"name": "@kyoo/models",
|
"name": "@kyoo/models",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"types": "src/index.ts",
|
"types": "src/index.ts",
|
||||||
|
"sideEffects": false,
|
||||||
"packageManager": "yarn@3.2.4",
|
"packageManager": "yarn@3.2.4",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "18.2.34",
|
"@types/react": "18.2.34",
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
"name": "@kyoo/primitives",
|
"name": "@kyoo/primitives",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"types": "src/index.ts",
|
"types": "src/index.ts",
|
||||||
|
"sideEffects": false,
|
||||||
"packageManager": "yarn@3.2.4",
|
"packageManager": "yarn@3.2.4",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gorhom/portal": "^1.0.14",
|
"@gorhom/portal": "^1.0.14",
|
||||||
|
@ -53,12 +53,16 @@ export const A = ({
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
textProps={css(
|
textProps={css(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
fontFamily: theme.font.normal,
|
||||||
|
color: theme.link,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
userSelect: "text",
|
||||||
|
} as any,
|
||||||
|
],
|
||||||
{
|
{
|
||||||
fontFamily: theme.font.normal,
|
|
||||||
color: theme.link,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selectable: true,
|
|
||||||
hrefAttrs: { target },
|
hrefAttrs: { target },
|
||||||
...props,
|
...props,
|
||||||
},
|
},
|
||||||
|
@ -73,7 +73,7 @@ const Menu = <AsProps,>({
|
|||||||
<MenuContext.Provider value={setOpen}>
|
<MenuContext.Provider value={setOpen}>
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={() => setOpen(false)}
|
onPress={() => setOpen(false)}
|
||||||
focusable={false}
|
tabIndex={-1}
|
||||||
{...css({ ...StyleSheet.absoluteFillObject, flexGrow: 1, bg: "transparent" })}
|
{...css({ ...StyleSheet.absoluteFillObject, flexGrow: 1, bg: "transparent" })}
|
||||||
/>
|
/>
|
||||||
<View
|
<View
|
||||||
|
@ -69,7 +69,7 @@ export const Slider = ({
|
|||||||
onMouseEnter={() => setHover(true)}
|
onMouseEnter={() => setHover(true)}
|
||||||
// @ts-ignore Web only
|
// @ts-ignore Web only
|
||||||
onMouseLeave={() => setHover(false)}
|
onMouseLeave={() => setHover(false)}
|
||||||
focusable
|
tabIndex={0}
|
||||||
onFocus={() => setFocus(true)}
|
onFocus={() => setFocus(true)}
|
||||||
onBlur={() => setFocus(false)}
|
onBlur={() => setFocus(false)}
|
||||||
onStartShouldSetResponder={() => true}
|
onStartShouldSetResponder={() => true}
|
||||||
@ -107,7 +107,7 @@ export const Slider = ({
|
|||||||
paddingVertical: ts(1),
|
paddingVertical: ts(1),
|
||||||
// @ts-ignore Web only
|
// @ts-ignore Web only
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
focus: focusReset,
|
...focusReset,
|
||||||
},
|
},
|
||||||
props,
|
props,
|
||||||
)}
|
)}
|
||||||
|
24
front/packages/primitives/src/types.d.ts
vendored
24
front/packages/primitives/src/types.d.ts
vendored
@ -22,8 +22,32 @@ import React from "react";
|
|||||||
import "react-native";
|
import "react-native";
|
||||||
|
|
||||||
declare module "react-native" {
|
declare module "react-native" {
|
||||||
|
interface PressableStateCallbackType {
|
||||||
|
hovered?: boolean;
|
||||||
|
focused?: boolean;
|
||||||
|
}
|
||||||
|
interface AccessibilityProps {
|
||||||
|
tabIndex?: number;
|
||||||
|
}
|
||||||
|
interface ViewStyle {
|
||||||
|
transitionProperty?: string;
|
||||||
|
transitionDuration?: string;
|
||||||
|
}
|
||||||
|
interface TextProps {
|
||||||
|
href?: string;
|
||||||
|
hrefAttrs?: {
|
||||||
|
rel?: "noreferrer";
|
||||||
|
target?: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
interface ViewProps {
|
interface ViewProps {
|
||||||
dataSet?: Record<string, string>;
|
dataSet?: Record<string, string>;
|
||||||
|
href?: string;
|
||||||
|
hrefAttrs?: {
|
||||||
|
rel: "noreferrer";
|
||||||
|
target?: "_blank";
|
||||||
|
};
|
||||||
|
onClick?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ export const Hover = ({
|
|||||||
<>
|
<>
|
||||||
<Back isLoading={isLoading} name={showName} href={href} {...css(opacity, props)} />
|
<Back isLoading={isLoading} name={showName} href={href} {...css(opacity, props)} />
|
||||||
<Pressable
|
<Pressable
|
||||||
focusable={false}
|
tabIndex={-1}
|
||||||
onPointerDown={onPointerDown}
|
onPointerDown={onPointerDown}
|
||||||
onPress={Platform.OS !== "web" ? () => onPointerDown?.({} as any) : undefined}
|
onPress={Platform.OS !== "web" ? () => onPointerDown?.({} as any) : undefined}
|
||||||
{...css(
|
{...css(
|
||||||
@ -247,9 +247,9 @@ export const LoadingIndicator = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
pointerEvents="none"
|
|
||||||
{...css({
|
{...css({
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
|
pointerEvents: "none",
|
||||||
top: 0,
|
top: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
|
@ -43,6 +43,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { PlayMode, playModeAtom, subtitleAtom } from "./state";
|
import { PlayMode, playModeAtom, subtitleAtom } from "./state";
|
||||||
import uuid from "react-native-uuid";
|
import uuid from "react-native-uuid";
|
||||||
import { Pressable } from "react-native";
|
import { Pressable } from "react-native";
|
||||||
|
import "@kyoo/primitives/src/types.d.ts";
|
||||||
import { useYoshiki } from "yoshiki/native";
|
import { useYoshiki } from "yoshiki/native";
|
||||||
|
|
||||||
const MimeTypes: Map<string, string> = new Map([
|
const MimeTypes: Map<string, string> = new Map([
|
||||||
@ -77,7 +78,7 @@ const Video = forwardRef<NativeVideo, VideoProps>(function Video(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Pressable
|
<Pressable
|
||||||
focusable={false}
|
tabIndex={-1}
|
||||||
onPress={() => onPointerDown?.({ nativeEvent: { pointerType: "pointer" } } as any)}
|
onPress={() => onPointerDown?.({ nativeEvent: { pointerType: "pointer" } } as any)}
|
||||||
{...css({ flexGrow: 1, flexShrink: 1 })}
|
{...css({ flexGrow: 1, flexShrink: 1 })}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user