@ihsanabuhanifah/react-math-editor 1.0.1 → 1.1.0
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/README.md +5 -2
- package/dist/components/SmartContentEditor.d.ts +27 -0
- package/dist/index.cjs +98 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10237 -9207
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,14 +13,17 @@ Designed specifically for educational platforms, exam builders (CBT), question b
|
|
|
13
13
|
|
|
14
14
|
## ✨ Features
|
|
15
15
|
|
|
16
|
+
- 🧠 **SmartContentEditor Included:** Advanced editor supporting resizable & alignable images (25%, 50%, 75%, 100%), document attachments, YouTube video embeds, and AI paste modal.
|
|
16
17
|
- 📐 **Interactive LaTeX Math Formulas:** Popup dialog with live KaTeX preview. Click any formula chip inside the editor to edit it seamlessly.
|
|
17
18
|
- 📘 **Built-in Formula Cheat Sheet:** Comprehensive LaTeX dictionary covering Algebra, Trigonometry, Calculus, Matrices, and Logic.
|
|
18
19
|
- 📊 **Rich Table Support:** Insert tables (3x3), visually add/remove rows and columns, delete tables.
|
|
19
20
|
- 📋 **Auto-convert Markdown Tables:** Copy-paste markdown tables from AI assistants (ChatGPT, Claude, DeepSeek) and they automatically convert into interactive HTML tables.
|
|
21
|
+
- 🤖 **Smart AI Paste:** Dedicated modal & paste listener that formats markdown from AI into clean visual Tiptap nodes.
|
|
22
|
+
- 🎥 **YouTube & Attachment Embeds:** Embed responsive 16:9 YouTube videos and downloadable document attachments.
|
|
20
23
|
- 💻 **Syntax Highlighted Code Blocks:** Pre-configured code blocks with syntax highlighting using `highlight.js`.
|
|
21
|
-
- 🖼️ **Vendor-Agnostic
|
|
24
|
+
- 🖼️ **Vendor-Agnostic Uploads:** Async callback props (`onUploadImage`, `onUploadFile`) connect to any storage backend.
|
|
22
25
|
- 🎨 **Self-Contained Styling:** Bundled standalone CSS (`style.css`), no TailwindCSS setup required on the consumer application.
|
|
23
|
-
- 👁️ **RenderMathHTML Viewer:** Companion lightweight component to safely render and display saved HTML content
|
|
26
|
+
- 👁️ **RenderMathHTML Viewer:** Companion lightweight component to safely render and display saved HTML content.
|
|
24
27
|
|
|
25
28
|
---
|
|
26
29
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare let lastActiveSmartEditor: any;
|
|
4
|
+
export declare function setLastActiveSmartEditor(ed: any): void;
|
|
5
|
+
export declare function getLastActiveSmartEditor(): any;
|
|
6
|
+
export declare function parseYouTubeEmbedUrl(url: string): string | null;
|
|
7
|
+
export declare function convertAiMarkdownToTipTapHtml(markdown: string): string;
|
|
8
|
+
export interface SmartContentEditorProps {
|
|
9
|
+
value: string;
|
|
10
|
+
handleChange?: (html: string) => void;
|
|
11
|
+
onChange?: (html: string) => void;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
minHeight?: number;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
onUploadImage?: (file: File) => Promise<string>;
|
|
16
|
+
onUploadFile?: (file: File) => Promise<{
|
|
17
|
+
url: string;
|
|
18
|
+
name: string;
|
|
19
|
+
size?: string | number;
|
|
20
|
+
}>;
|
|
21
|
+
showMathGraph?: boolean;
|
|
22
|
+
onPreview?: () => void;
|
|
23
|
+
error?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function SmartContentEditor({ value, handleChange, onChange, readOnly, minHeight, placeholder, onUploadImage, onUploadFile, showMathGraph, onPreview, error, className, }: SmartContentEditorProps): React.JSX.Element;
|
|
27
|
+
export default SmartContentEditor;
|