@moontra/moonui-pro 2.0.23 → 2.1.1
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 +790 -0
- package/dist/index.mjs +554 -121
- package/package.json +1 -1
- package/scripts/postinstall.js +144 -66
- package/src/components/advanced-chart/index.tsx +3 -3
- package/src/components/advanced-forms/index.tsx +4 -9
- package/src/components/animated-button/index.tsx +4 -8
- package/src/components/calendar/index.tsx +1 -1
- package/src/components/color-picker/index.tsx +2 -4
- package/src/components/dashboard/index.tsx +3 -3
- package/src/components/data-table/index.tsx +5 -8
- package/src/components/enhanced/badge.tsx +191 -0
- package/src/components/enhanced/button.tsx +7 -5
- package/src/components/enhanced/card.tsx +11 -17
- package/src/components/enhanced/dialog.tsx +26 -28
- package/src/components/enhanced/index.ts +2 -1
- package/src/components/error-boundary/index.tsx +2 -4
- package/src/components/file-upload/index.tsx +3 -5
- package/src/components/floating-action-button/index.tsx +1 -4
- package/src/components/github-stars/index.tsx +4 -6
- package/src/components/health-check/index.tsx +5 -7
- package/src/components/hover-card-3d/index.tsx +3 -6
- package/src/components/kanban/index.tsx +4 -6
- package/src/components/lazy-component/index.tsx +4 -7
- package/src/components/magnetic-button/index.tsx +3 -6
- package/src/components/memory-efficient-data/index.tsx +6 -6
- package/src/components/optimized-image/index.tsx +4 -6
- package/src/components/performance-debugger/index.tsx +8 -10
- package/src/components/performance-monitor/index.tsx +37 -18
- package/src/components/pinch-zoom/index.tsx +2 -4
- package/src/components/rich-text-editor/index-old-backup.tsx +3 -9
- package/src/components/rich-text-editor/index.tsx +75 -10
- package/src/components/rich-text-editor/slash-commands-extension.ts +1 -1
- package/src/components/spotlight-card/index.tsx +1 -4
- package/src/components/swipeable-card/index.tsx +1 -1
- package/src/components/timeline/index.tsx +2 -2
- package/src/components/ui/color-picker.tsx +1 -1
- package/src/components/ui/index.ts +2 -0
- package/src/components/ui/progress.tsx +27 -0
- package/src/components/ui/skeleton.tsx +17 -0
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/components/virtual-list/index.tsx +3 -4
- package/src/hooks/use-chart.ts +2 -2
- package/src/patterns/login-form/types.ts +6 -6
- package/src/use-pro-access.ts +2 -2
- package/src/utils/chart-helpers.ts +1 -1
|
@@ -84,12 +84,11 @@ const HoverCard3DInternal = React.forwardRef<HTMLDivElement, HoverCard3DProps>(
|
|
|
84
84
|
transformStyle: "preserve-3d",
|
|
85
85
|
}}
|
|
86
86
|
animate={{
|
|
87
|
-
rotateX: isHovered ? rotateX : 0,
|
|
88
|
-
rotateY: isHovered ? rotateY : 0,
|
|
87
|
+
rotateX: isHovered ? rotateX.get() : 0,
|
|
88
|
+
rotateY: isHovered ? rotateY.get() : 0,
|
|
89
89
|
scale: isHovered ? 1.05 : 1,
|
|
90
90
|
}}
|
|
91
91
|
transition={{ duration: 0.15 }}
|
|
92
|
-
{...props}
|
|
93
92
|
>
|
|
94
93
|
<motion.div
|
|
95
94
|
className="relative z-10"
|
|
@@ -130,14 +129,12 @@ HoverCard3DInternal.displayName = "HoverCard3DInternal"
|
|
|
130
129
|
export const HoverCard3D = React.forwardRef<HTMLDivElement, HoverCard3DProps>(
|
|
131
130
|
({ className, ...props }, ref) => {
|
|
132
131
|
// Check if we're in docs mode or have pro access
|
|
133
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
134
132
|
const { hasProAccess, isLoading } = useSubscription()
|
|
135
133
|
|
|
136
134
|
// In docs mode, always show the component
|
|
137
|
-
const canShowComponent = docsProAccess.isDocsMode || hasProAccess
|
|
138
135
|
|
|
139
136
|
// If not in docs mode and no pro access, show upgrade prompt
|
|
140
|
-
if (!
|
|
137
|
+
if (!isLoading && !hasProAccess) {
|
|
141
138
|
return (
|
|
142
139
|
<Card className={cn("w-fit", className)}>
|
|
143
140
|
<CardContent className="py-6 text-center">
|
|
@@ -22,7 +22,7 @@ import { cn } from '../../lib/utils'
|
|
|
22
22
|
// Note: DocsProAccess should be handled by consuming application
|
|
23
23
|
import { useSubscription } from '../../hooks/use-subscription'
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface KanbanCard {
|
|
26
26
|
id: string
|
|
27
27
|
title: string
|
|
28
28
|
description?: string
|
|
@@ -39,7 +39,7 @@ export interface KanbanCard {
|
|
|
39
39
|
completed?: boolean
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
interface KanbanColumn {
|
|
43
43
|
id: string
|
|
44
44
|
title: string
|
|
45
45
|
color?: string
|
|
@@ -47,7 +47,7 @@ export interface KanbanColumn {
|
|
|
47
47
|
limit?: number
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
interface KanbanProps {
|
|
51
51
|
columns: KanbanColumn[]
|
|
52
52
|
onCardMove?: (cardId: string, fromColumn: string, toColumn: string, newIndex: number) => void
|
|
53
53
|
onCardClick?: (card: KanbanCard) => void
|
|
@@ -89,14 +89,12 @@ export function Kanban({
|
|
|
89
89
|
disabled = false
|
|
90
90
|
}: KanbanProps) {
|
|
91
91
|
// Check if we're in docs mode or have pro access
|
|
92
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
93
92
|
const { hasProAccess, isLoading } = useSubscription()
|
|
94
93
|
|
|
95
94
|
// In docs mode, always show the component
|
|
96
|
-
const canShowComponent = docsProAccess.isDocsMode || hasProAccess
|
|
97
95
|
|
|
98
96
|
// If not in docs mode and no pro access, show upgrade prompt
|
|
99
|
-
if (!
|
|
97
|
+
if (!isLoading && !hasProAccess) {
|
|
100
98
|
return (
|
|
101
99
|
<Card className={cn("w-full", className)}>
|
|
102
100
|
<CardContent className="py-12 text-center">
|
|
@@ -4,12 +4,12 @@ import React, { useState, useEffect, useRef, Suspense } from "react"
|
|
|
4
4
|
import { motion } from "framer-motion"
|
|
5
5
|
import { Card, CardContent } from "../ui/card"
|
|
6
6
|
import { Button } from "../ui/button"
|
|
7
|
-
import { Skeleton } from "
|
|
7
|
+
import { Skeleton } from "../ui/skeleton"
|
|
8
8
|
import { cn } from "../../lib/utils"
|
|
9
9
|
import { Eye, Loader2, Lock, Sparkles, RefreshCw } from "lucide-react"
|
|
10
10
|
import { useSubscription } from "../../hooks/use-subscription"
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
interface LazyComponentProps {
|
|
13
13
|
children: React.ReactNode
|
|
14
14
|
fallback?: React.ReactNode
|
|
15
15
|
threshold?: number
|
|
@@ -216,7 +216,6 @@ export const LazyImage: React.FC<LazyImageProps> = ({
|
|
|
216
216
|
animate={{ opacity: 1 }}
|
|
217
217
|
transition={{ duration: 0.3 }}
|
|
218
218
|
className="w-full h-full object-cover"
|
|
219
|
-
{...props}
|
|
220
219
|
/>
|
|
221
220
|
) : showPlaceholder ? (
|
|
222
221
|
<Skeleton className="w-full h-full min-h-32" />
|
|
@@ -303,14 +302,12 @@ export function LazyList<T>({
|
|
|
303
302
|
|
|
304
303
|
export const LazyComponent: React.FC<LazyComponentProps> = ({ className, ...props }) => {
|
|
305
304
|
// Check if we're in docs mode or have pro access
|
|
306
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
307
305
|
const { hasProAccess, isLoading } = useSubscription()
|
|
308
306
|
|
|
309
307
|
// In docs mode, always show the component
|
|
310
|
-
const canShowComponent = docsProAccess.isDocsMode || hasProAccess
|
|
311
308
|
|
|
312
309
|
// If not in docs mode and no pro access, show upgrade prompt
|
|
313
|
-
if (!
|
|
310
|
+
if (!isLoading && !hasProAccess) {
|
|
314
311
|
return (
|
|
315
312
|
<Card className={cn("w-fit", className)}>
|
|
316
313
|
<CardContent className="py-6 text-center">
|
|
@@ -339,4 +336,4 @@ export const LazyComponent: React.FC<LazyComponentProps> = ({ className, ...prop
|
|
|
339
336
|
return <LazyComponentInternal className={className} {...props} />
|
|
340
337
|
}
|
|
341
338
|
|
|
342
|
-
|
|
339
|
+
// Export types removed to fix conflict
|
|
@@ -95,11 +95,10 @@ const MagneticButtonInternal = React.forwardRef<HTMLButtonElement, MagneticButto
|
|
|
95
95
|
whileHover={{ scale: 1.05 }}
|
|
96
96
|
whileTap={{ scale: 0.95 }}
|
|
97
97
|
animate={{
|
|
98
|
-
rotateX: isHovered ? rotateX : 0,
|
|
99
|
-
rotateY: isHovered ? rotateY : 0,
|
|
98
|
+
rotateX: isHovered ? rotateX.get() : 0,
|
|
99
|
+
rotateY: isHovered ? rotateY.get() : 0,
|
|
100
100
|
}}
|
|
101
101
|
transition={{ duration: 0.3 }}
|
|
102
|
-
{...props}
|
|
103
102
|
>
|
|
104
103
|
<motion.div
|
|
105
104
|
className="relative z-10"
|
|
@@ -130,14 +129,12 @@ MagneticButtonInternal.displayName = "MagneticButtonInternal"
|
|
|
130
129
|
export const MagneticButton = React.forwardRef<HTMLButtonElement, MagneticButtonProps>(
|
|
131
130
|
({ className, ...props }, ref) => {
|
|
132
131
|
// Check if we're in docs mode or have pro access
|
|
133
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
134
132
|
const { hasProAccess, isLoading } = useSubscription()
|
|
135
133
|
|
|
136
134
|
// In docs mode, always show the component
|
|
137
|
-
const canShowComponent = docsProAccess.isDocsMode || hasProAccess
|
|
138
135
|
|
|
139
136
|
// If not in docs mode and no pro access, show upgrade prompt
|
|
140
|
-
if (!
|
|
137
|
+
if (!isLoading && !hasProAccess) {
|
|
141
138
|
return (
|
|
142
139
|
<Card className={cn("w-fit", className)}>
|
|
143
140
|
<CardContent className="py-6 text-center">
|
|
@@ -4,7 +4,7 @@ import React, { useMemo, useCallback, useState, useEffect, useRef } from 'react'
|
|
|
4
4
|
import { cn } from '../../lib/utils'
|
|
5
5
|
|
|
6
6
|
// Memory konfigürasyonu için tip tanımları
|
|
7
|
-
|
|
7
|
+
interface MemoryConfig {
|
|
8
8
|
chunkSize?: number
|
|
9
9
|
maxMemoryItems?: number
|
|
10
10
|
cacheStrategy?: 'lru' | 'fifo' | 'lfu'
|
|
@@ -17,7 +17,7 @@ export interface MemoryConfig {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// Memory istatistikleri için tip tanımı
|
|
20
|
-
|
|
20
|
+
interface MemoryStats {
|
|
21
21
|
memoryUsage: number
|
|
22
22
|
itemCount: number
|
|
23
23
|
cacheHitRate: number
|
|
@@ -108,7 +108,7 @@ class MemoryCache<T> {
|
|
|
108
108
|
|
|
109
109
|
case 'fifo':
|
|
110
110
|
// İlk gireni sil
|
|
111
|
-
keyToDelete = this.cache.keys().next().value
|
|
111
|
+
keyToDelete = this.cache.keys().next().value || null
|
|
112
112
|
break
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -161,7 +161,7 @@ export function MemoryEfficientData<T = any>({
|
|
|
161
161
|
// Refs
|
|
162
162
|
const containerRef = useRef<HTMLDivElement>(null)
|
|
163
163
|
const cacheRef = useRef(new MemoryCache<T>(Math.floor(maxMemoryItems / chunkSize), cacheStrategy))
|
|
164
|
-
const scrollTimeoutRef = useRef<NodeJS.Timeout>()
|
|
164
|
+
const scrollTimeoutRef = useRef<NodeJS.Timeout | undefined>(undefined)
|
|
165
165
|
|
|
166
166
|
// Visible data'yı memoize et
|
|
167
167
|
const visibleData = useMemo(() => {
|
|
@@ -277,7 +277,7 @@ export function MemoryEfficientData<T = any>({
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
// Memory Analytics Component
|
|
280
|
-
|
|
280
|
+
interface MemoryAnalyticsProps {
|
|
281
281
|
onStatsUpdate?: (stats: MemoryStats) => void
|
|
282
282
|
showRealTime?: boolean
|
|
283
283
|
className?: string
|
|
@@ -349,4 +349,4 @@ export function useStreamingData<T>(
|
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
// Export types
|
|
352
|
-
export type { MemoryConfig, MemoryStats,
|
|
352
|
+
export type { MemoryConfig, MemoryStats, MemoryAnalyticsProps }
|
|
@@ -5,7 +5,7 @@ import { motion, AnimatePresence } from "framer-motion"
|
|
|
5
5
|
import { Card, CardContent } from "../ui/card"
|
|
6
6
|
import { Button } from "../ui/button"
|
|
7
7
|
import { Badge } from "../ui/badge"
|
|
8
|
-
import { Skeleton } from "
|
|
8
|
+
import { Skeleton } from "../ui/skeleton"
|
|
9
9
|
import { cn } from "../../lib/utils"
|
|
10
10
|
import {
|
|
11
11
|
Image as ImageIcon,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "lucide-react"
|
|
24
24
|
import { useSubscription } from "../../hooks/use-subscription"
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
interface OptimizedImageProps {
|
|
27
27
|
src: string
|
|
28
28
|
alt: string
|
|
29
29
|
width?: number
|
|
@@ -83,7 +83,7 @@ const OptimizedImageInternal: React.FC<OptimizedImageProps> = ({
|
|
|
83
83
|
const [showImageInfo, setShowImageInfo] = useState(false)
|
|
84
84
|
|
|
85
85
|
const imgRef = useRef<HTMLImageElement>(null)
|
|
86
|
-
const previewRef = useRef<
|
|
86
|
+
const previewRef = useRef<HTMLImageElement>(null)
|
|
87
87
|
|
|
88
88
|
// Generate optimized image URL
|
|
89
89
|
const getOptimizedSrc = (originalSrc: string, options: {
|
|
@@ -388,14 +388,12 @@ const OptimizedImageInternal: React.FC<OptimizedImageProps> = ({
|
|
|
388
388
|
|
|
389
389
|
export const OptimizedImage: React.FC<OptimizedImageProps> = ({ className, ...props }) => {
|
|
390
390
|
// Check if we're in docs mode or have pro access
|
|
391
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
392
391
|
const { hasProAccess, isLoading } = useSubscription()
|
|
393
392
|
|
|
394
393
|
// In docs mode, always show the component
|
|
395
|
-
const canShowComponent = docsProAccess.isDocsMode || hasProAccess
|
|
396
394
|
|
|
397
395
|
// If not in docs mode and no pro access, show upgrade prompt
|
|
398
|
-
if (!
|
|
396
|
+
if (!isLoading && !hasProAccess) {
|
|
399
397
|
return (
|
|
400
398
|
<Card className={cn("w-fit", className)}>
|
|
401
399
|
<CardContent className="py-6 text-center">
|
|
@@ -5,7 +5,7 @@ import { motion, AnimatePresence } from "framer-motion"
|
|
|
5
5
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../ui/card"
|
|
6
6
|
import { Button } from "../ui/button"
|
|
7
7
|
import { Badge } from "../ui/badge"
|
|
8
|
-
import { Progress } from "
|
|
8
|
+
import { Progress } from "../ui/progress"
|
|
9
9
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"
|
|
10
10
|
import { cn } from "../../lib/utils"
|
|
11
11
|
import {
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "lucide-react"
|
|
30
30
|
import { useSubscription } from "../../hooks/use-subscription"
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
interface PerformanceMetric {
|
|
33
33
|
name: string
|
|
34
34
|
value: number
|
|
35
35
|
unit: string
|
|
@@ -40,14 +40,14 @@ export interface PerformanceMetric {
|
|
|
40
40
|
description?: string
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
interface PerformanceEntry {
|
|
44
44
|
timestamp: number
|
|
45
45
|
metrics: PerformanceMetric[]
|
|
46
46
|
url: string
|
|
47
47
|
userAgent: string
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
interface PerformanceDebuggerProps {
|
|
51
51
|
autoCapture?: boolean
|
|
52
52
|
captureInterval?: number
|
|
53
53
|
maxEntries?: number
|
|
@@ -74,7 +74,7 @@ const PerformanceDebuggerInternal: React.FC<PerformanceDebuggerProps> = ({
|
|
|
74
74
|
const [currentMetrics, setCurrentMetrics] = useState<PerformanceMetric[]>([])
|
|
75
75
|
const [isCapturing, setIsCapturing] = useState(autoCapture)
|
|
76
76
|
const [isVisible, setIsVisible] = useState(true)
|
|
77
|
-
const intervalRef = useRef<NodeJS.Timeout>()
|
|
77
|
+
const intervalRef = useRef<NodeJS.Timeout | undefined>(undefined)
|
|
78
78
|
|
|
79
79
|
// Core Web Vitals thresholds
|
|
80
80
|
const webVitalsThresholds = {
|
|
@@ -115,7 +115,7 @@ const PerformanceDebuggerInternal: React.FC<PerformanceDebuggerProps> = ({
|
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
name: 'DOM Processing',
|
|
118
|
-
value: nav.domComplete - nav.
|
|
118
|
+
value: nav.domComplete - (nav.domInteractive || nav.fetchStart),
|
|
119
119
|
unit: 'ms',
|
|
120
120
|
description: 'Time to process DOM'
|
|
121
121
|
},
|
|
@@ -362,7 +362,7 @@ const PerformanceDebuggerInternal: React.FC<PerformanceDebuggerProps> = ({
|
|
|
362
362
|
</div>
|
|
363
363
|
|
|
364
364
|
<div className="flex items-center gap-2">
|
|
365
|
-
<Badge variant={isCapturing ? "
|
|
365
|
+
<Badge variant={isCapturing ? "secondary" : "secondary"} className="gap-1">
|
|
366
366
|
{isCapturing ? <Activity className="h-3 w-3 animate-pulse" /> : <Clock className="h-3 w-3" />}
|
|
367
367
|
{isCapturing ? "Live" : "Paused"}
|
|
368
368
|
</Badge>
|
|
@@ -552,14 +552,12 @@ const PerformanceDebuggerInternal: React.FC<PerformanceDebuggerProps> = ({
|
|
|
552
552
|
|
|
553
553
|
export const PerformanceDebugger: React.FC<PerformanceDebuggerProps> = ({ className, ...props }) => {
|
|
554
554
|
// Check if we're in docs mode or have pro access
|
|
555
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
556
555
|
const { hasProAccess, isLoading } = useSubscription()
|
|
557
556
|
|
|
558
557
|
// In docs mode, always show the component
|
|
559
|
-
const canShowComponent = docsProAccess.isDocsMode || hasProAccess
|
|
560
558
|
|
|
561
559
|
// If not in docs mode and no pro access, show upgrade prompt
|
|
562
|
-
if (!
|
|
560
|
+
if (!isLoading && !hasProAccess) {
|
|
563
561
|
return (
|
|
564
562
|
<Card className={cn("w-fit", className)}>
|
|
565
563
|
<CardContent className="py-6 text-center">
|
|
@@ -5,7 +5,6 @@ import { motion, AnimatePresence } from "framer-motion"
|
|
|
5
5
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../ui/card"
|
|
6
6
|
import { Button } from "../ui/button"
|
|
7
7
|
import { Badge } from "../ui/badge"
|
|
8
|
-
import { Progress } from "@moontra/moonui"
|
|
9
8
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"
|
|
10
9
|
import { cn } from "../../lib/utils"
|
|
11
10
|
import {
|
|
@@ -32,7 +31,7 @@ import {
|
|
|
32
31
|
} from "lucide-react"
|
|
33
32
|
import { useSubscription } from "../../hooks/use-subscription"
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
interface PerformanceMetrics {
|
|
36
35
|
cpu: {
|
|
37
36
|
usage: number
|
|
38
37
|
cores: number
|
|
@@ -67,7 +66,7 @@ export interface PerformanceMetrics {
|
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
interface PerformanceAlert {
|
|
71
70
|
id: string
|
|
72
71
|
type: "warning" | "critical" | "info"
|
|
73
72
|
metric: string
|
|
@@ -77,7 +76,7 @@ export interface PerformanceAlert {
|
|
|
77
76
|
timestamp: Date
|
|
78
77
|
}
|
|
79
78
|
|
|
80
|
-
|
|
79
|
+
interface PerformanceMonitorProps {
|
|
81
80
|
autoRefresh?: boolean
|
|
82
81
|
refreshInterval?: number
|
|
83
82
|
showAlerts?: boolean
|
|
@@ -117,7 +116,7 @@ const PerformanceMonitorInternal: React.FC<PerformanceMonitorProps> = ({
|
|
|
117
116
|
const [alerts, setAlerts] = useState<PerformanceAlert[]>([])
|
|
118
117
|
const [isVisible, setIsVisible] = useState(true)
|
|
119
118
|
const [isRefreshing, setIsRefreshing] = useState(false)
|
|
120
|
-
const intervalRef = useRef<NodeJS.Timeout>()
|
|
119
|
+
const intervalRef = useRef<NodeJS.Timeout | undefined>(undefined)
|
|
121
120
|
|
|
122
121
|
const generateMockMetrics = useCallback((): PerformanceMetrics => {
|
|
123
122
|
const baseMetrics = metrics || {
|
|
@@ -365,7 +364,7 @@ const PerformanceMonitorInternal: React.FC<PerformanceMonitorProps> = ({
|
|
|
365
364
|
</div>
|
|
366
365
|
|
|
367
366
|
<div className="flex items-center gap-2">
|
|
368
|
-
<Badge variant={autoRefresh ? "
|
|
367
|
+
<Badge variant={autoRefresh ? "outline" : "secondary"} className="gap-1">
|
|
369
368
|
{autoRefresh ? <Activity className="h-3 w-3 animate-pulse" /> : <Timer className="h-3 w-3" />}
|
|
370
369
|
{autoRefresh ? "Live" : "Paused"}
|
|
371
370
|
</Badge>
|
|
@@ -428,7 +427,12 @@ const PerformanceMonitorInternal: React.FC<PerformanceMonitorProps> = ({
|
|
|
428
427
|
{metrics.cpu.usage.toFixed(1)}%
|
|
429
428
|
</span>
|
|
430
429
|
</div>
|
|
431
|
-
<
|
|
430
|
+
<div className="h-2 mt-2 bg-secondary rounded-full overflow-hidden">
|
|
431
|
+
<div
|
|
432
|
+
className="h-full bg-primary transition-all duration-300 ease-out"
|
|
433
|
+
style={{ width: `${metrics.cpu.usage}%` }}
|
|
434
|
+
/>
|
|
435
|
+
</div>
|
|
432
436
|
<div className="text-xs text-muted-foreground mt-1">
|
|
433
437
|
{metrics.cpu.cores} cores {metrics.cpu.temperature && `• ${metrics.cpu.temperature.toFixed(0)}°C`}
|
|
434
438
|
</div>
|
|
@@ -446,7 +450,12 @@ const PerformanceMonitorInternal: React.FC<PerformanceMonitorProps> = ({
|
|
|
446
450
|
{metrics.memory.percentage.toFixed(1)}%
|
|
447
451
|
</span>
|
|
448
452
|
</div>
|
|
449
|
-
<
|
|
453
|
+
<div className="h-2 mt-2 bg-secondary rounded-full overflow-hidden">
|
|
454
|
+
<div
|
|
455
|
+
className="h-full bg-primary transition-all duration-300 ease-out"
|
|
456
|
+
style={{ width: `${metrics.memory.percentage}%` }}
|
|
457
|
+
/>
|
|
458
|
+
</div>
|
|
450
459
|
<div className="text-xs text-muted-foreground mt-1">
|
|
451
460
|
{formatBytes(metrics.memory.used * 1024 * 1024 * 1024)} / {formatBytes(metrics.memory.total * 1024 * 1024 * 1024)}
|
|
452
461
|
</div>
|
|
@@ -464,7 +473,12 @@ const PerformanceMonitorInternal: React.FC<PerformanceMonitorProps> = ({
|
|
|
464
473
|
{metrics.disk.percentage.toFixed(1)}%
|
|
465
474
|
</span>
|
|
466
475
|
</div>
|
|
467
|
-
<
|
|
476
|
+
<div className="h-2 mt-2 bg-secondary rounded-full overflow-hidden">
|
|
477
|
+
<div
|
|
478
|
+
className="h-full bg-primary transition-all duration-300 ease-out"
|
|
479
|
+
style={{ width: `${metrics.disk.percentage}%` }}
|
|
480
|
+
/>
|
|
481
|
+
</div>
|
|
468
482
|
<div className="text-xs text-muted-foreground mt-1">
|
|
469
483
|
{formatBytes(metrics.disk.used * 1024 * 1024 * 1024)} / {formatBytes(metrics.disk.total * 1024 * 1024 * 1024)}
|
|
470
484
|
</div>
|
|
@@ -553,7 +567,12 @@ const PerformanceMonitorInternal: React.FC<PerformanceMonitorProps> = ({
|
|
|
553
567
|
<span>Usage</span>
|
|
554
568
|
<span className={getStatusColor(metrics.cpu.usage)}>{metrics.cpu.usage.toFixed(1)}%</span>
|
|
555
569
|
</div>
|
|
556
|
-
<
|
|
570
|
+
<div className="h-2 bg-secondary rounded-full overflow-hidden">
|
|
571
|
+
<div
|
|
572
|
+
className="h-full bg-primary transition-all duration-300 ease-out"
|
|
573
|
+
style={{ width: `${metrics.cpu.usage}%` }}
|
|
574
|
+
/>
|
|
575
|
+
</div>
|
|
557
576
|
</div>
|
|
558
577
|
<div className="grid grid-cols-2 gap-4 text-sm">
|
|
559
578
|
<div>
|
|
@@ -584,7 +603,12 @@ const PerformanceMonitorInternal: React.FC<PerformanceMonitorProps> = ({
|
|
|
584
603
|
<span>Usage</span>
|
|
585
604
|
<span className={getStatusColor(metrics.memory.percentage)}>{metrics.memory.percentage.toFixed(1)}%</span>
|
|
586
605
|
</div>
|
|
587
|
-
<
|
|
606
|
+
<div className="h-2 bg-secondary rounded-full overflow-hidden">
|
|
607
|
+
<div
|
|
608
|
+
className="h-full bg-primary transition-all duration-300 ease-out"
|
|
609
|
+
style={{ width: `${metrics.memory.percentage}%` }}
|
|
610
|
+
/>
|
|
611
|
+
</div>
|
|
588
612
|
</div>
|
|
589
613
|
<div className="space-y-2 text-sm">
|
|
590
614
|
<div className="flex justify-between">
|
|
@@ -735,15 +759,10 @@ const PerformanceMonitorInternal: React.FC<PerformanceMonitorProps> = ({
|
|
|
735
759
|
}
|
|
736
760
|
|
|
737
761
|
export const PerformanceMonitor: React.FC<PerformanceMonitorProps> = ({ className, ...props }) => {
|
|
738
|
-
// Check if we're in docs mode or have pro access
|
|
739
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
740
762
|
const { hasProAccess, isLoading } = useSubscription()
|
|
741
763
|
|
|
742
|
-
//
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
// If not in docs mode and no pro access, show upgrade prompt
|
|
746
|
-
if (!docsProAccess.isDocsMode && !isLoading && !hasProAccess) {
|
|
764
|
+
// If no pro access, show upgrade prompt
|
|
765
|
+
if (!isLoading && !hasProAccess) {
|
|
747
766
|
return (
|
|
748
767
|
<Card className={cn("w-fit", className)}>
|
|
749
768
|
<CardContent className="py-6 text-center">
|
|
@@ -8,7 +8,7 @@ import { Button } from "../ui/button"
|
|
|
8
8
|
import { Lock, Sparkles } from "lucide-react"
|
|
9
9
|
import { useSubscription } from "../../hooks/use-subscription"
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface PinchZoomProps {
|
|
12
12
|
children: React.ReactNode
|
|
13
13
|
minZoom?: number
|
|
14
14
|
maxZoom?: number
|
|
@@ -132,14 +132,12 @@ PinchZoomInternal.displayName = "PinchZoomInternal"
|
|
|
132
132
|
export const PinchZoom = React.forwardRef<HTMLDivElement, PinchZoomProps>(
|
|
133
133
|
({ className, ...props }, ref) => {
|
|
134
134
|
// Check if we're in docs mode or have pro access
|
|
135
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
136
135
|
const { hasProAccess, isLoading } = useSubscription()
|
|
137
136
|
|
|
138
137
|
// In docs mode, always show the component
|
|
139
|
-
const canShowComponent = docsProAccess.isDocsMode || hasProAccess
|
|
140
138
|
|
|
141
139
|
// If not in docs mode and no pro access, show upgrade prompt
|
|
142
|
-
if (!
|
|
140
|
+
if (!isLoading && !hasProAccess) {
|
|
143
141
|
return (
|
|
144
142
|
<Card className={cn("w-fit", className)}>
|
|
145
143
|
<CardContent className="py-6 text-center">
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"use client"
|
|
6
6
|
|
|
7
7
|
import React from 'react'
|
|
8
|
-
import { useDocsProAccess } from '@/components/docs/docs-pro-provider'
|
|
9
8
|
import { useSubscription } from '../../hooks/use-subscription'
|
|
10
9
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from './card'
|
|
11
10
|
import { Button } from './button'
|
|
@@ -30,7 +29,7 @@ import {
|
|
|
30
29
|
} from 'lucide-react'
|
|
31
30
|
import { cn } from '../../lib/utils'
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
interface OldRichTextEditorProps {
|
|
34
33
|
value?: string
|
|
35
34
|
onChange?: (value: string) => void
|
|
36
35
|
placeholder?: string
|
|
@@ -72,15 +71,10 @@ export function OldRichTextEditor({
|
|
|
72
71
|
features = {},
|
|
73
72
|
height
|
|
74
73
|
}: OldRichTextEditorProps) {
|
|
75
|
-
// Check if we're in docs mode or have pro access
|
|
76
|
-
const docsProAccess = useDocsProAccess()
|
|
77
74
|
const { hasProAccess, isLoading } = useSubscription()
|
|
78
75
|
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// If not in docs mode and no pro access, show upgrade prompt
|
|
83
|
-
if (!docsProAccess.isDocsMode && !isLoading && !hasProAccess) {
|
|
76
|
+
// If no pro access, show upgrade prompt
|
|
77
|
+
if (!isLoading && !hasProAccess) {
|
|
84
78
|
return (
|
|
85
79
|
<Card className={cn("w-full", className)}>
|
|
86
80
|
<CardContent className="py-12 text-center">
|