@thangph2146/lexical-editor 0.0.5 → 0.0.7

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 (40) hide show
  1. package/README.md +47 -0
  2. package/dist/editor-x/editor.cjs +610 -493
  3. package/dist/editor-x/editor.cjs.map +1 -1
  4. package/dist/editor-x/editor.css +157 -69
  5. package/dist/editor-x/editor.css.map +1 -1
  6. package/dist/editor-x/editor.d.cts +2 -1
  7. package/dist/editor-x/editor.d.ts +2 -1
  8. package/dist/editor-x/editor.js +350 -233
  9. package/dist/editor-x/editor.js.map +1 -1
  10. package/dist/index.cjs +620 -501
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.css +157 -69
  13. package/dist/index.css.map +1 -1
  14. package/dist/index.d.cts +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +354 -235
  17. package/dist/index.js.map +1 -1
  18. package/package.json +3 -1
  19. package/src/components/lexical-editor.tsx +2 -0
  20. package/src/editor-x/editor.tsx +4 -2
  21. package/src/editor-x/plugins.tsx +7 -6
  22. package/src/plugins/images-plugin.tsx +3 -2
  23. package/src/plugins/layout-plugin.tsx +96 -61
  24. package/src/themes/_mixins.scss +12 -7
  25. package/src/themes/_variables.scss +2 -1
  26. package/src/themes/core/_reset.scss +10 -6
  27. package/src/themes/plugins/_color-picker.scss +1 -0
  28. package/src/themes/plugins/_layout.scss +3 -7
  29. package/src/themes/plugins/_list-color.scss +2 -0
  30. package/src/themes/plugins/_toolbar.scss +7 -7
  31. package/src/themes/ui-components/_button.scss +3 -3
  32. package/src/themes/ui-components/_flex.scss +2 -0
  33. package/src/themes/ui-components/_number-input.scss +81 -0
  34. package/src/themes/ui-components/_text-utilities.scss +1 -1
  35. package/src/themes/ui-components.scss +1 -0
  36. package/src/ui/flex.tsx +9 -2
  37. package/src/ui/number-input.tsx +104 -0
  38. package/src/themes/editor-theme copy.scss +0 -763
  39. package/src/themes/plugins copy.scss +0 -656
  40. package/src/themes/ui-components copy.scss +0 -1335
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # @thangph2146/lexical-editor
2
+
3
+ Một thư viện soạn thảo văn bản (Rich Text Editor) dựa trên [Lexical](https://lexical.dev/) dành cho React/Next.js.
4
+
5
+ ## Tính năng chính
6
+
7
+ - **Rich Text Editing**: Hỗ trợ đầy đủ các định dạng văn bản (Bold, Italic, Underline, Code, v.v.)
8
+ - **Plugins Hệ thống**: Tích hợp sẵn nhiều plugin mạnh mẽ (Toolbar, Images, Tables, Layout, v.v.)
9
+ - **Dynamic Placeholder**: Hỗ trợ thay đổi placeholder linh hoạt thông qua prop.
10
+ - **Modern UI**: Giao diện hiện đại, dễ dàng tùy chỉnh qua CSS Variables.
11
+ - **TypeScript Support**: Được viết hoàn toàn bằng TypeScript với định nghĩa kiểu đầy đủ.
12
+
13
+ ## Cài đặt
14
+
15
+ Sử dụng `npm`:
16
+ ```bash
17
+ npm install @thangph2146/lexical-editor lexical @lexical/react
18
+ ```
19
+
20
+ Sử dụng `pnpm`:
21
+ ```bash
22
+ pnpm add @thangph2146/lexical-editor lexical @lexical/react
23
+ ```
24
+
25
+ ## Cách sử dụng
26
+
27
+ ```tsx
28
+ import { LexicalEditor } from "@thangph2146/lexical-editor";
29
+ import "@thangph2146/lexical-editor/style.css";
30
+
31
+ function MyEditor() {
32
+ const handleChange = (editorState) => {
33
+ // Xử lý khi nội dung thay đổi
34
+ };
35
+
36
+ return (
37
+ <LexicalEditor
38
+ placeholder="Nhập nội dung tại đây..."
39
+ onChange={handleChange}
40
+ />
41
+ );
42
+ }
43
+ ```
44
+
45
+ ## Giấy phép
46
+
47
+ MIT