@ui5/webcomponents-ai 0.0.0-d473b9686 → 0.0.0-f42e7c18c

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 (162) hide show
  1. package/CHANGELOG.md +309 -0
  2. package/README.md +5 -7
  3. package/dist/Button.d.ts +108 -2
  4. package/dist/Button.js +203 -11
  5. package/dist/Button.js.map +1 -1
  6. package/dist/ButtonState.d.ts +60 -0
  7. package/dist/ButtonState.js +51 -0
  8. package/dist/ButtonState.js.map +1 -0
  9. package/dist/ButtonTemplate.d.ts +2 -0
  10. package/dist/ButtonTemplate.js +6 -0
  11. package/dist/ButtonTemplate.js.map +1 -0
  12. package/dist/PromptInput.d.ts +154 -0
  13. package/dist/PromptInput.js +235 -0
  14. package/dist/PromptInput.js.map +1 -0
  15. package/dist/PromptInputTemplate.d.ts +2 -0
  16. package/dist/PromptInputTemplate.js +12 -0
  17. package/dist/PromptInputTemplate.js.map +1 -0
  18. package/dist/bundle.esm.js +3 -1
  19. package/dist/bundle.esm.js.map +1 -1
  20. package/dist/bundle.scoped.config.d.ts +1 -0
  21. package/dist/bundle.scoped.config.js +3 -0
  22. package/dist/bundle.scoped.config.js.map +1 -0
  23. package/dist/bundle.scoped.esm.d.ts +2 -1
  24. package/dist/bundle.scoped.esm.js +2 -2
  25. package/dist/bundle.scoped.esm.js.map +1 -1
  26. package/dist/css/themes/Button.css +1 -0
  27. package/dist/css/themes/PromptInput.css +1 -0
  28. package/dist/custom-elements-internal.json +557 -1
  29. package/dist/custom-elements.json +491 -1
  30. package/dist/generated/assets/i18n/messagebundle_ar.json +1 -0
  31. package/dist/generated/assets/i18n/messagebundle_bg.json +1 -0
  32. package/dist/generated/assets/i18n/messagebundle_ca.json +1 -0
  33. package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -0
  34. package/dist/generated/assets/i18n/messagebundle_cs.json +1 -0
  35. package/dist/generated/assets/i18n/messagebundle_cy.json +1 -0
  36. package/dist/generated/assets/i18n/messagebundle_da.json +1 -0
  37. package/dist/generated/assets/i18n/messagebundle_de.json +1 -0
  38. package/dist/generated/assets/i18n/messagebundle_el.json +1 -0
  39. package/dist/generated/assets/i18n/messagebundle_en.json +1 -0
  40. package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -0
  41. package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
  42. package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
  43. package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
  44. package/dist/generated/assets/i18n/messagebundle_es.json +1 -0
  45. package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -0
  46. package/dist/generated/assets/i18n/messagebundle_et.json +1 -0
  47. package/dist/generated/assets/i18n/messagebundle_fi.json +1 -0
  48. package/dist/generated/assets/i18n/messagebundle_fr.json +1 -0
  49. package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -0
  50. package/dist/generated/assets/i18n/messagebundle_hi.json +1 -0
  51. package/dist/generated/assets/i18n/messagebundle_hr.json +1 -0
  52. package/dist/generated/assets/i18n/messagebundle_hu.json +1 -0
  53. package/dist/generated/assets/i18n/messagebundle_it.json +1 -0
  54. package/dist/generated/assets/i18n/messagebundle_iw.json +1 -0
  55. package/dist/generated/assets/i18n/messagebundle_ja.json +1 -0
  56. package/dist/generated/assets/i18n/messagebundle_kk.json +1 -0
  57. package/dist/generated/assets/i18n/messagebundle_ko.json +1 -0
  58. package/dist/generated/assets/i18n/messagebundle_lt.json +1 -0
  59. package/dist/generated/assets/i18n/messagebundle_lv.json +1 -0
  60. package/dist/generated/assets/i18n/messagebundle_mk.json +1 -0
  61. package/dist/generated/assets/i18n/messagebundle_ms.json +1 -0
  62. package/dist/generated/assets/i18n/messagebundle_nl.json +1 -0
  63. package/dist/generated/assets/i18n/messagebundle_no.json +1 -0
  64. package/dist/generated/assets/i18n/messagebundle_pl.json +1 -0
  65. package/dist/generated/assets/i18n/messagebundle_pt.json +1 -0
  66. package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -0
  67. package/dist/generated/assets/i18n/messagebundle_ro.json +1 -0
  68. package/dist/generated/assets/i18n/messagebundle_ru.json +1 -0
  69. package/dist/generated/assets/i18n/messagebundle_sh.json +1 -0
  70. package/dist/generated/assets/i18n/messagebundle_sk.json +1 -0
  71. package/dist/generated/assets/i18n/messagebundle_sl.json +1 -0
  72. package/dist/generated/assets/i18n/messagebundle_sr.json +1 -0
  73. package/dist/generated/assets/i18n/messagebundle_sv.json +1 -0
  74. package/dist/generated/assets/i18n/messagebundle_th.json +1 -0
  75. package/dist/generated/assets/i18n/messagebundle_tr.json +1 -0
  76. package/dist/generated/assets/i18n/messagebundle_uk.json +1 -0
  77. package/dist/generated/assets/i18n/messagebundle_vi.json +1 -0
  78. package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -0
  79. package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -0
  80. package/dist/generated/i18n/i18n-defaults.d.ts +4 -1
  81. package/dist/generated/i18n/i18n-defaults.js +3 -1
  82. package/dist/generated/i18n/i18n-defaults.js.map +1 -1
  83. package/dist/generated/json-imports/Themes-fetch.d.ts +1 -0
  84. package/dist/generated/json-imports/Themes-fetch.js +21 -0
  85. package/dist/generated/json-imports/Themes-fetch.js.map +1 -0
  86. package/dist/generated/json-imports/Themes.js.map +1 -1
  87. package/dist/generated/json-imports/i18n-fetch.d.ts +1 -0
  88. package/dist/generated/json-imports/i18n-fetch.js +118 -0
  89. package/dist/generated/json-imports/i18n-fetch.js.map +1 -0
  90. package/dist/generated/json-imports/i18n.d.ts +1 -0
  91. package/dist/generated/json-imports/i18n.js +117 -1
  92. package/dist/generated/json-imports/i18n.js.map +1 -1
  93. package/dist/generated/themes/Button.css.js +2 -1
  94. package/dist/generated/themes/Button.css.js.map +1 -1
  95. package/dist/generated/themes/PromptInput.css.d.ts +3 -0
  96. package/dist/generated/themes/PromptInput.css.js +9 -0
  97. package/dist/generated/themes/PromptInput.css.js.map +1 -0
  98. package/dist/tsconfig.tsbuildinfo +1 -0
  99. package/dist/vscode.html-custom-data.json +121 -1
  100. package/dist/web-types.json +287 -0
  101. package/package.json +7 -7
  102. package/src/ButtonTemplate.tsx +24 -0
  103. package/src/PromptInputTemplate.tsx +49 -0
  104. package/src/i18n/messagebundle.properties +6 -0
  105. package/src/i18n/messagebundle_ar.properties +4 -0
  106. package/src/i18n/messagebundle_bg.properties +4 -0
  107. package/src/i18n/messagebundle_ca.properties +4 -0
  108. package/src/i18n/messagebundle_cnr.properties +4 -0
  109. package/src/i18n/messagebundle_cs.properties +4 -0
  110. package/src/i18n/messagebundle_cy.properties +4 -0
  111. package/src/i18n/messagebundle_da.properties +4 -0
  112. package/src/i18n/messagebundle_de.properties +4 -0
  113. package/src/i18n/messagebundle_el.properties +4 -0
  114. package/src/i18n/messagebundle_en.properties +4 -0
  115. package/src/i18n/messagebundle_en_GB.properties +4 -0
  116. package/src/i18n/messagebundle_en_US_sappsd.properties +4 -0
  117. package/src/i18n/messagebundle_en_US_saprigi.properties +4 -0
  118. package/src/i18n/messagebundle_en_US_saptrc.properties +4 -0
  119. package/src/i18n/messagebundle_es.properties +4 -0
  120. package/src/i18n/messagebundle_es_MX.properties +4 -0
  121. package/src/i18n/messagebundle_et.properties +4 -0
  122. package/src/i18n/messagebundle_fi.properties +4 -0
  123. package/src/i18n/messagebundle_fr.properties +4 -0
  124. package/src/i18n/messagebundle_fr_CA.properties +4 -0
  125. package/src/i18n/messagebundle_hi.properties +4 -0
  126. package/src/i18n/messagebundle_hr.properties +4 -0
  127. package/src/i18n/messagebundle_hu.properties +4 -0
  128. package/src/i18n/messagebundle_id.properties +4 -0
  129. package/src/i18n/messagebundle_it.properties +4 -0
  130. package/src/i18n/messagebundle_iw.properties +4 -0
  131. package/src/i18n/messagebundle_ja.properties +4 -0
  132. package/src/i18n/messagebundle_kk.properties +4 -0
  133. package/src/i18n/messagebundle_ko.properties +4 -0
  134. package/src/i18n/messagebundle_lt.properties +4 -0
  135. package/src/i18n/messagebundle_lv.properties +4 -0
  136. package/src/i18n/messagebundle_mk.properties +4 -0
  137. package/src/i18n/messagebundle_ms.properties +4 -0
  138. package/src/i18n/messagebundle_nl.properties +4 -0
  139. package/src/i18n/messagebundle_no.properties +4 -0
  140. package/src/i18n/messagebundle_pl.properties +4 -0
  141. package/src/i18n/messagebundle_pt.properties +4 -0
  142. package/src/i18n/messagebundle_pt_PT.properties +4 -0
  143. package/src/i18n/messagebundle_ro.properties +4 -0
  144. package/src/i18n/messagebundle_ru.properties +4 -0
  145. package/src/i18n/messagebundle_sh.properties +4 -0
  146. package/src/i18n/messagebundle_sk.properties +4 -0
  147. package/src/i18n/messagebundle_sl.properties +4 -0
  148. package/src/i18n/messagebundle_sr.properties +4 -0
  149. package/src/i18n/messagebundle_sv.properties +4 -0
  150. package/src/i18n/messagebundle_th.properties +4 -0
  151. package/src/i18n/messagebundle_tr.properties +4 -0
  152. package/src/i18n/messagebundle_uk.properties +4 -0
  153. package/src/i18n/messagebundle_vi.properties +4 -0
  154. package/src/i18n/messagebundle_zh_CN.properties +4 -0
  155. package/src/i18n/messagebundle_zh_TW.properties +4 -0
  156. package/src/themes/Button.css +88 -0
  157. package/src/themes/PromptInput.css +30 -0
  158. package/tsconfig.json +36 -26
  159. package/dist/generated/templates/ButtonTemplate.lit.d.ts +0 -4
  160. package/dist/generated/templates/ButtonTemplate.lit.js +0 -5
  161. package/dist/generated/templates/ButtonTemplate.lit.js.map +0 -1
  162. package/src/Button.hbs +0 -3
package/CHANGELOG.md CHANGED
@@ -1,2 +1,311 @@
1
1
  # Change Log
2
2
 
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # [2.5.0](https://github.com/SAP/ui5-webcomponents/compare/v2.5.0-rc.3...v2.5.0) (2024-12-05)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-ai
9
+
10
+
11
+
12
+
13
+
14
+ # [2.5.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.5.0-rc.2...v2.5.0-rc.3) (2024-12-05)
15
+
16
+
17
+ ### Features
18
+
19
+ * **framework:** add strict event type checking ([#10235](https://github.com/SAP/ui5-webcomponents/issues/10235)) ([4ff8ab7](https://github.com/SAP/ui5-webcomponents/commit/4ff8ab7c34db5058b92511767be1b96c69a91cb5))
20
+
21
+
22
+
23
+
24
+
25
+ # [2.5.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.5.0-rc.1...v2.5.0-rc.2) (2024-11-28)
26
+
27
+ **Note:** Version bump only for package @ui5/webcomponents-ai
28
+
29
+
30
+
31
+
32
+
33
+ # [2.5.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.5.0-rc.0...v2.5.0-rc.1) (2024-11-21)
34
+
35
+ **Note:** Version bump only for package @ui5/webcomponents-ai
36
+
37
+
38
+
39
+
40
+
41
+ # [2.5.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.4.1-rc.0...v2.5.0-rc.0) (2024-11-14)
42
+
43
+ **Note:** Version bump only for package @ui5/webcomponents-ai
44
+
45
+
46
+
47
+
48
+
49
+ ## [2.4.1-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.4.0...v2.4.1-rc.0) (2024-11-07)
50
+
51
+ **Note:** Version bump only for package @ui5/webcomponents-ai
52
+
53
+
54
+
55
+
56
+
57
+ # [2.4.0](https://github.com/SAP/ui5-webcomponents/compare/v2.4.0-rc.4...v2.4.0) (2024-11-03)
58
+
59
+ **Note:** Version bump only for package @ui5/webcomponents-ai
60
+
61
+
62
+
63
+
64
+
65
+ # [2.4.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v2.4.0-rc.3...v2.4.0-rc.4) (2024-10-31)
66
+
67
+ **Note:** Version bump only for package @ui5/webcomponents-ai
68
+
69
+
70
+
71
+
72
+
73
+ # [2.4.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.4.0-rc.2...v2.4.0-rc.3) (2024-10-28)
74
+
75
+ **Note:** Version bump only for package @ui5/webcomponents-ai
76
+
77
+
78
+
79
+
80
+
81
+ # [2.4.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.4.0-rc.1...v2.4.0-rc.2) (2024-10-24)
82
+
83
+ **Note:** Version bump only for package @ui5/webcomponents-ai
84
+
85
+
86
+
87
+
88
+
89
+ # [2.4.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.4.0-rc.0...v2.4.0-rc.1) (2024-10-17)
90
+
91
+
92
+ ### Bug Fixes
93
+
94
+ * scoping issues and document how scoping is used correctly ([#10023](https://github.com/SAP/ui5-webcomponents/issues/10023)) ([ee808c3](https://github.com/SAP/ui5-webcomponents/commit/ee808c309f316fe145b05d292c92328396c655ab))
95
+ * **tools:** revert tsconfig moduleResolution to node ([#10014](https://github.com/SAP/ui5-webcomponents/issues/10014)) ([0724b92](https://github.com/SAP/ui5-webcomponents/commit/0724b9289ad04f88972d4978ed37e76f13abca13))
96
+
97
+
98
+
99
+
100
+
101
+ # [2.4.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.3.1-rc.0...v2.4.0-rc.0) (2024-10-10)
102
+
103
+
104
+ ### Bug Fixes
105
+
106
+ * **ui5-ai-button:** reset button width after animations ([#9923](https://github.com/SAP/ui5-webcomponents/issues/9923)) ([2a5c7db](https://github.com/SAP/ui5-webcomponents/commit/2a5c7db734b08f629f41b586f4aa0f39b20de632))
107
+
108
+
109
+ ### Features
110
+
111
+ * enhance `[@event](https://github.com/event)` decorator ([#9944](https://github.com/SAP/ui5-webcomponents/issues/9944)) ([fe1d816](https://github.com/SAP/ui5-webcomponents/commit/fe1d816f512400b839fd4ce1b9af1506d0cb4c9a))
112
+
113
+
114
+
115
+
116
+
117
+ ## [2.3.1-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0...v2.3.1-rc.0) (2024-10-03)
118
+
119
+ **Note:** Version bump only for package @ui5/webcomponents-ai
120
+
121
+
122
+
123
+
124
+
125
+ # [2.3.0](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.3...v2.3.0) (2024-10-02)
126
+
127
+
128
+ ### Features
129
+
130
+ * **framework:** introduce the `i18n` decorator and the `cldr` option ([#9897](https://github.com/SAP/ui5-webcomponents/issues/9897)) ([1f29d23](https://github.com/SAP/ui5-webcomponents/commit/1f29d231fe892a850871e7f73afca93c730ecffd))
131
+
132
+
133
+
134
+
135
+
136
+ # [2.3.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.2...v2.3.0-rc.3) (2024-09-26)
137
+
138
+ **Note:** Version bump only for package @ui5/webcomponents-ai
139
+
140
+
141
+
142
+
143
+
144
+ # [2.3.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.1...v2.3.0-rc.2) (2024-09-19)
145
+
146
+ **Note:** Version bump only for package @ui5/webcomponents-ai
147
+
148
+
149
+
150
+
151
+
152
+ # [2.3.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.0...v2.3.0-rc.1) (2024-09-12)
153
+
154
+ **Note:** Version bump only for package @ui5/webcomponents-ai
155
+
156
+
157
+
158
+
159
+
160
+ # [2.3.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0...v2.3.0-rc.0) (2024-09-05)
161
+
162
+ **Note:** Version bump only for package @ui5/webcomponents-ai
163
+
164
+
165
+
166
+
167
+
168
+ # [2.2.0](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0-rc.3...v2.2.0) (2024-09-03)
169
+
170
+ **Note:** Version bump only for package @ui5/webcomponents-ai
171
+
172
+
173
+
174
+
175
+
176
+ # [2.2.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0-rc.2...v2.2.0-rc.3) (2024-08-29)
177
+
178
+ **Note:** Version bump only for package @ui5/webcomponents-ai
179
+
180
+
181
+
182
+
183
+
184
+ # [2.2.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0-rc.1...v2.2.0-rc.2) (2024-08-22)
185
+
186
+ **Note:** Version bump only for package @ui5/webcomponents-ai
187
+
188
+
189
+
190
+
191
+
192
+ # [2.2.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0-rc.0...v2.2.0-rc.1) (2024-08-15)
193
+
194
+ **Note:** Version bump only for package @ui5/webcomponents-ai
195
+
196
+
197
+
198
+
199
+
200
+ # [2.2.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.1.1...v2.2.0-rc.0) (2024-08-08)
201
+
202
+ **Note:** Version bump only for package @ui5/webcomponents-ai
203
+
204
+
205
+
206
+
207
+
208
+ ## [2.1.1](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0...v2.1.1) (2024-08-02)
209
+
210
+ **Note:** Version bump only for package @ui5/webcomponents-ai
211
+
212
+
213
+
214
+
215
+
216
+ # [2.1.0](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0-rc.3...v2.1.0) (2024-08-02)
217
+
218
+ **Note:** Version bump only for package @ui5/webcomponents-ai
219
+
220
+
221
+
222
+
223
+
224
+ # [2.1.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0-rc.2...v2.1.0-rc.3) (2024-08-01)
225
+
226
+ **Note:** Version bump only for package @ui5/webcomponents-ai
227
+
228
+
229
+
230
+
231
+
232
+ # [2.1.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0-rc.1...v2.1.0-rc.2) (2024-07-25)
233
+
234
+ **Note:** Version bump only for package @ui5/webcomponents-ai
235
+
236
+
237
+
238
+
239
+
240
+ # [2.1.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0-rc.0...v2.1.0-rc.1) (2024-07-18)
241
+
242
+
243
+ ### Features
244
+
245
+ * **ui5-prompt-input:** implement suggestions ([#9390](https://github.com/SAP/ui5-webcomponents/issues/9390)) ([a261cfb](https://github.com/SAP/ui5-webcomponents/commit/a261cfbfa06328e1f496a8a2acd1e4b22e78243d))
246
+
247
+
248
+
249
+
250
+
251
+ # [2.1.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.0.1...v2.1.0-rc.0) (2024-07-11)
252
+
253
+ **Note:** Version bump only for package @ui5/webcomponents-ai
254
+
255
+
256
+
257
+
258
+
259
+ ## [2.0.1](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0...v2.0.1) (2024-07-05)
260
+
261
+ **Note:** Version bump only for package @ui5/webcomponents-ai
262
+
263
+
264
+
265
+
266
+
267
+ # [2.0.0](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0-rc.6...v2.0.0) (2024-07-03)
268
+
269
+
270
+ ### Features
271
+
272
+ * add property initializers ([#8846](https://github.com/SAP/ui5-webcomponents/issues/8846)) ([eef0cc9](https://github.com/SAP/ui5-webcomponents/commit/eef0cc9b663fda6268b98e516ed46439435fa2b0))
273
+ * **ui5-ai-button:** initial implementation ([b39548f](https://github.com/SAP/ui5-webcomponents/commit/b39548f7af9e0dd76543327d5bab5242d9ef15a0))
274
+
275
+
276
+ ### BREAKING CHANGES
277
+
278
+ * @property decorator must be adapted according to new type parameter
279
+
280
+
281
+
282
+
283
+
284
+ # [2.0.0-rc.6](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0-rc.5...v2.0.0-rc.6) (2024-06-17)
285
+
286
+
287
+ ### Features
288
+
289
+ * **ui5-ai-prompt-input:** initial (experimental) implementation ([#9078](https://github.com/SAP/ui5-webcomponents/issues/9078)) ([9dcdfdb](https://github.com/SAP/ui5-webcomponents/commit/9dcdfdbcf78eda087099e12301ad91e624038a17))
290
+
291
+
292
+
293
+
294
+
295
+ # [2.0.0-rc.5](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0-rc.4...v2.0.0-rc.5) (2024-06-06)
296
+
297
+ **Note:** Version bump only for package @ui5/webcomponents-ai
298
+
299
+
300
+
301
+
302
+
303
+ # [2.0.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0-rc.3...v2.0.0-rc.4) (2024-05-29)
304
+
305
+ **Note:** Version bump only for package @ui5/webcomponents-ai
306
+
307
+
308
+
309
+
310
+
311
+ # Change Log
package/README.md CHANGED
@@ -1,7 +1,4 @@
1
- ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/main/docs/images/UI5_logo_wide.png)
2
-
3
-
4
- # UI5 Web Components - AI
1
+ # ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/main/docs/images/UI5_logo_water.png)UI5 Web Components - AI
5
2
 
6
3
  [![npm Package Version](https://badge.fury.io/js/%40ui5%2Fwebcomponents.svg)](https://www.npmjs.com/package/@ui5/webcomponents)
7
4
 
@@ -13,9 +10,10 @@ Provides web components implementing AI-related visual and interaction.
13
10
 
14
11
  ## Provided components
15
12
 
16
- | Web Component | Tag name | Module import |
17
- |--------------------------|-----------------------------|------------------------------------------------------------|
18
-
13
+ | Web Component | Tag name | Module import |
14
+ |--------------------------|--------------------------------|---------------------------------------------------------|
15
+ | Button | `ui5-ai-button` | `import "@ui5/webcomponents-ai/dist/Button.js";` |
16
+ | PromptInput | `ui5-ai-prompt-input` | `import "@ui5/webcomponents-ai/dist/PromptInput.js";` |
19
17
 
20
18
  ## Provided assets
21
19
 
package/dist/Button.d.ts CHANGED
@@ -1,11 +1,117 @@
1
1
  import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
+ import MainButton from "@ui5/webcomponents/dist/Button.js";
3
+ import type ButtonDesign from "@ui5/webcomponents/dist/types/ButtonDesign.js";
4
+ import ButtonState from "./ButtonState.js";
2
5
  /**
3
6
  * @class
7
+ *
8
+ * ### Overview
9
+ *
10
+ * The `ui5-ai-button` component represents a button used in AI-related scenarios.
11
+ * It enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing
12
+ * certain keyboard keys, such as Enter.
13
+ *
14
+ * ### Usage
15
+ *
16
+ * For the `ui5-ai-button` UI, you can define one or more states of the button by placing `ai-button-state` components in its default slot.
17
+ * Each state have a name that identifies it and can have text, icon and end icon defined (in any combination) depending on the state purpose.
18
+ *
19
+ * You can choose from a set of predefined designs (the same as for regular `ui5-button` component) that allow different styling to correspond to the triggered action.
20
+ *
21
+ * `ui5-ai-button` can be activated by clicking or tapping it. The state can be changed in `click` event handler.
22
+ *
23
+ * ### ES6 Module Import
24
+ *
25
+ * `import "@ui5/webcomponents-ai/dist/Button.js";`
26
+ *
4
27
  * @constructor
5
28
  * @extends UI5Element
29
+ * @since 2.0.0
30
+ * @public
31
+ * @experimental The Button and ButtonState web components are availabe since 2.0 under an experimental flag and their API and behaviour are subject to change.
6
32
  */
7
33
  declare class Button extends UI5Element {
8
- icon: string;
9
- endIcon: string;
34
+ eventDetails: {
35
+ click: void;
36
+ };
37
+ /**
38
+ * Defines the component design.
39
+ * @default "Default"
40
+ * @public
41
+ */
42
+ design?: `${ButtonDesign}`;
43
+ /**
44
+ * Defines whether the component is disabled.
45
+ * A disabled component can't be pressed or
46
+ * focused, and it is not in the tab chain.
47
+ * @default false
48
+ * @public
49
+ */
50
+ disabled: boolean;
51
+ /**
52
+ * Defines the current state of the component.
53
+ *
54
+ * @default undefined
55
+ * @public
56
+ */
57
+ state?: string;
58
+ /**
59
+ * Keeps the current state object of the component.
60
+ * @private
61
+ */
62
+ _currentStateObject?: ButtonState;
63
+ /**
64
+ * Initiates button elements fade-out phase.
65
+ * @default false
66
+ * @private
67
+ */
68
+ fadeOut: boolean;
69
+ /**
70
+ * Initiates button fade middle phase.
71
+ * @default false
72
+ * @private
73
+ */
74
+ fadeMid: boolean;
75
+ /**
76
+ * Initiates button elements fade-in phase.
77
+ * @default false
78
+ * @private
79
+ */
80
+ fadeIn: boolean;
81
+ /**
82
+ * Defines the available states of the component.
83
+ * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use `ui5-ai-button-state` components in order to preserve the intended design.
84
+ * @public
85
+ */
86
+ states: Array<ButtonState>;
87
+ onBeforeRendering(): void;
88
+ /**
89
+ * Starts the fade-out animation.
90
+ * @private
91
+ */
92
+ _fadeOut(): Promise<void>;
93
+ /**
94
+ * Starts the fade-in animation.
95
+ * @private
96
+ */
97
+ _fadeIn(): void;
98
+ /**
99
+ * Resets the fade phases when the animation is completed.
100
+ * @private
101
+ */
102
+ _resetFade(): void;
103
+ /**
104
+ * Handles the click event.
105
+ * @private
106
+ */
107
+ _onclick(e: MouseEvent): void;
108
+ get _mainButton(): MainButton;
109
+ get _effectiveState(): string;
110
+ get _effectiveStateObject(): ButtonState | undefined;
111
+ get _stateIconOnly(): boolean;
112
+ get _stateText(): string | undefined;
113
+ get _stateIcon(): string | undefined;
114
+ get _stateEndIcon(): string | undefined;
115
+ get _hasText(): boolean;
10
116
  }
11
117
  export default Button;
package/dist/Button.js CHANGED
@@ -5,35 +5,227 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
8
+ import { renderFinished } from "@ui5/webcomponents-base/dist/Render.js";
8
9
  import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
9
10
  import property from "@ui5/webcomponents-base/dist/decorators/property.js";
10
- import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
11
- // Deps
11
+ import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
12
+ import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
13
+ import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
12
14
  import MainButton from "@ui5/webcomponents/dist/Button.js";
13
- // Template
14
- import template from "./generated/templates/ButtonTemplate.lit.js";
15
+ import Icon from "@ui5/webcomponents/dist/Icon.js";
16
+ import ButtonState from "./ButtonState.js";
17
+ import ButtonTemplate from "./ButtonTemplate.js";
15
18
  // Styles
16
- import styles from "./generated/themes/Button.css.js";
19
+ import ButtonCss from "./generated/themes/Button.css.js";
17
20
  /**
18
21
  * @class
22
+ *
23
+ * ### Overview
24
+ *
25
+ * The `ui5-ai-button` component represents a button used in AI-related scenarios.
26
+ * It enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing
27
+ * certain keyboard keys, such as Enter.
28
+ *
29
+ * ### Usage
30
+ *
31
+ * For the `ui5-ai-button` UI, you can define one or more states of the button by placing `ai-button-state` components in its default slot.
32
+ * Each state have a name that identifies it and can have text, icon and end icon defined (in any combination) depending on the state purpose.
33
+ *
34
+ * You can choose from a set of predefined designs (the same as for regular `ui5-button` component) that allow different styling to correspond to the triggered action.
35
+ *
36
+ * `ui5-ai-button` can be activated by clicking or tapping it. The state can be changed in `click` event handler.
37
+ *
38
+ * ### ES6 Module Import
39
+ *
40
+ * `import "@ui5/webcomponents-ai/dist/Button.js";`
41
+ *
19
42
  * @constructor
20
43
  * @extends UI5Element
44
+ * @since 2.0.0
45
+ * @public
46
+ * @experimental The Button and ButtonState web components are availabe since 2.0 under an experimental flag and their API and behaviour are subject to change.
21
47
  */
22
48
  let Button = class Button extends UI5Element {
49
+ constructor() {
50
+ super(...arguments);
51
+ /**
52
+ * Defines the component design.
53
+ * @default "Default"
54
+ * @public
55
+ */
56
+ this.design = "Default";
57
+ /**
58
+ * Defines whether the component is disabled.
59
+ * A disabled component can't be pressed or
60
+ * focused, and it is not in the tab chain.
61
+ * @default false
62
+ * @public
63
+ */
64
+ this.disabled = false;
65
+ /**
66
+ * Initiates button elements fade-out phase.
67
+ * @default false
68
+ * @private
69
+ */
70
+ this.fadeOut = false;
71
+ /**
72
+ * Initiates button fade middle phase.
73
+ * @default false
74
+ * @private
75
+ */
76
+ this.fadeMid = false;
77
+ /**
78
+ * Initiates button elements fade-in phase.
79
+ * @default false
80
+ * @private
81
+ */
82
+ this.fadeIn = false;
83
+ }
84
+ onBeforeRendering() {
85
+ if (this.fadeOut || this.fadeIn) {
86
+ return;
87
+ }
88
+ if (!this._currentStateObject?.name) {
89
+ this._currentStateObject = this._effectiveStateObject;
90
+ }
91
+ const currentStateName = this._currentStateObject?.name || "";
92
+ if (currentStateName !== "" && currentStateName !== this._effectiveState) {
93
+ this._fadeOut();
94
+ }
95
+ }
96
+ /**
97
+ * Starts the fade-out animation.
98
+ * @private
99
+ */
100
+ async _fadeOut() {
101
+ const fadeOutDuration = 180;
102
+ const button = this._mainButton;
103
+ const newStateObject = this._effectiveStateObject;
104
+ if (!newStateObject) {
105
+ // eslint-disable-next-line no-console
106
+ console.warn(`State with name="${this.state}" doesn't exist!`);
107
+ }
108
+ else if (button) {
109
+ const buttonWidth = button.offsetWidth;
110
+ const hiddenButton = this.shadowRoot?.querySelector(".ui5-ai-button-hidden");
111
+ button.style.width = `${buttonWidth}px`;
112
+ hiddenButton.icon = newStateObject.icon;
113
+ hiddenButton.endIcon = newStateObject.endIcon;
114
+ hiddenButton.textContent = newStateObject.text || null;
115
+ await renderFinished();
116
+ const hiddenButtonWidth = hiddenButton.offsetWidth;
117
+ this.fadeOut = true;
118
+ button.style.width = `${hiddenButtonWidth}px`;
119
+ setTimeout(() => {
120
+ this.fadeMid = true;
121
+ this._currentStateObject = newStateObject;
122
+ this._fadeIn();
123
+ }, fadeOutDuration);
124
+ }
125
+ }
126
+ /**
127
+ * Starts the fade-in animation.
128
+ * @private
129
+ */
130
+ _fadeIn() {
131
+ const fadeInDuration = 60;
132
+ setTimeout(() => {
133
+ this.fadeIn = true;
134
+ this._resetFade();
135
+ }, fadeInDuration);
136
+ }
137
+ /**
138
+ * Resets the fade phases when the animation is completed.
139
+ * @private
140
+ */
141
+ _resetFade() {
142
+ const fadeResetDuration = 160;
143
+ setTimeout(() => {
144
+ this.fadeOut = false;
145
+ this.fadeMid = false;
146
+ this.fadeIn = false;
147
+ }, fadeResetDuration);
148
+ // reset the button's width after animations
149
+ const button = this._mainButton;
150
+ if (button) {
151
+ button.style.width = "";
152
+ }
153
+ }
154
+ /**
155
+ * Handles the click event.
156
+ * @private
157
+ */
158
+ _onclick(e) {
159
+ e.stopImmediatePropagation();
160
+ this.fireDecoratorEvent("click");
161
+ }
162
+ get _mainButton() {
163
+ return this.shadowRoot?.querySelector("[ui5-button]");
164
+ }
165
+ get _effectiveState() {
166
+ return this.state || (this.states.length && this.states[0].name) || "";
167
+ }
168
+ get _effectiveStateObject() {
169
+ return this.states.find(state => state.name === this._effectiveState);
170
+ }
171
+ get _stateIconOnly() {
172
+ return !this._stateText && !!this._stateIcon;
173
+ }
174
+ get _stateText() {
175
+ return this._currentStateObject?.text;
176
+ }
177
+ get _stateIcon() {
178
+ return this._currentStateObject?.icon;
179
+ }
180
+ get _stateEndIcon() {
181
+ return this._currentStateObject?.endIcon;
182
+ }
183
+ get _hasText() {
184
+ return !!this._stateText;
185
+ }
23
186
  };
24
187
  __decorate([
25
188
  property()
26
- ], Button.prototype, "icon", void 0);
189
+ ], Button.prototype, "design", void 0);
190
+ __decorate([
191
+ property({ type: Boolean })
192
+ ], Button.prototype, "disabled", void 0);
27
193
  __decorate([
28
194
  property()
29
- ], Button.prototype, "endIcon", void 0);
195
+ ], Button.prototype, "state", void 0);
196
+ __decorate([
197
+ property({ type: Object })
198
+ ], Button.prototype, "_currentStateObject", void 0);
199
+ __decorate([
200
+ property({ type: Boolean })
201
+ ], Button.prototype, "fadeOut", void 0);
202
+ __decorate([
203
+ property({ type: Boolean })
204
+ ], Button.prototype, "fadeMid", void 0);
205
+ __decorate([
206
+ property({ type: Boolean })
207
+ ], Button.prototype, "fadeIn", void 0);
208
+ __decorate([
209
+ slot({ type: HTMLElement, "default": true })
210
+ ], Button.prototype, "states", void 0);
30
211
  Button = __decorate([
31
212
  customElement({
32
213
  tag: "ui5-ai-button",
33
- renderer: litRender,
34
- template,
35
- styles,
36
- dependencies: [MainButton],
214
+ languageAware: true,
215
+ renderer: jsxRenderer,
216
+ template: ButtonTemplate,
217
+ styles: ButtonCss,
218
+ dependencies: [MainButton, Icon, ButtonState],
219
+ shadowRootOptions: { delegatesFocus: true },
220
+ })
221
+ /**
222
+ * Fired when the component is activated either with a
223
+ * mouse/tap or by using the Enter or Space key.
224
+ * @public
225
+ */
226
+ ,
227
+ event("click", {
228
+ bubbles: true,
37
229
  })
38
230
  ], Button);
39
231
  Button.define();