@ckeditor/ckeditor5-ai 49.0.1 → 49.1.0-alpha.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.
- package/dist/aiactions/aiactions.d.ts +2 -2
- package/dist/aiballoon/ui/aiballoonview.d.ts +1 -1
- package/dist/aichat/aichatballoon.d.ts +1 -1
- package/dist/aichat/aichatcontroller.d.ts +2 -2
- package/dist/aichat/ui/aichatfeedview.d.ts +24 -0
- package/dist/aichat/ui/feed/aichatfeedsuggestionitemactionsview.d.ts +7 -0
- package/dist/aichatshortcuts/aichatshortcuts.d.ts +2 -2
- package/dist/aicore/aiconnector.d.ts +2 -2
- package/dist/aicore/aiediting.d.ts +8 -4
- package/dist/aicore/aieditorconfig.d.ts +225 -0
- package/dist/aicore/aigateway.d.ts +8 -3
- package/dist/aicore/model/aicontext.d.ts +2 -2
- package/dist/aicore/pipeline/airesponseapplier.d.ts +1 -0
- package/dist/aicore/ui/aiscrollfillerview.d.ts +37 -0
- package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +6 -1
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +7 -0
- package/dist/aicore/utils/autoadvancedelay.d.ts +13 -0
- package/dist/aicore/utils/getallowedcustomelements.d.ts +16 -0
- package/dist/aicore/utils/geteditorconfig.d.ts +10 -76
- package/dist/aicore/utils/getoperationsfordocumentsuggestions.d.ts +4 -4
- package/dist/aicore/utils/getrootinfo.d.ts +2 -19
- package/dist/aicore/utils/getscrolltoptoelement.d.ts +13 -0
- package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +35 -0
- package/dist/aicore/utils/htmlparser.d.ts +3 -2
- package/dist/aicore/utils/replyactions.d.ts +10 -2
- package/dist/aicore/utils/scrollmanager.d.ts +5 -0
- package/dist/aireviewcore/aireviewcoreediting.d.ts +2 -2
- package/dist/aireviewcore/aireviewcoreui.d.ts +8 -0
- package/dist/aireviewcore/model/aireviewcheckrun.d.ts +8 -0
- package/dist/aireviewcore/ui/aireviewcorenavigationpanelview.d.ts +1 -1
- package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +22 -7
- package/dist/aireviewmode/aireviewmodecontroller.d.ts +4 -0
- package/dist/aireviewmode/ui/aireviewmodecheckresultsview.d.ts +10 -1
- package/dist/aireviewmode/ui/aireviewmodesummaryview.d.ts +44 -0
- package/dist/augmentation.d.ts +6 -0
- package/dist/index-editor.css +328 -166
- package/dist/index.css +328 -166
- package/dist/index.d.ts +10 -4
- package/dist/index.js +21 -19
- package/dist/toolkit/applypatch.d.ts +31 -0
- package/dist/toolkit/computechanges.d.ts +19 -0
- package/dist/toolkit/computepreviews.d.ts +39 -0
- package/dist/toolkit/createfragmentfromrange.d.ts +24 -0
- package/dist/toolkit/dataidassigner.d.ts +38 -0
- package/dist/toolkit/documentcompare.d.ts +357 -0
- package/dist/{aisdk → toolkit}/documentcompareutils.d.ts +1 -1
- package/dist/{aisdk/documentchanges.d.ts → toolkit/documentdiffer.d.ts} +39 -21
- package/dist/toolkit/documentdifferutils.d.ts +15 -0
- package/dist/{aisdk → toolkit}/documentsnapshot.d.ts +9 -4
- package/dist/toolkit/elementcategory.d.ts +50 -0
- package/dist/toolkit/elementmatcher.d.ts +114 -0
- package/dist/{aisdk → toolkit}/extractselectionfromhtml.d.ts +1 -1
- package/dist/toolkit/proposedchange.d.ts +113 -0
- package/dist/toolkit/proposedchanges.d.ts +130 -0
- package/dist/toolkit/proposedchangescollection.d.ts +93 -0
- package/dist/toolkit/proposedchangescontroller.d.ts +129 -0
- package/dist/toolkit/proposedchangescontrollertype.d.ts +88 -0
- package/dist/{aisdk/documentchangesutils.d.ts → toolkit/proposedchangesutils.d.ts} +3 -3
- package/dist/{aisdk → toolkit}/validateoperations.d.ts +1 -1
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +32 -30
- package/dist/aisdk/dataidassigner.d.ts +0 -20
- package/dist/aisdk/documentcompare.d.ts +0 -171
|
@@ -13,7 +13,7 @@ import { Dialog } from "@ckeditor/ckeditor5-ui";
|
|
|
13
13
|
import { AIEditing } from "../aicore/aiediting.js";
|
|
14
14
|
import { type AIContextRef } from "../aicore/model/aicontextref.js";
|
|
15
15
|
import { AIBalloon } from "../aiballoon/aiballoon.js";
|
|
16
|
-
import {
|
|
16
|
+
import { DocumentDiffer } from "../toolkit/documentdiffer.js";
|
|
17
17
|
/**
|
|
18
18
|
* @experimental **Experimental:** Some methods of this class are production-ready but experimental and may change
|
|
19
19
|
* in minor releases without the standard deprecation policy. Check the changelog for migration guidance.
|
|
@@ -22,7 +22,7 @@ export declare class AIActions extends Plugin {
|
|
|
22
22
|
/**
|
|
23
23
|
* @inheritDoc
|
|
24
24
|
*/
|
|
25
|
-
static get requires(): PluginDependenciesOf<[AIConnector, AIErrorSink, Dialog, AIEditing, AIBalloon,
|
|
25
|
+
static get requires(): PluginDependenciesOf<[AIConnector, AIErrorSink, Dialog, AIEditing, AIBalloon, DocumentDiffer]>;
|
|
26
26
|
/**
|
|
27
27
|
* @inheritDoc
|
|
28
28
|
*/
|
|
@@ -32,7 +32,7 @@ export declare abstract class AIBalloonView extends View {
|
|
|
32
32
|
*/
|
|
33
33
|
children: ViewCollection<View>;
|
|
34
34
|
/**
|
|
35
|
-
* Observable property that indicates whether the track changes
|
|
35
|
+
* Observable property that indicates whether the track changes is on.
|
|
36
36
|
*/
|
|
37
37
|
isTrackChangesOn: boolean;
|
|
38
38
|
/**
|
|
@@ -45,7 +45,7 @@ export declare class AIChatBalloon extends Plugin {
|
|
|
45
45
|
/**
|
|
46
46
|
* Opens the AI Balloon dialog.
|
|
47
47
|
*/
|
|
48
|
-
open(config: Omit<AIChatBalloonConfig, "class" | "
|
|
48
|
+
open(config: Omit<AIChatBalloonConfig, "class" | "mainView">): void;
|
|
49
49
|
/**
|
|
50
50
|
* Closes the AI Balloon dialog.
|
|
51
51
|
*/
|
|
@@ -14,7 +14,7 @@ import { type AIInteractionReplyCreatedEvent, type AIToolData } from "../aicore/
|
|
|
14
14
|
import { type AIContextRef } from "../aicore/model/aicontextref.js";
|
|
15
15
|
import { type AIChatInteraction } from "./model/aichatinteraction.js";
|
|
16
16
|
import { AICore } from "../aicore/aicore.js";
|
|
17
|
-
import {
|
|
17
|
+
import { DocumentDiffer } from "../toolkit/documentdiffer.js";
|
|
18
18
|
import { type AIChatFeedCustomElementView } from "./ui/feed/aichatfeedcustomelementview.js";
|
|
19
19
|
/**
|
|
20
20
|
* Implements integration layer between AI Chat feature UI and logic.
|
|
@@ -38,7 +38,7 @@ export declare class AIChatController extends ContextPlugin {
|
|
|
38
38
|
/**
|
|
39
39
|
* @inheritDoc
|
|
40
40
|
*/
|
|
41
|
-
static get requires(): PluginDependenciesOf<[AIConnector, AIErrorSink,
|
|
41
|
+
static get requires(): PluginDependenciesOf<[AIConnector, AIErrorSink, DocumentDiffer, AICore]>;
|
|
42
42
|
/**
|
|
43
43
|
* @inheritDoc
|
|
44
44
|
*/
|
|
@@ -112,8 +112,32 @@ export declare class AIChatFeedView extends View {
|
|
|
112
112
|
* Checks if an item exists in the feed.
|
|
113
113
|
*/
|
|
114
114
|
hasItem(id: string): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Scrolls the feed after either a suggestion part was decided or it has been clicked, so the selected part to decide on
|
|
117
|
+
* is at the top of the feed, with its action buttons (they are the first row of the part) ready to use.
|
|
118
|
+
*
|
|
119
|
+
* The feed cannot scroll past its end, so when the part sits too close to the end (the last parts of the last reply),
|
|
120
|
+
* extra space is added below the feed items to make the scroll possible. The space stays until
|
|
121
|
+
* {@link #resetAutoAdvanceSpace} is called.
|
|
122
|
+
*
|
|
123
|
+
* @param replyId The ID of the reply the part belongs to.
|
|
124
|
+
* @param partIndex The index of the part to bring to the top of the feed.
|
|
125
|
+
*/
|
|
115
126
|
scrollToSuggestion(replyId: string, partIndex: number): void;
|
|
116
127
|
/**
|
|
128
|
+
* Removes the extra space {@link #scrollToSuggestion} added below the feed items, bringing the feed back
|
|
129
|
+
* to its default scrolling range.
|
|
130
|
+
*
|
|
131
|
+
* Taking the space away makes the browser clamp the scroll position to the smaller range and, in a feed with little
|
|
132
|
+
* content, pins the items to the bottom again. Both move the items at once. When `animate` is set, the items slide
|
|
133
|
+
* from where they were to where they ended up instead.
|
|
134
|
+
*
|
|
135
|
+
* @param options.animate Whether to slide the items to their new place.
|
|
136
|
+
*/
|
|
137
|
+
resetAutoAdvanceSpace(options?: {
|
|
138
|
+
animate?: boolean;
|
|
139
|
+
}): void;
|
|
140
|
+
/**
|
|
117
141
|
* Sets the loading message of the chat feed.
|
|
118
142
|
*/
|
|
119
143
|
setLoadingMessage(message: string): void;
|
|
@@ -27,6 +27,13 @@ export declare class AIChatFeedSuggestionItemActionsView extends View {
|
|
|
27
27
|
*/
|
|
28
28
|
isTrackChangesOn: boolean;
|
|
29
29
|
/**
|
|
30
|
+
* Whether the button for suggesting all changes may be shown. It is never shown when `'insertSuggestion'` is not
|
|
31
|
+
* an available action.
|
|
32
|
+
*
|
|
33
|
+
* @observable
|
|
34
|
+
*/
|
|
35
|
+
isSuggestVisible: boolean;
|
|
36
|
+
/**
|
|
30
37
|
* @inheritDoc
|
|
31
38
|
*/
|
|
32
39
|
constructor(locale: Locale, availableActions?: Array<AISuggestionActionName>, areActionsDisabled?: boolean);
|
|
@@ -236,10 +236,10 @@ export interface AIChatShortcutChatDefinition extends AIChatShortcutBaseDefiniti
|
|
|
236
236
|
* ```ts
|
|
237
237
|
* {
|
|
238
238
|
* id: 'custom-review',
|
|
239
|
-
* label: 'Custom grammar command using the gpt-5.
|
|
239
|
+
* label: 'Custom grammar command using the gpt-5.5 model',
|
|
240
240
|
* type: 'review',
|
|
241
241
|
* commandId: 'custom',
|
|
242
|
-
* model: 'gpt-5.
|
|
242
|
+
* model: 'gpt-5.5',
|
|
243
243
|
* prompt: 'Check grammar and style.'
|
|
244
244
|
* }
|
|
245
245
|
* ```
|
|
@@ -8,7 +8,7 @@ import { type AIContextRequestPart, type AIContextItemType } from "./model/aicon
|
|
|
8
8
|
import { type AIContextRefRequestData } from "./model/aicontextref.js";
|
|
9
9
|
import { type AICapabilitiesRequestData } from "./model/aicapabilities.js";
|
|
10
10
|
import type { AIActionsNames } from "../aiactions/aiactions.js";
|
|
11
|
-
import { type
|
|
11
|
+
import { type AIEditorConfigSnapshot } from "./aieditorconfig.js";
|
|
12
12
|
/**
|
|
13
13
|
* A plugin that handles communication with the AI API.
|
|
14
14
|
*/
|
|
@@ -347,7 +347,7 @@ export type AIUserMessageContent = {
|
|
|
347
347
|
type: AIContextItemType;
|
|
348
348
|
content: string;
|
|
349
349
|
mcpServerName: string;
|
|
350
|
-
editorConfig?:
|
|
350
|
+
editorConfig?: AIEditorConfigSnapshot;
|
|
351
351
|
toolName?: string;
|
|
352
352
|
data?: Record<string, any>;
|
|
353
353
|
name?: string;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module ai/aicore/aiediting
|
|
7
7
|
*/
|
|
8
8
|
import { type ModelRange, type ModelDocumentFragment } from "@ckeditor/ckeditor5-engine";
|
|
9
|
-
import { ContextPlugin, type Context, Editor } from "@ckeditor/ckeditor5-core";
|
|
10
|
-
import { type
|
|
9
|
+
import { ContextPlugin, type Context, type PluginDependenciesOf, Editor } from "@ckeditor/ckeditor5-core";
|
|
10
|
+
import { AIEditorConfig, type AIEditorConfigSnapshot } from "./aieditorconfig.js";
|
|
11
11
|
export declare const AI_VISUAL_SELECTION_MARKER_NAME = "ai-selection";
|
|
12
12
|
export declare class AIEditing extends ContextPlugin {
|
|
13
13
|
/**
|
|
@@ -21,6 +21,10 @@ export declare class AIEditing extends ContextPlugin {
|
|
|
21
21
|
/**
|
|
22
22
|
* @inheritDoc
|
|
23
23
|
*/
|
|
24
|
+
static get requires(): PluginDependenciesOf<[AIEditorConfig]>;
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
24
28
|
static override get isOfficialPlugin(): true;
|
|
25
29
|
/**
|
|
26
30
|
* @inheritDoc
|
|
@@ -64,7 +68,7 @@ export declare class AIEditing extends ContextPlugin {
|
|
|
64
68
|
modelToDataWithIds(modelFragment: ModelDocumentFragment, editor: Editor, rootName?: string): Promise<string>;
|
|
65
69
|
}
|
|
66
70
|
/**
|
|
67
|
-
* A single document entry returned by
|
|
71
|
+
* A single document entry returned by `AIEditing#getDocumentData()`. One
|
|
68
72
|
* entry per editor model root (excluding `$graveyard`); `editor` + `rootName` identify the source root so callers can route AI
|
|
69
73
|
* modifications back to the correct place.
|
|
70
74
|
*/
|
|
@@ -82,7 +86,7 @@ export type AIEditingDocumentData = {
|
|
|
82
86
|
htmlFragment: string;
|
|
83
87
|
}>;
|
|
84
88
|
selectionSignature: string;
|
|
85
|
-
editorConfig:
|
|
89
|
+
editorConfig: AIEditorConfigSnapshot;
|
|
86
90
|
name?: string;
|
|
87
91
|
description?: string;
|
|
88
92
|
};
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ai/aicore/aieditorconfig
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ContextPlugin, type Editor } from "@ckeditor/ckeditor5-core";
|
|
10
|
+
import { type AlignmentConfig } from "@ckeditor/ckeditor5-alignment";
|
|
11
|
+
import { type CodeBlockConfig } from "@ckeditor/ckeditor5-code-block";
|
|
12
|
+
import { type FontSizeConfig, type FontFamilyConfig, type FontColorConfig } from "@ckeditor/ckeditor5-font";
|
|
13
|
+
import { type FootnotesConfig } from "@ckeditor/ckeditor5-footnotes";
|
|
14
|
+
import { type HeadingConfig } from "@ckeditor/ckeditor5-heading";
|
|
15
|
+
import { type HighlightConfig } from "@ckeditor/ckeditor5-highlight";
|
|
16
|
+
import { type ImageConfig } from "@ckeditor/ckeditor5-image";
|
|
17
|
+
import { type IndentBlockConfig } from "@ckeditor/ckeditor5-indent";
|
|
18
|
+
import { type TextPartLanguageOption } from "@ckeditor/ckeditor5-language";
|
|
19
|
+
import { type LineHeightConfig } from "@ckeditor/ckeditor5-line-height";
|
|
20
|
+
import { type LinkConfig } from "@ckeditor/ckeditor5-link";
|
|
21
|
+
import { type ListConfig } from "@ckeditor/ckeditor5-list";
|
|
22
|
+
import { type MentionConfig } from "@ckeditor/ckeditor5-mention";
|
|
23
|
+
import { type MergeFieldsConfig } from "@ckeditor/ckeditor5-merge-fields";
|
|
24
|
+
import { type MultiLevelListConfig } from "@ckeditor/ckeditor5-list-multi-level";
|
|
25
|
+
import { type StyleConfig } from "@ckeditor/ckeditor5-style";
|
|
26
|
+
import { type TableConfig } from "@ckeditor/ckeditor5-table";
|
|
27
|
+
import { type MediaEmbedConfig } from "@ckeditor/ckeditor5-media-embed";
|
|
28
|
+
import { type GeneralHtmlSupportConfig } from "@ckeditor/ckeditor5-html-support";
|
|
29
|
+
import { type RestrictedEditingConfig } from "@ckeditor/ckeditor5-restricted-editing";
|
|
30
|
+
/**
|
|
31
|
+
* The plugin that describes the editor's feature capabilities to the AI agent.
|
|
32
|
+
*
|
|
33
|
+
* It builds a {@link ~AIEditorConfig#get compact, serializable snapshot} of the features loaded in an editor and
|
|
34
|
+
* lets custom plugins {@link ~AIEditorConfig#add register their own features} so that the AI agent can produce and
|
|
35
|
+
* preserve their content.
|
|
36
|
+
*/
|
|
37
|
+
export declare class AIEditorConfig extends ContextPlugin {
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
static get pluginName(): "AIEditorConfig";
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
static override get isOfficialPlugin(): true;
|
|
46
|
+
/**
|
|
47
|
+
* @inheritDoc
|
|
48
|
+
*/
|
|
49
|
+
static override get isPremiumPlugin(): true;
|
|
50
|
+
/**
|
|
51
|
+
* Registers a custom editor feature (plugin) with the AI agent. It allows the AI agent to match the existing
|
|
52
|
+
* [custom skill](https://ckeditor.com/docs/cs/latest/guides/ckeditor-ai/extensions/skills.html) with a specific custom editor feature.
|
|
53
|
+
*
|
|
54
|
+
* This is a mandatory step for any custom plugin that introduces content the AI agent should be able to produce or preserve.
|
|
55
|
+
*
|
|
56
|
+
* Example of using this API in a custom plugin's `init()` method:
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* if ( this.editor.plugins.has( 'AIEditorConfig' ) ) {
|
|
60
|
+
* // The name must correspond to the "configKey" property of the custom skill to be used by the AI agent.
|
|
61
|
+
* // Use empty object as the configuration when the feature has no practical configuration.
|
|
62
|
+
* this.editor.plugins.get( 'AIEditorConfig' ).add( this.editor, 'myCustomFeature', {
|
|
63
|
+
* // Configuration that may be relevant to the AI agent for producing or preserving the feature's content.
|
|
64
|
+
* someKey: 'someValue'
|
|
65
|
+
* } );
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* Learn more about registering custom editor features with the AI agent in the
|
|
70
|
+
* {@glink features/ai/ckeditor-ai-feature-understanding#registering-custom-features dedicated guide}.
|
|
71
|
+
*
|
|
72
|
+
* **Note**: Editor comes with a set built-in features and corresponding skills. It is not possible to override configuration of
|
|
73
|
+
* a core editor feature with a custom feature using this API. The used name must be unique.
|
|
74
|
+
*
|
|
75
|
+
* @param editor The editor the feature is registered for.
|
|
76
|
+
* @param name The key under which the feature is reported. It must correspond to the `configKey` property of the custom
|
|
77
|
+
* skill to be used by the AI agent.
|
|
78
|
+
* @param config The configuration of the feature. It should pass information relevant to the AI agent for producing or
|
|
79
|
+
* preserving the feature's content. Use empty object when the feature has no practical configuration.
|
|
80
|
+
*/
|
|
81
|
+
add(editor: Editor, name: string, config: Record<string, unknown>): void;
|
|
82
|
+
/**
|
|
83
|
+
* Builds a compact, serializable snapshot of the editor's feature capabilities for the AI agent.
|
|
84
|
+
*
|
|
85
|
+
* The returned object is keyed by feature. A key is present only when the feature's plugin is loaded, so the agent
|
|
86
|
+
* can tell at a glance what content the editor is able to produce:
|
|
87
|
+
*
|
|
88
|
+
* * For configurable features, the value is that feature's configuration with UI-only options stripped out
|
|
89
|
+
* (toolbars, color pickers, icons, labels, keystrokes, dropdown limits, preview machinery, …), leaving only the
|
|
90
|
+
* options that actually shape the document data.
|
|
91
|
+
* * For features that expose no data-relevant configuration, the value is an empty object acting purely as a
|
|
92
|
+
* presence flag.
|
|
93
|
+
*
|
|
94
|
+
* Knowing both which features are available and how they are configured (e.g. the allowed heading levels, font
|
|
95
|
+
* sizes or table properties) lets the agent keep its edits within what the editor can represent.
|
|
96
|
+
*
|
|
97
|
+
* On top of the features, the snapshot describes the root it was gathered for in
|
|
98
|
+
* the {@link ~AIEditorConfigSnapshot `rootType`} property — what that root can hold and what surrounds it. A snapshot is
|
|
99
|
+
* therefore specific to one root, which matters for editors with more than one.
|
|
100
|
+
*
|
|
101
|
+
* Features registered by custom plugins through {@link #add `add()`} are added on top of the built-in ones.
|
|
102
|
+
* Their names are checked against the built-in keys when they are registered, so they never overwrite a built-in feature.
|
|
103
|
+
*
|
|
104
|
+
* @param editor The editor whose feature configuration is gathered.
|
|
105
|
+
* @param rootName The name of the root the snapshot is gathered for.
|
|
106
|
+
* @returns The editor's feature capabilities snapshot.
|
|
107
|
+
*/
|
|
108
|
+
get(editor: Editor, rootName: string): AIEditorConfigSnapshot;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A compact, serializable snapshot of the editor's feature capabilities, returned by
|
|
112
|
+
* {@link module:ai/aicore/aieditorconfig~AIEditorConfig#get `AIEditorConfig#get()`}.
|
|
113
|
+
*
|
|
114
|
+
* It consists of:
|
|
115
|
+
*
|
|
116
|
+
* * {@link module:ai/aicore/aieditorconfig~AIEditorConfigFeatureConfigs Configurations of the built-in configurable features},
|
|
117
|
+
* * {@link module:ai/aicore/aieditorconfig~AIEditorConfigPresenceFlags presence flags of the built-in features}
|
|
118
|
+
* that expose no data-relevant configuration,
|
|
119
|
+
* * {@link module:ai/aicore/aieditorconfig~AIEditorConfigCustomFeatures features registered by custom plugins},
|
|
120
|
+
* * information about the root and the editor version (see below).
|
|
121
|
+
*/
|
|
122
|
+
export type AIEditorConfigSnapshot = AIEditorConfigFeatureConfigs & AIEditorConfigPresenceFlags & AIEditorConfigCustomFeatures & {
|
|
123
|
+
/**
|
|
124
|
+
* A snapshot of the root the document relates to: whether it is an inline root and which element hosts it.
|
|
125
|
+
*/
|
|
126
|
+
rootType: AIRootInfo;
|
|
127
|
+
/**
|
|
128
|
+
* The version of CKEditor 5 the snapshot was taken from. Tells the agent which editor release its capabilities describe.
|
|
129
|
+
*/
|
|
130
|
+
editorVersion: string;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* A snapshot of a single editor root, reported in the {@link ~AIEditorConfigSnapshot `rootType`} property of
|
|
134
|
+
* the {@link ~AIEditorConfig#get editor configuration snapshot}.
|
|
135
|
+
*
|
|
136
|
+
* It tells the AI agent what the root can hold and what surrounds it, so it can keep its edits within the shape of that
|
|
137
|
+
* root: an inline root cannot take block content at all, and a root hosted by a semantic element (a `<h1>` title,
|
|
138
|
+
* a `<span>` label) implies a different tone and length than a full-page `<div>`.
|
|
139
|
+
*/
|
|
140
|
+
export interface AIRootInfo {
|
|
141
|
+
/**
|
|
142
|
+
* Whether the root is an inline root, that is, whether it rejects block content and behaves like a single
|
|
143
|
+
* paragraph. Content of such a root must stay inline-only.
|
|
144
|
+
*/
|
|
145
|
+
isInline: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* The tag name of the element hosting the root, for example `div` for a regular rich-text area or `h1` for a
|
|
148
|
+
* title mounted on a heading.
|
|
149
|
+
*
|
|
150
|
+
* This element surrounds the root - it is not part of the root's content and cannot be edited. It must not be
|
|
151
|
+
* reproduced in content produced for this root.
|
|
152
|
+
*/
|
|
153
|
+
hostElement: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The configurable features reported in the {@link ~AIEditorConfig#get editor configuration snapshot}.
|
|
157
|
+
*
|
|
158
|
+
* A key is present only when the feature's plugin is loaded. Its value is the feature's configuration with
|
|
159
|
+
* UI-only options stripped out, leaving only the options that shape the document data.
|
|
160
|
+
*/
|
|
161
|
+
export type AIEditorConfigFeatureConfigs = {
|
|
162
|
+
alignment?: AlignmentConfig;
|
|
163
|
+
codeBlock?: CodeBlockConfig;
|
|
164
|
+
fontBackgroundColor?: FontColorConfig;
|
|
165
|
+
fontColor?: FontColorConfig;
|
|
166
|
+
fontFamily?: FontFamilyConfig;
|
|
167
|
+
fontSize?: FontSizeConfig;
|
|
168
|
+
footnotes?: FootnotesConfig;
|
|
169
|
+
htmlSupport?: GeneralHtmlSupportConfig;
|
|
170
|
+
heading?: HeadingConfig;
|
|
171
|
+
highlight?: HighlightConfig;
|
|
172
|
+
image?: ImageConfig;
|
|
173
|
+
indentBlock?: IndentBlockConfig;
|
|
174
|
+
lineHeight?: LineHeightConfig;
|
|
175
|
+
link?: LinkConfig;
|
|
176
|
+
list?: ListConfig;
|
|
177
|
+
listMultiLevel?: MultiLevelListConfig;
|
|
178
|
+
mediaEmbed?: MediaEmbedConfig;
|
|
179
|
+
mention?: MentionConfig;
|
|
180
|
+
mergeFields?: MergeFieldsConfig;
|
|
181
|
+
restrictedEditingMode?: Omit<RestrictedEditingConfig, "allowedAttributes">;
|
|
182
|
+
style?: StyleConfig;
|
|
183
|
+
table?: TableConfig;
|
|
184
|
+
textPartLanguage?: Array<TextPartLanguageOption>;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* The features reported in the {@link ~AIEditorConfig#get editor configuration snapshot} that expose no
|
|
188
|
+
* data-relevant configuration.
|
|
189
|
+
*
|
|
190
|
+
* A key is set to an empty object only when the feature's plugin is loaded, acting purely as a presence flag.
|
|
191
|
+
* It is absent otherwise.
|
|
192
|
+
*/
|
|
193
|
+
export type AIEditorConfigPresenceFlags = {
|
|
194
|
+
blockQuote?: object;
|
|
195
|
+
bold?: object;
|
|
196
|
+
bookmark?: object;
|
|
197
|
+
code?: object;
|
|
198
|
+
horizontalLine?: object;
|
|
199
|
+
htmlEmbed?: object;
|
|
200
|
+
italic?: object;
|
|
201
|
+
math?: object;
|
|
202
|
+
pageBreak?: object;
|
|
203
|
+
paragraph?: object;
|
|
204
|
+
restrictedEditing?: object;
|
|
205
|
+
shiftEnter?: object;
|
|
206
|
+
strikethrough?: object;
|
|
207
|
+
subscript?: object;
|
|
208
|
+
superscript?: object;
|
|
209
|
+
tableOfContents?: object;
|
|
210
|
+
title?: object;
|
|
211
|
+
todoList?: object;
|
|
212
|
+
underline?: object;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Features registered by custom plugins through
|
|
216
|
+
* {@link module:ai/aicore/aieditorconfig~AIEditorConfig#add `AIEditorConfig#add()`}, reported in the
|
|
217
|
+
* {@link ~AIEditorConfig#get editor configuration snapshot}.
|
|
218
|
+
*
|
|
219
|
+
* Each key is the name of a registered feature and its value is the configuration passed during registration
|
|
220
|
+
* (with regular expressions converted to strings). Custom feature names never collide with the built-in keys
|
|
221
|
+
* of the snapshot.
|
|
222
|
+
*/
|
|
223
|
+
export type AIEditorConfigCustomFeatures = {
|
|
224
|
+
[customFeatureName: string]: unknown;
|
|
225
|
+
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @publicApi
|
|
8
8
|
*/
|
|
9
9
|
import { ContextPlugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
10
|
-
import {
|
|
10
|
+
import { DocumentDiffer } from "../toolkit/documentdiffer.js";
|
|
11
11
|
import { AICore } from "./aicore.js";
|
|
12
12
|
import { type AIModels } from "./model/aimodels.js";
|
|
13
13
|
import { AIResponseApplier } from "./pipeline/airesponseapplier.js";
|
|
@@ -81,7 +81,7 @@ export declare class AIGateway extends ContextPlugin {
|
|
|
81
81
|
/**
|
|
82
82
|
* @inheritDoc
|
|
83
83
|
*/
|
|
84
|
-
static get requires(): PluginDependenciesOf<[
|
|
84
|
+
static get requires(): PluginDependenciesOf<[DocumentDiffer, AICore]>;
|
|
85
85
|
/**
|
|
86
86
|
* The shared model registry. Exposed here so headless gateways are self-sufficient — integrators can
|
|
87
87
|
* discover and resolve models (`getAvailableModels()`, `getModel()`, `resolveModel()`, …) without
|
|
@@ -130,6 +130,11 @@ export declare class AIGateway extends ContextPlugin {
|
|
|
130
130
|
*
|
|
131
131
|
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
132
132
|
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
133
|
+
* @param changes The AI changes to merge.
|
|
134
|
+
* @param content The original content to merge the changes into.
|
|
135
|
+
* @param options Additional merge options.
|
|
133
136
|
*/
|
|
134
|
-
mergeChangesIntoContent(changes: ReadonlyArray<AIRunChangeData>, content: string
|
|
137
|
+
mergeChangesIntoContent(changes: ReadonlyArray<AIRunChangeData>, content: string, options?: {
|
|
138
|
+
allowedCustomElements?: ReadonlyArray<string>;
|
|
139
|
+
}): ReturnType<AIResponseApplier["merge"]>["parsedContent"];
|
|
135
140
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @publicApi
|
|
8
8
|
*/
|
|
9
9
|
import { type ObservableMixinConstructor } from "@ckeditor/ckeditor5-utils";
|
|
10
|
-
import { type
|
|
10
|
+
import { type AIEditorConfigSnapshot } from "../aieditorconfig.js";
|
|
11
11
|
import { type AIContextRef, type AIContextRefRequestData } from "./aicontextref.js";
|
|
12
12
|
/**
|
|
13
13
|
* The type of context item.
|
|
@@ -71,7 +71,7 @@ export type AIContextItemRequestData = {
|
|
|
71
71
|
start: number;
|
|
72
72
|
end: number;
|
|
73
73
|
}>;
|
|
74
|
-
editorConfig?:
|
|
74
|
+
editorConfig?: AIEditorConfigSnapshot;
|
|
75
75
|
};
|
|
76
76
|
/**
|
|
77
77
|
* A single entry in a request `content`/`parts` array: either a resolved context item or a
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ai/aicore/ui/aiscrollfillerview
|
|
7
|
+
*/
|
|
8
|
+
import { View } from "@ckeditor/ckeditor5-ui";
|
|
9
|
+
import { type Locale } from "@ckeditor/ckeditor5-utils";
|
|
10
|
+
/**
|
|
11
|
+
* The empty space inserted into scrollable containers that allows for
|
|
12
|
+
* scrolling the last element within the container to the top of the container.
|
|
13
|
+
*/
|
|
14
|
+
export declare class AIScrollFillerView extends View {
|
|
15
|
+
/**
|
|
16
|
+
* The current height (in pixels) of the filler.
|
|
17
|
+
*
|
|
18
|
+
* @observable
|
|
19
|
+
*/
|
|
20
|
+
space: number;
|
|
21
|
+
/**
|
|
22
|
+
* Sets the space to exactly what the element needs to scroll to `targetScrollTop`, adding or taking away space
|
|
23
|
+
* below its content.
|
|
24
|
+
*
|
|
25
|
+
* The space never gets smaller than the current scroll position needs, so taking it away does not make the element
|
|
26
|
+
* jump. Without `targetScrollTop`, the last one is used again, which lets the space follow the content as it changes.
|
|
27
|
+
* Use {@link #reset} to take the space away completely.
|
|
28
|
+
*
|
|
29
|
+
* @param targetScrollTop The scroll position the element has to be able to reach. Defaults to the last one given.
|
|
30
|
+
*/
|
|
31
|
+
adjustSpace(targetScrollTop?: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* Takes the space away.
|
|
34
|
+
*/
|
|
35
|
+
reset(): void;
|
|
36
|
+
constructor(locale: Locale);
|
|
37
|
+
}
|
|
@@ -31,9 +31,14 @@ export declare class AISuggestionBodyView extends View<HTMLDivElement> {
|
|
|
31
31
|
*/
|
|
32
32
|
isAcceptAllEnabled: boolean;
|
|
33
33
|
/**
|
|
34
|
-
* Observable property that indicates whether the track changes
|
|
34
|
+
* Observable property that indicates whether the track changes is on.
|
|
35
35
|
*/
|
|
36
36
|
isTrackChangesOn: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Observable property that indicates whether the actions suggesting changes may be shown, both on each content part and
|
|
39
|
+
* for all of them at once. They are never shown when `'insertSuggestion'` is not an available action.
|
|
40
|
+
*/
|
|
41
|
+
isSuggestVisible: boolean;
|
|
37
42
|
constructor(locale: Locale, options: {
|
|
38
43
|
areActionsDisabled: boolean;
|
|
39
44
|
showUnchangedParts: boolean;
|
|
@@ -25,6 +25,13 @@ export declare class AISuggestionContentPartStateView extends View {
|
|
|
25
25
|
* @default 'small'
|
|
26
26
|
*/
|
|
27
27
|
size: "small" | "large";
|
|
28
|
+
/**
|
|
29
|
+
* Whether the pill pops in when it is shown, to confirm a decision the user has just made.
|
|
30
|
+
*
|
|
31
|
+
* @observable
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
isAnimated: boolean;
|
|
28
35
|
constructor(locale: Locale, translationKeys?: AISuggestionContentPartTranslationKeys);
|
|
29
36
|
/**
|
|
30
37
|
* Sets the state of the view.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ai/aicore/utils/autoadvancedelay
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* How long, in milliseconds, the built-in UI waits after a decision on a change before it moves on to the next one.
|
|
10
|
+
* The decided change shows its state ("Accepted", "Dismissed") in the meantime, so the user sees the decision land before
|
|
11
|
+
* the lists, the content and the floating UI move, all at once.
|
|
12
|
+
*/
|
|
13
|
+
export declare const AUTO_ADVANCE_DELAY = 600;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ai/aicore/utils/getallowedcustomelements
|
|
7
|
+
*/
|
|
8
|
+
import { type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
/**
|
|
10
|
+
* Returns the private `config.ai.allowedCustomElements` option of the given editor as a list of lowercase tag names.
|
|
11
|
+
* A value set in a shared {@link module:core/context~Context} configuration is inherited by the editor.
|
|
12
|
+
*
|
|
13
|
+
* Returns an empty list when there is no editor, for example for a reply loaded from history whose source editor
|
|
14
|
+
* was not re-created in the current session.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getAllowedCustomElements(editor: Editor | undefined): Array<string>;
|