@ui5/webcomponents-ai 0.0.0-8ae0ba6fc → 0.0.0-95afb1087

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 (216) hide show
  1. package/.ui5-cem-aliases.json +4 -0
  2. package/CHANGELOG.md +438 -0
  3. package/LICENSE.txt +201 -0
  4. package/README.md +10 -8
  5. package/dist/.tsbuildinfo +1 -1
  6. package/dist/Assets-fetch.d.ts +3 -0
  7. package/dist/Assets-fetch.js +6 -0
  8. package/dist/Assets-fetch.js.map +1 -0
  9. package/dist/Assets-node.d.ts +14 -0
  10. package/dist/Assets-node.js +17 -0
  11. package/dist/Assets-node.js.map +1 -0
  12. package/dist/Button.d.ts +37 -0
  13. package/dist/Button.js +56 -2
  14. package/dist/Button.js.map +1 -1
  15. package/dist/ButtonTemplate.js +1 -1
  16. package/dist/ButtonTemplate.js.map +1 -1
  17. package/dist/Input.d.ts +143 -0
  18. package/dist/Input.js +288 -0
  19. package/dist/Input.js.map +1 -0
  20. package/dist/InputTemplate.d.ts +10 -0
  21. package/dist/InputTemplate.js +28 -0
  22. package/dist/InputTemplate.js.map +1 -0
  23. package/dist/TextArea.d.ts +118 -0
  24. package/dist/TextArea.js +230 -0
  25. package/dist/TextArea.js.map +1 -0
  26. package/dist/TextAreaTemplate.d.ts +2 -0
  27. package/dist/TextAreaTemplate.js +13 -0
  28. package/dist/TextAreaTemplate.js.map +1 -0
  29. package/dist/ToolbarLabel.d.ts +39 -0
  30. package/dist/ToolbarLabel.js +67 -0
  31. package/dist/ToolbarLabel.js.map +1 -0
  32. package/dist/ToolbarLabelTemplate.d.ts +2 -0
  33. package/dist/ToolbarLabelTemplate.js +5 -0
  34. package/dist/ToolbarLabelTemplate.js.map +1 -0
  35. package/dist/Versioning.d.ts +95 -0
  36. package/dist/Versioning.js +187 -0
  37. package/dist/Versioning.js.map +1 -0
  38. package/dist/VersioningTemplate.d.ts +4 -0
  39. package/dist/VersioningTemplate.js +9 -0
  40. package/dist/VersioningTemplate.js.map +1 -0
  41. package/dist/WritingAssistant.d.ts +100 -0
  42. package/dist/WritingAssistant.js +197 -0
  43. package/dist/WritingAssistant.js.map +1 -0
  44. package/dist/WritingAssistantTemplate.d.ts +2 -0
  45. package/dist/WritingAssistantTemplate.js +12 -0
  46. package/dist/WritingAssistantTemplate.js.map +1 -0
  47. package/dist/bundle.esm.js +2 -0
  48. package/dist/bundle.esm.js.map +1 -1
  49. package/dist/css/themes/Button.css +1 -1
  50. package/dist/css/themes/Input.css +1 -0
  51. package/dist/css/themes/PromptInput.css +1 -1
  52. package/dist/css/themes/TextArea.css +1 -0
  53. package/dist/css/themes/Versioning.css +1 -0
  54. package/dist/css/themes/WritingAssistant.css +1 -0
  55. package/dist/custom-elements-internal.json +427 -0
  56. package/dist/custom-elements.json +368 -0
  57. package/dist/generated/assets/i18n/messagebundle_ar.json +1 -1
  58. package/dist/generated/assets/i18n/messagebundle_bg.json +1 -1
  59. package/dist/generated/assets/i18n/messagebundle_ca.json +1 -1
  60. package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -1
  61. package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
  62. package/dist/generated/assets/i18n/messagebundle_cy.json +1 -1
  63. package/dist/generated/assets/i18n/messagebundle_da.json +1 -1
  64. package/dist/generated/assets/i18n/messagebundle_de.json +1 -1
  65. package/dist/generated/assets/i18n/messagebundle_el.json +1 -1
  66. package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
  67. package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -1
  68. package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -1
  69. package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
  70. package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -1
  71. package/dist/generated/assets/i18n/messagebundle_es.json +1 -1
  72. package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -1
  73. package/dist/generated/assets/i18n/messagebundle_et.json +1 -1
  74. package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
  75. package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
  76. package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -1
  77. package/dist/generated/assets/i18n/messagebundle_hi.json +1 -1
  78. package/dist/generated/assets/i18n/messagebundle_hr.json +1 -1
  79. package/dist/generated/assets/i18n/messagebundle_hu.json +1 -1
  80. package/dist/generated/assets/i18n/messagebundle_id.json +1 -0
  81. package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
  82. package/dist/generated/assets/i18n/messagebundle_iw.json +1 -1
  83. package/dist/generated/assets/i18n/messagebundle_ja.json +1 -1
  84. package/dist/generated/assets/i18n/messagebundle_kk.json +1 -1
  85. package/dist/generated/assets/i18n/messagebundle_ko.json +1 -1
  86. package/dist/generated/assets/i18n/messagebundle_lt.json +1 -1
  87. package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
  88. package/dist/generated/assets/i18n/messagebundle_mk.json +1 -1
  89. package/dist/generated/assets/i18n/messagebundle_ms.json +1 -1
  90. package/dist/generated/assets/i18n/messagebundle_nl.json +1 -1
  91. package/dist/generated/assets/i18n/messagebundle_no.json +1 -1
  92. package/dist/generated/assets/i18n/messagebundle_pl.json +1 -1
  93. package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
  94. package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -1
  95. package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
  96. package/dist/generated/assets/i18n/messagebundle_ru.json +1 -1
  97. package/dist/generated/assets/i18n/messagebundle_sh.json +1 -1
  98. package/dist/generated/assets/i18n/messagebundle_sk.json +1 -1
  99. package/dist/generated/assets/i18n/messagebundle_sl.json +1 -1
  100. package/dist/generated/assets/i18n/messagebundle_sr.json +1 -1
  101. package/dist/generated/assets/i18n/messagebundle_sv.json +1 -1
  102. package/dist/generated/assets/i18n/messagebundle_th.json +1 -1
  103. package/dist/generated/assets/i18n/messagebundle_tr.json +1 -1
  104. package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
  105. package/dist/generated/assets/i18n/messagebundle_vi.json +1 -1
  106. package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -1
  107. package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -1
  108. package/dist/generated/i18n/i18n-defaults.d.ts +15 -1
  109. package/dist/generated/i18n/i18n-defaults.js +15 -1
  110. package/dist/generated/i18n/i18n-defaults.js.map +1 -1
  111. package/dist/generated/json-imports/Themes-fetch.js +1 -1
  112. package/dist/generated/json-imports/Themes-fetch.js.map +1 -1
  113. package/dist/generated/json-imports/Themes-node.d.ts +1 -0
  114. package/dist/generated/json-imports/Themes-node.js +21 -0
  115. package/dist/generated/json-imports/Themes-node.js.map +1 -0
  116. package/dist/generated/json-imports/Themes.js +1 -1
  117. package/dist/generated/json-imports/Themes.js.map +1 -1
  118. package/dist/generated/json-imports/i18n-fetch.js +3 -1
  119. package/dist/generated/json-imports/i18n-fetch.js.map +1 -1
  120. package/dist/generated/json-imports/i18n-node.d.ts +1 -0
  121. package/dist/generated/json-imports/i18n-node.js +120 -0
  122. package/dist/generated/json-imports/i18n-node.js.map +1 -0
  123. package/dist/generated/json-imports/i18n.js +3 -1
  124. package/dist/generated/json-imports/i18n.js.map +1 -1
  125. package/dist/generated/themes/Button.css.d.ts +1 -1
  126. package/dist/generated/themes/Button.css.js +3 -3
  127. package/dist/generated/themes/Button.css.js.map +1 -1
  128. package/dist/generated/themes/Input.css.d.ts +2 -0
  129. package/dist/generated/themes/Input.css.js +8 -0
  130. package/dist/generated/themes/Input.css.js.map +1 -0
  131. package/dist/generated/themes/PromptInput.css.d.ts +1 -1
  132. package/dist/generated/themes/PromptInput.css.js +3 -3
  133. package/dist/generated/themes/PromptInput.css.js.map +1 -1
  134. package/dist/generated/themes/TextArea.css.d.ts +2 -0
  135. package/dist/generated/themes/TextArea.css.js +8 -0
  136. package/dist/generated/themes/TextArea.css.js.map +1 -0
  137. package/dist/generated/themes/Versioning.css.d.ts +2 -0
  138. package/dist/generated/themes/Versioning.css.js +8 -0
  139. package/dist/generated/themes/Versioning.css.js.map +1 -0
  140. package/dist/generated/themes/WritingAssistant.css.d.ts +2 -0
  141. package/dist/generated/themes/WritingAssistant.css.js +8 -0
  142. package/dist/generated/themes/WritingAssistant.css.js.map +1 -0
  143. package/dist/vscode.html-custom-data.json +54 -0
  144. package/dist/web-types.json +174 -1
  145. package/package-scripts.cjs +3 -0
  146. package/package.json +22 -21
  147. package/src/ButtonTemplate.tsx +1 -0
  148. package/src/InputTemplate.tsx +197 -0
  149. package/src/TextArea.css +45 -0
  150. package/src/TextAreaTemplate.tsx +90 -0
  151. package/src/ToolbarLabelTemplate.tsx +9 -0
  152. package/src/VersioningTemplate.tsx +34 -0
  153. package/src/WritingAssistantTemplate.tsx +49 -0
  154. package/src/i18n/messagebundle.properties +43 -1
  155. package/src/i18n/messagebundle_ar.properties +20 -0
  156. package/src/i18n/messagebundle_bg.properties +20 -0
  157. package/src/i18n/messagebundle_ca.properties +20 -0
  158. package/src/i18n/messagebundle_cnr.properties +20 -0
  159. package/src/i18n/messagebundle_cs.properties +20 -0
  160. package/src/i18n/messagebundle_cy.properties +20 -0
  161. package/src/i18n/messagebundle_da.properties +20 -0
  162. package/src/i18n/messagebundle_de.properties +20 -0
  163. package/src/i18n/messagebundle_el.properties +20 -0
  164. package/src/i18n/messagebundle_en.properties +20 -0
  165. package/src/i18n/messagebundle_en_GB.properties +20 -0
  166. package/src/i18n/messagebundle_en_US_sappsd.properties +28 -0
  167. package/src/i18n/messagebundle_en_US_saprigi.properties +28 -0
  168. package/src/i18n/messagebundle_en_US_saptrc.properties +28 -0
  169. package/src/i18n/messagebundle_es.properties +20 -0
  170. package/src/i18n/messagebundle_es_MX.properties +21 -1
  171. package/src/i18n/messagebundle_et.properties +20 -0
  172. package/src/i18n/messagebundle_fi.properties +20 -0
  173. package/src/i18n/messagebundle_fr.properties +20 -0
  174. package/src/i18n/messagebundle_fr_CA.properties +20 -0
  175. package/src/i18n/messagebundle_hi.properties +20 -0
  176. package/src/i18n/messagebundle_hr.properties +22 -2
  177. package/src/i18n/messagebundle_hu.properties +20 -0
  178. package/src/i18n/messagebundle_id.properties +20 -0
  179. package/src/i18n/messagebundle_it.properties +20 -0
  180. package/src/i18n/messagebundle_iw.properties +20 -0
  181. package/src/i18n/messagebundle_ja.properties +20 -0
  182. package/src/i18n/messagebundle_kk.properties +20 -0
  183. package/src/i18n/messagebundle_ko.properties +20 -0
  184. package/src/i18n/messagebundle_lt.properties +20 -0
  185. package/src/i18n/messagebundle_lv.properties +20 -0
  186. package/src/i18n/messagebundle_mk.properties +20 -0
  187. package/src/i18n/messagebundle_ms.properties +20 -0
  188. package/src/i18n/messagebundle_nl.properties +20 -0
  189. package/src/i18n/messagebundle_no.properties +20 -0
  190. package/src/i18n/messagebundle_pl.properties +20 -0
  191. package/src/i18n/messagebundle_pt.properties +20 -0
  192. package/src/i18n/messagebundle_pt_PT.properties +20 -0
  193. package/src/i18n/messagebundle_ro.properties +20 -0
  194. package/src/i18n/messagebundle_ru.properties +20 -0
  195. package/src/i18n/messagebundle_sh.properties +20 -0
  196. package/src/i18n/messagebundle_sk.properties +20 -0
  197. package/src/i18n/messagebundle_sl.properties +20 -0
  198. package/src/i18n/messagebundle_sr.properties +20 -0
  199. package/src/i18n/messagebundle_sv.properties +20 -0
  200. package/src/i18n/messagebundle_th.properties +22 -2
  201. package/src/i18n/messagebundle_tr.properties +20 -0
  202. package/src/i18n/messagebundle_uk.properties +20 -0
  203. package/src/i18n/messagebundle_vi.properties +20 -0
  204. package/src/i18n/messagebundle_zh_CN.properties +20 -0
  205. package/src/i18n/messagebundle_zh_TW.properties +20 -0
  206. package/src/themes/Input.css +83 -0
  207. package/src/themes/PromptInput.css +5 -1
  208. package/src/themes/TextArea.css +45 -0
  209. package/src/themes/Versioning.css +20 -0
  210. package/src/themes/WritingAssistant.css +45 -0
  211. package/tsconfig.json +6 -0
  212. package/cypress/specs/Button.cy.tsx +0 -14
  213. package/cypress/support/commands.ts +0 -40
  214. package/cypress/support/component-index.html +0 -12
  215. package/cypress/support/component.ts +0 -36
  216. package/cypress/tsconfig.json +0 -43
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@ui5/webcomponents-ai",
4
- "version": "2.9.0-rc.1",
4
+ "version": "2.17.0-rc.3",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -33,6 +33,14 @@
33
33
  "name": "arrow-button-pressed",
34
34
  "description": "Defines the active state of the arrow button in split mode.\nSet to true when the button is in split mode and a menu with additional options\nis opened by the arrow button. Set back to false when the menu is closed.",
35
35
  "value": { "type": "boolean", "default": "false" }
36
+ },
37
+ {
38
+ "name": "accessibility-attributes",
39
+ "description": "Defines the additional accessibility attributes that will be applied to the component.\n\nThis property allows for fine-tuned control of ARIA attributes for screen reader support.\nIt accepts an object with the following optional fields:\n\n- **root**: Accessibility attributes that will be applied to the root element.\n - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **roleDescription**: Defines a human-readable description for the button's role.\n Accepts any string value.\n - **title**: Specifies a tooltip or description for screen readers.\n Accepts any string value.\n- **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or focus the button.\n\n- **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n Accepts boolean values: `true` or `false`.",
40
+ "value": {
41
+ "type": "AIButtonAccessibilityAttributes",
42
+ "default": "{}"
43
+ }
36
44
  }
37
45
  ],
38
46
  "slots": [
@@ -74,6 +82,11 @@
74
82
  "name": "arrow-button-pressed",
75
83
  "description": "Defines the active state of the arrow button in split mode.\nSet to true when the button is in split mode and a menu with additional options\nis opened by the arrow button. Set back to false when the menu is closed.",
76
84
  "value": { "type": "boolean" }
85
+ },
86
+ {
87
+ "name": "accessibility-attributes",
88
+ "description": "Defines the additional accessibility attributes that will be applied to the component.\n\nThis property allows for fine-tuned control of ARIA attributes for screen reader support.\nIt accepts an object with the following optional fields:\n\n- **root**: Accessibility attributes that will be applied to the root element.\n - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **roleDescription**: Defines a human-readable description for the button's role.\n Accepts any string value.\n - **title**: Specifies a tooltip or description for screen readers.\n Accepts any string value.\n- **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or focus the button.\n\n- **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n Accepts boolean values: `true` or `false`.",
89
+ "value": { "type": "AIButtonAccessibilityAttributes" }
77
90
  }
78
91
  ],
79
92
  "events": [
@@ -151,6 +164,89 @@
151
164
  "events": []
152
165
  }
153
166
  },
167
+ {
168
+ "name": "ui5-ai-input",
169
+ "description": "### Overview\n\nThe `ui5-ai-input` component extends the standard `ui5-input` with **AI Writing Assistant** capabilities.\n\n### Structure\n\nThe `ui5-ai-input` consists of the following main parts:\n\n- **Input Field** – Inherits all standard Input behaviors.\n- **AI Action Button** – Appears when focused or loading, providing access to AI-related actions or stopping generation.\n\nThe component automatically determines which elements to render based on its internal state:\n- The AI Button is only shown when there are available `actions`.\n- The version navigation appears only when `totalVersions > 1`.\n\n### Keyboard Support\n\n- **Shift + F4** — Opens the AI menu.\n- **Ctrl + Shift + Z / Y** — Navigates backward/forward between AI-generated versions.\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents-ai/dist/Input.js\";`\n---\n\n\n### **Events:**\n - **button-click** - Fired when the user selects the AI button.\n- **item-click** - Fired when an item from the AI actions menu is clicked.\n- **stop-generation** - Fired when the user selects the \"Stop\" button to stop ongoing AI text generation.\n- **version-change** - Fired when the user selects the version navigation buttons.\n\n### **Slots:**\n - **actions** - Defines the items of the menu for the component.",
170
+ "doc-url": "",
171
+ "attributes": [
172
+ {
173
+ "name": "current-version",
174
+ "description": "Indicates the index of the currently displayed version.",
175
+ "value": { "type": "number", "default": "0" }
176
+ },
177
+ {
178
+ "name": "total-versions",
179
+ "description": "Indicates the total number of result versions available.\n\nWhen not set or set to 0, the versioning will be hidden.",
180
+ "value": { "type": "number", "default": "0" }
181
+ },
182
+ {
183
+ "name": "loading",
184
+ "description": "Defines whether the AI Writing Assistant is currently loading.\n\nWhen `true`, indicates that an AI action is in progress.",
185
+ "value": { "type": "boolean", "default": "false" }
186
+ }
187
+ ],
188
+ "slots": [
189
+ {
190
+ "name": "actions",
191
+ "description": "Defines the items of the menu for the component."
192
+ }
193
+ ],
194
+ "events": [
195
+ {
196
+ "name": "button-click",
197
+ "description": "Fired when the user selects the AI button."
198
+ },
199
+ {
200
+ "name": "item-click",
201
+ "description": "Fired when an item from the AI actions menu is clicked."
202
+ },
203
+ {
204
+ "name": "stop-generation",
205
+ "description": "Fired when the user selects the \"Stop\" button to stop ongoing AI text generation."
206
+ },
207
+ {
208
+ "name": "version-change",
209
+ "description": "Fired when the user selects the version navigation buttons."
210
+ }
211
+ ],
212
+ "js": {
213
+ "properties": [
214
+ {
215
+ "name": "current-version",
216
+ "description": "Indicates the index of the currently displayed version.",
217
+ "value": { "type": "number" }
218
+ },
219
+ {
220
+ "name": "total-versions",
221
+ "description": "Indicates the total number of result versions available.\n\nWhen not set or set to 0, the versioning will be hidden.",
222
+ "value": { "type": "number" }
223
+ },
224
+ {
225
+ "name": "loading",
226
+ "description": "Defines whether the AI Writing Assistant is currently loading.\n\nWhen `true`, indicates that an AI action is in progress.",
227
+ "value": { "type": "boolean" }
228
+ }
229
+ ],
230
+ "events": [
231
+ {
232
+ "name": "button-click",
233
+ "description": "Fired when the user selects the AI button."
234
+ },
235
+ {
236
+ "name": "item-click",
237
+ "description": "Fired when an item from the AI actions menu is clicked."
238
+ },
239
+ {
240
+ "name": "stop-generation",
241
+ "description": "Fired when the user selects the \"Stop\" button to stop ongoing AI text generation."
242
+ },
243
+ {
244
+ "name": "version-change",
245
+ "description": "Fired when the user selects the version navigation buttons."
246
+ }
247
+ ]
248
+ }
249
+ },
154
250
  {
155
251
  "name": "ui5-ai-prompt-input",
156
252
  "description": "### Overview\n\nThe `ui5-ai-prompt-input` component allows the user to write custom instructions in natural language, so that AI is guided to generate content tailored to user needs.\n\n**Note:** The web component is in an experimental state\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents-ai/dist/PromptInput.js\"`\n---\n\n\n### **Events:**\n - **submit** - Fired when the input operation has finished by pressing Enter\nor AI button is clicked.\n- **input** - Fired when the value of the component changes at each keystroke,\nand when a suggestion item has been selected.\n- **change** - Fired when the input operation has finished by pressing Enter\nor on focusout.\n\n### **Slots:**\n - **default** - Defines the suggestion items.\n\n**Note:** The suggestions would be displayed only if the `showSuggestions`\nproperty is set to `true`.\n\n**Note:** The `<ui5-suggestion-item>`, `<ui5-suggestion-item-group>` and `ui5-suggestion-item-custom` are recommended to be used as suggestion items.\n- **valueStateMessage** - Defines the value state message that will be displayed as pop up under the component.\nThe value state message slot should contain only one root element.\n\n**Note:** If not specified, a default text (in the respective language) will be displayed.\n\n**Note:** The `valueStateMessage` would be displayed,\nwhen the component is in `Information`, `Critical` or `Negative` value state.",
@@ -304,6 +400,83 @@
304
400
  }
305
401
  ]
306
402
  }
403
+ },
404
+ {
405
+ "name": "ui5-ai-textarea",
406
+ "description": "### Overview\n\nThe `ui5-ai-textarea` component extends the standard TextArea with Writing Assistant capabilities.\nIt provides AI-powered text generation, editing suggestions, and version management functionality.\n\n### Structure\nThe `ui5-ai-textarea` consists of the following elements:\n- TextArea: The main text input area with all standard textarea functionality\n- WritingAssistant: Dedicated toolbar containing:\n - Versioning: A component with left/right navigation buttons and a label for browsing AI-generated versions\n - AI Button: Opens a menu that can be extended with custom AI generation options through slotting\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents-ai/dist/TextArea.js\";`\n---\n\n\n### **Events:**\n - **version-change** - Fired when the user clicks on version navigation buttons.\n- **stop-generation** - Fired when the user requests to stop AI text generation.\n\n### **Slots:**\n - **menu** - Defines a slot for `ui5-menu` integration. This slot allows you to pass a `ui5-menu` instance that will be associated with the assistant.",
407
+ "doc-url": "",
408
+ "attributes": [
409
+ {
410
+ "name": "loading",
411
+ "description": "Defines whether the `ui5-ai-textarea` is currently in a loading(processing) state.",
412
+ "value": { "type": "boolean", "default": "false" }
413
+ },
414
+ {
415
+ "name": "prompt-description",
416
+ "description": "Defines the prompt description of the current action.",
417
+ "value": { "type": "string", "default": "\"\"" }
418
+ },
419
+ {
420
+ "name": "current-version",
421
+ "description": "Indicates the index of the currently displayed version.",
422
+ "value": { "type": "number", "default": "0" }
423
+ },
424
+ {
425
+ "name": "total-versions",
426
+ "description": "Indicates the total number of result versions available.\n\nNotes:\nVersioning is hidden if the value is `0`",
427
+ "value": { "type": "number", "default": "0" }
428
+ }
429
+ ],
430
+ "slots": [
431
+ {
432
+ "name": "menu",
433
+ "description": "Defines a slot for `ui5-menu` integration. This slot allows you to pass a `ui5-menu` instance that will be associated with the assistant."
434
+ }
435
+ ],
436
+ "events": [
437
+ {
438
+ "name": "version-change",
439
+ "description": "Fired when the user clicks on version navigation buttons."
440
+ },
441
+ {
442
+ "name": "stop-generation",
443
+ "description": "Fired when the user requests to stop AI text generation."
444
+ }
445
+ ],
446
+ "js": {
447
+ "properties": [
448
+ {
449
+ "name": "loading",
450
+ "description": "Defines whether the `ui5-ai-textarea` is currently in a loading(processing) state.",
451
+ "value": { "type": "boolean" }
452
+ },
453
+ {
454
+ "name": "prompt-description",
455
+ "description": "Defines the prompt description of the current action.",
456
+ "value": { "type": "string" }
457
+ },
458
+ {
459
+ "name": "current-version",
460
+ "description": "Indicates the index of the currently displayed version.",
461
+ "value": { "type": "number" }
462
+ },
463
+ {
464
+ "name": "total-versions",
465
+ "description": "Indicates the total number of result versions available.\n\nNotes:\nVersioning is hidden if the value is `0`",
466
+ "value": { "type": "number" }
467
+ }
468
+ ],
469
+ "events": [
470
+ {
471
+ "name": "version-change",
472
+ "description": "Fired when the user clicks on version navigation buttons."
473
+ },
474
+ {
475
+ "name": "stop-generation",
476
+ "description": "Fired when the user requests to stop AI text generation."
477
+ }
478
+ ]
479
+ }
307
480
  }
308
481
  ]
309
482
  },
@@ -6,6 +6,9 @@ const options = {
6
6
  aiPackage: true,
7
7
  noWatchTS: true,
8
8
  dev: true,
9
+ internal: {
10
+ cypress_code_coverage: false,
11
+ },
9
12
  };
10
13
 
11
14
  const scripts = getScripts(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-ai",
3
- "version": "0.0.0-8ae0ba6fc",
3
+ "version": "0.0.0-95afb1087",
4
4
  "description": "UI5 Web Components: webcomponents.ai",
5
5
  "ui5": {
6
6
  "webComponentsPackage": true
@@ -8,8 +8,7 @@
8
8
  "type": "module",
9
9
  "author": "SAP SE (https://www.sap.com)",
10
10
  "license": "Apache-2.0",
11
- "private": false,
12
- "customElements": "./dist/custom-elements.json",
11
+ "customElements": "dist/custom-elements.json",
13
12
  "keywords": [
14
13
  "openui5",
15
14
  "sapui5",
@@ -18,23 +17,22 @@
18
17
  "scripts": {
19
18
  "clean": "wc-dev clean",
20
19
  "lint": "wc-dev lint",
21
- "lint:scope": "nps scope.lint",
20
+ "lint:scope": "wc-dev scope.lint",
22
21
  "start": "wc-dev start",
23
22
  "build": "wc-dev build",
24
23
  "watch": "wc-dev watch",
25
- "generate": "nps generate",
26
- "generateAPI": "nps generateAPI",
27
- "bundle": "nps build.bundle",
28
- "test": "nps test-cy-ci",
29
- "test:cypress": "nps test-cy-ci",
24
+ "generate": "wc-dev generate",
25
+ "generateAPI": "wc-dev generateAPI",
26
+ "bundle": "wc-dev build.bundle",
27
+ "test": "yarn test:cypress",
28
+ "test:cypress": "wc-dev test-cy-ci",
30
29
  "test:cypress:single": "npx cypress run --component --browser chrome --spec",
31
- "test:cypress:open": "nps test-cy-open",
30
+ "test:cypress:open": "wc-dev test-cy-open",
32
31
  "test:ssr": "node -e \"import('./test/ssr/component-imports.js')\"",
33
32
  "create-ui5-element": "wc-create-ui5-element",
34
33
  "prepublishOnly": "tsc -b"
35
34
  },
36
35
  "exports": {
37
- "./.port": "./.port",
38
36
  "./src/*": "./src/*",
39
37
  "./dist/*": "./dist/*",
40
38
  "./package.json": "./package.json",
@@ -44,18 +42,21 @@
44
42
  },
45
43
  "repository": {
46
44
  "type": "git",
47
- "url": "https://github.com/SAP/ui5-webcomponents.git",
45
+ "url": "https://github.com/UI5/webcomponents.git",
48
46
  "directory": "packages/ai"
49
47
  },
50
48
  "dependencies": {
51
- "@ui5/webcomponents": "0.0.0-8ae0ba6fc",
52
- "@ui5/webcomponents-base": "0.0.0-8ae0ba6fc",
53
- "@ui5/webcomponents-icons": "0.0.0-8ae0ba6fc",
54
- "@ui5/webcomponents-theming": "0.0.0-8ae0ba6fc"
49
+ "@ui5/webcomponents": "0.0.0-95afb1087",
50
+ "@ui5/webcomponents-base": "0.0.0-95afb1087",
51
+ "@ui5/webcomponents-icons": "0.0.0-95afb1087",
52
+ "@ui5/webcomponents-theming": "0.0.0-95afb1087"
55
53
  },
56
54
  "devDependencies": {
57
- "@ui5/cypress-internal": "0.0.0",
58
- "@ui5/webcomponents-tools": "0.0.0-8ae0ba6fc",
59
- "chromedriver": "^133.0.0"
60
- }
61
- }
55
+ "@custom-elements-manifest/analyzer": "^0.10.10",
56
+ "@ui5/cypress-internal": "0.1.0",
57
+ "@ui5/webcomponents-tools": "0.0.0-95afb1087",
58
+ "cypress": "^15.3.0",
59
+ "vite": "5.4.21"
60
+ },
61
+ "gitHead": "1b7f451f1e43ae13626dfc69b3c2bfa8b0d32219"
62
+ }
@@ -12,6 +12,7 @@ export default function ButtonTemplate(this: Button) {
12
12
  _hideArrowButton={this._hideArrowButton}
13
13
  onClick={this._onClick}
14
14
  onArrowClick={this._onArrowClick}
15
+ accessibilityAttributes={this._computedAccessibilityAttributes}
15
16
  >
16
17
  {this._hasText && (
17
18
  <div class="ui5-ai-button-text">{this._stateText}</div>
@@ -0,0 +1,197 @@
1
+ import type Input from "./Input.js";
2
+ import Icon from "@ui5/webcomponents/dist/Icon.js";
3
+ import BusyIndicator from "@ui5/webcomponents/dist/BusyIndicator.js";
4
+ import MenuItem from "@ui5/webcomponents/dist/MenuItem.js";
5
+ import MenuSeparator from "@ui5/webcomponents/dist/MenuSeparator.js";
6
+ import Button from "@ui5/webcomponents/dist/Button.js";
7
+ import Menu from "@ui5/webcomponents/dist/Menu.js";
8
+ import "@ui5/webcomponents-icons/dist/navigation-left-arrow.js";
9
+ import "@ui5/webcomponents-icons/dist/navigation-right-arrow.js";
10
+ import type { JsxTemplateResult } from "@ui5/webcomponents-base";
11
+
12
+ type TemplateHook = () => JsxTemplateResult;
13
+
14
+ export default function InputTemplate(this: Input, hooks?: { preContent: TemplateHook, postContent: TemplateHook }) {
15
+ const preContent = hooks?.preContent || defaultPreContent;
16
+ const postContent = hooks?.postContent || defaultPostContent;
17
+ return (
18
+ <>
19
+ <div
20
+ class={`ui5-ai-input-root ui5-input-focusable-element ${this.loading && "ui5-ai-input-busy"}`}
21
+ onFocusIn={this._onfocusin}
22
+ onFocusOut={this._onfocusout}
23
+ >
24
+ <div class="ui5-input-content">
25
+ <BusyIndicator
26
+ id={`${this._id}-busyIndicator`}
27
+ active={this.loading}
28
+ class="ui5-input-busy-indicator"
29
+ >
30
+
31
+ <div
32
+ class="ui5-input-root"
33
+ part="root"
34
+ >
35
+ <div class="ui5-input-content">
36
+ {preContent.call(this)}
37
+
38
+ <input
39
+ id="inner"
40
+ part="input"
41
+ class="ui5-input-inner"
42
+ style={this.styles.innerInput}
43
+ type={this.inputNativeType}
44
+ inner-input
45
+ inner-input-with-icon={!!this.icon.length}
46
+ disabled={this.disabled}
47
+ readonly={this._readonly || this.loading}
48
+ value={this._innerValue}
49
+ placeholder={this._placeholder}
50
+ maxlength={this.maxlength}
51
+ role={this.accInfo.role}
52
+ enterkeyhint={this.hint}
53
+ aria-controls={this.accInfo.ariaControls}
54
+ aria-invalid={this.accInfo.ariaInvalid}
55
+ aria-haspopup={this.accInfo.ariaHasPopup}
56
+ aria-describedby={this.accInfo.ariaDescribedBy}
57
+ aria-roledescription={this.accInfo.ariaRoledescription}
58
+ aria-autocomplete={this.accInfo.ariaAutoComplete}
59
+ aria-expanded={this.accInfo.ariaExpanded}
60
+ aria-label={this.ariaLabel}
61
+ aria-required={this.required}
62
+ autocomplete="off"
63
+ data-sap-focus-ref
64
+ step={this.nativeInputAttributes.step}
65
+ min={this.nativeInputAttributes.min}
66
+ max={this.nativeInputAttributes.max}
67
+ onInput={this._handleNativeInput}
68
+ onChange={this._handleChange}
69
+ onSelect={this._handleSelect}
70
+ onKeyDown={this._onkeydown}
71
+ onKeyUp={this._onkeyup}
72
+ onClick={this._click}
73
+ onFocusIn={this.innerFocusIn}
74
+ />
75
+
76
+ {this._effectiveShowClearIcon &&
77
+ <div
78
+ tabindex={-1}
79
+ part="clear-icon-wrapper"
80
+ class="ui5-input-clear-icon-wrapper inputIcon"
81
+ onClick={this._clear}
82
+ onMouseDown={this._iconMouseDown}
83
+ >
84
+ <Icon
85
+ part="clear-icon"
86
+ class="ui5-input-clear-icon"
87
+ name={"decline"}
88
+ tabindex={-1}
89
+ accessibleName={this.clearIconAccessibleName}>
90
+ </Icon>
91
+ </div>
92
+ }
93
+
94
+ {this.icon.length > 0 &&
95
+ <div class="ui5-input-icon-root"
96
+ tabindex={-1}
97
+ >
98
+ <slot name="icon"></slot>
99
+ </div>
100
+ }
101
+
102
+ <div class="ui5-input-value-state-icon">
103
+ {this._valueStateInputIcon}
104
+ </div>
105
+ { postContent.call(this) }
106
+
107
+ {this.accInfo.ariaDescription &&
108
+ <span id="descr" class="ui5-hidden-text">{this.accInfo.ariaDescription}</span>
109
+ }
110
+
111
+ {this.accInfo.accessibleDescription &&
112
+ <span id="accessibleDescription" class="ui5-hidden-text">{this.accInfo.accessibleDescription}</span>
113
+ }
114
+
115
+ {this.linksInAriaValueStateHiddenText.length > 0 &&
116
+ <span id="hiddenText-value-state-link-shortcut" class="ui5-hidden-text">{this.valueStateLinksShortcutsTextAcc}</span>
117
+ }
118
+
119
+ {this.hasValueState &&
120
+ <span id="valueStateDesc" class="ui5-hidden-text">{this.ariaValueStateHiddenText}</span>
121
+ }
122
+ </div>
123
+ </div>
124
+
125
+ </BusyIndicator>
126
+ <Button
127
+ id="ai-menu-btn"
128
+ hidden={(!this.isFocused && !this.loading) || !this.hasActions || this.readonly}
129
+ tabIndex={-1}
130
+ class={`ui5-input-ai-button ui5-ai-input-button-wrapper ${this._isMenuOpen && "ui5-input-button-menu-open"} ${this.loading && "ui5-ai-input-loading"}`}
131
+ design="Transparent"
132
+ icon={this.loading ? "stop" : "ai"}
133
+ onClick={this._handleAIButtonClick}
134
+ onKeyDown={this._handleAIButtonKeydown}
135
+ aria-keyshortcuts={ this.loading ? "Esc" : "Shift + F4" }
136
+ tooltip={this.loading ? this.stopGeneratingTooltip : this.ariaLabel}
137
+ accessibilityAttributes={{ hasPopup: this.loading ? "false" : "menu" }}
138
+ />
139
+ <Menu
140
+ onItemClick={this._onMenuIconClick}
141
+ onBeforeOpen={() => { this._isMenuOpen = true; }}
142
+ onBeforeClose={() => { this._isMenuOpen = false; }}
143
+ onClose={() => { if (!this.loading) { this.focus(); } }}
144
+ >
145
+ <slot name="actions"></slot>
146
+ {this.totalVersions > 1 && Versioning.call(this)}
147
+ </Menu>
148
+ </div>
149
+ </div>
150
+ </>
151
+ );
152
+ }
153
+
154
+ function Versioning(this: Input) {
155
+ return (
156
+ <>
157
+ <MenuSeparator />
158
+ <MenuItem
159
+ type="Inactive"
160
+ class="ui5-ai-versioning-menu-footer"
161
+ text={`${this.currentVersion} / ${this.totalVersions}`}
162
+ >
163
+ <Button
164
+ id="arrow-left"
165
+ class="versioning-button"
166
+ slot="endContent"
167
+ design="Transparent"
168
+ icon="navigation-left-arrow"
169
+ tooltip={this.previousButtonAccessibleName}
170
+ accessibleName={this.previousButtonAccessibleName}
171
+ aria-keyshortcut="Shift+Ctrl+Z"
172
+ disabled={this.currentVersion <= 1}
173
+ onClick={this._handlePreviousButtonClick}
174
+ data-ui5-versioning-button="previous"
175
+ >
176
+ </Button>
177
+ <Button
178
+ id="arrow-right"
179
+ class="versioning-button"
180
+ slot="endContent"
181
+ design="Transparent"
182
+ icon="navigation-right-arrow"
183
+ tooltip={this.nextButtonAccessibleName}
184
+ accessibleName={this.nextButtonAccessibleName}
185
+ aria-keyshortcut="Shift+Ctrl+Y"
186
+ disabled={this.currentVersion >= this.totalVersions}
187
+ onClick={this._handleNextButtonClick}
188
+ data-ui5-versioning-button="next"
189
+ />
190
+ </MenuItem>
191
+ </>
192
+ );
193
+ }
194
+
195
+ function defaultPreContent() { }
196
+
197
+ function defaultPostContent() {}
@@ -0,0 +1,45 @@
1
+ .ui5-ai-textarea-root {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ width: 100%;
6
+ height: 100%;
7
+ }
8
+
9
+ .ui5-ai-textarea-root .ui5-textarea-wrapper {
10
+ display: flex;
11
+ flex-direction: column;
12
+ flex: 1;
13
+ position: relative;
14
+ }
15
+
16
+ .ui5-ai-textarea-root [part="footer"] {
17
+ position: relative;
18
+ width: 100%;
19
+ margin-top: auto;
20
+ flex-shrink: 0;
21
+ }
22
+
23
+ .ui5-ai-writing-assistant-footer-bar {
24
+ background: var(--_ui5_texteditor_toolbar_background, var(--sapPageFooter_Background));
25
+ width: 100%;
26
+ box-sizing: border-box;
27
+ box-shadow: none;
28
+ border-bottom: none;
29
+ border-top: none;
30
+ }
31
+
32
+ .ui5-ai-writing-assistant-footer-bar--with-border {
33
+ border-top: 1px solid var(--sapPageFooter_BorderColor);
34
+ }
35
+
36
+ .ui5-ai-writing-assistant-action-label {
37
+ margin-left: 0.5rem;
38
+ color: var(--sapContent_LabelColor);
39
+ font-size: var(--sapFontSmallSize);
40
+ }
41
+
42
+ #ai-menu-wrapper {
43
+ position: relative;
44
+ z-index: 1000;
45
+ }
@@ -0,0 +1,90 @@
1
+ import type TextArea from "./TextArea.js";
2
+ import WritingAssistant from "./WritingAssistant.js";
3
+ import BusyIndicator from "@ui5/webcomponents/dist/BusyIndicator.js";
4
+ import TextAreaPopoverTemplate from "@ui5/webcomponents/dist/TextAreaPopoverTemplate.js";
5
+
6
+ export default function TextAreaTemplate(this: TextArea) {
7
+ return (
8
+ <div class="ui5-ai-textarea-root">
9
+ <div
10
+ class={this.classes.root}
11
+ onFocusIn={this._onfocusin}
12
+ onFocusOut={this._onfocusout}
13
+ >
14
+ <div class="ui5-textarea-wrapper">
15
+ {this.growing &&
16
+ <div id={`${this._id}-mirror`} class="ui5-textarea-mirror" aria-hidden="true">
17
+ {this._mirrorText.map(mirrorText => {
18
+ return (
19
+ <>
20
+ {mirrorText.text}
21
+ <br />
22
+ </>
23
+ );
24
+ })}
25
+ </div>
26
+ }
27
+ <BusyIndicator
28
+ id={`${this._id}-busyIndicator`}
29
+ active={this.loading}
30
+ class="ui5-textarea-busy-indicator"
31
+ >
32
+ <textarea
33
+ id={`${this._id}-inner`}
34
+ class="ui5-textarea-inner"
35
+ part="textarea"
36
+ placeholder={this.placeholder}
37
+ disabled={this.disabled}
38
+ readonly={this.readonly}
39
+ aria-label={this._ariaLabel}
40
+ aria-describedby={this.ariaDescribedBy}
41
+ aria-invalid={this._ariaInvalid}
42
+ aria-required={this.required}
43
+ maxlength={this._exceededTextProps.calcedMaxLength}
44
+ value={this.value}
45
+ data-sap-focus-ref
46
+ onInput={this._oninput}
47
+ onChange={this._onchange}
48
+ onKeyUp={this._onkeyup}
49
+ onKeyDown={this._onkeydown}
50
+ onSelect={this._onselect}
51
+ onScroll={this._onscroll}>
52
+ </textarea>
53
+ </BusyIndicator>
54
+ <div part="footer">
55
+ <slot name="footer">
56
+ <WritingAssistant
57
+ loading={this.loading}
58
+ currentVersion={this.currentVersion}
59
+ totalVersions={this.totalVersions}
60
+ promptDescription={this.promptDescription}
61
+ onButtonClick={this._handleAIButtonClick}
62
+ onStopGeneration={this.handleStopGeneration}
63
+ onVersionChange={this._handleVersionChange}
64
+ />
65
+ </slot>
66
+ </div>
67
+ </div>
68
+
69
+ {this.showExceededText &&
70
+ <span class="ui5-textarea-exceeded-text">{this._exceededTextProps.exceededText}</span>
71
+ }
72
+
73
+ {this.hasValueState &&
74
+ <span id={`${this._id}-valueStateDesc`} class="ui5-hidden-text">{this.ariaValueStateHiddenText}</span>
75
+ }
76
+ </div>
77
+
78
+ {TextAreaPopoverTemplate.call(this)}
79
+
80
+ {/* ARIA live region for screen readers */}
81
+ <div aria-live="polite" aria-atomic="true" class="ui5-hidden-text">
82
+ {this.loading ? this.promptDescription : ""}
83
+ </div>
84
+
85
+ <div id="ai-menu-wrapper">
86
+ <slot name="menu"></slot>
87
+ </div>
88
+ </div>
89
+ );
90
+ }
@@ -0,0 +1,9 @@
1
+ import type ToolbarLabel from "./ToolbarLabel.js";
2
+
3
+ export default function ToolbarLabelTemplate(this: ToolbarLabel) {
4
+ return (
5
+ <span class="ui5-ai-toolbar-label">
6
+ {this.text}
7
+ </span>
8
+ );
9
+ }