@moontra/moonui-pro 2.20.2 → 2.20.4

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.
Files changed (153) hide show
  1. package/package.json +8 -3
  2. package/plugin/index.d.ts +86 -0
  3. package/plugin/index.js +308 -0
  4. package/scripts/postinstall.js +191 -23
  5. package/src/components/advanced-chart/index.tsx +0 -1246
  6. package/src/components/advanced-forms/index.tsx +0 -585
  7. package/src/components/animated-button/index.tsx +0 -385
  8. package/src/components/calendar/event-dialog.tsx +0 -377
  9. package/src/components/calendar/index.tsx +0 -1220
  10. package/src/components/calendar-pro/index.tsx +0 -1697
  11. package/src/components/color-picker/index.tsx +0 -432
  12. package/src/components/credit-card-input/index.tsx +0 -406
  13. package/src/components/dashboard/dashboard-grid.tsx +0 -480
  14. package/src/components/dashboard/demo.tsx +0 -425
  15. package/src/components/dashboard/index.tsx +0 -1046
  16. package/src/components/dashboard/time-range-picker.tsx +0 -336
  17. package/src/components/dashboard/types.ts +0 -225
  18. package/src/components/dashboard/widgets/activity-feed.tsx +0 -349
  19. package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
  20. package/src/components/dashboard/widgets/comparison-widget.tsx +0 -177
  21. package/src/components/dashboard/widgets/index.ts +0 -5
  22. package/src/components/dashboard/widgets/metric-card.tsx +0 -363
  23. package/src/components/dashboard/widgets/progress-widget.tsx +0 -113
  24. package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
  25. package/src/components/data-table/data-table-column-toggle.tsx +0 -169
  26. package/src/components/data-table/data-table-export.ts +0 -156
  27. package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
  28. package/src/components/data-table/index.tsx +0 -845
  29. package/src/components/draggable-list/index.tsx +0 -100
  30. package/src/components/error-boundary/index.tsx +0 -232
  31. package/src/components/file-upload/index.tsx +0 -1660
  32. package/src/components/floating-action-button/index.tsx +0 -206
  33. package/src/components/form-wizard/form-wizard-context.tsx +0 -335
  34. package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
  35. package/src/components/form-wizard/form-wizard-progress.tsx +0 -329
  36. package/src/components/form-wizard/form-wizard-step.tsx +0 -111
  37. package/src/components/form-wizard/index.tsx +0 -102
  38. package/src/components/form-wizard/types.ts +0 -77
  39. package/src/components/gesture-drawer/index.tsx +0 -551
  40. package/src/components/github-stars/github-api.ts +0 -426
  41. package/src/components/github-stars/hooks.ts +0 -517
  42. package/src/components/github-stars/index.tsx +0 -375
  43. package/src/components/github-stars/types.ts +0 -148
  44. package/src/components/github-stars/variants.tsx +0 -515
  45. package/src/components/health-check/index.tsx +0 -439
  46. package/src/components/hover-card-3d/index.tsx +0 -529
  47. package/src/components/index.ts +0 -130
  48. package/src/components/internal/index.ts +0 -78
  49. package/src/components/kanban/add-card-modal.tsx +0 -502
  50. package/src/components/kanban/card-detail-modal.tsx +0 -761
  51. package/src/components/kanban/index.ts +0 -13
  52. package/src/components/kanban/kanban.tsx +0 -1689
  53. package/src/components/kanban/types.ts +0 -168
  54. package/src/components/lazy-component/index.tsx +0 -823
  55. package/src/components/license-error/index.tsx +0 -31
  56. package/src/components/magnetic-button/index.tsx +0 -216
  57. package/src/components/memory-efficient-data/index.tsx +0 -1018
  58. package/src/components/moonui-quiz-form/index.tsx +0 -817
  59. package/src/components/navbar/index.tsx +0 -781
  60. package/src/components/optimized-image/index.tsx +0 -425
  61. package/src/components/performance-debugger/index.tsx +0 -613
  62. package/src/components/performance-monitor/index.tsx +0 -808
  63. package/src/components/phone-number-input/index.tsx +0 -343
  64. package/src/components/phone-number-input/phone-number-input-simple.tsx +0 -167
  65. package/src/components/pinch-zoom/index.tsx +0 -566
  66. package/src/components/quiz-form/index.tsx +0 -479
  67. package/src/components/rich-text-editor/index.tsx +0 -2322
  68. package/src/components/rich-text-editor/slash-commands-extension.ts +0 -230
  69. package/src/components/rich-text-editor/slash-commands.css +0 -35
  70. package/src/components/rich-text-editor/table-styles.css +0 -65
  71. package/src/components/sidebar/index.tsx +0 -884
  72. package/src/components/spotlight-card/index.tsx +0 -191
  73. package/src/components/swipeable-card/index.tsx +0 -100
  74. package/src/components/timeline/index.tsx +0 -1183
  75. package/src/components/ui/accordion.tsx +0 -581
  76. package/src/components/ui/alert-dialog.tsx +0 -141
  77. package/src/components/ui/alert.tsx +0 -141
  78. package/src/components/ui/aspect-ratio.tsx +0 -245
  79. package/src/components/ui/avatar.tsx +0 -155
  80. package/src/components/ui/badge.tsx +0 -230
  81. package/src/components/ui/breadcrumb.tsx +0 -216
  82. package/src/components/ui/button.tsx +0 -228
  83. package/src/components/ui/calendar.tsx +0 -387
  84. package/src/components/ui/card.tsx +0 -216
  85. package/src/components/ui/checkbox.tsx +0 -259
  86. package/src/components/ui/collapsible.tsx +0 -631
  87. package/src/components/ui/color-picker.tsx +0 -97
  88. package/src/components/ui/command.tsx +0 -948
  89. package/src/components/ui/dialog.tsx +0 -752
  90. package/src/components/ui/dropdown-menu.tsx +0 -706
  91. package/src/components/ui/gesture-drawer.tsx +0 -11
  92. package/src/components/ui/hover-card.tsx +0 -29
  93. package/src/components/ui/index.ts +0 -222
  94. package/src/components/ui/input.tsx +0 -224
  95. package/src/components/ui/label.tsx +0 -29
  96. package/src/components/ui/lightbox.tsx +0 -606
  97. package/src/components/ui/magnetic-button.tsx +0 -129
  98. package/src/components/ui/media-gallery.tsx +0 -611
  99. package/src/components/ui/navigation-menu.tsx +0 -130
  100. package/src/components/ui/pagination.tsx +0 -125
  101. package/src/components/ui/popover.tsx +0 -185
  102. package/src/components/ui/progress.tsx +0 -30
  103. package/src/components/ui/radio-group.tsx +0 -257
  104. package/src/components/ui/scroll-area.tsx +0 -47
  105. package/src/components/ui/select.tsx +0 -378
  106. package/src/components/ui/separator.tsx +0 -145
  107. package/src/components/ui/sheet.tsx +0 -139
  108. package/src/components/ui/skeleton.tsx +0 -20
  109. package/src/components/ui/slider.tsx +0 -354
  110. package/src/components/ui/spotlight-card.tsx +0 -119
  111. package/src/components/ui/switch.tsx +0 -86
  112. package/src/components/ui/table.tsx +0 -331
  113. package/src/components/ui/tabs-pro.tsx +0 -542
  114. package/src/components/ui/tabs.tsx +0 -54
  115. package/src/components/ui/textarea.tsx +0 -28
  116. package/src/components/ui/toast.tsx +0 -317
  117. package/src/components/ui/toggle.tsx +0 -119
  118. package/src/components/ui/tooltip.tsx +0 -151
  119. package/src/components/virtual-list/index.tsx +0 -668
  120. package/src/hooks/use-chart.ts +0 -205
  121. package/src/hooks/use-data-table.ts +0 -182
  122. package/src/hooks/use-docs-pro-access.ts +0 -13
  123. package/src/hooks/use-license-check.ts +0 -65
  124. package/src/hooks/use-subscription.ts +0 -19
  125. package/src/hooks/use-toast.ts +0 -15
  126. package/src/index.ts +0 -22
  127. package/src/lib/ai-providers.ts +0 -377
  128. package/src/lib/component-metadata.ts +0 -18
  129. package/src/lib/micro-interactions.ts +0 -255
  130. package/src/lib/paddle.ts +0 -17
  131. package/src/lib/utils.ts +0 -6
  132. package/src/patterns/login-form/index.tsx +0 -276
  133. package/src/patterns/login-form/types.ts +0 -67
  134. package/src/setupTests.ts +0 -41
  135. package/src/styles/advanced-chart.css +0 -239
  136. package/src/styles/calendar.css +0 -35
  137. package/src/styles/design-system.css +0 -363
  138. package/src/styles/index.css +0 -681
  139. package/src/styles/tailwind.css +0 -7
  140. package/src/styles/tokens.css +0 -455
  141. package/src/types/next-auth.d.ts +0 -21
  142. package/src/use-intersection-observer.tsx +0 -154
  143. package/src/use-local-storage.tsx +0 -71
  144. package/src/use-paddle.ts +0 -138
  145. package/src/use-performance-optimizer.ts +0 -389
  146. package/src/use-pro-access.ts +0 -141
  147. package/src/use-scroll-animation.ts +0 -219
  148. package/src/use-subscription.ts +0 -37
  149. package/src/use-toast.ts +0 -32
  150. package/src/utils/chart-helpers.ts +0 -357
  151. package/src/utils/cn.ts +0 -6
  152. package/src/utils/data-processing.ts +0 -151
  153. package/src/utils/license-validator.tsx +0 -183
@@ -1,426 +0,0 @@
1
- import { GitHubRepository, GitHubStats, GitHubActivity, LanguageStats, RateLimitInfo, StarHistory } from "./types"
2
-
3
- // Cache management
4
- const cache = new Map<string, { data: any; timestamp: number; expiresAt: number }>()
5
-
6
- // Docs mode detection
7
- const isDocsMode = () => {
8
- return typeof window !== "undefined" &&
9
- (window.location.pathname.includes("/docs/") ||
10
- window.location.pathname.includes("/components/"))
11
- }
12
-
13
- // Get cache duration based on mode
14
- const getCacheDuration = (defaultDuration: number) => {
15
- // Increase cache duration to 30 minutes in docs mode
16
- return isDocsMode() ? 1800000 : defaultDuration // 30 minutes : default
17
- }
18
-
19
- // Language colors
20
- export const LANGUAGE_COLORS: Record<string, string> = {
21
- JavaScript: "#f7df1e",
22
- TypeScript: "#3178c6",
23
- Python: "#3776ab",
24
- Java: "#ed8b00",
25
- "C++": "#00599c",
26
- "C#": "#239120",
27
- Go: "#00add8",
28
- Rust: "#000000",
29
- Swift: "#fa7343",
30
- Kotlin: "#7f52ff",
31
- PHP: "#777bb4",
32
- Ruby: "#cc342d",
33
- HTML: "#e34f26",
34
- CSS: "#1572b6",
35
- Vue: "#4fc08d",
36
- React: "#61dafb",
37
- Shell: "#89e051",
38
- Dart: "#0175c2",
39
- Elixir: "#6e4a7e",
40
- Scala: "#c22d40",
41
- R: "#198ce7",
42
- Julia: "#9558b2",
43
- Lua: "#000080",
44
- Perl: "#39457e",
45
- Haskell: "#5e5086",
46
- Clojure: "#db5855",
47
- Erlang: "#b83998",
48
- Objective_C: "#438eff",
49
- // Add more as needed
50
- }
51
-
52
- // API base URL
53
- const API_BASE = "https://api.github.com"
54
-
55
- // Helper to make authenticated requests
56
- async function githubFetch(url: string, token?: string): Promise<Response> {
57
- const headers: HeadersInit = {
58
- Accept: "application/vnd.github.v3+json",
59
- }
60
-
61
- if (token) {
62
- headers.Authorization = `token ${token}`
63
- }
64
-
65
- const response = await fetch(url, { headers })
66
-
67
- if (response.status === 403 && response.headers.get("X-RateLimit-Remaining") === "0") {
68
- const resetTime = parseInt(response.headers.get("X-RateLimit-Reset") || "0") * 1000
69
- const resetDate = new Date(resetTime)
70
- throw new Error(`GitHub API rate limit exceeded. Resets at ${resetDate.toLocaleTimeString()}`)
71
- }
72
-
73
- if (!response.ok) {
74
- throw new Error(`GitHub API error: ${response.status} ${response.statusText}`)
75
- }
76
-
77
- return response
78
- }
79
-
80
- // Get rate limit info
81
- export async function getRateLimitInfo(token?: string): Promise<RateLimitInfo> {
82
- const cacheKey = `rate-limit-${token || "public"}`
83
- const cached = cache.get(cacheKey)
84
-
85
- if (cached && cached.expiresAt > Date.now()) {
86
- return cached.data
87
- }
88
-
89
- const response = await githubFetch(`${API_BASE}/rate_limit`, token)
90
- const data = await response.json()
91
-
92
- const rateLimitInfo: RateLimitInfo = {
93
- limit: data.rate.limit,
94
- remaining: data.rate.remaining,
95
- reset: data.rate.reset * 1000,
96
- used: data.rate.used,
97
- }
98
-
99
- cache.set(cacheKey, {
100
- data: rateLimitInfo,
101
- timestamp: Date.now(),
102
- expiresAt: Date.now() + getCacheDuration(60000), // Docs modunda daha uzun cache
103
- })
104
-
105
- return rateLimitInfo
106
- }
107
-
108
- // Fetch user repositories
109
- export async function fetchUserRepositories(
110
- username: string,
111
- token?: string,
112
- options?: {
113
- sort?: string
114
- per_page?: number
115
- page?: number
116
- }
117
- ): Promise<GitHubRepository[]> {
118
- const params = new URLSearchParams({
119
- sort: options?.sort || "updated",
120
- per_page: String(options?.per_page || 100),
121
- page: String(options?.page || 1),
122
- })
123
-
124
- const cacheKey = `repos-${username}-${params.toString()}`
125
- const cached = cache.get(cacheKey)
126
-
127
- if (cached && cached.expiresAt > Date.now()) {
128
- return cached.data
129
- }
130
-
131
- const response = await githubFetch(`${API_BASE}/users/${username}/repos?${params}`, token)
132
- const repos = await response.json()
133
-
134
- cache.set(cacheKey, {
135
- data: repos,
136
- timestamp: Date.now(),
137
- expiresAt: Date.now() + getCacheDuration(300000), // 30 minutes in docs mode
138
- })
139
-
140
- return repos
141
- }
142
-
143
- // Fetch single repository
144
- export async function fetchRepository(
145
- owner: string,
146
- repo: string,
147
- token?: string
148
- ): Promise<GitHubRepository> {
149
- const cacheKey = `repo-${owner}-${repo}`
150
- const cached = cache.get(cacheKey)
151
-
152
- if (cached && cached.expiresAt > Date.now()) {
153
- return cached.data
154
- }
155
-
156
- const response = await githubFetch(`${API_BASE}/repos/${owner}/${repo}`, token)
157
- const repository = await response.json()
158
-
159
- cache.set(cacheKey, {
160
- data: repository,
161
- timestamp: Date.now(),
162
- expiresAt: Date.now() + getCacheDuration(300000), // 30 minutes in docs mode
163
- })
164
-
165
- return repository
166
- }
167
-
168
- // Fetch repository contributors count
169
- export async function fetchContributorsCount(
170
- owner: string,
171
- repo: string,
172
- token?: string
173
- ): Promise<number> {
174
- const cacheKey = `contributors-${owner}-${repo}`
175
- const cached = cache.get(cacheKey)
176
-
177
- if (cached && cached.expiresAt > Date.now()) {
178
- return cached.data
179
- }
180
-
181
- try {
182
- const response = await githubFetch(
183
- `${API_BASE}/repos/${owner}/${repo}/contributors?per_page=1&anon=true`,
184
- token
185
- )
186
-
187
- // Get total count from Link header
188
- const linkHeader = response.headers.get("Link")
189
- if (linkHeader) {
190
- const match = linkHeader.match(/page=(\d+)>; rel="last"/)
191
- if (match) {
192
- const count = parseInt(match[1])
193
- cache.set(cacheKey, {
194
- data: count,
195
- timestamp: Date.now(),
196
- expiresAt: Date.now() + getCacheDuration(3600000), // 30 minutes in docs mode
197
- })
198
- return count
199
- }
200
- }
201
-
202
- // If no pagination, count the results
203
- const contributors = await response.json()
204
- const count = contributors.length
205
-
206
- cache.set(cacheKey, {
207
- data: count,
208
- timestamp: Date.now(),
209
- expiresAt: Date.now() + getCacheDuration(3600000), // 30 minutes in docs mode
210
- })
211
-
212
- return count
213
- } catch (error) {
214
- console.error("Failed to fetch contributors:", error)
215
- return 0
216
- }
217
- }
218
-
219
- // Fetch repository star history (limited without token)
220
- export async function fetchStarHistory(
221
- owner: string,
222
- repo: string,
223
- token?: string
224
- ): Promise<StarHistory[]> {
225
- const cacheKey = `star-history-${owner}-${repo}`
226
- const cached = cache.get(cacheKey)
227
-
228
- if (cached && cached.expiresAt > Date.now()) {
229
- return cached.data
230
- }
231
-
232
- try {
233
- // This is a simplified version - for full star history you'd need
234
- // to use the stargazers API with Accept: application/vnd.github.v3.star+json
235
- // header and paginate through all results
236
- const response = await githubFetch(`${API_BASE}/repos/${owner}/${repo}`, token)
237
- const repoData = await response.json()
238
-
239
- // For now, return current count as single data point
240
- const history: StarHistory[] = [{
241
- date: new Date().toISOString(),
242
- count: repoData.stargazers_count,
243
- repository: repoData.full_name,
244
- }]
245
-
246
- cache.set(cacheKey, {
247
- data: history,
248
- timestamp: Date.now(),
249
- expiresAt: Date.now() + getCacheDuration(3600000), // 30 minutes in docs mode
250
- })
251
-
252
- return history
253
- } catch (error) {
254
- console.error("Failed to fetch star history:", error)
255
- return []
256
- }
257
- }
258
-
259
- // Calculate repository statistics
260
- export function calculateStats(repositories: GitHubRepository[]): GitHubStats {
261
- const totalStars = repositories.reduce((sum, repo) => sum + repo.stargazers_count, 0)
262
- const totalForks = repositories.reduce((sum, repo) => sum + repo.forks_count, 0)
263
- const totalWatchers = repositories.reduce((sum, repo) => sum + repo.watchers_count, 0)
264
- const totalIssues = repositories.reduce((sum, repo) => sum + repo.open_issues_count, 0)
265
-
266
- const avgStarsPerRepo = repositories.length > 0 ? totalStars / repositories.length : 0
267
-
268
- const mostStarredRepo = repositories.reduce((max, repo) =>
269
- repo.stargazers_count > (max?.stargazers_count || 0) ? repo : max
270
- , null as GitHubRepository | null)
271
-
272
- // Calculate language statistics
273
- const languageMap = new Map<string, number>()
274
- repositories.forEach(repo => {
275
- if (repo.language) {
276
- languageMap.set(repo.language, (languageMap.get(repo.language) || 0) + 1)
277
- }
278
- })
279
-
280
- const totalRepos = repositories.length
281
- const languages: LanguageStats[] = Array.from(languageMap.entries())
282
- .map(([language, count]) => ({
283
- language,
284
- count,
285
- percentage: (count / totalRepos) * 100,
286
- color: LANGUAGE_COLORS[language] || "#6b7280",
287
- }))
288
- .sort((a, b) => b.count - a.count)
289
-
290
- // Generate recent activity (mock for now)
291
- const recentActivity: GitHubActivity[] = repositories
292
- .slice(0, 5)
293
- .map(repo => ({
294
- type: "star" as const,
295
- repository: repo.full_name,
296
- timestamp: repo.updated_at,
297
- description: `Repository updated`,
298
- }))
299
-
300
- return {
301
- totalStars,
302
- totalForks,
303
- totalWatchers,
304
- totalIssues,
305
- avgStarsPerRepo,
306
- mostStarredRepo,
307
- recentActivity,
308
- languages,
309
- }
310
- }
311
-
312
- // Format numbers for display
313
- export function formatNumber(num: number): string {
314
- if (num >= 1000000) {
315
- return (num / 1000000).toFixed(1) + "M"
316
- }
317
- if (num >= 1000) {
318
- return (num / 1000).toFixed(1) + "k"
319
- }
320
- return num.toString()
321
- }
322
-
323
- // Format date for display
324
- export function formatDate(dateString: string): string {
325
- const date = new Date(dateString)
326
- const now = new Date()
327
- const diffMs = now.getTime() - date.getTime()
328
- const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24))
329
-
330
- if (diffDays === 0) {
331
- const diffHours = Math.floor(diffMs / (1000 * 60 * 60))
332
- if (diffHours === 0) {
333
- const diffMinutes = Math.floor(diffMs / (1000 * 60))
334
- return `${diffMinutes} minutes ago`
335
- }
336
- return `${diffHours} hours ago`
337
- }
338
-
339
- if (diffDays === 1) return "yesterday"
340
- if (diffDays < 7) return `${diffDays} days ago`
341
- if (diffDays < 30) return `${Math.floor(diffDays / 7)} weeks ago`
342
- if (diffDays < 365) return `${Math.floor(diffDays / 30)} months ago`
343
-
344
- return date.toLocaleDateString("en-US", {
345
- year: "numeric",
346
- month: "short",
347
- day: "numeric",
348
- })
349
- }
350
-
351
- // Clear cache
352
- export function clearCache(pattern?: string): void {
353
- if (pattern) {
354
- for (const key of cache.keys()) {
355
- if (key.includes(pattern)) {
356
- cache.delete(key)
357
- }
358
- }
359
- } else {
360
- cache.clear()
361
- }
362
- }
363
-
364
- // Export data as JSON
365
- export function exportData(data: any, filename: string): void {
366
- const jsonString = JSON.stringify(data, null, 2)
367
- const blob = new Blob([jsonString], { type: "application/json" })
368
- const url = URL.createObjectURL(blob)
369
-
370
- const link = document.createElement("a")
371
- link.href = url
372
- link.download = filename
373
- document.body.appendChild(link)
374
- link.click()
375
- document.body.removeChild(link)
376
-
377
- URL.revokeObjectURL(url)
378
- }
379
-
380
- // Export data as CSV
381
- export function exportAsCSV(repositories: GitHubRepository[], filename: string): void {
382
- const headers = [
383
- "Name",
384
- "Owner",
385
- "Stars",
386
- "Forks",
387
- "Watchers",
388
- "Issues",
389
- "Language",
390
- "Description",
391
- "URL",
392
- "Created",
393
- "Updated",
394
- ]
395
-
396
- const rows = repositories.map(repo => [
397
- repo.name,
398
- repo.owner.login,
399
- repo.stargazers_count,
400
- repo.forks_count,
401
- repo.watchers_count,
402
- repo.open_issues_count,
403
- repo.language || "",
404
- repo.description || "",
405
- repo.html_url,
406
- new Date(repo.created_at).toLocaleDateString(),
407
- new Date(repo.updated_at).toLocaleDateString(),
408
- ])
409
-
410
- const csvContent = [
411
- headers.join(","),
412
- ...rows.map(row => row.map(cell => `"${cell}"`).join(",")),
413
- ].join("\n")
414
-
415
- const blob = new Blob([csvContent], { type: "text/csv" })
416
- const url = URL.createObjectURL(blob)
417
-
418
- const link = document.createElement("a")
419
- link.href = url
420
- link.download = filename
421
- document.body.appendChild(link)
422
- link.click()
423
- document.body.removeChild(link)
424
-
425
- URL.revokeObjectURL(url)
426
- }