@adminforth/rich-editor 2.0.4 → 2.0.6
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 +26 -2
- package/dist/index.js +5 -2
- package/index.ts +4 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
# AdminForth RichEditor Plugin
|
|
2
2
|
|
|
3
|
-
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /> <img src="https://woodpecker.devforth.io/api/badges/3848/status.svg" alt="Build Status" /> <a href="https://www.npmjs.com/package/@adminforth/rich-editor"
|
|
3
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /> <img src="https://woodpecker.devforth.io/api/badges/3848/status.svg" alt="Build Status" /> <a href="https://www.npmjs.com/package/@adminforth/rich-editor"><img src="https://img.shields.io/npm/dm/@adminforth/rich-editor" alt="npm downloads" /></a> <a href="https://www.npmjs.com/package/@adminforth/rich-editor"><img src="https://img.shields.io/npm/v/@adminforth/rich-editor" alt="npm version" /></a>
|
|
4
|
+
|
|
5
|
+
[](https://tluma.ai/ask-ai/devforth/adminforth)
|
|
4
6
|
|
|
5
7
|
Allows to add a rich text editor to your AdminForth text columns.
|
|
6
8
|
|
|
7
|
-
##
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Add a rich text editor to AdminForth text columns.
|
|
12
|
+
- Improve authoring for formatted content in the admin panel.
|
|
13
|
+
- Support more expressive text workflows.
|
|
14
|
+
- Integrate rich editing into existing resources.
|
|
15
|
+
|
|
16
|
+
## Documentation
|
|
17
|
+
|
|
18
|
+
Full setup and configuration guide:
|
|
19
|
+
|
|
20
|
+
[AdminForth RichEditor Documentation](https://adminforth.dev/docs/tutorial/Plugins/rich-editor/)
|
|
21
|
+
|
|
22
|
+
## About AdminForth
|
|
23
|
+
|
|
24
|
+
AdminForth is an open-source, agent-first admin framework for building robust admin panels and back-office applications faster.
|
|
25
|
+
|
|
26
|
+
## Related links
|
|
27
|
+
|
|
28
|
+
- [AdminForth website](https://adminforth.dev)
|
|
29
|
+
- [npm package](https://www.npmjs.com/package/@adminforth/rich-editor)
|
|
30
|
+
- [More AdminForth plugins](https://adminforth.dev/docs/tutorial/ListOfPlugins/)
|
|
31
|
+
- [Built by DevForth](https://devforth.io)
|
package/dist/index.js
CHANGED
|
@@ -219,7 +219,7 @@ export default class RichEditorPlugin extends AdminForthPlugin {
|
|
|
219
219
|
method: 'POST',
|
|
220
220
|
path: `/plugin/${this.pluginInstanceId}/doComplete`,
|
|
221
221
|
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, headers }) {
|
|
222
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
222
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
223
223
|
const { record } = body;
|
|
224
224
|
if (this.rateLimiter) {
|
|
225
225
|
// rate limit
|
|
@@ -257,7 +257,10 @@ export default class RichEditorPlugin extends AdminForthPlugin {
|
|
|
257
257
|
"Be short, clear and precise. No quotes. Don't talk to me. Just write text. Stop generating when you finish the sentence. DO NOT GENERATE AFTER YOU GENERATED FIRST\".\" \n";
|
|
258
258
|
}
|
|
259
259
|
process.env.HEAVY_DEBUG && console.log('🪲 OpenAI Prompt 🧠', content);
|
|
260
|
-
const { content: respContent } = yield this.options.completion.adapter.complete(
|
|
260
|
+
const { content: respContent } = yield this.options.completion.adapter.complete({
|
|
261
|
+
content,
|
|
262
|
+
maxTokens: (_o = (_m = (_l = this.options.completion) === null || _l === void 0 ? void 0 : _l.expert) === null || _m === void 0 ? void 0 : _m.maxTokens) !== null && _o !== void 0 ? _o : 50,
|
|
263
|
+
});
|
|
261
264
|
let suggestion = respContent;
|
|
262
265
|
if (suggestion.startsWith(currentVal)) {
|
|
263
266
|
suggestion = suggestion.slice(currentVal.length);
|
package/index.ts
CHANGED
|
@@ -324,7 +324,10 @@ export default class RichEditorPlugin extends AdminForthPlugin {
|
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
process.env.HEAVY_DEBUG && console.log('🪲 OpenAI Prompt 🧠', content);
|
|
327
|
-
const { content: respContent } = await this.options.completion.adapter.complete(
|
|
327
|
+
const { content: respContent } = await this.options.completion.adapter.complete({
|
|
328
|
+
content,
|
|
329
|
+
maxTokens: this.options.completion?.expert?.maxTokens ?? 50,
|
|
330
|
+
});
|
|
328
331
|
let suggestion = respContent
|
|
329
332
|
if (suggestion.startsWith(currentVal)) {
|
|
330
333
|
suggestion = suggestion.slice(currentVal.length);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/rich-editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "Rich editor plugin for adminforth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc && rsync -av --exclude 'node_modules' custom dist/"
|
|
13
13
|
},
|
|
14
|
-
"homepage": "https://adminforth.dev/docs/tutorial/Plugins/
|
|
14
|
+
"homepage": "https://adminforth.dev/docs/tutorial/Plugins/rich-editor/",
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
17
|
"url": "https://github.com/devforth/adminforth-rich-editor.git"
|
|
@@ -26,10 +26,11 @@
|
|
|
26
26
|
"cheerio": "^1.0.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"adminforth": "^2.
|
|
29
|
+
"adminforth": "^2.42.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^22.10.7",
|
|
33
|
+
"adminforth": "^2.42.0",
|
|
33
34
|
"semantic-release": "^24.2.1",
|
|
34
35
|
"semantic-release-slack-bot": "^4.0.2",
|
|
35
36
|
"typescript": "^5.7.3"
|