@djangocfg/ui-tools 2.1.404 → 2.1.408
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/README.md +9 -11
- package/dist/file-icon/index.cjs +449 -61
- package/dist/file-icon/index.cjs.map +1 -1
- package/dist/file-icon/index.d.cts +56 -18
- package/dist/file-icon/index.d.ts +56 -18
- package/dist/file-icon/index.mjs +448 -62
- package/dist/file-icon/index.mjs.map +1 -1
- package/dist/tree/index.cjs +49 -22
- package/dist/tree/index.cjs.map +1 -1
- package/dist/tree/index.d.cts +9 -3
- package/dist/tree/index.d.ts +9 -3
- package/dist/tree/index.mjs +49 -22
- package/dist/tree/index.mjs.map +1 -1
- package/dist/{types-B_zhyAqR.d.cts → types-eEu8SeiQ.d.cts} +4 -0
- package/dist/{types-B_zhyAqR.d.ts → types-eEu8SeiQ.d.ts} +4 -0
- package/package.json +13 -16
- package/src/components/FloatingToolbar/index.tsx +37 -3
- package/src/lib/page-snapshot/__tests__/capture-integration.test.ts +85 -0
- package/src/lib/page-snapshot/__tests__/engine.test.ts +36 -0
- package/src/lib/page-snapshot/__tests__/redaction-integration.test.ts +99 -0
- package/src/lib/page-snapshot/__tests__/tokens.test.ts +17 -0
- package/src/lib/page-snapshot/capture/__tests__/budget.test.ts +49 -0
- package/src/lib/page-snapshot/capture/__tests__/chrome-filter.test.ts +47 -0
- package/src/lib/page-snapshot/capture/__tests__/fold.test.ts +66 -0
- package/src/lib/page-snapshot/capture/__tests__/scope.test.ts +74 -0
- package/src/lib/page-snapshot/capture/__tests__/walk.test.ts +129 -0
- package/src/lib/page-snapshot/capture/accessible-name.ts +73 -0
- package/src/lib/page-snapshot/capture/budget.ts +95 -0
- package/src/lib/page-snapshot/capture/chrome-filter.ts +81 -0
- package/src/lib/page-snapshot/capture/classify.ts +111 -0
- package/src/lib/page-snapshot/capture/dom-utils.ts +111 -0
- package/src/lib/page-snapshot/capture/fold.ts +96 -0
- package/src/lib/page-snapshot/capture/scope.ts +169 -0
- package/src/lib/page-snapshot/capture/walk.ts +250 -0
- package/src/lib/page-snapshot/cst/__tests__/serialize.test.ts +50 -0
- package/src/lib/page-snapshot/cst/directives.ts +47 -0
- package/src/lib/page-snapshot/cst/payload.ts +50 -0
- package/src/lib/page-snapshot/cst/serialize.ts +84 -0
- package/src/lib/page-snapshot/cst/types.ts +115 -0
- package/src/lib/page-snapshot/engine.ts +176 -0
- package/src/lib/page-snapshot/index.ts +93 -0
- package/src/lib/page-snapshot/react/PageSnapshotChip.tsx +72 -0
- package/src/lib/page-snapshot/react/PageSnapshotPreview.tsx +78 -0
- package/src/lib/page-snapshot/react/__tests__/PageSnapshotChip.test.tsx +54 -0
- package/src/lib/page-snapshot/react/__tests__/provider.test.tsx +103 -0
- package/src/lib/page-snapshot/react/__tests__/use-page-snapshot-toggle.test.tsx +62 -0
- package/src/lib/page-snapshot/react/provider.tsx +162 -0
- package/src/lib/page-snapshot/react/use-page-snapshot-toggle.ts +47 -0
- package/src/lib/page-snapshot/react/use-page-snapshot.ts +67 -0
- package/src/lib/page-snapshot/redaction/__tests__/audit.test.ts +25 -0
- package/src/lib/page-snapshot/redaction/__tests__/heuristics.test.ts +73 -0
- package/src/lib/page-snapshot/redaction/__tests__/luhn.test.ts +26 -0
- package/src/lib/page-snapshot/redaction/__tests__/patterns.test.ts +60 -0
- package/src/lib/page-snapshot/redaction/audit.ts +58 -0
- package/src/lib/page-snapshot/redaction/heuristics.ts +75 -0
- package/src/lib/page-snapshot/redaction/index.ts +75 -0
- package/src/lib/page-snapshot/redaction/luhn.ts +25 -0
- package/src/lib/page-snapshot/redaction/patterns.ts +111 -0
- package/src/lib/page-snapshot/refs/__tests__/registry.test.ts +24 -0
- package/src/lib/page-snapshot/refs/registry.ts +46 -0
- package/src/lib/page-snapshot/staleness/__tests__/hash.test.ts +34 -0
- package/src/lib/page-snapshot/staleness/hash.ts +20 -0
- package/src/lib/page-snapshot/tokens.ts +15 -0
- package/src/tools/AudioPlayer/context/PlayerProvider.tsx +13 -14
- package/src/tools/AudioPlayer/hooks/useAudioElementEvents.ts +55 -6
- package/src/tools/AudioPlayer/lazy.tsx +13 -27
- package/src/tools/AudioPlayer/parts/Meta/TimeDisplay.tsx +2 -5
- package/src/tools/Chat/README.md +267 -39
- package/src/tools/Chat/composer/Composer.tsx +471 -0
- package/src/tools/Chat/composer/ComposerActionBar.tsx +65 -0
- package/src/tools/Chat/composer/ComposerBanner.tsx +128 -0
- package/src/tools/Chat/composer/ComposerButton.tsx +64 -0
- package/src/tools/Chat/composer/ComposerFooter.tsx +90 -0
- package/src/tools/Chat/composer/ComposerMenuButton.tsx +62 -0
- package/src/tools/Chat/composer/ComposerModelPicker.tsx +104 -0
- package/src/tools/Chat/composer/ComposerRichTextarea.tsx +88 -0
- package/src/tools/Chat/composer/ComposerToolPill.tsx +95 -0
- package/src/tools/Chat/composer/index.ts +45 -0
- package/src/tools/Chat/composer/size-context.tsx +26 -0
- package/src/tools/Chat/composer/types.ts +143 -0
- package/src/tools/Chat/composer/useComposerActions.tsx +164 -0
- package/src/tools/Chat/context/ChatProvider.tsx +54 -3
- package/src/tools/Chat/core/__tests__/metadata.test.ts +69 -0
- package/src/tools/Chat/core/index.ts +23 -1
- package/src/tools/Chat/core/markdown.ts +1 -1
- package/src/tools/Chat/core/metadata.ts +47 -0
- package/src/tools/Chat/core/payload-dispatch.ts +1 -1
- package/src/tools/Chat/core/transport/http.ts +71 -32
- package/src/tools/Chat/core/transport/sse.ts +18 -10
- package/src/tools/Chat/highlight/HighlightOverlay.tsx +101 -0
- package/src/tools/Chat/highlight/README.md +103 -0
- package/src/tools/Chat/highlight/SpotlightCanvas.tsx +153 -0
- package/src/tools/Chat/highlight/__tests__/HighlightOverlay.test.tsx +112 -0
- package/src/tools/Chat/highlight/__tests__/resolveRef.test.ts +55 -0
- package/src/tools/Chat/highlight/index.ts +21 -0
- package/src/tools/Chat/highlight/resolveRef.ts +42 -0
- package/src/tools/Chat/highlight/types.ts +49 -0
- package/src/tools/Chat/highlight/useHighlightTargets.ts +128 -0
- package/src/tools/Chat/hooks/index.ts +0 -5
- package/src/tools/Chat/hooks/useAutoFocusOnStreamEnd.ts +28 -47
- package/src/tools/Chat/hooks/useChat.ts +47 -14
- package/src/tools/Chat/hooks/useChatComposer.ts +2 -2
- package/src/tools/Chat/hooks/useChatLayout.ts +1 -1
- package/src/tools/Chat/hooks/useStreamEndFocus.ts +54 -0
- package/src/tools/Chat/index.ts +25 -219
- package/src/tools/Chat/launcher/ChatDock.tsx +1 -1
- package/src/tools/Chat/launcher/ChatLauncher.tsx +1 -1
- package/src/tools/Chat/launcher/{ChatHeader.tsx → header/ChatHeader.tsx} +24 -11
- package/src/tools/Chat/launcher/{ChatHeaderActionButton.tsx → header/ChatHeaderActionButton.tsx} +34 -3
- package/src/tools/Chat/launcher/{ChatHeaderLanguageButton.tsx → header/ChatHeaderLanguageButton.tsx} +2 -2
- package/src/tools/Chat/launcher/{ChatHeaderModeToggle.tsx → header/ChatHeaderModeToggle.tsx} +1 -1
- package/src/tools/Chat/launcher/{ChatHeaderResetButton.tsx → header/ChatHeaderResetButton.tsx} +2 -1
- package/src/tools/Chat/launcher/{HeaderSlots.tsx → header/HeaderSlots.tsx} +3 -3
- package/src/tools/Chat/launcher/header/index.ts +26 -0
- package/src/tools/Chat/launcher/index.ts +3 -10
- package/src/tools/Chat/lazy.tsx +38 -284
- package/src/tools/Chat/{components → messages}/MessageBubble.tsx +58 -5
- package/src/tools/Chat/{components → messages}/MessageList.tsx +8 -25
- package/src/tools/Chat/messages/blocks/MessageBlocks.tsx +131 -0
- package/src/tools/Chat/messages/blocks/builtin.tsx +91 -0
- package/src/tools/Chat/messages/blocks/index.ts +12 -0
- package/src/tools/Chat/messages/blocks/registry.tsx +42 -0
- package/src/tools/Chat/messages/blocks/renderers/AudioBlock.tsx +20 -0
- package/src/tools/Chat/messages/blocks/renderers/CodeBlock.tsx +19 -0
- package/src/tools/Chat/messages/blocks/renderers/GalleryBlock.tsx +26 -0
- package/src/tools/Chat/messages/blocks/renderers/ImageBlock.tsx +27 -0
- package/src/tools/Chat/messages/blocks/renderers/JsonBlock.tsx +12 -0
- package/src/tools/Chat/messages/blocks/renderers/LottieBlock.tsx +11 -0
- package/src/tools/Chat/messages/blocks/renderers/MapBlock.tsx +36 -0
- package/src/tools/Chat/messages/blocks/renderers/MermaidBlock.tsx +11 -0
- package/src/tools/Chat/messages/blocks/renderers/VideoBlock.tsx +24 -0
- package/src/tools/Chat/messages/blocks/renderers/types.ts +8 -0
- package/src/tools/Chat/{components → messages}/index.ts +11 -5
- package/src/tools/Chat/public.ts +212 -0
- package/src/tools/Chat/shell/ChatRoot.tsx +326 -0
- package/src/tools/Chat/{components → shell}/EmptyState.tsx +4 -2
- package/src/tools/Chat/shell/index.ts +15 -0
- package/src/tools/Chat/types/block.ts +120 -0
- package/src/tools/Chat/types/config.ts +0 -5
- package/src/tools/Chat/types/index.ts +17 -0
- package/src/tools/Chat/types/message.ts +3 -0
- package/src/tools/Chat/utils/index.ts +4 -0
- package/src/tools/CodeEditor/README.md +4 -6
- package/src/tools/CodeEditor/components/DiffEditor.tsx +48 -13
- package/src/tools/CodeEditor/components/Editor.tsx +96 -44
- package/src/tools/CodeEditor/context/EditorProvider.tsx +34 -17
- package/src/tools/CodeEditor/hooks/useEditorTheme.ts +92 -99
- package/src/tools/CodeEditor/hooks/useMonaco.ts +37 -22
- package/src/tools/CodeEditor/lazy.tsx +6 -0
- package/src/tools/CodeEditor/lib/index.ts +1 -1
- package/src/tools/CodeEditor/lib/themes.ts +3 -39
- package/src/tools/CronScheduler/CronScheduler.client.tsx +230 -61
- package/src/tools/CronScheduler/components/CustomInput.tsx +21 -4
- package/src/tools/CronScheduler/components/DayChips.tsx +13 -11
- package/src/tools/CronScheduler/components/MonthDayGrid.tsx +4 -4
- package/src/tools/CronScheduler/components/SchedulePreview.tsx +7 -3
- package/src/tools/CronScheduler/components/TimeSelector.tsx +1 -1
- package/src/tools/CronScheduler/index.tsx +1 -1
- package/src/tools/CronScheduler/types/index.ts +8 -3
- package/src/tools/CronScheduler/utils/cron-humanize.ts +61 -16
- package/src/tools/CronScheduler/utils/cron-parser.ts +13 -4
- package/src/tools/FileIcon/FileIcon.tsx +24 -39
- package/src/tools/FileIcon/get-file-icon.ts +73 -0
- package/src/tools/FileIcon/icons/icon-data.ts +399 -0
- package/src/tools/FileIcon/index.ts +4 -0
- package/src/tools/FileIcon/loader.ts +17 -35
- package/src/tools/FileIcon/specialFolders.ts +18 -0
- package/src/tools/Gallery/components/lightbox/GalleryLightbox.tsx +112 -35
- package/src/tools/Gallery/components/media/GalleryVideo.tsx +21 -2
- package/src/tools/Gallery/components/preview/GalleryCarousel.tsx +11 -1
- package/src/tools/Gallery/hooks/usePreloadImages.ts +54 -7
- package/src/tools/ImageViewer/components/ImageInfo.tsx +12 -1
- package/src/tools/ImageViewer/components/ImageToolbar.tsx +51 -43
- package/src/tools/ImageViewer/components/ImageViewer.tsx +106 -26
- package/src/tools/ImageViewer/hooks/useImageLoading.ts +13 -0
- package/src/tools/ImageViewer/utils/constants.ts +3 -0
- package/src/tools/ImageViewer/utils/index.ts +1 -0
- package/src/tools/JsonForm/JsonSchemaForm.tsx +4 -1
- package/src/tools/JsonForm/templates/ArrayFieldTemplate.tsx +5 -3
- package/src/tools/JsonForm/templates/BaseInputTemplate.tsx +7 -4
- package/src/tools/JsonForm/templates/ErrorListTemplate.tsx +3 -1
- package/src/tools/JsonForm/templates/ObjectFieldTemplate.tsx +23 -3
- package/src/tools/JsonForm/widgets/ColorWidget.tsx +20 -12
- package/src/tools/JsonForm/widgets/NumberWidget.tsx +14 -9
- package/src/tools/JsonForm/widgets/RadioWidget.tsx +78 -0
- package/src/tools/JsonForm/widgets/SelectWidget.tsx +1 -0
- package/src/tools/JsonForm/widgets/SliderWidget.tsx +7 -4
- package/src/tools/JsonForm/widgets/TextWidget.tsx +41 -17
- package/src/tools/JsonForm/widgets/index.ts +1 -0
- package/src/tools/JsonTree/components/JsonContent.tsx +115 -40
- package/src/tools/LottiePlayer/LottiePlayer.client.tsx +177 -72
- package/src/tools/LottiePlayer/index.tsx +14 -4
- package/src/tools/LottiePlayer/lazy.tsx +11 -3
- package/src/tools/LottiePlayer/types.ts +31 -1
- package/src/tools/LottiePlayer/useLottie.ts +32 -9
- package/src/tools/LottiePlayer/usePrefersReducedMotion.ts +46 -0
- package/src/tools/Map/components/LayerSwitcher.tsx +54 -21
- package/src/tools/Map/components/MapCluster.tsx +28 -21
- package/src/tools/Map/components/MapContainer.tsx +11 -4
- package/src/tools/Map/components/MapLegend.tsx +46 -15
- package/src/tools/Map/components/MapMarker.tsx +31 -2
- package/src/tools/Map/hooks/useMapEvents.ts +64 -105
- package/src/tools/MarkdownEditor/MarkdownEditor.tsx +61 -6
- package/src/tools/MarkdownEditor/MentionList.tsx +37 -4
- package/src/tools/MarkdownEditor/createMentionSuggestion.ts +11 -0
- package/src/tools/MarkdownEditor/lazy.tsx +32 -7
- package/src/tools/MarkdownEditor/styles.css +13 -0
- package/src/tools/MarkdownMessage/CodeBlock.tsx +40 -17
- package/src/tools/MarkdownMessage/MarkdownMessage.tsx +26 -6
- package/src/tools/MarkdownMessage/components.tsx +22 -9
- package/src/tools/MarkdownMessage/types.ts +24 -1
- package/src/tools/Mermaid/Mermaid.client.tsx +27 -5
- package/src/tools/Mermaid/components/MermaidErrorPanel.tsx +31 -0
- package/src/tools/Mermaid/components/MermaidFullscreenModal.tsx +14 -17
- package/src/tools/Mermaid/hooks/useMermaidRenderer.ts +264 -168
- package/src/tools/Mermaid/hooks/useMermaidValidation.ts +76 -10
- package/src/tools/Mermaid/index.tsx +6 -0
- package/src/tools/Mermaid/utils/mermaid-helpers.ts +141 -18
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/FieldRow.tsx +11 -1
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/buildTree.ts +49 -20
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/index.tsx +7 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/grouping.ts +7 -4
- package/src/tools/OpenapiViewer/constants.ts +3 -0
- package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +73 -11
- package/src/tools/OpenapiViewer/utils/schemaExport.ts +26 -6
- package/src/tools/PrettyCode/PrettyCode.client.tsx +23 -16
- package/src/tools/PrettyCode/lazy.tsx +1 -1
- package/src/tools/SpeechRecognition/README.md +1 -1
- package/src/tools/SpeechRecognition/__tests__/language.test.ts +9 -3
- package/src/tools/SpeechRecognition/components/RecordingPulse.tsx +59 -0
- package/src/tools/SpeechRecognition/components/index.ts +2 -0
- package/src/tools/SpeechRecognition/core/engine/external.ts +24 -7
- package/src/tools/SpeechRecognition/core/language.ts +23 -6
- package/src/tools/SpeechRecognition/hooks/usePushToTalk.ts +36 -5
- package/src/tools/SpeechRecognition/hooks/useSpeechRecognition.ts +18 -11
- package/src/tools/SpeechRecognition/widgets/VoiceComposerSlot.tsx +94 -26
- package/src/tools/SpeechRecognition/widgets/index.ts +1 -1
- package/src/tools/Tree/README.md +4 -8
- package/src/tools/Tree/TreeRoot.tsx +22 -10
- package/src/tools/Tree/components/TreeContent.tsx +24 -4
- package/src/tools/Tree/components/TreeLabel.tsx +8 -2
- package/src/tools/Tree/components/TreeRow.tsx +16 -6
- package/src/tools/Tree/data/flatten.ts +10 -4
- package/src/tools/Tree/types.ts +4 -0
- package/src/tools/Uploader/components/UploadAddButton.tsx +29 -6
- package/src/tools/Uploader/components/UploadDropzone.tsx +63 -7
- package/src/tools/Uploader/components/UploadPageDropOverlay.tsx +19 -5
- package/src/tools/Uploader/components/UploadPreviewItem.tsx +47 -17
- package/src/tools/Uploader/components/UploadPreviewList.tsx +24 -12
- package/src/tools/Uploader/utils/formatters.ts +8 -3
- package/src/tools/VideoPlayer/README.md +87 -230
- package/src/tools/VideoPlayer/VideoPlayer.tsx +82 -0
- package/src/tools/VideoPlayer/canvas/canvas-dispatcher.tsx +34 -0
- package/src/tools/VideoPlayer/canvas/hls-canvas.tsx +39 -0
- package/src/tools/VideoPlayer/canvas/iframe-canvas.tsx +33 -0
- package/src/tools/VideoPlayer/canvas/index.ts +12 -0
- package/src/tools/VideoPlayer/canvas/jsx-augmentation.ts +47 -0
- package/src/tools/VideoPlayer/canvas/native-canvas.tsx +38 -0
- package/src/tools/VideoPlayer/canvas/vimeo-canvas.tsx +40 -0
- package/src/tools/VideoPlayer/canvas/youtube-canvas.tsx +78 -0
- package/src/tools/VideoPlayer/index.ts +51 -65
- package/src/tools/VideoPlayer/lazy.tsx +11 -54
- package/src/tools/VideoPlayer/parts/controls-bar.tsx +35 -0
- package/src/tools/VideoPlayer/parts/fullscreen.tsx +19 -0
- package/src/tools/VideoPlayer/parts/index.ts +15 -0
- package/src/tools/VideoPlayer/parts/pip.tsx +19 -0
- package/src/tools/VideoPlayer/parts/play-button.tsx +19 -0
- package/src/tools/VideoPlayer/parts/playback-rate.tsx +31 -0
- package/src/tools/VideoPlayer/parts/poster.tsx +3 -0
- package/src/tools/VideoPlayer/parts/seek-bar.tsx +26 -0
- package/src/tools/VideoPlayer/parts/volume.tsx +32 -0
- package/src/tools/VideoPlayer/styles/video-player.css +141 -0
- package/src/tools/VideoPlayer/types.ts +82 -0
- package/src/tools/VideoPlayer/utils/parse-embed-url.ts +70 -0
- package/src/tools/VideoPlayer/utils/vimeo-id.ts +24 -0
- package/src/tools/VideoPlayer/utils/youtube-id.ts +64 -0
- package/src/tools/index.ts +37 -29
- package/src/tools/Chat/components/AudioToggle.tsx +0 -78
- package/src/tools/Chat/components/ChatRoot.tsx +0 -305
- package/src/tools/Chat/components/Composer.tsx +0 -216
- package/src/tools/Chat/hooks/useChatScroll.ts +0 -145
- package/src/tools/Chat/types.ts +0 -9
- package/src/tools/JsonTree/components/JsonToolbar.tsx +0 -95
- package/src/tools/JsonTree/hooks/useElementCorner.ts +0 -84
- package/src/tools/JsonTree/hooks/useNavbarHeight.ts +0 -83
- package/src/tools/OpenapiViewer/components/DocsLayout/schemaFields.ts +0 -121
- package/src/tools/Tour/README.md +0 -373
- package/src/tools/Tour/components/Tour.tsx +0 -12
- package/src/tools/Tour/components/TourContent.tsx +0 -171
- package/src/tools/Tour/components/TourNavigation.tsx +0 -77
- package/src/tools/Tour/components/TourProgress.tsx +0 -88
- package/src/tools/Tour/components/TourSpotlight.tsx +0 -199
- package/src/tools/Tour/components/index.ts +0 -5
- package/src/tools/Tour/context/TourContext.ts +0 -19
- package/src/tools/Tour/context/TourProvider.tsx +0 -292
- package/src/tools/Tour/context/index.ts +0 -2
- package/src/tools/Tour/hooks/index.ts +0 -3
- package/src/tools/Tour/hooks/useKeyboardNavigation.ts +0 -59
- package/src/tools/Tour/hooks/useStepTarget.ts +0 -121
- package/src/tools/Tour/hooks/useTour.ts +0 -42
- package/src/tools/Tour/index.ts +0 -38
- package/src/tools/Tour/types/index.ts +0 -224
- package/src/tools/Tour/utils/dom.ts +0 -98
- package/src/tools/Tour/utils/index.ts +0 -3
- package/src/tools/Tour/utils/logger.ts +0 -3
- package/src/tools/Tour/utils/scrollIntoView.ts +0 -24
- package/src/tools/VideoPlayer/components/VideoControls.tsx +0 -138
- package/src/tools/VideoPlayer/components/VideoErrorFallback.tsx +0 -172
- package/src/tools/VideoPlayer/components/VideoPlayer.tsx +0 -201
- package/src/tools/VideoPlayer/components/index.ts +0 -14
- package/src/tools/VideoPlayer/context/VideoPlayerContext.tsx +0 -52
- package/src/tools/VideoPlayer/context/index.ts +0 -8
- package/src/tools/VideoPlayer/hooks/index.ts +0 -12
- package/src/tools/VideoPlayer/hooks/useVideoPlayerSettings.ts +0 -71
- package/src/tools/VideoPlayer/hooks/useVideoPositionCache.ts +0 -117
- package/src/tools/VideoPlayer/providers/NativeProvider.tsx +0 -284
- package/src/tools/VideoPlayer/providers/StreamProvider.tsx +0 -505
- package/src/tools/VideoPlayer/providers/VidstackProvider.tsx +0 -397
- package/src/tools/VideoPlayer/providers/index.ts +0 -8
- package/src/tools/VideoPlayer/types/index.ts +0 -38
- package/src/tools/VideoPlayer/types/player.ts +0 -116
- package/src/tools/VideoPlayer/types/provider.ts +0 -93
- package/src/tools/VideoPlayer/types/sources.ts +0 -97
- package/src/tools/VideoPlayer/utils/debug.ts +0 -14
- package/src/tools/VideoPlayer/utils/fileSource.ts +0 -78
- package/src/tools/VideoPlayer/utils/index.ts +0 -12
- package/src/tools/VideoPlayer/utils/resolvers.ts +0 -75
- /package/src/tools/Chat/{config.ts → constants.ts} +0 -0
- /package/src/tools/Chat/launcher/{ChatHeaderAudioToggle.tsx → header/ChatHeaderAudioToggle.tsx} +0 -0
- /package/src/tools/Chat/{components → messages}/Attachments.tsx +0 -0
- /package/src/tools/Chat/{components → messages}/JumpToLatest.tsx +0 -0
- /package/src/tools/Chat/{components → messages}/MessageActions.tsx +0 -0
- /package/src/tools/Chat/{components → messages}/Sources.tsx +0 -0
- /package/src/tools/Chat/{components → messages}/StreamingIndicator.tsx +0 -0
- /package/src/tools/Chat/{components → messages}/ToolCalls.tsx +0 -0
- /package/src/tools/Chat/{components → shell}/ErrorBanner.tsx +0 -0
|
@@ -28,6 +28,10 @@ export function humanizeCron(cron: string): string {
|
|
|
28
28
|
const hour = parseInt(hourPart, 10);
|
|
29
29
|
const timeStr = formatTime(hour, minute);
|
|
30
30
|
|
|
31
|
+
// A month restriction (e.g. "0 9 1 6 *") is not representable by the
|
|
32
|
+
// daily/weekly/monthly phrasings below — describe it generically.
|
|
33
|
+
const monthSuffix = monthPart === '*' ? '' : ` in ${describeMonths(monthPart)}`;
|
|
34
|
+
|
|
31
35
|
// Every minute
|
|
32
36
|
if (minutePart === '*' && hourPart === '*' && dayOfMonthPart === '*' && monthPart === '*' && dayOfWeekPart === '*') {
|
|
33
37
|
return 'Every minute';
|
|
@@ -36,15 +40,21 @@ export function humanizeCron(cron: string): string {
|
|
|
36
40
|
// Every N minutes
|
|
37
41
|
if (minutePart.startsWith('*/')) {
|
|
38
42
|
const interval = parseInt(minutePart.slice(2), 10);
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
return `Every ${
|
|
43
|
+
if (!Number.isFinite(interval) || interval < 1) return 'Custom schedule';
|
|
44
|
+
const unit = `${interval} minute${interval > 1 ? 's' : ''}`;
|
|
45
|
+
if (hourPart === '*') return `Every ${unit}`;
|
|
46
|
+
if (/^\d+$/.test(hourPart)) return `Every ${unit}, hour ${hour}`;
|
|
47
|
+
return `Every ${unit}, hours ${hourPart}`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Hourly: concrete minute, wildcard hour
|
|
51
|
+
if (/^\d+$/.test(minutePart) && hourPart === '*' && dayOfMonthPart === '*' && monthPart === '*' && dayOfWeekPart === '*') {
|
|
52
|
+
return minute === 0 ? 'Every hour' : `Every hour at minute ${minute}`;
|
|
43
53
|
}
|
|
44
54
|
|
|
45
|
-
//
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
55
|
+
// Anything from here on needs a concrete minute and hour to read cleanly.
|
|
56
|
+
if (!/^\d+$/.test(minutePart) || !/^\d+$/.test(hourPart)) {
|
|
57
|
+
return 'Custom schedule';
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
// Daily
|
|
@@ -53,45 +63,80 @@ export function humanizeCron(cron: string): string {
|
|
|
53
63
|
}
|
|
54
64
|
|
|
55
65
|
// Weekly
|
|
56
|
-
if (dayOfMonthPart === '*' &&
|
|
66
|
+
if (dayOfMonthPart === '*' && dayOfWeekPart !== '*') {
|
|
57
67
|
const days = parseWeekDays(dayOfWeekPart);
|
|
58
68
|
|
|
69
|
+
if (days.length === 0) return 'Custom schedule';
|
|
70
|
+
|
|
59
71
|
if (days.length === 7) {
|
|
60
|
-
return `Every day at ${timeStr}`;
|
|
72
|
+
return `Every day at ${timeStr}${monthSuffix}`;
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
if (days.length === 5 && isWeekdays(days)) {
|
|
64
|
-
return `Weekdays at ${timeStr}`;
|
|
76
|
+
return `Weekdays at ${timeStr}${monthSuffix}`;
|
|
65
77
|
}
|
|
66
78
|
|
|
67
79
|
if (days.length === 2 && isWeekend(days)) {
|
|
68
|
-
return `Weekends at ${timeStr}`;
|
|
80
|
+
return `Weekends at ${timeStr}${monthSuffix}`;
|
|
69
81
|
}
|
|
70
82
|
|
|
71
83
|
const dayNames = days.map(d => WEEKDAY_SHORT[d]).join(', ');
|
|
72
|
-
return `${dayNames} at ${timeStr}`;
|
|
84
|
+
return `${dayNames} at ${timeStr}${monthSuffix}`;
|
|
73
85
|
}
|
|
74
86
|
|
|
75
87
|
// Monthly
|
|
76
|
-
if (dayOfMonthPart !== '*' &&
|
|
88
|
+
if (dayOfMonthPart !== '*' && dayOfWeekPart === '*') {
|
|
77
89
|
const days = parseMonthDays(dayOfMonthPart);
|
|
78
90
|
|
|
91
|
+
if (days.length === 0) return 'Custom schedule';
|
|
92
|
+
|
|
93
|
+
const monthWord = monthPart === '*' ? 'every month' : describeMonths(monthPart);
|
|
94
|
+
|
|
79
95
|
if (days.length === 1) {
|
|
80
|
-
return `${ordinal(days[0])} of
|
|
96
|
+
return `${ordinal(days[0])} of ${monthWord} at ${timeStr}`;
|
|
81
97
|
}
|
|
82
98
|
|
|
83
99
|
if (days.length <= 3) {
|
|
84
100
|
const dayStr = days.map(d => ordinal(d)).join(', ');
|
|
85
|
-
return `${dayStr} of
|
|
101
|
+
return `${dayStr} of ${monthWord} at ${timeStr}`;
|
|
86
102
|
}
|
|
87
103
|
|
|
88
|
-
return `${days.length} days
|
|
104
|
+
return `${days.length} days of ${monthWord} at ${timeStr}`;
|
|
89
105
|
}
|
|
90
106
|
|
|
91
107
|
// Complex expression - show as-is
|
|
92
108
|
return `Custom schedule`;
|
|
93
109
|
}
|
|
94
110
|
|
|
111
|
+
const MONTH_SHORT = [
|
|
112
|
+
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
|
113
|
+
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Describes a month field (1-12) in a readable way.
|
|
118
|
+
* Handles single values, lists and ranges; falls back to the raw field.
|
|
119
|
+
*/
|
|
120
|
+
function describeMonths(part: string): string {
|
|
121
|
+
const nums: number[] = [];
|
|
122
|
+
for (const segment of part.split(',')) {
|
|
123
|
+
if (segment.includes('-')) {
|
|
124
|
+
const [start, end] = segment.split('-').map(s => parseInt(s, 10));
|
|
125
|
+
if (!isNaN(start) && !isNaN(end)) {
|
|
126
|
+
for (let i = start; i <= end && i <= 12; i++) {
|
|
127
|
+
if (i >= 1) nums.push(i);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
const n = parseInt(segment.trim(), 10);
|
|
132
|
+
if (!isNaN(n) && n >= 1 && n <= 12) nums.push(n);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (nums.length === 0) return part;
|
|
136
|
+
const names = nums.map(n => MONTH_SHORT[n - 1]);
|
|
137
|
+
return names.length === 1 ? names[0] : names.join(', ');
|
|
138
|
+
}
|
|
139
|
+
|
|
95
140
|
/**
|
|
96
141
|
* Formats time as HH:MM
|
|
97
142
|
*/
|
|
@@ -93,7 +93,14 @@ function detectScheduleType(
|
|
|
93
93
|
return { type: 'custom', weekDays, monthDays };
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
//
|
|
96
|
+
// The daily/weekly/monthly UI presets require a concrete minute AND hour.
|
|
97
|
+
// A wildcard hour or minute (e.g. "0 * * * *" hourly, "* 9 * * *") cannot be
|
|
98
|
+
// represented by the time picker, so it must stay 'custom'.
|
|
99
|
+
if (minutePart === '*' || hourPart === '*') {
|
|
100
|
+
return { type: 'custom', weekDays, monthDays };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Daily: M H * * * (concrete minute and hour, rest are *)
|
|
97
104
|
if (dayOfMonthPart === '*' && monthPart === '*' && dayOfWeekPart === '*') {
|
|
98
105
|
type = 'daily';
|
|
99
106
|
}
|
|
@@ -119,10 +126,12 @@ function detectScheduleType(
|
|
|
119
126
|
function isValidCronField(part: string, min: number, max: number): boolean {
|
|
120
127
|
if (part === '*') return true;
|
|
121
128
|
|
|
122
|
-
// Step pattern: */N or range/N
|
|
129
|
+
// Step pattern: */N or range/N (exactly one slash, step >= 1)
|
|
123
130
|
if (part.includes('/')) {
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
131
|
+
const slashParts = part.split('/');
|
|
132
|
+
if (slashParts.length !== 2) return false;
|
|
133
|
+
const [base, step] = slashParts;
|
|
134
|
+
if (!step || !/^\d+$/.test(step) || parseInt(step, 10) < 1) return false;
|
|
126
135
|
if (base === '*') return true;
|
|
127
136
|
// Validate base part (range or number)
|
|
128
137
|
return isValidCronField(base, min, max);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { File as FileFallback } from 'lucide-react';
|
|
5
3
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
6
4
|
|
|
7
|
-
import {
|
|
5
|
+
import { getFileIcon } from './get-file-icon';
|
|
8
6
|
import { resolveFolderIcon, type FolderIconOverrides } from './specialFolders';
|
|
9
7
|
|
|
10
8
|
export type FileIconSize = 12 | 14 | 16 | 18 | 20 | 24 | 28 | 32 | 40 | 48 | 64;
|
|
@@ -23,18 +21,24 @@ export interface FileIconProps {
|
|
|
23
21
|
* matched case-insensitively. Only used when `isFolder` is true.
|
|
24
22
|
*/
|
|
25
23
|
folderOverrides?: FolderIconOverrides;
|
|
24
|
+
/**
|
|
25
|
+
* Accessible label. When omitted the icon is decorative (`aria-hidden`) —
|
|
26
|
+
* correct when it sits next to a visible file name. Pass a string to
|
|
27
|
+
* expose the icon to assistive technology.
|
|
28
|
+
*/
|
|
29
|
+
label?: string;
|
|
26
30
|
className?: string;
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
* VSCode-style file icon.
|
|
31
35
|
*
|
|
32
|
-
* - Folders render Lucide `Folder` / `FolderOpen` (
|
|
33
|
-
* - Files
|
|
34
|
-
*
|
|
36
|
+
* - Folders render Lucide `Folder` / `FolderOpen` (warning-token tint).
|
|
37
|
+
* - Files render rich, colourful SVGs vendored from `material-file-icons`
|
|
38
|
+
* (MIT). Resolution is synchronous — no runtime dependency, no async load.
|
|
35
39
|
*
|
|
36
|
-
* The
|
|
37
|
-
*
|
|
40
|
+
* The icon SVG data is a static module, so it bundles into the `FileIcon`
|
|
41
|
+
* chunk and is only fetched by consumers that actually mount this component.
|
|
38
42
|
*/
|
|
39
43
|
export function FileIcon({
|
|
40
44
|
name,
|
|
@@ -42,28 +46,15 @@ export function FileIcon({
|
|
|
42
46
|
isExpanded = false,
|
|
43
47
|
size = 16,
|
|
44
48
|
folderOverrides,
|
|
49
|
+
label,
|
|
45
50
|
className,
|
|
46
51
|
}: FileIconProps) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (isFolder) {
|
|
55
|
-
setSvg(null);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
let cancelled = false;
|
|
59
|
-
void loadMaterialIcons().then((fn) => {
|
|
60
|
-
if (cancelled) return;
|
|
61
|
-
setSvg(fn ? (fn(name)?.svg ?? null) : null);
|
|
62
|
-
});
|
|
63
|
-
return () => {
|
|
64
|
-
cancelled = true;
|
|
65
|
-
};
|
|
66
|
-
}, [isFolder, name]);
|
|
52
|
+
// Either a labelled image, or fully hidden from assistive tech (the default,
|
|
53
|
+
// since the icon usually sits beside a visible file name).
|
|
54
|
+
const a11y =
|
|
55
|
+
label === undefined
|
|
56
|
+
? ({ 'aria-hidden': true } as const)
|
|
57
|
+
: ({ role: 'img', 'aria-label': label } as const);
|
|
67
58
|
|
|
68
59
|
if (isFolder) {
|
|
69
60
|
const Icon = resolveFolderIcon({
|
|
@@ -73,25 +64,19 @@ export function FileIcon({
|
|
|
73
64
|
});
|
|
74
65
|
return (
|
|
75
66
|
<Icon
|
|
76
|
-
|
|
67
|
+
{...a11y}
|
|
68
|
+
className={cn('shrink-0 text-warning', className)}
|
|
77
69
|
style={{ width: size, height: size }}
|
|
78
70
|
/>
|
|
79
71
|
);
|
|
80
72
|
}
|
|
81
73
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<FileFallback
|
|
85
|
-
className={cn('shrink-0 text-muted-foreground/80', className)}
|
|
86
|
-
style={{ width: size, height: size }}
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
74
|
+
// Vendored static data — `getFileIcon` always returns a definition.
|
|
75
|
+
const svg = getFileIcon(name).svg;
|
|
90
76
|
|
|
91
77
|
return (
|
|
92
78
|
<span
|
|
93
|
-
|
|
94
|
-
aria-hidden
|
|
79
|
+
{...a11y}
|
|
95
80
|
className={cn('inline-block shrink-0', className)}
|
|
96
81
|
style={{ width: size, height: size }}
|
|
97
82
|
dangerouslySetInnerHTML={{ __html: svg }}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolver for VSCode-style file icons. Replaces the former optional
|
|
5
|
+
* `material-file-icons` runtime dependency — the icon SVGs are now vendored
|
|
6
|
+
* as a static data module (`./icons/icon-data`), so the bundler resolves them
|
|
7
|
+
* deterministically with no dynamic `import()` and no `@vite-ignore`.
|
|
8
|
+
*
|
|
9
|
+
* Lookup matches the original `material-file-icons` algorithm:
|
|
10
|
+
* 1. exact full-name match (`files[]`, lowercased)
|
|
11
|
+
* 2. longest matching extension (`name.endsWith('.' + ext)`)
|
|
12
|
+
* 3. fall back to the default file icon
|
|
13
|
+
*
|
|
14
|
+
* The `files` / `extensions` lookup maps are built lazily on first call.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
DEFAULT_FILE_ICON,
|
|
19
|
+
FILE_ICONS,
|
|
20
|
+
type FileIconDef,
|
|
21
|
+
} from './icons/icon-data';
|
|
22
|
+
|
|
23
|
+
export type { FileIconDef };
|
|
24
|
+
export { DEFAULT_FILE_ICON };
|
|
25
|
+
|
|
26
|
+
/** Full-name → icon (e.g. `dockerfile`, `.gitignore`). */
|
|
27
|
+
let fileMap: Map<string, FileIconDef> | null = null;
|
|
28
|
+
/** Extension → icon. When several icons share an extension, last wins. */
|
|
29
|
+
let extMap: Map<string, FileIconDef> | null = null;
|
|
30
|
+
|
|
31
|
+
function buildIndex(): void {
|
|
32
|
+
fileMap = new Map();
|
|
33
|
+
extMap = new Map();
|
|
34
|
+
for (const icon of FILE_ICONS) {
|
|
35
|
+
if (icon.files) {
|
|
36
|
+
for (const f of icon.files) fileMap.set(f, icon);
|
|
37
|
+
}
|
|
38
|
+
if (icon.extensions) {
|
|
39
|
+
for (const ext of icon.extensions) extMap.set(ext, icon);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the icon definition for a file name. Always returns a definition —
|
|
46
|
+
* unknown types yield {@link DEFAULT_FILE_ICON}.
|
|
47
|
+
*/
|
|
48
|
+
export function getFileIcon(filename: string): FileIconDef {
|
|
49
|
+
if (typeof filename !== 'string' || filename.length === 0) {
|
|
50
|
+
return DEFAULT_FILE_ICON;
|
|
51
|
+
}
|
|
52
|
+
if (fileMap === null || extMap === null) buildIndex();
|
|
53
|
+
|
|
54
|
+
const lc = filename.toLowerCase();
|
|
55
|
+
|
|
56
|
+
// 1. Exact full-name match.
|
|
57
|
+
const byName = fileMap!.get(lc);
|
|
58
|
+
if (byName) return byName;
|
|
59
|
+
|
|
60
|
+
// 2. Longest matching extension.
|
|
61
|
+
let match: FileIconDef | null = null;
|
|
62
|
+
let matchLength = 0;
|
|
63
|
+
for (const [ext, icon] of extMap!) {
|
|
64
|
+
if (ext.length > matchLength && lc.endsWith(`.${ext}`)) {
|
|
65
|
+
match = icon;
|
|
66
|
+
matchLength = ext.length;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (match) return match;
|
|
70
|
+
|
|
71
|
+
// 3. Fallback.
|
|
72
|
+
return DEFAULT_FILE_ICON;
|
|
73
|
+
}
|