@djangocfg/ui-tools 2.1.91
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/dist/LottiePlayer.client-LBEC2JKY.mjs +161 -0
- package/dist/LottiePlayer.client-LBEC2JKY.mjs.map +1 -0
- package/dist/LottiePlayer.client-WFMG2OOW.cjs +168 -0
- package/dist/LottiePlayer.client-WFMG2OOW.cjs.map +1 -0
- package/dist/Mermaid.client-4TU2TSH3.mjs +477 -0
- package/dist/Mermaid.client-4TU2TSH3.mjs.map +1 -0
- package/dist/Mermaid.client-SBYY364Q.cjs +483 -0
- package/dist/Mermaid.client-SBYY364Q.cjs.map +1 -0
- package/dist/PlaygroundLayout-3YVSAEAF.cjs +1003 -0
- package/dist/PlaygroundLayout-3YVSAEAF.cjs.map +1 -0
- package/dist/PlaygroundLayout-4DYBORAS.mjs +996 -0
- package/dist/PlaygroundLayout-4DYBORAS.mjs.map +1 -0
- package/dist/PrettyCode.client-LCBPPTIX.mjs +152 -0
- package/dist/PrettyCode.client-LCBPPTIX.mjs.map +1 -0
- package/dist/PrettyCode.client-PNPLXRH6.cjs +154 -0
- package/dist/PrettyCode.client-PNPLXRH6.cjs.map +1 -0
- package/dist/chunk-37ZI6VD4.mjs +12 -0
- package/dist/chunk-37ZI6VD4.mjs.map +1 -0
- package/dist/chunk-3HK2OE62.cjs +81 -0
- package/dist/chunk-3HK2OE62.cjs.map +1 -0
- package/dist/chunk-7DGDQVQW.cjs +591 -0
- package/dist/chunk-7DGDQVQW.cjs.map +1 -0
- package/dist/chunk-M6P2FU7L.mjs +572 -0
- package/dist/chunk-M6P2FU7L.mjs.map +1 -0
- package/dist/chunk-UQ3XI5MY.cjs +15 -0
- package/dist/chunk-UQ3XI5MY.cjs.map +1 -0
- package/dist/chunk-YFRNE2IR.mjs +79 -0
- package/dist/chunk-YFRNE2IR.mjs.map +1 -0
- package/dist/index.cjs +5042 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1591 -0
- package/dist/index.d.ts +1591 -0
- package/dist/index.mjs +4941 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +86 -0
- package/src/components/markdown/MarkdownMessage.tsx +340 -0
- package/src/components/markdown/index.ts +5 -0
- package/src/index.ts +26 -0
- package/src/stores/index.ts +9 -0
- package/src/stores/mediaCache.ts +534 -0
- package/src/tools/AudioPlayer/README.md +206 -0
- package/src/tools/AudioPlayer/components/HybridAudioPlayer.tsx +216 -0
- package/src/tools/AudioPlayer/components/HybridSimplePlayer.tsx +280 -0
- package/src/tools/AudioPlayer/components/HybridWaveform.tsx +279 -0
- package/src/tools/AudioPlayer/components/ReactiveCover/AudioReactiveCover.tsx +149 -0
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/GlowEffect.tsx +110 -0
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/MeshEffect.tsx +58 -0
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/OrbsEffect.tsx +45 -0
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/SpotlightEffect.tsx +82 -0
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/index.ts +8 -0
- package/src/tools/AudioPlayer/components/ReactiveCover/index.ts +6 -0
- package/src/tools/AudioPlayer/components/index.ts +22 -0
- package/src/tools/AudioPlayer/context/HybridAudioProvider.tsx +158 -0
- package/src/tools/AudioPlayer/context/index.ts +16 -0
- package/src/tools/AudioPlayer/effects/index.ts +412 -0
- package/src/tools/AudioPlayer/hooks/index.ts +35 -0
- package/src/tools/AudioPlayer/hooks/useHybridAudio.ts +387 -0
- package/src/tools/AudioPlayer/hooks/useHybridAudioAnalysis.ts +95 -0
- package/src/tools/AudioPlayer/hooks/useVisualization.tsx +207 -0
- package/src/tools/AudioPlayer/index.ts +133 -0
- package/src/tools/AudioPlayer/types/effects.ts +73 -0
- package/src/tools/AudioPlayer/types/index.ts +27 -0
- package/src/tools/AudioPlayer/utils/debug.ts +14 -0
- package/src/tools/AudioPlayer/utils/formatTime.ts +10 -0
- package/src/tools/AudioPlayer/utils/index.ts +6 -0
- package/src/tools/ImageViewer/@refactoring/00-PLAN.md +71 -0
- package/src/tools/ImageViewer/@refactoring/01-TYPES.md +121 -0
- package/src/tools/ImageViewer/@refactoring/02-UTILS.md +143 -0
- package/src/tools/ImageViewer/@refactoring/03-HOOKS.md +261 -0
- package/src/tools/ImageViewer/@refactoring/04-COMPONENTS.md +427 -0
- package/src/tools/ImageViewer/@refactoring/05-EXECUTION-CHECKLIST.md +126 -0
- package/src/tools/ImageViewer/README.md +200 -0
- package/src/tools/ImageViewer/components/ImageInfo.tsx +44 -0
- package/src/tools/ImageViewer/components/ImageToolbar.tsx +145 -0
- package/src/tools/ImageViewer/components/ImageViewer.tsx +241 -0
- package/src/tools/ImageViewer/components/index.ts +7 -0
- package/src/tools/ImageViewer/hooks/index.ts +9 -0
- package/src/tools/ImageViewer/hooks/useImageLoading.ts +204 -0
- package/src/tools/ImageViewer/hooks/useImageTransform.ts +101 -0
- package/src/tools/ImageViewer/index.ts +60 -0
- package/src/tools/ImageViewer/types.ts +81 -0
- package/src/tools/ImageViewer/utils/constants.ts +59 -0
- package/src/tools/ImageViewer/utils/debug.ts +14 -0
- package/src/tools/ImageViewer/utils/index.ts +17 -0
- package/src/tools/ImageViewer/utils/lqip.ts +47 -0
- package/src/tools/JsonForm/JsonSchemaForm.tsx +197 -0
- package/src/tools/JsonForm/examples/BotConfigExample.tsx +249 -0
- package/src/tools/JsonForm/examples/RealBotConfigExample.tsx +161 -0
- package/src/tools/JsonForm/index.ts +46 -0
- package/src/tools/JsonForm/templates/ArrayFieldItemTemplate.tsx +47 -0
- package/src/tools/JsonForm/templates/ArrayFieldTemplate.tsx +74 -0
- package/src/tools/JsonForm/templates/BaseInputTemplate.tsx +107 -0
- package/src/tools/JsonForm/templates/ErrorListTemplate.tsx +35 -0
- package/src/tools/JsonForm/templates/FieldTemplate.tsx +62 -0
- package/src/tools/JsonForm/templates/ObjectFieldTemplate.tsx +116 -0
- package/src/tools/JsonForm/templates/index.ts +12 -0
- package/src/tools/JsonForm/types.ts +83 -0
- package/src/tools/JsonForm/utils.ts +213 -0
- package/src/tools/JsonForm/widgets/CheckboxWidget.tsx +37 -0
- package/src/tools/JsonForm/widgets/ColorWidget.tsx +219 -0
- package/src/tools/JsonForm/widgets/NumberWidget.tsx +89 -0
- package/src/tools/JsonForm/widgets/SelectWidget.tsx +97 -0
- package/src/tools/JsonForm/widgets/SliderWidget.tsx +148 -0
- package/src/tools/JsonForm/widgets/SwitchWidget.tsx +35 -0
- package/src/tools/JsonForm/widgets/TextWidget.tsx +96 -0
- package/src/tools/JsonForm/widgets/index.ts +14 -0
- package/src/tools/JsonTree/index.tsx +243 -0
- package/src/tools/LottiePlayer/LottiePlayer.client.tsx +213 -0
- package/src/tools/LottiePlayer/index.tsx +56 -0
- package/src/tools/LottiePlayer/types.ts +108 -0
- package/src/tools/LottiePlayer/useLottie.ts +164 -0
- package/src/tools/Mermaid/Mermaid.client.tsx +82 -0
- package/src/tools/Mermaid/components/MermaidCodeViewer.tsx +95 -0
- package/src/tools/Mermaid/components/MermaidFullscreenModal.tsx +103 -0
- package/src/tools/Mermaid/hooks/index.ts +4 -0
- package/src/tools/Mermaid/hooks/useMermaidCleanup.ts +73 -0
- package/src/tools/Mermaid/hooks/useMermaidFullscreen.ts +46 -0
- package/src/tools/Mermaid/hooks/useMermaidRenderer.ts +226 -0
- package/src/tools/Mermaid/hooks/useMermaidValidation.ts +29 -0
- package/src/tools/Mermaid/index.tsx +44 -0
- package/src/tools/Mermaid/utils/mermaid-helpers.ts +33 -0
- package/src/tools/OpenapiViewer/components/EndpointInfo.tsx +149 -0
- package/src/tools/OpenapiViewer/components/EndpointsLibrary.tsx +263 -0
- package/src/tools/OpenapiViewer/components/PlaygroundLayout.tsx +125 -0
- package/src/tools/OpenapiViewer/components/PlaygroundStepper.tsx +100 -0
- package/src/tools/OpenapiViewer/components/RequestBuilder.tsx +157 -0
- package/src/tools/OpenapiViewer/components/RequestParametersForm.tsx +253 -0
- package/src/tools/OpenapiViewer/components/ResponseViewer.tsx +173 -0
- package/src/tools/OpenapiViewer/components/VersionSelector.tsx +68 -0
- package/src/tools/OpenapiViewer/components/index.ts +14 -0
- package/src/tools/OpenapiViewer/constants.ts +39 -0
- package/src/tools/OpenapiViewer/context/PlaygroundContext.tsx +337 -0
- package/src/tools/OpenapiViewer/hooks/index.ts +8 -0
- package/src/tools/OpenapiViewer/hooks/useMobile.ts +10 -0
- package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +199 -0
- package/src/tools/OpenapiViewer/index.tsx +37 -0
- package/src/tools/OpenapiViewer/types.ts +151 -0
- package/src/tools/OpenapiViewer/utils/apiKeyManager.ts +149 -0
- package/src/tools/OpenapiViewer/utils/formatters.ts +71 -0
- package/src/tools/OpenapiViewer/utils/index.ts +9 -0
- package/src/tools/OpenapiViewer/utils/versionManager.ts +161 -0
- package/src/tools/PrettyCode/PrettyCode.client.tsx +208 -0
- package/src/tools/PrettyCode/index.tsx +47 -0
- package/src/tools/VideoPlayer/@refactoring/00-PLAN.md +91 -0
- package/src/tools/VideoPlayer/@refactoring/01-TYPES.md +284 -0
- package/src/tools/VideoPlayer/@refactoring/02-UTILS.md +141 -0
- package/src/tools/VideoPlayer/@refactoring/03-HOOKS.md +178 -0
- package/src/tools/VideoPlayer/@refactoring/04-COMPONENTS.md +95 -0
- package/src/tools/VideoPlayer/@refactoring/05-EXECUTION-CHECKLIST.md +139 -0
- package/src/tools/VideoPlayer/README.md +264 -0
- package/src/tools/VideoPlayer/components/VideoControls.tsx +138 -0
- package/src/tools/VideoPlayer/components/VideoErrorFallback.tsx +172 -0
- package/src/tools/VideoPlayer/components/VideoPlayer.tsx +201 -0
- package/src/tools/VideoPlayer/components/index.ts +14 -0
- package/src/tools/VideoPlayer/context/VideoPlayerContext.tsx +52 -0
- package/src/tools/VideoPlayer/context/index.ts +8 -0
- package/src/tools/VideoPlayer/hooks/index.ts +12 -0
- package/src/tools/VideoPlayer/hooks/useVideoPlayerSettings.ts +70 -0
- package/src/tools/VideoPlayer/hooks/useVideoPositionCache.ts +116 -0
- package/src/tools/VideoPlayer/index.ts +77 -0
- package/src/tools/VideoPlayer/providers/NativeProvider.tsx +284 -0
- package/src/tools/VideoPlayer/providers/StreamProvider.tsx +505 -0
- package/src/tools/VideoPlayer/providers/VidstackProvider.tsx +400 -0
- package/src/tools/VideoPlayer/providers/index.ts +8 -0
- package/src/tools/VideoPlayer/types/index.ts +38 -0
- package/src/tools/VideoPlayer/types/player.ts +116 -0
- package/src/tools/VideoPlayer/types/provider.ts +93 -0
- package/src/tools/VideoPlayer/types/sources.ts +97 -0
- package/src/tools/VideoPlayer/utils/debug.ts +14 -0
- package/src/tools/VideoPlayer/utils/fileSource.ts +78 -0
- package/src/tools/VideoPlayer/utils/index.ts +12 -0
- package/src/tools/VideoPlayer/utils/resolvers.ts +75 -0
- package/src/tools/_shared.ts +29 -0
- package/src/tools/index.ts +172 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video source type definitions
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// Source Types - Different ways to provide video content
|
|
7
|
+
// =============================================================================
|
|
8
|
+
|
|
9
|
+
/** Simple URL source (mp4, webm, etc.) */
|
|
10
|
+
export interface UrlSource {
|
|
11
|
+
type: 'url';
|
|
12
|
+
url: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
poster?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** YouTube embed source */
|
|
18
|
+
export interface YouTubeSource {
|
|
19
|
+
type: 'youtube';
|
|
20
|
+
/** YouTube video ID (11 characters) */
|
|
21
|
+
id: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
poster?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Vimeo embed source */
|
|
27
|
+
export interface VimeoSource {
|
|
28
|
+
type: 'vimeo';
|
|
29
|
+
/** Vimeo video ID */
|
|
30
|
+
id: string;
|
|
31
|
+
title?: string;
|
|
32
|
+
poster?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** HLS streaming source */
|
|
36
|
+
export interface HLSSource {
|
|
37
|
+
type: 'hls';
|
|
38
|
+
/** URL to .m3u8 manifest */
|
|
39
|
+
url: string;
|
|
40
|
+
title?: string;
|
|
41
|
+
poster?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** DASH streaming source */
|
|
45
|
+
export interface DASHSource {
|
|
46
|
+
type: 'dash';
|
|
47
|
+
/** URL to .mpd manifest */
|
|
48
|
+
url: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
poster?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** HTTP Range streaming source (for large files with auth) */
|
|
54
|
+
export interface StreamSource {
|
|
55
|
+
type: 'stream';
|
|
56
|
+
/** Session ID for authorization */
|
|
57
|
+
sessionId: string;
|
|
58
|
+
/** File path on server */
|
|
59
|
+
path: string;
|
|
60
|
+
/** Function to generate stream URL */
|
|
61
|
+
getStreamUrl: (sessionId: string, path: string) => string;
|
|
62
|
+
/** MIME type for the video */
|
|
63
|
+
mimeType?: string;
|
|
64
|
+
title?: string;
|
|
65
|
+
poster?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Binary data source (ArrayBuffer) */
|
|
69
|
+
export interface BlobSource {
|
|
70
|
+
type: 'blob';
|
|
71
|
+
/** Video data as ArrayBuffer */
|
|
72
|
+
data: ArrayBuffer;
|
|
73
|
+
/** MIME type (default: video/mp4) */
|
|
74
|
+
mimeType?: string;
|
|
75
|
+
title?: string;
|
|
76
|
+
poster?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Base64 data URL source */
|
|
80
|
+
export interface DataUrlSource {
|
|
81
|
+
type: 'data-url';
|
|
82
|
+
/** Base64 encoded data URL */
|
|
83
|
+
data: string;
|
|
84
|
+
title?: string;
|
|
85
|
+
poster?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Union of all source types */
|
|
89
|
+
export type VideoSourceUnion =
|
|
90
|
+
| UrlSource
|
|
91
|
+
| YouTubeSource
|
|
92
|
+
| VimeoSource
|
|
93
|
+
| HLSSource
|
|
94
|
+
| DASHSource
|
|
95
|
+
| StreamSource
|
|
96
|
+
| BlobSource
|
|
97
|
+
| DataUrlSource;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* VideoPlayer Debug Logger
|
|
5
|
+
*
|
|
6
|
+
* Uses universal logger with media-specific helpers.
|
|
7
|
+
* Logs go to both console (dev) and zustand store (for Console panel).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { createMediaLogger } from '@djangocfg/ui-core/lib';
|
|
11
|
+
|
|
12
|
+
export const videoDebug = createMediaLogger('VideoPlayer');
|
|
13
|
+
|
|
14
|
+
export default videoDebug;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File source resolution utilities
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { VideoSourceUnion, ResolveFileSourceOptions } from '../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Resolve file content to VideoSourceUnion
|
|
9
|
+
* Useful for FileWorkspace/file manager integrations
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const source = resolveFileSource({
|
|
13
|
+
* content: file.content,
|
|
14
|
+
* path: file.path,
|
|
15
|
+
* mimeType: file.mimeType,
|
|
16
|
+
* sessionId: sessionId,
|
|
17
|
+
* loadMethod: file.loadMethod,
|
|
18
|
+
* getStreamUrl: terminalClient.terminal_media.streamStreamRetrieveUrl
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* <VideoPlayer source={source} />
|
|
22
|
+
*/
|
|
23
|
+
export function resolveFileSource(options: ResolveFileSourceOptions): VideoSourceUnion | null {
|
|
24
|
+
const {
|
|
25
|
+
content,
|
|
26
|
+
path,
|
|
27
|
+
mimeType,
|
|
28
|
+
sessionId,
|
|
29
|
+
loadMethod,
|
|
30
|
+
getStreamUrl,
|
|
31
|
+
title,
|
|
32
|
+
poster,
|
|
33
|
+
} = options;
|
|
34
|
+
|
|
35
|
+
const contentSize = content
|
|
36
|
+
? typeof content === 'string'
|
|
37
|
+
? content.length
|
|
38
|
+
: content.byteLength
|
|
39
|
+
: 0;
|
|
40
|
+
const hasContent = contentSize > 0;
|
|
41
|
+
|
|
42
|
+
// Priority 1: HTTP Range streaming for large files
|
|
43
|
+
if (loadMethod === 'http_stream' && !hasContent && sessionId && getStreamUrl) {
|
|
44
|
+
return {
|
|
45
|
+
type: 'stream',
|
|
46
|
+
sessionId,
|
|
47
|
+
path,
|
|
48
|
+
getStreamUrl,
|
|
49
|
+
mimeType,
|
|
50
|
+
title,
|
|
51
|
+
poster,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Priority 2: Data URL (base64 string)
|
|
56
|
+
if (typeof content === 'string' && hasContent) {
|
|
57
|
+
return {
|
|
58
|
+
type: 'data-url',
|
|
59
|
+
data: content,
|
|
60
|
+
title,
|
|
61
|
+
poster,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Priority 3: ArrayBuffer → Blob
|
|
66
|
+
if (content instanceof ArrayBuffer && hasContent) {
|
|
67
|
+
return {
|
|
68
|
+
type: 'blob',
|
|
69
|
+
data: content,
|
|
70
|
+
mimeType: mimeType || 'video/mp4',
|
|
71
|
+
title,
|
|
72
|
+
poster,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// No valid content
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video source and player mode resolvers
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { VideoSourceUnion, PlayerMode, SimpleStreamSource, StreamSource, VideoPlayerContextValue } from '../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Determine which provider to use based on source type
|
|
9
|
+
*/
|
|
10
|
+
export function resolvePlayerMode(
|
|
11
|
+
source: VideoSourceUnion,
|
|
12
|
+
mode: PlayerMode = 'auto'
|
|
13
|
+
): 'vidstack' | 'native' | 'streaming' {
|
|
14
|
+
if (mode !== 'auto') {
|
|
15
|
+
return mode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
switch (source.type) {
|
|
19
|
+
case 'youtube':
|
|
20
|
+
case 'vimeo':
|
|
21
|
+
case 'hls':
|
|
22
|
+
case 'dash':
|
|
23
|
+
return 'vidstack';
|
|
24
|
+
|
|
25
|
+
case 'stream':
|
|
26
|
+
case 'blob':
|
|
27
|
+
return 'streaming';
|
|
28
|
+
|
|
29
|
+
case 'data-url':
|
|
30
|
+
case 'url':
|
|
31
|
+
default:
|
|
32
|
+
return 'native';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if source is a simplified stream source (without getStreamUrl)
|
|
38
|
+
*/
|
|
39
|
+
export function isSimpleStreamSource(
|
|
40
|
+
source: VideoSourceUnion | SimpleStreamSource
|
|
41
|
+
): source is SimpleStreamSource {
|
|
42
|
+
return source.type === 'stream' && !('getStreamUrl' in source);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Resolve simplified stream source to full stream source using context
|
|
47
|
+
*/
|
|
48
|
+
export function resolveStreamSource(
|
|
49
|
+
source: SimpleStreamSource,
|
|
50
|
+
context: VideoPlayerContextValue | null
|
|
51
|
+
): StreamSource | null {
|
|
52
|
+
if (!context?.getStreamUrl) {
|
|
53
|
+
console.warn(
|
|
54
|
+
'VideoPlayer: Stream source requires getStreamUrl. ' +
|
|
55
|
+
'Either provide it in source or wrap with VideoPlayerProvider.'
|
|
56
|
+
);
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const sessionId = source.sessionId || context.sessionId;
|
|
61
|
+
if (!sessionId) {
|
|
62
|
+
console.warn('VideoPlayer: Stream source requires sessionId.');
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
type: 'stream',
|
|
68
|
+
sessionId,
|
|
69
|
+
path: source.path,
|
|
70
|
+
getStreamUrl: context.getStreamUrl,
|
|
71
|
+
mimeType: source.mimeType,
|
|
72
|
+
title: source.title,
|
|
73
|
+
poster: source.poster,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared imports for tools
|
|
3
|
+
*
|
|
4
|
+
* This file re-exports commonly used utilities from @djangocfg/ui-core
|
|
5
|
+
* to simplify imports in deeply nested tool components.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Utilities
|
|
9
|
+
export { cn } from '@djangocfg/ui-core/lib';
|
|
10
|
+
|
|
11
|
+
// Components
|
|
12
|
+
export {
|
|
13
|
+
Button,
|
|
14
|
+
Slider,
|
|
15
|
+
ScrollArea,
|
|
16
|
+
DropdownMenu,
|
|
17
|
+
DropdownMenuContent,
|
|
18
|
+
DropdownMenuItem,
|
|
19
|
+
DropdownMenuTrigger,
|
|
20
|
+
DownloadButton,
|
|
21
|
+
} from '@djangocfg/ui-core/components';
|
|
22
|
+
|
|
23
|
+
// Hooks
|
|
24
|
+
export { useLocalStorage } from '@djangocfg/ui-core/hooks';
|
|
25
|
+
export { useResolvedTheme } from '@djangocfg/ui-core/hooks';
|
|
26
|
+
export type { ResolvedTheme } from '@djangocfg/ui-core/hooks';
|
|
27
|
+
|
|
28
|
+
// Logger
|
|
29
|
+
export { createLogger } from '@djangocfg/ui-core/lib';
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools - Heavy components with lazy loading (React.lazy + Suspense)
|
|
3
|
+
*
|
|
4
|
+
* All components are lazy-loaded to reduce initial bundle size:
|
|
5
|
+
* - Mermaid: ~800KB (diagram rendering)
|
|
6
|
+
* - PrettyCode: ~500KB (code syntax highlighting)
|
|
7
|
+
* - JsonTree: ~100KB (JSON visualization)
|
|
8
|
+
* - LottiePlayer: ~200KB (Lottie animation player)
|
|
9
|
+
* - JsonForm: ~300KB (JSON Schema form generator)
|
|
10
|
+
* - OpenapiViewer: ~400KB (OpenAPI schema viewer & playground)
|
|
11
|
+
* - VideoPlayer: ~150KB (Professional video player with Vidstack)
|
|
12
|
+
* - AudioPlayer: ~200KB (Audio player with WaveSurfer.js)
|
|
13
|
+
* - ImageViewer: ~50KB (Image viewer with zoom/pan/rotate)
|
|
14
|
+
*
|
|
15
|
+
* Works in any React environment: Next.js, Vite, Wails, CRA
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// Export tools as named exports (all use React.lazy internally)
|
|
19
|
+
export { default as JsonTree } from './JsonTree';
|
|
20
|
+
export type { JsonTreeConfig } from './JsonTree';
|
|
21
|
+
export { default as Mermaid } from './Mermaid';
|
|
22
|
+
export { default as PrettyCode } from './PrettyCode';
|
|
23
|
+
export type { Language } from './PrettyCode';
|
|
24
|
+
export { LottiePlayer, useLottie } from './LottiePlayer';
|
|
25
|
+
export type {
|
|
26
|
+
LottiePlayerProps,
|
|
27
|
+
LottieSize,
|
|
28
|
+
LottieSpeed,
|
|
29
|
+
LottieDirection,
|
|
30
|
+
UseLottieOptions,
|
|
31
|
+
UseLottieReturn,
|
|
32
|
+
} from './LottiePlayer';
|
|
33
|
+
|
|
34
|
+
// Export JsonForm components
|
|
35
|
+
export { JsonSchemaForm } from './JsonForm';
|
|
36
|
+
export type { JsonSchemaFormProps } from './JsonForm';
|
|
37
|
+
export * from './JsonForm/widgets';
|
|
38
|
+
export * from './JsonForm/templates';
|
|
39
|
+
export * from './JsonForm/utils';
|
|
40
|
+
|
|
41
|
+
// Export OpenapiViewer
|
|
42
|
+
export { default as OpenapiViewer } from './OpenapiViewer';
|
|
43
|
+
export type { PlaygroundConfig, SchemaSource, PlaygroundProps } from './OpenapiViewer';
|
|
44
|
+
|
|
45
|
+
// Export VideoPlayer
|
|
46
|
+
export {
|
|
47
|
+
VideoPlayer,
|
|
48
|
+
VideoControls,
|
|
49
|
+
VidstackProvider,
|
|
50
|
+
NativeProvider,
|
|
51
|
+
StreamProvider,
|
|
52
|
+
VideoPlayerProvider,
|
|
53
|
+
useVideoPlayerContext,
|
|
54
|
+
VideoErrorFallback,
|
|
55
|
+
createVideoErrorFallback,
|
|
56
|
+
resolvePlayerMode,
|
|
57
|
+
resolveFileSource,
|
|
58
|
+
isSimpleStreamSource,
|
|
59
|
+
resolveStreamSource,
|
|
60
|
+
} from './VideoPlayer';
|
|
61
|
+
export type {
|
|
62
|
+
VideoSourceUnion,
|
|
63
|
+
UrlSource,
|
|
64
|
+
YouTubeSource,
|
|
65
|
+
VimeoSource,
|
|
66
|
+
HLSSource,
|
|
67
|
+
DASHSource,
|
|
68
|
+
StreamSource,
|
|
69
|
+
BlobSource,
|
|
70
|
+
DataUrlSource,
|
|
71
|
+
PlayerMode,
|
|
72
|
+
AspectRatioValue,
|
|
73
|
+
VideoPlayerProps,
|
|
74
|
+
VideoPlayerRef,
|
|
75
|
+
ErrorFallbackProps,
|
|
76
|
+
ResolveFileSourceOptions,
|
|
77
|
+
VideoPlayerContextValue,
|
|
78
|
+
VideoPlayerProviderProps,
|
|
79
|
+
SimpleStreamSource,
|
|
80
|
+
VideoErrorFallbackProps,
|
|
81
|
+
CreateVideoErrorFallbackOptions,
|
|
82
|
+
} from './VideoPlayer';
|
|
83
|
+
|
|
84
|
+
// Export AudioPlayer (Hybrid - HTML5 audio + Web Audio visualization)
|
|
85
|
+
export {
|
|
86
|
+
// Components
|
|
87
|
+
HybridSimplePlayer,
|
|
88
|
+
HybridAudioPlayer,
|
|
89
|
+
HybridWaveform,
|
|
90
|
+
AudioReactiveCover,
|
|
91
|
+
GlowEffect,
|
|
92
|
+
OrbsEffect,
|
|
93
|
+
SpotlightEffect,
|
|
94
|
+
MeshEffect,
|
|
95
|
+
// Context
|
|
96
|
+
HybridAudioProvider,
|
|
97
|
+
useHybridAudioContext,
|
|
98
|
+
useHybridAudioState,
|
|
99
|
+
useHybridAudioControls,
|
|
100
|
+
useHybridAudioLevels,
|
|
101
|
+
useHybridWebAudio,
|
|
102
|
+
// Hooks
|
|
103
|
+
useHybridAudio,
|
|
104
|
+
useHybridAudioAnalysis,
|
|
105
|
+
useVisualization,
|
|
106
|
+
useAudioVisualization,
|
|
107
|
+
VisualizationProvider,
|
|
108
|
+
VARIANT_INFO,
|
|
109
|
+
INTENSITY_INFO,
|
|
110
|
+
COLOR_SCHEME_INFO,
|
|
111
|
+
// Effects utilities
|
|
112
|
+
getEffectConfig,
|
|
113
|
+
getColors,
|
|
114
|
+
prepareEffectColors,
|
|
115
|
+
calculateGlowLayers,
|
|
116
|
+
calculateOrbs,
|
|
117
|
+
calculateMeshGradients,
|
|
118
|
+
calculateSpotlight,
|
|
119
|
+
INTENSITY_CONFIG,
|
|
120
|
+
COLOR_SCHEMES,
|
|
121
|
+
EFFECT_ANIMATIONS,
|
|
122
|
+
// Utils
|
|
123
|
+
formatTime,
|
|
124
|
+
} from './AudioPlayer';
|
|
125
|
+
export type {
|
|
126
|
+
// Component types
|
|
127
|
+
HybridSimplePlayerProps,
|
|
128
|
+
HybridAudioPlayerProps,
|
|
129
|
+
HybridWaveformProps,
|
|
130
|
+
AudioReactiveCoverProps,
|
|
131
|
+
GlowEffectData,
|
|
132
|
+
// Context types
|
|
133
|
+
HybridAudioProviderProps,
|
|
134
|
+
HybridAudioContextValue,
|
|
135
|
+
// Hook types
|
|
136
|
+
UseHybridAudioOptions,
|
|
137
|
+
HybridAudioState,
|
|
138
|
+
HybridAudioControls,
|
|
139
|
+
HybridWebAudioAPI,
|
|
140
|
+
UseHybridAudioReturn,
|
|
141
|
+
VisualizationSettings,
|
|
142
|
+
VisualizationVariant,
|
|
143
|
+
VisualizationIntensity,
|
|
144
|
+
VisualizationColorScheme,
|
|
145
|
+
UseVisualizationReturn,
|
|
146
|
+
UseAudioVisualizationReturn,
|
|
147
|
+
VisualizationProviderProps,
|
|
148
|
+
// Effect types
|
|
149
|
+
EffectVariant,
|
|
150
|
+
EffectIntensity,
|
|
151
|
+
EffectColorScheme,
|
|
152
|
+
AudioLevels,
|
|
153
|
+
EffectConfig,
|
|
154
|
+
EffectColors,
|
|
155
|
+
EffectLayer,
|
|
156
|
+
// Other types
|
|
157
|
+
EqualizerOptions,
|
|
158
|
+
} from './AudioPlayer';
|
|
159
|
+
|
|
160
|
+
// Export ImageViewer
|
|
161
|
+
export { ImageViewer } from './ImageViewer';
|
|
162
|
+
export type { ImageViewerProps, ImageFile } from './ImageViewer';
|
|
163
|
+
|
|
164
|
+
// Export Media Cache Store
|
|
165
|
+
export {
|
|
166
|
+
useMediaCacheStore,
|
|
167
|
+
useImageCache,
|
|
168
|
+
useAudioCache,
|
|
169
|
+
useVideoCache,
|
|
170
|
+
useBlobUrlCleanup,
|
|
171
|
+
generateContentKey,
|
|
172
|
+
} from '../stores/mediaCache';
|