@ui5/webcomponents-ai 2.18.0 → 2.19.0-rc.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 (140) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -3
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/Button.d.ts +2 -1
  5. package/dist/Button.js +2 -1
  6. package/dist/Button.js.map +1 -1
  7. package/dist/ButtonState.d.ts +2 -1
  8. package/dist/ButtonState.js +2 -1
  9. package/dist/ButtonState.js.map +1 -1
  10. package/dist/Input.d.ts +5 -3
  11. package/dist/Input.js +3 -0
  12. package/dist/Input.js.map +1 -1
  13. package/dist/PromptInput.d.ts +1 -0
  14. package/dist/PromptInput.js +1 -0
  15. package/dist/PromptInput.js.map +1 -1
  16. package/dist/TextArea.d.ts +1 -0
  17. package/dist/TextArea.js +1 -0
  18. package/dist/TextArea.js.map +1 -1
  19. package/dist/css/themes/Button.css +1 -1
  20. package/dist/css/themes/Input.css +1 -1
  21. package/dist/css/themes/TextArea.css +1 -1
  22. package/dist/css/themes/WritingAssistant.css +1 -1
  23. package/dist/custom-elements-internal.json +32 -7
  24. package/dist/custom-elements.json +8 -1
  25. package/dist/generated/assets/i18n/messagebundle_ar.json +1 -1
  26. package/dist/generated/assets/i18n/messagebundle_bg.json +1 -1
  27. package/dist/generated/assets/i18n/messagebundle_ca.json +1 -1
  28. package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -1
  29. package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
  30. package/dist/generated/assets/i18n/messagebundle_cy.json +1 -1
  31. package/dist/generated/assets/i18n/messagebundle_da.json +1 -1
  32. package/dist/generated/assets/i18n/messagebundle_de.json +1 -1
  33. package/dist/generated/assets/i18n/messagebundle_el.json +1 -1
  34. package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
  35. package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -1
  36. package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -1
  37. package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
  38. package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -1
  39. package/dist/generated/assets/i18n/messagebundle_es.json +1 -1
  40. package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -1
  41. package/dist/generated/assets/i18n/messagebundle_et.json +1 -1
  42. package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
  43. package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
  44. package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -1
  45. package/dist/generated/assets/i18n/messagebundle_hi.json +1 -1
  46. package/dist/generated/assets/i18n/messagebundle_hr.json +1 -1
  47. package/dist/generated/assets/i18n/messagebundle_hu.json +1 -1
  48. package/dist/generated/assets/i18n/messagebundle_id.json +1 -1
  49. package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
  50. package/dist/generated/assets/i18n/messagebundle_iw.json +1 -1
  51. package/dist/generated/assets/i18n/messagebundle_ja.json +1 -1
  52. package/dist/generated/assets/i18n/messagebundle_kk.json +1 -1
  53. package/dist/generated/assets/i18n/messagebundle_ko.json +1 -1
  54. package/dist/generated/assets/i18n/messagebundle_lt.json +1 -1
  55. package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
  56. package/dist/generated/assets/i18n/messagebundle_mk.json +1 -1
  57. package/dist/generated/assets/i18n/messagebundle_ms.json +1 -1
  58. package/dist/generated/assets/i18n/messagebundle_nl.json +1 -1
  59. package/dist/generated/assets/i18n/messagebundle_no.json +1 -1
  60. package/dist/generated/assets/i18n/messagebundle_pl.json +1 -1
  61. package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
  62. package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -1
  63. package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
  64. package/dist/generated/assets/i18n/messagebundle_ru.json +1 -1
  65. package/dist/generated/assets/i18n/messagebundle_sh.json +1 -1
  66. package/dist/generated/assets/i18n/messagebundle_sk.json +1 -1
  67. package/dist/generated/assets/i18n/messagebundle_sl.json +1 -1
  68. package/dist/generated/assets/i18n/messagebundle_sr.json +1 -1
  69. package/dist/generated/assets/i18n/messagebundle_sv.json +1 -1
  70. package/dist/generated/assets/i18n/messagebundle_th.json +1 -1
  71. package/dist/generated/assets/i18n/messagebundle_tr.json +1 -1
  72. package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
  73. package/dist/generated/assets/i18n/messagebundle_vi.json +1 -1
  74. package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -1
  75. package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -1
  76. package/dist/generated/themes/Button.css.d.ts +1 -1
  77. package/dist/generated/themes/Button.css.js +1 -1
  78. package/dist/generated/themes/Button.css.js.map +1 -1
  79. package/dist/generated/themes/Input.css.d.ts +1 -1
  80. package/dist/generated/themes/Input.css.js +1 -1
  81. package/dist/generated/themes/Input.css.js.map +1 -1
  82. package/dist/generated/themes/TextArea.css.d.ts +1 -1
  83. package/dist/generated/themes/TextArea.css.js +1 -1
  84. package/dist/generated/themes/TextArea.css.js.map +1 -1
  85. package/dist/generated/themes/WritingAssistant.css.d.ts +1 -1
  86. package/dist/generated/themes/WritingAssistant.css.js +1 -1
  87. package/dist/generated/themes/WritingAssistant.css.js.map +1 -1
  88. package/dist/web-types.json +1 -1
  89. package/package.json +7 -7
  90. package/src/i18n/messagebundle_ar.properties +8 -0
  91. package/src/i18n/messagebundle_bg.properties +8 -0
  92. package/src/i18n/messagebundle_ca.properties +8 -0
  93. package/src/i18n/messagebundle_cnr.properties +8 -0
  94. package/src/i18n/messagebundle_cs.properties +8 -0
  95. package/src/i18n/messagebundle_cy.properties +8 -0
  96. package/src/i18n/messagebundle_da.properties +8 -0
  97. package/src/i18n/messagebundle_de.properties +11 -3
  98. package/src/i18n/messagebundle_el.properties +8 -0
  99. package/src/i18n/messagebundle_en.properties +25 -2
  100. package/src/i18n/messagebundle_en_GB.properties +8 -0
  101. package/src/i18n/messagebundle_en_US_sappsd.properties +2 -2
  102. package/src/i18n/messagebundle_en_US_saprigi.properties +2 -2
  103. package/src/i18n/messagebundle_en_US_saptrc.properties +2 -2
  104. package/src/i18n/messagebundle_es.properties +8 -0
  105. package/src/i18n/messagebundle_es_MX.properties +8 -0
  106. package/src/i18n/messagebundle_et.properties +8 -0
  107. package/src/i18n/messagebundle_fi.properties +8 -0
  108. package/src/i18n/messagebundle_fr.properties +8 -0
  109. package/src/i18n/messagebundle_fr_CA.properties +8 -0
  110. package/src/i18n/messagebundle_hi.properties +8 -0
  111. package/src/i18n/messagebundle_hr.properties +8 -0
  112. package/src/i18n/messagebundle_hu.properties +8 -0
  113. package/src/i18n/messagebundle_id.properties +8 -0
  114. package/src/i18n/messagebundle_it.properties +8 -0
  115. package/src/i18n/messagebundle_iw.properties +10 -2
  116. package/src/i18n/messagebundle_ja.properties +8 -0
  117. package/src/i18n/messagebundle_kk.properties +8 -0
  118. package/src/i18n/messagebundle_ko.properties +8 -0
  119. package/src/i18n/messagebundle_lt.properties +8 -0
  120. package/src/i18n/messagebundle_lv.properties +8 -0
  121. package/src/i18n/messagebundle_mk.properties +8 -0
  122. package/src/i18n/messagebundle_ms.properties +8 -0
  123. package/src/i18n/messagebundle_nl.properties +8 -0
  124. package/src/i18n/messagebundle_no.properties +8 -0
  125. package/src/i18n/messagebundle_pl.properties +8 -0
  126. package/src/i18n/messagebundle_pt.properties +8 -0
  127. package/src/i18n/messagebundle_pt_PT.properties +8 -0
  128. package/src/i18n/messagebundle_ro.properties +8 -0
  129. package/src/i18n/messagebundle_ru.properties +8 -0
  130. package/src/i18n/messagebundle_sh.properties +8 -0
  131. package/src/i18n/messagebundle_sk.properties +8 -0
  132. package/src/i18n/messagebundle_sl.properties +8 -0
  133. package/src/i18n/messagebundle_sr.properties +8 -0
  134. package/src/i18n/messagebundle_sv.properties +9 -1
  135. package/src/i18n/messagebundle_th.properties +8 -0
  136. package/src/i18n/messagebundle_tr.properties +8 -0
  137. package/src/i18n/messagebundle_uk.properties +8 -0
  138. package/src/i18n/messagebundle_vi.properties +8 -0
  139. package/src/i18n/messagebundle_zh_CN.properties +8 -0
  140. package/src/i18n/messagebundle_zh_TW.properties +8 -0
package/dist/Button.d.ts CHANGED
@@ -40,7 +40,8 @@ type AIButtonAccessibilityAttributes = {
40
40
  * @extends UI5Element
41
41
  * @since 2.0.0
42
42
  * @public
43
- * @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.
43
+ * @experimental The **@ui5/webcomponents-ai** package (including Button and ButtonState) is under active development and considered experimental. Component APIs are subject to change.
44
+ * Furthermore, the package supports **Horizon** themes only.
44
45
  */
45
46
  declare class Button extends UI5Element {
46
47
  eventDetails: {
package/dist/Button.js CHANGED
@@ -49,7 +49,8 @@ import ButtonCss from "./generated/themes/Button.css.js";
49
49
  * @extends UI5Element
50
50
  * @since 2.0.0
51
51
  * @public
52
- * @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.
52
+ * @experimental The **@ui5/webcomponents-ai** package (including Button and ButtonState) is under active development and considered experimental. Component APIs are subject to change.
53
+ * Furthermore, the package supports **Horizon** themes only.
53
54
  */
54
55
  let Button = Button_1 = class Button extends UI5Element {
55
56
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAClE,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,kDAAkD,C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nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { i18n } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport query from \"@ui5/webcomponents-base/dist/decorators/query.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type SplitButton from \"@ui5/webcomponents/dist/SplitButton.js\";\nimport type ButtonDesign from \"@ui5/webcomponents/dist/types/ButtonDesign.js\";\nimport type ButtonState from \"./ButtonState.js\";\nimport { BUTTON_TOOLTIP_TEXT } from \"./generated/i18n/i18n-defaults.js\";\nimport \"./ButtonState.js\";\nimport ButtonTemplate from \"./ButtonTemplate.js\";\nimport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tgetAllAccessibleNameRefTexts,\n} from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\n\n// Styles\nimport ButtonCss from \"./generated/themes/Button.css.js\";\n\ntype AIButtonRootAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"roleDescription\" | \"title\" | \"ariaKeyShortcuts\">;\ntype AIButtonArrowButtonAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\" | \"title\">;\ntype AIButtonAccessibilityAttributes = { root?: AIButtonRootAccessibilityAttributes, arrowButton?: AIButtonArrowButtonAccessibilityAttributes}\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button`\n * or by pressing keyboard keys like [Enter] or [Space].\n *\n * ### Usage\n *\n * For the `ui5-ai-button` user interface, you can define one or more button states by placing `ui5-ai-button-state` components in their default slot.\n * Each state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.\n * You can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.\n *\n * You can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.\n *\n * The `ui5-ai-button` can be activated by clicking or tapping it. You can change the button state in the click event handler. When the button is\n * in split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].\n * You can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].\n * To display additional actions, you can attach a menu to the arrow button.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents-ai/dist/Button.js\";`\n *\n * @constructor\n * @extends UI5Element\n * @since 2.0.0\n * @public\n * @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.\n */\n\n@customElement({\n\ttag: \"ui5-ai-button\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ButtonTemplate,\n\tstyles: ButtonCss,\n\tshadowRootOptions: { delegatesFocus: true },\n})\n\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the component is in split mode and after the arrow button\n * is activated either by clicking or tapping it or by using the [Arrow Up] / [Arrow Down],\n * [Alt] + [Arrow Up]/ [Arrow Down], or [F4] keyboard keys.\n * @public\n */\n@event(\"arrow-button-click\", {\n\tbubbles: true,\n})\n\nclass Button extends UI5Element {\n\teventDetails!: {\n\t\t\"click\": void;\n\t\t\"arrow-button-click\": void;\n\t}\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign?: `${ButtonDesign}` = \"Default\"\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the current state of the component.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tstate?: string;\n\n\t/**\n\t * Defines the active state of the arrow button in split mode.\n\t * Set to true when the button is in split mode and a menu with additional options\n\t * is opened by the arrow button. Set back to false when the menu is closed.\n\t * @default false\n\t * @public\n\t * @since 2.6.0\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\tarrowButtonPressed = false;\n\n\t/**\n \t * Defines the additional accessibility attributes that will be applied to the component.\n\t *\n\t * This property allows for fine-tuned control of ARIA attributes for screen reader support.\n\t * It accepts an object with the following optional fields:\n\t *\n\t * - **root**: Accessibility attributes that will be applied to the root element.\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **roleDescription**: Defines a human-readable description for the button's role.\n\t * Accepts any string value.\n\t * - **title**: Specifies a tooltip or description for screen readers.\n\t * Accepts any string value.\n\t * - **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or focus the button.\n\t *\n\t * - **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n\t * - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n\t * Accepts boolean values: `true` or `false`.\n\t *\n\t * @public\n\t * @since 2.6.0\n\t * @default {}\n \t*/\n\t@property({ type: Object })\n\taccessibilityAttributes: AIButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Keeps the current state object of the component.\n\t * @private\n\t */\n\t@property({ type: Object })\n\t_currentStateObject?: ButtonState;\n\n\t/**\n\t * Determines if the button is in icon-only mode.\n\t * This property is animation related only.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly? = false;\n\n\t/**\n\t * Defines the available states of the component.\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that\n\t * you only use `ui5-ai-button-state` components in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\tstates!: Array<ButtonState>;\n\n\t@query(\"[ui5-split-button]\")\n\t_splitButton?: SplitButton;\n\n\t@query(\".ui5-ai-button-hidden[ui5-split-button]\")\n\t_hiddenSplitButton?: SplitButton;\n\n\t@i18n(\"@ui5/webcomponents-ai\")\n\tstatic i18nBundleAi: I18nBundle;\n\n\tget _hideArrowButton() {\n\t\treturn !this._effectiveStateObject?.showArrowButton;\n\t}\n\n\tget _effectiveState() {\n\t\treturn this.state || (this.states.length && this.states[0].name) || \"\";\n\t}\n\n\tget _effectiveStateObject() {\n\t\treturn this.states.find(state => state.name === this._effectiveState);\n\t}\n\n\tget _stateIconOnly() {\n\t\treturn !this._stateText && !!this._stateIcon;\n\t}\n\n\tget _stateText() {\n\t\treturn this._currentStateObject?.text;\n\t}\n\n\tget _stateIcon() {\n\t\treturn this._currentStateObject?.icon;\n\t}\n\n\tget _stateEndIcon() {\n\t\tconst endIcon = this._effectiveStateObject?.showArrowButton ? \"\" : this._effectiveStateObject?.endIcon;\n\t\treturn endIcon;\n\t}\n\n\tget _hasText() {\n\t\treturn !!this._stateText;\n\t}\n\n\tonBeforeRendering(): void {\n\t\tconst splitButton = this._splitButton;\n\n\t\tif (splitButton) {\n\t\t\tsplitButton.activeArrowButton = this.arrowButtonPressed;\n\t\t}\n\n\t\tif (!this._currentStateObject?.name) {\n\t\t\tthis._currentStateObject = this._effectiveStateObject;\n\t\t}\n\n\t\tconst currentStateName = this._currentStateObject?.name || \"\";\n\n\t\tthis.iconOnly = this._stateIconOnly;\n\t\tif (currentStateName !== \"\" && currentStateName !== this._effectiveState) {\n\t\t\tthis._fadeOut();\n\t\t}\n\t}\n\n\t/**\n\t * Starts the fade-out animation.\n\t * @private\n\t */\n\tasync _fadeOut(): Promise<void> {\n\t\tconst fadeOutDuration = 180;\n\t\tconst button = this._splitButton;\n\t\tconst hiddenButton = this._hiddenSplitButton;\n\t\tconst newStateObject = this._effectiveStateObject;\n\n\t\tif (!newStateObject) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`State with name=\"${this.state}\" doesn't exist!`);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!button || !hiddenButton) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttonWidth = button.offsetWidth;\n\t\tconst currentState: Partial<ButtonState> = this._currentStateObject || {};\n\n\t\tif ((!currentState.showArrowButton && newStateObject.showArrowButton) || (!currentState.endIcon && !!newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-button-to-menu\");\n\t\t}\n\t\tif ((currentState.showArrowButton && !newStateObject.showArrowButton) || (!!currentState.endIcon && !newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-menu-to-button\");\n\t\t}\n\n\t\tthis.style.width = `${buttonWidth}px`;\n\t\thiddenButton.icon = newStateObject.icon;\n\t\thiddenButton._endIcon = newStateObject.endIcon;\n\t\thiddenButton.textContent = newStateObject.text || null;\n\t\thiddenButton._hideArrowButton = this._hideArrowButton;\n\n\t\tawait renderFinished();\n\t\tconst hiddenButtonWidth = hiddenButton.offsetWidth;\n\t\tthis.style.width = `${hiddenButtonWidth}px`;\n\t\tthis.classList.add(\"ui5-ai-button-fade-out\");\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-mid\");\n\t\t\tbutton._hideArrowButton = this._hideArrowButton;\n\t\t\tthis._fadeIn();\n\t\t}, fadeOutDuration);\n\t}\n\n\t/**\n\t * Starts the fade-in animation.\n\t * @private\n\t */\n\t_fadeIn(): void {\n\t\tconst fadeInDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tconst newStateObject = this._effectiveStateObject;\n\t\t\tthis._currentStateObject = newStateObject;\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-in\");\n\t\t\tthis._resetFade();\n\t\t}, fadeInDuration);\n\t}\n\n\t/**\n\t * Resets the fade phases when the animation is completed.\n\t * @private\n\t */\n\t_resetFade(): void {\n\t\tconst fadeResetDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-out\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-mid\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-in\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-button-to-menu\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-menu-to-button\");\n\t\t}, fadeResetDuration);\n\n\t\t// reset the button's width after animations\n\t\tconst button = this._splitButton;\n\n\t\tif (button) {\n\t\t\tbutton.style.width = \"\";\n\t\t}\n\t}\n\n\t/**\n\t * Handles the click event.\n\t * @private\n\t */\n\t_onClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t/**\n\t * Handles the arrow-button-click event when `ui5-ai-button` is in split mode.\n\t * @private\n\t */\n\t_onArrowClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"arrow-button-click\");\n\t}\n\n\tget _computedAccessibilityAttributes(): AIButtonAccessibilityAttributes {\n\t\tconst labelRefTexts = getAllAccessibleNameRefTexts(this) || getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || \"\";\n\n\t\tconst mainTitle = this._hasText ? Button.i18nBundleAi.getText(BUTTON_TOOLTIP_TEXT, this._stateText as string) : \"\";\n\t\tconst title = `${mainTitle} ${labelRefTexts}`.trim();\n\n\t\treturn {\n\t\t\troot: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.root?.hasPopup || \"false\",\n\t\t\t\troleDescription: this.accessibilityAttributes?.root?.roleDescription,\n\t\t\t\ttitle: this.accessibilityAttributes?.root?.title || title,\n\t\t\t\tariaKeyShortcuts: this.accessibilityAttributes?.root?.ariaKeyShortcuts,\n\t\t\t},\n\t\t\tarrowButton: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup,\n\t\t\t\texpanded: this.accessibilityAttributes?.arrowButton?.expanded,\n\t\t\t\ttitle: this.accessibilityAttributes?.arrowButton?.title,\n\t\t\t},\n\t\t};\n\t}\n}\n\nButton.define();\nexport default Button;\nexport type {\n\tAIButtonAccessibilityAttributes,\n};\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAClE,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAI/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,GAC5B,MAAM,+DAA+D,CAAC;AAIvE,SAAS;AACT,OAAO,SAAS,MAAM,kCAAkC,CAAC;AAMzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AA8BH,IAAM,MAAM,cAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QAKC;;;;WAIG;QAEH,WAAM,GAAuB,SAAS,CAAA;QAEtC;;;;;;WAMG;QAEH,aAAQ,GAAG,KAA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lB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;sCACjB;AAG5B;IADC,KAAK,CAAC,oBAAoB,CAAC;4CACD;AAG3B;IADC,KAAK,CAAC,yCAAyC,CAAC;kDAChB;AAG1B;IADN,IAAI,CAAC,uBAAuB,CAAC;kCACE;AAvG3B,MAAM;IA5BX,aAAa,CAAC;QACd,GAAG,EAAE,eAAe;QACpB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,SAAS;QACjB,iBAAiB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;KAC3C,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,oBAAoB,EAAE;QAC5B,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,MAAM,CAyRX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { i18n } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport query from \"@ui5/webcomponents-base/dist/decorators/query.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type SplitButton from \"@ui5/webcomponents/dist/SplitButton.js\";\nimport type ButtonDesign from \"@ui5/webcomponents/dist/types/ButtonDesign.js\";\nimport type ButtonState from \"./ButtonState.js\";\nimport { BUTTON_TOOLTIP_TEXT } from \"./generated/i18n/i18n-defaults.js\";\nimport \"./ButtonState.js\";\nimport ButtonTemplate from \"./ButtonTemplate.js\";\nimport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tgetAllAccessibleNameRefTexts,\n} from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\n\n// Styles\nimport ButtonCss from \"./generated/themes/Button.css.js\";\n\ntype AIButtonRootAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"roleDescription\" | \"title\" | \"ariaKeyShortcuts\">;\ntype AIButtonArrowButtonAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\" | \"title\">;\ntype AIButtonAccessibilityAttributes = { root?: AIButtonRootAccessibilityAttributes, arrowButton?: AIButtonArrowButtonAccessibilityAttributes}\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button`\n * or by pressing keyboard keys like [Enter] or [Space].\n *\n * ### Usage\n *\n * For the `ui5-ai-button` user interface, you can define one or more button states by placing `ui5-ai-button-state` components in their default slot.\n * Each state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.\n * You can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.\n *\n * You can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.\n *\n * The `ui5-ai-button` can be activated by clicking or tapping it. You can change the button state in the click event handler. When the button is\n * in split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].\n * You can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].\n * To display additional actions, you can attach a menu to the arrow button.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents-ai/dist/Button.js\";`\n *\n * @constructor\n * @extends UI5Element\n * @since 2.0.0\n * @public\n * @experimental The **@ui5/webcomponents-ai** package (including Button and ButtonState) is under active development and considered experimental. Component APIs are subject to change.\n * Furthermore, the package supports **Horizon** themes only.\n */\n\n@customElement({\n\ttag: \"ui5-ai-button\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ButtonTemplate,\n\tstyles: ButtonCss,\n\tshadowRootOptions: { delegatesFocus: true },\n})\n\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the component is in split mode and after the arrow button\n * is activated either by clicking or tapping it or by using the [Arrow Up] / [Arrow Down],\n * [Alt] + [Arrow Up]/ [Arrow Down], or [F4] keyboard keys.\n * @public\n */\n@event(\"arrow-button-click\", {\n\tbubbles: true,\n})\n\nclass Button extends UI5Element {\n\teventDetails!: {\n\t\t\"click\": void;\n\t\t\"arrow-button-click\": void;\n\t}\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign?: `${ButtonDesign}` = \"Default\"\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the current state of the component.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tstate?: string;\n\n\t/**\n\t * Defines the active state of the arrow button in split mode.\n\t * Set to true when the button is in split mode and a menu with additional options\n\t * is opened by the arrow button. Set back to false when the menu is closed.\n\t * @default false\n\t * @public\n\t * @since 2.6.0\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\tarrowButtonPressed = false;\n\n\t/**\n \t * Defines the additional accessibility attributes that will be applied to the component.\n\t *\n\t * This property allows for fine-tuned control of ARIA attributes for screen reader support.\n\t * It accepts an object with the following optional fields:\n\t *\n\t * - **root**: Accessibility attributes that will be applied to the root element.\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **roleDescription**: Defines a human-readable description for the button's role.\n\t * Accepts any string value.\n\t * - **title**: Specifies a tooltip or description for screen readers.\n\t * Accepts any string value.\n\t * - **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or focus the button.\n\t *\n\t * - **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n\t * - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n\t * Accepts boolean values: `true` or `false`.\n\t *\n\t * @public\n\t * @since 2.6.0\n\t * @default {}\n \t*/\n\t@property({ type: Object })\n\taccessibilityAttributes: AIButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Keeps the current state object of the component.\n\t * @private\n\t */\n\t@property({ type: Object })\n\t_currentStateObject?: ButtonState;\n\n\t/**\n\t * Determines if the button is in icon-only mode.\n\t * This property is animation related only.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly? = false;\n\n\t/**\n\t * Defines the available states of the component.\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that\n\t * you only use `ui5-ai-button-state` components in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\tstates!: Array<ButtonState>;\n\n\t@query(\"[ui5-split-button]\")\n\t_splitButton?: SplitButton;\n\n\t@query(\".ui5-ai-button-hidden[ui5-split-button]\")\n\t_hiddenSplitButton?: SplitButton;\n\n\t@i18n(\"@ui5/webcomponents-ai\")\n\tstatic i18nBundleAi: I18nBundle;\n\n\tget _hideArrowButton() {\n\t\treturn !this._effectiveStateObject?.showArrowButton;\n\t}\n\n\tget _effectiveState() {\n\t\treturn this.state || (this.states.length && this.states[0].name) || \"\";\n\t}\n\n\tget _effectiveStateObject() {\n\t\treturn this.states.find(state => state.name === this._effectiveState);\n\t}\n\n\tget _stateIconOnly() {\n\t\treturn !this._stateText && !!this._stateIcon;\n\t}\n\n\tget _stateText() {\n\t\treturn this._currentStateObject?.text;\n\t}\n\n\tget _stateIcon() {\n\t\treturn this._currentStateObject?.icon;\n\t}\n\n\tget _stateEndIcon() {\n\t\tconst endIcon = this._effectiveStateObject?.showArrowButton ? \"\" : this._effectiveStateObject?.endIcon;\n\t\treturn endIcon;\n\t}\n\n\tget _hasText() {\n\t\treturn !!this._stateText;\n\t}\n\n\tonBeforeRendering(): void {\n\t\tconst splitButton = this._splitButton;\n\n\t\tif (splitButton) {\n\t\t\tsplitButton.activeArrowButton = this.arrowButtonPressed;\n\t\t}\n\n\t\tif (!this._currentStateObject?.name) {\n\t\t\tthis._currentStateObject = this._effectiveStateObject;\n\t\t}\n\n\t\tconst currentStateName = this._currentStateObject?.name || \"\";\n\n\t\tthis.iconOnly = this._stateIconOnly;\n\t\tif (currentStateName !== \"\" && currentStateName !== this._effectiveState) {\n\t\t\tthis._fadeOut();\n\t\t}\n\t}\n\n\t/**\n\t * Starts the fade-out animation.\n\t * @private\n\t */\n\tasync _fadeOut(): Promise<void> {\n\t\tconst fadeOutDuration = 180;\n\t\tconst button = this._splitButton;\n\t\tconst hiddenButton = this._hiddenSplitButton;\n\t\tconst newStateObject = this._effectiveStateObject;\n\n\t\tif (!newStateObject) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`State with name=\"${this.state}\" doesn't exist!`);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!button || !hiddenButton) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttonWidth = button.offsetWidth;\n\t\tconst currentState: Partial<ButtonState> = this._currentStateObject || {};\n\n\t\tif ((!currentState.showArrowButton && newStateObject.showArrowButton) || (!currentState.endIcon && !!newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-button-to-menu\");\n\t\t}\n\t\tif ((currentState.showArrowButton && !newStateObject.showArrowButton) || (!!currentState.endIcon && !newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-menu-to-button\");\n\t\t}\n\n\t\tthis.style.width = `${buttonWidth}px`;\n\t\thiddenButton.icon = newStateObject.icon;\n\t\thiddenButton._endIcon = newStateObject.endIcon;\n\t\thiddenButton.textContent = newStateObject.text || null;\n\t\thiddenButton._hideArrowButton = this._hideArrowButton;\n\n\t\tawait renderFinished();\n\t\tconst hiddenButtonWidth = hiddenButton.offsetWidth;\n\t\tthis.style.width = `${hiddenButtonWidth}px`;\n\t\tthis.classList.add(\"ui5-ai-button-fade-out\");\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-mid\");\n\t\t\tbutton._hideArrowButton = this._hideArrowButton;\n\t\t\tthis._fadeIn();\n\t\t}, fadeOutDuration);\n\t}\n\n\t/**\n\t * Starts the fade-in animation.\n\t * @private\n\t */\n\t_fadeIn(): void {\n\t\tconst fadeInDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tconst newStateObject = this._effectiveStateObject;\n\t\t\tthis._currentStateObject = newStateObject;\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-in\");\n\t\t\tthis._resetFade();\n\t\t}, fadeInDuration);\n\t}\n\n\t/**\n\t * Resets the fade phases when the animation is completed.\n\t * @private\n\t */\n\t_resetFade(): void {\n\t\tconst fadeResetDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-out\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-mid\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-in\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-button-to-menu\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-menu-to-button\");\n\t\t}, fadeResetDuration);\n\n\t\t// reset the button's width after animations\n\t\tconst button = this._splitButton;\n\n\t\tif (button) {\n\t\t\tbutton.style.width = \"\";\n\t\t}\n\t}\n\n\t/**\n\t * Handles the click event.\n\t * @private\n\t */\n\t_onClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t/**\n\t * Handles the arrow-button-click event when `ui5-ai-button` is in split mode.\n\t * @private\n\t */\n\t_onArrowClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"arrow-button-click\");\n\t}\n\n\tget _computedAccessibilityAttributes(): AIButtonAccessibilityAttributes {\n\t\tconst labelRefTexts = getAllAccessibleNameRefTexts(this) || getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || \"\";\n\n\t\tconst mainTitle = this._hasText ? Button.i18nBundleAi.getText(BUTTON_TOOLTIP_TEXT, this._stateText as string) : \"\";\n\t\tconst title = `${mainTitle} ${labelRefTexts}`.trim();\n\n\t\treturn {\n\t\t\troot: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.root?.hasPopup || \"false\",\n\t\t\t\troleDescription: this.accessibilityAttributes?.root?.roleDescription,\n\t\t\t\ttitle: this.accessibilityAttributes?.root?.title || title,\n\t\t\t\tariaKeyShortcuts: this.accessibilityAttributes?.root?.ariaKeyShortcuts,\n\t\t\t},\n\t\t\tarrowButton: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup,\n\t\t\t\texpanded: this.accessibilityAttributes?.arrowButton?.expanded,\n\t\t\t\ttitle: this.accessibilityAttributes?.arrowButton?.title,\n\t\t\t},\n\t\t};\n\t}\n}\n\nButton.define();\nexport default Button;\nexport type {\n\tAIButtonAccessibilityAttributes,\n};\n"]}
@@ -19,7 +19,8 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
19
19
  * @abstract
20
20
  * @since 2.0.0
21
21
  * @public
22
- * @experimental The Button and ButtonState web components are available since 2.0 under an experimental flag and their API and behaviour are subject to change.
22
+ * @experimental The **@ui5/webcomponents-ai** package (including ButtonState) is under active development and considered experimental. Component APIs are subject to change.
23
+ * Furthermore, the package supports **Horizon** themes only.
23
24
  */
24
25
  declare class ButtonState extends UI5Element {
25
26
  /**
@@ -27,7 +27,8 @@ import property from "@ui5/webcomponents-base/dist/decorators/property.js";
27
27
  * @abstract
28
28
  * @since 2.0.0
29
29
  * @public
30
- * @experimental The Button and ButtonState web components are available since 2.0 under an experimental flag and their API and behaviour are subject to change.
30
+ * @experimental The **@ui5/webcomponents-ai** package (including ButtonState) is under active development and considered experimental. Component APIs are subject to change.
31
+ * Furthermore, the package supports **Horizon** themes only.
31
32
  */
32
33
  let ButtonState = class ButtonState extends UI5Element {
33
34
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonState.js","sourceRoot":"","sources":["../src/ButtonState.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QA2CC;;;;;WAKG;QAEH,oBAAe,GAAG,KAAK,CAAC;IACzB,CAAC;CAAA,CAAA;AA5CA;IADC,QAAQ,EAAE;yCACG;AAQd;IADC,QAAQ,EAAE;yCACG;AAad;IADC,QAAQ,EAAE;yCACG;AAad;IADC,QAAQ,EAAE;4CACM;AASjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACJ;AAlDnB,WAAW;IADhB,aAAa,CAAC,qBAAqB,CAAC;GAC/B,WAAW,CAmDhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AACrB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-ai-button-state` is the item to use for defining states of `ui5-ai-button` components.\n *\n * ### Usage\n *\n * `ui5-ai-button-state` is an abstract element, representing a state of `ui5-ai-button`. It is meant to be used in the `default` slot\n * of `ui5-ai-button` and should not be used as standalone component.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/AiButtonState.js\";`\n * @constructor\n * @extends UI5Element\n * @abstract\n * @since 2.0.0\n * @public\n * @experimental The Button and ButtonState web components are available since 2.0 under an experimental flag and their API and behaviour are subject to change.\n */\n@customElement(\"ui5-ai-button-state\")\nclass ButtonState extends UI5Element {\n\t/**\n\t * Defines the name of the button state.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tname?: string;\n\n\t/**\n\t * Defines the text of the button in this state.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component before the text.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component after the text.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tendIcon?: string;\n\n\t/**\n\t * Defines if the component is in split button mode.\n\t * @default false\n\t * @since 2.6.0\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowArrowButton = false;\n}\n\nButtonState.define();\nexport default ButtonState;\n"]}
1
+ {"version":3,"file":"ButtonState.js","sourceRoot":"","sources":["../src/ButtonState.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QA2CC;;;;;WAKG;QAEH,oBAAe,GAAG,KAAK,CAAC;IACzB,CAAC;CAAA,CAAA;AA5CA;IADC,QAAQ,EAAE;yCACG;AAQd;IADC,QAAQ,EAAE;yCACG;AAad;IADC,QAAQ,EAAE;yCACG;AAad;IADC,QAAQ,EAAE;4CACM;AASjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACJ;AAlDnB,WAAW;IADhB,aAAa,CAAC,qBAAqB,CAAC;GAC/B,WAAW,CAmDhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AACrB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-ai-button-state` is the item to use for defining states of `ui5-ai-button` components.\n *\n * ### Usage\n *\n * `ui5-ai-button-state` is an abstract element, representing a state of `ui5-ai-button`. It is meant to be used in the `default` slot\n * of `ui5-ai-button` and should not be used as standalone component.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/AiButtonState.js\";`\n * @constructor\n * @extends UI5Element\n * @abstract\n * @since 2.0.0\n * @public\n * @experimental The **@ui5/webcomponents-ai** package (including ButtonState) is under active development and considered experimental. Component APIs are subject to change.\n * Furthermore, the package supports **Horizon** themes only.\n */\n@customElement(\"ui5-ai-button-state\")\nclass ButtonState extends UI5Element {\n\t/**\n\t * Defines the name of the button state.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tname?: string;\n\n\t/**\n\t * Defines the text of the button in this state.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component before the text.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component after the text.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tendIcon?: string;\n\n\t/**\n\t * Defines if the component is in split button mode.\n\t * @default false\n\t * @since 2.6.0\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowArrowButton = false;\n}\n\nButtonState.define();\nexport default ButtonState;\n"]}
package/dist/Input.d.ts CHANGED
@@ -4,6 +4,7 @@ import type { MenuItemClickEventDetail } from "@ui5/webcomponents/dist/Menu.js";
4
4
  type InputVersionChangeEventDetail = {
5
5
  backwards: boolean;
6
6
  };
7
+ type InputItemClickEventDetail = MenuItemClickEventDetail;
7
8
  /**
8
9
  * @class
9
10
  *
@@ -35,6 +36,7 @@ type InputVersionChangeEventDetail = {
35
36
  * @extends BaseInput
36
37
  * @since 2.16.0
37
38
  * @experimental The **@ui5/webcomponents-ai** package is under active development and considered experimental. Component APIs are subject to change.
39
+ * Furthermore, the package supports **Horizon** themes only.
38
40
  * @public
39
41
  */
40
42
  declare class Input extends BaseInput {
@@ -42,7 +44,7 @@ declare class Input extends BaseInput {
42
44
  "version-change": InputVersionChangeEventDetail;
43
45
  "stop-generation": void;
44
46
  "button-click": void;
45
- "item-click": MenuItemClickEventDetail;
47
+ "item-click": InputItemClickEventDetail;
46
48
  };
47
49
  /**
48
50
  * Indicates the index of the currently displayed version.
@@ -122,7 +124,7 @@ declare class Input extends BaseInput {
122
124
  * @private
123
125
  */
124
126
  _handleNextButtonClick(): void;
125
- _onMenuIconClick(e: CustomEvent<MenuItemClickEventDetail>): void;
127
+ _onMenuIconClick(e: CustomEvent<InputItemClickEventDetail>): void;
126
128
  /**
127
129
  * Handles keydown events for keyboard shortcuts.
128
130
  * @private
@@ -139,5 +141,5 @@ declare class Input extends BaseInput {
139
141
  get previousButtonAccessibleName(): string;
140
142
  get menu(): Menu;
141
143
  }
142
- export type { InputVersionChangeEventDetail, MenuItemClickEventDetail as InputItemClickEventDetail };
144
+ export type { InputVersionChangeEventDetail, InputItemClickEventDetail, };
143
145
  export default Input;
package/dist/Input.js CHANGED
@@ -51,6 +51,7 @@ import { INPUT_VERSIONING_NEXT_BUTTON_TOOLTIP, INPUT_VERSIONING_PREVIOUS_BUTTON_
51
51
  * @extends BaseInput
52
52
  * @since 2.16.0
53
53
  * @experimental The **@ui5/webcomponents-ai** package is under active development and considered experimental. Component APIs are subject to change.
54
+ * Furthermore, the package supports **Horizon** themes only.
54
55
  * @public
55
56
  */
56
57
  let Input = Input_1 = class Input extends BaseInput {
@@ -264,6 +265,8 @@ Input = Input_1 = __decorate([
264
265
  cancelable: true,
265
266
  })
266
267
  /** Fired when an item from the AI actions menu is clicked.
268
+ * @param { HTMLElement } item The currently clicked menu item.
269
+ * @param { string } text The text of the currently clicked menu item.
267
270
  * @public
268
271
  */
269
272
  ,
package/dist/Input.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sourceRoot":"","sources":["../src/Input.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,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AAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACR;AAWnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACT;AAWlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCACH;AAQzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACC;AAU7B;IAJC,IAAI,CAAC;QACL,IAAI,EAAE,WAAW;QACjB,uBAAuB,EAAE,IAAI;KAC7B,CAAC;sCAC2B;AAvDxB,KAAK;IAxCV,aAAa,CAAC;QACd,GAAG,EAAE,cAAc;QACnB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,aAAa;QACvB,MAAM,EAAE;YACP,UAAU;YACV,QAAQ;YACR,0BAA0B;YAC1B,oBAAoB;SACpB;KACD,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;OAEG;;IACF,KAAK,CAAC,YAAY,CAAC;IAEpB;;;OAGG;;IACF,KAAK,CAAC,iBAAiB,CAAC;IAEzB;;;;;OAKG;;IACF,KAAK,CAAC,gBAAgB,CAAC;GAElB,KAAK,CAiNV;AAED,KAAK,CAAC,MAAM,EAAE,CAAC;AAGf,eAAe,KAAK,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport {\n\tisEscape,\n\tisF4Shift,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport BaseInput from \"@ui5/webcomponents/dist/Input.js\";\nimport type Menu from \"@ui5/webcomponents/dist/Menu.js\";\nimport type { MenuItemClickEventDetail } from \"@ui5/webcomponents/dist/Menu.js\";\nimport type Button from \"./Button.js\";\n\n// styles\nimport AIInputCss from \"./generated/themes/Input.css.js\";\nimport InputCss from \"@ui5/webcomponents/dist/generated/themes/Input.css.js\";\nimport ResponsivePopoverCommonCss from \"@ui5/webcomponents/dist/generated/themes/ResponsivePopoverCommon.css.js\";\nimport ValueStateMessageCss from \"@ui5/webcomponents/dist/generated/themes/ValueStateMessage.css.js\";\n\n// templates\nimport InputTemplate from \"./InputTemplate.js\";\nimport {\n\tINPUT_VERSIONING_NEXT_BUTTON_TOOLTIP,\n\tINPUT_VERSIONING_PREVIOUS_BUTTON_TOOLTIP,\n\tINPUT_WRITING_ASSISTANT_BUTTON_TOOLTIP,\n\tWRITING_ASSISTANT_GENERATING_ANNOUNCEMENT,\n} from \"./generated/i18n/i18n-defaults.js\";\n\ntype InputVersionChangeEventDetail = {\n\tbackwards: boolean,\n};\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-input` component extends the standard `ui5-input` with **AI Writing Assistant** capabilities.\n *\n * ### Structure\n *\n * The `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 *\n * The 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 * @constructor\n * @extends BaseInput\n * @since 2.16.0\n * @experimental The **@ui5/webcomponents-ai** package is under active development and considered experimental. Component APIs are subject to change.\n * @public\n */\n@customElement({\n\ttag: \"ui5-ai-input\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: InputTemplate,\n\tstyles: [\n\t\tAIInputCss,\n\t\tInputCss,\n\t\tResponsivePopoverCommonCss,\n\t\tValueStateMessageCss,\n\t],\n})\n\n/**\n * Fired when the user selects the AI button.\n * @public\n */\n@event(\"button-click\", {\n\tcancelable: true,\n})\n\n/** Fired when an item from the AI actions menu is clicked.\n * @public\n */\n@event(\"item-click\")\n\n/**\n * Fired when the user selects the \"Stop\" button to stop ongoing AI text generation.\n * @public\n */\n@event(\"stop-generation\")\n\n/**\n * Fired when the user selects the version navigation buttons.\n *\n * @param {boolean} backwards - Indicates if navigation is backwards (true) or forwards (false, default)\n * @public\n */\n@event(\"version-change\")\n\nclass Input extends BaseInput {\n\teventDetails!: BaseInput[\"eventDetails\"] & {\n\t\t\"version-change\": InputVersionChangeEventDetail;\n\t\t\"stop-generation\": void;\n\t\t\"button-click\": void;\n\t\t\"item-click\": MenuItemClickEventDetail;\n\t};\n\n\t/**\n\t * Indicates the index of the currently displayed version.\n\t *\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tcurrentVersion = 0;\n\n\t/**\n\t * Indicates the total number of result versions available.\n\t *\n\t * When not set or set to 0, the versioning will be hidden.\n\t *\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\ttotalVersions = 0;\n\n\t/**\n\t * Defines whether the AI Writing Assistant is currently loading.\n\t *\n\t * When `true`, indicates that an AI action is in progress.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tloading: boolean = false;\n\n\t/**\n\t * Indicates if the menu is open.\n\t * @default 0\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_isMenuOpen: boolean = false;\n\n\t/**\n\t * Defines the items of the menu for the component.\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\tinvalidateOnChildChange: true,\n\t})\n\tactions!: Array<HTMLElement>;\n\n\t_previousCurrentStep = 0;\n\t_previousTotalSteps = 0;\n\tisFocused: boolean = false;\n\n\t_onfocusin(e: FocusEvent): void {\n\t\tsuper._onfocusin(e);\n\t\tthis.isFocused = true;\n\t}\n\n\t_onfocusout(e: FocusEvent): void {\n\t\tsuper._onfocusout(e);\n\t\tthis.isFocused = false;\n\t}\n\n\t/**\n\t * Manages the focus when the navigation buttons become disabled/enabled.\n\t * Automatically moves the focus to the available button when the user reaches the boundaries.\n\t * @private\n\t */\n\t_manageVersionButtonsFocus() {\n\t\tconst previousButton = this.shadowRoot?.getElementById(\"arrow-left\") as Button;\n\t\tconst nextButton = this.shadowRoot?.getElementById(\"arrow-right\") as Button;\n\t\tconst isPreviousDisabled = this.currentVersion <= 1;\n\t\tconst isNextDisabled = this.currentVersion >= this.totalVersions;\n\n\t\tif (isPreviousDisabled && previousButton) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tnextButton.focus();\n\t\t\t}, 0);\n\t\t} else if (isNextDisabled && nextButton) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tpreviousButton.focus();\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the click event for the AI generate Button.\n\t * Fires the appropriate event based on the AI Button state.\n\t * @private\n\t */\n\t_handleAIButtonClick(e: Event) {\n\t\tconst target = e.target as HTMLElement & { icon?: string };\n\t\tif (target?.icon === \"stop\") {\n\t\t\tthis.fireDecoratorEvent(\"stop-generation\");\n\t\t} else {\n\t\t\tconst opener = this.shadowRoot?.querySelector(\".ui5-input-ai-button\") as HTMLElement;\n\t\t\tthis.fireDecoratorEvent(\"button-click\");\n\t\t\tthis.menu.opener = opener;\n\t\t\tthis.menu.open = true;\n\t\t\tthis.menu.horizontalAlign = \"End\";\n\t\t}\n\t}\n\n\t/**\n\t * Handles the escape event for the AI generate Button.\n\t * @private\n\t */\n\t_handleAIButtonKeydown = (e: KeyboardEvent) => {\n\t\tif (isEscape(e) && this.loading) {\n\t\t\tthis.fireDecoratorEvent(\"stop-generation\");\n\t\t}\n\t}\n\n\t/**\n\t * Handles the version change event from the versioning component.\n\t *\n\t * @param {CustomEvent} e - The version change event\n\t */\n\t_handleVersionChange(e: CustomEvent<{ backwards: boolean }>) {\n\t\tthis.fireDecoratorEvent(\"version-change\", {\n\t\t\tbackwards: e.detail.backwards,\n\t\t});\n\t\tthis._manageVersionButtonsFocus();\n\t}\n\n\t/**\n\t * Handles the click event for the \"Previous Version\" button.\n\t * Updates the current version index and syncs content.\n\t * @private\n\t */\n\t_handlePreviousButtonClick(): void {\n\t\tthis._handleVersionChange(new CustomEvent(\"version-change\", { detail: { backwards: true } }));\n\t}\n\n\t/**\n\t * Handles the click event for the \"Next Version\" button.\n\t * Updates the current version index and syncs content.\n\t * @private\n\t */\n\t_handleNextButtonClick(): void {\n\t\tthis._handleVersionChange(new CustomEvent(\"version-change\", { detail: { backwards: false } }));\n\t}\n\n\t_onMenuIconClick(e: CustomEvent<MenuItemClickEventDetail>): void {\n\t\tthis.fireDecoratorEvent(\"item-click\", e.detail);\n\t}\n\n\t/**\n\t * Handles keydown events for keyboard shortcuts.\n\t * @private\n\t */\n\t_onkeydown(e: KeyboardEvent): void {\n\t\tsuper._onkeydown(e);\n\t\tconst menuButton = this.shadowRoot?.getElementById(\"ai-menu-btn\") as HTMLElement;\n\n\t\tif (isF4Shift(e)) {\n\t\t\tmenuButton?.focus();\n\n\t\t\tthis.menu.opener = menuButton;\n\t\t\tthis.menu.open = true;\n\t\t\tthis.menu.horizontalAlign = \"End\";\n\t\t}\n\t\tconst goPreviousStep = e.key === \"Z\" && e.shiftKey && e.ctrlKey;\n\t\tconst goNextStep = e.key === \"Y\" && e.shiftKey && e.ctrlKey;\n\n\t\tif (goPreviousStep) {\n\t\t\te.preventDefault();\n\t\t\tthis._handlePreviousButtonClick();\n\t\t} else if (goNextStep) {\n\t\t\te.preventDefault();\n\t\t\tthis._handleNextButtonClick();\n\t\t}\n\t}\n\n\t/**\n\t * Handles visibility of the Writing Assistant Button.\n\t * If there are no items, the Writing Assistant Button would not be rendered.\n\t */\n\tget hasActions() {\n\t\treturn !!this?.menu?.getSlottedNodes(\"items\").length;\n\t}\n\n\tget ariaLabel() {\n\t\treturn this.accessibleName || !this.loading ? Input.i18nBundle.getText(INPUT_WRITING_ASSISTANT_BUTTON_TOOLTIP) : Input.i18nBundle.getText(WRITING_ASSISTANT_GENERATING_ANNOUNCEMENT);\n\t}\n\n\tget stopGeneratingTooltip() {\n\t\treturn Input.i18nBundle.getText(WRITING_ASSISTANT_GENERATING_ANNOUNCEMENT);\n\t}\n\n\tget nextButtonAccessibleName() {\n\t\treturn Input.i18nBundle.getText(INPUT_VERSIONING_NEXT_BUTTON_TOOLTIP);\n\t}\n\n\tget previousButtonAccessibleName() {\n\t\treturn Input.i18nBundle.getText(INPUT_VERSIONING_PREVIOUS_BUTTON_TOOLTIP);\n\t}\n\n\tget menu() {\n\t\treturn this.shadowRoot?.querySelector(\"[ui5-menu]\") as Menu;\n\t}\n}\n\nInput.define();\n\nexport type { InputVersionChangeEventDetail, MenuItemClickEventDetail as InputItemClickEventDetail };\nexport default Input;\n"]}
1
+ {"version":3,"file":"Input.js","sourceRoot":"","sources":["../src/Input.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,EACN,QAAQ,EACR,SAAS,GACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,SAAS,MAAM,kCAAkC,CAAC;AAKzD,SAAS;AACT,OAAO,UAAU,MAAM,iCAAiC,CAAC;AACzD,OAAO,QAAQ,MAAM,uDAAuD,CAAC;AAC7E,OAAO,0BAA0B,MAAM,yEAAyE,CAAC;AACjH,OAAO,oBAAoB,MAAM,mEAAmE,CAAC;AAErG,YAAY;AACZ,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACN,oCAAoC,EACpC,wCAAwC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ACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,aAAa;QACvB,MAAM,EAAE;YACP,UAAU;YACV,QAAQ;YACR,0BAA0B;YAC1B,oBAAoB;SACpB;KACD,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,YAAY,CAAC;IAEpB;;;OAGG;;IACF,KAAK,CAAC,iBAAiB,CAAC;IAEzB;;;;;OAKG;;IACF,KAAK,CAAC,gBAAgB,CAAC;GAElB,KAAK,CAiNV;AAED,KAAK,CAAC,MAAM,EAAE,CAAC;AAMf,eAAe,KAAK,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport {\n\tisEscape,\n\tisF4Shift,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport BaseInput from \"@ui5/webcomponents/dist/Input.js\";\nimport type Menu from \"@ui5/webcomponents/dist/Menu.js\";\nimport type { MenuItemClickEventDetail } from \"@ui5/webcomponents/dist/Menu.js\";\nimport type Button from \"./Button.js\";\n\n// styles\nimport AIInputCss from \"./generated/themes/Input.css.js\";\nimport InputCss from \"@ui5/webcomponents/dist/generated/themes/Input.css.js\";\nimport ResponsivePopoverCommonCss from \"@ui5/webcomponents/dist/generated/themes/ResponsivePopoverCommon.css.js\";\nimport ValueStateMessageCss from \"@ui5/webcomponents/dist/generated/themes/ValueStateMessage.css.js\";\n\n// templates\nimport InputTemplate from \"./InputTemplate.js\";\nimport {\n\tINPUT_VERSIONING_NEXT_BUTTON_TOOLTIP,\n\tINPUT_VERSIONING_PREVIOUS_BUTTON_TOOLTIP,\n\tINPUT_WRITING_ASSISTANT_BUTTON_TOOLTIP,\n\tWRITING_ASSISTANT_GENERATING_ANNOUNCEMENT,\n} from \"./generated/i18n/i18n-defaults.js\";\n\ntype InputVersionChangeEventDetail = {\n\tbackwards: boolean,\n};\n\ntype InputItemClickEventDetail = MenuItemClickEventDetail;\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-input` component extends the standard `ui5-input` with **AI Writing Assistant** capabilities.\n *\n * ### Structure\n *\n * The `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 *\n * The 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 * @constructor\n * @extends BaseInput\n * @since 2.16.0\n * @experimental The **@ui5/webcomponents-ai** package is under active development and considered experimental. Component APIs are subject to change.\n * Furthermore, the package supports **Horizon** themes only.\n * @public\n */\n@customElement({\n\ttag: \"ui5-ai-input\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: InputTemplate,\n\tstyles: [\n\t\tAIInputCss,\n\t\tInputCss,\n\t\tResponsivePopoverCommonCss,\n\t\tValueStateMessageCss,\n\t],\n})\n\n/**\n * Fired when the user selects the AI button.\n * @public\n */\n@event(\"button-click\", {\n\tcancelable: true,\n})\n\n/** Fired when an item from the AI actions menu is clicked.\n * @param { HTMLElement } item The currently clicked menu item.\n * @param { string } text The text of the currently clicked menu item.\n * @public\n */\n@event(\"item-click\")\n\n/**\n * Fired when the user selects the \"Stop\" button to stop ongoing AI text generation.\n * @public\n */\n@event(\"stop-generation\")\n\n/**\n * Fired when the user selects the version navigation buttons.\n *\n * @param {boolean} backwards - Indicates if navigation is backwards (true) or forwards (false, default)\n * @public\n */\n@event(\"version-change\")\n\nclass Input extends BaseInput {\n\teventDetails!: BaseInput[\"eventDetails\"] & {\n\t\t\"version-change\": InputVersionChangeEventDetail;\n\t\t\"stop-generation\": void;\n\t\t\"button-click\": void;\n\t\t\"item-click\": InputItemClickEventDetail;\n\t};\n\n\t/**\n\t * Indicates the index of the currently displayed version.\n\t *\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tcurrentVersion = 0;\n\n\t/**\n\t * Indicates the total number of result versions available.\n\t *\n\t * When not set or set to 0, the versioning will be hidden.\n\t *\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\ttotalVersions = 0;\n\n\t/**\n\t * Defines whether the AI Writing Assistant is currently loading.\n\t *\n\t * When `true`, indicates that an AI action is in progress.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tloading: boolean = false;\n\n\t/**\n\t * Indicates if the menu is open.\n\t * @default 0\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_isMenuOpen: boolean = false;\n\n\t/**\n\t * Defines the items of the menu for the component.\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\tinvalidateOnChildChange: true,\n\t})\n\tactions!: Array<HTMLElement>;\n\n\t_previousCurrentStep = 0;\n\t_previousTotalSteps = 0;\n\tisFocused: boolean = false;\n\n\t_onfocusin(e: FocusEvent): void {\n\t\tsuper._onfocusin(e);\n\t\tthis.isFocused = true;\n\t}\n\n\t_onfocusout(e: FocusEvent): void {\n\t\tsuper._onfocusout(e);\n\t\tthis.isFocused = false;\n\t}\n\n\t/**\n\t * Manages the focus when the navigation buttons become disabled/enabled.\n\t * Automatically moves the focus to the available button when the user reaches the boundaries.\n\t * @private\n\t */\n\t_manageVersionButtonsFocus() {\n\t\tconst previousButton = this.shadowRoot?.getElementById(\"arrow-left\") as Button;\n\t\tconst nextButton = this.shadowRoot?.getElementById(\"arrow-right\") as Button;\n\t\tconst isPreviousDisabled = this.currentVersion <= 1;\n\t\tconst isNextDisabled = this.currentVersion >= this.totalVersions;\n\n\t\tif (isPreviousDisabled && previousButton) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tnextButton.focus();\n\t\t\t}, 0);\n\t\t} else if (isNextDisabled && nextButton) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tpreviousButton.focus();\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the click event for the AI generate Button.\n\t * Fires the appropriate event based on the AI Button state.\n\t * @private\n\t */\n\t_handleAIButtonClick(e: Event) {\n\t\tconst target = e.target as HTMLElement & { icon?: string };\n\t\tif (target?.icon === \"stop\") {\n\t\t\tthis.fireDecoratorEvent(\"stop-generation\");\n\t\t} else {\n\t\t\tconst opener = this.shadowRoot?.querySelector(\".ui5-input-ai-button\") as HTMLElement;\n\t\t\tthis.fireDecoratorEvent(\"button-click\");\n\t\t\tthis.menu.opener = opener;\n\t\t\tthis.menu.open = true;\n\t\t\tthis.menu.horizontalAlign = \"End\";\n\t\t}\n\t}\n\n\t/**\n\t * Handles the escape event for the AI generate Button.\n\t * @private\n\t */\n\t_handleAIButtonKeydown = (e: KeyboardEvent) => {\n\t\tif (isEscape(e) && this.loading) {\n\t\t\tthis.fireDecoratorEvent(\"stop-generation\");\n\t\t}\n\t}\n\n\t/**\n\t * Handles the version change event from the versioning component.\n\t *\n\t * @param {CustomEvent} e - The version change event\n\t */\n\t_handleVersionChange(e: CustomEvent<{ backwards: boolean }>) {\n\t\tthis.fireDecoratorEvent(\"version-change\", {\n\t\t\tbackwards: e.detail.backwards,\n\t\t});\n\t\tthis._manageVersionButtonsFocus();\n\t}\n\n\t/**\n\t * Handles the click event for the \"Previous Version\" button.\n\t * Updates the current version index and syncs content.\n\t * @private\n\t */\n\t_handlePreviousButtonClick(): void {\n\t\tthis._handleVersionChange(new CustomEvent(\"version-change\", { detail: { backwards: true } }));\n\t}\n\n\t/**\n\t * Handles the click event for the \"Next Version\" button.\n\t * Updates the current version index and syncs content.\n\t * @private\n\t */\n\t_handleNextButtonClick(): void {\n\t\tthis._handleVersionChange(new CustomEvent(\"version-change\", { detail: { backwards: false } }));\n\t}\n\n\t_onMenuIconClick(e: CustomEvent<InputItemClickEventDetail>): void {\n\t\tthis.fireDecoratorEvent(\"item-click\", e.detail);\n\t}\n\n\t/**\n\t * Handles keydown events for keyboard shortcuts.\n\t * @private\n\t */\n\t_onkeydown(e: KeyboardEvent): void {\n\t\tsuper._onkeydown(e);\n\t\tconst menuButton = this.shadowRoot?.getElementById(\"ai-menu-btn\") as HTMLElement;\n\n\t\tif (isF4Shift(e)) {\n\t\t\tmenuButton?.focus();\n\n\t\t\tthis.menu.opener = menuButton;\n\t\t\tthis.menu.open = true;\n\t\t\tthis.menu.horizontalAlign = \"End\";\n\t\t}\n\t\tconst goPreviousStep = e.key === \"Z\" && e.shiftKey && e.ctrlKey;\n\t\tconst goNextStep = e.key === \"Y\" && e.shiftKey && e.ctrlKey;\n\n\t\tif (goPreviousStep) {\n\t\t\te.preventDefault();\n\t\t\tthis._handlePreviousButtonClick();\n\t\t} else if (goNextStep) {\n\t\t\te.preventDefault();\n\t\t\tthis._handleNextButtonClick();\n\t\t}\n\t}\n\n\t/**\n\t * Handles visibility of the Writing Assistant Button.\n\t * If there are no items, the Writing Assistant Button would not be rendered.\n\t */\n\tget hasActions() {\n\t\treturn !!this?.menu?.getSlottedNodes(\"items\").length;\n\t}\n\n\tget ariaLabel() {\n\t\treturn this.accessibleName || !this.loading ? Input.i18nBundle.getText(INPUT_WRITING_ASSISTANT_BUTTON_TOOLTIP) : Input.i18nBundle.getText(WRITING_ASSISTANT_GENERATING_ANNOUNCEMENT);\n\t}\n\n\tget stopGeneratingTooltip() {\n\t\treturn Input.i18nBundle.getText(WRITING_ASSISTANT_GENERATING_ANNOUNCEMENT);\n\t}\n\n\tget nextButtonAccessibleName() {\n\t\treturn Input.i18nBundle.getText(INPUT_VERSIONING_NEXT_BUTTON_TOOLTIP);\n\t}\n\n\tget previousButtonAccessibleName() {\n\t\treturn Input.i18nBundle.getText(INPUT_VERSIONING_PREVIOUS_BUTTON_TOOLTIP);\n\t}\n\n\tget menu() {\n\t\treturn this.shadowRoot?.querySelector(\"[ui5-menu]\") as Menu;\n\t}\n}\n\nInput.define();\n\nexport type {\n\tInputVersionChangeEventDetail,\n\tInputItemClickEventDetail,\n};\nexport default Input;\n"]}
@@ -20,6 +20,7 @@ import type { UI5CustomEvent } from "@ui5/webcomponents-base/dist/index.js";
20
20
  * @public
21
21
  * @extends UI5Element
22
22
  * @experimental The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.
23
+ * Furthermore, the package supports **Horizon** themes only.
23
24
  */
24
25
  declare class PromptInput extends UI5Element {
25
26
  eventDetails: {
@@ -33,6 +33,7 @@ import PromptInputCss from "./generated/themes/PromptInput.css.js";
33
33
  * @public
34
34
  * @extends UI5Element
35
35
  * @experimental The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.
36
+ * Furthermore, the package supports **Horizon** themes only.
36
37
  */
37
38
  let PromptInput = PromptInput_1 = class PromptInput extends UI5Element {
38
39
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"PromptInput.js","sourceRoot":"","sources":["../src/PromptInput.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAK/E,OAAO,EACN,OAAO,GACP,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,4BAA4B,EAC5B,gCAAgC,GAChC,MAA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AAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;oDACC;AAkB/C;IAJC,IAAI,CAAC;QACL,IAAI,EAAE,WAAW;QACjB,uBAAuB,EAAE,IAAI;KAC7B,CAAC;sDACqC;AAGhC;IADN,IAAI,CAAC,uBAAuB,CAAC;qCACA;AA/IzB,WAAW;IAvChB,aAAa,CAAC;QACd,GAAG,EAAE,qBAAqB;QAC1B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,cAAc;QACtB,QAAQ,EAAE,mBAAmB;KAC7B,CAAC;IAEF;;;;;;OAMG;;IACF,KAAK,CAAC,QAAQ,EAAE;QAChB,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;;;;OAMG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;;;;OAMG;;IACF,KAAK,CAAC,QAAQ,EAAE;QAChB,OAAO,EAAE,IAAI;KACb,CAAC;GACI,WAAW,CAiMhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type ValueState from \"@ui5/webcomponents-base/dist/types/ValueState.js\";\nimport type { IInputSuggestionItem } from \"@ui5/webcomponents/dist/Input.js\";\nimport type Input from \"@ui5/webcomponents/dist/Input.js\";\nimport {\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tPROMPT_INPUT_CHARACTERS_LEFT,\n\tPROMPT_INPUT_CHARACTERS_EXCEEDED,\n} from \"./generated/i18n/i18n-defaults.js\";\n\nimport PromptInputTemplate from \"./PromptInputTemplate.js\";\n\n// Styles\nimport PromptInputCss from \"./generated/themes/PromptInput.css.js\";\nimport type { UI5CustomEvent } from \"@ui5/webcomponents-base/dist/index.js\";\n\n/**\n * @class\n * ### Overview\n *\n * The `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 * @class\n * @constructor\n * @public\n * @extends UI5Element\n * @experimental The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.\n */\n@customElement({\n\ttag: \"ui5-ai-prompt-input\",\n\trenderer: jsxRenderer,\n\tstyles: PromptInputCss,\n\ttemplate: PromptInputTemplate,\n})\n\n/**\n * Fired when the input operation has finished by pressing Enter\n * or AI button is clicked.\n *\n * @since 2.0.0\n * @public\n */\n@event(\"submit\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the value of the component changes at each keystroke,\n * and when a suggestion item has been selected.\n *\n * @since 2.0.0\n * @public\n */\n@event(\"input\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the input operation has finished by pressing Enter\n * or on focusout.\n *\n * @since 2.0.0\n * @public\n */\n@event(\"change\", {\n\tbubbles: true,\n})\nclass PromptInput extends UI5Element {\n\teventDetails!: {\n\t\tsubmit: void;\n\t\tinput: void;\n\t\tchange: void;\n\t}\n\t/**\n\t * Defines the value of the component.\n\t *\n\t * @default \"\"\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tvalue = \"\";\n\n\t/**\n\t * Defines a short hint intended to aid the user with data entry when the\n\t * component has no value.\n\t * @default undefined\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tplaceholder?: string;\n\n\t/**\n\t * Defines the label of the input field.\n\t *\n\t * @default undefined\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tlabel?: string;\n\n\t/**\n\t * Defines whether the clear icon of the input will be shown.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tshowClearIcon = false;\n\n\t/**\n\t * Determines whether the characters exceeding the maximum allowed character count are visible\n\t * in the component.\n\t *\n\t * If set to `false`, the user is not allowed to enter more characters than what is set in the\n\t * `maxlength` property.\n\t * If set to `true` the characters exceeding the `maxlength` value are selected on\n\t * paste and the counter below the component displays their number.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tshowExceededText = false;\n\n\t/**\n\t * Defines whether the component is in disabled state.\n\t *\n\t * **Note:** A disabled component is completely noninteractive.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines whether the component is read-only.\n\t *\n\t * **Note:** A read-only component is not editable,\n\t * but still provides visual feedback upon user interaction.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\treadonly = false;\n\n\t/**\n\t * Sets the maximum number of characters available in the input field.\n\t *\n\t * @default undefined\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tmaxlength?: number;\n\n\t/**\n\t * Defines the value state of the component.\n\t * @default \"None\"\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tvalueState: `${ValueState}` = \"None\"\n\n\t/**\n\t * Defines whether the component should show suggestions, if such are present.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowSuggestions = false;\n\n\t/**\n\t * Defines the suggestion items.\n\t *\n\t * **Note:** The suggestions would be displayed only if the `showSuggestions`\n\t * property is set to `true`.\n\t *\n\t * **Note:** The `<ui5-suggestion-item>`, `<ui5-suggestion-item-group>` and `ui5-suggestion-item-custom` are recommended to be used as suggestion items.\n\t *\n\t * @public\n\t */\n\t\t@slot({ type: HTMLElement, \"default\": true })\n\t\tsuggestionItems!: Array<IInputSuggestionItem>;\n\n\t/**\n\t * Defines the value state message that will be displayed as pop up under the component.\n\t * The value state message slot should contain only one root element.\n\t *\n\t * **Note:** If not specified, a default text (in the respective language) will be displayed.\n\t *\n\t * **Note:** The `valueStateMessage` would be displayed,\n\t * when the component is in `Information`, `Critical` or `Negative` value state.\n\t *\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\tinvalidateOnChildChange: true,\n\t})\n\tvalueStateMessage!: Array<HTMLElement>;\n\n\t@i18n(\"@ui5/webcomponents-ai\")\n\tstatic i18nBundle: I18nBundle;\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (isEnter(e)) {\n\t\t\tthis.fireDecoratorEvent(\"submit\");\n\t\t}\n\t}\n\n\t_onInnerInput(e: UI5CustomEvent<Input, \"input\">) {\n\t\tthis.value = e.currentTarget.value;\n\n\t\tthis.fireDecoratorEvent(\"input\");\n\t}\n\n\t_onInnerChange() {\n\t\tthis.fireDecoratorEvent(\"change\");\n\t}\n\n\t_onButtonClick() {\n\t\tthis.fireDecoratorEvent(\"submit\");\n\t}\n\n\t_onTypeAhead(e: UI5CustomEvent<Input, \"type-ahead\">): void {\n\t\tthis.value = e.currentTarget.value;\n\t}\n\n\tget _exceededText() {\n\t\tif (this.showExceededText) {\n\t\t\tlet leftCharactersCount;\n\t\t\tconst maxLength = this.maxlength;\n\n\t\t\tif (maxLength !== undefined) {\n\t\t\t\tleftCharactersCount = maxLength - this.value.length;\n\n\t\t\t\tif (leftCharactersCount >= 0) {\n\t\t\t\t\treturn PromptInput.i18nBundle.getText(PROMPT_INPUT_CHARACTERS_LEFT, leftCharactersCount);\n\t\t\t\t}\n\n\t\t\t\treturn PromptInput.i18nBundle.getText(PROMPT_INPUT_CHARACTERS_EXCEEDED, Math.abs(leftCharactersCount));\n\t\t\t}\n\t\t}\n\t}\n\n\tget _maxLenght() {\n\t\treturn this.maxlength || undefined;\n\t}\n\n\tget _submitButtonDisabled() {\n\t\treturn (this.value.length <= 0) || this.disabled || this.readonly;\n\t}\n}\n\nPromptInput.define();\n\nexport default PromptInput;\n"]}
1
+ {"version":3,"file":"PromptInput.js","sourceRoot":"","sources":["../src/PromptInput.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAK/E,OAAO,EACN,OAAO,GACP,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,4BAA4B,EAC5B,gCAAgC,GAChC,MAAM,mCAAmC,CAAC;AAE3C,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAE3D,SAAS;AACT,OAAO,cAAc,MAAM,uCAAuC,CAAC;AAGnE;;;;;;;;;;;;;;;;;GAiBG;AAwCH,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAMC;;;;;;WAMG;QAEH,UAAK,GAAG,EAAE,CAAC;QAsBX;;;;;WAKG;QAEH,kBAAa,GAAG,KAAK,CAAC;QAEtB;;;;;;;;;;;WAWG;QAEH,qBAAgB,GAAG,KAAK,CAAC;QAEzB;;;;;;;WAOG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;;;;;;;WAQG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAYjB;;;;;WAKG;QAEH,eAAU,GAAoB,MAAM,CAAA;QAEpC;;;;;WAKG;QAEH,oBAAe,GAAG,KAAK,CAAC;IAoFzB,CAAC;IAhDA,UAAU,CAAC,CAAgB;QA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C;GACI,WAAW,CAiMhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type ValueState from \"@ui5/webcomponents-base/dist/types/ValueState.js\";\nimport type { IInputSuggestionItem } from \"@ui5/webcomponents/dist/Input.js\";\nimport type Input from \"@ui5/webcomponents/dist/Input.js\";\nimport {\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tPROMPT_INPUT_CHARACTERS_LEFT,\n\tPROMPT_INPUT_CHARACTERS_EXCEEDED,\n} from \"./generated/i18n/i18n-defaults.js\";\n\nimport PromptInputTemplate from \"./PromptInputTemplate.js\";\n\n// Styles\nimport PromptInputCss from \"./generated/themes/PromptInput.css.js\";\nimport type { UI5CustomEvent } from \"@ui5/webcomponents-base/dist/index.js\";\n\n/**\n * @class\n * ### Overview\n *\n * The `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 * @class\n * @constructor\n * @public\n * @extends UI5Element\n * @experimental The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.\n * Furthermore, the package supports **Horizon** themes only.\n */\n@customElement({\n\ttag: \"ui5-ai-prompt-input\",\n\trenderer: jsxRenderer,\n\tstyles: PromptInputCss,\n\ttemplate: PromptInputTemplate,\n})\n\n/**\n * Fired when the input operation has finished by pressing Enter\n * or AI button is clicked.\n *\n * @since 2.0.0\n * @public\n */\n@event(\"submit\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the value of the component changes at each keystroke,\n * and when a suggestion item has been selected.\n *\n * @since 2.0.0\n * @public\n */\n@event(\"input\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the input operation has finished by pressing Enter\n * or on focusout.\n *\n * @since 2.0.0\n * @public\n */\n@event(\"change\", {\n\tbubbles: true,\n})\nclass PromptInput extends UI5Element {\n\teventDetails!: {\n\t\tsubmit: void;\n\t\tinput: void;\n\t\tchange: void;\n\t}\n\t/**\n\t * Defines the value of the component.\n\t *\n\t * @default \"\"\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tvalue = \"\";\n\n\t/**\n\t * Defines a short hint intended to aid the user with data entry when the\n\t * component has no value.\n\t * @default undefined\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tplaceholder?: string;\n\n\t/**\n\t * Defines the label of the input field.\n\t *\n\t * @default undefined\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tlabel?: string;\n\n\t/**\n\t * Defines whether the clear icon of the input will be shown.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tshowClearIcon = false;\n\n\t/**\n\t * Determines whether the characters exceeding the maximum allowed character count are visible\n\t * in the component.\n\t *\n\t * If set to `false`, the user is not allowed to enter more characters than what is set in the\n\t * `maxlength` property.\n\t * If set to `true` the characters exceeding the `maxlength` value are selected on\n\t * paste and the counter below the component displays their number.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tshowExceededText = false;\n\n\t/**\n\t * Defines whether the component is in disabled state.\n\t *\n\t * **Note:** A disabled component is completely noninteractive.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines whether the component is read-only.\n\t *\n\t * **Note:** A read-only component is not editable,\n\t * but still provides visual feedback upon user interaction.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\treadonly = false;\n\n\t/**\n\t * Sets the maximum number of characters available in the input field.\n\t *\n\t * @default undefined\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tmaxlength?: number;\n\n\t/**\n\t * Defines the value state of the component.\n\t * @default \"None\"\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tvalueState: `${ValueState}` = \"None\"\n\n\t/**\n\t * Defines whether the component should show suggestions, if such are present.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowSuggestions = false;\n\n\t/**\n\t * Defines the suggestion items.\n\t *\n\t * **Note:** The suggestions would be displayed only if the `showSuggestions`\n\t * property is set to `true`.\n\t *\n\t * **Note:** The `<ui5-suggestion-item>`, `<ui5-suggestion-item-group>` and `ui5-suggestion-item-custom` are recommended to be used as suggestion items.\n\t *\n\t * @public\n\t */\n\t\t@slot({ type: HTMLElement, \"default\": true })\n\t\tsuggestionItems!: Array<IInputSuggestionItem>;\n\n\t/**\n\t * Defines the value state message that will be displayed as pop up under the component.\n\t * The value state message slot should contain only one root element.\n\t *\n\t * **Note:** If not specified, a default text (in the respective language) will be displayed.\n\t *\n\t * **Note:** The `valueStateMessage` would be displayed,\n\t * when the component is in `Information`, `Critical` or `Negative` value state.\n\t *\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\tinvalidateOnChildChange: true,\n\t})\n\tvalueStateMessage!: Array<HTMLElement>;\n\n\t@i18n(\"@ui5/webcomponents-ai\")\n\tstatic i18nBundle: I18nBundle;\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (isEnter(e)) {\n\t\t\tthis.fireDecoratorEvent(\"submit\");\n\t\t}\n\t}\n\n\t_onInnerInput(e: UI5CustomEvent<Input, \"input\">) {\n\t\tthis.value = e.currentTarget.value;\n\n\t\tthis.fireDecoratorEvent(\"input\");\n\t}\n\n\t_onInnerChange() {\n\t\tthis.fireDecoratorEvent(\"change\");\n\t}\n\n\t_onButtonClick() {\n\t\tthis.fireDecoratorEvent(\"submit\");\n\t}\n\n\t_onTypeAhead(e: UI5CustomEvent<Input, \"type-ahead\">): void {\n\t\tthis.value = e.currentTarget.value;\n\t}\n\n\tget _exceededText() {\n\t\tif (this.showExceededText) {\n\t\t\tlet leftCharactersCount;\n\t\t\tconst maxLength = this.maxlength;\n\n\t\t\tif (maxLength !== undefined) {\n\t\t\t\tleftCharactersCount = maxLength - this.value.length;\n\n\t\t\t\tif (leftCharactersCount >= 0) {\n\t\t\t\t\treturn PromptInput.i18nBundle.getText(PROMPT_INPUT_CHARACTERS_LEFT, leftCharactersCount);\n\t\t\t\t}\n\n\t\t\t\treturn PromptInput.i18nBundle.getText(PROMPT_INPUT_CHARACTERS_EXCEEDED, Math.abs(leftCharactersCount));\n\t\t\t}\n\t\t}\n\t}\n\n\tget _maxLenght() {\n\t\treturn this.maxlength || undefined;\n\t}\n\n\tget _submitButtonDisabled() {\n\t\treturn (this.value.length <= 0) || this.disabled || this.readonly;\n\t}\n}\n\nPromptInput.define();\n\nexport default PromptInput;\n"]}
@@ -25,6 +25,7 @@ type TextAreaVersionChangeEventDetail = {
25
25
  * @constructor
26
26
  * @extends BaseTextArea
27
27
  * @experimental The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.
28
+ * Furthermore, the package supports **Horizon** themes only.
28
29
  * @since 2.16.0
29
30
  * @public
30
31
  * @slot {HTMLElement} 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.
package/dist/TextArea.js CHANGED
@@ -41,6 +41,7 @@ import TextAreaTemplate from "./TextAreaTemplate.js";
41
41
  * @constructor
42
42
  * @extends BaseTextArea
43
43
  * @experimental The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.
44
+ * Furthermore, the package supports **Horizon** themes only.
44
45
  * @since 2.16.0
45
46
  * @public
46
47
  * @slot {HTMLElement} 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.
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../src/TextArea.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAE3E,OAAO,EACN,uBAAuB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,SAAS;AACT,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAC7D,OAAO,cAAc,MAAM,0DAA0D,CAAC;AACtF,OAAO,uBAAuB,MAAM,mEAAmE,CAAC;AAExG,YAAY;AACZ,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AAMrD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA4BH,IAAM,QAAQ,gBAAd,MAAM,QAAS,SAAQ,YAAY;IAAnC;;QAWC;;;;;WAKG;QAEH,YAAO,GAAG,KAAK,CAAC;QAEhB;;;;;WAKG;QAEH,sBAAiB,GAAG,EAAE,CAAC;QAEvB;;;;;;WAMG;QAEH,mBAAc,GAAG,CAAC,CAAC;QAEnB;;;;;;;;WAQG;QAEH,kBAAa,GAAG,CAAC,CAAC;QAGlB,YAAO,GAAG,KAAK,CAAC;QA8HhB;;;;;WAKG;QACH,yBAAoB,GAAG,CAAC,CAA6C,EAAE,EAAE;YACxE,MAAM,SAAS,GAAG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AC;QACd,GAAG,EAAE,iBAAiB;QACtB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,gBAAgB;QAC1B,MAAM,EAAE;YACP,cAAc;YACd,uBAAuB;YACvB,WAAW;SACX;KACD,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,gBAAgB,CAAC;IAExB;;;;OAIG;;IACF,KAAK,CAAC,iBAAiB,CAAC;GAEnB,QAAQ,CAqNb;AAED,QAAQ,CAAC,MAAM,EAAE,CAAC;AAGlB,eAAe,QAAQ,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\n\nimport { BaseTextArea } from \"@ui5/webcomponents/dist/TextArea.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport {\n\tWRITING_ASSISTANT_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\n// Styles\nimport TextAreaCss from \"./generated/themes/TextArea.css.js\";\nimport textareaStyles from \"@ui5/webcomponents/dist/generated/themes/TextArea.css.js\";\nimport valueStateMessageStyles from \"@ui5/webcomponents/dist/generated/themes/ValueStateMessage.css.js\";\n\n// Templates\nimport TextAreaTemplate from \"./TextAreaTemplate.js\";\n\ntype TextAreaVersionChangeEventDetail = {\n\tbackwards: boolean,\n};\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-textarea` component extends the standard TextArea with Writing Assistant capabilities.\n * It provides AI-powered text generation, editing suggestions, and version management functionality.\n *\n * ### Structure\n * The `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 * @constructor\n * @extends BaseTextArea\n * @experimental The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.\n * @since 2.16.0\n * @public\n * @slot {HTMLElement} 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.\n */\n@customElement({\n\ttag: \"ui5-ai-textarea\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: TextAreaTemplate,\n\tstyles: [\n\t\ttextareaStyles,\n\t\tvalueStateMessageStyles,\n\t\tTextAreaCss,\n\t],\n})\n\n/**\n * Fired when the user clicks on version navigation buttons.\n *\n * @param {boolean} backwards - Indicates if navigation is backwards (true) or forwards (false, default).\n * @public\n */\n@event(\"version-change\")\n\n/**\n * Fired when the user requests to stop AI text generation.\n *\n * @public\n */\n@event(\"stop-generation\")\n\nclass TextArea extends BaseTextArea {\n\teventDetails!: BaseTextArea[\"eventDetails\"] & {\n\t\t\"version-change\": TextAreaVersionChangeEventDetail;\n\t\t\"stop-generation\": void;\n\t};\n\n\t// Store bound handler for proper cleanup\n\tprivate _keydownHandler?: (event: KeyboardEvent) => void;\n\tprivate _menuFocusinHandler?: () => void;\n\tprivate _menuFocusoutHandler?: (event: Event) => void;\n\n\t/**\n\t * Defines whether the `ui5-ai-textarea` is currently in a loading(processing) state.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tloading = false;\n\n\t/**\n\t * Defines the prompt description of the current action.\n\t *\n\t * @default \"\"\n\t * @public\n\t */\n\t@property()\n\tpromptDescription = \"\";\n\n\t/**\n\t * Indicates the index of the currently displayed version.\n\t *\n\t *\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tcurrentVersion = 0;\n\n\t/**\n\t * Indicates the total number of result versions available.\n\t *\n\t * Notes:\n\t * Versioning is hidden if the value is `0`\n\t *\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\ttotalVersions = 0;\n\n\t@property({ type: Boolean })\n\tfocused = false;\n\n\t@slot({ type: HTMLElement })\n\tmenu!: Array<HTMLElement>;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tstatic async onDefine() {\n\t\tTextArea.i18nBundle = await getI18nBundle(\"@ui5/webcomponents-ai\");\n\t}\n\n\t/**\n\t * Handles the click event for the \"Previous Version\" button.\n\t * Updates the current version index and syncs content.\n\t */\n\t_handlePreviousVersionClick(): void {\n\t\tthis.fireDecoratorEvent(\"version-change\", { backwards: true });\n\t}\n\n\t/**\n\t * Handles the click event for the \"Next Version\" button.\n\t * Updates the current version index and syncs content.\n\t */\n\t_handleNextVersionClick(): void {\n\t\tthis.fireDecoratorEvent(\"version-change\", { backwards: false });\n\t}\n\n\t/**\n\t * Handles the version change event from the writing assistant.\n\t */\n\t_handleVersionChange(e: CustomEvent<{ backwards: boolean }>): void {\n\t\tif (e.detail.backwards) {\n\t\t\tthis._handlePreviousVersionClick();\n\t\t} else {\n\t\t\tthis._handleNextVersionClick();\n\t\t}\n\t}\n\n\t/**\n\t * Handles keydown events for keyboard shortcuts.\n\t * @private\n\t */\n\t_handleKeydown(keyboardEvent: KeyboardEvent) {\n\t\tconst isCtrlOrCmd = keyboardEvent.ctrlKey || keyboardEvent.metaKey;\n\t\tconst isShift = keyboardEvent.shiftKey;\n\n\t\tif (isShift && keyboardEvent.key.toLowerCase() === \"f4\") {\n\t\t\tconst toolbar = this.shadowRoot?.querySelector(\"[ui5-ai-writing-assistant]\") as HTMLElement;\n\t\t\tconst aiButton = toolbar?.shadowRoot?.querySelector(\"#ai-menu-btn\") as HTMLElement;\n\n\t\t\tif (aiButton) {\n\t\t\t\taiButton.focus();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.totalVersions > 1) {\n\t\t\tif (isCtrlOrCmd && isShift && keyboardEvent.key.toLowerCase() === \"z\") {\n\t\t\t\tkeyboardEvent.preventDefault();\n\t\t\t\tthis._handlePreviousVersionClick();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isCtrlOrCmd && isShift && keyboardEvent.key.toLowerCase() === \"y\") {\n\t\t\t\tkeyboardEvent.preventDefault();\n\t\t\t\tthis._handleNextVersionClick();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Overrides the parent's onAfterRendering to add keydown handler.\n\t * @private\n\t */\n\tonAfterRendering() {\n\t\tsuper.onAfterRendering();\n\n\t\tconst textarea = this.shadowRoot?.querySelector(\"textarea\");\n\t\tif (textarea && !this._keydownHandler) {\n\t\t\tthis._keydownHandler = this._handleKeydown.bind(this);\n\t\t\ttextarea.addEventListener(\"keydown\", this._keydownHandler);\n\t\t}\n\n\t\tconst menuNodes = this.getSlottedNodes(\"menu\");\n\t\tif (menuNodes.length > 0) {\n\t\t\tconst menu = menuNodes[0];\n\t\t\tif (!this._menuFocusinHandler) {\n\t\t\t\tthis._menuFocusinHandler = () => {\n\t\t\t\t\tthis.focused = true;\n\t\t\t\t};\n\t\t\t\tmenu.addEventListener(\"focusin\", this._menuFocusinHandler);\n\t\t\t}\n\t\t\tif (!this._menuFocusoutHandler) {\n\t\t\t\tthis._menuFocusoutHandler = (evt: Event) => {\n\t\t\t\t\tconst e = evt as FocusEvent;\n\t\t\t\t\tconst relatedTarget = e.relatedTarget as HTMLElement;\n\t\t\t\t\tconst focusMovingWithinComponent = relatedTarget && this.shadowRoot?.contains(relatedTarget);\n\t\t\t\t\tconst focusStayingInMenu = relatedTarget && menu.contains(relatedTarget);\n\t\t\t\t\tif (!focusMovingWithinComponent && !focusStayingInMenu) {\n\t\t\t\t\t\tthis.focused = false;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmenu.addEventListener(\"focusout\", this._menuFocusoutHandler);\n\t\t\t}\n\t\t}\n\t}\n\n\t_onfocusin() {\n\t\tsuper._onfocusin();\n\t\tthis.focused = true;\n\t}\n\n\t_onfocusout(e: FocusEvent) {\n\t\tsuper._onfocusout(e);\n\t\tconst relatedTarget = e.relatedTarget as HTMLElement;\n\t\tconst focusMovingWithinShadowDOM = relatedTarget && this.shadowRoot?.contains(relatedTarget);\n\t\tconst menuNodes = this.getSlottedNodes(\"menu\");\n\t\tconst focusMovingToMenu = menuNodes.length > 0 && relatedTarget && (\n\t\t\tmenuNodes[0].contains(relatedTarget)\n\t\t\t|| relatedTarget === menuNodes[0]\n\t\t);\n\t\tif (!focusMovingWithinShadowDOM && !focusMovingToMenu) {\n\t\t\tthis.focused = false;\n\t\t}\n\t}\n\n\t/**\n\t * Handles the generate click event from the AI toolbar.\n\t * Opens the AI menu and sets the opener element.\n\t *\n\t * @private\n\t */\n\t_handleAIButtonClick = (e: CustomEvent<{ clickTarget?: HTMLElement }>) => {\n\t\tconst menuNodes = this.getSlottedNodes(\"menu\");\n\t\tif (menuNodes.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tif (!e.detail?.clickTarget) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst menu = menuNodes[0] as HTMLElement & { opener?: HTMLElement; open?: boolean, horizontalAlign?: string };\n\t\tif (menu && typeof menu.open !== \"undefined\") {\n\t\t\tmenu.opener = e.detail.clickTarget.shadowRoot?.querySelector(\"ui5-button\") as HTMLElement;\n\t\t\tmenu.horizontalAlign = \"End\";\n\t\t\tmenu.open = true;\n\t\t}\n\t}\n\tget _ariaLabel() {\n\t\treturn this.accessibleName || TextArea.i18nBundle.getText(WRITING_ASSISTANT_LABEL);\n\t}\n\n\t/**\n\t * Handles the stop generation event from the AI toolbar.\n\t * Fires the stop-generation event to notify listeners.\n\t *\n\t * @private\n\t */\n\thandleStopGeneration = () => {\n\t\tthis.fireDecoratorEvent(\"stop-generation\");\n\t}\n}\n\nTextArea.define();\n\nexport type { TextAreaVersionChangeEventDetail };\nexport default TextAr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;OAKG;;IACF,KAAK,CAAC,gBAAgB,CAAC;IAExB;;;;OAIG;;IACF,KAAK,CAAC,iBAAiB,CAAC;GAEnB,QAAQ,CAqNb;AAED,QAAQ,CAAC,MAAM,EAAE,CAAC;AAGlB,eAAe,QAAQ,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\n\nimport { BaseTextArea } from \"@ui5/webcomponents/dist/TextArea.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport {\n\tWRITING_ASSISTANT_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\n// Styles\nimport TextAreaCss from \"./generated/themes/TextArea.css.js\";\nimport textareaStyles from \"@ui5/webcomponents/dist/generated/themes/TextArea.css.js\";\nimport valueStateMessageStyles from \"@ui5/webcomponents/dist/generated/themes/ValueStateMessage.css.js\";\n\n// Templates\nimport TextAreaTemplate from \"./TextAreaTemplate.js\";\n\ntype TextAreaVersionChangeEventDetail = {\n\tbackwards: boolean,\n};\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-textarea` component extends the standard TextArea with Writing Assistant capabilities.\n * It provides AI-powered text generation, editing suggestions, and version management functionality.\n *\n * ### Structure\n * The `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 * @constructor\n * @extends BaseTextArea\n * @experimental The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.\n * Furthermore, the package supports **Horizon** themes only.\n * @since 2.16.0\n * @public\n * @slot {HTMLElement} 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.\n */\n@customElement({\n\ttag: \"ui5-ai-textarea\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: TextAreaTemplate,\n\tstyles: [\n\t\ttextareaStyles,\n\t\tvalueStateMessageStyles,\n\t\tTextAreaCss,\n\t],\n})\n\n/**\n * Fired when the user clicks on version navigation buttons.\n *\n * @param {boolean} backwards - Indicates if navigation is backwards (true) or forwards (false, default).\n * @public\n */\n@event(\"version-change\")\n\n/**\n * Fired when the user requests to stop AI text generation.\n *\n * @public\n */\n@event(\"stop-generation\")\n\nclass TextArea extends BaseTextArea {\n\teventDetails!: BaseTextArea[\"eventDetails\"] & {\n\t\t\"version-change\": TextAreaVersionChangeEventDetail;\n\t\t\"stop-generation\": void;\n\t};\n\n\t// Store bound handler for proper cleanup\n\tprivate _keydownHandler?: (event: KeyboardEvent) => void;\n\tprivate _menuFocusinHandler?: () => void;\n\tprivate _menuFocusoutHandler?: (event: Event) => void;\n\n\t/**\n\t * Defines whether the `ui5-ai-textarea` is currently in a loading(processing) state.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tloading = false;\n\n\t/**\n\t * Defines the prompt description of the current action.\n\t *\n\t * @default \"\"\n\t * @public\n\t */\n\t@property()\n\tpromptDescription = \"\";\n\n\t/**\n\t * Indicates the index of the currently displayed version.\n\t *\n\t *\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tcurrentVersion = 0;\n\n\t/**\n\t * Indicates the total number of result versions available.\n\t *\n\t * Notes:\n\t * Versioning is hidden if the value is `0`\n\t *\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\ttotalVersions = 0;\n\n\t@property({ type: Boolean })\n\tfocused = false;\n\n\t@slot({ type: HTMLElement })\n\tmenu!: Array<HTMLElement>;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tstatic async onDefine() {\n\t\tTextArea.i18nBundle = await getI18nBundle(\"@ui5/webcomponents-ai\");\n\t}\n\n\t/**\n\t * Handles the click event for the \"Previous Version\" button.\n\t * Updates the current version index and syncs content.\n\t */\n\t_handlePreviousVersionClick(): void {\n\t\tthis.fireDecoratorEvent(\"version-change\", { backwards: true });\n\t}\n\n\t/**\n\t * Handles the click event for the \"Next Version\" button.\n\t * Updates the current version index and syncs content.\n\t */\n\t_handleNextVersionClick(): void {\n\t\tthis.fireDecoratorEvent(\"version-change\", { backwards: false });\n\t}\n\n\t/**\n\t * Handles the version change event from the writing assistant.\n\t */\n\t_handleVersionChange(e: CustomEvent<{ backwards: boolean }>): void {\n\t\tif (e.detail.backwards) {\n\t\t\tthis._handlePreviousVersionClick();\n\t\t} else {\n\t\t\tthis._handleNextVersionClick();\n\t\t}\n\t}\n\n\t/**\n\t * Handles keydown events for keyboard shortcuts.\n\t * @private\n\t */\n\t_handleKeydown(keyboardEvent: KeyboardEvent) {\n\t\tconst isCtrlOrCmd = keyboardEvent.ctrlKey || keyboardEvent.metaKey;\n\t\tconst isShift = keyboardEvent.shiftKey;\n\n\t\tif (isShift && keyboardEvent.key.toLowerCase() === \"f4\") {\n\t\t\tconst toolbar = this.shadowRoot?.querySelector(\"[ui5-ai-writing-assistant]\") as HTMLElement;\n\t\t\tconst aiButton = toolbar?.shadowRoot?.querySelector(\"#ai-menu-btn\") as HTMLElement;\n\n\t\t\tif (aiButton) {\n\t\t\t\taiButton.focus();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.totalVersions > 1) {\n\t\t\tif (isCtrlOrCmd && isShift && keyboardEvent.key.toLowerCase() === \"z\") {\n\t\t\t\tkeyboardEvent.preventDefault();\n\t\t\t\tthis._handlePreviousVersionClick();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isCtrlOrCmd && isShift && keyboardEvent.key.toLowerCase() === \"y\") {\n\t\t\t\tkeyboardEvent.preventDefault();\n\t\t\t\tthis._handleNextVersionClick();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Overrides the parent's onAfterRendering to add keydown handler.\n\t * @private\n\t */\n\tonAfterRendering() {\n\t\tsuper.onAfterRendering();\n\n\t\tconst textarea = this.shadowRoot?.querySelector(\"textarea\");\n\t\tif (textarea && !this._keydownHandler) {\n\t\t\tthis._keydownHandler = this._handleKeydown.bind(this);\n\t\t\ttextarea.addEventListener(\"keydown\", this._keydownHandler);\n\t\t}\n\n\t\tconst menuNodes = this.getSlottedNodes(\"menu\");\n\t\tif (menuNodes.length > 0) {\n\t\t\tconst menu = menuNodes[0];\n\t\t\tif (!this._menuFocusinHandler) {\n\t\t\t\tthis._menuFocusinHandler = () => {\n\t\t\t\t\tthis.focused = true;\n\t\t\t\t};\n\t\t\t\tmenu.addEventListener(\"focusin\", this._menuFocusinHandler);\n\t\t\t}\n\t\t\tif (!this._menuFocusoutHandler) {\n\t\t\t\tthis._menuFocusoutHandler = (evt: Event) => {\n\t\t\t\t\tconst e = evt as FocusEvent;\n\t\t\t\t\tconst relatedTarget = e.relatedTarget as HTMLElement;\n\t\t\t\t\tconst focusMovingWithinComponent = relatedTarget && this.shadowRoot?.contains(relatedTarget);\n\t\t\t\t\tconst focusStayingInMenu = relatedTarget && menu.contains(relatedTarget);\n\t\t\t\t\tif (!focusMovingWithinComponent && !focusStayingInMenu) {\n\t\t\t\t\t\tthis.focused = false;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmenu.addEventListener(\"focusout\", this._menuFocusoutHandler);\n\t\t\t}\n\t\t}\n\t}\n\n\t_onfocusin() {\n\t\tsuper._onfocusin();\n\t\tthis.focused = true;\n\t}\n\n\t_onfocusout(e: FocusEvent) {\n\t\tsuper._onfocusout(e);\n\t\tconst relatedTarget = e.relatedTarget as HTMLElement;\n\t\tconst focusMovingWithinShadowDOM = relatedTarget && this.shadowRoot?.contains(relatedTarget);\n\t\tconst menuNodes = this.getSlottedNodes(\"menu\");\n\t\tconst focusMovingToMenu = menuNodes.length > 0 && relatedTarget && (\n\t\t\tmenuNodes[0].contains(relatedTarget)\n\t\t\t|| relatedTarget === menuNodes[0]\n\t\t);\n\t\tif (!focusMovingWithinShadowDOM && !focusMovingToMenu) {\n\t\t\tthis.focused = false;\n\t\t}\n\t}\n\n\t/**\n\t * Handles the generate click event from the AI toolbar.\n\t * Opens the AI menu and sets the opener element.\n\t *\n\t * @private\n\t */\n\t_handleAIButtonClick = (e: CustomEvent<{ clickTarget?: HTMLElement }>) => {\n\t\tconst menuNodes = this.getSlottedNodes(\"menu\");\n\t\tif (menuNodes.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tif (!e.detail?.clickTarget) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst menu = menuNodes[0] as HTMLElement & { opener?: HTMLElement; open?: boolean, horizontalAlign?: string };\n\t\tif (menu && typeof menu.open !== \"undefined\") {\n\t\t\tmenu.opener = e.detail.clickTarget.shadowRoot?.querySelector(\"ui5-button\") as HTMLElement;\n\t\t\tmenu.horizontalAlign = \"End\";\n\t\t\tmenu.open = true;\n\t\t}\n\t}\n\tget _ariaLabel() {\n\t\treturn this.accessibleName || TextArea.i18nBundle.getText(WRITING_ASSISTANT_LABEL);\n\t}\n\n\t/**\n\t * Handles the stop generation event from the AI toolbar.\n\t * Fires the stop-generation event to notify listeners.\n\t *\n\t * @private\n\t */\n\thandleStopGeneration = () => {\n\t\tthis.fireDecoratorEvent(\"stop-generation\");\n\t}\n}\n\nTextArea.define();\n\nexport type { TextAreaVersionChangeEventDetail };\nexport default TextArea;\n"]}
@@ -1 +1 @@
1
- :host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host .ui5-ai-button-inner{width:100%}:host{width:auto;position:relative;transition:width .18s cubic-bezier(.67,1,.95,1.3) .12s}:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-18-0-rc-3_button_base_min_width)!important;max-width:var(--_ui5-v2-18-0-rc-3_button_base_min_width)!important}:host(.ui5-ai-button-menu-to-button) .ui5-ai-button-inner::part(button),:host(.ui5-ai-button-fade-out:not([icon-only])) .ui5-ai-button-inner::part(button){justify-content:flex-start}:host([icon-only]) .ui5-ai-button-inner[_end-icon]:not([_end-icon=""])::part(button),:host([icon-only]) .ui5-ai-button-inner[_hide-arrow-button]::part(button){justify-content:flex-start;padding-inline-start:var(--_ui5-v2-18-0-rc-3_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(button){max-width:var(--_ui5-v2-18-0-rc-3_button_base_min_width)}:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-18-0-rc-3_button_base_min_width);max-width:var(--_ui5-v2-18-0-rc-3_button_base_min_width)}:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) .ui5-ai-button-text,:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(endIcon),:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(arrowButton){opacity:1;transform:translateY(0)}:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(endIcon),:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(arrowButton){display:none;transform:translateY(0);opacity:0}:host(.ui5-ai-button-fade-out) .ui5-ai-button-text{opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-out) ::part(icon){opacity:0;transform:translateY(-1rem);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-out) ::part(endIcon){opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-mid) .ui5-ai-button-text,:host(.ui5-ai-button-fade-mid) ::part(icon),:host(.ui5-ai-button-fade-mid) ::part(endIcon),:host(.ui5-ai-button-fade-mid) ::part(arrowButton){opacity:0;transform:translateY(1rem);transition:none}:host(.ui5-ai-button-fade-in) .ui5-ai-button-text{opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-in) ::part(icon){opacity:1;transform:translateY(0);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-in) ::part(endIcon){opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}
1
+ :host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host .ui5-ai-button-inner{width:100%}:host{width:auto;position:relative;transition:width .18s cubic-bezier(.67,1,.95,1.3) .12s}:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-18-0_button_base_min_width)!important;max-width:var(--_ui5-v2-18-0_button_base_min_width)!important}:host(.ui5-ai-button-menu-to-button) .ui5-ai-button-inner::part(button),:host(.ui5-ai-button-fade-out:not([icon-only])) .ui5-ai-button-inner::part(button){justify-content:flex-start}:host([icon-only]) .ui5-ai-button-inner[_end-icon]:not([_end-icon=""])::part(button),:host([icon-only]) .ui5-ai-button-inner[_hide-arrow-button]::part(button){justify-content:flex-start;padding-inline-start:var(--_ui5-v2-18-0_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(button){max-width:var(--_ui5-v2-18-0_button_base_min_width)}:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-18-0_button_base_min_width);max-width:var(--_ui5-v2-18-0_button_base_min_width)}:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) .ui5-ai-button-text,:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(endIcon),:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(arrowButton){opacity:1;transform:translateY(0)}:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(endIcon),:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(arrowButton){display:none;transform:translateY(0);opacity:0}:host(.ui5-ai-button-fade-out) .ui5-ai-button-text{opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-out) ::part(icon){opacity:0;transform:translateY(-1rem);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-out) ::part(endIcon){opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-mid) .ui5-ai-button-text,:host(.ui5-ai-button-fade-mid) ::part(icon),:host(.ui5-ai-button-fade-mid) ::part(endIcon),:host(.ui5-ai-button-fade-mid) ::part(arrowButton){opacity:0;transform:translateY(1rem);transition:none}:host(.ui5-ai-button-fade-in) .ui5-ai-button-text{opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-in) ::part(icon){opacity:1;transform:translateY(0);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-in) ::part(endIcon){opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}
@@ -1 +1 @@
1
- .ui5-ai-input-root{width:100%;height:100%;border-right:none}:host([focused]:not([opened])[_is-menu-open]) .ui5-ai-input-root:hover{border-radius:var(--_ui5-v2-18-0-rc-3_input_border_radius);box-shadow:var(--sapField_Hover_Shadow)}:host([focused]:not([opened])[_is-menu-open]) .ui5-input-focusable-element:after{border:var(--_ui5-v2-18-0-rc-3-input-border)}.ui5-input-busy-indicator{flex:1;width:100%;height:100%;position:relative;box-sizing:border-box;display:block}.ui5-ai-input-busy .ui5-ai-input-button-wrapper{background-color:inherit;border:none}.ui5-ai-input-button-wrapper{display:flex;justify-content:center;align-items:center;width:var(--_ui5-v2-18-0-rc-3_input_icon_width);min-width:var(--_ui5-v2-18-0-rc-3_input_icon_width);height:var(--_ui5-v2-18-0-rc-3_input_icon_wrapper_height);padding:0;box-sizing:border-box;border-radius:var(--_ui5-v2-18-0-rc-3_input_border_radius);cursor:pointer;border:none}.ui5-input-ai-button[hidden]{display:none}.ui5-ai-input-button-wrapper.ui5-input-button-menu-open,.ui5-ai-input-button-wrapper:active{background-color:var(--sapButton_Selected_Background);box-shadow:var(--sapField_Hover_Shadow);color:var(--sapButton_Selected_TextColor)}.ui5-ai-input-button-wrapper:not(.ui5-input-button-menu-open):not(.ui5-ai-input-loading):not(:active):hover,.ui5-ai-input-button-wrapper.ui5-ai-input-loading:hover{background-color:var(--sapButton_Hover_Background);border:1px solid var(--sapButton_Hover_BorderColor);box-shadow:inset 0 0 0 .0625rem var(--sapContent_Neutral_Shadow)}.ui5-input-button-menu-open{background-color:var(--sapButton_Selected_Background);box-shadow:var(--sapField_Hover_Shadow)}[ui5-menu-item].ui5-ai-versioning-menu-footer:hover{background-color:inherit}.ui5-ai-versioning-menu-footer::part(native-li){padding-right:.25rem}#ai-menu-btn{--_ui5-v2-18-0-rc-3_button_focused_border: none}
1
+ .ui5-ai-input-root{width:100%;height:100%;border-right:none}:host([focused]:not([opened])[_is-menu-open]) .ui5-ai-input-root:hover{border-radius:var(--_ui5-v2-18-0_input_border_radius);box-shadow:var(--sapField_Hover_Shadow)}:host([focused]:not([opened])[_is-menu-open]) .ui5-input-focusable-element:after{border:var(--_ui5-v2-18-0-input-border)}.ui5-input-busy-indicator{flex:1;width:100%;height:100%;position:relative;box-sizing:border-box;display:block}.ui5-ai-input-busy .ui5-ai-input-button-wrapper{background-color:inherit;border:none}.ui5-ai-input-button-wrapper{display:flex;justify-content:center;align-items:center;width:var(--_ui5-v2-18-0_input_icon_width);min-width:var(--_ui5-v2-18-0_input_icon_width);height:var(--_ui5-v2-18-0_input_icon_wrapper_height);padding:0;box-sizing:border-box;border-radius:var(--_ui5-v2-18-0_input_border_radius);cursor:pointer;border:none}.ui5-input-ai-button[hidden]{display:none}.ui5-ai-input-button-wrapper.ui5-input-button-menu-open,.ui5-ai-input-button-wrapper:active{background-color:var(--sapButton_Selected_Background);box-shadow:var(--sapField_Hover_Shadow);color:var(--sapButton_Selected_TextColor)}.ui5-ai-input-button-wrapper:not(.ui5-input-button-menu-open):not(.ui5-ai-input-loading):not(:active):hover,.ui5-ai-input-button-wrapper.ui5-ai-input-loading:hover{background-color:var(--sapButton_Hover_Background);border:1px solid var(--sapButton_Hover_BorderColor);box-shadow:inset 0 0 0 .0625rem var(--sapContent_Neutral_Shadow)}.ui5-input-button-menu-open{background-color:var(--sapButton_Selected_Background);box-shadow:var(--sapField_Hover_Shadow)}[ui5-menu-item].ui5-ai-versioning-menu-footer:hover{background-color:inherit}.ui5-ai-versioning-menu-footer::part(native-li){padding-right:.25rem}#ai-menu-btn{--_ui5-v2-18-0_button_focused_border: none}
@@ -1 +1 @@
1
- .ui5-ai-textarea-root{position:relative;display:flex;flex-direction:column;width:100%;height:100%}.ui5-ai-textarea-root .ui5-textarea-wrapper{display:flex;flex-direction:column;flex:1;position:relative}.ui5-ai-textarea-root [part=footer]{position:relative;width:100%;margin-top:auto;flex-shrink:0}.ui5-ai-writing-assistant-footer-bar{background:var(--_ui5-v2-18-0-rc-3_texteditor_toolbar_background, var(--sapPageFooter_Background));width:100%;box-sizing:border-box;box-shadow:none;border-bottom:none;border-top:none}.ui5-ai-writing-assistant-footer-bar--with-border{border-top:1px solid var(--sapPageFooter_BorderColor)}.ui5-ai-writing-assistant-action-label{margin-left:.5rem;color:var(--sapContent_LabelColor);font-size:var(--sapFontSmallSize)}#ai-menu-wrapper{position:relative;z-index:1000}
1
+ .ui5-ai-textarea-root{position:relative;display:flex;flex-direction:column;width:100%;height:100%}.ui5-ai-textarea-root .ui5-textarea-wrapper{display:flex;flex-direction:column;flex:1;position:relative}.ui5-ai-textarea-root [part=footer]{position:relative;width:100%;margin-top:auto;flex-shrink:0}.ui5-ai-writing-assistant-footer-bar{background:var(--_ui5-v2-18-0_texteditor_toolbar_background, var(--sapPageFooter_Background));width:100%;box-sizing:border-box;box-shadow:none;border-bottom:none;border-top:none}.ui5-ai-writing-assistant-footer-bar--with-border{border-top:1px solid var(--sapPageFooter_BorderColor)}.ui5-ai-writing-assistant-action-label{margin-left:.5rem;color:var(--sapContent_LabelColor);font-size:var(--sapFontSmallSize)}#ai-menu-wrapper{position:relative;z-index:1000}
@@ -1 +1 @@
1
- .ui5-ai-writing-assistant-footer-bar{background:var(--_ui5-v2-18-0-rc-3_texteditor_toolbar_background, var(--sapPageFooter_Background));width:100%;box-sizing:border-box;box-shadow:none;border-bottom:none;border-top:none;padding:.5rem;display:flex;align-items:center;justify-content:flex-start}.ui5-ai-writing-assistant-footer-bar--with-border{border-top:1px solid var(--sapPageFooter_BorderColor)}.ui5-ai-writing-assistant-action-label{color:var(--sapContent_LabelColor);font-size:var(--sapFontSize);font-family:"72override",var(--sapFontFamily);margin-left:.25rem}
1
+ .ui5-ai-writing-assistant-footer-bar{background:var(--_ui5-v2-18-0_texteditor_toolbar_background, var(--sapPageFooter_Background));width:100%;box-sizing:border-box;box-shadow:none;border-bottom:none;border-top:none;padding:.5rem;display:flex;align-items:center;justify-content:flex-start}.ui5-ai-writing-assistant-footer-bar--with-border{border-top:1px solid var(--sapPageFooter_BorderColor)}.ui5-ai-writing-assistant-action-label{color:var(--sapContent_LabelColor);font-size:var(--sapFontSize);font-family:"72override",var(--sapFontFamily);margin-left:.25rem}
@@ -193,7 +193,7 @@
193
193
  },
194
194
  "tagName": "ui5-ai-button",
195
195
  "customElement": true,
196
- "_ui5experimental": "The Button and ButtonState web components are availabe since 2.0 under an experimental flag and their API and behaviour are subject to change.",
196
+ "_ui5experimental": "The **@ui5/webcomponents-ai** package (including Button and ButtonState) is under active development and considered experimental. Component APIs are subject to change.\nFurthermore, the package supports **Horizon** themes only.",
197
197
  "_ui5since": "2.0.0",
198
198
  "_ui5privacy": "public"
199
199
  }
@@ -332,7 +332,7 @@
332
332
  },
333
333
  "tagName": "ui5-ai-button-state",
334
334
  "customElement": true,
335
- "_ui5experimental": "The Button and ButtonState web components are available since 2.0 under an experimental flag and their API and behaviour are subject to change.",
335
+ "_ui5experimental": "The **@ui5/webcomponents-ai** package (including ButtonState) is under active development and considered experimental. Component APIs are subject to change.\nFurthermore, the package supports **Horizon** themes only.",
336
336
  "_ui5since": "2.0.0",
337
337
  "_ui5privacy": "public",
338
338
  "_ui5abstract": true
@@ -423,12 +423,37 @@
423
423
  "name": "item-click",
424
424
  "_ui5privacy": "public",
425
425
  "type": {
426
- "text": "CustomEvent"
426
+ "text": "CustomEvent<InputItemClickEventDetail>",
427
+ "references": [
428
+ {
429
+ "name": "InputItemClickEventDetail",
430
+ "package": "@ui5/webcomponents-ai",
431
+ "module": "dist/Input.js"
432
+ }
433
+ ]
427
434
  },
428
435
  "description": "Fired when an item from the AI actions menu is clicked.",
429
436
  "_ui5Cancelable": false,
430
437
  "_ui5allowPreventDefault": false,
431
- "_ui5Bubbles": false
438
+ "_ui5Bubbles": false,
439
+ "_ui5parameters": [
440
+ {
441
+ "type": {
442
+ "text": "HTMLElement"
443
+ },
444
+ "name": "item",
445
+ "_ui5privacy": "public",
446
+ "description": "The currently clicked menu item."
447
+ },
448
+ {
449
+ "type": {
450
+ "text": "string"
451
+ },
452
+ "name": "text",
453
+ "_ui5privacy": "public",
454
+ "description": "The text of the currently clicked menu item."
455
+ }
456
+ ]
432
457
  },
433
458
  {
434
459
  "name": "stop-generation",
@@ -506,7 +531,7 @@
506
531
  },
507
532
  "tagName": "ui5-ai-input",
508
533
  "customElement": true,
509
- "_ui5experimental": "The **@ui5/webcomponents-ai** package is under active development and considered experimental. Component APIs are subject to change.",
534
+ "_ui5experimental": "The **@ui5/webcomponents-ai** package is under active development and considered experimental. Component APIs are subject to change.\nFurthermore, the package supports **Horizon** themes only.",
510
535
  "_ui5since": "2.16.0",
511
536
  "_ui5privacy": "public"
512
537
  }
@@ -820,7 +845,7 @@
820
845
  },
821
846
  "tagName": "ui5-ai-prompt-input",
822
847
  "customElement": true,
823
- "_ui5experimental": "The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.",
848
+ "_ui5experimental": "The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.\nFurthermore, the package supports **Horizon** themes only.",
824
849
  "_ui5privacy": "public"
825
850
  }
826
851
  ],
@@ -989,7 +1014,7 @@
989
1014
  },
990
1015
  "tagName": "ui5-ai-textarea",
991
1016
  "customElement": true,
992
- "_ui5experimental": "The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.",
1017
+ "_ui5experimental": "The **@ui5/webcomponents-ai** package is under development and considered experimental - components' APIs are subject to change.\nFurthermore, the package supports **Horizon** themes only.",
993
1018
  "_ui5since": "2.16.0",
994
1019
  "_ui5privacy": "public"
995
1020
  }