@djangocfg/ui-nextjs 2.1.42 → 2.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/animations/AnimatedBackground.tsx +1 -0
- package/src/blocks/ArticleCard.tsx +6 -7
- package/src/blocks/ArticleList.tsx +14 -13
- package/src/blocks/FeatureSection.tsx +87 -15
- package/src/blocks/SplitHero/SplitHero.tsx +95 -0
- package/src/blocks/SplitHero/SplitHeroContent.tsx +117 -0
- package/src/blocks/SplitHero/SplitHeroMedia.tsx +66 -0
- package/src/blocks/SplitHero/index.ts +13 -0
- package/src/blocks/SplitHero/types.ts +75 -0
- package/src/blocks/SuperHero.tsx +10 -4
- package/src/blocks/index.ts +1 -0
- package/src/components/breadcrumb-navigation.tsx +6 -9
- package/src/components/breadcrumb.tsx +6 -5
- package/src/components/button-download.tsx +7 -5
- package/src/components/dropdown-menu.tsx +6 -5
- package/src/components/markdown/MarkdownMessage.tsx +5 -2
- package/src/components/menubar.tsx +6 -5
- package/src/components/multi-select-pro/async.tsx +8 -18
- package/src/components/multi-select-pro/index.tsx +8 -18
- package/src/components/navigation-menu.tsx +7 -6
- package/src/components/otp/index.tsx +7 -9
- package/src/components/otp/use-otp-input.ts +2 -1
- package/src/components/pagination-static.tsx +7 -10
- package/src/components/pagination.tsx +6 -5
- package/src/components/phone-input.tsx +11 -10
- package/src/components/sidebar.tsx +11 -21
- package/src/components/sonner.tsx +2 -2
- package/src/components/ssr-pagination.tsx +6 -9
- package/src/hooks/useDeviceDetect.ts +1 -1
- package/src/hooks/useHotkey.ts +2 -1
- package/src/hooks/useLocalStorage.ts +1 -1
- package/src/hooks/useQueryParams.ts +1 -1
- package/src/theme/ForceTheme.tsx +1 -0
- package/src/theme/ThemeProvider.tsx +1 -0
- package/src/theme/ThemeToggle.tsx +4 -2
- package/src/tools/JsonForm/JsonSchemaForm.tsx +12 -21
- package/src/tools/JsonForm/examples/BotConfigExample.tsx +7 -3
- package/src/tools/JsonForm/examples/RealBotConfigExample.tsx +7 -3
- package/src/tools/JsonForm/templates/ArrayFieldItemTemplate.tsx +2 -1
- package/src/tools/JsonForm/templates/ArrayFieldTemplate.tsx +3 -2
- package/src/tools/JsonForm/templates/BaseInputTemplate.tsx +3 -2
- package/src/tools/JsonForm/templates/ErrorListTemplate.tsx +3 -2
- package/src/tools/JsonForm/templates/FieldTemplate.tsx +2 -1
- package/src/tools/JsonForm/templates/ObjectFieldTemplate.tsx +4 -7
- package/src/tools/JsonForm/utils.ts +2 -1
- package/src/tools/JsonForm/widgets/CheckboxWidget.tsx +2 -1
- package/src/tools/JsonForm/widgets/ColorWidget.tsx +3 -2
- package/src/tools/JsonForm/widgets/NumberWidget.tsx +3 -2
- package/src/tools/JsonForm/widgets/SelectWidget.tsx +4 -7
- package/src/tools/JsonForm/widgets/SliderWidget.tsx +4 -3
- package/src/tools/JsonForm/widgets/SwitchWidget.tsx +2 -1
- package/src/tools/JsonForm/widgets/TextWidget.tsx +3 -2
- package/src/tools/JsonTree/index.tsx +2 -1
- package/src/tools/LottiePlayer/LottiePlayer.client.tsx +1 -0
- package/src/tools/LottiePlayer/index.tsx +1 -0
- package/src/tools/LottiePlayer/useLottie.ts +2 -1
- package/src/tools/Mermaid/Mermaid.client.tsx +3 -2
- package/src/tools/Mermaid/components/MermaidFullscreenModal.tsx +1 -0
- package/src/tools/Mermaid/hooks/useMermaidFullscreen.ts +1 -1
- package/src/tools/Mermaid/hooks/useMermaidRenderer.ts +3 -2
- package/src/tools/OpenapiViewer/components/EndpointInfo.tsx +22 -16
- package/src/tools/OpenapiViewer/components/EndpointsLibrary.tsx +12 -4
- package/src/tools/OpenapiViewer/components/PlaygroundLayout.tsx +4 -2
- package/src/tools/OpenapiViewer/components/PlaygroundStepper.tsx +3 -1
- package/src/tools/OpenapiViewer/components/RequestBuilder.tsx +9 -6
- package/src/tools/OpenapiViewer/components/RequestParametersForm.tsx +7 -7
- package/src/tools/OpenapiViewer/components/ResponseViewer.tsx +8 -4
- package/src/tools/OpenapiViewer/components/VersionSelector.tsx +7 -3
- package/src/tools/OpenapiViewer/context/PlaygroundContext.tsx +9 -3
- package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +3 -7
- package/src/tools/OpenapiViewer/index.tsx +3 -1
- package/src/tools/PrettyCode/PrettyCode.client.tsx +2 -0
- package/src/tools/PrettyCode/index.tsx +1 -0
- package/src/tools/VideoPlayer/VideoControls.tsx +4 -3
- package/src/tools/VideoPlayer/VideoPlayer.tsx +9 -8
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
|
|
5
5
|
import { Input } from '@djangocfg/ui-core/components';
|
|
6
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Number input widget for JSON Schema Form
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
SelectContent,
|
|
8
|
-
SelectItem,
|
|
9
|
-
SelectTrigger,
|
|
10
|
-
SelectValue,
|
|
6
|
+
Select, SelectContent, SelectItem, SelectTrigger, SelectValue
|
|
11
7
|
} from '@djangocfg/ui-core/components';
|
|
8
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* Select dropdown widget for JSON Schema Form
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
5
|
-
import {
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
|
|
5
|
+
import { Input, Slider } from '@djangocfg/ui-core/components';
|
|
6
6
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
7
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Slider widget for JSON Schema Form
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
|
|
5
5
|
import { Input } from '@djangocfg/ui-core/components';
|
|
6
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Text input widget for JSON Schema Form
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { ChevronDown, ChevronUp, Download } from 'lucide-react';
|
|
3
4
|
import React, { useState } from 'react';
|
|
4
5
|
import { CommonExternalProps, JSONTree } from 'react-json-tree';
|
|
5
|
-
|
|
6
|
+
|
|
6
7
|
import { Button, CopyButton } from '@djangocfg/ui-core/components';
|
|
7
8
|
|
|
8
9
|
export type { Language } from 'prism-react-renderer';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
+
|
|
4
5
|
import { useResolvedTheme } from '../../hooks/useResolvedTheme';
|
|
5
|
-
import { useMermaidRenderer } from './hooks/useMermaidRenderer';
|
|
6
|
-
import { useMermaidFullscreen } from './hooks/useMermaidFullscreen';
|
|
7
6
|
import { MermaidFullscreenModal } from './components/MermaidFullscreenModal';
|
|
7
|
+
import { useMermaidFullscreen } from './hooks/useMermaidFullscreen';
|
|
8
|
+
import { useMermaidRenderer } from './hooks/useMermaidRenderer';
|
|
8
9
|
|
|
9
10
|
interface MermaidProps {
|
|
10
11
|
chart: string;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Hook for rendering Mermaid diagrams with debounce and validation
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { useEffect, useRef, useState } from 'react';
|
|
6
5
|
import mermaid from 'mermaid';
|
|
7
|
-
import {
|
|
6
|
+
import { useEffect, useRef, useState } from 'react';
|
|
7
|
+
|
|
8
8
|
import { useMermaidCleanup } from './useMermaidCleanup';
|
|
9
|
+
import { useMermaidValidation } from './useMermaidValidation';
|
|
9
10
|
|
|
10
11
|
interface UseMermaidRendererProps {
|
|
11
12
|
chart: string;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { AlertCircle, ChevronDown, Code, Database, FileText } from 'lucide-react';
|
|
3
4
|
import React, { useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Badge, Card, CardContent, CardHeader, CardTitle, Collapsible, CollapsibleContent,
|
|
8
|
+
CollapsibleTrigger, CopyButton
|
|
9
|
+
} from '@djangocfg/ui-core/components';
|
|
10
|
+
|
|
6
11
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
12
|
import { getMethodColor, getStatusColor } from '../utils';
|
|
8
13
|
|
|
@@ -119,20 +124,21 @@ export const EndpointInfo: React.FC = () => {
|
|
|
119
124
|
<ChevronDown className="h-4 w-4" />
|
|
120
125
|
</CollapsibleTrigger>
|
|
121
126
|
<CollapsibleContent className="mt-2 space-y-2">
|
|
122
|
-
{selectedEndpoint.responses.map((response, index) =>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
{selectedEndpoint.responses.map((response, index) => {
|
|
128
|
+
const statusColor = getStatusColor(parseInt(response.code));
|
|
129
|
+
const badgeVariant = statusColor === 'success' ? 'default' :
|
|
130
|
+
statusColor === 'error' ? 'destructive' : 'secondary';
|
|
131
|
+
return (
|
|
132
|
+
<div key={index} className="flex items-center space-x-2 text-xs">
|
|
133
|
+
<Badge variant={badgeVariant} className="text-xs">
|
|
134
|
+
{response.code}
|
|
135
|
+
</Badge>
|
|
136
|
+
<span className="text-muted-foreground">
|
|
137
|
+
{response.description}
|
|
138
|
+
</span>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
})}
|
|
136
142
|
</CollapsibleContent>
|
|
137
143
|
</Collapsible>
|
|
138
144
|
)}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
BarChart3, Code, Database, FileText, Filter, Grid3X3, List, Search, Settings, Shield, Users
|
|
5
|
+
} from 'lucide-react';
|
|
3
6
|
import React, { useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
Badge, Button, Card, CardContent, CardHeader, CardTitle, Input, Select, SelectContent,
|
|
10
|
+
SelectItem, SelectTrigger, SelectValue, Skeleton, Table, TableBody, TableCell, TableHead,
|
|
11
|
+
TableHeader, TableRow
|
|
12
|
+
} from '@djangocfg/ui-core/components';
|
|
13
|
+
|
|
6
14
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
|
-
import type { ApiEndpoint } from '../types';
|
|
8
|
-
import { getMethodColor } from '../utils';
|
|
9
15
|
import useOpenApiSchema from '../hooks/useOpenApiSchema';
|
|
16
|
+
import { getMethodColor } from '../utils';
|
|
10
17
|
import { deduplicateEndpoints } from '../utils/versionManager';
|
|
11
18
|
import { VersionSelector } from './VersionSelector';
|
|
12
19
|
|
|
20
|
+
import type { ApiEndpoint } from '../types';
|
|
13
21
|
const categoryIcons: Record<string, React.ReactNode> = {
|
|
14
22
|
'Authentication': <Shield className="h-4 w-4" />,
|
|
15
23
|
'Users': <Users className="h-4 w-4" />,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { Menu, X } from 'lucide-react';
|
|
3
4
|
import React from 'react';
|
|
5
|
+
|
|
4
6
|
import { Button, Sheet, SheetContent, SheetTrigger } from '@djangocfg/ui-core/components';
|
|
5
|
-
|
|
7
|
+
|
|
6
8
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
9
|
import { useMobile } from '../hooks/useMobile';
|
|
8
|
-
import { PlaygroundStepper } from './PlaygroundStepper';
|
|
9
10
|
import { EndpointsLibrary } from './EndpointsLibrary';
|
|
11
|
+
import { PlaygroundStepper } from './PlaygroundStepper';
|
|
10
12
|
import { RequestBuilder } from './RequestBuilder';
|
|
11
13
|
import { ResponseViewer } from './ResponseViewer';
|
|
12
14
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { Check, ChevronLeft, ChevronRight, Code, FileText, Send } from 'lucide-react';
|
|
3
4
|
import React from 'react';
|
|
5
|
+
|
|
4
6
|
import { Badge, Button } from '@djangocfg/ui-core/components';
|
|
5
|
-
|
|
7
|
+
|
|
6
8
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
9
|
import { PlaygroundStep } from '../types';
|
|
8
10
|
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { Key, Loader2, Send } from 'lucide-react';
|
|
3
4
|
import React, { useCallback } from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Button, Card, CardContent, CardHeader, CardTitle, CopyButton, Input, Textarea
|
|
8
|
+
} from '@djangocfg/ui-core/components';
|
|
9
|
+
|
|
10
|
+
import PrettyCode from '../../PrettyCode';
|
|
6
11
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
|
-
import { findApiKeyById } from '../utils';
|
|
8
|
-
import { isValidJson, parseRequestHeaders } from '../utils';
|
|
9
|
-
import { RequestParametersForm } from './RequestParametersForm';
|
|
12
|
+
import { findApiKeyById, isValidJson, parseRequestHeaders } from '../utils';
|
|
10
13
|
import { EndpointInfo } from './EndpointInfo';
|
|
11
|
-
import
|
|
14
|
+
import { RequestParametersForm } from './RequestParametersForm';
|
|
12
15
|
|
|
13
16
|
export const RequestBuilder: React.FC = () => {
|
|
14
17
|
const {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { HelpCircle } from 'lucide-react';
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
|
+
|
|
4
6
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Accordion, AccordionContent, AccordionItem, AccordionTrigger,
|
|
9
|
-
Tooltip, TooltipContent, TooltipProvider, TooltipTrigger
|
|
7
|
+
Accordion, AccordionContent, AccordionItem, AccordionTrigger, Badge, Button, Card, CardContent,
|
|
8
|
+
CardHeader, CardTitle, Input, Label, Tabs, TabsContent, TabsList, TabsTrigger, Textarea,
|
|
9
|
+
Tooltip, TooltipContent, TooltipProvider, TooltipTrigger
|
|
10
10
|
} from '@djangocfg/ui-core/components';
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
13
13
|
|
|
14
14
|
interface Parameter {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import { Download, XCircle } from 'lucide-react';
|
|
4
|
+
import React, { useCallback, useMemo } from 'react';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Badge, Button, Card, CardContent, CardHeader, CardTitle, CopyButton
|
|
8
|
+
} from '@djangocfg/ui-core/components';
|
|
9
|
+
|
|
10
|
+
import JsonTree from '../../JsonTree';
|
|
6
11
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
12
|
import { getStatusColor } from '../utils';
|
|
8
|
-
import JsonTree from '../../JsonTree';
|
|
9
13
|
|
|
10
14
|
export const ResponseViewer: React.FC = () => {
|
|
11
15
|
const { state } = usePlaygroundContext();
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Badge, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@djangocfg/ui-core/components';
|
|
5
3
|
import { GitBranch, Info } from 'lucide-react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Badge, Select, SelectContent, SelectItem, SelectTrigger, SelectValue
|
|
8
|
+
} from '@djangocfg/ui-core/components';
|
|
9
|
+
|
|
6
10
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
|
-
import { API_VERSIONS, getVersionById, getVersionStats } from '../utils/versionManager';
|
|
8
11
|
import useOpenApiSchema from '../hooks/useOpenApiSchema';
|
|
12
|
+
import { API_VERSIONS, getVersionById, getVersionStats } from '../utils/versionManager';
|
|
9
13
|
|
|
10
14
|
export const VersionSelector: React.FC = () => {
|
|
11
15
|
const { state, config, setSelectedVersion } = usePlaygroundContext();
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import React, { createContext, ReactNode, useCallback, useContext, useEffect, useState } from 'react';
|
|
4
3
|
import consola from 'consola';
|
|
5
|
-
import
|
|
6
|
-
|
|
4
|
+
import React, {
|
|
5
|
+
createContext, ReactNode, useCallback, useContext, useEffect, useState
|
|
6
|
+
} from 'react';
|
|
7
|
+
|
|
8
|
+
import type {
|
|
9
|
+
ApiEndpoint, ApiResponse, PlaygroundConfig, PlaygroundContextType, PlaygroundState,
|
|
10
|
+
PlaygroundStep
|
|
11
|
+
} from '../types';
|
|
7
12
|
import { parseRequestHeaders, substituteUrlParameters } from '../utils';
|
|
13
|
+
import { getDefaultVersion } from '../utils/versionManager';
|
|
8
14
|
|
|
9
15
|
const createInitialState = (): PlaygroundState => ({
|
|
10
16
|
// Step management
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
3
|
import consola from 'consola';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
SchemaSource,
|
|
9
|
-
UseOpenApiSchemaReturn,
|
|
10
|
-
} from '../types';
|
|
4
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
|
+
|
|
6
|
+
import { ApiEndpoint, OpenApiSchema, SchemaSource, UseOpenApiSchemaReturn } from '../types';
|
|
11
7
|
|
|
12
8
|
// Extract endpoints from OpenAPI schema (GET only)
|
|
13
9
|
const extractEndpoints = (schema: OpenApiSchema): ApiEndpoint[] => {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import dynamic from 'next/dynamic';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
5
6
|
import { PlaygroundProvider } from './context/PlaygroundContext';
|
|
7
|
+
|
|
6
8
|
import type { PlaygroundConfig } from './types';
|
|
7
9
|
|
|
8
10
|
const PlaygroundLayout = dynamic(
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { Highlight, Language, themes } from 'prism-react-renderer';
|
|
4
4
|
import React from 'react';
|
|
5
|
+
|
|
5
6
|
import { CopyButton } from '@djangocfg/ui-core/components';
|
|
7
|
+
|
|
6
8
|
import { useResolvedTheme } from '../../hooks/useResolvedTheme';
|
|
7
9
|
|
|
8
10
|
interface PrettyCodeProps {
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
'use client';
|
|
6
6
|
|
|
7
|
+
import { Maximize, Minimize, Pause, Play, Volume2, VolumeX } from 'lucide-react';
|
|
7
8
|
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import type { MediaPlayerInstance } from '@vidstack/react';
|
|
10
|
-
import { Play, Pause, Volume2, VolumeX, Maximize, Minimize } from 'lucide-react';
|
|
9
|
+
|
|
11
10
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
11
|
+
import { useMediaRemote, useMediaStore } from '@vidstack/react';
|
|
12
12
|
|
|
13
|
+
import type { MediaPlayerInstance } from '@vidstack/react';
|
|
13
14
|
interface VideoControlsProps {
|
|
14
15
|
player: React.RefObject<MediaPlayerInstance | null>;
|
|
15
16
|
className?: string;
|
|
@@ -6,20 +6,21 @@
|
|
|
6
6
|
|
|
7
7
|
'use client';
|
|
8
8
|
|
|
9
|
-
import React, { forwardRef, useImperativeHandle, useRef, useMemo } from 'react';
|
|
10
|
-
import { MediaPlayer, MediaProvider, Poster } from '@vidstack/react';
|
|
11
|
-
import { defaultLayoutIcons, DefaultVideoLayout } from '@vidstack/react/player/layouts/default';
|
|
12
|
-
import type { MediaPlayerInstance } from '@vidstack/react';
|
|
13
|
-
import { cn } from '@djangocfg/ui-core/lib';
|
|
14
|
-
import { generateOgImageUrl } from '@djangocfg/ui-core/lib';
|
|
15
|
-
import { type VideoPlayerProps, type VideoPlayerRef } from './types';
|
|
16
|
-
|
|
17
9
|
// Import Vidstack base styles
|
|
18
10
|
import '@vidstack/react/player/styles/base.css';
|
|
19
11
|
// Import default theme
|
|
20
12
|
import '@vidstack/react/player/styles/default/theme.css';
|
|
21
13
|
import '@vidstack/react/player/styles/default/layouts/video.css';
|
|
22
14
|
|
|
15
|
+
import React, { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';
|
|
16
|
+
|
|
17
|
+
import { cn, generateOgImageUrl } from '@djangocfg/ui-core/lib';
|
|
18
|
+
import { MediaPlayer, MediaProvider, Poster } from '@vidstack/react';
|
|
19
|
+
import { defaultLayoutIcons, DefaultVideoLayout } from '@vidstack/react/player/layouts/default';
|
|
20
|
+
|
|
21
|
+
import { type, VideoPlayerProps, VideoPlayerRef } from './types';
|
|
22
|
+
|
|
23
|
+
import type { MediaPlayerInstance } from '@vidstack/react';
|
|
23
24
|
/**
|
|
24
25
|
* Custom error class for invalid video URLs
|
|
25
26
|
*/
|