@moontra/moonui-pro 2.8.12 → 2.8.13

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.mjs CHANGED
@@ -49975,7 +49975,7 @@ ${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. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the summary, nothing else:
49978
+ const prompt = `Create a comprehensive and detailed summary of the following text. Include all key points, important details, main arguments, and significant examples. The summary should be thorough enough to understand the full context and meaning of the original text, not just a brief overview. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the detailed summary, nothing else:
49979
49979
 
49980
49980
  ${text}`;
49981
49981
  return this.callGeminiAPI(prompt);
@@ -50083,7 +50083,7 @@ var OpenAIProvider = class {
50083
50083
  }
50084
50084
  async summarize(text) {
50085
50085
  return this.callOpenAI(
50086
- "You are a summarization expert. Create concise summaries. Always respond in the same language as the input text.",
50086
+ "You are a summarization expert. Create comprehensive and detailed summaries that include all key points, important details, main arguments, and significant examples. The summary should be thorough enough to understand the full context and meaning of the original text, not just a brief overview. Always respond in the same language as the input text.",
50087
50087
  text
50088
50088
  );
50089
50089
  }
@@ -50179,7 +50179,7 @@ ${text}`);
50179
50179
  ${text}`);
50180
50180
  }
50181
50181
  async summarize(text) {
50182
- return this.callClaude(`Summarize this text concisely. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
50182
+ return this.callClaude(`Create a comprehensive and detailed summary of the following text. Include all key points, important details, main arguments, and significant examples. The summary should be thorough enough to understand the full context and meaning of the original text, not just a brief overview. IMPORTANT: Respond in the SAME LANGUAGE as the input text:
50183
50183
 
50184
50184
  ${text}`);
50185
50185
  }
@@ -50514,7 +50514,7 @@ function RichTextEditor({
50514
50514
  }
50515
50515
  }
50516
50516
  let currentIndex = 0;
50517
- const typeSpeed = 30;
50517
+ const typeSpeed = 5;
50518
50518
  const typeNextChar = () => {
50519
50519
  if (currentIndex < content.length && isTypingRef.current) {
50520
50520
  const nextChar = content[currentIndex];
@@ -50808,10 +50808,12 @@ function RichTextEditor({
50808
50808
  return;
50809
50809
  const selection = editor.state.selection;
50810
50810
  const selectedText = editor.state.doc.textBetween(selection.from, selection.to, " ");
50811
- if (!selectedText && action !== "complete") {
50811
+ const fullText = editor.getText();
50812
+ const textToProcess = selectedText || fullText;
50813
+ if (!textToProcess && action !== "complete") {
50812
50814
  toast({
50813
- title: "No text selected",
50814
- description: "Please select some text first.",
50815
+ title: "No content available",
50816
+ description: "Please write some text first.",
50815
50817
  variant: "destructive"
50816
50818
  });
50817
50819
  return;
@@ -50823,13 +50825,13 @@ function RichTextEditor({
50823
50825
  duration: 6e4
50824
50826
  // Long duration
50825
50827
  });
50826
- const result = await callAI(action, selectedText || editor.getText(), targetLanguage);
50828
+ const result = await callAI(action, textToProcess, targetLanguage);
50827
50829
  processingToast.dismiss();
50828
50830
  if (result) {
50829
50831
  if (shouldUseModal(action)) {
50830
50832
  setPreviewContent(result);
50831
50833
  setPreviewAction(action);
50832
- setPreviewOriginalText(selectedText || editor.getText());
50834
+ setPreviewOriginalText(textToProcess);
50833
50835
  setIsAiPreviewOpen(true);
50834
50836
  } else {
50835
50837
  applyAIContentToEditor(result, !!selectedText);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.8.12",
3
+ "version": "2.8.13",
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",
@@ -498,7 +498,7 @@ export function RichTextEditor({
498
498
  }
499
499
 
500
500
  let currentIndex = 0;
501
- const typeSpeed = 30; // ms per character
501
+ const typeSpeed = 5; // ms per character - much faster for better UX
502
502
 
503
503
  const typeNextChar = () => {
504
504
  if (currentIndex < content.length && isTypingRef.current) {
@@ -812,11 +812,15 @@ export function RichTextEditor({
812
812
 
813
813
  const selection = editor.state.selection;
814
814
  const selectedText = editor.state.doc.textBetween(selection.from, selection.to, ' ');
815
+ const fullText = editor.getText();
815
816
 
816
- if (!selectedText && action !== 'complete') {
817
+ // If no text is selected, use the full editor content as prompt
818
+ const textToProcess = selectedText || fullText;
819
+
820
+ if (!textToProcess && action !== 'complete') {
817
821
  toast({
818
- title: "No text selected",
819
- description: "Please select some text first.",
822
+ title: "No content available",
823
+ description: "Please write some text first.",
820
824
  variant: "destructive",
821
825
  });
822
826
  return;
@@ -832,7 +836,7 @@ export function RichTextEditor({
832
836
  duration: 60000, // Long duration
833
837
  });
834
838
 
835
- const result = await callAI(action, selectedText || editor.getText(), targetLanguage);
839
+ const result = await callAI(action, textToProcess, targetLanguage);
836
840
 
837
841
  // Dismiss processing toast
838
842
  processingToast.dismiss();
@@ -843,7 +847,7 @@ export function RichTextEditor({
843
847
  // Open preview modal instead of directly applying
844
848
  setPreviewContent(result);
845
849
  setPreviewAction(action);
846
- setPreviewOriginalText(selectedText || editor.getText());
850
+ setPreviewOriginalText(textToProcess);
847
851
  setIsAiPreviewOpen(true);
848
852
  } else {
849
853
  // Apply directly with typewriter effect (for rewrite, fix grammar, tone changes, etc.)
@@ -104,7 +104,7 @@ export class GeminiProvider implements AIProvider {
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. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the summary, nothing else:\n\n${text}`;
107
+ const prompt = `Create a comprehensive and detailed summary of the following text. Include all key points, important details, main arguments, and significant examples. The summary should be thorough enough to understand the full context and meaning of the original text, not just a brief overview. IMPORTANT: Respond in the SAME LANGUAGE as the input text. Only return the detailed summary, nothing else:\n\n${text}`;
108
108
  return this.callGeminiAPI(prompt);
109
109
  }
110
110
 
@@ -218,7 +218,7 @@ export class OpenAIProvider implements AIProvider {
218
218
 
219
219
  async summarize(text: string): Promise<string> {
220
220
  return this.callOpenAI(
221
- 'You are a summarization expert. Create concise summaries. Always respond in the same language as the input text.',
221
+ 'You are a summarization expert. Create comprehensive and detailed summaries that include all key points, important details, main arguments, and significant examples. The summary should be thorough enough to understand the full context and meaning of the original text, not just a brief overview. Always respond in the same language as the input text.',
222
222
  text
223
223
  );
224
224
  }
@@ -327,7 +327,7 @@ export class ClaudeProvider implements AIProvider {
327
327
  }
328
328
 
329
329
  async summarize(text: string): Promise<string> {
330
- return this.callClaude(`Summarize this text concisely. IMPORTANT: Respond in the SAME LANGUAGE as the input text:\n\n${text}`);
330
+ return this.callClaude(`Create a comprehensive and detailed summary of the following text. Include all key points, important details, main arguments, and significant examples. The summary should be thorough enough to understand the full context and meaning of the original text, not just a brief overview. 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> {