@richhtmleditor/spellcheck 1.1.0 → 1.1.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.
- package/README.md +86 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +47 -32
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# @richhtmleditor/spellcheck
|
|
2
|
+
|
|
3
|
+
Real-time spell checking plugin for Rich HTML Editor. Adds a **Spellcheck** toolbar toggle that underlines misspelled words with suggestions popup on click. Built on [`@richhtmleditor/core`](https://www.npmjs.com/package/@richhtmleditor/core).
|
|
4
|
+
|
|
5
|
+
**Current release: 1.1.2** — Depends on `@richhtmleditor/core` **^1.1.2**.
|
|
6
|
+
|
|
7
|
+
**Repository:** [github.com/rajkishorsahu89/richhtmleditor](https://github.com/rajkishorsahu89/richhtmleditor)
|
|
8
|
+
|
|
9
|
+
**Demo:** [richhtmleditor.vercel.app](https://richhtmleditor.vercel.app/) — [demo](https://richhtmleditor.vercel.app/demo) · [guide](https://richhtmleditor.vercel.app/guide) · [API](https://richhtmleditor.vercel.app/api)
|
|
10
|
+
|
|
11
|
+
### What's in 1.1.2
|
|
12
|
+
|
|
13
|
+
- **`createSpellcheckPlugin`** — registers the `spellcheck` toolbar tool
|
|
14
|
+
- **Red underlines** — misspelled words highlighted in real time as you type
|
|
15
|
+
- **Suggestions popup** — click a misspelled word to see corrections
|
|
16
|
+
- **Custom dictionary** — add project-specific words that should not be flagged
|
|
17
|
+
- **Toggle on/off** — toolbar button enables or disables spell checking
|
|
18
|
+
|
|
19
|
+
> Community feature — no enterprise licence required.
|
|
20
|
+
|
|
21
|
+
**Keywords:** `richhtmleditor` `spellcheck` `spelling` `grammar` `wysiwyg`
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @richhtmleditor/spellcheck
|
|
27
|
+
# Requires @richhtmleditor/core (via framework wrapper or direct install).
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createEditor } from "@richhtmleditor/core";
|
|
34
|
+
import { createSpellcheckPlugin } from "@richhtmleditor/spellcheck";
|
|
35
|
+
|
|
36
|
+
const editor = createEditor({
|
|
37
|
+
element: host,
|
|
38
|
+
toolbar: { preset: "full" },
|
|
39
|
+
plugins: [createSpellcheckPlugin()]
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Angular
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { createSpellcheckPlugin } from "@richhtmleditor/spellcheck";
|
|
47
|
+
|
|
48
|
+
plugins = [createSpellcheckPlugin({ language: "en-US" })];
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<richhtmleditor [plugins]="plugins" [toolbar]="{ preset: 'full' }" />
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Custom dictionary
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
createSpellcheckPlugin({
|
|
59
|
+
language: "en-US",
|
|
60
|
+
customWords: ["richhtmleditor", "WYSIWYG", "Mermaid"]
|
|
61
|
+
})
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## API
|
|
65
|
+
|
|
66
|
+
### `createSpellcheckPlugin(options?)`
|
|
67
|
+
|
|
68
|
+
Returns an `EditorPlugin` that registers the `spellcheck` toolbar tool.
|
|
69
|
+
|
|
70
|
+
| Option | Type | Description |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| `language` | `string?` | Language code for spell checking (default: `"en-US"`). |
|
|
73
|
+
| `customWords` | `string[]?` | Additional words to accept as correct. |
|
|
74
|
+
| `enabled` | `boolean?` | Start with spell check enabled (default: `true`). |
|
|
75
|
+
|
|
76
|
+
## Related packages
|
|
77
|
+
|
|
78
|
+
- [`@richhtmleditor/core`](https://www.npmjs.com/package/@richhtmleditor/core) — editor engine and plugins API.
|
|
79
|
+
- [`@richhtmleditor/themes`](https://www.npmjs.com/package/@richhtmleditor/themes) — shared CSS.
|
|
80
|
+
- [`@richhtmleditor/mentions`](https://www.npmjs.com/package/@richhtmleditor/mentions) — @ mentions plugin.
|
|
81
|
+
- [`@richhtmleditor/angular`](https://www.npmjs.com/package/@richhtmleditor/angular) — Angular wrapper.
|
|
82
|
+
- [`@richhtmleditor/react`](https://www.npmjs.com/package/@richhtmleditor/react) — React wrapper.
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
[MIT](./LICENSE)
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,YAAY,EAAyB,MAAM,sBAAsB,CAAC;AAEhG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CACnF,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IACtC,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,YAAY,EAAyB,MAAM,sBAAsB,CAAC;AAEhG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CACnF,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IACtC,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AA0LF;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,iBAAsB,GAAG,YAAY,CAkFpF"}
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,6 @@ function clearHighlights(contentEl) {
|
|
|
21
21
|
}
|
|
22
22
|
function applyHighlights(contentEl, matches) {
|
|
23
23
|
clearHighlights(contentEl);
|
|
24
|
-
const text = contentEl.textContent ?? "";
|
|
25
24
|
// Walk text nodes and wrap error ranges
|
|
26
25
|
let globalOffset = 0;
|
|
27
26
|
function walkNode(node) {
|
|
@@ -61,7 +60,6 @@ function applyHighlights(contentEl, matches) {
|
|
|
61
60
|
walkNode(child);
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
|
-
void text; // suppress unused warning
|
|
65
63
|
walkNode(contentEl);
|
|
66
64
|
}
|
|
67
65
|
async function checkWithLanguageTool(text, url, language) {
|
|
@@ -76,7 +74,7 @@ async function checkWithLanguageTool(text, url, language) {
|
|
|
76
74
|
const data = await res.json();
|
|
77
75
|
return data.matches ?? [];
|
|
78
76
|
}
|
|
79
|
-
function mountSuggestionPopover(contentEl) {
|
|
77
|
+
function mountSuggestionPopover(contentEl, ignoredWords) {
|
|
80
78
|
let popover = null;
|
|
81
79
|
const close = () => {
|
|
82
80
|
popover?.remove();
|
|
@@ -89,10 +87,11 @@ function mountSuggestionPopover(contentEl) {
|
|
|
89
87
|
close();
|
|
90
88
|
return;
|
|
91
89
|
}
|
|
90
|
+
// Prevent the document mousedown handler from immediately closing the popover
|
|
91
|
+
e.stopPropagation();
|
|
92
92
|
close();
|
|
93
93
|
const replacements = JSON.parse(errorSpan.dataset.replacements ?? "[]");
|
|
94
|
-
|
|
95
|
-
return;
|
|
94
|
+
const word = errorSpan.textContent ?? "";
|
|
96
95
|
popover = document.createElement("div");
|
|
97
96
|
popover.className = POPOVER_CLASS;
|
|
98
97
|
popover.setAttribute("role", "listbox");
|
|
@@ -102,7 +101,8 @@ function mountSuggestionPopover(contentEl) {
|
|
|
102
101
|
btn.type = "button";
|
|
103
102
|
btn.className = `${POPOVER_CLASS}__item`;
|
|
104
103
|
btn.textContent = suggestion;
|
|
105
|
-
btn.addEventListener("
|
|
104
|
+
btn.addEventListener("mousedown", (ev) => {
|
|
105
|
+
ev.preventDefault();
|
|
106
106
|
ev.stopPropagation();
|
|
107
107
|
errorSpan.replaceWith(document.createTextNode(suggestion));
|
|
108
108
|
close();
|
|
@@ -111,25 +111,52 @@ function mountSuggestionPopover(contentEl) {
|
|
|
111
111
|
}
|
|
112
112
|
const ignoreBtn = document.createElement("button");
|
|
113
113
|
ignoreBtn.type = "button";
|
|
114
|
-
ignoreBtn.className = `${POPOVER_CLASS}__item ${POPOVER_CLASS}__item--
|
|
114
|
+
ignoreBtn.className = `${POPOVER_CLASS}__item ${POPOVER_CLASS}__item--muted`;
|
|
115
115
|
ignoreBtn.textContent = "Ignore";
|
|
116
|
-
ignoreBtn.addEventListener("
|
|
116
|
+
ignoreBtn.addEventListener("mousedown", (ev) => {
|
|
117
|
+
ev.preventDefault();
|
|
117
118
|
ev.stopPropagation();
|
|
118
|
-
|
|
119
|
-
errorSpan.replaceWith(document.createTextNode(text));
|
|
119
|
+
errorSpan.replaceWith(document.createTextNode(word));
|
|
120
120
|
close();
|
|
121
121
|
});
|
|
122
122
|
popover.appendChild(ignoreBtn);
|
|
123
|
+
// Show "Ignore All" only when there are multiple instances of the same word
|
|
124
|
+
const sameWordSpans = Array.from(contentEl.querySelectorAll(`.${HIGHLIGHT_CLASS}`))
|
|
125
|
+
.filter((s) => s !== errorSpan && s.textContent === word);
|
|
126
|
+
if (sameWordSpans.length > 0) {
|
|
127
|
+
const ignoreAllBtn = document.createElement("button");
|
|
128
|
+
ignoreAllBtn.type = "button";
|
|
129
|
+
ignoreAllBtn.className = `${POPOVER_CLASS}__item ${POPOVER_CLASS}__item--muted`;
|
|
130
|
+
ignoreAllBtn.textContent = "Ignore All";
|
|
131
|
+
ignoreAllBtn.addEventListener("mousedown", (ev) => {
|
|
132
|
+
ev.preventDefault();
|
|
133
|
+
ev.stopPropagation();
|
|
134
|
+
ignoredWords.add(word.toLowerCase());
|
|
135
|
+
for (const span of Array.from(contentEl.querySelectorAll(`.${HIGHLIGHT_CLASS}`))) {
|
|
136
|
+
if (span.textContent === word) {
|
|
137
|
+
span.replaceWith(document.createTextNode(span.textContent ?? ""));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
contentEl.normalize();
|
|
141
|
+
close();
|
|
142
|
+
});
|
|
143
|
+
popover.appendChild(ignoreAllBtn);
|
|
144
|
+
}
|
|
145
|
+
// Use fixed positioning so the popover escapes any overflow:hidden container
|
|
123
146
|
const rect = errorSpan.getBoundingClientRect();
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
147
|
+
popover.style.cssText = `position:fixed;z-index:10002;top:${rect.bottom + 4}px;left:${rect.left}px;`;
|
|
148
|
+
document.body.appendChild(popover);
|
|
149
|
+
};
|
|
150
|
+
const onDocMousedown = (e) => {
|
|
151
|
+
if (popover && !popover.contains(e.target)) {
|
|
152
|
+
close();
|
|
153
|
+
}
|
|
127
154
|
};
|
|
128
155
|
contentEl.addEventListener("click", onClick);
|
|
129
|
-
document.addEventListener("
|
|
156
|
+
document.addEventListener("mousedown", onDocMousedown);
|
|
130
157
|
return () => {
|
|
131
158
|
contentEl.removeEventListener("click", onClick);
|
|
132
|
-
document.removeEventListener("
|
|
159
|
+
document.removeEventListener("mousedown", onDocMousedown);
|
|
133
160
|
close();
|
|
134
161
|
};
|
|
135
162
|
}
|
|
@@ -169,6 +196,7 @@ export function createSpellcheckPlugin(options = {}) {
|
|
|
169
196
|
const contentEl = host.querySelector(".de-content");
|
|
170
197
|
if (!contentEl)
|
|
171
198
|
return () => { };
|
|
199
|
+
const ignoredWords = new Set();
|
|
172
200
|
let destroyPopover = null;
|
|
173
201
|
let checkTimer = null;
|
|
174
202
|
const runLtCheck = async () => {
|
|
@@ -181,8 +209,9 @@ export function createSpellcheckPlugin(options = {}) {
|
|
|
181
209
|
}
|
|
182
210
|
try {
|
|
183
211
|
const matches = await checkWithLanguageTool(text, ltUrl, language);
|
|
184
|
-
|
|
185
|
-
|
|
212
|
+
const filtered = matches.filter((m) => !ignoredWords.has(text.slice(m.offset, m.offset + m.length).toLowerCase()));
|
|
213
|
+
options.onMatches?.(filtered);
|
|
214
|
+
applyHighlights(contentEl, filtered);
|
|
186
215
|
}
|
|
187
216
|
catch { /* network error — silently skip */ }
|
|
188
217
|
};
|
|
@@ -195,7 +224,7 @@ export function createSpellcheckPlugin(options = {}) {
|
|
|
195
224
|
}
|
|
196
225
|
// LanguageTool
|
|
197
226
|
if (active) {
|
|
198
|
-
destroyPopover = mountSuggestionPopover(contentEl);
|
|
227
|
+
destroyPopover = mountSuggestionPopover(contentEl, ignoredWords);
|
|
199
228
|
editor.on("change", debouncedCheck);
|
|
200
229
|
void runLtCheck();
|
|
201
230
|
}
|
|
@@ -208,20 +237,6 @@ export function createSpellcheckPlugin(options = {}) {
|
|
|
208
237
|
// Patch the tool's onClick at attach time
|
|
209
238
|
const toolDef = tool;
|
|
210
239
|
toolDef.onClick = toggleSpellcheck;
|
|
211
|
-
// Inject minimal CSS
|
|
212
|
-
const styleId = "de-spellcheck-styles";
|
|
213
|
-
if (!document.getElementById(styleId)) {
|
|
214
|
-
const style = document.createElement("style");
|
|
215
|
-
style.id = styleId;
|
|
216
|
-
style.textContent = `
|
|
217
|
-
.${HIGHLIGHT_CLASS}{border-bottom:2px solid #dc2626;cursor:pointer;}
|
|
218
|
-
.${POPOVER_CLASS}{background:var(--de-toolbar-bg,#fff);border:1px solid var(--de-border,#e2e8f0);border-radius:8px;box-shadow:0 4px 16px rgba(0,0,0,.12);padding:4px;min-width:120px;display:flex;flex-direction:column;gap:2px;}
|
|
219
|
-
.${POPOVER_CLASS}__item{text-align:left;padding:6px 10px;border:none;background:none;cursor:pointer;border-radius:6px;font-size:.875rem;}
|
|
220
|
-
.${POPOVER_CLASS}__item:hover{background:var(--de-primary-hover,#eff6ff);}
|
|
221
|
-
.${POPOVER_CLASS}__item--ignore{color:var(--de-text-muted,#64748b);font-style:italic;}
|
|
222
|
-
`.trim();
|
|
223
|
-
document.head.appendChild(style);
|
|
224
|
-
}
|
|
225
240
|
return () => {
|
|
226
241
|
if (active) {
|
|
227
242
|
active = false;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA4BA,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEzC,SAAS,QAAQ,CAAyC,EAAK,EAAE,EAAU;IACzE,IAAI,KAAK,GAAyC,IAAI,CAAC;IACvD,OAAO,CAAC,CAAC,GAAG,IAAe,EAAE,EAAE;QAC7B,IAAI,KAAK,KAAK,IAAI;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAM,CAAC;AACV,CAAC;AAED,SAAS,eAAe,CAAC,SAAsB;IAC7C,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAc,IAAI,eAAe,EAAE,CAAC,CAAC,EAAE,CAAC;QAC5F,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,OAAO,EAAE,CAAC,UAAU;YAAE,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC7D,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IACD,SAAS,CAAC,SAAS,EAAE,CAAC;AACxB,CAAC;AAED,SAAS,eAAe,CAAC,SAAsB,EAAE,OAA4B;IAC3E,eAAe,CAAC,SAAS,CAAC,CAAC;IAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA4BA,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEzC,S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AC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;oBAChE,OAAO;gBACT,CAAC;gBAED,eAAe;gBACf,IAAI,MAAM,EAAE,CAAC;oBACX,cAAc,GAAG,sBAAsB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;oBACjE,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,cAA4B,CAAC,CAAC;oBAClD,KAAK,UAAU,EAAE,CAAC;gBACpB,CAAC;qBAAM,CAAC;oBACN,eAAe,CAAC,SAAS,CAAC,CAAC;oBAC3B,cAAc,EAAE,EAAE,CAAC;oBACnB,cAAc,GAAG,IAAI,CAAC;gBACxB,CAAC;YACH,CAAC,CAAC;YAEF,0CAA0C;YAC1C,MAAM,OAAO,GAAG,IAAgC,CAAC;YACjD,OAAO,CAAC,OAAO,GAAG,gBAAgB,CAAC;YAEnC,OAAO,GAAG,EAAE;gBACV,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,GAAG,KAAK,CAAC;oBACf,IAAI,QAAQ,KAAK,SAAS;wBAAE,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;yBAC/D,CAAC;wBAAC,eAAe,CAAC,SAAS,CAAC,CAAC;wBAAC,cAAc,EAAE,EAAE,CAAC;oBAAC,CAAC;gBAC1D,CAAC;gBACD,IAAI,UAAU;oBAAE,YAAY,CAAC,UAAU,CAAC,CAAC;YAC3C,CAAC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@richhtmleditor/spellcheck",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Spell & grammar check plugin for Rich HTML Editor (browser-native + LanguageTool API).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"prepack": "node ../../scripts/assert-pack-ready.mjs"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@richhtmleditor/core": "^1.1.
|
|
21
|
+
"@richhtmleditor/core": "^1.1.1"
|
|
22
22
|
},
|
|
23
23
|
"keywords": ["richhtmleditor", "spellcheck", "grammar", "languagetool"],
|
|
24
24
|
"license": "MIT",
|