@ckeditor/ckeditor5-ai 48.3.1 → 48.4.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.
Files changed (246) hide show
  1. package/dist/aiactions/aiactions.d.ts +36 -1
  2. package/dist/aiactions/model/aiactionsinteraction.d.ts +7 -1
  3. package/dist/aiassistant/aiassistantui.d.ts +0 -3
  4. package/dist/aiballoon/aiballoon.d.ts +0 -1
  5. package/dist/aichat/aichatballoon.d.ts +7 -2
  6. package/dist/aichat/aichatcontroller.d.ts +12 -2
  7. package/dist/aichat/aichatui.d.ts +20 -6
  8. package/dist/aichat/model/aichatcontext.d.ts +29 -10
  9. package/dist/aichat/model/aichatconversation.d.ts +10 -1
  10. package/dist/aichat/model/aichatinteraction.d.ts +6 -1
  11. package/dist/aichat/ui/aichatballoonview.d.ts +14 -19
  12. package/dist/aichat/ui/aichatcontrolsview.d.ts +0 -9
  13. package/dist/aichat/ui/aichatfeedview.d.ts +5 -11
  14. package/dist/aichat/ui/aichatview.d.ts +0 -4
  15. package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +4 -0
  16. package/dist/aichat/ui/controls/aichatpromptcapabilitiesview.d.ts +14 -29
  17. package/dist/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +7 -2
  18. package/dist/aichathistory/aichathistoryui.d.ts +0 -1
  19. package/dist/aichatshortcuts/aichatshortcuts.d.ts +2 -2
  20. package/dist/aiconfig.d.ts +109 -0
  21. package/dist/aicore/aiconnector.d.ts +78 -11
  22. package/dist/aicore/aicore.d.ts +53 -0
  23. package/dist/aicore/aiediting.d.ts +8 -2
  24. package/dist/aicore/aigateway.d.ts +43 -11
  25. package/dist/aicore/errors/normalizeerror.d.ts +4 -0
  26. package/dist/aicore/model/aicapabilities.d.ts +20 -5
  27. package/dist/aicore/model/aicontext.d.ts +57 -2
  28. package/dist/aicore/model/aicontextlibrary.d.ts +70 -0
  29. package/dist/aicore/model/aicontextref.d.ts +39 -0
  30. package/dist/aicore/model/aidefaultcontext.d.ts +95 -0
  31. package/dist/aicore/model/aieditorroot.d.ts +26 -0
  32. package/dist/aicore/model/aimodels.d.ts +11 -4
  33. package/dist/aicore/model/aireply.d.ts +12 -1
  34. package/dist/aicore/model/airunresult.d.ts +18 -73
  35. package/dist/aicore/model/airunsinglerootresult.d.ts +101 -0
  36. package/dist/aicore/ui/aidisclaimerview.d.ts +0 -1
  37. package/dist/aicore/ui/aiheaderview.d.ts +0 -1
  38. package/dist/aicore/ui/aimodelselectorview.d.ts +151 -0
  39. package/dist/aicore/ui/aiskeleton.d.ts +0 -1
  40. package/dist/aicore/ui/aispinner.d.ts +0 -1
  41. package/dist/aicore/ui/suggestioncontainer/aiminitoolbarview.d.ts +0 -1
  42. package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +20 -5
  43. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +0 -1
  44. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +12 -1
  45. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +4 -12
  46. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +6 -1
  47. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +11 -1
  48. package/dist/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.d.ts +0 -1
  49. package/dist/aicore/utils/createandattachaibodycollection.d.ts +0 -1
  50. package/dist/aicore/utils/createresizebutton.d.ts +0 -1
  51. package/dist/aicore/utils/createstartconversationbutton.d.ts +0 -1
  52. package/dist/aicore/utils/geteditorconfig.d.ts +88 -0
  53. package/dist/aicore/utils/getmodeldisplaymode.d.ts +21 -0
  54. package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +4 -1
  55. package/dist/aicore/utils/htmlparser.d.ts +1 -0
  56. package/dist/aicore/utils/inlineroot.d.ts +1 -0
  57. package/dist/aicore/utils/tocontextrefrequestdata.d.ts +1 -0
  58. package/dist/aidocumentprocessing/aidocumentprocessinggateway.d.ts +48 -25
  59. package/dist/aidocumentprocessing/model/aidocumentprocessingrunresult.d.ts +2 -2
  60. package/dist/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +0 -1
  61. package/dist/aiquickactions/aiquickactions.d.ts +60 -9
  62. package/dist/aiquickactions/aiquickactionsui.d.ts +10 -4
  63. package/dist/aiquickactions/ui/balloon/aiactionsballoonview.d.ts +6 -1
  64. package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +2 -4
  65. package/dist/aireviewcore/aireviewcoreediting.d.ts +43 -6
  66. package/dist/aireviewcore/aireviewcoreui.d.ts +3 -10
  67. package/dist/aireviewcore/model/aichecksinglerootresult.d.ts +22 -0
  68. package/dist/aireviewcore/model/aireviewcheckresultchange.d.ts +12 -1
  69. package/dist/aireviewcore/model/aireviewcheckrun.d.ts +11 -1
  70. package/dist/aireviewcore/types.d.ts +7 -1
  71. package/dist/aireviewcore/ui/aireviewcoreballoonsuggestionview.d.ts +0 -2
  72. package/dist/aireviewcore/ui/aireviewcorechecklistitemresultview.d.ts +7 -0
  73. package/dist/aireviewcore/ui/aireviewcorecustomcheckview.d.ts +1 -19
  74. package/dist/aireviewcore/ui/aireviewcorefinishreviewbuttonview.d.ts +0 -1
  75. package/dist/aireviewcore/ui/aireviewcorereviewchecklistview.d.ts +0 -1
  76. package/dist/aireviewcore/ui/aireviewcorereviewcompletedview.d.ts +0 -1
  77. package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +10 -8
  78. package/dist/aireviewcore/ui/aireviewcoreview.d.ts +3 -4
  79. package/dist/aireviewmode/aireviewgateway.d.ts +63 -44
  80. package/dist/aireviewmode/aireviewmode.d.ts +73 -5
  81. package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +8 -1
  82. package/dist/aireviewmode/aireviewmodecontroller.d.ts +2 -1
  83. package/dist/aireviewmode/model/aireviewcheckextra.d.ts +7 -2
  84. package/dist/aireviewmode/model/aireviewcustomcheckrun.d.ts +2 -1
  85. package/dist/aitabs/aitabsmainview.d.ts +0 -1
  86. package/dist/aitabs/tabs/aitabsview.d.ts +0 -1
  87. package/dist/aitabs/tabs/tabbuttonview.d.ts +0 -1
  88. package/dist/aitranslate/aitranslatecontroller.d.ts +2 -1
  89. package/dist/aitranslate/aitranslategateway.d.ts +33 -21
  90. package/dist/aitranslate/aitranslateui.d.ts +0 -1
  91. package/dist/aitranslate/model/aitranslatecheckrun.d.ts +2 -1
  92. package/dist/augmentation.d.ts +2 -0
  93. package/dist/index-content.css +0 -97
  94. package/dist/index-editor.css +2640 -2631
  95. package/dist/index.css +36 -32
  96. package/dist/index.d.ts +17 -8
  97. package/dist/index.js +19 -19
  98. package/dist/translations/af.js +1 -1
  99. package/dist/translations/af.umd.js +1 -1
  100. package/dist/translations/ar.js +1 -1
  101. package/dist/translations/ar.umd.js +1 -1
  102. package/dist/translations/ast.js +1 -1
  103. package/dist/translations/ast.umd.js +1 -1
  104. package/dist/translations/az.js +1 -1
  105. package/dist/translations/az.umd.js +1 -1
  106. package/dist/translations/be.js +1 -1
  107. package/dist/translations/be.umd.js +1 -1
  108. package/dist/translations/bg.js +1 -1
  109. package/dist/translations/bg.umd.js +1 -1
  110. package/dist/translations/bn.js +1 -1
  111. package/dist/translations/bn.umd.js +1 -1
  112. package/dist/translations/bs.js +1 -1
  113. package/dist/translations/bs.umd.js +1 -1
  114. package/dist/translations/ca.js +1 -1
  115. package/dist/translations/ca.umd.js +1 -1
  116. package/dist/translations/cs.js +1 -1
  117. package/dist/translations/cs.umd.js +1 -1
  118. package/dist/translations/da.js +1 -1
  119. package/dist/translations/da.umd.js +1 -1
  120. package/dist/translations/de-ch.js +1 -1
  121. package/dist/translations/de-ch.umd.js +1 -1
  122. package/dist/translations/de.js +1 -1
  123. package/dist/translations/de.umd.js +1 -1
  124. package/dist/translations/el.js +1 -1
  125. package/dist/translations/el.umd.js +1 -1
  126. package/dist/translations/en-au.js +1 -1
  127. package/dist/translations/en-au.umd.js +1 -1
  128. package/dist/translations/en-gb.js +1 -1
  129. package/dist/translations/en-gb.umd.js +1 -1
  130. package/dist/translations/en.js +1 -1
  131. package/dist/translations/en.umd.js +1 -1
  132. package/dist/translations/eo.js +1 -1
  133. package/dist/translations/eo.umd.js +1 -1
  134. package/dist/translations/es-co.js +1 -1
  135. package/dist/translations/es-co.umd.js +1 -1
  136. package/dist/translations/es.js +1 -1
  137. package/dist/translations/es.umd.js +1 -1
  138. package/dist/translations/et.js +1 -1
  139. package/dist/translations/et.umd.js +1 -1
  140. package/dist/translations/eu.js +1 -1
  141. package/dist/translations/eu.umd.js +1 -1
  142. package/dist/translations/fa.js +1 -1
  143. package/dist/translations/fa.umd.js +1 -1
  144. package/dist/translations/fi.js +1 -1
  145. package/dist/translations/fi.umd.js +1 -1
  146. package/dist/translations/fr.js +1 -1
  147. package/dist/translations/fr.umd.js +1 -1
  148. package/dist/translations/gl.js +1 -1
  149. package/dist/translations/gl.umd.js +1 -1
  150. package/dist/translations/gu.js +1 -1
  151. package/dist/translations/gu.umd.js +1 -1
  152. package/dist/translations/he.js +1 -1
  153. package/dist/translations/he.umd.js +1 -1
  154. package/dist/translations/hi.js +1 -1
  155. package/dist/translations/hi.umd.js +1 -1
  156. package/dist/translations/hr.js +1 -1
  157. package/dist/translations/hr.umd.js +1 -1
  158. package/dist/translations/hu.js +1 -1
  159. package/dist/translations/hu.umd.js +1 -1
  160. package/dist/translations/hy.js +1 -1
  161. package/dist/translations/hy.umd.js +1 -1
  162. package/dist/translations/id.js +1 -1
  163. package/dist/translations/id.umd.js +1 -1
  164. package/dist/translations/it.js +1 -1
  165. package/dist/translations/it.umd.js +1 -1
  166. package/dist/translations/ja.js +1 -1
  167. package/dist/translations/ja.umd.js +1 -1
  168. package/dist/translations/jv.js +1 -1
  169. package/dist/translations/jv.umd.js +1 -1
  170. package/dist/translations/kk.js +1 -1
  171. package/dist/translations/kk.umd.js +1 -1
  172. package/dist/translations/km.js +1 -1
  173. package/dist/translations/km.umd.js +1 -1
  174. package/dist/translations/kn.js +1 -1
  175. package/dist/translations/kn.umd.js +1 -1
  176. package/dist/translations/ko.js +1 -1
  177. package/dist/translations/ko.umd.js +1 -1
  178. package/dist/translations/ku.js +1 -1
  179. package/dist/translations/ku.umd.js +1 -1
  180. package/dist/translations/lt.js +1 -1
  181. package/dist/translations/lt.umd.js +1 -1
  182. package/dist/translations/lv.js +1 -1
  183. package/dist/translations/lv.umd.js +1 -1
  184. package/dist/translations/ms.js +1 -1
  185. package/dist/translations/ms.umd.js +1 -1
  186. package/dist/translations/nb.js +1 -1
  187. package/dist/translations/nb.umd.js +1 -1
  188. package/dist/translations/ne.js +1 -1
  189. package/dist/translations/ne.umd.js +1 -1
  190. package/dist/translations/nl.js +1 -1
  191. package/dist/translations/nl.umd.js +1 -1
  192. package/dist/translations/no.js +1 -1
  193. package/dist/translations/no.umd.js +1 -1
  194. package/dist/translations/oc.js +1 -1
  195. package/dist/translations/oc.umd.js +1 -1
  196. package/dist/translations/pl.js +1 -1
  197. package/dist/translations/pl.umd.js +1 -1
  198. package/dist/translations/pt-br.js +1 -1
  199. package/dist/translations/pt-br.umd.js +1 -1
  200. package/dist/translations/pt.js +1 -1
  201. package/dist/translations/pt.umd.js +1 -1
  202. package/dist/translations/ro.js +1 -1
  203. package/dist/translations/ro.umd.js +1 -1
  204. package/dist/translations/ru.js +1 -1
  205. package/dist/translations/ru.umd.js +1 -1
  206. package/dist/translations/si.js +1 -1
  207. package/dist/translations/si.umd.js +1 -1
  208. package/dist/translations/sk.js +1 -1
  209. package/dist/translations/sk.umd.js +1 -1
  210. package/dist/translations/sl.js +1 -1
  211. package/dist/translations/sl.umd.js +1 -1
  212. package/dist/translations/sq.js +1 -1
  213. package/dist/translations/sq.umd.js +1 -1
  214. package/dist/translations/sr-latn.js +1 -1
  215. package/dist/translations/sr-latn.umd.js +1 -1
  216. package/dist/translations/sr.js +1 -1
  217. package/dist/translations/sr.umd.js +1 -1
  218. package/dist/translations/sv.js +1 -1
  219. package/dist/translations/sv.umd.js +1 -1
  220. package/dist/translations/th.js +1 -1
  221. package/dist/translations/th.umd.js +1 -1
  222. package/dist/translations/ti.js +1 -1
  223. package/dist/translations/ti.umd.js +1 -1
  224. package/dist/translations/tk.js +1 -1
  225. package/dist/translations/tk.umd.js +1 -1
  226. package/dist/translations/tr.js +1 -1
  227. package/dist/translations/tr.umd.js +1 -1
  228. package/dist/translations/tt.js +1 -1
  229. package/dist/translations/tt.umd.js +1 -1
  230. package/dist/translations/ug.js +1 -1
  231. package/dist/translations/ug.umd.js +1 -1
  232. package/dist/translations/uk.js +1 -1
  233. package/dist/translations/uk.umd.js +1 -1
  234. package/dist/translations/ur.js +1 -1
  235. package/dist/translations/ur.umd.js +1 -1
  236. package/dist/translations/uz.js +1 -1
  237. package/dist/translations/uz.umd.js +1 -1
  238. package/dist/translations/vi.js +1 -1
  239. package/dist/translations/vi.umd.js +1 -1
  240. package/dist/translations/zh-cn.js +1 -1
  241. package/dist/translations/zh-cn.umd.js +1 -1
  242. package/dist/translations/zh.js +1 -1
  243. package/dist/translations/zh.umd.js +1 -1
  244. package/package.json +30 -12
  245. package/dist/aireviewmode/model/aireviewrunresult.d.ts +0 -20
  246. package/dist/aitranslate/model/aitranslaterunresult.d.ts +0 -20
@@ -0,0 +1,151 @@
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/aimodelselectorview
7
+ */
8
+ import { type Locale } from "@ckeditor/ckeditor5-utils";
9
+ import { ButtonLabelView, View, type DropdownView } from "@ckeditor/ckeditor5-ui";
10
+ import { type AIModelData } from "../aiconnector.js";
11
+ import { type AIModelDisplayMode } from "../utils/getmodeldisplaymode.js";
12
+ /**
13
+ * Per-feature configuration for the shared {@link module:ai/aicore/ui/aimodelselectorview~AIModelSelectorView}.
14
+ */
15
+ export interface AIModelSelectorConfig {
16
+ /**
17
+ * The dropdown panel position (e.g. `'ne'` for AI Chat, `'se'` for AI Review).
18
+ */
19
+ panelPosition: DropdownView["panelPosition"];
20
+ /**
21
+ * CSS class(es) for the dropdown.
22
+ */
23
+ dropdownClass: string | Array<string>;
24
+ /**
25
+ * CSS class for the model-name label (shown when there is a single model).
26
+ */
27
+ nameClass: string;
28
+ /**
29
+ * CSS classes for the dropdown item label parts.
30
+ */
31
+ itemClasses: {
32
+ name: string;
33
+ description: string;
34
+ capabilities?: string;
35
+ };
36
+ /**
37
+ * The dropdown button label shown before a model is selected. Optional — features that immediately
38
+ * select a default model (e.g. AI Review) do not need it.
39
+ */
40
+ defaultLabel?: string;
41
+ /**
42
+ * Optional tooltip shown on the dropdown button while the selector is disabled. When omitted, the
43
+ * active model name (the button label) is used as the tooltip regardless of the enabled state.
44
+ */
45
+ disabledTooltip?: string;
46
+ /**
47
+ * Optional tooltip position for the dropdown button.
48
+ */
49
+ tooltipPosition?: "s" | "n" | "e" | "w" | "sw" | "se" | "nw" | "ne";
50
+ /**
51
+ * When `true`, each dropdown item also renders the model's capabilities (web search, reasoning).
52
+ * Used by AI Chat; AI Review leaves it off.
53
+ */
54
+ showCapabilities?: boolean;
55
+ }
56
+ /**
57
+ * Fired when the user picks a model from the dropdown. Parents decide what to do with the selection
58
+ * (the view does not update its own {@link module:ai/aicore/ui/aimodelselectorview~AIModelSelectorView#activeModelId}
59
+ * optimistically — call {@link module:ai/aicore/ui/aimodelselectorview~AIModelSelectorView#setSelectedModel} to reflect it).
60
+ */
61
+ export type AIModelSelectorSelectEvent = {
62
+ name: "selectModel";
63
+ args: [model: AIModelData];
64
+ };
65
+ /**
66
+ * A shared model-selector: a dropdown of available models plus a single-model name label, with the
67
+ * display-mode / active-model state. Used by AI Chat and AI Review; per-feature differences (CSS,
68
+ * default label, chat's capability rendering) are injected via {@link ~AIModelSelectorConfig}.
69
+ */
70
+ export declare class AIModelSelectorView extends View {
71
+ /**
72
+ * How the selector is presented: `'selector'` (dropdown), `'name'` (single model), or `'hidden'`.
73
+ *
74
+ * @observable
75
+ */
76
+ modelDisplayMode: AIModelDisplayMode;
77
+ /**
78
+ * The id of the currently active model (drives the dropdown item highlight).
79
+ *
80
+ * @observable
81
+ */
82
+ activeModelId: string | null;
83
+ /**
84
+ * The name of the currently active model (shown in `'name'` display mode).
85
+ *
86
+ * @observable
87
+ */
88
+ activeModelName: string | null;
89
+ /**
90
+ * Whether the selector is enabled.
91
+ *
92
+ * @observable
93
+ */
94
+ isEnabled: boolean;
95
+ /**
96
+ * The model-selection dropdown.
97
+ */
98
+ readonly dropdownView: DropdownView;
99
+ /**
100
+ * The single-model name label.
101
+ */
102
+ readonly nameView: ModelNameView;
103
+ /**
104
+ * @inheritDoc
105
+ */
106
+ constructor(locale: Locale, config: AIModelSelectorConfig);
107
+ /**
108
+ * Populates the dropdown with the given models and updates the display mode.
109
+ */
110
+ setModels(models: Array<AIModelData>, showSelector: boolean): void;
111
+ /**
112
+ * Reflects the given model as the active selection (highlight, name, dropdown label). Passing `null`
113
+ * clears the active selection, which lets parents derive an "is a model available" state from
114
+ * {@link #activeModelId}.
115
+ */
116
+ setSelectedModel(model: AIModelData | null): void;
117
+ }
118
+ /**
119
+ * The single-model name label used by {@link module:ai/aicore/ui/aimodelselectorview~AIModelSelectorView}.
120
+ */
121
+ export declare class ModelNameView extends View {
122
+ /**
123
+ * The text of the label.
124
+ *
125
+ * @observable
126
+ */
127
+ text: string | undefined;
128
+ /**
129
+ * @observable
130
+ */
131
+ isVisible: boolean;
132
+ /**
133
+ * @inheritDoc
134
+ */
135
+ constructor(locale: Locale, cssClass: string);
136
+ }
137
+ /**
138
+ * The dropdown item label (model name + description, plus optional extra content such as capabilities)
139
+ * used by {@link module:ai/aicore/ui/aimodelselectorview~AIModelSelectorView}.
140
+ */
141
+ export declare class ModelButtonLabelView extends ButtonLabelView {
142
+ /**
143
+ * @inheritDoc
144
+ */
145
+ constructor(locale: Locale, model: AIModelData, options: {
146
+ nameClass: string;
147
+ descriptionClass: string;
148
+ capabilitiesClass?: string;
149
+ extraContent?: Array<View>;
150
+ });
151
+ }
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { View } from "@ckeditor/ckeditor5-ui";
9
9
  import { type Locale } from "@ckeditor/ckeditor5-utils";
10
- import "../../../theme/common/aiskeleton.css";
11
10
  export declare class AISkeletonView extends View {
12
11
  /**
13
12
  * Controls the visibility of the skeleton view.
@@ -6,7 +6,6 @@
6
6
  * @module ai/aicore/ui/aispinner
7
7
  */
8
8
  import { SpinnerView } from "@ckeditor/ckeditor5-ui";
9
- import "../../../theme/common/aispinner.css";
10
9
  export declare class AISpinnerView extends SpinnerView {
11
10
  /**
12
11
  * @inheritDoc
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { type Locale } from "@ckeditor/ckeditor5-utils";
9
9
  import { ToolbarView, type ViewCollection } from "@ckeditor/ckeditor5-ui";
10
- import "../../../../theme/aichat/aiminitoolbar.css";
11
10
  /**
12
11
  * Configuration interface for AIMiniToolbarView buttons.
13
12
  */
@@ -10,18 +10,26 @@ import { type BodyCollection, View } from "@ckeditor/ckeditor5-ui";
10
10
  import { AISuggestionBodyViewContentPartView } from "./aisuggestioncontentpartview.js";
11
11
  import { type AISuggestionContentPartDefinition } from "../../utils/getsuggestionpartsfromreply.js";
12
12
  import { type AISuggestionActionName } from "../../../aichat/ui/feed/aichatfeedsuggestionitemactionsview.js";
13
- import { type AIReplyChangeGroupState } from "../../model/aireply.js";
13
+ import { type AIReplyChangeGroupState, type AIReplyChangeGroupOutdatedReason } from "../../model/aireply.js";
14
14
  import { type AISource } from "../../aiconnector.js";
15
15
  /**
16
+ * A read-only gating state for one suggestion reply: per-part (by change-group index) read-only flags and
17
+ * whether "apply/suggest all" is currently enabled. Computed by the controller, applied by the views.
18
+ */
19
+ export type AISuggestionGating = {
20
+ readOnlyByIndex: Map<number, boolean>;
21
+ isAcceptAllEnabled: boolean;
22
+ };
23
+ /**
16
24
  * The inner view of the suggestion container that displays the content of the suggestion (or multiple parts of it).
17
25
  */
18
26
  export declare class AISuggestionBodyView extends View<HTMLDivElement> {
19
27
  /**
20
- * Observable property that indicates whether the suggestion body has pending parts.
28
+ * The observable that "apply/suggest all" action binds to.
21
29
  *
22
- * This flag affects the interactivity of the {@link #actionsView} buttons.
30
+ * @observable
23
31
  */
24
- hasPendingParts: boolean;
32
+ isAcceptAllEnabled: boolean;
25
33
  /**
26
34
  * Observable property that indicates whether the track changes are on.
27
35
  */
@@ -56,7 +64,14 @@ export declare class AISuggestionBodyView extends View<HTMLDivElement> {
56
64
  /**
57
65
  * Updates the state of a content part by its index.
58
66
  */
59
- updatePartState(index: number, state: AIReplyChangeGroupState): void;
67
+ updatePartState(index: number, state: AIReplyChangeGroupState, outdatedReason?: AIReplyChangeGroupOutdatedReason): void;
68
+ /**
69
+ * Applies the gating state.
70
+ *
71
+ * Sets each existing part view's read-only flag and the "apply/suggest all" enablement.
72
+ * Parts still streaming pick up the read-only flag on creation.
73
+ */
74
+ setGating({ readOnlyByIndex, isAcceptAllEnabled }: AISuggestionGating): void;
60
75
  /**
61
76
  * Sets the part active or not (active parts are those currently previewed in a dialog by the user).
62
77
  *
@@ -10,7 +10,6 @@ import { View, type BodyCollection } from "@ckeditor/ckeditor5-ui";
10
10
  import { type AISuggestionContentPartDefinition } from "../../utils/getsuggestionpartsfromreply.js";
11
11
  import { type AISource } from "../../aiconnector.js";
12
12
  import { type AISuggestionActionName } from "../../../aichat/ui/feed/aichatfeedsuggestionitemactionsview.js";
13
- import "../../../../theme/aichat/aisuggestioncontainer.css";
14
13
  /**
15
14
  * This view displays a suggestion from the AI.
16
15
  *
@@ -10,7 +10,7 @@ import { type AISuggestionActionName } from "../../../aichat/ui/feed/aichatfeeds
10
10
  import { type AISuggestionContentPartDefinition } from "../../utils/getsuggestionpartsfromreply.js";
11
11
  import { type Locale } from "@ckeditor/ckeditor5-utils";
12
12
  import { AISuggestionContentPartToolbarView } from "./aisuggestioncontentparttoolbarview.js";
13
- import { type AIReplyChangeGroupState } from "../../model/aireply.js";
13
+ import { type AIReplyChangeGroupState, type AIReplyChangeGroupOutdatedReason } from "../../model/aireply.js";
14
14
  /**
15
15
  * A view that displays the header of a single part in the suggestion content.
16
16
  *
@@ -25,6 +25,10 @@ export declare class AISuggestionContentPartHeaderView extends View<HTMLDivEleme
25
25
  */
26
26
  state: AIReplyChangeGroupState;
27
27
  /**
28
+ * For the `'outdated'` {@link #state}, the reason that selects the {@link #stateView} pill's tooltip.
29
+ */
30
+ outdatedReason: AIReplyChangeGroupOutdatedReason | undefined;
31
+ /**
28
32
  * Controls whether the content part is enabled, which means that it can be interacted with. It affects the interactivity
29
33
  * of the {@link #toolbarView} buttons.
30
34
  */
@@ -37,6 +41,13 @@ export declare class AISuggestionContentPartHeaderView extends View<HTMLDivEleme
37
41
  * Observable property that indicates whether the track changes feature is on.
38
42
  */
39
43
  isTrackChangesOn: boolean;
44
+ /**
45
+ * Whether the target editor is read-only. Forwarded to the toolbar to disable the write actions (apply,
46
+ * suggest) while keeping the reject action available.
47
+ *
48
+ * @observable
49
+ */
50
+ isTargetReadOnly: boolean;
40
51
  constructor(locale: Locale, { part, uiIndex, availableActions, areActionsDisabled }: {
41
52
  part: AISuggestionContentPartDefinition;
42
53
  uiIndex: number;
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module ai/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview
7
7
  */
8
- import { IconView, View } from "@ckeditor/ckeditor5-ui";
8
+ import { View } from "@ckeditor/ckeditor5-ui";
9
9
  import { type Locale } from "@ckeditor/ckeditor5-utils";
10
- import "../../../../theme/common/aisuggestioncontentpartstate.css";
10
+ import { type AIReplyChangeGroupOutdatedReason } from "../../model/aireply.js";
11
11
  export type AISuggestionContentPartState = "accepted" | "rejected" | "outdated";
12
12
  export declare const ICON_STATE_MAP: Record<AISuggestionContentPartState, string>;
13
13
  /**
@@ -15,19 +15,11 @@ export declare const ICON_STATE_MAP: Record<AISuggestionContentPartState, string
15
15
  */
16
16
  export declare class AISuggestionContentPartStateView extends View {
17
17
  state: AISuggestionContentPartState;
18
+ outdatedReason: AIReplyChangeGroupOutdatedReason | undefined;
18
19
  isVisible: boolean;
19
20
  constructor(locale: Locale);
20
21
  /**
21
22
  * Sets the state of the view.
22
23
  */
23
- setState(state: keyof typeof ICON_STATE_MAP): void;
24
- }
25
- /**
26
- * A view that displays the icon of the state of a single part in the suggestion content.
27
- *
28
- * It automatically updates the icon content based on the state.
29
- */
30
- export declare class StateIconView extends IconView {
31
- state: keyof typeof ICON_STATE_MAP;
32
- constructor();
24
+ setState(state: keyof typeof ICON_STATE_MAP, outdatedReason?: AIReplyChangeGroupOutdatedReason): void;
33
25
  }
@@ -8,7 +8,6 @@
8
8
  import { ToolbarView } from "@ckeditor/ckeditor5-ui";
9
9
  import { type Locale } from "@ckeditor/ckeditor5-utils";
10
10
  import { type AISuggestionActionName } from "../../../aichat/ui/feed/aichatfeedsuggestionitemactionsview.js";
11
- import "../../../../theme/common/aisuggestioncontentparttoolbar.css";
12
11
  /**
13
12
  * A toolbar view with actions for a specific suggestion: delete, insert, apply.
14
13
  */
@@ -19,6 +18,12 @@ export declare class AISuggestionContentPartToolbarView extends ToolbarView {
19
18
  * Observable property that indicates whether the track changes feature is on.
20
19
  */
21
20
  isTrackChangesOn: boolean;
21
+ /**
22
+ * Whether the target editor is read-only. Disables the write actions (apply, suggest), but not reject.
23
+ *
24
+ * @observable
25
+ */
26
+ isTargetReadOnly: boolean;
22
27
  constructor(locale: Locale, availableActions: Array<AISuggestionActionName>, areActionsDisabled?: boolean);
23
28
  /**
24
29
  * Toggles the visibility of the apply and suggest buttons.
@@ -8,7 +8,7 @@
8
8
  import { type Locale } from "@ckeditor/ckeditor5-utils";
9
9
  import { View } from "@ckeditor/ckeditor5-ui";
10
10
  import { type AISuggestionContentPartDefinition } from "../../utils/getsuggestionpartsfromreply.js";
11
- import { type AIReplyChangeGroupState } from "../../model/aireply.js";
11
+ import { type AIReplyChangeGroupState, type AIReplyChangeGroupOutdatedReason } from "../../model/aireply.js";
12
12
  import { type AISuggestionActionName } from "../../../aichat/ui/feed/aichatfeedsuggestionitemactionsview.js";
13
13
  /**
14
14
  * A view that displays a single part in the suggestion content.
@@ -23,6 +23,10 @@ export declare class AISuggestionBodyViewContentPartView extends View<HTMLDivEle
23
23
  */
24
24
  state: AIReplyChangeGroupState;
25
25
  /**
26
+ * For the `'outdated'` state, the reason that selects the state pill's tooltip.
27
+ */
28
+ outdatedReason: AIReplyChangeGroupOutdatedReason | undefined;
29
+ /**
26
30
  * Controls whether the content part is enabled, which means that it can be interacted with. This flag is a composition
27
31
  * of `isDone`, `state` and initial `areActionsDisabled` flags.
28
32
  */
@@ -44,6 +48,12 @@ export declare class AISuggestionBodyViewContentPartView extends View<HTMLDivEle
44
48
  */
45
49
  isTrackChangesOn: boolean;
46
50
  /**
51
+ * Whether the target editor is read-only. Forwarded to the toolbar to disable the write actions (apply, suggest).
52
+ *
53
+ * @observable
54
+ */
55
+ isTargetReadOnly: boolean;
56
+ /**
47
57
  * @inheritDoc
48
58
  */
49
59
  constructor(locale: Locale, { part, uiIndex, areActionsDisabled, availableActions }: {
@@ -8,7 +8,6 @@
8
8
  import { View } from "@ckeditor/ckeditor5-ui";
9
9
  import { type Locale } from "@ckeditor/ckeditor5-utils";
10
10
  import { type AISuggestionContentPartDefinition } from "../../utils/getsuggestionpartsfromreply.js";
11
- import "../../../../theme/common/aisuggestionstreamablecontent.css";
12
11
  /**
13
12
  * A container that is able to stream its own content (see {@link #update}).
14
13
  */
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import type { Locale } from "@ckeditor/ckeditor5-utils";
9
9
  import { BodyCollection } from "@ckeditor/ckeditor5-ui";
10
- import "../../../theme/common/aibody.css";
11
10
  /**
12
11
  * Creates a body collection dedicated to the AI features UI and attaches it to the DOM.
13
12
  *
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import type { Locale } from "@ckeditor/ckeditor5-utils";
9
9
  import { ButtonView, type View } from "@ckeditor/ckeditor5-ui";
10
- import "../../../theme/aitabs/aitabsresizebutton.css";
11
10
  export declare function createResizeButton<T extends View & {
12
11
  isMaximized: boolean;
13
12
  }>(locale: Locale, view: T): ButtonView;
@@ -7,5 +7,4 @@
7
7
  */
8
8
  import type { Locale } from "@ckeditor/ckeditor5-utils";
9
9
  import { ButtonView, type View } from "@ckeditor/ckeditor5-ui";
10
- import "../../../theme/common/aiheader.css";
11
10
  export declare function createStartConversationButton<T extends View>(locale: Locale, view: T): ButtonView;
@@ -0,0 +1,88 @@
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/geteditorconfig
7
+ */
8
+ import { type Editor } from "@ckeditor/ckeditor5-core";
9
+ import { type AlignmentConfig } from "@ckeditor/ckeditor5-alignment";
10
+ import { type CodeBlockConfig } from "@ckeditor/ckeditor5-code-block";
11
+ import { type FontSizeConfig, type FontFamilyConfig, type FontColorConfig } from "@ckeditor/ckeditor5-font";
12
+ import { type FootnotesConfig } from "@ckeditor/ckeditor5-footnotes";
13
+ import { type HeadingConfig } from "@ckeditor/ckeditor5-heading";
14
+ import { type HighlightConfig } from "@ckeditor/ckeditor5-highlight";
15
+ import { type ImageConfig } from "@ckeditor/ckeditor5-image";
16
+ import { type IndentBlockConfig } from "@ckeditor/ckeditor5-indent";
17
+ import { type TextPartLanguageOption } from "@ckeditor/ckeditor5-language";
18
+ import { type LineHeightConfig } from "@ckeditor/ckeditor5-line-height";
19
+ import { type LinkConfig } from "@ckeditor/ckeditor5-link";
20
+ import { type ListConfig } from "@ckeditor/ckeditor5-list";
21
+ import { type MentionConfig } from "@ckeditor/ckeditor5-mention";
22
+ import { type MergeFieldsConfig } from "@ckeditor/ckeditor5-merge-fields";
23
+ import { type MultiLevelListConfig } from "@ckeditor/ckeditor5-list-multi-level";
24
+ import { type StyleConfig } from "@ckeditor/ckeditor5-style";
25
+ import { type TableConfig } from "@ckeditor/ckeditor5-table";
26
+ import { type MediaEmbedConfig } from "@ckeditor/ckeditor5-media-embed";
27
+ /**
28
+ * Builds a compact, serializable snapshot of the editor's feature capabilities for the AI agent.
29
+ *
30
+ * The returned object is keyed by feature. A key is present only when the feature's plugin is loaded, so the agent
31
+ * can tell at a glance what content the editor is able to produce:
32
+ *
33
+ * * For configurable features, the value is that feature's configuration with UI-only options stripped out
34
+ * (toolbars, color pickers, icons, labels, keystrokes, dropdown limits, preview machinery, …), leaving only the
35
+ * options that actually shape the document data.
36
+ * * For features that expose no data-relevant configuration, the value is an empty object acting purely as a
37
+ * presence flag.
38
+ *
39
+ * Knowing both which features are available and how they are configured (e.g. the allowed heading levels, font
40
+ * sizes or table properties) lets the agent keep its edits within what the editor can represent.
41
+ *
42
+ * The live editor configuration is never mutated.
43
+ *
44
+ * @param editor The editor whose feature configuration is gathered.
45
+ * @returns The editor's feature capabilities snapshot.
46
+ */
47
+ export declare function getEditorConfig(editor: Editor): AIEditorConfig;
48
+ export interface AIEditorConfig {
49
+ alignment?: AlignmentConfig;
50
+ codeBlock?: CodeBlockConfig;
51
+ fontBackgroundColor?: FontColorConfig;
52
+ fontColor?: FontColorConfig;
53
+ fontFamily?: FontFamilyConfig;
54
+ fontSize?: FontSizeConfig;
55
+ footnotes?: FootnotesConfig;
56
+ heading?: HeadingConfig;
57
+ highlight?: HighlightConfig;
58
+ image?: ImageConfig;
59
+ indentBlock?: IndentBlockConfig;
60
+ lineHeight?: LineHeightConfig;
61
+ link?: LinkConfig;
62
+ list?: ListConfig;
63
+ listMultiLevel?: MultiLevelListConfig;
64
+ mediaEmbed?: MediaEmbedConfig;
65
+ mention?: MentionConfig;
66
+ mergeFields?: MergeFieldsConfig;
67
+ style?: StyleConfig;
68
+ table?: TableConfig;
69
+ textPartLanguage?: Array<TextPartLanguageOption>;
70
+ blockQuote?: object;
71
+ bold?: object;
72
+ bookmark?: object;
73
+ code?: object;
74
+ horizontalLine?: object;
75
+ htmlEmbed?: object;
76
+ italic?: object;
77
+ math?: object;
78
+ pageBreak?: object;
79
+ paragraph?: object;
80
+ restrictedEditing?: object;
81
+ strikethrough?: object;
82
+ subscript?: object;
83
+ superscript?: object;
84
+ tableOfContents?: object;
85
+ title?: object;
86
+ todoList?: object;
87
+ underline?: object;
88
+ }
@@ -0,0 +1,21 @@
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/getmodeldisplaymode
7
+ */
8
+ /**
9
+ * How the model selector should be presented in the UI:
10
+ * * `'selector'` — a dropdown with the available models,
11
+ * * `'name'` — just the single model's name (no choice to make),
12
+ * * `'hidden'` — no model UI at all.
13
+ */
14
+ export type AIModelDisplayMode = "selector" | "name" | "hidden";
15
+ /**
16
+ * Resolves how the model selector should be presented, shared by all AI features that expose one.
17
+ *
18
+ * @param modelCount The number of available models.
19
+ * @param showModelSelector Whether the model selector UI is enabled (the `ai.models.showModelSelector` config).
20
+ */
21
+ export declare function getModelDisplayMode(modelCount: number, showModelSelector: boolean): AIModelDisplayMode;
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { type Editor } from "@ckeditor/ckeditor5-core";
9
9
  import { Document } from "./htmlparser.js";
10
- import { type AIReplyChangeGroup } from "../model/aireply.js";
10
+ import { type AIReplyChangeGroup, type AIReplyChangeGroupState, type AIReplyChangeGroupOutdatedReason } from "../model/aireply.js";
11
11
  export declare function getSuggestionPartsFromReply({ changeGroups, documentContextContent, showDiff, trimUnchanged }: {
12
12
  showDiff: boolean;
13
13
  changeGroups: Array<AIReplyChangeGroup>;
@@ -21,6 +21,9 @@ export declare function passThroughEditorDataPipeline(editor: Editor, before: Do
21
21
  export type AISuggestionContentPartDefinition = {
22
22
  type: "modified" | "new" | "removed" | "context";
23
23
  index: number;
24
+ state: AIReplyChangeGroupState;
25
+ outdatedReason?: AIReplyChangeGroupOutdatedReason;
24
26
  content: Document;
25
27
  hasChanges: boolean;
28
+ wrapperTag?: string;
26
29
  };
@@ -17,6 +17,7 @@ export declare function findByAttribute(name: string, value: string | null, node
17
17
  export declare function findAllByAttribute(name: string, value: string | null, nodes: Array<AnyNode> | ParentNode): ReturnType<typeof findAll>;
18
18
  export declare function isUnsupportedTag(name: string): boolean;
19
19
  export declare function findAllUnsupported(root: ParentNode): Array<Element>;
20
+ export declare function isMarkerBoundaryElement(node: AnyNode): boolean;
20
21
  export declare function findAllComments(document: Document): Array<Comment>;
21
22
  export declare function getAttribute(node: AnyNode | null, name: string): string | null;
22
23
  export declare function setAttribute(node: AnyNode, name: string, value: string | null): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};