@moontra/moonui-pro 2.8.14 → 2.9.0
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/index.d.ts +78 -8
- package/dist/index.mjs +869 -219
- package/package.json +1 -1
- package/src/components/file-upload/index.tsx +1184 -287
- package/src/lib/ai-providers.ts +8 -8
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
3
3
|
import * as t from 'react';
|
|
4
4
|
import t__default, { useState, useRef, useCallback, forwardRef, createContext, useEffect, useContext, useMemo, useLayoutEffect, useDebugValue, Component } from 'react';
|
|
5
5
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
6
|
-
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus,
|
|
6
|
+
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus, Upload, Play, Eye, CheckCircle2, Pause, RotateCcw, Download, Copy, Share, Trash2, CreditCard, Globe, XCircle, Clock, HelpCircle, ChevronLeft, Calendar as Calendar$1, Edit, MapPin, User, GripVertical, MessageCircle, Paperclip, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, CheckSquare, Quote, Palette, Highlighter, Link2, Image as Image$1, Table as Table$1, Settings, Undo, Redo, RefreshCw, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Zap, Languages, Lightbulb, TrendingUp, TrendingDown, ZoomOut, ZoomIn, FileSpreadsheet, FileJson, Maximize2, Move, Menu, Bell, CheckCheck, CheckCircle, Settings2, LogOut, Edit3, LayoutGrid, Share2, Save, Video, Music, Archive, File, Filter, FileDown, ArrowUp, ArrowDown, ArrowUpDown, ChevronsLeft, ChevronsRight, Pin, Sun, Moon, Monitor, Star, ExternalLink, CalendarIcon, DollarSign, Users, Github, GitFork, Activity, Server, EyeOff, RotateCw, Timer, Cpu, MemoryStick, HardDrive, Network, BarChart3, Columns, Grip, Unlock, Minimize2, Map as Map$1, Target, MoreVertical, BellOff, ArrowDownRight, ArrowUpRight } from 'lucide-react';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
@@ -49963,19 +49963,19 @@ var GeminiProvider = class {
|
|
|
49963
49963
|
return this.callGeminiAPI(prompt);
|
|
49964
49964
|
}
|
|
49965
49965
|
async rewrite(text) {
|
|
49966
|
-
const prompt = `Rewrite
|
|
49966
|
+
const prompt = `Rewrite the following text to make it clearer, more engaging, and better structured while maintaining the original meaning. Respond in the same language:
|
|
49967
49967
|
|
|
49968
49968
|
${text}`;
|
|
49969
49969
|
return this.callGeminiAPI(prompt);
|
|
49970
49970
|
}
|
|
49971
49971
|
async expand(text) {
|
|
49972
|
-
const prompt = `Expand this text with more details and
|
|
49972
|
+
const prompt = `Expand this text with more details, specific examples, explanations, and supporting information while keeping the same structure and tone. Respond in the same language:
|
|
49973
49973
|
|
|
49974
49974
|
${text}`;
|
|
49975
49975
|
return this.callGeminiAPI(prompt);
|
|
49976
49976
|
}
|
|
49977
49977
|
async summarize(text) {
|
|
49978
|
-
const prompt = `Create a
|
|
49978
|
+
const prompt = `Create a comprehensive summary that captures all key points, main arguments, important details, and significant examples from the text. The summary should be thorough enough to understand the core message. Respond in the same language:
|
|
49979
49979
|
|
|
49980
49980
|
${text}`;
|
|
49981
49981
|
return this.callGeminiAPI(prompt);
|
|
@@ -50071,19 +50071,19 @@ var OpenAIProvider = class {
|
|
|
50071
50071
|
}
|
|
50072
50072
|
async rewrite(text) {
|
|
50073
50073
|
return this.callOpenAI(
|
|
50074
|
-
"Rewrite to be clearer and
|
|
50074
|
+
"Rewrite the text to be clearer, more engaging, and better structured while maintaining the original meaning. Respond in the same language as the input.",
|
|
50075
50075
|
text
|
|
50076
50076
|
);
|
|
50077
50077
|
}
|
|
50078
50078
|
async expand(text) {
|
|
50079
50079
|
return this.callOpenAI(
|
|
50080
|
-
"Expand with more details and
|
|
50080
|
+
"Expand the text with more details, specific examples, explanations, and supporting information while keeping the same structure and tone. Respond in the same language as the input.",
|
|
50081
50081
|
text
|
|
50082
50082
|
);
|
|
50083
50083
|
}
|
|
50084
50084
|
async summarize(text) {
|
|
50085
50085
|
return this.callOpenAI(
|
|
50086
|
-
"Create
|
|
50086
|
+
"Create a comprehensive summary that captures all key points, main arguments, important details, and significant examples. The summary should be thorough enough to understand the core message. Respond in the same language as the input.",
|
|
50087
50087
|
text
|
|
50088
50088
|
);
|
|
50089
50089
|
}
|
|
@@ -50174,12 +50174,12 @@ IMPORTANT: Respond in the SAME LANGUAGE as the input text.`);
|
|
|
50174
50174
|
${text}`);
|
|
50175
50175
|
}
|
|
50176
50176
|
async expand(text) {
|
|
50177
|
-
return this.callClaude(`Expand this text with more details.
|
|
50177
|
+
return this.callClaude(`Expand this text with more details, specific examples, explanations, and supporting information while keeping the same structure and tone. Respond in the same language as the input:
|
|
50178
50178
|
|
|
50179
50179
|
${text}`);
|
|
50180
50180
|
}
|
|
50181
50181
|
async summarize(text) {
|
|
50182
|
-
return this.callClaude(`Create
|
|
50182
|
+
return this.callClaude(`Create a comprehensive summary that captures all key points, main arguments, important details, and significant examples. The summary should be thorough enough to understand the core message. Respond in the same language as the input:
|
|
50183
50183
|
|
|
50184
50184
|
${text}`);
|
|
50185
50185
|
}
|
|
@@ -52790,7 +52790,7 @@ function Timeline({
|
|
|
52790
52790
|
day: "numeric"
|
|
52791
52791
|
});
|
|
52792
52792
|
};
|
|
52793
|
-
const
|
|
52793
|
+
const formatTime2 = (date) => {
|
|
52794
52794
|
return date.toLocaleTimeString("en-US", {
|
|
52795
52795
|
hour: "2-digit",
|
|
52796
52796
|
minute: "2-digit",
|
|
@@ -52868,7 +52868,7 @@ function Timeline({
|
|
|
52868
52868
|
), children: event.description })
|
|
52869
52869
|
] }),
|
|
52870
52870
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
52871
|
-
showRelativeTime ? /* @__PURE__ */ jsx("span", { children: getRelativeTime(event.date) }) : /* @__PURE__ */ jsx("span", { children:
|
|
52871
|
+
showRelativeTime ? /* @__PURE__ */ jsx("span", { children: getRelativeTime(event.date) }) : /* @__PURE__ */ jsx("span", { children: formatTime2(event.date) }),
|
|
52872
52872
|
/* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "outline", className: cn("text-xs", textColor), children: event.type })
|
|
52873
52873
|
] })
|
|
52874
52874
|
] }),
|
|
@@ -58234,7 +58234,7 @@ var PerformanceMonitorInternal = ({
|
|
|
58234
58234
|
}
|
|
58235
58235
|
if (newAlerts.length > 0) {
|
|
58236
58236
|
setAlerts((prev) => [...newAlerts, ...prev].slice(0, 20));
|
|
58237
|
-
newAlerts.forEach((
|
|
58237
|
+
newAlerts.forEach((alert) => onAlert?.(alert));
|
|
58238
58238
|
}
|
|
58239
58239
|
}, [alertThresholds, onAlert]);
|
|
58240
58240
|
const updateMetrics = useCallback(async () => {
|
|
@@ -58618,7 +58618,7 @@ var PerformanceMonitorInternal = ({
|
|
|
58618
58618
|
}
|
|
58619
58619
|
)
|
|
58620
58620
|
] }),
|
|
58621
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-96 overflow-y-auto", children: /* @__PURE__ */ jsx(AnimatePresence, { children: alerts.map((
|
|
58621
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-96 overflow-y-auto", children: /* @__PURE__ */ jsx(AnimatePresence, { children: alerts.map((alert, index2) => /* @__PURE__ */ jsx(
|
|
58622
58622
|
motion.div,
|
|
58623
58623
|
{
|
|
58624
58624
|
initial: { opacity: 0, x: -20 },
|
|
@@ -58627,22 +58627,22 @@ var PerformanceMonitorInternal = ({
|
|
|
58627
58627
|
transition: { delay: index2 * 0.05 },
|
|
58628
58628
|
children: /* @__PURE__ */ jsx(MoonUICardPro, { children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
58629
58629
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
58630
|
-
|
|
58630
|
+
alert.type === "critical" ? /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 text-red-500" }) : alert.type === "warning" ? /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 text-yellow-500" }) : /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4 text-blue-500" }),
|
|
58631
58631
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
58632
|
-
/* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children:
|
|
58633
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children:
|
|
58632
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children: alert.metric }),
|
|
58633
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: alert.message })
|
|
58634
58634
|
] })
|
|
58635
58635
|
] }),
|
|
58636
58636
|
/* @__PURE__ */ jsxs("div", { className: "text-right text-sm", children: [
|
|
58637
58637
|
/* @__PURE__ */ jsxs("div", { className: "font-medium", children: [
|
|
58638
|
-
|
|
58639
|
-
|
|
58638
|
+
alert.value.toFixed(1),
|
|
58639
|
+
alert.metric === "Network" ? "ms" : "%"
|
|
58640
58640
|
] }),
|
|
58641
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children:
|
|
58641
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: alert.timestamp.toLocaleTimeString() })
|
|
58642
58642
|
] })
|
|
58643
58643
|
] }) }) })
|
|
58644
58644
|
},
|
|
58645
|
-
|
|
58645
|
+
alert.id
|
|
58646
58646
|
)) }) }),
|
|
58647
58647
|
alerts.length === 0 && /* @__PURE__ */ jsxs("div", { className: "text-center py-8", children: [
|
|
58648
58648
|
/* @__PURE__ */ jsx(CheckCircle, { className: "h-12 w-12 mx-auto mb-4 text-green-500" }),
|
|
@@ -58712,250 +58712,900 @@ var PerformanceMonitor = ({ className, ...props }) => {
|
|
|
58712
58712
|
}
|
|
58713
58713
|
return /* @__PURE__ */ jsx(PerformanceMonitorInternal, { className, ...props });
|
|
58714
58714
|
};
|
|
58715
|
-
var
|
|
58716
|
-
|
|
58717
|
-
|
|
58718
|
-
|
|
58719
|
-
|
|
58720
|
-
|
|
58721
|
-
|
|
58722
|
-
|
|
58723
|
-
|
|
58724
|
-
|
|
58725
|
-
|
|
58726
|
-
|
|
58727
|
-
|
|
58715
|
+
var fileUploadVariants = cva(
|
|
58716
|
+
"relative overflow-hidden transition-all duration-200",
|
|
58717
|
+
{
|
|
58718
|
+
variants: {
|
|
58719
|
+
variant: {
|
|
58720
|
+
default: "border-2 border-dashed rounded-lg p-8",
|
|
58721
|
+
compact: "border border-dashed rounded-md p-4",
|
|
58722
|
+
grid: "border-2 border-dashed rounded-lg p-6"
|
|
58723
|
+
},
|
|
58724
|
+
state: {
|
|
58725
|
+
idle: "border-muted-foreground/25 hover:border-primary/50",
|
|
58726
|
+
dragover: "border-primary bg-primary/5 scale-102",
|
|
58727
|
+
disabled: "opacity-50 cursor-not-allowed"
|
|
58728
|
+
}
|
|
58729
|
+
},
|
|
58730
|
+
defaultVariants: {
|
|
58731
|
+
variant: "default",
|
|
58732
|
+
state: "idle"
|
|
58733
|
+
}
|
|
58734
|
+
}
|
|
58735
|
+
);
|
|
58728
58736
|
var formatFileSize = (bytes) => {
|
|
58729
58737
|
if (bytes === 0)
|
|
58730
|
-
return "0
|
|
58738
|
+
return "0 B";
|
|
58731
58739
|
const k3 = 1024;
|
|
58732
|
-
const sizes = ["
|
|
58740
|
+
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
|
58733
58741
|
const i = Math.floor(Math.log(bytes) / Math.log(k3));
|
|
58734
58742
|
return parseFloat((bytes / Math.pow(k3, i)).toFixed(2)) + " " + sizes[i];
|
|
58735
58743
|
};
|
|
58736
|
-
|
|
58737
|
-
|
|
58738
|
-
|
|
58739
|
-
|
|
58740
|
-
|
|
58741
|
-
|
|
58742
|
-
|
|
58743
|
-
|
|
58744
|
-
|
|
58745
|
-
|
|
58746
|
-
|
|
58747
|
-
|
|
58748
|
-
})
|
|
58749
|
-
|
|
58750
|
-
|
|
58751
|
-
|
|
58752
|
-
|
|
58753
|
-
|
|
58754
|
-
|
|
58755
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "File Upload is available exclusively to MoonUI Pro subscribers." }),
|
|
58756
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-3 justify-center", children: /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { size: "sm", children: [
|
|
58757
|
-
/* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
|
|
58758
|
-
"Upgrade to Pro"
|
|
58759
|
-
] }) }) })
|
|
58760
|
-
] })
|
|
58761
|
-
] }) }) });
|
|
58744
|
+
var formatTime = (seconds) => {
|
|
58745
|
+
if (seconds < 60)
|
|
58746
|
+
return `${Math.round(seconds)}s`;
|
|
58747
|
+
const minutes = Math.floor(seconds / 60);
|
|
58748
|
+
const remainingSeconds = Math.round(seconds % 60);
|
|
58749
|
+
return `${minutes}m ${remainingSeconds}s`;
|
|
58750
|
+
};
|
|
58751
|
+
var getFileIcon = (type, size4 = "md") => {
|
|
58752
|
+
const iconSize = size4 === "sm" ? "h-4 w-4" : size4 === "md" ? "h-5 w-5" : "h-6 w-6";
|
|
58753
|
+
if (type.startsWith("image/"))
|
|
58754
|
+
return /* @__PURE__ */ jsx(Image$1, { className: iconSize });
|
|
58755
|
+
if (type.startsWith("video/"))
|
|
58756
|
+
return /* @__PURE__ */ jsx(Video, { className: iconSize });
|
|
58757
|
+
if (type.startsWith("audio/"))
|
|
58758
|
+
return /* @__PURE__ */ jsx(Music, { className: iconSize });
|
|
58759
|
+
if (type.includes("pdf"))
|
|
58760
|
+
return /* @__PURE__ */ jsx(FileText, { className: iconSize });
|
|
58761
|
+
if (type.includes("zip") || type.includes("rar") || type.includes("7z")) {
|
|
58762
|
+
return /* @__PURE__ */ jsx(Archive, { className: iconSize });
|
|
58762
58763
|
}
|
|
58763
|
-
|
|
58764
|
-
|
|
58765
|
-
|
|
58766
|
-
const
|
|
58767
|
-
const
|
|
58768
|
-
|
|
58769
|
-
|
|
58770
|
-
|
|
58771
|
-
|
|
58772
|
-
|
|
58764
|
+
return /* @__PURE__ */ jsx(File, { className: iconSize });
|
|
58765
|
+
};
|
|
58766
|
+
var generateFileHash = async (file) => {
|
|
58767
|
+
const buffer = await file.arrayBuffer();
|
|
58768
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", buffer);
|
|
58769
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
58770
|
+
return hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
58771
|
+
};
|
|
58772
|
+
var createImagePreview = (file) => {
|
|
58773
|
+
return new Promise((resolve) => {
|
|
58774
|
+
const img = new Image();
|
|
58775
|
+
const url = URL.createObjectURL(file);
|
|
58776
|
+
img.onload = () => {
|
|
58777
|
+
resolve({
|
|
58778
|
+
type: "image",
|
|
58779
|
+
url,
|
|
58780
|
+
thumbnail: url,
|
|
58781
|
+
dimensions: { width: img.width, height: img.height }
|
|
58782
|
+
});
|
|
58783
|
+
};
|
|
58784
|
+
img.onerror = () => {
|
|
58785
|
+
resolve({
|
|
58786
|
+
type: "image",
|
|
58787
|
+
url
|
|
58788
|
+
});
|
|
58789
|
+
};
|
|
58790
|
+
img.src = url;
|
|
58791
|
+
});
|
|
58792
|
+
};
|
|
58793
|
+
var createVideoPreview = (file) => {
|
|
58794
|
+
return new Promise((resolve) => {
|
|
58795
|
+
const video = document.createElement("video");
|
|
58796
|
+
const url = URL.createObjectURL(file);
|
|
58797
|
+
video.onloadedmetadata = () => {
|
|
58798
|
+
const canvas = document.createElement("canvas");
|
|
58799
|
+
const ctx = canvas.getContext("2d");
|
|
58800
|
+
canvas.width = 320;
|
|
58801
|
+
canvas.height = video.videoHeight / video.videoWidth * 320;
|
|
58802
|
+
video.currentTime = Math.min(1, video.duration / 4);
|
|
58803
|
+
video.onseeked = () => {
|
|
58804
|
+
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
58805
|
+
const thumbnail = canvas.toDataURL("image/jpeg", 0.8);
|
|
58806
|
+
resolve({
|
|
58807
|
+
type: "video",
|
|
58808
|
+
url,
|
|
58809
|
+
thumbnail,
|
|
58810
|
+
duration: video.duration,
|
|
58811
|
+
dimensions: { width: video.videoWidth, height: video.videoHeight }
|
|
58812
|
+
});
|
|
58813
|
+
};
|
|
58814
|
+
};
|
|
58815
|
+
video.onerror = () => {
|
|
58816
|
+
resolve({
|
|
58817
|
+
type: "video",
|
|
58818
|
+
url
|
|
58819
|
+
});
|
|
58820
|
+
};
|
|
58821
|
+
video.src = url;
|
|
58822
|
+
});
|
|
58823
|
+
};
|
|
58824
|
+
var BulkActions = ({
|
|
58825
|
+
selectedIds,
|
|
58826
|
+
onClearSelection,
|
|
58827
|
+
onBulkRemove,
|
|
58828
|
+
onBulkDownload
|
|
58829
|
+
}) => {
|
|
58830
|
+
if (selectedIds.length === 0)
|
|
58831
|
+
return null;
|
|
58832
|
+
return /* @__PURE__ */ jsxs(
|
|
58833
|
+
motion.div,
|
|
58834
|
+
{
|
|
58835
|
+
initial: { opacity: 0, y: -10 },
|
|
58836
|
+
animate: { opacity: 1, y: 0 },
|
|
58837
|
+
exit: { opacity: 0, y: -10 },
|
|
58838
|
+
className: "flex items-center gap-2 p-3 bg-primary/5 rounded-lg border",
|
|
58839
|
+
children: [
|
|
58840
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm font-medium", children: [
|
|
58841
|
+
selectedIds.length,
|
|
58842
|
+
" dosya se\xE7ildi"
|
|
58843
|
+
] }),
|
|
58844
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-1 ml-auto", children: [
|
|
58845
|
+
/* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "ghost", size: "sm", onClick: onBulkDownload, children: [
|
|
58846
|
+
/* @__PURE__ */ jsx(Download, { className: "h-4 w-4 mr-1" }),
|
|
58847
|
+
"\u0130ndir"
|
|
58848
|
+
] }),
|
|
58849
|
+
/* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "ghost", size: "sm", onClick: onBulkRemove, children: [
|
|
58850
|
+
/* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4 mr-1" }),
|
|
58851
|
+
"Sil"
|
|
58852
|
+
] }),
|
|
58853
|
+
/* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", onClick: onClearSelection, children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
|
|
58854
|
+
] })
|
|
58855
|
+
]
|
|
58773
58856
|
}
|
|
58857
|
+
);
|
|
58858
|
+
};
|
|
58859
|
+
var FilePreviewModal = ({
|
|
58860
|
+
file,
|
|
58861
|
+
isOpen,
|
|
58862
|
+
onClose
|
|
58863
|
+
}) => {
|
|
58864
|
+
if (!file || !file.preview)
|
|
58774
58865
|
return null;
|
|
58775
|
-
|
|
58776
|
-
|
|
58777
|
-
|
|
58778
|
-
|
|
58779
|
-
|
|
58780
|
-
|
|
58781
|
-
|
|
58782
|
-
|
|
58866
|
+
return /* @__PURE__ */ jsx(MoonUIDialogPro, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "max-w-4xl max-h-[90vh]", children: [
|
|
58867
|
+
/* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsxs(MoonUIDialogTitlePro, { className: "flex items-center gap-2", children: [
|
|
58868
|
+
getFileIcon(file.file.type),
|
|
58869
|
+
file.file.name,
|
|
58870
|
+
/* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", children: formatFileSize(file.file.size) })
|
|
58871
|
+
] }) }),
|
|
58872
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center p-4 bg-muted/20 rounded-lg", children: [
|
|
58873
|
+
file.preview.type === "image" && /* @__PURE__ */ jsx(
|
|
58874
|
+
"img",
|
|
58875
|
+
{
|
|
58876
|
+
src: file.preview.url,
|
|
58877
|
+
alt: file.file.name,
|
|
58878
|
+
className: "max-w-full max-h-[60vh] object-contain rounded"
|
|
58879
|
+
}
|
|
58880
|
+
),
|
|
58881
|
+
file.preview.type === "video" && /* @__PURE__ */ jsx(
|
|
58882
|
+
"video",
|
|
58883
|
+
{
|
|
58884
|
+
src: file.preview.url,
|
|
58885
|
+
controls: true,
|
|
58886
|
+
className: "max-w-full max-h-[60vh] rounded"
|
|
58887
|
+
}
|
|
58888
|
+
),
|
|
58889
|
+
file.preview.type === "audio" && /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx("audio", { src: file.preview.url, controls: true, className: "w-full" }) }),
|
|
58890
|
+
!["image", "video", "audio"].includes(file.preview.type) && /* @__PURE__ */ jsxs("div", { className: "text-center py-8", children: [
|
|
58891
|
+
getFileIcon(file.file.type, "lg"),
|
|
58892
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-muted-foreground", children: "\xD6nizleme mevcut de\u011Fil" })
|
|
58893
|
+
] })
|
|
58894
|
+
] }),
|
|
58895
|
+
file.preview.dimensions && /* @__PURE__ */ jsxs("div", { className: "flex gap-4 text-sm text-muted-foreground", children: [
|
|
58896
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
58897
|
+
"Boyutlar: ",
|
|
58898
|
+
file.preview.dimensions.width,
|
|
58899
|
+
" \xD7 ",
|
|
58900
|
+
file.preview.dimensions.height
|
|
58901
|
+
] }),
|
|
58902
|
+
file.preview.duration && /* @__PURE__ */ jsxs("span", { children: [
|
|
58903
|
+
"S\xFCre: ",
|
|
58904
|
+
formatTime(file.preview.duration)
|
|
58905
|
+
] })
|
|
58906
|
+
] })
|
|
58907
|
+
] }) });
|
|
58908
|
+
};
|
|
58909
|
+
var MoonUIFileUploadPro = t__default.forwardRef(
|
|
58910
|
+
({
|
|
58911
|
+
accept = "*",
|
|
58912
|
+
multiple = true,
|
|
58913
|
+
maxSize = 100 * 1024 * 1024,
|
|
58914
|
+
// 100MB
|
|
58915
|
+
maxFiles = 10,
|
|
58916
|
+
disabled = false,
|
|
58917
|
+
className,
|
|
58918
|
+
variant = "default",
|
|
58919
|
+
chunkSize = 1024 * 1024,
|
|
58920
|
+
// 1MB chunks
|
|
58921
|
+
resumable = true,
|
|
58922
|
+
compression = false,
|
|
58923
|
+
allowedMimeTypes = [],
|
|
58924
|
+
maxTotalSize,
|
|
58925
|
+
duplicateCheck = true,
|
|
58926
|
+
uploadStrategy = "direct",
|
|
58927
|
+
showPreview = true,
|
|
58928
|
+
showProgress = true,
|
|
58929
|
+
showMetadata = true,
|
|
58930
|
+
allowBulkOperations = true,
|
|
58931
|
+
previewTypes = ["image", "video", "audio", "pdf"],
|
|
58932
|
+
onUpload,
|
|
58933
|
+
onProgress,
|
|
58934
|
+
onComplete,
|
|
58935
|
+
onError,
|
|
58936
|
+
onRemove,
|
|
58937
|
+
onPreview,
|
|
58938
|
+
onBulkSelect,
|
|
58939
|
+
customValidation,
|
|
58940
|
+
...props
|
|
58941
|
+
}, ref) => {
|
|
58942
|
+
const { hasProAccess, isLoading } = useSubscription();
|
|
58943
|
+
const [files, setFiles] = useState([]);
|
|
58944
|
+
const [isDragOver, setIsDragOver] = useState(false);
|
|
58945
|
+
const [selectedIds, setSelectedIds] = useState([]);
|
|
58946
|
+
const [previewFile, setPreviewFile] = useState(null);
|
|
58947
|
+
const [isPreviewOpen, setIsPreviewOpen] = useState(false);
|
|
58948
|
+
const [error, setError] = useState(null);
|
|
58949
|
+
const fileInputRef = useRef(null);
|
|
58950
|
+
const uploadQueue = useRef(/* @__PURE__ */ new Map());
|
|
58951
|
+
if (!isLoading && !hasProAccess) {
|
|
58952
|
+
return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
|
|
58953
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
|
|
58954
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
58955
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Pro \xD6zellik" }),
|
|
58956
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "Geli\u015Fmi\u015F Dosya Y\xFCkleme sadece MoonUI Pro abonelerine \xF6zeldir." }),
|
|
58957
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-3 justify-center", children: /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { size: "sm", children: [
|
|
58958
|
+
/* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
|
|
58959
|
+
"Pro'ya Y\xFCkseltin"
|
|
58960
|
+
] }) }) })
|
|
58961
|
+
] })
|
|
58962
|
+
] }) }) });
|
|
58783
58963
|
}
|
|
58784
|
-
const
|
|
58785
|
-
|
|
58786
|
-
|
|
58787
|
-
|
|
58788
|
-
if (
|
|
58789
|
-
|
|
58790
|
-
}
|
|
58791
|
-
|
|
58792
|
-
|
|
58793
|
-
|
|
58794
|
-
|
|
58795
|
-
|
|
58964
|
+
const validateFile = useCallback(async (file) => {
|
|
58965
|
+
if (file.size > maxSize) {
|
|
58966
|
+
return `Dosya boyutu ${formatFileSize(maxSize)} limitini a\u015F\u0131yor`;
|
|
58967
|
+
}
|
|
58968
|
+
if (allowedMimeTypes.length > 0 && !allowedMimeTypes.includes(file.type)) {
|
|
58969
|
+
return `Dosya t\xFCr\xFC ${file.type} desteklenmiyor`;
|
|
58970
|
+
}
|
|
58971
|
+
if (accept !== "*") {
|
|
58972
|
+
const acceptTypes = accept.split(",").map((t2) => t2.trim());
|
|
58973
|
+
const isAccepted = acceptTypes.some((acceptType) => {
|
|
58974
|
+
if (acceptType.includes("*")) {
|
|
58975
|
+
return file.type.startsWith(acceptType.replace("*", ""));
|
|
58976
|
+
}
|
|
58977
|
+
return file.type === acceptType;
|
|
58796
58978
|
});
|
|
58979
|
+
if (!isAccepted) {
|
|
58980
|
+
return `Dosya t\xFCr\xFC kabul edilmiyor`;
|
|
58981
|
+
}
|
|
58797
58982
|
}
|
|
58798
|
-
|
|
58799
|
-
|
|
58800
|
-
|
|
58801
|
-
|
|
58802
|
-
|
|
58803
|
-
return;
|
|
58804
|
-
|
|
58805
|
-
|
|
58806
|
-
|
|
58983
|
+
if (customValidation) {
|
|
58984
|
+
const customError = await customValidation(file);
|
|
58985
|
+
if (customError)
|
|
58986
|
+
return customError;
|
|
58987
|
+
}
|
|
58988
|
+
return null;
|
|
58989
|
+
}, [maxSize, allowedMimeTypes, accept, customValidation]);
|
|
58990
|
+
const checkDuplicate = useCallback(async (file) => {
|
|
58991
|
+
if (!duplicateCheck)
|
|
58992
|
+
return false;
|
|
58993
|
+
const hash = await generateFileHash(file);
|
|
58994
|
+
return files.some((f) => f.metadata?.hash === hash);
|
|
58995
|
+
}, [files, duplicateCheck]);
|
|
58996
|
+
const createPreview = useCallback(async (file) => {
|
|
58997
|
+
if (!showPreview)
|
|
58998
|
+
return void 0;
|
|
58999
|
+
const fileType = file.type.split("/")[0];
|
|
59000
|
+
if (!previewTypes.includes(fileType))
|
|
59001
|
+
return void 0;
|
|
58807
59002
|
try {
|
|
58808
|
-
|
|
59003
|
+
if (fileType === "image") {
|
|
59004
|
+
return await createImagePreview(file);
|
|
59005
|
+
} else if (fileType === "video") {
|
|
59006
|
+
return await createVideoPreview(file);
|
|
59007
|
+
} else if (fileType === "audio") {
|
|
59008
|
+
const url = URL.createObjectURL(file);
|
|
59009
|
+
return {
|
|
59010
|
+
type: "audio",
|
|
59011
|
+
url
|
|
59012
|
+
};
|
|
59013
|
+
}
|
|
59014
|
+
} catch (error2) {
|
|
59015
|
+
console.warn("\xD6nizleme olu\u015Fturulamad\u0131:", error2);
|
|
59016
|
+
}
|
|
59017
|
+
return void 0;
|
|
59018
|
+
}, [showPreview, previewTypes]);
|
|
59019
|
+
const createMetadata = useCallback(async (file) => {
|
|
59020
|
+
const metadata = {
|
|
59021
|
+
name: file.name,
|
|
59022
|
+
size: file.size,
|
|
59023
|
+
type: file.type,
|
|
59024
|
+
lastModified: file.lastModified
|
|
59025
|
+
};
|
|
59026
|
+
if (duplicateCheck) {
|
|
59027
|
+
metadata.hash = await generateFileHash(file);
|
|
59028
|
+
}
|
|
59029
|
+
return metadata;
|
|
59030
|
+
}, [duplicateCheck]);
|
|
59031
|
+
const uploadFileChunked = useCallback(async (fileItem) => {
|
|
59032
|
+
const { file } = fileItem;
|
|
59033
|
+
const chunks = [];
|
|
59034
|
+
const chunkCount = Math.ceil(file.size / chunkSize);
|
|
59035
|
+
for (let i = 0; i < chunkCount; i++) {
|
|
59036
|
+
chunks.push({
|
|
59037
|
+
index: i,
|
|
59038
|
+
start: i * chunkSize,
|
|
59039
|
+
end: Math.min((i + 1) * chunkSize, file.size),
|
|
59040
|
+
status: "pending",
|
|
59041
|
+
attempts: 0
|
|
59042
|
+
});
|
|
59043
|
+
}
|
|
59044
|
+
setFiles((prev) => prev.map(
|
|
59045
|
+
(f) => f.id === fileItem.id ? { ...f, chunks, status: "uploading" } : f
|
|
59046
|
+
));
|
|
59047
|
+
const abortController = new AbortController();
|
|
59048
|
+
uploadQueue.current.set(fileItem.id, abortController);
|
|
59049
|
+
let uploadedBytes = 0;
|
|
59050
|
+
const startTime = Date.now();
|
|
59051
|
+
try {
|
|
59052
|
+
for (const chunk of chunks) {
|
|
59053
|
+
if (abortController.signal.aborted) {
|
|
59054
|
+
throw new Error("Upload cancelled");
|
|
59055
|
+
}
|
|
59056
|
+
await new Promise((resolve) => setTimeout(resolve, 100 + Math.random() * 200));
|
|
59057
|
+
uploadedBytes += chunk.end - chunk.start;
|
|
59058
|
+
const progress = Math.round(uploadedBytes / file.size * 100);
|
|
59059
|
+
const elapsedTime = (Date.now() - startTime) / 1e3;
|
|
59060
|
+
const speed = uploadedBytes / elapsedTime;
|
|
59061
|
+
const estimatedTime = (file.size - uploadedBytes) / speed;
|
|
59062
|
+
setFiles((prev) => prev.map(
|
|
59063
|
+
(f) => f.id === fileItem.id ? {
|
|
59064
|
+
...f,
|
|
59065
|
+
progress,
|
|
59066
|
+
uploadedBytes,
|
|
59067
|
+
speed,
|
|
59068
|
+
estimatedTime: estimatedTime || 0,
|
|
59069
|
+
chunks: f.chunks?.map(
|
|
59070
|
+
(c2) => c2.index === chunk.index ? { ...c2, status: "success" } : c2
|
|
59071
|
+
)
|
|
59072
|
+
} : f
|
|
59073
|
+
));
|
|
59074
|
+
onProgress?.(fileItem.id, progress);
|
|
59075
|
+
}
|
|
58809
59076
|
setFiles((prev) => prev.map(
|
|
58810
|
-
(f) =>
|
|
59077
|
+
(f) => f.id === fileItem.id ? { ...f, status: "success", progress: 100 } : f
|
|
58811
59078
|
));
|
|
58812
|
-
|
|
59079
|
+
onComplete?.(fileItem.id, { success: true });
|
|
59080
|
+
} catch (error2) {
|
|
58813
59081
|
setFiles((prev) => prev.map(
|
|
58814
|
-
(f) =>
|
|
59082
|
+
(f) => f.id === fileItem.id ? { ...f, status: "error", error: error2 instanceof Error ? error2.message : "Upload failed" } : f
|
|
58815
59083
|
));
|
|
59084
|
+
onError?.(fileItem.id, error2 instanceof Error ? error2.message : "Upload failed");
|
|
59085
|
+
} finally {
|
|
59086
|
+
uploadQueue.current.delete(fileItem.id);
|
|
58816
59087
|
}
|
|
58817
|
-
}
|
|
58818
|
-
|
|
58819
|
-
|
|
58820
|
-
|
|
58821
|
-
|
|
58822
|
-
|
|
58823
|
-
|
|
58824
|
-
setTimeout(() => {
|
|
58825
|
-
clearInterval(interval);
|
|
58826
|
-
setFiles((prev) => prev.map(
|
|
58827
|
-
(f) => f.id === validFile.id ? { ...f, status: "success", progress: 100 } : f
|
|
58828
|
-
));
|
|
58829
|
-
}, 1e3);
|
|
59088
|
+
}, [chunkSize, onProgress, onComplete, onError]);
|
|
59089
|
+
const processFiles = useCallback(async (fileList) => {
|
|
59090
|
+
const fileArray = Array.from(fileList);
|
|
59091
|
+
setError(null);
|
|
59092
|
+
if (files.length + fileArray.length > maxFiles) {
|
|
59093
|
+
setError(`Maksimum ${maxFiles} dosya y\xFCkleyebilirsiniz`);
|
|
59094
|
+
return;
|
|
58830
59095
|
}
|
|
58831
|
-
|
|
58832
|
-
|
|
58833
|
-
|
|
58834
|
-
|
|
58835
|
-
|
|
58836
|
-
|
|
58837
|
-
|
|
58838
|
-
|
|
58839
|
-
|
|
58840
|
-
|
|
58841
|
-
|
|
58842
|
-
|
|
58843
|
-
|
|
58844
|
-
|
|
58845
|
-
|
|
58846
|
-
|
|
58847
|
-
|
|
58848
|
-
|
|
58849
|
-
|
|
58850
|
-
|
|
58851
|
-
|
|
58852
|
-
|
|
58853
|
-
|
|
58854
|
-
|
|
58855
|
-
|
|
58856
|
-
|
|
58857
|
-
|
|
58858
|
-
|
|
58859
|
-
|
|
58860
|
-
|
|
58861
|
-
|
|
58862
|
-
|
|
58863
|
-
|
|
58864
|
-
|
|
58865
|
-
|
|
58866
|
-
|
|
58867
|
-
|
|
58868
|
-
|
|
58869
|
-
|
|
58870
|
-
|
|
58871
|
-
|
|
59096
|
+
if (maxTotalSize) {
|
|
59097
|
+
const currentSize = files.reduce((sum, f) => sum + f.file.size, 0);
|
|
59098
|
+
const newSize = fileArray.reduce((sum, f) => sum + f.size, 0);
|
|
59099
|
+
if (currentSize + newSize > maxTotalSize) {
|
|
59100
|
+
setError(`Toplam dosya boyutu ${formatFileSize(maxTotalSize)} limitini a\u015F\u0131yor`);
|
|
59101
|
+
return;
|
|
59102
|
+
}
|
|
59103
|
+
}
|
|
59104
|
+
const validFiles = [];
|
|
59105
|
+
const errors = [];
|
|
59106
|
+
for (const file of fileArray) {
|
|
59107
|
+
const validationError = await validateFile(file);
|
|
59108
|
+
if (validationError) {
|
|
59109
|
+
errors.push(`${file.name}: ${validationError}`);
|
|
59110
|
+
continue;
|
|
59111
|
+
}
|
|
59112
|
+
const isDuplicate = await checkDuplicate(file);
|
|
59113
|
+
if (isDuplicate) {
|
|
59114
|
+
errors.push(`${file.name}: Dosya zaten mevcut`);
|
|
59115
|
+
continue;
|
|
59116
|
+
}
|
|
59117
|
+
validFiles.push(file);
|
|
59118
|
+
}
|
|
59119
|
+
if (errors.length > 0) {
|
|
59120
|
+
setError(errors.join(", "));
|
|
59121
|
+
}
|
|
59122
|
+
if (validFiles.length === 0)
|
|
59123
|
+
return;
|
|
59124
|
+
const newFileItems = [];
|
|
59125
|
+
for (const file of validFiles) {
|
|
59126
|
+
const id = `${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
|
|
59127
|
+
const preview = await createPreview(file);
|
|
59128
|
+
const metadata = await createMetadata(file);
|
|
59129
|
+
newFileItems.push({
|
|
59130
|
+
id,
|
|
59131
|
+
file,
|
|
59132
|
+
status: "pending",
|
|
59133
|
+
progress: 0,
|
|
59134
|
+
totalBytes: file.size,
|
|
59135
|
+
preview,
|
|
59136
|
+
metadata
|
|
59137
|
+
});
|
|
59138
|
+
}
|
|
59139
|
+
setFiles((prev) => [...prev, ...newFileItems]);
|
|
59140
|
+
if (onUpload) {
|
|
59141
|
+
try {
|
|
59142
|
+
await onUpload(newFileItems);
|
|
59143
|
+
} catch (error2) {
|
|
59144
|
+
console.error("Upload failed:", error2);
|
|
59145
|
+
}
|
|
59146
|
+
} else {
|
|
59147
|
+
newFileItems.forEach((fileItem) => {
|
|
59148
|
+
uploadFileChunked(fileItem);
|
|
59149
|
+
});
|
|
59150
|
+
}
|
|
59151
|
+
}, [
|
|
59152
|
+
files,
|
|
59153
|
+
maxFiles,
|
|
59154
|
+
maxTotalSize,
|
|
59155
|
+
validateFile,
|
|
59156
|
+
checkDuplicate,
|
|
59157
|
+
createPreview,
|
|
59158
|
+
createMetadata,
|
|
59159
|
+
onUpload,
|
|
59160
|
+
uploadFileChunked
|
|
59161
|
+
]);
|
|
59162
|
+
const handleDrop = useCallback((e) => {
|
|
59163
|
+
e.preventDefault();
|
|
59164
|
+
setIsDragOver(false);
|
|
59165
|
+
if (disabled)
|
|
59166
|
+
return;
|
|
59167
|
+
const droppedFiles = Array.from(e.dataTransfer.files);
|
|
59168
|
+
if (droppedFiles.length > 0) {
|
|
59169
|
+
processFiles(droppedFiles);
|
|
59170
|
+
}
|
|
59171
|
+
}, [processFiles, disabled]);
|
|
59172
|
+
const handleDragOver = useCallback((e) => {
|
|
59173
|
+
e.preventDefault();
|
|
59174
|
+
if (!disabled) {
|
|
59175
|
+
setIsDragOver(true);
|
|
59176
|
+
}
|
|
59177
|
+
}, [disabled]);
|
|
59178
|
+
const handleDragLeave = useCallback((e) => {
|
|
59179
|
+
e.preventDefault();
|
|
59180
|
+
setIsDragOver(false);
|
|
59181
|
+
}, []);
|
|
59182
|
+
const handleFileSelect = useCallback((e) => {
|
|
59183
|
+
const selectedFiles = e.target.files;
|
|
59184
|
+
if (selectedFiles && selectedFiles.length > 0) {
|
|
59185
|
+
processFiles(selectedFiles);
|
|
59186
|
+
}
|
|
59187
|
+
e.target.value = "";
|
|
59188
|
+
}, [processFiles]);
|
|
59189
|
+
const removeFile = useCallback((fileId) => {
|
|
59190
|
+
const fileToRemove = files.find((f) => f.id === fileId);
|
|
59191
|
+
if (!fileToRemove)
|
|
59192
|
+
return;
|
|
59193
|
+
const controller = uploadQueue.current.get(fileId);
|
|
59194
|
+
if (controller) {
|
|
59195
|
+
controller.abort();
|
|
59196
|
+
uploadQueue.current.delete(fileId);
|
|
59197
|
+
}
|
|
59198
|
+
if (fileToRemove.preview?.url) {
|
|
59199
|
+
URL.revokeObjectURL(fileToRemove.preview.url);
|
|
59200
|
+
}
|
|
59201
|
+
setFiles((prev) => prev.filter((f) => f.id !== fileId));
|
|
59202
|
+
setSelectedIds((prev) => prev.filter((id) => id !== fileId));
|
|
59203
|
+
onRemove?.(fileId);
|
|
59204
|
+
}, [files, onRemove]);
|
|
59205
|
+
const pauseResumeUpload = useCallback((fileId) => {
|
|
59206
|
+
const file = files.find((f) => f.id === fileId);
|
|
59207
|
+
if (!file)
|
|
59208
|
+
return;
|
|
59209
|
+
if (file.status === "uploading") {
|
|
59210
|
+
const controller = uploadQueue.current.get(fileId);
|
|
59211
|
+
if (controller) {
|
|
59212
|
+
controller.abort();
|
|
59213
|
+
uploadQueue.current.delete(fileId);
|
|
59214
|
+
}
|
|
59215
|
+
setFiles((prev) => prev.map(
|
|
59216
|
+
(f) => f.id === fileId ? { ...f, status: "paused" } : f
|
|
59217
|
+
));
|
|
59218
|
+
} else if (file.status === "paused" && resumable) {
|
|
59219
|
+
uploadFileChunked(file);
|
|
59220
|
+
}
|
|
59221
|
+
}, [files, resumable, uploadFileChunked]);
|
|
59222
|
+
const handleBulkSelect = useCallback((fileId, selected) => {
|
|
59223
|
+
setSelectedIds(
|
|
59224
|
+
(prev) => selected ? [...prev, fileId] : prev.filter((id) => id !== fileId)
|
|
59225
|
+
);
|
|
59226
|
+
}, []);
|
|
59227
|
+
const handleSelectAll = useCallback(() => {
|
|
59228
|
+
const allIds = files.map((f) => f.id);
|
|
59229
|
+
setSelectedIds(allIds);
|
|
59230
|
+
onBulkSelect?.(allIds);
|
|
59231
|
+
}, [files, onBulkSelect]);
|
|
59232
|
+
const handleClearSelection = useCallback(() => {
|
|
59233
|
+
setSelectedIds([]);
|
|
59234
|
+
onBulkSelect?.([]);
|
|
59235
|
+
}, [onBulkSelect]);
|
|
59236
|
+
const handleBulkRemove = useCallback(() => {
|
|
59237
|
+
selectedIds.forEach((id) => removeFile(id));
|
|
59238
|
+
setSelectedIds([]);
|
|
59239
|
+
}, [selectedIds, removeFile]);
|
|
59240
|
+
const handleBulkDownload = useCallback(() => {
|
|
59241
|
+
console.log("Bulk download:", selectedIds);
|
|
59242
|
+
}, [selectedIds]);
|
|
59243
|
+
const handlePreview = useCallback((file) => {
|
|
59244
|
+
setPreviewFile(file);
|
|
59245
|
+
setIsPreviewOpen(true);
|
|
59246
|
+
onPreview?.(file);
|
|
59247
|
+
}, [onPreview]);
|
|
59248
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("w-full space-y-4", className), ...props, children: [
|
|
59249
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: allowBulkOperations && selectedIds.length > 0 && /* @__PURE__ */ jsx(
|
|
59250
|
+
BulkActions,
|
|
59251
|
+
{
|
|
59252
|
+
selectedIds,
|
|
59253
|
+
onClearSelection: handleClearSelection,
|
|
59254
|
+
onBulkRemove: handleBulkRemove,
|
|
59255
|
+
onBulkDownload: handleBulkDownload
|
|
59256
|
+
}
|
|
59257
|
+
) }),
|
|
58872
59258
|
/* @__PURE__ */ jsxs(
|
|
58873
|
-
|
|
59259
|
+
motion.div,
|
|
58874
59260
|
{
|
|
58875
59261
|
className: cn(
|
|
58876
|
-
|
|
58877
|
-
|
|
58878
|
-
|
|
59262
|
+
fileUploadVariants({
|
|
59263
|
+
variant,
|
|
59264
|
+
state: disabled ? "disabled" : isDragOver ? "dragover" : "idle"
|
|
59265
|
+
})
|
|
58879
59266
|
),
|
|
58880
59267
|
onDrop: handleDrop,
|
|
58881
59268
|
onDragOver: handleDragOver,
|
|
58882
59269
|
onDragLeave: handleDragLeave,
|
|
58883
|
-
onClick:
|
|
59270
|
+
onClick: () => !disabled && fileInputRef.current?.click(),
|
|
59271
|
+
animate: {
|
|
59272
|
+
scale: isDragOver ? 1.02 : 1
|
|
59273
|
+
},
|
|
59274
|
+
transition: { duration: 0.2 },
|
|
58884
59275
|
children: [
|
|
58885
|
-
/* @__PURE__ */ jsx(
|
|
58886
|
-
|
|
58887
|
-
|
|
59276
|
+
/* @__PURE__ */ jsx(
|
|
59277
|
+
"input",
|
|
59278
|
+
{
|
|
59279
|
+
ref: fileInputRef,
|
|
59280
|
+
type: "file",
|
|
59281
|
+
accept,
|
|
59282
|
+
multiple,
|
|
59283
|
+
disabled,
|
|
59284
|
+
onChange: handleFileSelect,
|
|
59285
|
+
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
|
59286
|
+
}
|
|
59287
|
+
),
|
|
59288
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center space-y-4", children: [
|
|
59289
|
+
/* @__PURE__ */ jsx(
|
|
59290
|
+
motion.div,
|
|
59291
|
+
{
|
|
59292
|
+
animate: {
|
|
59293
|
+
scale: isDragOver ? 1.1 : 1,
|
|
59294
|
+
rotate: isDragOver ? 5 : 0
|
|
59295
|
+
},
|
|
59296
|
+
className: "mx-auto h-12 w-12 text-muted-foreground",
|
|
59297
|
+
children: /* @__PURE__ */ jsx(Upload, { className: "h-full w-full" })
|
|
59298
|
+
}
|
|
59299
|
+
),
|
|
59300
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
59301
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: isDragOver ? "Dosyalar\u0131 buraya b\u0131rak\u0131n" : "Dosya Y\xFCkleyin" }),
|
|
59302
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Dosyalar\u0131 s\xFCr\xFCkleyip b\u0131rak\u0131n veya t\u0131klayarak se\xE7in" }),
|
|
59303
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-4 mt-3 text-xs text-muted-foreground", children: [
|
|
59304
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
59305
|
+
"Maks ",
|
|
59306
|
+
maxFiles,
|
|
59307
|
+
" dosya"
|
|
59308
|
+
] }),
|
|
59309
|
+
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
59310
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
59311
|
+
formatFileSize(maxSize),
|
|
59312
|
+
" her dosya"
|
|
59313
|
+
] }),
|
|
59314
|
+
resumable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59315
|
+
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
59316
|
+
/* @__PURE__ */ jsx("span", { children: "Devam ettirilebilir" })
|
|
59317
|
+
] })
|
|
59318
|
+
] })
|
|
59319
|
+
] }),
|
|
59320
|
+
/* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", disabled, type: "button", children: [
|
|
59321
|
+
/* @__PURE__ */ jsx(Upload, { className: "mr-2 h-4 w-4" }),
|
|
59322
|
+
"Dosya Se\xE7"
|
|
59323
|
+
] })
|
|
59324
|
+
] })
|
|
58888
59325
|
]
|
|
58889
59326
|
}
|
|
58890
59327
|
),
|
|
59328
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: error && /* @__PURE__ */ jsxs(
|
|
59329
|
+
motion.div,
|
|
59330
|
+
{
|
|
59331
|
+
initial: { opacity: 0, y: -10 },
|
|
59332
|
+
animate: { opacity: 1, y: 0 },
|
|
59333
|
+
exit: { opacity: 0, y: -10 },
|
|
59334
|
+
className: "flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-lg",
|
|
59335
|
+
children: [
|
|
59336
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 text-destructive flex-shrink-0" }),
|
|
59337
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-destructive", children: error }),
|
|
59338
|
+
/* @__PURE__ */ jsx(
|
|
59339
|
+
MoonUIButtonPro,
|
|
59340
|
+
{
|
|
59341
|
+
variant: "ghost",
|
|
59342
|
+
size: "sm",
|
|
59343
|
+
className: "ml-auto h-6 w-6 p-0",
|
|
59344
|
+
onClick: () => setError(null),
|
|
59345
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
|
|
59346
|
+
}
|
|
59347
|
+
)
|
|
59348
|
+
]
|
|
59349
|
+
}
|
|
59350
|
+
) }),
|
|
59351
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: files.length > 0 && /* @__PURE__ */ jsxs(
|
|
59352
|
+
motion.div,
|
|
59353
|
+
{
|
|
59354
|
+
initial: { opacity: 0, height: 0 },
|
|
59355
|
+
animate: { opacity: 1, height: "auto" },
|
|
59356
|
+
exit: { opacity: 0, height: 0 },
|
|
59357
|
+
className: "space-y-3",
|
|
59358
|
+
children: [
|
|
59359
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
59360
|
+
/* @__PURE__ */ jsxs("h4", { className: "text-sm font-medium", children: [
|
|
59361
|
+
"Y\xFCklenen Dosyalar (",
|
|
59362
|
+
files.length,
|
|
59363
|
+
")"
|
|
59364
|
+
] }),
|
|
59365
|
+
allowBulkOperations && files.length > 1 && /* @__PURE__ */ jsx(
|
|
59366
|
+
MoonUIButtonPro,
|
|
59367
|
+
{
|
|
59368
|
+
variant: "ghost",
|
|
59369
|
+
size: "sm",
|
|
59370
|
+
onClick: selectedIds.length === files.length ? handleClearSelection : handleSelectAll,
|
|
59371
|
+
children: selectedIds.length === files.length ? "Se\xE7imi Temizle" : "T\xFCm\xFCn\xFC Se\xE7"
|
|
59372
|
+
}
|
|
59373
|
+
)
|
|
59374
|
+
] }),
|
|
59375
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
59376
|
+
"space-y-2",
|
|
59377
|
+
variant === "grid" && "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 space-y-0"
|
|
59378
|
+
), children: /* @__PURE__ */ jsx(AnimatePresence, { children: files.map((file) => /* @__PURE__ */ jsx(
|
|
59379
|
+
FileUploadItem,
|
|
59380
|
+
{
|
|
59381
|
+
file,
|
|
59382
|
+
variant,
|
|
59383
|
+
showPreview,
|
|
59384
|
+
showProgress,
|
|
59385
|
+
showMetadata,
|
|
59386
|
+
allowBulkOperations,
|
|
59387
|
+
resumable,
|
|
59388
|
+
selected: selectedIds.includes(file.id),
|
|
59389
|
+
onSelect: (selected) => handleBulkSelect(file.id, selected),
|
|
59390
|
+
onRemove: () => removeFile(file.id),
|
|
59391
|
+
onPauseResume: () => pauseResumeUpload(file.id),
|
|
59392
|
+
onPreview: () => handlePreview(file)
|
|
59393
|
+
},
|
|
59394
|
+
file.id
|
|
59395
|
+
)) }) })
|
|
59396
|
+
]
|
|
59397
|
+
}
|
|
59398
|
+
) }),
|
|
58891
59399
|
/* @__PURE__ */ jsx(
|
|
58892
|
-
|
|
59400
|
+
FilePreviewModal,
|
|
58893
59401
|
{
|
|
58894
|
-
|
|
58895
|
-
|
|
58896
|
-
|
|
58897
|
-
multiple,
|
|
58898
|
-
onChange: (e) => handleFileSelect(e.target.files),
|
|
58899
|
-
className: "hidden",
|
|
58900
|
-
disabled
|
|
59402
|
+
file: previewFile,
|
|
59403
|
+
isOpen: isPreviewOpen,
|
|
59404
|
+
onClose: () => setIsPreviewOpen(false)
|
|
58901
59405
|
}
|
|
59406
|
+
)
|
|
59407
|
+
] });
|
|
59408
|
+
}
|
|
59409
|
+
);
|
|
59410
|
+
var FileUploadItem = ({
|
|
59411
|
+
file,
|
|
59412
|
+
variant = "default",
|
|
59413
|
+
showPreview = true,
|
|
59414
|
+
showProgress = true,
|
|
59415
|
+
showMetadata = true,
|
|
59416
|
+
allowBulkOperations = true,
|
|
59417
|
+
resumable = true,
|
|
59418
|
+
selected = false,
|
|
59419
|
+
onSelect,
|
|
59420
|
+
onRemove,
|
|
59421
|
+
onPauseResume,
|
|
59422
|
+
onPreview
|
|
59423
|
+
}) => {
|
|
59424
|
+
const canPauseResume = resumable && ["uploading", "paused"].includes(file.status);
|
|
59425
|
+
const canPreview = showPreview && file.preview && ["image", "video", "audio"].includes(file.preview.type);
|
|
59426
|
+
return /* @__PURE__ */ jsxs(
|
|
59427
|
+
motion.div,
|
|
59428
|
+
{
|
|
59429
|
+
layout: true,
|
|
59430
|
+
initial: { opacity: 0, y: 10 },
|
|
59431
|
+
animate: { opacity: 1, y: 0 },
|
|
59432
|
+
exit: { opacity: 0, y: -10, scale: 0.95 },
|
|
59433
|
+
className: cn(
|
|
59434
|
+
"group relative overflow-hidden rounded-lg border bg-card transition-all",
|
|
59435
|
+
selected && "ring-2 ring-primary bg-primary/5",
|
|
59436
|
+
variant === "compact" && "p-3",
|
|
59437
|
+
variant === "default" && "p-4",
|
|
59438
|
+
variant === "grid" && "p-4"
|
|
58902
59439
|
),
|
|
58903
|
-
|
|
58904
|
-
/* @__PURE__ */
|
|
58905
|
-
"
|
|
58906
|
-
|
|
58907
|
-
|
|
59440
|
+
children: [
|
|
59441
|
+
allowBulkOperations && /* @__PURE__ */ jsx("div", { className: "absolute top-3 left-3 z-10", children: /* @__PURE__ */ jsx(
|
|
59442
|
+
"input",
|
|
59443
|
+
{
|
|
59444
|
+
type: "checkbox",
|
|
59445
|
+
checked: selected,
|
|
59446
|
+
onChange: (e) => onSelect?.(e.target.checked),
|
|
59447
|
+
className: "rounded border-muted-foreground/25"
|
|
59448
|
+
}
|
|
59449
|
+
) }),
|
|
59450
|
+
showPreview && file.preview && /* @__PURE__ */ jsxs("div", { className: cn(
|
|
59451
|
+
"relative overflow-hidden rounded bg-muted/20",
|
|
59452
|
+
variant === "grid" ? "aspect-video mb-3" : "w-12 h-12 float-left mr-3"
|
|
59453
|
+
), children: [
|
|
59454
|
+
file.preview.type === "image" && file.preview.thumbnail && /* @__PURE__ */ jsx(
|
|
59455
|
+
"img",
|
|
59456
|
+
{
|
|
59457
|
+
src: file.preview.thumbnail,
|
|
59458
|
+
alt: file.file.name,
|
|
59459
|
+
className: "w-full h-full object-cover"
|
|
59460
|
+
}
|
|
59461
|
+
),
|
|
59462
|
+
file.preview.type === "video" && file.preview.thumbnail && /* @__PURE__ */ jsxs("div", { className: "relative w-full h-full", children: [
|
|
59463
|
+
/* @__PURE__ */ jsx(
|
|
59464
|
+
"img",
|
|
59465
|
+
{
|
|
59466
|
+
src: file.preview.thumbnail,
|
|
59467
|
+
alt: file.file.name,
|
|
59468
|
+
className: "w-full h-full object-cover"
|
|
59469
|
+
}
|
|
59470
|
+
),
|
|
59471
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/20", children: /* @__PURE__ */ jsx(Play, { className: "h-6 w-6 text-white" }) })
|
|
59472
|
+
] }),
|
|
59473
|
+
!file.preview.thumbnail && /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center", children: getFileIcon(file.file.type, variant === "grid" ? "lg" : "md") }),
|
|
59474
|
+
canPreview && /* @__PURE__ */ jsx(
|
|
59475
|
+
MoonUIButtonPro,
|
|
59476
|
+
{
|
|
59477
|
+
variant: "secondary",
|
|
59478
|
+
size: "sm",
|
|
59479
|
+
className: "absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
59480
|
+
onClick: onPreview,
|
|
59481
|
+
children: /* @__PURE__ */ jsx(Eye, { className: "h-3 w-3" })
|
|
59482
|
+
}
|
|
59483
|
+
)
|
|
58908
59484
|
] }),
|
|
58909
|
-
|
|
58910
|
-
|
|
58911
|
-
|
|
58912
|
-
|
|
58913
|
-
|
|
58914
|
-
|
|
58915
|
-
|
|
58916
|
-
|
|
58917
|
-
|
|
58918
|
-
|
|
59485
|
+
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
59486
|
+
"flex-1 min-w-0",
|
|
59487
|
+
variant === "grid" && "text-center"
|
|
59488
|
+
), children: [
|
|
59489
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
59490
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
59491
|
+
/* @__PURE__ */ jsx("h5", { className: cn(
|
|
59492
|
+
"font-medium truncate",
|
|
59493
|
+
variant === "compact" ? "text-sm" : "text-base"
|
|
59494
|
+
), children: file.file.name }),
|
|
59495
|
+
showMetadata && /* @__PURE__ */ jsxs("div", { className: cn(
|
|
59496
|
+
"flex items-center gap-2 mt-1 text-muted-foreground",
|
|
59497
|
+
variant === "compact" ? "text-xs" : "text-sm",
|
|
59498
|
+
variant === "grid" && "justify-center"
|
|
59499
|
+
), children: [
|
|
59500
|
+
/* @__PURE__ */ jsx("span", { children: formatFileSize(file.file.size) }),
|
|
59501
|
+
file.preview?.dimensions && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59502
|
+
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
59503
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
59504
|
+
file.preview.dimensions.width,
|
|
59505
|
+
" \xD7 ",
|
|
59506
|
+
file.preview.dimensions.height
|
|
59507
|
+
] })
|
|
59508
|
+
] }),
|
|
59509
|
+
file.preview?.duration && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59510
|
+
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
59511
|
+
/* @__PURE__ */ jsx("span", { children: formatTime(file.preview.duration) })
|
|
59512
|
+
] })
|
|
58919
59513
|
] })
|
|
58920
59514
|
] }),
|
|
58921
|
-
/* @__PURE__ */ jsxs(
|
|
58922
|
-
|
|
58923
|
-
|
|
58924
|
-
|
|
59515
|
+
/* @__PURE__ */ jsxs(
|
|
59516
|
+
MoonUIBadgePro,
|
|
59517
|
+
{
|
|
59518
|
+
variant: file.status === "success" ? "success" : file.status === "error" ? "destructive" : file.status === "paused" ? "secondary" : "secondary",
|
|
59519
|
+
className: "flex-shrink-0",
|
|
59520
|
+
children: [
|
|
59521
|
+
file.status === "uploading" && /* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 mr-1 animate-spin" }),
|
|
59522
|
+
file.status === "success" && /* @__PURE__ */ jsx(CheckCircle2, { className: "h-3 w-3 mr-1" }),
|
|
59523
|
+
file.status === "error" && /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3 mr-1" }),
|
|
59524
|
+
file.status === "paused" && /* @__PURE__ */ jsx(Pause, { className: "h-3 w-3 mr-1" }),
|
|
59525
|
+
file.status === "pending" ? "Bekliyor" : file.status === "uploading" ? "Y\xFCkleniyor" : file.status === "paused" ? "Duraklat\u0131ld\u0131" : file.status === "success" ? "Tamamland\u0131" : file.status === "error" ? "Hata" : "\u0130ptal"
|
|
59526
|
+
]
|
|
59527
|
+
}
|
|
59528
|
+
)
|
|
59529
|
+
] }),
|
|
59530
|
+
showProgress && file.status === "uploading" && /* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-1", children: [
|
|
59531
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
59532
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
59533
|
+
file.progress,
|
|
58925
59534
|
"%"
|
|
59535
|
+
] }),
|
|
59536
|
+
file.speed && /* @__PURE__ */ jsxs("span", { children: [
|
|
59537
|
+
formatFileSize(file.speed),
|
|
59538
|
+
"/s"
|
|
59539
|
+
] }),
|
|
59540
|
+
file.estimatedTime && file.estimatedTime > 0 && /* @__PURE__ */ jsxs("span", { children: [
|
|
59541
|
+
formatTime(file.estimatedTime),
|
|
59542
|
+
" kald\u0131"
|
|
58926
59543
|
] })
|
|
58927
59544
|
] }),
|
|
58928
|
-
|
|
58929
|
-
|
|
59545
|
+
/* @__PURE__ */ jsx(MoonUIProgressPro, { value: file.progress, className: "h-1" })
|
|
59546
|
+
] }),
|
|
59547
|
+
file.status === "error" && file.error && /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-destructive", children: file.error }),
|
|
59548
|
+
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
59549
|
+
"flex items-center gap-1 mt-3",
|
|
59550
|
+
variant === "grid" && "justify-center"
|
|
59551
|
+
), children: [
|
|
59552
|
+
canPauseResume && /* @__PURE__ */ jsx(
|
|
59553
|
+
MoonUIButtonPro,
|
|
58930
59554
|
{
|
|
58931
|
-
|
|
58932
|
-
|
|
59555
|
+
variant: "ghost",
|
|
59556
|
+
size: "sm",
|
|
59557
|
+
onClick: onPauseResume,
|
|
59558
|
+
className: "h-7 px-2",
|
|
59559
|
+
children: file.status === "uploading" ? /* @__PURE__ */ jsx(Pause, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Play, { className: "h-3 w-3" })
|
|
58933
59560
|
}
|
|
58934
|
-
)
|
|
58935
|
-
|
|
58936
|
-
] }),
|
|
58937
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
58938
|
-
uploadedFile.status === "success" && showPreview && uploadedFile.file.type.startsWith("image/") && /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }) }),
|
|
58939
|
-
/* @__PURE__ */ jsx(
|
|
59561
|
+
),
|
|
59562
|
+
file.status === "error" && resumable && /* @__PURE__ */ jsx(
|
|
58940
59563
|
MoonUIButtonPro,
|
|
58941
59564
|
{
|
|
58942
59565
|
variant: "ghost",
|
|
58943
59566
|
size: "sm",
|
|
58944
|
-
onClick:
|
|
58945
|
-
|
|
58946
|
-
children: /* @__PURE__ */ jsx(
|
|
59567
|
+
onClick: onPauseResume,
|
|
59568
|
+
className: "h-7 px-2",
|
|
59569
|
+
children: /* @__PURE__ */ jsx(RotateCcw, { className: "h-3 w-3" })
|
|
58947
59570
|
}
|
|
58948
|
-
)
|
|
59571
|
+
),
|
|
59572
|
+
file.status === "success" && /* @__PURE__ */ jsx(
|
|
59573
|
+
MoonUIButtonPro,
|
|
59574
|
+
{
|
|
59575
|
+
variant: "ghost",
|
|
59576
|
+
size: "sm",
|
|
59577
|
+
className: "h-7 px-2",
|
|
59578
|
+
children: /* @__PURE__ */ jsx(Download, { className: "h-3 w-3" })
|
|
59579
|
+
}
|
|
59580
|
+
),
|
|
59581
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
59582
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", className: "h-7 w-7 p-0", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-3 w-3" }) }) }),
|
|
59583
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
|
|
59584
|
+
canPreview && /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: onPreview, children: [
|
|
59585
|
+
/* @__PURE__ */ jsx(Eye, { className: "mr-2 h-4 w-4" }),
|
|
59586
|
+
"\xD6nizle"
|
|
59587
|
+
] }),
|
|
59588
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
|
|
59589
|
+
/* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" }),
|
|
59590
|
+
"Linki Kopyala"
|
|
59591
|
+
] }),
|
|
59592
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
|
|
59593
|
+
/* @__PURE__ */ jsx(Share, { className: "mr-2 h-4 w-4" }),
|
|
59594
|
+
"Payla\u015F"
|
|
59595
|
+
] }),
|
|
59596
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: onRemove, className: "text-destructive", children: [
|
|
59597
|
+
/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
|
|
59598
|
+
"Sil"
|
|
59599
|
+
] })
|
|
59600
|
+
] })
|
|
59601
|
+
] })
|
|
58949
59602
|
] })
|
|
58950
|
-
] }
|
|
58951
|
-
]
|
|
58952
|
-
|
|
58953
|
-
|
|
58954
|
-
|
|
58955
|
-
|
|
58956
|
-
] })
|
|
58957
|
-
] });
|
|
58958
|
-
}
|
|
59603
|
+
] })
|
|
59604
|
+
]
|
|
59605
|
+
}
|
|
59606
|
+
);
|
|
59607
|
+
};
|
|
59608
|
+
MoonUIFileUploadPro.displayName = "MoonUIFileUploadPro";
|
|
58959
59609
|
function DataTableColumnToggle({ table, trigger }) {
|
|
58960
59610
|
const [search, setSearch] = t__default.useState("");
|
|
58961
59611
|
const columns = table.getAllColumns().filter(
|
|
@@ -62381,7 +63031,7 @@ var MoonUIQuizFormPro = t__default.forwardRef(({
|
|
|
62381
63031
|
link.click();
|
|
62382
63032
|
URL.revokeObjectURL(url);
|
|
62383
63033
|
};
|
|
62384
|
-
const
|
|
63034
|
+
const formatTime2 = (seconds) => {
|
|
62385
63035
|
const mins = Math.floor(seconds / 60);
|
|
62386
63036
|
const secs = seconds % 60;
|
|
62387
63037
|
return `${mins}:${secs.toString().padStart(2, "0")}`;
|
|
@@ -62632,7 +63282,7 @@ var MoonUIQuizFormPro = t__default.forwardRef(({
|
|
|
62632
63282
|
timeLeft < 60 ? "bg-red-100 text-red-700" : "bg-muted"
|
|
62633
63283
|
), children: [
|
|
62634
63284
|
/* @__PURE__ */ jsx(Clock, { className: "w-4 h-4" }),
|
|
62635
|
-
|
|
63285
|
+
formatTime2(timeLeft)
|
|
62636
63286
|
] })
|
|
62637
63287
|
] }),
|
|
62638
63288
|
/* @__PURE__ */ jsxs("div", { className: "mb-6", children: [
|
|
@@ -63660,4 +64310,4 @@ var BadgePro = t__default.forwardRef(({
|
|
|
63660
64310
|
});
|
|
63661
64311
|
BadgePro.displayName = "BadgePro";
|
|
63662
64312
|
|
|
63663
|
-
export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, Calendar3 as AdvancedCalendar, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, AnimatedButton, MoonUIAspectRatioPro as AspectRatio, MoonUIAvatarPro as Avatar, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarImagePro as AvatarImage, MoonUIBadgePro as Badge, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbPagePro as BreadcrumbPage, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIButtonPro as Button, Calendar, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, MoonUICheckboxPro as Checkbox, MoonUICollapsiblePro as Collapsible, MoonUICollapsibleContentPro as CollapsibleContent, MoonUICollapsibleTriggerPro as CollapsibleTrigger, MoonUIColorPickerPro as ColorPicker, MoonUICommandPro as Command, MoonUICommandDialogPro as CommandDialog, MoonUICommandEmptyPro as CommandEmpty, MoonUICommandGroupPro as CommandGroup, MoonUICommandInputPro as CommandInput, MoonUICommandItemPro as CommandItem, MoonUICommandListPro as CommandList, MoonUICommandSeparatorPro as CommandSeparator, MoonUICommandShortcutPro as CommandShortcut, Dashboard, DataTable, MoonUIDialogPro as Dialog, MoonUIDialogClosePro as DialogClose, MoonUIDialogContentPro as DialogContent, MoonUIDialogDescriptionPro as DialogDescription, MoonUIDialogFooterPro as DialogFooter, MoonUIDialogHeaderPro as DialogHeader, MoonUIDialogTitlePro as DialogTitle, MoonUIDialogTriggerPro as DialogTrigger, DraggableList, MoonUIDropdownMenuPro as DropdownMenu, MoonUIDropdownMenuCheckboxItemPro as DropdownMenuCheckboxItem, MoonUIDropdownMenuContentPro as DropdownMenuContent, MoonUIDropdownMenuGroupPro as DropdownMenuGroup, MoonUIDropdownMenuItemPro as DropdownMenuItem, MoonUIDropdownMenuLabelPro as DropdownMenuLabel, MoonUIDropdownMenuPortalPro as DropdownMenuPortal, MoonUIDropdownMenuRadioGroupPro as DropdownMenuRadioGroup, MoonUIDropdownMenuRadioItemPro as DropdownMenuRadioItem, MoonUIDropdownMenuSeparatorPro as DropdownMenuSeparator, MoonUIDropdownMenuShortcutPro as DropdownMenuShortcut, MoonUIDropdownMenuSubPro as DropdownMenuSub, MoonUIDropdownMenuSubContentPro as DropdownMenuSubContent, MoonUIDropdownMenuSubTriggerPro as DropdownMenuSubTrigger, MoonUIDropdownMenuTriggerPro as DropdownMenuTrigger, enhanced_exports as Enhanced, ErrorBoundary,
|
|
64313
|
+
export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, Calendar3 as AdvancedCalendar, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, AnimatedButton, MoonUIAspectRatioPro as AspectRatio, MoonUIAvatarPro as Avatar, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarImagePro as AvatarImage, MoonUIBadgePro as Badge, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbPagePro as BreadcrumbPage, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIButtonPro as Button, Calendar, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, MoonUICheckboxPro as Checkbox, MoonUICollapsiblePro as Collapsible, MoonUICollapsibleContentPro as CollapsibleContent, MoonUICollapsibleTriggerPro as CollapsibleTrigger, MoonUIColorPickerPro as ColorPicker, MoonUICommandPro as Command, MoonUICommandDialogPro as CommandDialog, MoonUICommandEmptyPro as CommandEmpty, MoonUICommandGroupPro as CommandGroup, MoonUICommandInputPro as CommandInput, MoonUICommandItemPro as CommandItem, MoonUICommandListPro as CommandList, MoonUICommandSeparatorPro as CommandSeparator, MoonUICommandShortcutPro as CommandShortcut, Dashboard, DataTable, MoonUIDialogPro as Dialog, MoonUIDialogClosePro as DialogClose, MoonUIDialogContentPro as DialogContent, MoonUIDialogDescriptionPro as DialogDescription, MoonUIDialogFooterPro as DialogFooter, MoonUIDialogHeaderPro as DialogHeader, MoonUIDialogTitlePro as DialogTitle, MoonUIDialogTriggerPro as DialogTrigger, DraggableList, MoonUIDropdownMenuPro as DropdownMenu, MoonUIDropdownMenuCheckboxItemPro as DropdownMenuCheckboxItem, MoonUIDropdownMenuContentPro as DropdownMenuContent, MoonUIDropdownMenuGroupPro as DropdownMenuGroup, MoonUIDropdownMenuItemPro as DropdownMenuItem, MoonUIDropdownMenuLabelPro as DropdownMenuLabel, MoonUIDropdownMenuPortalPro as DropdownMenuPortal, MoonUIDropdownMenuRadioGroupPro as DropdownMenuRadioGroup, MoonUIDropdownMenuRadioItemPro as DropdownMenuRadioItem, MoonUIDropdownMenuSeparatorPro as DropdownMenuSeparator, MoonUIDropdownMenuShortcutPro as DropdownMenuShortcut, MoonUIDropdownMenuSubPro as DropdownMenuSub, MoonUIDropdownMenuSubContentPro as DropdownMenuSubContent, MoonUIDropdownMenuSubTriggerPro as DropdownMenuSubTrigger, MoonUIDropdownMenuTriggerPro as DropdownMenuTrigger, enhanced_exports as Enhanced, ErrorBoundary, FloatingActionButton, FormWizardNavigation, FormWizardProgress, FormWizardStep, GitHubStars, HealthCheck, HoverCard2 as HoverCard, HoverCard3D, HoverCardContent2 as HoverCardContent, HoverCardTrigger2 as HoverCardTrigger, MoonUIInputPro as Input, Kanban, MoonUILabelPro as Label, LazyComponent, LazyImage, LazyList, MagneticButton, MemoryAnalytics, MemoryEfficientData, MoonUIAccordionContentPro, MoonUIAccordionItemPro, MoonUIAccordionPro, MoonUIAccordionTriggerPro, MoonUIAlertDescriptionPro, MoonUIAlertPro, MoonUIAlertTitlePro, MoonUIAspectRatioPro, MoonUIAvatarFallbackPro, MoonUIAvatarImagePro, MoonUIAvatarPro, MoonUIBadgePro, MoonUIBreadcrumbEllipsisPro, MoonUIBreadcrumbItemPro, MoonUIBreadcrumbLinkPro, MoonUIBreadcrumbListPro, MoonUIBreadcrumbPagePro, MoonUIBreadcrumbPro, MoonUIBreadcrumbSeparatorPro, MoonUIButtonPro, MoonUICardContentPro, MoonUICardDescriptionPro, MoonUICardFooterPro, MoonUICardHeaderPro, MoonUICardPro, MoonUICardTitlePro, MoonUICheckboxPro, MoonUICollapsibleContentPro, MoonUICollapsiblePro, MoonUICollapsibleTriggerPro, MoonUIColorPickerPro, MoonUICommandDialogPro, MoonUICommandEmptyPro, MoonUICommandGroupPro, MoonUICommandInputPro, MoonUICommandItemPro, MoonUICommandListPro, MoonUICommandPro, MoonUICommandSeparatorPro, MoonUICommandShortcutPro, MoonUICreditCardInputPro, MoonUIDialogClosePro, MoonUIDialogContentPro, MoonUIDialogDescriptionPro, MoonUIDialogFooterPro, MoonUIDialogHeaderPro, MoonUIDialogPro, MoonUIDialogTitlePro, MoonUIDialogTriggerPro, MoonUIDropdownMenuCheckboxItemPro, MoonUIDropdownMenuContentPro, MoonUIDropdownMenuGroupPro, MoonUIDropdownMenuItemPro, MoonUIDropdownMenuLabelPro, MoonUIDropdownMenuPortalPro, MoonUIDropdownMenuPro, MoonUIDropdownMenuRadioGroupPro, MoonUIDropdownMenuRadioItemPro, MoonUIDropdownMenuSeparatorPro, MoonUIDropdownMenuShortcutPro, MoonUIDropdownMenuSubContentPro, MoonUIDropdownMenuSubPro, MoonUIDropdownMenuSubTriggerPro, MoonUIDropdownMenuTriggerPro, MoonUIFileUploadPro, MoonUIFormWizardPro, MoonUIInputPro, MoonUILabelPro, MoonUIPaginationContentPro, MoonUIPaginationEllipsisPro, MoonUIPaginationItemPro, MoonUIPaginationLinkPro, MoonUIPaginationNextPro, MoonUIPaginationPreviousPro, MoonUIPaginationPro, MoonUIPhoneNumberInputPro, MoonUIPopoverContentPro, MoonUIPopoverPro, MoonUIPopoverTriggerPro, MoonUIProgressPro, MoonUIQuizFormPro, MoonUIRadioGroupContextPro, MoonUIRadioGroupItemPro, MoonUIRadioGroupPro, MoonUIRadioItemWithLabelPro, MoonUIRadioLabelPro, MoonUISelectContentPro, MoonUISelectGroupPro, MoonUISelectItemPro, MoonUISelectLabelPro, MoonUISelectPro, MoonUISelectSeparatorPro, MoonUISelectTriggerPro, MoonUISelectValuePro, MoonUISeparatorPro, MoonUISkeletonPro, MoonUISliderPro, MoonUISwitchPro, MoonUITableBodyPro, MoonUITableCaptionPro, MoonUITableCellPro, MoonUITableFooterPro, MoonUITableHeadPro, MoonUITableHeaderPro, MoonUITablePro, MoonUITableRowPro, MoonUITabsContentPro, MoonUITabsListPro, MoonUITabsPro, MoonUITabsTriggerPro, MoonUITextareaPro, MoonUIToastPro, MoonUITogglePro, MoonUITooltipContentPro, MoonUITooltipPro, MoonUITooltipProviderPro, MoonUITooltipTriggerPro, MoonUIalertVariantsPro, MoonUIaspectRatioVariantsPro, MoonUIbreadcrumbVariantsPro, MoonUIcollapsibleContentVariantsPro, MoonUIcollapsibleTriggerVariantsPro, MoonUIcommandVariantsPro, MoonUIradioGroupItemVariantsPro, MoonUItableVariantsPro, MoonUItoggleVariantsPro, OptimizedImage, MoonUIPaginationPro as Pagination, MoonUIPaginationContentPro as PaginationContent, MoonUIPaginationEllipsisPro as PaginationEllipsis, MoonUIPaginationItemPro as PaginationItem, MoonUIPaginationLinkPro as PaginationLink, MoonUIPaginationNextPro as PaginationNext, MoonUIPaginationPreviousPro as PaginationPrevious, PerformanceDebugger, PerformanceMonitor, PinchZoom, MoonUIPopoverPro as Popover, MoonUIPopoverContentPro as PopoverContent, MoonUIPopoverTriggerPro as PopoverTrigger, MoonUIProgressPro as Progress, MoonUIRadioGroupPro as RadioGroup, MoonUIRadioGroupContextPro as RadioGroupContext, MoonUIRadioGroupItemPro as RadioGroupItem, MoonUIRadioItemWithLabelPro as RadioItemWithLabel, MoonUIRadioLabelPro as RadioLabel, RichTextEditor, ScrollArea, ScrollBar, MoonUISelectPro as Select, MoonUISelectContentPro as SelectContent, MoonUISelectGroupPro as SelectGroup, MoonUISelectItemPro as SelectItem, MoonUISelectLabelPro as SelectLabel, MoonUISelectSeparatorPro as SelectSeparator, MoonUISelectTriggerPro as SelectTrigger, MoonUISelectValuePro as SelectValue, SelectableVirtualList, MoonUISeparatorPro as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, MoonUISkeletonPro as Skeleton, MoonUISliderPro as Slider, SpotlightCard, SwipeableCard, MoonUISwitchPro as Switch, MoonUITablePro as Table, MoonUITableBodyPro as TableBody, MoonUITableCaptionPro as TableCaption, MoonUITableCellPro as TableCell, MoonUITableFooterPro as TableFooter, MoonUITableHeadPro as TableHead, MoonUITableHeaderPro as TableHeader, MoonUITableRowPro as TableRow, MoonUITabsPro as Tabs, MoonUITabsContentPro as TabsContent, MoonUITabsListPro as TabsList, MoonUITabsTriggerPro as TabsTrigger, MoonUITextareaPro as Textarea, Timeline, MoonUIToastPro as Toast, MoonUITogglePro as Toggle, MoonUITooltipPro as Tooltip, MoonUITooltipContentPro as TooltipContent, MoonUITooltipProviderPro as TooltipProvider, MoonUITooltipTriggerPro as TooltipTrigger, VirtualList, MoonUIalertVariantsPro as alertVariants, animatedButtonVariants, MoonUIaspectRatioVariantsPro as aspectRatioVariants, moonUIBadgeVariantsPro as badgeVariants, MoonUIbreadcrumbVariantsPro as breadcrumbVariants, moonUIButtonProVariants as buttonVariants, cn, MoonUIcollapsibleContentVariantsPro as collapsibleContentVariants, MoonUIcollapsibleTriggerVariantsPro as collapsibleTriggerVariants, MoonUIcommandVariantsPro as commandVariants, getExpandableColumn, moonUIBadgeVariantsPro, moonUIButtonProVariants, moonUISeparatorVariantsPro, countries as phoneCountries, MoonUIradioGroupItemVariantsPro as radioGroupItemVariants, moonUISeparatorVariantsPro as separatorVariants, MoonUItableVariantsPro as tableVariants, MoonUItoggleVariantsPro as toggleVariants, useExpandableRows, useFormWizard, useStreamingData, useVirtualList };
|