@oix1987/yjd 1.0.0 → 1.0.2

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 (58) hide show
  1. package/README.md +73 -22
  2. package/dist/rich-editor.esm.js +2 -0
  3. package/dist/rich-editor.esm.js.map +1 -0
  4. package/dist/rich-editor.min.js +2 -0
  5. package/dist/rich-editor.min.js.map +1 -0
  6. package/package.json +12 -7
  7. package/index.js +0 -221
  8. package/lib/core/editor.js +0 -1175
  9. package/lib/core/format.js +0 -542
  10. package/lib/core/module.js +0 -81
  11. package/lib/core/registry.js +0 -152
  12. package/lib/formats/background.js +0 -212
  13. package/lib/formats/bold.js +0 -67
  14. package/lib/formats/capitalization.js +0 -563
  15. package/lib/formats/color.js +0 -165
  16. package/lib/formats/emoji.js +0 -282
  17. package/lib/formats/font-family.js +0 -547
  18. package/lib/formats/heading.js +0 -502
  19. package/lib/formats/image.js +0 -344
  20. package/lib/formats/import.js +0 -385
  21. package/lib/formats/indent.js +0 -297
  22. package/lib/formats/italic.js +0 -27
  23. package/lib/formats/line-height.js +0 -558
  24. package/lib/formats/link.js +0 -251
  25. package/lib/formats/list.js +0 -635
  26. package/lib/formats/strike.js +0 -31
  27. package/lib/formats/subscript.js +0 -36
  28. package/lib/formats/superscript.js +0 -35
  29. package/lib/formats/table.js +0 -288
  30. package/lib/formats/tag.js +0 -304
  31. package/lib/formats/text-align.js +0 -421
  32. package/lib/formats/text-size.js +0 -497
  33. package/lib/formats/underline.js +0 -30
  34. package/lib/formats/video.js +0 -372
  35. package/lib/modules/block-toolbar.js +0 -628
  36. package/lib/modules/code-view.js +0 -434
  37. package/lib/modules/history.js +0 -410
  38. package/lib/modules/resize-handles.js +0 -677
  39. package/lib/modules/table-toolbar.js +0 -618
  40. package/lib/modules/toolbar.js +0 -424
  41. package/lib/styles-loader.js +0 -144
  42. package/lib/styles.css +0 -2123
  43. package/lib/ui/color-picker.js +0 -296
  44. package/lib/ui/customselect.js +0 -319
  45. package/lib/ui/emoji-picker.js +0 -196
  46. package/lib/ui/icons.js +0 -413
  47. package/lib/ui/image-popup.js +0 -444
  48. package/lib/ui/import-popup.js +0 -288
  49. package/lib/ui/link-popup.js +0 -191
  50. package/lib/ui/list-picker.js +0 -307
  51. package/lib/ui/select-button.js +0 -61
  52. package/lib/ui/table-popup.js +0 -171
  53. package/lib/ui/tag-popup.js +0 -249
  54. package/lib/ui/text-align-picker.js +0 -281
  55. package/lib/ui/video-popup.js +0 -422
  56. package/lib/utils/history-helper.js +0 -50
  57. package/lib/utils/popup-helper.js +0 -219
  58. package/lib/utils/popup-positioning.js +0 -231
package/README.md CHANGED
@@ -1,21 +1,30 @@
1
- # Rich Text Editor
1
+ # @oix1987/yjd - Professional Rich Text Editor
2
2
 
3
- A powerful rich text editor with real-time content change tracking.
3
+ A powerful, commercial-grade rich text editor with real-time content change tracking for web applications. Built with vanilla JavaScript for maximum performance and compatibility.
4
4
 
5
- ## Features
5
+ ## 🚀 Features
6
6
 
7
- - Rich text formatting (Bold, Italic, Underline, Strikethrough, etc.)
8
- - Real-time content change tracking with `onChange` callback
9
- - Modern UI with customizable toolbar
10
- - Support for images, tables, links, and more
11
- - TypeScript support
7
+ - **Rich Text Formatting**: Bold, Italic, Underline, Strikethrough, Subscript, Superscript
8
+ - **Advanced Formatting**: Text alignment, line height, font family, text size, background colors
9
+ - **Content Management**: Images, tables, links, lists, emojis, videos
10
+ - **Real-time Tracking**: `onChange` callback for live content monitoring
11
+ - **Modern UI**: Customizable toolbar with intuitive controls
12
+ - **TypeScript Support**: Full type definitions included
13
+ - **Lightweight**: Pure JavaScript implementation, no heavy dependencies
14
+ - **Cross-browser**: Compatible with all modern browsers
12
15
 
13
- ## Usage
16
+ ## 📦 Installation
14
17
 
15
- ### Basic Usage
18
+ ```bash
19
+ npm install @oix1987/yjd
20
+ ```
21
+
22
+ ## 💻 Usage
23
+
24
+ ### Basic Implementation
16
25
 
17
26
  ```javascript
18
- import RichEditor from "./index.js";
27
+ import RichEditor from "@oix1987/yjd";
19
28
 
20
29
  const editor = new RichEditor("#editor-container", {
21
30
  content: "<p>Initial content</p>",
@@ -32,14 +41,33 @@ const editor = new RichEditor("#editor-container", {
32
41
  });
33
42
  ```
34
43
 
35
- ### Options
44
+ ### CDN Usage
45
+
46
+ ```html
47
+ <!-- Using jsDelivr CDN -->
48
+ <script src="https://cdn.jsdelivr.net/npm/@oix1987/yjd@1.0.2/dist/rich-editor.min.js"></script>
49
+ <script>
50
+ const editor = new RichEditor("#editor-container", {
51
+ // configuration options
52
+ });
53
+ </script>
54
+ ```
55
+
56
+ ### Alternative CDN
57
+
58
+ ```html
59
+ <!-- Using unpkg CDN -->
60
+ <script src="https://unpkg.com/@oix1987/yjd@1.0.2/dist/rich-editor.min.js"></script>
61
+ ```
62
+
63
+ ## ⚙️ Configuration Options
36
64
 
37
65
  | Option | Type | Default | Description |
38
66
  | ------------- | -------- | -------------- | --------------------------------------------- |
39
67
  | `content` | string | null | Initial content for the editor |
40
68
  | `height` | number | 400 | Editor height in pixels |
41
69
  | `width` | number | 800 | Editor width in pixels |
42
- | `theme` | string | 'light' | Editor theme |
70
+ | `theme` | string | 'light' | Editor theme (light/dark) |
43
71
  | `placeholder` | string | 'Type here...' | Placeholder text |
44
72
  | `onChange` | function | undefined | Callback function called when content changes |
45
73
 
@@ -64,9 +92,9 @@ onChange: (content) => {
64
92
  };
65
93
  ```
66
94
 
67
- ## Events
95
+ ## 🎯 Events
68
96
 
69
- The editor also supports event listeners:
97
+ The editor supports comprehensive event handling:
70
98
 
71
99
  ```javascript
72
100
  // Listen for text changes
@@ -74,18 +102,41 @@ editor.on("text-change", (content) => {
74
102
  console.log("Text changed:", content);
75
103
  });
76
104
 
105
+ // Listen for focus events
106
+ editor.on("focus", () => {
107
+ console.log("Editor focused");
108
+ });
109
+
77
110
  // Remove event listener
78
111
  editor.off("text-change", handler);
79
112
  ```
80
113
 
81
- ## Methods
114
+ ## 🔧 API Methods
115
+
116
+ | Method | Description | Parameters | Returns |
117
+ | --------------------- | ------------------------ | ---------------------------------- | -------- |
118
+ | `getContent()` | Get current HTML content | - | `string` |
119
+ | `setContent(content)` | Set editor content | `content: string` | `void` |
120
+ | `focus()` | Focus the editor | - | `void` |
121
+ | `on(event, handler)` | Add event listener | `event: string, handler: function` | `void` |
122
+ | `off(event, handler)` | Remove event listener | `event: string, handler: function` | `void` |
123
+
124
+ ## 💼 Commercial License
125
+
126
+ This is a commercial product. For licensing information and pricing, please contact:
127
+
128
+ - **Author**: Oix1987
129
+ - **License**: ISC (Commercial)
130
+ - **Version**: 1.0.1
131
+
132
+ ## 📄 License
133
+
134
+ Copyright (c) 2024 Oix1987. All rights reserved.
135
+
136
+ This software is licensed under the ISC License. Commercial use requires a valid license.
82
137
 
83
- - `getContent()` - Get current HTML content
84
- - `setContent(content)` - Set editor content
85
- - `focus()` - Focus the editor
86
- - `on(event, handler)` - Add event listener
87
- - `off(event, handler)` - Remove event listener
138
+ ## 🆘 Support
88
139
 
89
- ## Example
140
+ For technical support, feature requests, or licensing inquiries, please contact the author.
90
141
 
91
142
  See `index.html` and `main.js` for a complete working example that demonstrates the `onChange` functionality with real-time output display.