@moontra/moonui-pro 2.8.5 → 2.8.6
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 +12 -9
- package/dist/index.mjs +113 -43
- package/package.json +1 -1
- package/src/components/rich-text-editor/index.tsx +99 -14
- package/src/lib/ai-providers.ts +29 -29
package/dist/index.d.ts
CHANGED
|
@@ -1055,6 +1055,14 @@ interface KanbanProps {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
declare function Kanban({ columns, onCardMove, onCardClick, onCardEdit, onCardDelete, onAddCard, onAddColumn, className, showAddColumn, showCardDetails, disabled }: KanbanProps): react_jsx_runtime.JSX.Element;
|
|
1057
1057
|
|
|
1058
|
+
interface AIConfig {
|
|
1059
|
+
provider?: 'openai' | 'claude' | 'gemini' | 'cohere';
|
|
1060
|
+
apiKey?: string;
|
|
1061
|
+
model?: string;
|
|
1062
|
+
temperature?: number;
|
|
1063
|
+
maxTokens?: number;
|
|
1064
|
+
endpoint?: string;
|
|
1065
|
+
}
|
|
1058
1066
|
interface RichTextEditorProps {
|
|
1059
1067
|
value?: string;
|
|
1060
1068
|
onChange?: (value: string) => void;
|
|
@@ -1077,15 +1085,10 @@ interface RichTextEditorProps {
|
|
|
1077
1085
|
color?: boolean;
|
|
1078
1086
|
ai?: boolean;
|
|
1079
1087
|
};
|
|
1080
|
-
aiConfig?:
|
|
1081
|
-
|
|
1082
|
-
apiKey?: string;
|
|
1083
|
-
model?: string;
|
|
1084
|
-
temperature?: number;
|
|
1085
|
-
maxTokens?: number;
|
|
1086
|
-
};
|
|
1088
|
+
aiConfig?: AIConfig;
|
|
1089
|
+
persistAISettings?: boolean;
|
|
1087
1090
|
}
|
|
1088
|
-
declare function RichTextEditor({ placeholder, className, height, features, aiConfig, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
1091
|
+
declare function RichTextEditor({ placeholder, className, height, features, aiConfig, persistAISettings, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
1089
1092
|
|
|
1090
1093
|
interface MemoryConfig {
|
|
1091
1094
|
chunkSize?: number;
|
|
@@ -2366,4 +2369,4 @@ declare namespace index {
|
|
|
2366
2369
|
};
|
|
2367
2370
|
}
|
|
2368
2371
|
|
|
2369
|
-
export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, ActivityItem, Calendar as AdvancedCalendar, AdvancedChart, AdvancedFormField, AdvancedForms, AdvancedFormsProps, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, AnimatedButton, AnimatedButtonProps, 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, BulkAction, MoonUIButtonPro as Button, Calendar$1 as Calendar, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, ChartData, ChartType, 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, ComparisonData, CreditCardInputProps, 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, DraggableListProps, 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, index as Enhanced, ErrorBoundary, ExportFormat, FileUpload, FilterCondition, FilterOperator, FloatingActionButton, FloatingActionButtonProps, FormWizardNavigation, FormWizardProgress, FormWizardProps, FormWizardStep, GitHubRepository, GitHubStars, GitHubStarsProps, HealthCheck, HealthCheckEndpoint, HealthCheckProps, HealthCheckResult, HoverCard, HoverCard3D, HoverCard3DProps, HoverCardContent, HoverCardTrigger, MoonUIInputPro as Input, Kanban, MoonUILabelPro as Label, LazyComponent, LazyImage, LazyImageProps, LazyList, LazyListProps, MagneticButton, MagneticButtonProps, MemoryAnalytics, MemoryAnalyticsProps, MemoryConfig, MemoryEfficientData, MemoryEfficientDataProps, MemoryStats, MetricData, 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, MoonUIFormWizardPro, MoonUIInputPro, MoonUILabelPro, MoonUIPaginationContentPro, MoonUIPaginationEllipsisPro, MoonUIPaginationItemPro, MoonUIPaginationLinkPro, MoonUIPaginationNextPro, MoonUIPaginationPreviousPro, MoonUIPaginationPro, MoonUIPhoneNumberInputPro, MoonUIPopoverContentPro, MoonUIPopoverPro, MoonUIPopoverTriggerPro, MoonUIProgressPro, Question as MoonUIQuestion, QuestionType as MoonUIQuestionType, MoonUIQuizFormPro, MoonUIQuizFormProProps, QuizResult as MoonUIQuizResult, QuizSettings as MoonUIQuizSettings, 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, UserAnswer as MoonUIUserAnswer, MoonUIalertVariantsPro, MoonUIaspectRatioVariantsPro, MoonUIbreadcrumbVariantsPro, MoonUIcollapsibleContentVariantsPro, MoonUIcollapsibleTriggerVariantsPro, MoonUIcommandVariantsPro, MoonUIradioGroupItemVariantsPro, MoonUItableVariantsPro, MoonUItoggleVariantsPro, OptimizedImage, OptimizedImageProps, MoonUIPaginationPro as Pagination, MoonUIPaginationContentPro as PaginationContent, MoonUIPaginationEllipsisPro as PaginationEllipsis, MoonUIPaginationItemPro as PaginationItem, MoonUIPaginationLinkPro as PaginationLink, MoonUIPaginationNextPro as PaginationNext, MoonUIPaginationPreviousPro as PaginationPrevious, PerformanceAlert, PerformanceDebugger, PerformanceDebuggerProps, PerformanceEntry, PerformanceMetric, PerformanceMetrics, PerformanceMonitor, PerformanceMonitorProps, PhoneNumberInputProps, PinchZoom, MoonUIPopoverPro as Popover, MoonUIPopoverContentPro as PopoverContent, MoonUIPopoverTriggerPro as PopoverTrigger, MoonUIProgressPro as Progress, ProgressData, QuestionType$1 as QuestionType, QuizAnswer, QuizFormProps, QuizQuestion, QuizResult$1 as QuizResult, 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, SelectableVirtualListProps, MoonUISeparatorPro as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarConfig, SidebarItem, SidebarSection, SidebarState, MoonUISkeletonPro as Skeleton, MoonUISliderPro as Slider, SpotlightCard, SpotlightCardProps, 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, VirtualListProps, Widget, WizardStep, WizardStepContentProps, 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 };
|
|
2372
|
+
export { AIConfig, MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, ActivityItem, Calendar as AdvancedCalendar, AdvancedChart, AdvancedFormField, AdvancedForms, AdvancedFormsProps, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, AnimatedButton, AnimatedButtonProps, 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, BulkAction, MoonUIButtonPro as Button, Calendar$1 as Calendar, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, ChartData, ChartType, 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, ComparisonData, CreditCardInputProps, 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, DraggableListProps, 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, index as Enhanced, ErrorBoundary, ExportFormat, FileUpload, FilterCondition, FilterOperator, FloatingActionButton, FloatingActionButtonProps, FormWizardNavigation, FormWizardProgress, FormWizardProps, FormWizardStep, GitHubRepository, GitHubStars, GitHubStarsProps, HealthCheck, HealthCheckEndpoint, HealthCheckProps, HealthCheckResult, HoverCard, HoverCard3D, HoverCard3DProps, HoverCardContent, HoverCardTrigger, MoonUIInputPro as Input, Kanban, MoonUILabelPro as Label, LazyComponent, LazyImage, LazyImageProps, LazyList, LazyListProps, MagneticButton, MagneticButtonProps, MemoryAnalytics, MemoryAnalyticsProps, MemoryConfig, MemoryEfficientData, MemoryEfficientDataProps, MemoryStats, MetricData, 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, MoonUIFormWizardPro, MoonUIInputPro, MoonUILabelPro, MoonUIPaginationContentPro, MoonUIPaginationEllipsisPro, MoonUIPaginationItemPro, MoonUIPaginationLinkPro, MoonUIPaginationNextPro, MoonUIPaginationPreviousPro, MoonUIPaginationPro, MoonUIPhoneNumberInputPro, MoonUIPopoverContentPro, MoonUIPopoverPro, MoonUIPopoverTriggerPro, MoonUIProgressPro, Question as MoonUIQuestion, QuestionType as MoonUIQuestionType, MoonUIQuizFormPro, MoonUIQuizFormProProps, QuizResult as MoonUIQuizResult, QuizSettings as MoonUIQuizSettings, 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, UserAnswer as MoonUIUserAnswer, MoonUIalertVariantsPro, MoonUIaspectRatioVariantsPro, MoonUIbreadcrumbVariantsPro, MoonUIcollapsibleContentVariantsPro, MoonUIcollapsibleTriggerVariantsPro, MoonUIcommandVariantsPro, MoonUIradioGroupItemVariantsPro, MoonUItableVariantsPro, MoonUItoggleVariantsPro, OptimizedImage, OptimizedImageProps, MoonUIPaginationPro as Pagination, MoonUIPaginationContentPro as PaginationContent, MoonUIPaginationEllipsisPro as PaginationEllipsis, MoonUIPaginationItemPro as PaginationItem, MoonUIPaginationLinkPro as PaginationLink, MoonUIPaginationNextPro as PaginationNext, MoonUIPaginationPreviousPro as PaginationPrevious, PerformanceAlert, PerformanceDebugger, PerformanceDebuggerProps, PerformanceEntry, PerformanceMetric, PerformanceMetrics, PerformanceMonitor, PerformanceMonitorProps, PhoneNumberInputProps, PinchZoom, MoonUIPopoverPro as Popover, MoonUIPopoverContentPro as PopoverContent, MoonUIPopoverTriggerPro as PopoverTrigger, MoonUIProgressPro as Progress, ProgressData, QuestionType$1 as QuestionType, QuizAnswer, QuizFormProps, QuizQuestion, QuizResult$1 as QuizResult, 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, SelectableVirtualListProps, MoonUISeparatorPro as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarConfig, SidebarItem, SidebarSection, SidebarState, MoonUISkeletonPro as Skeleton, MoonUISliderPro as Slider, SpotlightCard, SpotlightCardProps, 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, VirtualListProps, Widget, WizardStep, WizardStepContentProps, 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -49963,25 +49963,25 @@ var GeminiProvider = class {
|
|
|
49963
49963
|
return this.callGeminiAPI(prompt);
|
|
49964
49964
|
}
|
|
49965
49965
|
async rewrite(text) {
|
|
49966
|
-
const prompt = `Rewrite the following text to make it clearer and more engaging while maintaining the same meaning. Only return the rewritten text, nothing else:
|
|
49966
|
+
const prompt = `Rewrite the following text to make it clearer and more engaging while maintaining the same meaning. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the rewritten text, nothing else:
|
|
49967
49967
|
|
|
49968
49968
|
${text}`;
|
|
49969
49969
|
return this.callGeminiAPI(prompt);
|
|
49970
49970
|
}
|
|
49971
49971
|
async expand(text) {
|
|
49972
|
-
const prompt = `Expand the following text with more details, examples, and explanations. Only return the expanded text, nothing else:
|
|
49972
|
+
const prompt = `Expand the following text with more details, examples, and explanations. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the expanded text, nothing else:
|
|
49973
49973
|
|
|
49974
49974
|
${text}`;
|
|
49975
49975
|
return this.callGeminiAPI(prompt);
|
|
49976
49976
|
}
|
|
49977
49977
|
async summarize(text) {
|
|
49978
|
-
const prompt = `Summarize the following text concisely while keeping the main points. Only return the summary, nothing else:
|
|
49978
|
+
const prompt = `Summarize the following text concisely while keeping the main points. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the summary, nothing else:
|
|
49979
49979
|
|
|
49980
49980
|
${text}`;
|
|
49981
49981
|
return this.callGeminiAPI(prompt);
|
|
49982
49982
|
}
|
|
49983
49983
|
async fixGrammar(text) {
|
|
49984
|
-
const prompt = `Fix any grammar and spelling errors in the following text. Only return the corrected text, nothing else:
|
|
49984
|
+
const prompt = `Fix any grammar and spelling errors in the following text. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the corrected text, nothing else:
|
|
49985
49985
|
|
|
49986
49986
|
${text}`;
|
|
49987
49987
|
return this.callGeminiAPI(prompt);
|
|
@@ -50000,31 +50000,31 @@ ${text}`;
|
|
|
50000
50000
|
formal: "formal and academic"
|
|
50001
50001
|
};
|
|
50002
50002
|
const toneDesc = toneDescriptions[tone] || tone;
|
|
50003
|
-
const prompt = `Rewrite the following text in a ${toneDesc} tone. Only return the rewritten text, nothing else:
|
|
50003
|
+
const prompt = `Rewrite the following text in a ${toneDesc} tone. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the rewritten text, nothing else:
|
|
50004
50004
|
|
|
50005
50005
|
${text}`;
|
|
50006
50006
|
return this.callGeminiAPI(prompt);
|
|
50007
50007
|
}
|
|
50008
50008
|
async continueWriting(text) {
|
|
50009
|
-
const prompt = `Continue writing from where this text ends. Only return the continuation, nothing else:
|
|
50009
|
+
const prompt = `Continue writing from where this text ends. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the continuation, nothing else:
|
|
50010
50010
|
|
|
50011
50011
|
${text}`;
|
|
50012
50012
|
return this.callGeminiAPI(prompt);
|
|
50013
50013
|
}
|
|
50014
50014
|
async improveWriting(text) {
|
|
50015
|
-
const prompt = `Improve the following text by making it more compelling, clear, and well-structured. Only return the improved text, nothing else:
|
|
50015
|
+
const prompt = `Improve the following text by making it more compelling, clear, and well-structured. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the improved text, nothing else:
|
|
50016
50016
|
|
|
50017
50017
|
${text}`;
|
|
50018
50018
|
return this.callGeminiAPI(prompt);
|
|
50019
50019
|
}
|
|
50020
50020
|
async generateIdeas(text) {
|
|
50021
|
-
const prompt = `Generate creative ideas and suggestions based on this topic. Format as a bullet list:
|
|
50021
|
+
const prompt = `Generate creative ideas and suggestions based on this topic. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Format as a bullet list:
|
|
50022
50022
|
|
|
50023
50023
|
${text}`;
|
|
50024
50024
|
return this.callGeminiAPI(prompt);
|
|
50025
50025
|
}
|
|
50026
50026
|
async complete(text) {
|
|
50027
|
-
const prompt = `Complete this text naturally. Only return the completion, nothing else:
|
|
50027
|
+
const prompt = `Complete this text naturally. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the completion, nothing else:
|
|
50028
50028
|
|
|
50029
50029
|
${text}`;
|
|
50030
50030
|
return this.callGeminiAPI(prompt);
|
|
@@ -50067,29 +50067,29 @@ var OpenAIProvider = class {
|
|
|
50067
50067
|
}
|
|
50068
50068
|
}
|
|
50069
50069
|
async generateText(prompt) {
|
|
50070
|
-
return this.callOpenAI("You are a helpful writing assistant.", prompt);
|
|
50070
|
+
return this.callOpenAI("You are a helpful writing assistant. Always respond in the same language as the input text.", prompt);
|
|
50071
50071
|
}
|
|
50072
50072
|
async rewrite(text) {
|
|
50073
50073
|
return this.callOpenAI(
|
|
50074
|
-
"You are a professional editor. Rewrite text to be clearer and more engaging.",
|
|
50074
|
+
"You are a professional editor. Rewrite text to be clearer and more engaging. Always respond in the same language as the input text.",
|
|
50075
50075
|
text
|
|
50076
50076
|
);
|
|
50077
50077
|
}
|
|
50078
50078
|
async expand(text) {
|
|
50079
50079
|
return this.callOpenAI(
|
|
50080
|
-
"You are a content writer. Expand the given text with more details and examples.",
|
|
50080
|
+
"You are a content writer. Expand the given text with more details and examples. Always respond in the same language as the input text.",
|
|
50081
50081
|
text
|
|
50082
50082
|
);
|
|
50083
50083
|
}
|
|
50084
50084
|
async summarize(text) {
|
|
50085
50085
|
return this.callOpenAI(
|
|
50086
|
-
"You are a summarization expert. Create concise summaries.",
|
|
50086
|
+
"You are a summarization expert. Create concise summaries. Always respond in the same language as the input text.",
|
|
50087
50087
|
text
|
|
50088
50088
|
);
|
|
50089
50089
|
}
|
|
50090
50090
|
async fixGrammar(text) {
|
|
50091
50091
|
return this.callOpenAI(
|
|
50092
|
-
"You are a grammar expert. Fix all grammar and spelling errors.",
|
|
50092
|
+
"You are a grammar expert. Fix all grammar and spelling errors. Always respond in the same language as the input text.",
|
|
50093
50093
|
text
|
|
50094
50094
|
);
|
|
50095
50095
|
}
|
|
@@ -50101,31 +50101,31 @@ var OpenAIProvider = class {
|
|
|
50101
50101
|
}
|
|
50102
50102
|
async changeTone(text, tone) {
|
|
50103
50103
|
return this.callOpenAI(
|
|
50104
|
-
`You are a writing expert. Rewrite the text in a ${tone} tone.`,
|
|
50104
|
+
`You are a writing expert. Rewrite the text in a ${tone} tone. Always respond in the same language as the input text.`,
|
|
50105
50105
|
text
|
|
50106
50106
|
);
|
|
50107
50107
|
}
|
|
50108
50108
|
async continueWriting(text) {
|
|
50109
50109
|
return this.callOpenAI(
|
|
50110
|
-
"You are a creative writer. Continue writing from where the text ends.",
|
|
50110
|
+
"You are a creative writer. Continue writing from where the text ends. Always respond in the same language as the input text.",
|
|
50111
50111
|
text
|
|
50112
50112
|
);
|
|
50113
50113
|
}
|
|
50114
50114
|
async improveWriting(text) {
|
|
50115
50115
|
return this.callOpenAI(
|
|
50116
|
-
"You are a professional editor. Improve the text quality.",
|
|
50116
|
+
"You are a professional editor. Improve the text quality. Always respond in the same language as the input text.",
|
|
50117
50117
|
text
|
|
50118
50118
|
);
|
|
50119
50119
|
}
|
|
50120
50120
|
async generateIdeas(text) {
|
|
50121
50121
|
return this.callOpenAI(
|
|
50122
|
-
"You are a creative consultant. Generate ideas based on the topic.",
|
|
50122
|
+
"You are a creative consultant. Generate ideas based on the topic. Always respond in the same language as the input text.",
|
|
50123
50123
|
text
|
|
50124
50124
|
);
|
|
50125
50125
|
}
|
|
50126
50126
|
async complete(text) {
|
|
50127
50127
|
return this.callOpenAI(
|
|
50128
|
-
"You are a writing assistant. Complete the text naturally.",
|
|
50128
|
+
"You are a writing assistant. Complete the text naturally. Always respond in the same language as the input text.",
|
|
50129
50129
|
text
|
|
50130
50130
|
);
|
|
50131
50131
|
}
|
|
@@ -50164,25 +50164,27 @@ var ClaudeProvider = class {
|
|
|
50164
50164
|
}
|
|
50165
50165
|
}
|
|
50166
50166
|
async generateText(prompt) {
|
|
50167
|
-
return this.callClaude(prompt
|
|
50167
|
+
return this.callClaude(`${prompt}
|
|
50168
|
+
|
|
50169
|
+
IMPORTANT: Respond in the SAME LANGUAGE as the input text.`);
|
|
50168
50170
|
}
|
|
50169
50171
|
async rewrite(text) {
|
|
50170
|
-
return this.callClaude(`Rewrite this text to be clearer and more engaging:
|
|
50172
|
+
return this.callClaude(`Rewrite this text to be clearer and more engaging. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
|
|
50171
50173
|
|
|
50172
50174
|
${text}`);
|
|
50173
50175
|
}
|
|
50174
50176
|
async expand(text) {
|
|
50175
|
-
return this.callClaude(`Expand this text with more details:
|
|
50177
|
+
return this.callClaude(`Expand this text with more details. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
|
|
50176
50178
|
|
|
50177
50179
|
${text}`);
|
|
50178
50180
|
}
|
|
50179
50181
|
async summarize(text) {
|
|
50180
|
-
return this.callClaude(`Summarize this text concisely:
|
|
50182
|
+
return this.callClaude(`Summarize this text concisely. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
|
|
50181
50183
|
|
|
50182
50184
|
${text}`);
|
|
50183
50185
|
}
|
|
50184
50186
|
async fixGrammar(text) {
|
|
50185
|
-
return this.callClaude(`Fix grammar and spelling errors in:
|
|
50187
|
+
return this.callClaude(`Fix grammar and spelling errors. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
|
|
50186
50188
|
|
|
50187
50189
|
${text}`);
|
|
50188
50190
|
}
|
|
@@ -50192,27 +50194,27 @@ ${text}`);
|
|
|
50192
50194
|
${text}`);
|
|
50193
50195
|
}
|
|
50194
50196
|
async changeTone(text, tone) {
|
|
50195
|
-
return this.callClaude(`Rewrite in a ${tone} tone:
|
|
50197
|
+
return this.callClaude(`Rewrite in a ${tone} tone. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
|
|
50196
50198
|
|
|
50197
50199
|
${text}`);
|
|
50198
50200
|
}
|
|
50199
50201
|
async continueWriting(text) {
|
|
50200
|
-
return this.callClaude(`Continue writing from:
|
|
50202
|
+
return this.callClaude(`Continue writing from where this text ends. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
|
|
50201
50203
|
|
|
50202
50204
|
${text}`);
|
|
50203
50205
|
}
|
|
50204
50206
|
async improveWriting(text) {
|
|
50205
|
-
return this.callClaude(`Improve this text:
|
|
50207
|
+
return this.callClaude(`Improve this text. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
|
|
50206
50208
|
|
|
50207
50209
|
${text}`);
|
|
50208
50210
|
}
|
|
50209
50211
|
async generateIdeas(text) {
|
|
50210
|
-
return this.callClaude(`Generate ideas for:
|
|
50212
|
+
return this.callClaude(`Generate ideas for this topic. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
|
|
50211
50213
|
|
|
50212
50214
|
${text}`);
|
|
50213
50215
|
}
|
|
50214
50216
|
async complete(text) {
|
|
50215
|
-
return this.callClaude(`Complete:
|
|
50217
|
+
return this.callClaude(`Complete this text naturally. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
|
|
50216
50218
|
|
|
50217
50219
|
${text}`);
|
|
50218
50220
|
}
|
|
@@ -50367,7 +50369,8 @@ function RichTextEditor({
|
|
|
50367
50369
|
model: "gpt-3.5-turbo",
|
|
50368
50370
|
temperature: 0.7,
|
|
50369
50371
|
maxTokens: 1e3
|
|
50370
|
-
}
|
|
50372
|
+
},
|
|
50373
|
+
persistAISettings = true
|
|
50371
50374
|
}) {
|
|
50372
50375
|
const { hasProAccess, isLoading } = useSubscription();
|
|
50373
50376
|
if (!isLoading && !hasProAccess) {
|
|
@@ -50383,12 +50386,31 @@ function RichTextEditor({
|
|
|
50383
50386
|
] })
|
|
50384
50387
|
] }) }) });
|
|
50385
50388
|
}
|
|
50386
|
-
const [aiSettings, setAiSettings] = useState({
|
|
50387
|
-
|
|
50388
|
-
|
|
50389
|
-
|
|
50390
|
-
|
|
50391
|
-
|
|
50389
|
+
const [aiSettings, setAiSettings] = useState(() => {
|
|
50390
|
+
if (persistAISettings) {
|
|
50391
|
+
try {
|
|
50392
|
+
const stored = localStorage.getItem("moonui-ai-settings");
|
|
50393
|
+
if (stored) {
|
|
50394
|
+
const parsed = JSON.parse(stored);
|
|
50395
|
+
return {
|
|
50396
|
+
provider: aiConfig.provider || parsed.provider || "openai",
|
|
50397
|
+
apiKey: aiConfig.apiKey || parsed.apiKey || "",
|
|
50398
|
+
model: aiConfig.model || parsed.model || "gpt-3.5-turbo",
|
|
50399
|
+
temperature: aiConfig.temperature ?? parsed.temperature ?? 0.7,
|
|
50400
|
+
maxTokens: aiConfig.maxTokens ?? parsed.maxTokens ?? 1e3
|
|
50401
|
+
};
|
|
50402
|
+
}
|
|
50403
|
+
} catch (e) {
|
|
50404
|
+
console.error("Failed to load AI settings from localStorage:", e);
|
|
50405
|
+
}
|
|
50406
|
+
}
|
|
50407
|
+
return {
|
|
50408
|
+
provider: aiConfig.provider || "openai",
|
|
50409
|
+
apiKey: aiConfig.apiKey || "",
|
|
50410
|
+
model: aiConfig.model || "gpt-3.5-turbo",
|
|
50411
|
+
temperature: aiConfig.temperature ?? 0.7,
|
|
50412
|
+
maxTokens: aiConfig.maxTokens ?? 1e3
|
|
50413
|
+
};
|
|
50392
50414
|
});
|
|
50393
50415
|
const [isAiSettingsOpen, setIsAiSettingsOpen] = useState(false);
|
|
50394
50416
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
@@ -51524,13 +51546,61 @@ function RichTextEditor({
|
|
|
51524
51546
|
] })
|
|
51525
51547
|
] })
|
|
51526
51548
|
] }),
|
|
51527
|
-
/* @__PURE__ */
|
|
51528
|
-
|
|
51529
|
-
|
|
51530
|
-
|
|
51531
|
-
|
|
51532
|
-
|
|
51533
|
-
|
|
51549
|
+
persistAISettings && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
51550
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start space-x-2", children: [
|
|
51551
|
+
/* @__PURE__ */ jsx(
|
|
51552
|
+
MoonUICheckboxPro,
|
|
51553
|
+
{
|
|
51554
|
+
id: "rememberSettings",
|
|
51555
|
+
defaultChecked: true,
|
|
51556
|
+
onCheckedChange: (checked) => {
|
|
51557
|
+
if (!checked) {
|
|
51558
|
+
localStorage.removeItem("moonui-ai-settings");
|
|
51559
|
+
}
|
|
51560
|
+
}
|
|
51561
|
+
}
|
|
51562
|
+
),
|
|
51563
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-1.5 leading-none", children: [
|
|
51564
|
+
/* @__PURE__ */ jsx(
|
|
51565
|
+
MoonUILabelPro,
|
|
51566
|
+
{
|
|
51567
|
+
htmlFor: "rememberSettings",
|
|
51568
|
+
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
51569
|
+
children: "Remember my settings"
|
|
51570
|
+
}
|
|
51571
|
+
),
|
|
51572
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Save settings locally for future sessions" })
|
|
51573
|
+
] })
|
|
51574
|
+
] }),
|
|
51575
|
+
aiSettings.apiKey && /* @__PURE__ */ jsx("div", { className: "rounded-md bg-yellow-50 dark:bg-yellow-900/10 p-3", children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
51576
|
+
/* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx(Settings, { className: "h-4 w-4 text-yellow-400" }) }),
|
|
51577
|
+
/* @__PURE__ */ jsx("div", { className: "ml-3", children: /* @__PURE__ */ jsxs("p", { className: "text-xs text-yellow-800 dark:text-yellow-200", children: [
|
|
51578
|
+
/* @__PURE__ */ jsx("strong", { children: "Security Notice:" }),
|
|
51579
|
+
" API keys will be stored in your browser's local storage. For production use, consider using a server-side proxy."
|
|
51580
|
+
] }) })
|
|
51581
|
+
] }) })
|
|
51582
|
+
] }),
|
|
51583
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
51584
|
+
/* @__PURE__ */ jsx(
|
|
51585
|
+
MoonUIButtonPro,
|
|
51586
|
+
{
|
|
51587
|
+
variant: "outline",
|
|
51588
|
+
onClick: () => setIsAiSettingsOpen(false),
|
|
51589
|
+
children: "Cancel"
|
|
51590
|
+
}
|
|
51591
|
+
),
|
|
51592
|
+
/* @__PURE__ */ jsx(MoonUIButtonPro, { onClick: () => {
|
|
51593
|
+
if (persistAISettings) {
|
|
51594
|
+
const toStore = { ...aiSettings };
|
|
51595
|
+
localStorage.setItem("moonui-ai-settings", JSON.stringify(toStore));
|
|
51596
|
+
}
|
|
51597
|
+
setIsAiSettingsOpen(false);
|
|
51598
|
+
toast({
|
|
51599
|
+
title: "Settings saved",
|
|
51600
|
+
description: "Your AI settings have been updated."
|
|
51601
|
+
});
|
|
51602
|
+
}, children: "Save Settings" })
|
|
51603
|
+
] })
|
|
51534
51604
|
] })
|
|
51535
51605
|
] })
|
|
51536
51606
|
] })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.6",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -101,6 +101,7 @@ import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
|
|
|
101
101
|
import { MoonUIColorPickerPro as ColorPicker } from '../ui/color-picker';
|
|
102
102
|
import { Slider } from '../ui/slider';
|
|
103
103
|
import { toast } from '../ui/toast';
|
|
104
|
+
import { Checkbox } from '../ui/checkbox';
|
|
104
105
|
import { createAIProvider, type AIProvider as AIProviderInterface } from '../../lib/ai-providers';
|
|
105
106
|
|
|
106
107
|
// Type definitions for AI functionality
|
|
@@ -153,6 +154,15 @@ const getAIProvider = (settings: AISettingsType): AIProviderInterface | null =>
|
|
|
153
154
|
import './slash-commands.css';
|
|
154
155
|
import './table-styles.css';
|
|
155
156
|
|
|
157
|
+
export interface AIConfig {
|
|
158
|
+
provider?: 'openai' | 'claude' | 'gemini' | 'cohere';
|
|
159
|
+
apiKey?: string;
|
|
160
|
+
model?: string;
|
|
161
|
+
temperature?: number;
|
|
162
|
+
maxTokens?: number;
|
|
163
|
+
endpoint?: string; // For server-side proxy
|
|
164
|
+
}
|
|
165
|
+
|
|
156
166
|
interface RichTextEditorProps {
|
|
157
167
|
value?: string;
|
|
158
168
|
onChange?: (value: string) => void;
|
|
@@ -175,13 +185,8 @@ interface RichTextEditorProps {
|
|
|
175
185
|
color?: boolean;
|
|
176
186
|
ai?: boolean;
|
|
177
187
|
};
|
|
178
|
-
aiConfig?:
|
|
179
|
-
|
|
180
|
-
apiKey?: string;
|
|
181
|
-
model?: string;
|
|
182
|
-
temperature?: number;
|
|
183
|
-
maxTokens?: number;
|
|
184
|
-
};
|
|
188
|
+
aiConfig?: AIConfig;
|
|
189
|
+
persistAISettings?: boolean;
|
|
185
190
|
}
|
|
186
191
|
|
|
187
192
|
|
|
@@ -281,6 +286,7 @@ export function RichTextEditor({
|
|
|
281
286
|
temperature: 0.7,
|
|
282
287
|
maxTokens: 1000,
|
|
283
288
|
},
|
|
289
|
+
persistAISettings = true,
|
|
284
290
|
}: RichTextEditorProps) {
|
|
285
291
|
// Pro access kontrolü
|
|
286
292
|
const { hasProAccess, isLoading } = useSubscription();
|
|
@@ -316,12 +322,35 @@ export function RichTextEditor({
|
|
|
316
322
|
);
|
|
317
323
|
}
|
|
318
324
|
|
|
319
|
-
const [aiSettings, setAiSettings] = useState<AISettingsType>({
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
+
const [aiSettings, setAiSettings] = useState<AISettingsType>(() => {
|
|
326
|
+
// Öncelik sırası: Props > LocalStorage > Varsayılan
|
|
327
|
+
if (persistAISettings) {
|
|
328
|
+
try {
|
|
329
|
+
const stored = localStorage.getItem('moonui-ai-settings');
|
|
330
|
+
if (stored) {
|
|
331
|
+
const parsed = JSON.parse(stored);
|
|
332
|
+
// Props'tan gelen değerler her zaman öncelikli
|
|
333
|
+
return {
|
|
334
|
+
provider: aiConfig.provider || parsed.provider || 'openai',
|
|
335
|
+
apiKey: aiConfig.apiKey || parsed.apiKey || '',
|
|
336
|
+
model: aiConfig.model || parsed.model || 'gpt-3.5-turbo',
|
|
337
|
+
temperature: aiConfig.temperature ?? parsed.temperature ?? 0.7,
|
|
338
|
+
maxTokens: aiConfig.maxTokens ?? parsed.maxTokens ?? 1000,
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
} catch (e) {
|
|
342
|
+
console.error('Failed to load AI settings from localStorage:', e);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// LocalStorage yoksa veya persist kapalıysa props/varsayılan değerleri kullan
|
|
347
|
+
return {
|
|
348
|
+
provider: aiConfig.provider || 'openai',
|
|
349
|
+
apiKey: aiConfig.apiKey || '',
|
|
350
|
+
model: aiConfig.model || 'gpt-3.5-turbo',
|
|
351
|
+
temperature: aiConfig.temperature ?? 0.7,
|
|
352
|
+
maxTokens: aiConfig.maxTokens ?? 1000,
|
|
353
|
+
};
|
|
325
354
|
});
|
|
326
355
|
const [isAiSettingsOpen, setIsAiSettingsOpen] = useState(false);
|
|
327
356
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
@@ -1523,8 +1552,64 @@ export function RichTextEditor({
|
|
|
1523
1552
|
</div>
|
|
1524
1553
|
</div>
|
|
1525
1554
|
</div>
|
|
1526
|
-
|
|
1555
|
+
{persistAISettings && (
|
|
1556
|
+
<div className="space-y-4">
|
|
1557
|
+
<div className="flex items-start space-x-2">
|
|
1558
|
+
<Checkbox
|
|
1559
|
+
id="rememberSettings"
|
|
1560
|
+
defaultChecked
|
|
1561
|
+
onCheckedChange={(checked) => {
|
|
1562
|
+
if (!checked) {
|
|
1563
|
+
localStorage.removeItem('moonui-ai-settings');
|
|
1564
|
+
}
|
|
1565
|
+
}}
|
|
1566
|
+
/>
|
|
1567
|
+
<div className="grid gap-1.5 leading-none">
|
|
1568
|
+
<Label
|
|
1569
|
+
htmlFor="rememberSettings"
|
|
1570
|
+
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1571
|
+
>
|
|
1572
|
+
Remember my settings
|
|
1573
|
+
</Label>
|
|
1574
|
+
<p className="text-xs text-muted-foreground">
|
|
1575
|
+
Save settings locally for future sessions
|
|
1576
|
+
</p>
|
|
1577
|
+
</div>
|
|
1578
|
+
</div>
|
|
1579
|
+
|
|
1580
|
+
{aiSettings.apiKey && (
|
|
1581
|
+
<div className="rounded-md bg-yellow-50 dark:bg-yellow-900/10 p-3">
|
|
1582
|
+
<div className="flex">
|
|
1583
|
+
<div className="flex-shrink-0">
|
|
1584
|
+
<Settings className="h-4 w-4 text-yellow-400" />
|
|
1585
|
+
</div>
|
|
1586
|
+
<div className="ml-3">
|
|
1587
|
+
<p className="text-xs text-yellow-800 dark:text-yellow-200">
|
|
1588
|
+
<strong>Security Notice:</strong> API keys will be stored in your browser's local storage.
|
|
1589
|
+
For production use, consider using a server-side proxy.
|
|
1590
|
+
</p>
|
|
1591
|
+
</div>
|
|
1592
|
+
</div>
|
|
1593
|
+
</div>
|
|
1594
|
+
)}
|
|
1595
|
+
</div>
|
|
1596
|
+
)}
|
|
1597
|
+
|
|
1598
|
+
<div className="flex justify-end gap-2">
|
|
1599
|
+
<Button
|
|
1600
|
+
variant="outline"
|
|
1601
|
+
onClick={() => setIsAiSettingsOpen(false)}
|
|
1602
|
+
>
|
|
1603
|
+
Cancel
|
|
1604
|
+
</Button>
|
|
1527
1605
|
<Button onClick={() => {
|
|
1606
|
+
// LocalStorage'a kaydet
|
|
1607
|
+
if (persistAISettings) {
|
|
1608
|
+
const toStore = { ...aiSettings };
|
|
1609
|
+
// Güvenlik için API key'i opsiyonel olarak kaydet
|
|
1610
|
+
localStorage.setItem('moonui-ai-settings', JSON.stringify(toStore));
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1528
1613
|
setIsAiSettingsOpen(false);
|
|
1529
1614
|
toast({
|
|
1530
1615
|
title: "Settings saved",
|
package/src/lib/ai-providers.ts
CHANGED
|
@@ -94,22 +94,22 @@ export class GeminiProvider implements AIProvider {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
async rewrite(text: string): Promise<string> {
|
|
97
|
-
const prompt = `Rewrite the following text to make it clearer and more engaging while maintaining the same meaning. Only return the rewritten text, nothing else:\n\n${text}`;
|
|
97
|
+
const prompt = `Rewrite the following text to make it clearer and more engaging while maintaining the same meaning. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the rewritten text, nothing else:\n\n${text}`;
|
|
98
98
|
return this.callGeminiAPI(prompt);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
async expand(text: string): Promise<string> {
|
|
102
|
-
const prompt = `Expand the following text with more details, examples, and explanations. Only return the expanded text, nothing else:\n\n${text}`;
|
|
102
|
+
const prompt = `Expand the following text with more details, examples, and explanations. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the expanded text, nothing else:\n\n${text}`;
|
|
103
103
|
return this.callGeminiAPI(prompt);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
async summarize(text: string): Promise<string> {
|
|
107
|
-
const prompt = `Summarize the following text concisely while keeping the main points. Only return the summary, nothing else:\n\n${text}`;
|
|
107
|
+
const prompt = `Summarize the following text concisely while keeping the main points. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the summary, nothing else:\n\n${text}`;
|
|
108
108
|
return this.callGeminiAPI(prompt);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
async fixGrammar(text: string): Promise<string> {
|
|
112
|
-
const prompt = `Fix any grammar and spelling errors in the following text. Only return the corrected text, nothing else:\n\n${text}`;
|
|
112
|
+
const prompt = `Fix any grammar and spelling errors in the following text. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the corrected text, nothing else:\n\n${text}`;
|
|
113
113
|
return this.callGeminiAPI(prompt);
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -127,27 +127,27 @@ export class GeminiProvider implements AIProvider {
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
const toneDesc = toneDescriptions[tone] || tone;
|
|
130
|
-
const prompt = `Rewrite the following text in a ${toneDesc} tone. Only return the rewritten text, nothing else:\n\n${text}`;
|
|
130
|
+
const prompt = `Rewrite the following text in a ${toneDesc} tone. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the rewritten text, nothing else:\n\n${text}`;
|
|
131
131
|
return this.callGeminiAPI(prompt);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
async continueWriting(text: string): Promise<string> {
|
|
135
|
-
const prompt = `Continue writing from where this text ends. Only return the continuation, nothing else:\n\n${text}`;
|
|
135
|
+
const prompt = `Continue writing from where this text ends. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the continuation, nothing else:\n\n${text}`;
|
|
136
136
|
return this.callGeminiAPI(prompt);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
async improveWriting(text: string): Promise<string> {
|
|
140
|
-
const prompt = `Improve the following text by making it more compelling, clear, and well-structured. Only return the improved text, nothing else:\n\n${text}`;
|
|
140
|
+
const prompt = `Improve the following text by making it more compelling, clear, and well-structured. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the improved text, nothing else:\n\n${text}`;
|
|
141
141
|
return this.callGeminiAPI(prompt);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
async generateIdeas(text: string): Promise<string> {
|
|
145
|
-
const prompt = `Generate creative ideas and suggestions based on this topic. Format as a bullet list:\n\n${text}`;
|
|
145
|
+
const prompt = `Generate creative ideas and suggestions based on this topic. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Format as a bullet list:\n\n${text}`;
|
|
146
146
|
return this.callGeminiAPI(prompt);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
async complete(text: string): Promise<string> {
|
|
150
|
-
const prompt = `Complete this text naturally. Only return the completion, nothing else:\n\n${text}`;
|
|
150
|
+
const prompt = `Complete this text naturally. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the completion, nothing else:\n\n${text}`;
|
|
151
151
|
return this.callGeminiAPI(prompt);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
@@ -199,33 +199,33 @@ export class OpenAIProvider implements AIProvider {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
async generateText(prompt: string): Promise<string> {
|
|
202
|
-
return this.callOpenAI('You are a helpful writing assistant.', prompt);
|
|
202
|
+
return this.callOpenAI('You are a helpful writing assistant. Always respond in the same language as the input text.', prompt);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
async rewrite(text: string): Promise<string> {
|
|
206
206
|
return this.callOpenAI(
|
|
207
|
-
'You are a professional editor. Rewrite text to be clearer and more engaging.',
|
|
207
|
+
'You are a professional editor. Rewrite text to be clearer and more engaging. Always respond in the same language as the input text.',
|
|
208
208
|
text
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
async expand(text: string): Promise<string> {
|
|
213
213
|
return this.callOpenAI(
|
|
214
|
-
'You are a content writer. Expand the given text with more details and examples.',
|
|
214
|
+
'You are a content writer. Expand the given text with more details and examples. Always respond in the same language as the input text.',
|
|
215
215
|
text
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
async summarize(text: string): Promise<string> {
|
|
220
220
|
return this.callOpenAI(
|
|
221
|
-
'You are a summarization expert. Create concise summaries.',
|
|
221
|
+
'You are a summarization expert. Create concise summaries. Always respond in the same language as the input text.',
|
|
222
222
|
text
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
async fixGrammar(text: string): Promise<string> {
|
|
227
227
|
return this.callOpenAI(
|
|
228
|
-
'You are a grammar expert. Fix all grammar and spelling errors.',
|
|
228
|
+
'You are a grammar expert. Fix all grammar and spelling errors. Always respond in the same language as the input text.',
|
|
229
229
|
text
|
|
230
230
|
);
|
|
231
231
|
}
|
|
@@ -239,35 +239,35 @@ export class OpenAIProvider implements AIProvider {
|
|
|
239
239
|
|
|
240
240
|
async changeTone(text: string, tone: string): Promise<string> {
|
|
241
241
|
return this.callOpenAI(
|
|
242
|
-
`You are a writing expert. Rewrite the text in a ${tone} tone.`,
|
|
242
|
+
`You are a writing expert. Rewrite the text in a ${tone} tone. Always respond in the same language as the input text.`,
|
|
243
243
|
text
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
async continueWriting(text: string): Promise<string> {
|
|
248
248
|
return this.callOpenAI(
|
|
249
|
-
'You are a creative writer. Continue writing from where the text ends.',
|
|
249
|
+
'You are a creative writer. Continue writing from where the text ends. Always respond in the same language as the input text.',
|
|
250
250
|
text
|
|
251
251
|
);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
async improveWriting(text: string): Promise<string> {
|
|
255
255
|
return this.callOpenAI(
|
|
256
|
-
'You are a professional editor. Improve the text quality.',
|
|
256
|
+
'You are a professional editor. Improve the text quality. Always respond in the same language as the input text.',
|
|
257
257
|
text
|
|
258
258
|
);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
async generateIdeas(text: string): Promise<string> {
|
|
262
262
|
return this.callOpenAI(
|
|
263
|
-
'You are a creative consultant. Generate ideas based on the topic.',
|
|
263
|
+
'You are a creative consultant. Generate ideas based on the topic. Always respond in the same language as the input text.',
|
|
264
264
|
text
|
|
265
265
|
);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
async complete(text: string): Promise<string> {
|
|
269
269
|
return this.callOpenAI(
|
|
270
|
-
'You are a writing assistant. Complete the text naturally.',
|
|
270
|
+
'You are a writing assistant. Complete the text naturally. Always respond in the same language as the input text.',
|
|
271
271
|
text
|
|
272
272
|
);
|
|
273
273
|
}
|
|
@@ -315,23 +315,23 @@ export class ClaudeProvider implements AIProvider {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
async generateText(prompt: string): Promise<string> {
|
|
318
|
-
return this.callClaude(prompt);
|
|
318
|
+
return this.callClaude(`${prompt}\n\nIMPORTANT: Respond in the SAME LANGUAGE as the input text.`);
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
async rewrite(text: string): Promise<string> {
|
|
322
|
-
return this.callClaude(`Rewrite this text to be clearer and more engaging:\n\n${text}`);
|
|
322
|
+
return this.callClaude(`Rewrite this text to be clearer and more engaging. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
async expand(text: string): Promise<string> {
|
|
326
|
-
return this.callClaude(`Expand this text with more details:\n\n${text}`);
|
|
326
|
+
return this.callClaude(`Expand this text with more details. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
async summarize(text: string): Promise<string> {
|
|
330
|
-
return this.callClaude(`Summarize this text concisely:\n\n${text}`);
|
|
330
|
+
return this.callClaude(`Summarize this text concisely. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
async fixGrammar(text: string): Promise<string> {
|
|
334
|
-
return this.callClaude(`Fix grammar and spelling errors in:\n\n${text}`);
|
|
334
|
+
return this.callClaude(`Fix grammar and spelling errors. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
async translate(text: string, targetLang: string): Promise<string> {
|
|
@@ -339,23 +339,23 @@ export class ClaudeProvider implements AIProvider {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
async changeTone(text: string, tone: string): Promise<string> {
|
|
342
|
-
return this.callClaude(`Rewrite in a ${tone} tone:\n\n${text}`);
|
|
342
|
+
return this.callClaude(`Rewrite in a ${tone} tone. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
async continueWriting(text: string): Promise<string> {
|
|
346
|
-
return this.callClaude(`Continue writing from:\n\n${text}`);
|
|
346
|
+
return this.callClaude(`Continue writing from where this text ends. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
async improveWriting(text: string): Promise<string> {
|
|
350
|
-
return this.callClaude(`Improve this text:\n\n${text}`);
|
|
350
|
+
return this.callClaude(`Improve this text. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
async generateIdeas(text: string): Promise<string> {
|
|
354
|
-
return this.callClaude(`Generate ideas for:\n\n${text}`);
|
|
354
|
+
return this.callClaude(`Generate ideas for this topic. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
async complete(text: string): Promise<string> {
|
|
358
|
-
return this.callClaude(`Complete:\n\n${text}`);
|
|
358
|
+
return this.callClaude(`Complete this text naturally. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
|