@qalma/editor 0.0.1-alpha.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 +45 -0
- package/fesm2022/qalma-editor.mjs +3228 -0
- package/fesm2022/qalma-editor.mjs.map +1 -0
- package/package.json +52 -0
- package/types/qalma-editor.d.ts +274 -0
- package/types/qalma-editor.d.ts.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @qalma/editor
|
|
2
|
+
|
|
3
|
+
Headless Angular components and plugin primitives for the Qalma editor.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const editor = createQalmaEditor({
|
|
7
|
+
plugins: [
|
|
8
|
+
...TextFormattingKit,
|
|
9
|
+
HistoryPlugin.configure({
|
|
10
|
+
depth: 200,
|
|
11
|
+
newGroupDelay: 750,
|
|
12
|
+
}),
|
|
13
|
+
],
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<qalma-editor [editor]="editor">
|
|
19
|
+
<qalma-toolbar>
|
|
20
|
+
<button qalmaCommand="toggleBold">Bold</button>
|
|
21
|
+
<button qalmaCommand="undo">Undo</button>
|
|
22
|
+
<button qalmaCommand="redo">Redo</button>
|
|
23
|
+
</qalma-toolbar>
|
|
24
|
+
|
|
25
|
+
<qalma-content />
|
|
26
|
+
</qalma-editor>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Styling images
|
|
30
|
+
|
|
31
|
+
`ImagePlugin` renders the `image` node as a plain `<img>` with no inline
|
|
32
|
+
styles or classes — the library stays headless. The node is part of a
|
|
33
|
+
paragraph's inline content, so if your global CSS resets images to
|
|
34
|
+
`display: block` (the default in Tailwind's preflight, normalize.css, etc.),
|
|
35
|
+
inline images will behave like standalone blocks: the cursor can't be placed
|
|
36
|
+
next to them and `text-align` won't affect their position.
|
|
37
|
+
|
|
38
|
+
Scope an override to the editor content, for example:
|
|
39
|
+
|
|
40
|
+
```css
|
|
41
|
+
qalma-content .ProseMirror img {
|
|
42
|
+
display: inline-block;
|
|
43
|
+
vertical-align: bottom;
|
|
44
|
+
}
|
|
45
|
+
```
|