@ckeditor/ckeditor5-ai 41.3.0 → 41.4.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +1 -1
  2. package/build/ai.js +6 -6
  3. package/dist/index-content.css +4 -0
  4. package/dist/index-editor.css +267 -0
  5. package/dist/index.css +396 -0
  6. package/dist/index.js +23 -0
  7. package/dist/translations/af.d.ts +8 -0
  8. package/dist/translations/af.js +23 -0
  9. package/dist/translations/ar.d.ts +8 -0
  10. package/dist/translations/ar.js +23 -0
  11. package/dist/translations/bg.d.ts +8 -0
  12. package/dist/translations/bg.js +23 -0
  13. package/dist/translations/bn.d.ts +8 -0
  14. package/dist/translations/bn.js +23 -0
  15. package/dist/translations/bs.d.ts +8 -0
  16. package/dist/translations/bs.js +23 -0
  17. package/dist/translations/ca.d.ts +8 -0
  18. package/dist/translations/ca.js +23 -0
  19. package/dist/translations/cs.d.ts +8 -0
  20. package/dist/translations/cs.js +23 -0
  21. package/dist/translations/da.d.ts +8 -0
  22. package/dist/translations/da.js +23 -0
  23. package/dist/translations/de-ch.d.ts +8 -0
  24. package/dist/translations/de-ch.js +23 -0
  25. package/dist/translations/de.d.ts +8 -0
  26. package/dist/translations/de.js +23 -0
  27. package/dist/translations/el.d.ts +8 -0
  28. package/dist/translations/el.js +23 -0
  29. package/dist/translations/en-au.d.ts +8 -0
  30. package/dist/translations/en-au.js +23 -0
  31. package/dist/translations/en.d.ts +8 -0
  32. package/dist/translations/en.js +23 -0
  33. package/dist/translations/es-co.d.ts +8 -0
  34. package/dist/translations/es-co.js +23 -0
  35. package/dist/translations/es.d.ts +8 -0
  36. package/dist/translations/es.js +23 -0
  37. package/dist/translations/et.d.ts +8 -0
  38. package/dist/translations/et.js +23 -0
  39. package/dist/translations/fa.d.ts +8 -0
  40. package/dist/translations/fa.js +23 -0
  41. package/dist/translations/fi.d.ts +8 -0
  42. package/dist/translations/fi.js +23 -0
  43. package/dist/translations/fr.d.ts +8 -0
  44. package/dist/translations/fr.js +23 -0
  45. package/dist/translations/gl.d.ts +8 -0
  46. package/dist/translations/gl.js +23 -0
  47. package/dist/translations/he.d.ts +8 -0
  48. package/dist/translations/he.js +23 -0
  49. package/dist/translations/hi.d.ts +8 -0
  50. package/dist/translations/hi.js +23 -0
  51. package/dist/translations/hr.d.ts +8 -0
  52. package/dist/translations/hr.js +23 -0
  53. package/dist/translations/hu.d.ts +8 -0
  54. package/dist/translations/hu.js +23 -0
  55. package/dist/translations/id.d.ts +8 -0
  56. package/dist/translations/id.js +23 -0
  57. package/dist/translations/it.d.ts +8 -0
  58. package/dist/translations/it.js +23 -0
  59. package/dist/translations/ja.d.ts +8 -0
  60. package/dist/translations/ja.js +23 -0
  61. package/dist/translations/jv.d.ts +8 -0
  62. package/dist/translations/jv.js +23 -0
  63. package/dist/translations/ko.d.ts +8 -0
  64. package/dist/translations/ko.js +23 -0
  65. package/dist/translations/lt.d.ts +8 -0
  66. package/dist/translations/lt.js +23 -0
  67. package/dist/translations/lv.d.ts +8 -0
  68. package/dist/translations/lv.js +23 -0
  69. package/dist/translations/ms.d.ts +8 -0
  70. package/dist/translations/ms.js +23 -0
  71. package/dist/translations/nl.d.ts +8 -0
  72. package/dist/translations/nl.js +23 -0
  73. package/dist/translations/no.d.ts +8 -0
  74. package/dist/translations/no.js +23 -0
  75. package/dist/translations/pl.d.ts +8 -0
  76. package/dist/translations/pl.js +23 -0
  77. package/dist/translations/pt-br.d.ts +8 -0
  78. package/dist/translations/pt-br.js +23 -0
  79. package/dist/translations/pt.d.ts +8 -0
  80. package/dist/translations/pt.js +23 -0
  81. package/dist/translations/ro.d.ts +8 -0
  82. package/dist/translations/ro.js +23 -0
  83. package/dist/translations/ru.d.ts +8 -0
  84. package/dist/translations/ru.js +23 -0
  85. package/dist/translations/sk.d.ts +8 -0
  86. package/dist/translations/sk.js +23 -0
  87. package/dist/translations/sr-latn.d.ts +8 -0
  88. package/dist/translations/sr-latn.js +23 -0
  89. package/dist/translations/sr.d.ts +8 -0
  90. package/dist/translations/sr.js +23 -0
  91. package/dist/translations/sv.d.ts +8 -0
  92. package/dist/translations/sv.js +23 -0
  93. package/dist/translations/th.d.ts +8 -0
  94. package/dist/translations/th.js +23 -0
  95. package/dist/translations/tk.d.ts +8 -0
  96. package/dist/translations/tk.js +23 -0
  97. package/dist/translations/tr.d.ts +8 -0
  98. package/dist/translations/tr.js +23 -0
  99. package/dist/translations/ug.d.ts +8 -0
  100. package/dist/translations/ug.js +23 -0
  101. package/dist/translations/uk.d.ts +8 -0
  102. package/dist/translations/uk.js +23 -0
  103. package/dist/translations/ur.d.ts +8 -0
  104. package/dist/translations/ur.js +23 -0
  105. package/dist/translations/uz.d.ts +8 -0
  106. package/dist/translations/uz.js +23 -0
  107. package/dist/translations/vi.d.ts +8 -0
  108. package/dist/translations/vi.js +23 -0
  109. package/dist/translations/zh-cn.d.ts +8 -0
  110. package/dist/translations/zh-cn.js +23 -0
  111. package/dist/translations/zh.d.ts +8 -0
  112. package/dist/translations/zh.js +23 -0
  113. package/dist/types/adapters/aiadapter.d.ts +52 -0
  114. package/dist/types/adapters/aitextadapter.d.ts +150 -0
  115. package/dist/types/adapters/awstextadapter.d.ts +183 -0
  116. package/dist/types/adapters/openaitextadapter.d.ts +187 -0
  117. package/dist/types/aiassistant.d.ts +390 -0
  118. package/dist/types/aiassistantediting.d.ts +50 -0
  119. package/dist/types/aiassistantui.d.ts +57 -0
  120. package/dist/types/aiconfig.d.ts +73 -0
  121. package/dist/types/augmentation.d.ts +31 -0
  122. package/dist/types/index.d.ts +17 -0
  123. package/dist/types/ui/aiassistantcontroller.d.ts +113 -0
  124. package/dist/types/ui/dropdown/aicommandslistview.d.ts +37 -0
  125. package/dist/types/ui/dropdown/buttonlabelwithhighlightview.d.ts +33 -0
  126. package/dist/types/ui/dropdown/labelwithhighlightview.d.ts +29 -0
  127. package/dist/types/ui/form/aiformcontentarea.d.ts +52 -0
  128. package/dist/types/ui/form/aiformerrorview.d.ts +30 -0
  129. package/dist/types/ui/form/aiformpromptview.d.ts +50 -0
  130. package/dist/types/ui/form/aiformtoolbarview.d.ts +62 -0
  131. package/dist/types/ui/form/aiformview.d.ts +145 -0
  132. package/dist/types/ui/form/aihistorylistitemview.d.ts +22 -0
  133. package/dist/types/ui/form/aihistorylistview.d.ts +39 -0
  134. package/dist/types/ui/form/prompthistory.d.ts +24 -0
  135. package/dist/types/ui/showaiassistantcommand.d.ts +44 -0
  136. package/dist/types/utils/common-translations.d.ts +13 -0
  137. package/lang/contexts.json +4 -0
  138. package/package.json +5 -4
  139. package/src/adapters/aiadapter.js +1 -1
  140. package/src/adapters/aitextadapter.js +1 -1
  141. package/src/adapters/awstextadapter.js +1 -1
  142. package/src/adapters/openaitextadapter.js +1 -1
  143. package/src/aiassistant.js +1 -1
  144. package/src/aiassistantediting.js +1 -1
  145. package/src/aiassistantui.js +1 -1
  146. package/src/index.js +1 -1
  147. package/src/ui/aiassistantcontroller.js +1 -1
  148. package/src/ui/dropdown/aicommandslistview.js +1 -1
  149. package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
  150. package/src/ui/dropdown/labelwithhighlightview.js +1 -1
  151. package/src/ui/form/aiformcontentarea.js +1 -1
  152. package/src/ui/form/aiformerrorview.js +1 -1
  153. package/src/ui/form/aiformpromptview.js +1 -1
  154. package/src/ui/form/aiformtoolbarview.js +1 -1
  155. package/src/ui/form/aiformview.js +1 -1
  156. package/src/ui/form/aihistorylistitemview.js +1 -1
  157. package/src/ui/form/aihistorylistview.js +1 -1
  158. package/src/ui/form/prompthistory.js +1 -1
  159. package/src/ui/showaiassistantcommand.js +1 -1
  160. package/src/utils/common-translations.js +1 -1
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
@@ -0,0 +1,267 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ :root {
6
+ --ck-ai-form-submit-button-text-color: var(--ck-color-text);
7
+ --ck-ai-form-submit-button-border-color: transparent;
8
+ --ck-ai-form-submit-button-disabled-border-color: transparent;
9
+ --ck-ai-toolbar-button-hover-color: var(--ck-color-text);
10
+ --ck-color-ai-selection: hsla(201, 100%, 56%, 0.3);
11
+ --ck-ai-dropdown-view-width: 250px;
12
+ --ck-ai-dropdown-view-list-max-height: 250px;
13
+ --ck-ai-form-view-width: 600px;
14
+ --ck-ai-form-content-height: 175px;
15
+ --ck-ai-form-content-background: hsl(0, 0%, 98%);
16
+ --ck-ai-form-history-font-size: .9em;
17
+ --ck-ai-form-error-background: var(--ck-color-light-red);
18
+ }
19
+ .ck-ai-assistant-ui_theme {
20
+ --ck-color-button-default-hover-background: hsl(262.1,100%,96.3%);
21
+ --ck-color-button-default-active-background: hsl(262.1,100%,96.3%);
22
+ --ck-color-button-on-background: hsl(262.1,100%,96.3%);
23
+ --ck-color-button-on-hover-background: hsl(262.5,60%,92.2%);
24
+ --ck-color-button-on-active-background: hsl(262.1,100%,96.3%);
25
+ --ck-color-button-on-disabled-background: hsl(262.1,100%,96.3%);
26
+ --ck-color-button-on-color: hsl(263.2,59.2%,52%);
27
+ --ck-color-button-action-background: hsl(263.2,59.2%,52%);
28
+ --ck-color-button-action-hover-background: hsl(262.6,58.9%,49.6%);
29
+ --ck-color-button-action-active-background: hsl(262.6,58.9%,49.6%);
30
+ --ck-color-button-action-disabled-background: hsl(263.8,59.3%,75.9%);
31
+ --ck-color-list-button-hover-background: hsl(262.1,100%,96.3%);
32
+ --ck-ai-form-content-background: hsl(0,0%,97.6%);
33
+ --ck-ai-form-submit-button-text-color: var(--ck-color-button-on-color);
34
+ --ck-ai-form-submit-button-border-color: var(--ck-color-button-action-background);
35
+ --ck-ai-form-submit-button-disabled-border-color: var(--ck-color-button-action-disabled-background);
36
+ --ck-ai-toolbar-button-hover-color: var(--ck-color-button-on-color);
37
+ --ck-color-ai-selection: hsl(262.5,60%,90%);
38
+ }
39
+ .ck-ai-commands-dropdown > .ck-button:hover {
40
+ color: var(--ck-ai-toolbar-button-hover-color);
41
+ }
42
+ .ck span.ck-fake-ai-selection {
43
+ background: var(--ck-color-ai-selection);
44
+ }
45
+ .ck .ck-widget.ck-fake-ai-selection {
46
+ outline-color: var(--ck-color-ai-selection);
47
+ }
48
+ .ck span.ck-fake-ai-selection-candidate {
49
+ background: var(--ck-color-ai-selection);
50
+ }
51
+ .ck .ck-fake-ai-selection_collapsed {
52
+ height: 100%;
53
+ border-right: 1px solid var(--ck-color-base-text);
54
+ margin-right: -1px;
55
+ outline: solid 1px hsla(0, 0%, 100%, .5);
56
+ }
57
+ .ck.ck-content.ck-ai-form__content-field h2 {
58
+ font-size: 1.3em;
59
+ }
60
+ .ck.ck-content.ck-ai-form__content-field h3 {
61
+ font-size: 1.2em;
62
+ }
63
+ .ck.ck-content.ck-ai-form__content-field h4 {
64
+ font-size: 1.1em;
65
+ }
66
+ .ck.ck-content.ck-ai-form__content-field h2 {
67
+ margin-block-start: .5em;
68
+ margin-block-end: .5em;
69
+ line-height: 1.7em;
70
+ }
71
+ .ck.ck-content.ck-ai-form__content-field > :first-child {
72
+ margin-top: 0;
73
+ }
74
+ .ck.ck-content.ck-ai-form__content-field > :last-child {
75
+ margin-bottom: 0;
76
+ }
77
+ .ck.ck-ai-commands-search {
78
+ width: var(--ck-ai-dropdown-view-width);
79
+ }
80
+ .ck.ck-ai-commands-search > .ck-labeled-field-view {
81
+ padding: var(--ck-spacing-large);
82
+ }
83
+ .ck.ck-ai-commands-search > .ck-labeled-field-view .ck-input {
84
+ min-width: unset;
85
+ }
86
+ .ck.ck-ai-commands-search > .ck-search__results {
87
+ border-top: 1px solid var(--ck-color-base-border);
88
+ }
89
+ .ck.ck-ai-commands-search > .ck-search__results > .ck-list {
90
+ max-height: var(--ck-ai-dropdown-view-list-max-height);
91
+ overflow: auto;
92
+ }
93
+ .ck .ck-ai-form {
94
+ width: var(--ck-ai-form-view-width);
95
+ max-width: 100%;
96
+ }
97
+ .ck .ck-ai-form .ck-ai-form-content {
98
+ padding: var(--ck-spacing-large);
99
+ width: 100%;
100
+ }
101
+ .ck .ck-ai-form .ck-ai-form-content .ck-input {
102
+ width: 100%;
103
+ }
104
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area-wrapper {
105
+ width: 100%;
106
+ max-height: var(--ck-ai-form-content-height);
107
+ overflow-y: auto;
108
+ border: 1px solid var(--ck-color-base-border);
109
+ border-radius: 2px;
110
+ }
111
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area-wrapper:focus {
112
+ outline: none;
113
+ border: var(--ck-focus-ring);
114
+ box-shadow: var(--ck-focus-outer-shadow), 0 0;
115
+ }
116
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area {
117
+ display: flex;
118
+ background-color: var(--ck-ai-form-content-background);
119
+ }
120
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area.ck-ai-form__content-area--processing {
121
+ --ck-color-text: var(--ck-color-input-disabled-text);
122
+ background-color: var(--ck-color-input-disabled-background);
123
+ }
124
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field {
125
+ width: 100%;
126
+ white-space: normal;
127
+ padding: var(--ck-spacing-tiny) var(--ck-spacing-medium);
128
+ min-height: calc( var(--ck-line-height-base) * var(--ck-font-size-base) );
129
+ box-sizing: content-box;
130
+ }
131
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field {
132
+ padding-right: 0;
133
+ }
134
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field {
135
+ padding-left: 0;
136
+ }
137
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field > * {
138
+ white-space: normal;
139
+ color: inherit;
140
+ }
141
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-spinner-container {
142
+ margin-right: var(--ck-spacing-medium);
143
+ }
144
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-spinner-container {
145
+ margin-left: var(--ck-spacing-medium);
146
+ }
147
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button-wrapper {
148
+ display: flex;
149
+ flex-direction: column-reverse;
150
+ padding-left: 2px;
151
+ }
152
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button {
153
+ position: sticky;
154
+ right: 1px;
155
+ bottom: 1px;
156
+ padding: 4px;
157
+ min-height: unset;
158
+ min-width: unset;
159
+ }
160
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button svg {
161
+ --ck-icon-size: 16px;
162
+ }
163
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button.ck-ai-form__copy-button--copied {
164
+ color: inherit;
165
+ }
166
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__toolbar {
167
+ border: none;
168
+ padding: 0;
169
+ margin-top: var(--ck-spacing-medium);
170
+ margin-bottom: calc( 2 * var(--ck-spacing-medium) );
171
+ }
172
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__loader {
173
+ display: flex;
174
+ align-items: center;
175
+ }
176
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__loader .ck-spinner {
177
+ box-sizing: border-box;
178
+ }
179
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete {
180
+ display: flex;
181
+ justify-content: space-between;
182
+ }
183
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view {
184
+ flex-grow: 1;
185
+ }
186
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck.ck-ai-form__submit {
187
+ margin-left: var(--ck-spacing-medium);
188
+ }
189
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck.ck-ai-form__submit {
190
+ margin-right: var(--ck-spacing-medium);
191
+ }
192
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck.ck-ai-form__submit {
193
+ border-color: var(--ck-ai-form-submit-button-border-color);
194
+ color: var(--ck-ai-form-submit-button-text-color);
195
+ }
196
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck.ck-ai-form__submit.ck-disabled {
197
+ border-color: var(--ck-ai-form-submit-button-disabled-border-color);
198
+ }
199
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view .ck-ai-form__toggle-history {
200
+ position: absolute;
201
+ font-size: var(--ck-font-size-tiny);
202
+ }
203
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view .ck-ai-form__toggle-history {
204
+ right: var(--ck-spacing-medium);
205
+ }
206
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view .ck-ai-form__toggle-history {
207
+ left: var(--ck-spacing-medium);
208
+ }
209
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view .ck-ai-form__toggle-history {
210
+ bottom: var(--ck-spacing-small);
211
+ top: var(--ck-spacing-small);
212
+ padding: 4px;
213
+ min-height: unset;
214
+ min-width: unset;
215
+ }
216
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea {
217
+ padding-right: 30px;
218
+ }
219
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea {
220
+ padding-left: 30px;
221
+ }
222
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group {
223
+ display: grid;
224
+ grid-template-columns: auto 1fr;
225
+ grid-template-rows: auto;
226
+ grid-column-gap: 0px;
227
+ grid-row-gap: 0px;
228
+ }
229
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > span {
230
+ grid-area: 1 / 1 / 2 / 2;
231
+ }
232
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-button {
233
+ padding: 0;
234
+ min-height: auto;
235
+ grid-area: 1 / 2 / 2 / 3;
236
+ font-size: var(--ck-ai-form-history-font-size);
237
+ justify-self: start;
238
+ background: none;
239
+ margin: var(--ck-spacing-medium) 0 0;
240
+ }
241
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-button .ck-button__label {
242
+ line-height: inherit;
243
+ }
244
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-button .ck-button__label:hover {
245
+ text-decoration: underline;
246
+ }
247
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-list {
248
+ grid-area: 2 / 1 / 3 / 3;
249
+ }
250
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-list .ck-list__item .ck-button .ck-button__label {
251
+ white-space: nowrap;
252
+ overflow: hidden;
253
+ max-width: 100%;
254
+ text-overflow: ellipsis;
255
+ font-size: var(--ck-ai-form-history-font-size);
256
+ line-height: var(--ck-line-height-base);
257
+ }
258
+ .ck .ck-ai-form .ck-ai-form__error {
259
+ display: flex;
260
+ justify-content: center;
261
+ align-items: center;
262
+ padding: var(--ck-spacing-medium);
263
+ background-color: var(--ck-ai-form-error-background);
264
+ color: var(--ck-color-base-text);
265
+ border-radius: 2px;
266
+ margin-bottom: var(--ck-spacing-medium);
267
+ }
package/dist/index.css ADDED
@@ -0,0 +1,396 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /*
6
+ * What you're currently looking at is the source code of a legally protected, proprietary software.
7
+ * CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
8
+ * all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
9
+ *
10
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
11
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
12
+ */
13
+
14
+ /*
15
+ * These definitions bring violet accents (tint) across the AI UI.
16
+ */
17
+ :root {
18
+ --ck-ai-form-submit-button-text-color: var(--ck-color-text);
19
+ --ck-ai-form-submit-button-border-color: transparent;
20
+ --ck-ai-form-submit-button-disabled-border-color: transparent;
21
+ --ck-ai-toolbar-button-hover-color: var(--ck-color-text);
22
+ --ck-color-ai-selection: hsla(201, 100%, 56%, 0.3);
23
+ }
24
+
25
+ /* Note: This class name is mentioned in the guide and acts like a public API. */
26
+ .ck-ai-assistant-ui_theme {
27
+ --ck-color-button-default-hover-background: hsl(262.1,100%,96.3%);
28
+ --ck-color-button-default-active-background: hsl(262.1,100%,96.3%);
29
+
30
+ --ck-color-button-on-background: hsl(262.1,100%,96.3%);
31
+ --ck-color-button-on-hover-background: hsl(262.5,60%,92.2%);
32
+ --ck-color-button-on-active-background: hsl(262.1,100%,96.3%);
33
+ --ck-color-button-on-disabled-background: hsl(262.1,100%,96.3%);
34
+ --ck-color-button-on-color: hsl(263.2,59.2%,52%);
35
+
36
+ --ck-color-button-action-background: hsl(263.2,59.2%,52%);
37
+ --ck-color-button-action-hover-background: hsl(262.6,58.9%,49.6%);
38
+ --ck-color-button-action-active-background: hsl(262.6,58.9%,49.6%);
39
+ --ck-color-button-action-disabled-background: hsl(263.8,59.3%,75.9%);
40
+
41
+ --ck-color-list-button-hover-background: hsl(262.1,100%,96.3%);
42
+
43
+ --ck-ai-form-content-background: hsl(0,0%,97.6%);
44
+ --ck-ai-form-submit-button-text-color: var(--ck-color-button-on-color);
45
+ --ck-ai-form-submit-button-border-color: var(--ck-color-button-action-background);
46
+ --ck-ai-form-submit-button-disabled-border-color: var(--ck-color-button-action-disabled-background);
47
+ --ck-ai-toolbar-button-hover-color: var(--ck-color-button-on-color);
48
+
49
+ --ck-color-ai-selection: hsl(262.5,60%,90%);
50
+ }
51
+
52
+ /*
53
+ * Apply the theme colors for specific elements.
54
+ */
55
+ .ck-ai-commands-dropdown > .ck-button:hover,
56
+ .ck-ai-assistant-button:hover {
57
+ color: var(--ck-ai-toolbar-button-hover-color);
58
+ }
59
+
60
+ /*
61
+ * Classes used by the "fake visual selection" displayed in the content
62
+ * when the AI dialog is open.
63
+ *
64
+ * Narrow down to <span> to prevent changing background for widgets and nested editables.
65
+ */
66
+ .ck span.ck-fake-ai-selection {
67
+ background: var(--ck-color-ai-selection);
68
+ }
69
+
70
+ .ck .ck-widget.ck-fake-ai-selection {
71
+ outline-color: var(--ck-color-ai-selection);
72
+ }
73
+
74
+ /*
75
+ * Classes used by the "fake visual candidate selection" displayed in the content when an input
76
+ * in the AI dropdown has focus (the browser does not render the native selection in this state).
77
+ *
78
+ * Narrow down to <span> to prevent changing background for widgets and nested editables.
79
+ */
80
+ .ck span.ck-fake-ai-selection-candidate {
81
+ background: var(--ck-color-ai-selection);
82
+ }
83
+
84
+ /* A collapsed fake visual selection. */
85
+ .ck .ck-fake-ai-selection_collapsed {
86
+ height: 100%;
87
+ border-right: 1px solid var(--ck-color-base-text);
88
+ margin-right: -1px;
89
+ outline: solid 1px hsla(0, 0%, 100%, .5);
90
+ }
91
+
92
+ /*
93
+ * Styles of the AI response field. The margins, font sizes and line-heights have been reduced
94
+ * to save space.
95
+ *
96
+ * Note: This class name is mentioned in the guide and acts like a public API.
97
+ */
98
+ .ck.ck-content.ck-ai-form__content-field h2 {
99
+ font-size: 1.3em;
100
+ }
101
+ .ck.ck-content.ck-ai-form__content-field h3 {
102
+ font-size: 1.2em;
103
+ }
104
+ .ck.ck-content.ck-ai-form__content-field h4, .ck.ck-content.ck-ai-form__content-field h5, .ck.ck-content.ck-ai-form__content-field h6 {
105
+ font-size: 1.1em;
106
+ }
107
+ .ck.ck-content.ck-ai-form__content-field h2, .ck.ck-content.ck-ai-form__content-field h3, .ck.ck-content.ck-ai-form__content-field h4, .ck.ck-content.ck-ai-form__content-field h5, .ck.ck-content.ck-ai-form__content-field h6, .ck.ck-content.ck-ai-form__content-field p, .ck.ck-content.ck-ai-form__content-field ul, .ck.ck-content.ck-ai-form__content-field ol {
108
+ margin-block-start: .5em;
109
+ margin-block-end: .5em;
110
+ line-height: 1.7em;
111
+ }
112
+ .ck.ck-content.ck-ai-form__content-field > :first-child {
113
+ margin-top: 0;
114
+ }
115
+ .ck.ck-content.ck-ai-form__content-field > :last-child {
116
+ margin-bottom: 0;
117
+ }
118
+
119
+ /*
120
+ * What you're currently looking at is the source code of a legally protected, proprietary software.
121
+ * CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
122
+ * all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
123
+ *
124
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
125
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
126
+ */
127
+
128
+ /*
129
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
130
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
131
+ */
132
+ /*
133
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
134
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
135
+ */
136
+
137
+ :root {
138
+ --ck-ai-dropdown-view-width: 250px;
139
+ --ck-ai-dropdown-view-list-max-height: 250px;
140
+ }
141
+
142
+ .ck.ck-ai-commands-search {
143
+ width: var(--ck-ai-dropdown-view-width);
144
+ }
145
+
146
+ .ck.ck-ai-commands-search > .ck-labeled-field-view {
147
+ padding: var(--ck-spacing-large);
148
+ }
149
+
150
+ .ck.ck-ai-commands-search > .ck-labeled-field-view .ck-input {
151
+ min-width: unset;
152
+ }
153
+
154
+ .ck.ck-ai-commands-search > .ck-search__results {
155
+ border-top: 1px solid var(--ck-color-base-border);
156
+ }
157
+
158
+ .ck.ck-ai-commands-search > .ck-search__results > .ck-list {
159
+ max-height: var(--ck-ai-dropdown-view-list-max-height);
160
+ overflow: auto;
161
+ }
162
+
163
+ /*
164
+ * What you're currently looking at is the source code of a legally protected, proprietary software.
165
+ * CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
166
+ * all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
167
+ *
168
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
169
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
170
+ */
171
+
172
+ /*
173
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
174
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
175
+ */
176
+ /*
177
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
178
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
179
+ */
180
+
181
+ :root {
182
+ --ck-ai-form-view-width: 600px;
183
+ --ck-ai-form-content-height: 175px;
184
+ --ck-ai-form-content-background: hsl(0, 0%, 98%);
185
+ --ck-ai-form-history-font-size: .9em;
186
+
187
+ --ck-ai-form-error-background: var(--ck-color-light-red);
188
+ }
189
+
190
+ /* Note: This class name is mentioned in the guide and acts like a public API. */
191
+ .ck .ck-ai-form {
192
+ width: var(--ck-ai-form-view-width);
193
+
194
+ /* Don't overflow the parent dialog container */
195
+ max-width: 100%;
196
+ }
197
+ @media screen and (max-width: 600px) {
198
+ .ck .ck-ai-form {
199
+ /* Allow the for the layout to be fluid in narrow viewports to avoid breaking it due to limited
200
+ * horizontal space (https://github.com/cksource/ckeditor5-commercial/issues/5913). */
201
+ --ck-ai-form-view-width: 100vw;
202
+ }
203
+ }
204
+ .ck .ck-ai-form .ck-ai-form-content {
205
+ padding: var(--ck-spacing-large);
206
+ width: 100%;
207
+ }
208
+ .ck .ck-ai-form .ck-ai-form-content .ck-input {
209
+ width: 100%;
210
+ }
211
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area-wrapper {
212
+ width: 100%;
213
+ max-height: var(--ck-ai-form-content-height);
214
+ overflow-y: auto;
215
+ border: 1px solid var(--ck-color-base-border);
216
+ border-radius: 2px;
217
+ }
218
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area-wrapper:focus {
219
+ outline: none;
220
+ border: var(--ck-focus-ring);
221
+ box-shadow: var(--ck-focus-outer-shadow), 0 0;
222
+ }
223
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area {
224
+ display: flex;
225
+ background-color: var(--ck-ai-form-content-background);
226
+ }
227
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area.ck-ai-form__content-area--processing {
228
+ --ck-color-text: var(--ck-color-input-disabled-text);
229
+ background-color: var(--ck-color-input-disabled-background);
230
+ }
231
+ /* Note: This class name is mentioned in the guide and acts like a public API */
232
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field {
233
+ width: 100%;
234
+ white-space: normal;
235
+ padding: var(--ck-spacing-tiny) var(--ck-spacing-medium);
236
+ min-height: calc( var(--ck-line-height-base) * var(--ck-font-size-base) );
237
+ box-sizing: content-box;
238
+ }
239
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field {
240
+ padding-right: 0;
241
+ }
242
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field {
243
+ padding-left: 0;
244
+ }
245
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__content-field > * {
246
+ white-space: normal;
247
+ color: inherit;
248
+ }
249
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-spinner-container {
250
+ margin-right: var(--ck-spacing-medium);
251
+
252
+ }
253
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-spinner-container {
254
+ margin-left: var(--ck-spacing-medium);
255
+
256
+ }
257
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button-wrapper {
258
+ display: flex;
259
+ flex-direction: column-reverse;
260
+ padding-left: 2px;
261
+ }
262
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button {
263
+ position: sticky;
264
+ right: 1px;
265
+ bottom: 1px;
266
+ padding: 4px;
267
+ min-height: unset;
268
+ min-width: unset;
269
+ }
270
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button svg {
271
+ --ck-icon-size: 16px;
272
+ }
273
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__content-area .ck-ai-form__copy-button.ck-ai-form__copy-button--copied {
274
+ color: inherit;
275
+ }
276
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__toolbar {
277
+ border: none;
278
+ padding: 0;
279
+ margin-top: var(--ck-spacing-medium);
280
+ margin-bottom: calc( 2 * var(--ck-spacing-medium) );
281
+ }
282
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__loader {
283
+ display: flex;
284
+ align-items: center;
285
+ }
286
+ .ck .ck-ai-form .ck-ai-form-content .ck-ai-form__loader .ck-spinner {
287
+ box-sizing: border-box;
288
+ }
289
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete {
290
+ display: flex;
291
+ justify-content: space-between;
292
+ }
293
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view {
294
+ flex-grow: 1;
295
+ }
296
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck.ck-ai-form__submit {
297
+ margin-left: var(--ck-spacing-medium);
298
+ }
299
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck.ck-ai-form__submit {
300
+ margin-right: var(--ck-spacing-medium);
301
+ }
302
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck.ck-ai-form__submit {
303
+
304
+ border-color: var(--ck-ai-form-submit-button-border-color);
305
+ color: var(--ck-ai-form-submit-button-text-color);
306
+ }
307
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck.ck-ai-form__submit.ck-disabled {
308
+ border-color: var(--ck-ai-form-submit-button-disabled-border-color);
309
+ }
310
+ /* Toggle history button */
311
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view .ck-ai-form__toggle-history {
312
+ position: absolute;
313
+ font-size: var(--ck-font-size-tiny);
314
+ }
315
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view .ck-ai-form__toggle-history {
316
+ right: var(--ck-spacing-medium);
317
+ }
318
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view .ck-ai-form__toggle-history {
319
+ left: var(--ck-spacing-medium);
320
+ }
321
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete > .ck-labeled-field-view .ck-ai-form__toggle-history {
322
+
323
+ bottom: var(--ck-spacing-small);
324
+ top: var(--ck-spacing-small);
325
+ padding: 4px;
326
+ min-height: unset;
327
+ min-width: unset;
328
+ }
329
+ /* Give the toggle history button some space */
330
+ [dir="ltr"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea {
331
+ padding-right: 30px;
332
+ }
333
+ [dir="rtl"] .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea {
334
+ padding-left: 30px;
335
+ }
336
+ /* Squash the textarea horizontally if necessary on narrow layouts
337
+ * to avoid breaking the layout even at the cost of the placeholder
338
+ * being cut off (https://github.com/cksource/ckeditor5-commercial/issues/5913). */
339
+ @media screen and (max-width: 600px) {
340
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea {
341
+ --ck-input-width: auto;
342
+ }
343
+ }
344
+ /* Prompt history group */
345
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group {
346
+ display: grid;
347
+ grid-template-columns: auto 1fr;
348
+ grid-template-rows: auto;
349
+ grid-column-gap: 0px;
350
+ grid-row-gap: 0px;
351
+
352
+ /* History group label */
353
+ }
354
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > span {
355
+ grid-area: 1 / 1 / 2 / 2;
356
+ }
357
+ /* Clear button in the history */
358
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-button {
359
+ padding: 0;
360
+ min-height: auto;
361
+ grid-area: 1 / 2 / 2 / 3;
362
+ font-size: var(--ck-ai-form-history-font-size);
363
+ justify-self: start;
364
+ background: none;
365
+ margin: var(--ck-spacing-medium) 0 0;
366
+ }
367
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-button .ck-button__label {
368
+ line-height: inherit;
369
+ }
370
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-button .ck-button__label:hover {
371
+ text-decoration: underline;
372
+ }
373
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-list {
374
+ grid-area: 2 / 1 / 3 / 3;
375
+
376
+ /* Prompts can be very long. We need to display them whole. */
377
+ }
378
+ .ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-search__results .ck-list .ck-list__group > .ck-list .ck-list__item .ck-button .ck-button__label {
379
+ white-space: nowrap;
380
+ overflow: hidden;
381
+ max-width: 100%;
382
+ text-overflow: ellipsis;
383
+ font-size: var(--ck-ai-form-history-font-size);
384
+ line-height: var(--ck-line-height-base);
385
+ }
386
+ .ck .ck-ai-form .ck-ai-form__error {
387
+ display: flex;
388
+ justify-content: center;
389
+ align-items: center;
390
+ padding: var(--ck-spacing-medium);
391
+ background-color: var(--ck-ai-form-error-background);
392
+ color: var(--ck-color-base-text);
393
+ border-radius: 2px;
394
+ margin-bottom: var(--ck-spacing-medium);
395
+ }
396
+