@moontra/moonui-pro 2.20.1 → 2.20.3

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 (162) hide show
  1. package/dist/index.d.ts +691 -261
  2. package/dist/index.mjs +7418 -4934
  3. package/package.json +11 -5
  4. package/plugin/index.d.ts +86 -0
  5. package/plugin/index.js +308 -0
  6. package/scripts/postbuild.js +27 -0
  7. package/scripts/postinstall.js +176 -23
  8. package/src/__tests__/use-intersection-observer.test.tsx +0 -216
  9. package/src/__tests__/use-local-storage.test.tsx +0 -174
  10. package/src/__tests__/use-pro-access.test.tsx +0 -183
  11. package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
  12. package/src/components/advanced-chart/index.tsx +0 -1242
  13. package/src/components/advanced-forms/index.tsx +0 -426
  14. package/src/components/animated-button/index.tsx +0 -385
  15. package/src/components/calendar/event-dialog.tsx +0 -372
  16. package/src/components/calendar/index.tsx +0 -1073
  17. package/src/components/calendar-pro/index.tsx +0 -1697
  18. package/src/components/color-picker/index.tsx +0 -432
  19. package/src/components/credit-card-input/index.tsx +0 -406
  20. package/src/components/dashboard/dashboard-grid.tsx +0 -462
  21. package/src/components/dashboard/demo.tsx +0 -425
  22. package/src/components/dashboard/index.tsx +0 -1046
  23. package/src/components/dashboard/time-range-picker.tsx +0 -336
  24. package/src/components/dashboard/types.ts +0 -222
  25. package/src/components/dashboard/widgets/activity-feed.tsx +0 -344
  26. package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
  27. package/src/components/dashboard/widgets/metric-card.tsx +0 -343
  28. package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
  29. package/src/components/data-table/data-table-column-toggle.tsx +0 -169
  30. package/src/components/data-table/data-table-export.ts +0 -156
  31. package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
  32. package/src/components/data-table/data-table.test.tsx +0 -187
  33. package/src/components/data-table/index.tsx +0 -845
  34. package/src/components/draggable-list/index.tsx +0 -100
  35. package/src/components/enhanced/badge.tsx +0 -191
  36. package/src/components/enhanced/button.tsx +0 -362
  37. package/src/components/enhanced/card.tsx +0 -266
  38. package/src/components/enhanced/dialog.tsx +0 -246
  39. package/src/components/enhanced/index.ts +0 -4
  40. package/src/components/error-boundary/index.tsx +0 -109
  41. package/src/components/file-upload/file-upload.test.tsx +0 -243
  42. package/src/components/file-upload/index.tsx +0 -1660
  43. package/src/components/floating-action-button/index.tsx +0 -206
  44. package/src/components/form-wizard/form-wizard-context.tsx +0 -307
  45. package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
  46. package/src/components/form-wizard/form-wizard-progress.tsx +0 -298
  47. package/src/components/form-wizard/form-wizard-step.tsx +0 -111
  48. package/src/components/form-wizard/index.tsx +0 -102
  49. package/src/components/form-wizard/types.ts +0 -76
  50. package/src/components/gesture-drawer/index.tsx +0 -551
  51. package/src/components/github-stars/github-api.ts +0 -426
  52. package/src/components/github-stars/hooks.ts +0 -516
  53. package/src/components/github-stars/index.tsx +0 -375
  54. package/src/components/github-stars/types.ts +0 -148
  55. package/src/components/github-stars/variants.tsx +0 -513
  56. package/src/components/health-check/index.tsx +0 -439
  57. package/src/components/hover-card-3d/index.tsx +0 -530
  58. package/src/components/index.ts +0 -128
  59. package/src/components/internal/index.ts +0 -78
  60. package/src/components/kanban/add-card-modal.tsx +0 -502
  61. package/src/components/kanban/card-detail-modal.tsx +0 -761
  62. package/src/components/kanban/index.ts +0 -13
  63. package/src/components/kanban/kanban.tsx +0 -1684
  64. package/src/components/kanban/types.ts +0 -168
  65. package/src/components/lazy-component/index.tsx +0 -823
  66. package/src/components/license-error/index.tsx +0 -29
  67. package/src/components/magnetic-button/index.tsx +0 -167
  68. package/src/components/memory-efficient-data/index.tsx +0 -1016
  69. package/src/components/moonui-quiz-form/index.tsx +0 -817
  70. package/src/components/optimized-image/index.tsx +0 -425
  71. package/src/components/performance-debugger/index.tsx +0 -589
  72. package/src/components/performance-monitor/index.tsx +0 -794
  73. package/src/components/phone-number-input/index.tsx +0 -338
  74. package/src/components/pinch-zoom/index.tsx +0 -566
  75. package/src/components/quiz-form/index.tsx +0 -479
  76. package/src/components/rich-text-editor/index-old-backup.tsx +0 -437
  77. package/src/components/rich-text-editor/index.tsx +0 -2324
  78. package/src/components/rich-text-editor/slash-commands-extension.ts +0 -220
  79. package/src/components/rich-text-editor/slash-commands.css +0 -35
  80. package/src/components/rich-text-editor/table-styles.css +0 -65
  81. package/src/components/sidebar/index.tsx +0 -865
  82. package/src/components/spotlight-card/index.tsx +0 -191
  83. package/src/components/swipeable-card/index.tsx +0 -100
  84. package/src/components/timeline/index.tsx +0 -1148
  85. package/src/components/ui/accordion.tsx +0 -73
  86. package/src/components/ui/alert-dialog.tsx +0 -141
  87. package/src/components/ui/alert.tsx +0 -141
  88. package/src/components/ui/aspect-ratio.tsx +0 -245
  89. package/src/components/ui/avatar.tsx +0 -153
  90. package/src/components/ui/badge.tsx +0 -228
  91. package/src/components/ui/breadcrumb.tsx +0 -214
  92. package/src/components/ui/button.tsx +0 -222
  93. package/src/components/ui/calendar.tsx +0 -387
  94. package/src/components/ui/card.tsx +0 -214
  95. package/src/components/ui/checkbox.tsx +0 -259
  96. package/src/components/ui/collapsible.tsx +0 -135
  97. package/src/components/ui/color-picker.tsx +0 -97
  98. package/src/components/ui/command.tsx +0 -225
  99. package/src/components/ui/dialog.tsx +0 -334
  100. package/src/components/ui/dropdown-menu.tsx +0 -218
  101. package/src/components/ui/gesture-drawer.tsx +0 -11
  102. package/src/components/ui/hover-card.tsx +0 -29
  103. package/src/components/ui/index.ts +0 -190
  104. package/src/components/ui/input.tsx +0 -222
  105. package/src/components/ui/label.tsx +0 -29
  106. package/src/components/ui/lightbox.tsx +0 -606
  107. package/src/components/ui/magnetic-button.tsx +0 -129
  108. package/src/components/ui/media-gallery.tsx +0 -612
  109. package/src/components/ui/pagination.tsx +0 -123
  110. package/src/components/ui/popover.tsx +0 -185
  111. package/src/components/ui/progress.tsx +0 -30
  112. package/src/components/ui/radio-group.tsx +0 -257
  113. package/src/components/ui/scroll-area.tsx +0 -47
  114. package/src/components/ui/select.tsx +0 -374
  115. package/src/components/ui/separator.tsx +0 -145
  116. package/src/components/ui/sheet.tsx +0 -139
  117. package/src/components/ui/skeleton.tsx +0 -20
  118. package/src/components/ui/slider.tsx +0 -354
  119. package/src/components/ui/spotlight-card.tsx +0 -119
  120. package/src/components/ui/switch.tsx +0 -86
  121. package/src/components/ui/table.tsx +0 -329
  122. package/src/components/ui/tabs.tsx +0 -198
  123. package/src/components/ui/textarea.tsx +0 -28
  124. package/src/components/ui/toast.tsx +0 -317
  125. package/src/components/ui/toggle.tsx +0 -119
  126. package/src/components/ui/tooltip.tsx +0 -151
  127. package/src/components/virtual-list/index.tsx +0 -668
  128. package/src/hooks/use-chart.ts +0 -205
  129. package/src/hooks/use-data-table.ts +0 -182
  130. package/src/hooks/use-docs-pro-access.ts +0 -13
  131. package/src/hooks/use-license-check.ts +0 -65
  132. package/src/hooks/use-subscription.ts +0 -19
  133. package/src/hooks/use-toast.ts +0 -15
  134. package/src/index.ts +0 -14
  135. package/src/lib/ai-providers.ts +0 -377
  136. package/src/lib/component-metadata.ts +0 -18
  137. package/src/lib/micro-interactions.ts +0 -255
  138. package/src/lib/paddle.ts +0 -17
  139. package/src/lib/utils.ts +0 -6
  140. package/src/patterns/login-form/index.tsx +0 -276
  141. package/src/patterns/login-form/types.ts +0 -67
  142. package/src/setupTests.ts +0 -41
  143. package/src/styles/advanced-chart.css +0 -239
  144. package/src/styles/calendar.css +0 -35
  145. package/src/styles/design-system.css +0 -363
  146. package/src/styles/index.css +0 -85
  147. package/src/styles/tailwind.css +0 -7
  148. package/src/styles/tokens.css +0 -455
  149. package/src/types/moonui.d.ts +0 -22
  150. package/src/types/next-auth.d.ts +0 -21
  151. package/src/use-intersection-observer.tsx +0 -154
  152. package/src/use-local-storage.tsx +0 -71
  153. package/src/use-paddle.ts +0 -138
  154. package/src/use-performance-optimizer.ts +0 -389
  155. package/src/use-pro-access.ts +0 -141
  156. package/src/use-scroll-animation.ts +0 -219
  157. package/src/use-subscription.ts +0 -37
  158. package/src/use-toast.ts +0 -32
  159. package/src/utils/chart-helpers.ts +0 -357
  160. package/src/utils/cn.ts +0 -6
  161. package/src/utils/data-processing.ts +0 -151
  162. package/src/utils/license-validator.tsx +0 -183
@@ -1,205 +0,0 @@
1
- "use client"
2
-
3
- import React from 'react'
4
- import { ChartDataPoint, ChartSeries } from '../components/advanced-chart'
5
-
6
- interface UseChartOptions {
7
- data: ChartDataPoint[]
8
- series: ChartSeries[]
9
- realtime?: boolean
10
- refreshInterval?: number
11
- maxDataPoints?: number
12
- }
13
-
14
- interface UseChartReturn {
15
- data: ChartDataPoint[]
16
- series: ChartSeries[]
17
- isLoading: boolean
18
- error: string | null
19
- addDataPoint: (point: ChartDataPoint) => void
20
- updateSeries: (seriesUpdate: Partial<ChartSeries>[]) => void
21
- toggleSeries: (dataKey: string) => void
22
- resetData: () => void
23
- exportData: (format: 'csv' | 'json') => void
24
- getStats: () => {
25
- total: number
26
- average: number
27
- min: number
28
- max: number
29
- trend: 'up' | 'down' | 'neutral'
30
- }
31
- }
32
-
33
- export function useChart({
34
- data: initialData,
35
- series: initialSeries,
36
- realtime = false,
37
- refreshInterval = 5000,
38
- maxDataPoints = 100,
39
- }: UseChartOptions): UseChartReturn {
40
- const [data, setData] = React.useState<ChartDataPoint[]>(initialData)
41
- const [series, setSeries] = React.useState<ChartSeries[]>(initialSeries)
42
- const [isLoading, setIsLoading] = React.useState(false)
43
- const [error, setError] = React.useState<string | null>(null)
44
-
45
- // Realtime data updates
46
- React.useEffect(() => {
47
- if (!realtime) return
48
-
49
- const interval = setInterval(() => {
50
- // This would typically fetch new data from an API
51
- // For demo purposes, we'll simulate data updates
52
- setData(prevData => {
53
- const newData = [...prevData]
54
-
55
- // Keep only the last maxDataPoints
56
- if (newData.length >= maxDataPoints) {
57
- newData.shift()
58
- }
59
-
60
- // Add simulated new data point
61
- const lastPoint = newData[newData.length - 1]
62
- if (lastPoint) {
63
- const newPoint: ChartDataPoint = { ...lastPoint }
64
-
65
- // Simulate data changes for each series
66
- series.forEach(s => {
67
- if (typeof lastPoint[s.dataKey] === 'number') {
68
- const currentValue = lastPoint[s.dataKey] as number
69
- const change = (Math.random() - 0.5) * currentValue * 0.1
70
- newPoint[s.dataKey] = Math.max(0, currentValue + change)
71
- }
72
- })
73
-
74
- // Update timestamp if exists
75
- if ('timestamp' in newPoint) {
76
- newPoint.timestamp = Date.now()
77
- }
78
-
79
- newData.push(newPoint)
80
- }
81
-
82
- return newData
83
- })
84
- }, refreshInterval)
85
-
86
- return () => clearInterval(interval)
87
- }, [realtime, refreshInterval, maxDataPoints, series])
88
-
89
- const addDataPoint = React.useCallback((point: ChartDataPoint) => {
90
- setData(prevData => {
91
- const newData = [...prevData, point]
92
-
93
- // Keep only the last maxDataPoints
94
- if (newData.length > maxDataPoints) {
95
- return newData.slice(-maxDataPoints)
96
- }
97
-
98
- return newData
99
- })
100
- }, [maxDataPoints])
101
-
102
- const updateSeries = React.useCallback((seriesUpdate: Partial<ChartSeries>[]) => {
103
- setSeries(prevSeries => {
104
- return prevSeries.map(s => {
105
- const update = seriesUpdate.find(u => u.dataKey === s.dataKey)
106
- return update ? { ...s, ...update } : s
107
- })
108
- })
109
- }, [])
110
-
111
- const toggleSeries = React.useCallback((dataKey: string) => {
112
- setSeries(prevSeries => {
113
- return prevSeries.map(s =>
114
- s.dataKey === dataKey ? { ...s, hide: !s.hide } : s
115
- )
116
- })
117
- }, [])
118
-
119
- const resetData = React.useCallback(() => {
120
- setData(initialData)
121
- setSeries(initialSeries)
122
- setError(null)
123
- }, [initialData, initialSeries])
124
-
125
- const exportData = React.useCallback((format: 'csv' | 'json') => {
126
- try {
127
- if (format === 'csv') {
128
- const headers = Object.keys(data[0] || {})
129
- const csvContent = [
130
- headers.join(','),
131
- ...data.map(row =>
132
- headers.map(header => {
133
- const value = row[header]
134
- if (typeof value === 'string' && (value.includes(',') || value.includes('"'))) {
135
- return `"${value.replace(/"/g, '""')}"`
136
- }
137
- return value
138
- }).join(',')
139
- )
140
- ].join('\n')
141
-
142
- const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })
143
- const link = document.createElement('a')
144
- link.href = URL.createObjectURL(blob)
145
- link.download = 'chart-data.csv'
146
- link.click()
147
- } else if (format === 'json') {
148
- const jsonContent = JSON.stringify({ data, series }, null, 2)
149
- const blob = new Blob([jsonContent], { type: 'application/json;charset=utf-8;' })
150
- const link = document.createElement('a')
151
- link.href = URL.createObjectURL(blob)
152
- link.download = 'chart-data.json'
153
- link.click()
154
- }
155
- } catch (err) {
156
- setError('Failed to export data')
157
- }
158
- }, [data, series])
159
-
160
- const getStats = React.useCallback(() => {
161
- if (!data.length || !series.length) {
162
- return { total: 0, average: 0, min: 0, max: 0, trend: 'neutral' as const }
163
- }
164
-
165
- const firstSeries = series[0]
166
- const values = data
167
- .map(d => Number(d[firstSeries.dataKey]))
168
- .filter(v => !isNaN(v))
169
-
170
- if (!values.length) {
171
- return { total: 0, average: 0, min: 0, max: 0, trend: 'neutral' as const }
172
- }
173
-
174
- const total = values.reduce((sum, val) => sum + val, 0)
175
- const average = total / values.length
176
- const min = Math.min(...values)
177
- const max = Math.max(...values)
178
-
179
- // Calculate trend
180
- let trend: 'up' | 'down' | 'neutral' = 'neutral'
181
- if (values.length >= 2) {
182
- const first = values[0]
183
- const last = values[values.length - 1]
184
- const change = ((last - first) / first) * 100
185
-
186
- if (change > 5) trend = 'up'
187
- else if (change < -5) trend = 'down'
188
- }
189
-
190
- return { total, average, min, max, trend }
191
- }, [data, series])
192
-
193
- return {
194
- data,
195
- series,
196
- isLoading,
197
- error,
198
- addDataPoint,
199
- updateSeries,
200
- toggleSeries,
201
- resetData,
202
- exportData,
203
- getStats,
204
- }
205
- }
@@ -1,182 +0,0 @@
1
- "use client"
2
-
3
- import React from 'react'
4
- import { ColumnDef } from '@tanstack/react-table'
5
-
6
- export interface UseDataTableOptions<TData> {
7
- data: TData[]
8
- columns: ColumnDef<TData, any>[]
9
- searchable?: boolean
10
- filterable?: boolean
11
- sortable?: boolean
12
- pagination?: boolean
13
- pageSize?: number
14
- enableRowSelection?: boolean
15
- enableMultiRowSelection?: boolean
16
- }
17
-
18
- export interface UseDataTableReturn<TData> {
19
- // Table state
20
- filteredData: TData[]
21
- selectedRows: TData[]
22
- searchQuery: string
23
- currentPage: number
24
- totalPages: number
25
-
26
- // Actions
27
- setSearchQuery: (query: string) => void
28
- setCurrentPage: (page: number) => void
29
- selectRow: (row: TData) => void
30
- selectAllRows: () => void
31
- clearSelection: () => void
32
- exportData: (format?: 'csv' | 'json') => void
33
-
34
- // Utilities
35
- getRowCount: () => number
36
- getSelectedCount: () => number
37
- isRowSelected: (row: TData) => boolean
38
- }
39
-
40
- export function useDataTable<TData extends Record<string, any>>(
41
- options: UseDataTableOptions<TData>
42
- ): UseDataTableReturn<TData> {
43
- const {
44
- data,
45
- searchable = true,
46
- pageSize = 10,
47
- enableRowSelection = false,
48
- enableMultiRowSelection = true,
49
- } = options
50
-
51
- const [searchQuery, setSearchQuery] = React.useState('')
52
- const [currentPage, setCurrentPage] = React.useState(1)
53
- const [selectedRows, setSelectedRows] = React.useState<TData[]>([])
54
-
55
- // Filter data based on search query
56
- const filteredData = React.useMemo(() => {
57
- if (!searchable || !searchQuery.trim()) {
58
- return data
59
- }
60
-
61
- return data.filter((row) => {
62
- return Object.values(row).some((value) => {
63
- if (value == null) return false
64
- return String(value).toLowerCase().includes(searchQuery.toLowerCase())
65
- })
66
- })
67
- }, [data, searchQuery, searchable])
68
-
69
- // Calculate pagination
70
- const totalPages = Math.ceil(filteredData.length / pageSize)
71
- const paginatedData = React.useMemo(() => {
72
- const startIndex = (currentPage - 1) * pageSize
73
- const endIndex = startIndex + pageSize
74
- return filteredData.slice(startIndex, endIndex)
75
- }, [filteredData, currentPage, pageSize])
76
-
77
- // Row selection handlers
78
- const selectRow = React.useCallback((row: TData) => {
79
- if (!enableRowSelection) return
80
-
81
- setSelectedRows((prev) => {
82
- if (!enableMultiRowSelection) {
83
- return [row]
84
- }
85
-
86
- const isSelected = prev.some((selectedRow) =>
87
- JSON.stringify(selectedRow) === JSON.stringify(row)
88
- )
89
-
90
- if (isSelected) {
91
- return prev.filter((selectedRow) =>
92
- JSON.stringify(selectedRow) !== JSON.stringify(row)
93
- )
94
- } else {
95
- return [...prev, row]
96
- }
97
- })
98
- }, [enableRowSelection, enableMultiRowSelection])
99
-
100
- const selectAllRows = React.useCallback(() => {
101
- if (!enableRowSelection) return
102
-
103
- setSelectedRows((prev) => {
104
- if (prev.length === filteredData.length) {
105
- return []
106
- } else {
107
- return [...filteredData]
108
- }
109
- })
110
- }, [enableRowSelection, filteredData])
111
-
112
- const clearSelection = React.useCallback(() => {
113
- setSelectedRows([])
114
- }, [])
115
-
116
- const isRowSelected = React.useCallback((row: TData) => {
117
- return selectedRows.some((selectedRow) =>
118
- JSON.stringify(selectedRow) === JSON.stringify(row)
119
- )
120
- }, [selectedRows])
121
-
122
- // Export functionality
123
- const exportData = React.useCallback((format: 'csv' | 'json' = 'csv') => {
124
- const dataToExport = selectedRows.length > 0 ? selectedRows : filteredData
125
-
126
- if (format === 'csv') {
127
- const headers = Object.keys(dataToExport[0] || {})
128
- const csvContent = [
129
- headers.join(','),
130
- ...dataToExport.map(row =>
131
- headers.map(header => {
132
- const value = row[header]
133
- // Escape commas and quotes in CSV
134
- if (typeof value === 'string' && (value.includes(',') || value.includes('"'))) {
135
- return `"${value.replace(/"/g, '""')}"`
136
- }
137
- return value
138
- }).join(',')
139
- )
140
- ].join('\n')
141
-
142
- const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })
143
- const link = document.createElement('a')
144
- link.href = URL.createObjectURL(blob)
145
- link.download = 'data.csv'
146
- link.click()
147
- } else if (format === 'json') {
148
- const jsonContent = JSON.stringify(dataToExport, null, 2)
149
- const blob = new Blob([jsonContent], { type: 'application/json;charset=utf-8;' })
150
- const link = document.createElement('a')
151
- link.href = URL.createObjectURL(blob)
152
- link.download = 'data.json'
153
- link.click()
154
- }
155
- }, [selectedRows, filteredData])
156
-
157
- // Utility functions
158
- const getRowCount = React.useCallback(() => filteredData.length, [filteredData])
159
- const getSelectedCount = React.useCallback(() => selectedRows.length, [selectedRows])
160
-
161
- // Reset page when search changes
162
- React.useEffect(() => {
163
- setCurrentPage(1)
164
- }, [searchQuery])
165
-
166
- return {
167
- filteredData: paginatedData,
168
- selectedRows,
169
- searchQuery,
170
- currentPage,
171
- totalPages,
172
- setSearchQuery,
173
- setCurrentPage,
174
- selectRow,
175
- selectAllRows,
176
- clearSelection,
177
- exportData,
178
- getRowCount,
179
- getSelectedCount,
180
- isRowSelected,
181
- }
182
- }
@@ -1,13 +0,0 @@
1
- // Mock docs pro access hook for standalone moonui-pro package
2
- // Bu hook, moonui-pro'nun bağımsız çalışması için basit bir mock'tur
3
-
4
- export function useDocsProAccess() {
5
- // Production ortamında her zaman pro erişim verilir
6
- // Gerçek uygulamada bu hook uygulamanın kendi auth sistemiyle değiştirilmelidir
7
-
8
- return {
9
- hasProAccess: true,
10
- isLoading: false,
11
- isDocsMode: false, // Standalone package'da docs mode yok
12
- };
13
- }
@@ -1,65 +0,0 @@
1
- import { useEffect, useState } from 'react'
2
-
3
- interface LicenseCheckResult {
4
- isValid: boolean
5
- isLoading: boolean
6
- error?: string
7
- }
8
-
9
- // License kontrolü için hook
10
- export function useLicenseCheck(): LicenseCheckResult {
11
- const [isValid, setIsValid] = useState(false)
12
- const [isLoading, setIsLoading] = useState(true)
13
- const [error, setError] = useState<string>()
14
-
15
- useEffect(() => {
16
- async function checkLicense() {
17
- try {
18
- // Önce localStorage'dan kontrol et
19
- const cachedLicense = localStorage.getItem('moonui_pro_license')
20
- if (cachedLicense) {
21
- const parsed = JSON.parse(cachedLicense)
22
- if (parsed.expiresAt && new Date(parsed.expiresAt) > new Date()) {
23
- setIsValid(true)
24
- setIsLoading(false)
25
- return
26
- }
27
- }
28
-
29
- // API'den kontrol et
30
- const response = await fetch('/api/license/verify', {
31
- method: 'POST',
32
- headers: { 'Content-Type': 'application/json' },
33
- body: JSON.stringify({
34
- key: process.env.NEXT_PUBLIC_MOONUI_LICENSE_KEY || localStorage.getItem('moonui_license_key')
35
- })
36
- })
37
-
38
- if (response.ok) {
39
- const data = await response.json()
40
- if (data.valid) {
41
- // Cache'e kaydet
42
- localStorage.setItem('moonui_pro_license', JSON.stringify({
43
- valid: true,
44
- expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000) // 24 saat
45
- }))
46
- setIsValid(true)
47
- } else {
48
- setError('Invalid license key')
49
- }
50
- } else {
51
- setError('License verification failed')
52
- }
53
- } catch (err) {
54
- console.error('License check error:', err)
55
- setError('License verification error')
56
- } finally {
57
- setIsLoading(false)
58
- }
59
- }
60
-
61
- checkLicense()
62
- }, [])
63
-
64
- return { isValid, isLoading, error }
65
- }
@@ -1,19 +0,0 @@
1
- // Mock subscription hook for standalone moonui-pro package
2
- // Bu hook, moonui-pro'nun bağımsız çalışması için basit bir mock'tur
3
-
4
- export function useSubscription() {
5
- // Production ortamında her zaman pro erişim verilir
6
- // Gerçek uygulamada bu hook uygulamanın kendi auth sistemiyle değiştirilmelidir
7
-
8
- return {
9
- isLoading: false,
10
- isAuthenticated: true,
11
- isAdmin: false,
12
- hasProAccess: true, // Pro package kullanıcıları varsayılan olarak pro erişime sahip
13
- subscriptionPlan: "pro" as const,
14
- subscription: {
15
- status: "active" as const,
16
- plan: "pro" as const,
17
- },
18
- };
19
- }
@@ -1,15 +0,0 @@
1
- interface ToastOptions {
2
- title: string
3
- description?: string
4
- variant?: 'default' | 'destructive'
5
- }
6
-
7
- export function useToast() {
8
- const toast = (options: ToastOptions) => {
9
- // Simple console implementation for now
10
- // In production, this would integrate with a proper toast system
11
- console.log(`[Toast] ${options.title}${options.description ? ': ' + options.description : ''}`)
12
- }
13
-
14
- return { toast }
15
- }
package/src/index.ts DELETED
@@ -1,14 +0,0 @@
1
- // Pro Components Export - Source of Truth: packages/moonui-pro
2
- // Development environment imports from local packages
3
-
4
- // Import CSS for auto-loading
5
- import "./styles/index.css";
6
-
7
- // Utilities
8
- export { cn } from "./lib/utils";
9
-
10
- // Pro Components (Commercial License) - from packages/moonui-pro
11
- export * from "./components";
12
-
13
- // Enhanced Components - Premium animations and effects
14
- // export * from "./components/enhanced"