nam-rich-text-editor 9.0.1 → 9.0.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.
package/README.md CHANGED
@@ -10,6 +10,8 @@ npm install nam-rich-text-editor
10
10
 
11
11
  ## Usage
12
12
 
13
+ ### As a Class
14
+
13
15
  ```javascript
14
16
  import { RichTextEditor } from "nam-rich-text-editor";
15
17
 
@@ -24,6 +26,26 @@ const html = editor.getHTML();
24
26
  editor.setHTML("<p>Hello <strong>world</strong>!</p>");
25
27
  ```
26
28
 
29
+ ### As a React Component
30
+
31
+ ```jsx
32
+ import React from "react";
33
+ import { RichTextEditorComponent } from "nam-rich-text-editor";
34
+
35
+ const MyEditor = () => {
36
+ const handleChange = (html) => {
37
+ console.log("HTML content:", html);
38
+ };
39
+
40
+ return (
41
+ <RichTextEditorComponent
42
+ onChange={handleChange}
43
+ initialValue="<p>Start editing...</p>"
44
+ />
45
+ );
46
+ };
47
+ ```
48
+
27
49
  ## Features
28
50
 
29
51
  - Bold, Italic, Underline formatting
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface RichTextEditorProps {
3
+ onChange?: (html: string) => void;
4
+ initialValue?: string;
5
+ }
6
+ declare const RichTextEditorComponent: React.FC<RichTextEditorProps>;
7
+ export default RichTextEditorComponent;
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { RichTextEditor } from "./RichTextEditor";
2
+ export { default as RichTextEditorComponent } from "./RichTextEditorComponent";
package/dist/main.d.ts CHANGED
@@ -1 +1 @@
1
- import "./style.css";
1
+ export {};