@musaaj/simpleeditor 0.0.1

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 (63) hide show
  1. package/README.md +148 -0
  2. package/dist/simpleeditor.css +2 -0
  3. package/dist/simpleeditor.js +47030 -0
  4. package/dist/types/builtins/blots/chem/constants.d.ts +4 -0
  5. package/dist/types/builtins/blots/chem/constants.d.ts.map +1 -0
  6. package/dist/types/builtins/blots/chem/editor.d.ts +4 -0
  7. package/dist/types/builtins/blots/chem/editor.d.ts.map +1 -0
  8. package/dist/types/builtins/blots/chem/element.d.ts +3 -0
  9. package/dist/types/builtins/blots/chem/element.d.ts.map +1 -0
  10. package/dist/types/builtins/blots/chem/format.d.ts +3 -0
  11. package/dist/types/builtins/blots/chem/format.d.ts.map +1 -0
  12. package/dist/types/builtins/blots/image/constants.d.ts +8 -0
  13. package/dist/types/builtins/blots/image/constants.d.ts.map +1 -0
  14. package/dist/types/builtins/blots/image/handlers.d.ts +5 -0
  15. package/dist/types/builtins/blots/image/handlers.d.ts.map +1 -0
  16. package/dist/types/builtins/blots/image/picker.d.ts +2 -0
  17. package/dist/types/builtins/blots/image/picker.d.ts.map +1 -0
  18. package/dist/types/builtins/blots/image/resize.d.ts +2 -0
  19. package/dist/types/builtins/blots/image/resize.d.ts.map +1 -0
  20. package/dist/types/builtins/blots/math/constants.d.ts +5 -0
  21. package/dist/types/builtins/blots/math/constants.d.ts.map +1 -0
  22. package/dist/types/builtins/blots/math/field.d.ts +5 -0
  23. package/dist/types/builtins/blots/math/field.d.ts.map +1 -0
  24. package/dist/types/builtins/blots/table/actions.d.ts +11 -0
  25. package/dist/types/builtins/blots/table/actions.d.ts.map +1 -0
  26. package/dist/types/builtins/blots/table/blot.d.ts +3 -0
  27. package/dist/types/builtins/blots/table/blot.d.ts.map +1 -0
  28. package/dist/types/builtins/blots/table/cells.d.ts +3 -0
  29. package/dist/types/builtins/blots/table/cells.d.ts.map +1 -0
  30. package/dist/types/builtins/blots/table/handlers.d.ts +3 -0
  31. package/dist/types/builtins/blots/table/handlers.d.ts.map +1 -0
  32. package/dist/types/builtins/blots/table/menu.d.ts +5 -0
  33. package/dist/types/builtins/blots/table/menu.d.ts.map +1 -0
  34. package/dist/types/builtins/blots/table/resize.d.ts +3 -0
  35. package/dist/types/builtins/blots/table/resize.d.ts.map +1 -0
  36. package/dist/types/builtins/blots/table/selection.d.ts +22 -0
  37. package/dist/types/builtins/blots/table/selection.d.ts.map +1 -0
  38. package/dist/types/builtins/blots/table/state.d.ts +5 -0
  39. package/dist/types/builtins/blots/table/state.d.ts.map +1 -0
  40. package/dist/types/builtins/blots/table/theme.d.ts +21 -0
  41. package/dist/types/builtins/blots/table/theme.d.ts.map +1 -0
  42. package/dist/types/builtins/blots/table/toolbar.d.ts +8 -0
  43. package/dist/types/builtins/blots/table/toolbar.d.ts.map +1 -0
  44. package/dist/types/builtins/blots/table/types.d.ts +2 -0
  45. package/dist/types/builtins/blots/table/types.d.ts.map +1 -0
  46. package/dist/types/config.d.ts +6 -0
  47. package/dist/types/config.d.ts.map +1 -0
  48. package/dist/types/main.d.ts +7 -0
  49. package/dist/types/main.d.ts.map +1 -0
  50. package/dist/types/quill-chem-blot.d.ts +5 -0
  51. package/dist/types/quill-chem-blot.d.ts.map +1 -0
  52. package/dist/types/quill-div.d.ts +18 -0
  53. package/dist/types/quill-div.d.ts.map +1 -0
  54. package/dist/types/quill-image-blot.d.ts +5 -0
  55. package/dist/types/quill-image-blot.d.ts.map +1 -0
  56. package/dist/types/quill-math-blot.d.ts +6 -0
  57. package/dist/types/quill-math-blot.d.ts.map +1 -0
  58. package/dist/types/quill-table-blot.d.ts +3 -0
  59. package/dist/types/quill-table-blot.d.ts.map +1 -0
  60. package/dist/types/quill-textarea.d.ts +57 -0
  61. package/dist/types/quill-textarea.d.ts.map +1 -0
  62. package/dist/vite.svg +1 -0
  63. package/package.json +43 -0
package/README.md ADDED
@@ -0,0 +1,148 @@
1
+ # SimpleEditor
2
+
3
+ SimpleEditor ships two web components powered by Quill:
4
+
5
+ - `<quill-textarea>`: editable rich-text surface with toolbar
6
+ - `<quill-div>`: read-only renderer for exported HTML
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ yarn add simpleeditor
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```ts
17
+ import "simpleeditor";
18
+ import "simpleeditor/style.css";
19
+ ```
20
+
21
+ ```html
22
+ <quill-textarea value="<p>Hello world</p>" placeholder="Write..."></quill-textarea>
23
+ <quill-div value="<p>Read only preview</p>"></quill-div>
24
+ ```
25
+
26
+ ## API
27
+
28
+ ### `quill-textarea`
29
+
30
+ Attributes:
31
+
32
+ - `value`
33
+ - `placeholder`
34
+ - `name`
35
+ - `disabled`
36
+ - `readonly`
37
+
38
+ Properties:
39
+
40
+ - `value: string` (clean exported HTML)
41
+ - `textValue: string` (plain text)
42
+
43
+ Events:
44
+
45
+ - `valuechange` (bubbles)
46
+
47
+ ### `quill-div`
48
+
49
+ Attributes / properties:
50
+
51
+ - `value`
52
+
53
+ Behavior:
54
+
55
+ - Sanitizes input HTML
56
+ - Renders math/chem/table output
57
+
58
+ ## React wrapper
59
+
60
+ Use the wrapper components in `examples/react/quill-components.tsx` to avoid handling custom element refs/events in every screen.
61
+
62
+ Example:
63
+
64
+ ```tsx
65
+ import "simpleeditor";
66
+ import "simpleeditor/style.css";
67
+ import { QuillTextareaReact, QuillDivReact } from "./quill-components";
68
+ import { useState } from "react";
69
+
70
+ export function EditorDemo() {
71
+ const [html, setHtml] = useState("<p>Hello world</p>");
72
+
73
+ return (
74
+ <>
75
+ <QuillTextareaReact value={html} onChange={setHtml} placeholder="Write..." />
76
+ <QuillDivReact value={html} />
77
+ </>
78
+ );
79
+ }
80
+ ```
81
+
82
+ ## Theming
83
+
84
+ All component styles live in `src/style.css` and are exposed via CSS variables (`--qt-*`).
85
+
86
+ Global override:
87
+
88
+ ```css
89
+ quill-textarea.quill-textarea {
90
+ --qt-toolbar-bg: #101828;
91
+ --qt-toolbar-border: #1f2937;
92
+ --qt-button-bg: #111827;
93
+ --qt-button-color: #e5e7eb;
94
+ --qt-editor-bg: #0b1220;
95
+ --qt-editor-border: #1f2937;
96
+ --qt-text-color: #e2e8f0;
97
+ }
98
+ ```
99
+
100
+ Per-instance override:
101
+
102
+ ```html
103
+ <quill-textarea
104
+ style="--qt-editor-bg:#fff; --qt-toolbar-bg:#f8fafc; --qt-button-color:#1f2937;"
105
+ ></quill-textarea>
106
+ ```
107
+
108
+ System dark mode:
109
+
110
+ ```css
111
+ @media (prefers-color-scheme: dark) {
112
+ quill-textarea.quill-textarea {
113
+ --qt-modal-bg: #0f172a;
114
+ --qt-modal-text: #e2e8f0;
115
+ --qt-table-ui-bg: #0b1220;
116
+ --qt-table-ui-color: #f1f5f9;
117
+ }
118
+ }
119
+ ```
120
+
121
+ ## Build and Publish
122
+
123
+ ```bash
124
+ yarn build
125
+ ```
126
+
127
+ Build output:
128
+
129
+ - `dist/simpleeditor.js`
130
+ - `dist/style.css`
131
+ - `dist/types/*.d.ts`
132
+
133
+ `npm publish` will run build automatically via `prepublishOnly`.
134
+
135
+ ## Development
136
+
137
+ ```bash
138
+ yarn dev
139
+ ```
140
+
141
+ ## Docs
142
+
143
+ - `docs/overview.md`
144
+ - `docs/web-components.md`
145
+ - `docs/quill-api.md`
146
+ - `docs/blots.md`
147
+ - `docs/export-format.md`
148
+ - `docs/faq.md`