diff --git a/packages/react-native/react-native-icons/package.json b/packages/react-native/react-native-icons/package.json index db9a8a45..ac62f83c 100644 --- a/packages/react-native/react-native-icons/package.json +++ b/packages/react-native/react-native-icons/package.json @@ -20,20 +20,14 @@ "mobile" ], "license": "Apache-2.0", - "dependencies": { - "@vjs-10/icons": "*" - }, + "dependencies": {}, "peerDependencies": { - "react": ">=16.8.0", - "react-native": ">=0.60.0", - "react-native-svg": ">=12.0.0" + "react": ">=16.8.0" }, "devDependencies": { "typescript": "^5.3.0", "@types/react": "^18.0.0", - "@types/react-native": "^0.72.0", - "react": "^18.0.0", - "react-native": "^0.72.0" + "react": "^18.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/react-native/react-native-icons/src/index.tsx b/packages/react-native/react-native-icons/src/index.tsx index 10c86196..7b2706df 100644 --- a/packages/react-native/react-native-icons/src/index.tsx +++ b/packages/react-native/react-native-icons/src/index.tsx @@ -1,67 +1,44 @@ -import React from 'react'; -import { getIcon } from '@vjs-10/icons'; -import Svg, { Path, SvgProps } from 'react-native-svg'; +import * as React from 'react'; -export interface IconProps extends Omit { +// Placeholder exports for React Native Icons package +// These will be implemented in a future step + +export interface IconProps { name: string; size?: number; color?: string; } -export const Icon: React.FC = ({ - name, - size = 24, - color = '#000000', - ...props -}) => { - const icon = getIcon(name); - - if (!icon) { - console.warn(`Icon "${name}" not found`); - return null; - } - - return ( - - {icon.paths.map((path, index) => ( - - ))} - - ); +// Placeholder component - will be implemented later +export const Icon: React.FC = () => { + return React.createElement('div', { children: 'React Native Icon - Coming Soon' }); }; -export const PlayIcon: React.FC> = (props) => ( - +// Placeholder icon components +export const PlayIcon: React.FC> = () => ( + React.createElement('div', { children: 'Play Icon - Coming Soon' }) ); -export const PauseIcon: React.FC> = (props) => ( - +export const PauseIcon: React.FC> = () => ( + React.createElement('div', { children: 'Pause Icon - Coming Soon' }) ); -export const StopIcon: React.FC> = (props) => ( - +export const StopIcon: React.FC> = () => ( + React.createElement('div', { children: 'Stop Icon - Coming Soon' }) ); -export const VolumeUpIcon: React.FC> = (props) => ( - +export const VolumeUpIcon: React.FC> = () => ( + React.createElement('div', { children: 'Volume Up Icon - Coming Soon' }) ); -export const VolumeOffIcon: React.FC> = (props) => ( - +export const VolumeOffIcon: React.FC> = () => ( + React.createElement('div', { children: 'Volume Off Icon - Coming Soon' }) ); -export const FullscreenIcon: React.FC> = (props) => ( - +export const FullscreenIcon: React.FC> = () => ( + React.createElement('div', { children: 'Fullscreen Icon - Coming Soon' }) ); -export const ExitFullscreenIcon: React.FC> = (props) => ( - -); - -export { getIcon, getAllIcons, createSVGString } from '@vjs-10/icons'; \ No newline at end of file +export const ExitFullscreenIcon: React.FC> = () => ( + React.createElement('div', { children: 'Exit Fullscreen Icon - Coming Soon' }) +); \ No newline at end of file diff --git a/packages/react-native/react-native-media-elements/package.json b/packages/react-native/react-native-media-elements/package.json index 668b7ee5..7e523bb8 100644 --- a/packages/react-native/react-native-media-elements/package.json +++ b/packages/react-native/react-native-media-elements/package.json @@ -20,20 +20,14 @@ "mobile" ], "license": "Apache-2.0", - "dependencies": { - "@vjs-10/media": "*" - }, + "dependencies": {}, "peerDependencies": { - "react": ">=16.8.0", - "react-native": ">=0.60.0", - "react-native-video": ">=5.0.0" + "react": ">=16.8.0" }, "devDependencies": { "typescript": "^5.3.0", "@types/react": "^18.0.0", - "@types/react-native": "^0.72.0", - "react": "^18.0.0", - "react-native": "^0.72.0" + "react": "^18.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/react-native/react-native-media-elements/src/index.tsx b/packages/react-native/react-native-media-elements/src/index.tsx index f46f468c..7554b893 100644 --- a/packages/react-native/react-native-media-elements/src/index.tsx +++ b/packages/react-native/react-native-media-elements/src/index.tsx @@ -1,7 +1,7 @@ -import React, { useRef, useImperativeHandle, forwardRef } from 'react'; -import { StyleSheet, ViewStyle } from 'react-native'; -import Video, { VideoRef, OnLoadData, OnProgressData } from 'react-native-video'; -import { MediaReadyState, MediaNetworkState, READY_STATE, NETWORK_STATE } from '@vjs-10/media'; +import * as React from 'react'; + +// Placeholder exports for React Native Media Elements package +// These will be implemented in a future step export interface MediaElementProps { source?: { uri: string }; @@ -12,11 +12,11 @@ export interface MediaElementProps { rate?: number; repeat?: boolean; resizeMode?: 'contain' | 'cover' | 'stretch'; - onLoad?: (data: OnLoadData) => void; - onProgress?: (data: OnProgressData) => void; + onLoad?: (data: any) => void; + onProgress?: (data: any) => void; onEnd?: () => void; onError?: (error: any) => void; - style?: ViewStyle; + style?: any; // React Native ViewStyle } export interface MediaElementRef { @@ -27,8 +27,8 @@ export interface MediaElementRef { volume: number; muted: boolean; playbackRate: number; - readyState: MediaReadyState; - networkState: MediaNetworkState; + readyState: number; + networkState: number; play(): Promise; pause(): void; @@ -36,146 +36,11 @@ export interface MediaElementRef { seek(time: number): void; } -export const VideoElement = forwardRef( - ({ - source, - controls = false, - paused = true, - muted = false, - volume = 1.0, - rate = 1.0, - repeat = false, - resizeMode = 'contain', - onLoad, - onProgress, - onEnd, - onError, - style, - }, ref) => { - const videoRef = useRef(null); - const stateRef = useRef({ - currentTime: 0, - duration: 0, - paused: true, - ended: false, - volume: 1.0, - muted: false, - playbackRate: 1.0, - readyState: READY_STATE.HAVE_NOTHING, - networkState: NETWORK_STATE.EMPTY, - }); - - const handleLoad = (data: OnLoadData) => { - stateRef.current.duration = data.duration; - stateRef.current.readyState = READY_STATE.HAVE_METADATA; - stateRef.current.networkState = NETWORK_STATE.IDLE; - onLoad?.(data); - }; - - const handleProgress = (data: OnProgressData) => { - stateRef.current.currentTime = data.currentTime; - onProgress?.(data); - }; - - const handleEnd = () => { - stateRef.current.ended = true; - stateRef.current.paused = true; - onEnd?.(); - }; - - const handleError = (error: any) => { - stateRef.current.networkState = NETWORK_STATE.NO_SOURCE; - onError?.(error); - }; - - useImperativeHandle(ref, () => ({ - get currentTime() { - return stateRef.current.currentTime; - }, - get duration() { - return stateRef.current.duration; - }, - get paused() { - return stateRef.current.paused; - }, - get ended() { - return stateRef.current.ended; - }, - get volume() { - return stateRef.current.volume; - }, - get muted() { - return stateRef.current.muted; - }, - get playbackRate() { - return stateRef.current.playbackRate; - }, - get readyState() { - return stateRef.current.readyState; - }, - get networkState() { - return stateRef.current.networkState; - }, - play: async () => { - stateRef.current.paused = false; - stateRef.current.ended = false; - }, - pause: () => { - stateRef.current.paused = true; - }, - load: () => { - stateRef.current.networkState = NETWORK_STATE.LOADING; - }, - seek: (time: number) => { - videoRef.current?.seek(time); - stateRef.current.currentTime = time; - }, - }), []); - - React.useEffect(() => { - stateRef.current.paused = paused; - }, [paused]); - - React.useEffect(() => { - stateRef.current.volume = volume; - }, [volume]); - - React.useEffect(() => { - stateRef.current.muted = muted; - }, [muted]); - - React.useEffect(() => { - stateRef.current.playbackRate = rate; - }, [rate]); - - return ( -