@progress/kendo-react-conversational-ui 11.4.0-develop.9 → 12.0.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +80 -23
  2. package/ai-prompt/AIPrompt.js +1 -1
  3. package/ai-prompt/AIPrompt.mjs +40 -38
  4. package/ai-prompt/views/AIPromptView.js +2 -2
  5. package/ai-prompt/views/AIPromptView.mjs +42 -47
  6. package/ai-prompt/views/constants.js +1 -1
  7. package/ai-prompt/views/constants.mjs +1 -1
  8. package/chat/components/Action.js +8 -0
  9. package/chat/components/Action.mjs +37 -0
  10. package/chat/components/ActionGroup.js +8 -0
  11. package/chat/components/ActionGroup.mjs +56 -0
  12. package/chat/components/Attachment.js +8 -0
  13. package/chat/components/Attachment.mjs +23 -0
  14. package/chat/components/AttachmentGroup.js +8 -0
  15. package/chat/components/AttachmentGroup.mjs +66 -0
  16. package/chat/components/Chat.js +8 -0
  17. package/chat/components/Chat.mjs +388 -0
  18. package/chat/components/ChatContext.js +8 -0
  19. package/{components/base/FocusableUponSelection.mjs → chat/components/ChatContext.mjs} +10 -10
  20. package/chat/components/ChatMessage.js +8 -0
  21. package/chat/components/ChatMessage.mjs +284 -0
  22. package/chat/components/DateMarker.js +8 -0
  23. package/chat/components/DateMarker.mjs +22 -0
  24. package/chat/components/Header.js +8 -0
  25. package/{utils.mjs → chat/components/Header.mjs} +4 -2
  26. package/chat/components/MessageGroup.js +8 -0
  27. package/chat/components/MessageGroup.mjs +88 -0
  28. package/chat/components/NewMessage.js +8 -0
  29. package/chat/components/NewMessage.mjs +264 -0
  30. package/chat/components/Notification.js +8 -0
  31. package/chat/components/Notification.mjs +24 -0
  32. package/chat/components/SuggestionsGroup.js +1 -1
  33. package/chat/components/SuggestionsGroup.mjs +39 -20
  34. package/chat/components/elements/FileBox.js +8 -0
  35. package/chat/components/elements/FileBox.mjs +69 -0
  36. package/chat/components/elements/PinnedMessage.js +8 -0
  37. package/chat/components/elements/PinnedMessage.mjs +46 -0
  38. package/chat/components/templates/HeroCard.js +8 -0
  39. package/chat/components/templates/HeroCard.mjs +26 -0
  40. package/chat/utils/fieldMapping.js +8 -0
  41. package/chat/utils/fieldMapping.mjs +79 -0
  42. package/chat/utils.js +8 -0
  43. package/chat/utils.mjs +65 -0
  44. package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
  45. package/index.d.mts +437 -165
  46. package/index.d.ts +437 -165
  47. package/index.js +1 -1
  48. package/index.mjs +34 -27
  49. package/messages/index.js +1 -1
  50. package/messages/index.mjs +38 -16
  51. package/package-metadata.js +1 -1
  52. package/package-metadata.mjs +2 -2
  53. package/package.json +7 -7
  54. package/components/Action.js +0 -8
  55. package/components/Action.mjs +0 -45
  56. package/components/ActionGroup.js +0 -8
  57. package/components/ActionGroup.mjs +0 -36
  58. package/components/Attachment.js +0 -8
  59. package/components/Attachment.mjs +0 -50
  60. package/components/AttachmentGroup.js +0 -8
  61. package/components/AttachmentGroup.mjs +0 -64
  62. package/components/Chat.js +0 -8
  63. package/components/Chat.mjs +0 -214
  64. package/components/ChatMessage.js +0 -8
  65. package/components/ChatMessage.mjs +0 -63
  66. package/components/ChatToolbar.js +0 -8
  67. package/components/ChatToolbar.mjs +0 -33
  68. package/components/DateMarker.js +0 -8
  69. package/components/DateMarker.mjs +0 -19
  70. package/components/MessageGroup.js +0 -8
  71. package/components/MessageGroup.mjs +0 -67
  72. package/components/NewMessage.js +0 -8
  73. package/components/NewMessage.mjs +0 -106
  74. package/components/base/FocusableUponSelection.js +0 -8
  75. package/components/base/SelectableItemsContainer.js +0 -8
  76. package/components/base/SelectableItemsContainer.mjs +0 -42
  77. package/components/templates/HeroCard.js +0 -8
  78. package/components/templates/HeroCard.mjs +0 -44
  79. package/utils.js +0 -8
  80. /package/{ViewItem.js → chat/ViewItem.js} +0 -0
  81. /package/{ViewItem.mjs → chat/ViewItem.mjs} +0 -0
package/README.md CHANGED
@@ -1,31 +1,88 @@
1
- [![KendoReact NPM Banner](https://raw.githubusercontent.com/telerik/kendo-react/master/images/kendoreact-github-banner.png)](https://www.telerik.com/kendo-react-ui/components/free?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat&utm_content=banner)
1
+ [![KendoReact NPM Banner](https://raw.githubusercontent.com/telerik/kendo-react/master/images/kendoreact-github-banner.png)](https://www.telerik.com/kendo-react-ui/components/free?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui&utm_content=banner)
2
2
 
3
- # KendoReact Chat Component (Conversational UI) for React
3
+ # KendoReact Conversational UI Library for React
4
4
 
5
5
  > **Important**
6
6
  >
7
- > - This package is а part of [KendoReact](https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)—an enterprise-grade UI library with 120+ free and premium components.
7
+ > - This package is а part of [KendoReact](https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—an enterprise-grade UI library with 120+ free and premium components.
8
8
  > - To use this package, you must install a license key file, whether you are on a paid license or a 30-day free trial. To receive a license key, either [purchase a license](https://www.telerik.com/kendo-react-ui/pricing) or start a [free trial](https://www.telerik.com/download-login-v2-kendo-react-ui).
9
- > - It provides premium KendoReact components and features. You will need to install a license key when adding the package to your project. For more information, please refer to the [KendoReact My License page](https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat).
10
- > - To receive a license key, you need to either [purchase a license](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat) or register for a [free trial](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat). Doing so indicates that you [accept the KendoReact License Agreement](https://www.telerik.com/purchase/license-agreement/progress-kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat).
9
+ > - It provides premium KendoReact components and features. You will need to install a license key when adding the package to your project. For more information, please refer to the [KendoReact My License page](https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui).
10
+ > - To receive a license key, you need to either [purchase a license](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui) or register for a [free trial](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui). Doing so indicates that you [accept the KendoReact License Agreement](https://www.telerik.com/purchase/license-agreement/progress-kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui).
11
11
  > - The 30-day free trial gives you access to all KendoReact components and their full functionality. Additionally, for the period of your trial, you can use our legendary technical support provided directly by the KendoReact dev team!
12
12
  >
13
- > [Start using KendoReact](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat) and speed up your development process!
13
+ > [Start using KendoReact](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui) and speed up your development process!
14
14
  >
15
15
  > If you're looking for free React components, check out [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/free).
16
16
 
17
- The [React Chat Component](https://www.telerik.com/kendo-react-ui/conversationalui), part of KendoReact, bridges the gap between the Web and the next-generation natural language applications and delivers the Chat component which allows the user to participate in chat sessions with other users or with chat bots.
17
+ The KendoReact Conversational UI library provides a set of React components—such as Chat, AIPrompt, and InlineAIPrompt—that enable you to build modern conversational experiences, including chat interfaces, AI-powered prompts, and seamless user interactions with both humans and bots.
18
18
 
19
- ## React Chat
19
+ How to start:
20
20
 
21
- Among the features which the KendoReact Chat component delivers are:
21
+ ```sh
22
+ npm i @progress/kendo-react-conversational-ui
23
+ ```
22
24
 
23
- - [Chat bot integration](https://www.telerik.com/kendo-react-ui/components/conversationalui/integrations/dialogflow/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)—The Chat provides integration options for connecting the component to chat bots which are built with Google [DialogFlow](https://dialogflow.com/), [Microsoft Bot Framework](https://dev.botframework.com/) and many others.
24
- - [Suggested actions](https://www.telerik.com/kendo-react-ui/components/conversationalui/suggested-actions/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)—The Chat messages may contain suggestions for quick actions such as preset replies.
25
- - [Message attachments](https://www.telerik.com/kendo-react-ui/components/conversationalui/attachments/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)—The Chat messages may contain attachments such as images, videos, or data.
26
- - [Message templates](https://www.telerik.com/kendo-react-ui/components/conversationalui/message-templates/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)—You can customize the Chat messages by using templates to create a unique experience for the users.
27
- - [Keyboard navigation](https://www.telerik.com/kendo-react-ui/components/conversationalui/keyboard-navigation/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)—Built-in keyboard shortcuts for usability and navigation in the component.
28
- - [Theme support](https://www.telerik.com/kendo-react-ui/components/styling/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)—The KendoReact Chat, as well as all 100+ components in the KendoReact suite, are styled in three polished themes (Bootstrap, Material, and Default) and can be further customized to match your specific design guidelines.
25
+ What's in this package:
26
+
27
+ - [React Conversational UI Components Library Features](#react-conversational-ui-components-library-features)
28
+ - [React AIPrompt Component (premium)](#react-aiprompt-component)
29
+ - [React Chat Component (premium)](#react-chat-component)
30
+ - [React InlineAIPrompt Component (premium)](#react-inlineaiprompt-component)
31
+
32
+ Additional information:
33
+
34
+ - [Support Options](#support-options)
35
+ - [Resources](#resources)
36
+ - [KendoReact Conversational UI API](https://www.telerik.com/kendo-react-ui/components/conversationalui/api)
37
+
38
+ ## React Conversational UI Components Library Features
39
+
40
+ Among the many features which the KendoReact Conversational UI components deliver are:
41
+
42
+ - **Accessibility support**—The Conversational UI components are compliant with WAI-ARIA and Section 508.
43
+ - **Keyboard navigation**—All components provide comprehensive keyboard navigation support.
44
+ - **Globalization**—The Conversational UI components come with globalization features that allow you to create applications that can be used all over the world.
45
+ - [**Theme support**](https://www.telerik.com/kendo-react-ui/components/styling/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—The KendoReact Conversational UI components, as well as all 120+ components in the KendoReact suite, are styled in three polished themes (Bootstrap, Material, and Default) and can be further customized to match your specific design guidelines.
46
+
47
+ ## React AIPrompt Component
48
+
49
+ > This is a KendoReact **premium component** and requires a commercial license or an active trial license.
50
+
51
+ [The KendoReact AIPrompt component](https://www.telerik.com/kendo-react-ui/components/conversationalui/ai-prompt?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui) enables you to add AI-driven prompt capabilities to your applications. It is designed to facilitate user interactions with AI models, allowing for dynamic suggestions, completions, or contextual assistance. The component can be integrated with various AI services and customized to fit your application's needs, supporting features like streaming responses, custom views, and prompt commands.
52
+
53
+ Key features include:
54
+
55
+ - [**Suggestions**](https://www.telerik.com/kendo-react-ui/components/conversationalui/ai-prompt/suggestions/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Create custom prompt suggestions to guide user interactions.
56
+ - [**Streaming responses**](https://www.telerik.com/kendo-react-ui/components/conversationalui/ai-prompt/streaming/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Display AI responses progressively as they are generated in real-time.
57
+ - [**Custom commands**](https://www.telerik.com/kendo-react-ui/components/conversationalui/ai-prompt/commands/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Define custom prompt commands for specialized AI interactions.
58
+ - [**Customization options**](https://www.telerik.com/kendo-react-ui/components/conversationalui/ai-prompt/customization/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Customize component appearance and behavior to match your application needs.
59
+ - [**Events support**](https://www.telerik.com/kendo-react-ui/components/conversationalui/ai-prompt/events/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Handle various user interactions and AI response events.
60
+
61
+ ## React Chat Component
62
+
63
+ > This is a KendoReact **premium component** and requires a commercial license or an active trial license.
64
+
65
+ [The KendoReact Chat component](https://www.telerik.com/kendo-react-ui/components/conversationalui/chat?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui) bridges the gap between the Web and the next-generation natural language applications and delivers a Chat component which allows the user to participate in chat sessions with other users or with chat bots. The component provides integration options for connecting to chat bots built with Google DialogFlow, Microsoft Bot Framework, and many others.
66
+
67
+ Key features include:
68
+
69
+ - [**Data binding**](https://www.telerik.com/kendo-react-ui/components/conversationalui/chat/data-binding/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Bind the message list to streaming data from remote services and automated responses.
70
+ - [**Suggested actions**](https://www.telerik.com/kendo-react-ui/components/conversationalui/chat/suggested-actions/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Display quick action buttons like preset replies for enhanced user experience.
71
+ - [**Message attachments**](https://www.telerik.com/kendo-react-ui/components/conversationalui/chat/attachments/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Support for attaching images, videos, or data to chat messages.
72
+ - [**Message templates**](https://www.telerik.com/kendo-react-ui/components/conversationalui/chat/message-templates/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Customize the appearance of chat messages using templates.
73
+ - [**Bot integrations**](https://www.telerik.com/kendo-react-ui/components/conversationalui/chat/integrations/dialogflow/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Integration with Google DialogFlow, Microsoft Bot Framework, and other chatbot services.
74
+
75
+ ## React InlineAIPrompt Component
76
+
77
+ > This is a KendoReact **premium component** and requires a commercial license or an active trial license.
78
+
79
+ [The KendoReact InlineAIPrompt component](https://www.telerik.com/kendo-react-ui/components/conversationalui/inline-ai-prompt?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui) allows you to embed AI prompts seamlessly within chat messages or conversational flows. This enables users to interact with AI suggestions or actions directly in the context of their ongoing conversation, enhancing the user experience and streamlining workflows. The component can be integrated within existing chat interfaces to provide contextual AI assistance.
80
+
81
+ Key features include:
82
+
83
+ - [**Commands**](https://www.telerik.com/kendo-react-ui/components/conversationalui/inline-ai-prompt/commands/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Create custom commands and output actions for specialized AI interactions.
84
+ - [**Customization**](https://www.telerik.com/kendo-react-ui/components/conversationalui/inline-ai-prompt/customization/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)—Customize components to fit your application's specific requirements.
85
+ - **Streaming support**—Real-time AI response streaming for immediate feedback.
29
86
 
30
87
  ## Using for Free vs Commercial License
31
88
 
@@ -53,15 +110,15 @@ For any issues you might encounter while working with the KendoReact Chat, use a
53
110
 
54
111
  ## Resources
55
112
 
56
- - [Getting Started with KendoReact](https://www.telerik.com/kendo-react-ui/components/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)
113
+ - [Getting Started with KendoReact](https://www.telerik.com/kendo-react-ui/components/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)
57
114
  - [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/free)
58
- - [Get Started with KendoReact Chat](https://www.telerik.com/kendo-react-ui/components/conversationalui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)
59
- - [API Reference of the KendoReact Chat](https://www.telerik.com/kendo-react-ui/components/conversationalui/api/ChatProps/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)
60
- - [KendoReact Roadmap](https://www.telerik.com/support/whats-new/kendo-react-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)
61
- - [Blogs](https://www.telerik.com/blogs/tag/kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)
62
- - [Demos, documentation, and component reference](https://www.telerik.com/kendo-react-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)
63
- - [KendoReact pricing and licensing](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)
64
- - [Changelog](https://www.telerik.com/kendo-react-ui/components/changelogs/ui-for-react/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-chat)
115
+ - [Get Started with KendoReact Conversational UI](https://www.telerik.com/kendo-react-ui/components/conversationalui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)
116
+ - [API Reference of the KendoReact Conversational UI](https://www.telerik.com/kendo-react-ui/components/conversationalui/api/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)
117
+ - [KendoReact Roadmap](https://www.telerik.com/support/whats-new/kendo-react-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)
118
+ - [Blogs](https://www.telerik.com/blogs/tag/kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)
119
+ - [Demos, documentation, and component reference](https://www.telerik.com/kendo-react-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)
120
+ - [KendoReact pricing and licensing](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)
121
+ - [Changelog](https://www.telerik.com/kendo-react-ui/components/changelogs/ui-for-react/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui)
65
122
 
66
123
  High-level component overview pages
67
124
 
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),M=require("./AIPromptHeader.js"),c=require("./views/constants.js"),E=require("./AIPromptContext.js"),t=require("@progress/kendo-react-common"),n=require("../package-metadata.js"),b=s=>{const i=!t.validatePackage(n.packageMetadata,{component:"AIPrompt"}),m=t.getLicenseMessage(n.packageMetadata),{activeView:a,toolbarItems:l,children:p,onActiveViewChange:o,onPromptRequest:u,onCommandExecute:d,style:g,dir:v,className:P,streaming:w,loading:k,onCancel:A,...I}=s,S=l||[c.promptViewDefaults,c.outputViewDefaults],[q,C]=e.useState({activeView:a}),r={...q,activeView:a,streaming:w,loading:k,onCancel:A,onActiveViewChange:o,onPromptRequest:u,onCommandExecute:d},V=h=>{C(h)};return e.createElement(E.AIPromptContext.Provider,{value:[r,V]},e.createElement("div",{className:t.classNames("k-prompt",P),style:g,dir:v,...I},e.createElement(M.PromptHeader,{activeView:r.activeView,toolbarItems:S,activeViewChange:o}),p,i&&e.createElement(t.WatermarkOverlay,{message:m})))};exports.AIPrompt=b;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),E=require("./AIPromptHeader.js"),r=require("./views/constants.js"),b=require("./AIPromptContext.js"),t=require("@progress/kendo-react-common"),n=require("../package-metadata.js"),x=i=>{const m=!t.validatePackage(n.packageMetadata,{component:"AIPrompt"}),l=t.getLicenseMessage(n.packageMetadata),{activeView:o,toolbarItems:p,children:u,onActiveViewChange:c,onPromptRequest:d,onCommandExecute:g,style:v,dir:P,className:w,streaming:k,loading:A,onCancel:I,suggestionsView:a,...S}=i,q=p||[r.promptViewDefaults,r.outputViewDefaults],[C,V]=e.useState({activeView:o}),s={...C,activeView:o,streaming:k,loading:A,suggestionsView:a!=null?a:"classic",onCancel:I,onActiveViewChange:c,onPromptRequest:d,onCommandExecute:g},h=M=>{V(M)};return e.createElement(b.AIPromptContext.Provider,{value:[s,h]},e.createElement("div",{className:t.classNames("k-prompt",w),style:v,dir:P,...S},e.createElement(E.PromptHeader,{activeView:s.activeView,toolbarItems:q,activeViewChange:c}),u,m&&e.createElement(t.WatermarkOverlay,{message:l})))};exports.AIPrompt=x;
@@ -6,47 +6,49 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import e from "react";
9
- import { PromptHeader as C } from "./AIPromptHeader.mjs";
10
- import { promptViewDefaults as E, outputViewDefaults as I } from "./views/constants.mjs";
11
- import { AIPromptContext as x } from "./AIPromptContext.mjs";
12
- import { validatePackage as L, getLicenseMessage as M, classNames as N, WatermarkOverlay as b } from "@progress/kendo-react-common";
13
- import { packageMetadata as r } from "../package-metadata.mjs";
14
- const H = (m) => {
15
- const s = !L(r, { component: "AIPrompt" }), c = M(r), {
16
- activeView: t,
17
- toolbarItems: n,
18
- children: i,
19
- onActiveViewChange: a,
20
- onPromptRequest: l,
21
- onCommandExecute: p,
22
- style: d,
23
- dir: g,
24
- className: u,
25
- streaming: v,
26
- loading: f,
27
- onCancel: w,
28
- ...P
29
- } = m, V = n || [E, I], [h, S] = e.useState({ activeView: t }), o = {
30
- ...h,
31
- activeView: t,
32
- streaming: v,
33
- loading: f,
34
- onCancel: w,
35
- onActiveViewChange: a,
36
- onPromptRequest: l,
37
- onCommandExecute: p
38
- }, k = (A) => {
39
- S(A);
9
+ import { PromptHeader as E } from "./AIPromptHeader.mjs";
10
+ import { promptViewDefaults as I, outputViewDefaults as x } from "./views/constants.mjs";
11
+ import { AIPromptContext as L } from "./AIPromptContext.mjs";
12
+ import { validatePackage as M, getLicenseMessage as N, classNames as b, WatermarkOverlay as y } from "@progress/kendo-react-common";
13
+ import { packageMetadata as s } from "../package-metadata.mjs";
14
+ const O = (c) => {
15
+ const m = !M(s, { component: "AIPrompt" }), n = N(s), {
16
+ activeView: a,
17
+ toolbarItems: i,
18
+ children: l,
19
+ onActiveViewChange: o,
20
+ onPromptRequest: p,
21
+ onCommandExecute: d,
22
+ style: g,
23
+ dir: u,
24
+ className: v,
25
+ streaming: f,
26
+ loading: w,
27
+ onCancel: P,
28
+ suggestionsView: t,
29
+ ...V
30
+ } = c, h = i || [I, x], [S, k] = e.useState({ activeView: a }), r = {
31
+ ...S,
32
+ activeView: a,
33
+ streaming: f,
34
+ loading: w,
35
+ suggestionsView: t != null ? t : "classic",
36
+ onCancel: P,
37
+ onActiveViewChange: o,
38
+ onPromptRequest: p,
39
+ onCommandExecute: d
40
+ }, A = (C) => {
41
+ k(C);
40
42
  };
41
- return /* @__PURE__ */ e.createElement(x.Provider, { value: [o, k] }, /* @__PURE__ */ e.createElement("div", { className: N("k-prompt", u), style: d, dir: g, ...P }, /* @__PURE__ */ e.createElement(
42
- C,
43
+ return /* @__PURE__ */ e.createElement(L.Provider, { value: [r, A] }, /* @__PURE__ */ e.createElement("div", { className: b("k-prompt", v), style: g, dir: u, ...V }, /* @__PURE__ */ e.createElement(
44
+ E,
43
45
  {
44
- activeView: o.activeView,
45
- toolbarItems: V,
46
- activeViewChange: a
46
+ activeView: r.activeView,
47
+ toolbarItems: h,
48
+ activeViewChange: o
47
49
  }
48
- ), i, s && /* @__PURE__ */ e.createElement(b, { message: c })));
50
+ ), l, m && /* @__PURE__ */ e.createElement(y, { message: n })));
49
51
  };
50
52
  export {
51
- H as AIPrompt
53
+ O as AIPrompt
52
54
  };
@@ -5,5 +5,5 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),y=require("../AIPromptContent.js"),j=require("../AIPromptFooter.js"),P=require("@progress/kendo-react-buttons"),h=require("@progress/kendo-react-inputs"),G=require("@progress/kendo-svg-icons"),x=require("@progress/kendo-react-common"),O=require("./AIPromptViewRender.js"),F=require("../AIPromptExpander.js"),M=require("../AIPromptContext.js"),z=require("../../chat/components/SuggestionsGroup.js"),W=require("./constants.js"),D=A=>{const{promptInput:I=h.TextArea,generateButton:f=P.Button,enableSpeechToText:n=!1,promptValue:S,promptSuggestions:a}=A,[r,s]=e.useState(S||""),[c]=M.useAIPromptContext(),[C,i]=x.useCustomComponent(f),[q,p]=x.useCustomComponent(I),T=()=>{c.onPromptRequest&&c.onPromptRequest.call(null,r),s("")},R=t=>{s(t)},k=t=>{s(t.target.value)},E={title:"Generate",children:"Generate",svgIcon:G.sparklesIcon},b={placeholder:"Ask or generate content with AI ...",rows:2},m=Object.keys(i).length>0?i:E,V=Object.keys(p).length>0?p:b,d=t=>{const{isFinal:o,alternatives:g}=t;if(o&&g.length>0){const v=g[0].transcript,w=(()=>{const l=r,B=l&&!l.endsWith(" ")&&!l.endsWith(`
9
- `);return l+(B?" ":"")+v})();s(w)}};let u;return n&&(typeof n=="object"?u={...n,onResult:n.onResult||d}:u={onResult:d}),e.createElement(O.AIPromptViewRender,{name:W.promptViewDefaults.name},e.createElement(y.AIPromptContent,{streaming:c.streaming,onCancel:c.onCancel},e.createElement(q,{value:r,className:"!k-flex-col",suffix:n?e.createElement(h.InputSuffix,{orientation:"horizontal"},e.createElement(P.SpeechToTextButton,{fillMode:"flat",...u})):void 0,onChange:k,...V}),a&&a.length>0&&e.createElement(F.AIPromptExpander,{id:"prompt-suggestions",title:"Prompt Suggestions"},e.createElement(z.SuggestionGroup,{suggestions:a.map((t,o)=>({id:o,text:t,description:t})),onSuggestionClick:(t,o)=>{R(o.text)}}))),e.createElement(j.AIPromptFooter,null,e.createElement(C,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:T,disabled:!r.trim(),...m},m.children)))};exports.AIPromptView=D;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),y=require("../AIPromptContent.js"),j=require("../AIPromptFooter.js"),h=require("@progress/kendo-react-buttons"),i=require("@progress/kendo-react-inputs"),F=require("@progress/kendo-svg-icons"),I=require("@progress/kendo-react-common"),G=require("./AIPromptViewRender.js"),O=require("../AIPromptExpander.js"),z=require("../AIPromptContext.js"),M=require("../../chat/components/SuggestionsGroup.js"),W=require("./constants.js"),D=x=>{const{promptInput:A=i.TextArea,generateButton:f=h.Button,enableSpeechToText:n=!1,promptValue:S,promptSuggestions:a}=x,[r,s]=e.useState(S||""),[o]=z.useAIPromptContext(),[C,p]=I.useCustomComponent(f),[q,m]=I.useCustomComponent(A),E=()=>{o.onPromptRequest&&o.onPromptRequest.call(null,r),s("")},T=t=>{s(t)},R=t=>{s(t.target.value)},k={title:"Generate",children:"Generate",svgIcon:F.sparklesIcon},V={placeholder:"Ask or generate content with AI ...",rows:2},g=Object.keys(p).length>0?p:k,w=Object.keys(m).length>0?m:V,d=t=>{const{isFinal:u,alternatives:P}=t;if(u&&P.length>0){const b=P[0].transcript,v=(()=>{const c=r,B=c&&!c.endsWith(" ")&&!c.endsWith(`
9
+ `);return c+(B?" ":"")+b})();s(v)}};let l;return n&&(typeof n=="object"?l={...n,onResult:n.onResult||d}:l={onResult:d}),e.createElement(G.AIPromptViewRender,{name:W.promptViewDefaults.name},e.createElement(y.AIPromptContent,{streaming:o.streaming,onCancel:o.onCancel},e.createElement(q,{value:r,className:"!k-flex-col",suffix:n?e.createElement(e.Fragment,null,e.createElement(i.InputSeparator,{orientation:"horizontal"}),e.createElement(i.InputSuffix,{orientation:"horizontal"},e.createElement(h.SpeechToTextButton,{fillMode:"flat",...l}))):void 0,onChange:R,...w}),a&&a.length>0&&e.createElement(O.AIPromptExpander,{title:"Prompt Suggestions"},e.createElement(M.SuggestionGroup,{suggestionsView:o.suggestionsView,suggestions:a.map((t,u)=>({id:u,text:t,description:t})),onSuggestionClick:t=>{T(t.text)}}))),e.createElement(j.AIPromptFooter,null,e.createElement(C,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:E,disabled:!r.trim(),...g},g.children)))};exports.AIPromptView=D;
@@ -6,46 +6,46 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import e from "react";
9
- import { AIPromptContent as B } from "../AIPromptContent.mjs";
9
+ import { AIPromptContent as v } from "../AIPromptContent.mjs";
10
10
  import { AIPromptFooter as y } from "../AIPromptFooter.mjs";
11
11
  import { SpeechToTextButton as j, Button as q } from "@progress/kendo-react-buttons";
12
- import { InputSuffix as G, TextArea as O } from "@progress/kendo-react-inputs";
13
- import { sparklesIcon as _ } from "@progress/kendo-svg-icons";
14
- import { useCustomComponent as g } from "@progress/kendo-react-common";
15
- import { AIPromptViewRender as z } from "./AIPromptViewRender.mjs";
16
- import { AIPromptExpander as F } from "../AIPromptExpander.mjs";
17
- import { useAIPromptContext as M } from "../AIPromptContext.mjs";
18
- import { SuggestionGroup as W } from "../../chat/components/SuggestionsGroup.mjs";
19
- import { promptViewDefaults as $ } from "./constants.mjs";
20
- const te = (h) => {
12
+ import { InputSeparator as z, InputSuffix as F, TextArea as G } from "@progress/kendo-react-inputs";
13
+ import { sparklesIcon as O } from "@progress/kendo-svg-icons";
14
+ import { useCustomComponent as d } from "@progress/kendo-react-common";
15
+ import { AIPromptViewRender as M } from "./AIPromptViewRender.mjs";
16
+ import { AIPromptExpander as W } from "../AIPromptExpander.mjs";
17
+ import { useAIPromptContext as _ } from "../AIPromptContext.mjs";
18
+ import { SuggestionGroup as $ } from "../../chat/components/SuggestionsGroup.mjs";
19
+ import { promptViewDefaults as D } from "./constants.mjs";
20
+ const oe = (h) => {
21
21
  const {
22
- promptInput: x = O,
22
+ promptInput: x = G,
23
23
  generateButton: P = q,
24
24
  enableSpeechToText: o = !1,
25
- promptValue: A,
26
- promptSuggestions: m
27
- } = h, [r, s] = e.useState(A || ""), [l] = M(), [S, p] = g(P), [T, c] = g(x), C = () => {
28
- l.onPromptRequest && l.onPromptRequest.call(null, r), s("");
29
- }, I = (t) => {
25
+ promptValue: S,
26
+ promptSuggestions: a
27
+ } = h, [r, s] = e.useState(S || ""), [n] = _(), [A, c] = d(P), [E, p] = d(x), I = () => {
28
+ n.onPromptRequest && n.onPromptRequest.call(null, r), s("");
29
+ }, T = (t) => {
30
30
  s(t);
31
- }, E = (t) => {
31
+ }, C = (t) => {
32
32
  s(t.target.value);
33
- }, R = {
33
+ }, V = {
34
34
  title: "Generate",
35
35
  children: "Generate",
36
- svgIcon: _
37
- }, b = {
36
+ svgIcon: O
37
+ }, w = {
38
38
  placeholder: "Ask or generate content with AI ...",
39
39
  rows: 2
40
- }, u = Object.keys(p).length > 0 ? p : R, k = Object.keys(c).length > 0 ? c : b, f = (t) => {
41
- const { isFinal: n, alternatives: d } = t;
42
- if (n && d.length > 0) {
43
- const V = d[0].transcript, v = (() => {
44
- const a = r, w = a && !a.endsWith(" ") && !a.endsWith(`
40
+ }, u = Object.keys(c).length > 0 ? c : V, R = Object.keys(p).length > 0 ? p : w, f = (t) => {
41
+ const { isFinal: m, alternatives: g } = t;
42
+ if (m && g.length > 0) {
43
+ const b = g[0].transcript, k = (() => {
44
+ const l = r, B = l && !l.endsWith(" ") && !l.endsWith(`
45
45
  `);
46
- return a + (w ? " " : "") + V;
46
+ return l + (B ? " " : "") + b;
47
47
  })();
48
- s(v);
48
+ s(k);
49
49
  }
50
50
  };
51
51
  let i;
@@ -54,41 +54,36 @@ const te = (h) => {
54
54
  onResult: o.onResult || f
55
55
  } : i = {
56
56
  onResult: f
57
- }), /* @__PURE__ */ e.createElement(z, { name: $.name }, /* @__PURE__ */ e.createElement(B, { streaming: l.streaming, onCancel: l.onCancel }, /* @__PURE__ */ e.createElement(
58
- T,
57
+ }), /* @__PURE__ */ e.createElement(M, { name: D.name }, /* @__PURE__ */ e.createElement(v, { streaming: n.streaming, onCancel: n.onCancel }, /* @__PURE__ */ e.createElement(
58
+ E,
59
59
  {
60
60
  value: r,
61
61
  className: "!k-flex-col",
62
- suffix: o ? /* @__PURE__ */ e.createElement(G, { orientation: "horizontal" }, /* @__PURE__ */ e.createElement(
63
- j,
64
- {
65
- fillMode: "flat",
66
- ...i
67
- }
68
- )) : void 0,
69
- onChange: E,
70
- ...k
62
+ suffix: o ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(z, { orientation: "horizontal" }), /* @__PURE__ */ e.createElement(F, { orientation: "horizontal" }, /* @__PURE__ */ e.createElement(j, { fillMode: "flat", ...i }))) : void 0,
63
+ onChange: C,
64
+ ...R
71
65
  }
72
- ), m && m.length > 0 && /* @__PURE__ */ e.createElement(F, { id: "prompt-suggestions", title: "Prompt Suggestions" }, /* @__PURE__ */ e.createElement(
73
- W,
66
+ ), a && a.length > 0 && /* @__PURE__ */ e.createElement(W, { title: "Prompt Suggestions" }, /* @__PURE__ */ e.createElement(
67
+ $,
74
68
  {
75
- suggestions: m.map((t, n) => ({
76
- id: n,
69
+ suggestionsView: n.suggestionsView,
70
+ suggestions: a.map((t, m) => ({
71
+ id: m,
77
72
  text: t,
78
73
  description: t
79
74
  })),
80
- onSuggestionClick: (t, n) => {
81
- I(n.text);
75
+ onSuggestionClick: (t) => {
76
+ T(t.text);
82
77
  }
83
78
  }
84
79
  ))), /* @__PURE__ */ e.createElement(y, null, /* @__PURE__ */ e.createElement(
85
- S,
80
+ A,
86
81
  {
87
82
  themeColor: "primary",
88
83
  fillMode: "solid",
89
84
  rounded: "full",
90
85
  size: "medium",
91
- onClick: C,
86
+ onClick: I,
92
87
  disabled: !r.trim(),
93
88
  ...u
94
89
  },
@@ -96,5 +91,5 @@ const te = (h) => {
96
91
  )));
97
92
  };
98
93
  export {
99
- te as AIPromptView
94
+ oe as AIPromptView
100
95
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@progress/kendo-svg-icons"),e={name:"Output view",buttonText:"Output",buttonIcon:t.commentIcon},o={name:"Commands view",buttonIcon:t.moreHorizontalIcon},n={name:"prompt-view",buttonText:"Ask AI",buttonIcon:t.sparklesIcon};exports.commandsViewDefaults=o;exports.outputViewDefaults=e;exports.promptViewDefaults=n;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@progress/kendo-svg-icons"),e={name:"Output view",buttonText:"Output",buttonIcon:t.commentIcon},o={name:"Commands view",buttonIcon:t.moreHorizontalIcon},n={name:"Prompt view",buttonText:"Ask AI",buttonIcon:t.sparklesIcon};exports.commandsViewDefaults=o;exports.outputViewDefaults=e;exports.promptViewDefaults=n;
@@ -14,7 +14,7 @@ const m = {
14
14
  name: "Commands view",
15
15
  buttonIcon: o
16
16
  }, c = {
17
- name: "prompt-view",
17
+ name: "Prompt view",
18
18
  buttonText: "Ask AI",
19
19
  buttonIcon: n
20
20
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const i=require("react"),a=require("@progress/kendo-react-common");function f(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>c[t]})}}return e.default=c,Object.freeze(e)}const o=f(i),m=c=>{const{item:e,onActionExecute:t,selected:n}=c,r=o.useRef(null);o.useEffect(()=>{n&&r.current&&r.current.focus()},[n]);const l=o.useCallback(s=>{(s.keyCode===a.Keys.enter||s.key===" ")&&(s.preventDefault(),t(e,s))},[t,e]),u=o.useCallback(()=>a.classNames("k-suggestion k-suggestion-primary",{"k-selected":n},{"k-focus":n}),[n]);return o.createElement("span",{role:"button",className:u(),onClick:s=>t(e,s),ref:r,onKeyDown:l,tabIndex:0,"aria-label":e.title||e.value},e.title||e.value)};module.exports=m;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as a from "react";
9
+ import { Keys as u, classNames as i } from "@progress/kendo-react-common";
10
+ const m = (c) => {
11
+ const { item: e, onActionExecute: l, selected: s } = c, o = a.useRef(null);
12
+ a.useEffect(() => {
13
+ s && o.current && o.current.focus();
14
+ }, [s]);
15
+ const n = a.useCallback(
16
+ (t) => {
17
+ (t.keyCode === u.enter || t.key === " ") && (t.preventDefault(), l(e, t));
18
+ },
19
+ [l, e]
20
+ ), r = a.useCallback(() => i("k-suggestion k-suggestion-primary", { "k-selected": s }, { "k-focus": s }), [s]);
21
+ return /* @__PURE__ */ a.createElement(
22
+ "span",
23
+ {
24
+ role: "button",
25
+ className: r(),
26
+ onClick: (t) => l(e, t),
27
+ ref: o,
28
+ onKeyDown: n,
29
+ tabIndex: 0,
30
+ "aria-label": e.title || e.value
31
+ },
32
+ e.title || e.value
33
+ );
34
+ };
35
+ export {
36
+ m as default
37
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const y=require("react"),f=require("@progress/kendo-react-common"),I=require("./Action.js");function x(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>s[a]})}}return t.default=s,Object.freeze(t)}const o=x(y),S=s=>{var m;const{group:t,onActionExecute:a,selected:r,onRequestSelection:d}=s,[e,u]=o.useState(null);o.useEffect(()=>{!r&&e!==null?u(null):r&&e===null&&u(0)},[r,e]);const g=o.useCallback(()=>t.actions?t.actions.length-1:-1,[t.actions]),i=o.useCallback((n,c=0)=>{let l=null;return n?e===null?l=c:e<g()&&(l=e+1):e===null?l=0:e>0&&(l=e-1),l!==null&&u(l),l},[e,g]),p=o.useCallback(()=>{d(t.selectionIndex)},[d,t.selectionIndex]),b=o.useCallback(n=>{let c=null;const l=f.Keys.left,k=f.Keys.right;n.keyCode===l?c=i(!1):n.keyCode===k&&(c=i(!0)),c!==null&&(n.preventDefault(),n.stopPropagation())},[i]),C=o.useCallback(()=>f.classNames("k-suggestion-group"),[]);return o.createElement("div",{className:C(),onClick:p,onKeyDown:b,role:"toolbar",tabIndex:0,"aria-label":"Action group"},(m=t.actions)==null?void 0:m.map((n,c)=>o.createElement(I,{item:n,onActionExecute:a,selected:c===e,key:n.value})))};module.exports=S;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as n from "react";
9
+ import { Keys as d, classNames as x } from "@progress/kendo-react-common";
10
+ import b from "./Action.mjs";
11
+ const A = (m) => {
12
+ var f;
13
+ const { group: s, onActionExecute: p, selected: c, onRequestSelection: u } = m, [e, a] = n.useState(null);
14
+ n.useEffect(() => {
15
+ !c && e !== null ? a(null) : c && e === null && a(0);
16
+ }, [c, e]);
17
+ const r = n.useCallback(() => s.actions ? s.actions.length - 1 : -1, [s.actions]), i = n.useCallback(
18
+ (t, o = 0) => {
19
+ let l = null;
20
+ return t ? e === null ? l = o : e < r() && (l = e + 1) : e === null ? l = 0 : e > 0 && (l = e - 1), l !== null && a(l), l;
21
+ },
22
+ [e, r]
23
+ ), C = n.useCallback(() => {
24
+ u(s.selectionIndex);
25
+ }, [u, s.selectionIndex]), g = n.useCallback(
26
+ (t) => {
27
+ let o = null;
28
+ const l = d.left, I = d.right;
29
+ t.keyCode === l ? o = i(!1) : t.keyCode === I && (o = i(!0)), o !== null && (t.preventDefault(), t.stopPropagation());
30
+ },
31
+ [i]
32
+ ), k = n.useCallback(() => x("k-suggestion-group"), []);
33
+ return /* @__PURE__ */ n.createElement(
34
+ "div",
35
+ {
36
+ className: k(),
37
+ onClick: C,
38
+ onKeyDown: g,
39
+ role: "toolbar",
40
+ tabIndex: 0,
41
+ "aria-label": "Action group"
42
+ },
43
+ (f = s.actions) == null ? void 0 : f.map((t, o) => /* @__PURE__ */ n.createElement(
44
+ b,
45
+ {
46
+ item: t,
47
+ onActionExecute: p,
48
+ selected: o === e,
49
+ key: t.value
50
+ }
51
+ ))
52
+ );
53
+ };
54
+ export {
55
+ A as default
56
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const f=require("react"),k=require("@progress/kendo-react-common");function g(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const l=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(e,c,l.get?l:{enumerable:!0,get:()=>n[c]})}}return e.default=n,Object.freeze(e)}const t=g(f),p=n=>{const{item:e,template:c,tabbable:l,onClick:s,selected:a}=n,r=t.useRef(null);t.useEffect(()=>{a&&r.current&&r.current.focus()},[a]);const o=t.useCallback(()=>{if(l!==void 0)return l?0:-1},[l]),u=t.useCallback(()=>k.classNames({"k-selected":a},{"k-focus":a}),[a]),i=t.useCallback(()=>e.title?t.createElement("h5",{className:"k-card-title"},e.title):null,[e.title]),m=t.useCallback(()=>e.subtitle?t.createElement("h6",{className:"k-card-subtitle"},e.subtitle):null,[e.subtitle]),b=t.useCallback(()=>e.contentType.indexOf("image/")===0?t.createElement("img",{src:e.content,alt:e.title||"Attachment"}):e.content,[e.contentType,e.content,e.title]),d=c;return t.createElement("div",{className:u(),tabIndex:o(),onClick:s,ref:r},c?t.createElement(d,{item:e}):t.createElement("div",{className:"k-card"},t.createElement("div",{className:"k-card-body"},i(),m(),b())))};module.exports=p;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as t from "react";
9
+ import { classNames as f } from "@progress/kendo-react-common";
10
+ const C = (s) => {
11
+ const { item: e, template: c, tabbable: a, onClick: r, selected: l } = s, n = t.useRef(null);
12
+ t.useEffect(() => {
13
+ l && n.current && n.current.focus();
14
+ }, [l]);
15
+ const i = t.useCallback(() => {
16
+ if (a !== void 0)
17
+ return a ? 0 : -1;
18
+ }, [a]), u = t.useCallback(() => f({ "k-selected": l }, { "k-focus": l }), [l]), o = t.useCallback(() => e.title ? /* @__PURE__ */ t.createElement("h5", { className: "k-card-title" }, e.title) : null, [e.title]), m = t.useCallback(() => e.subtitle ? /* @__PURE__ */ t.createElement("h6", { className: "k-card-subtitle" }, e.subtitle) : null, [e.subtitle]), b = t.useCallback(() => e.contentType.indexOf("image/") === 0 ? /* @__PURE__ */ t.createElement("img", { src: e.content, alt: e.title || "Attachment" }) : e.content, [e.contentType, e.content, e.title]), d = c;
19
+ return /* @__PURE__ */ t.createElement("div", { className: u(), tabIndex: i(), onClick: r, ref: n }, c ? /* @__PURE__ */ t.createElement(d, { item: e }) : /* @__PURE__ */ t.createElement("div", { className: "k-card" }, /* @__PURE__ */ t.createElement("div", { className: "k-card-body" }, o(), m(), b())));
20
+ };
21
+ export {
22
+ C as default
23
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const B=require("react"),m=require("@progress/kendo-react-common"),v=require("@progress/kendo-svg-icons"),D=require("./Attachment.js"),S=require("@progress/kendo-react-buttons");function x(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const u=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(e,r,u.get?u:{enumerable:!0,get:()=>o[r]})}}return e.default=o,Object.freeze(e)}const n=x(B),E=o=>{const{group:e,itemTemplate:r,selected:u,isLastGroup:L,onRequestSelection:g}=o,[l,d]=n.useState(null);n.useEffect(()=>{!u&&l!==null?d(null):u&&l===null&&d(0)},[u,l]);const a=n.useCallback(t=>t.attachmentLayout!=="list",[]),h=n.useCallback(()=>e.attachments?e.attachments.length-1:-1,[e.attachments]),b=n.useCallback(()=>e.attachments.length-1,[e.attachments]),i=n.useCallback((t,s=0)=>{let c=null;return t?l===null?c=s:l<h()&&(c=l+1):l===null?c=0:l>0&&(c=l-1),c!==null&&d(c),c},[l,h]),f=n.useCallback(()=>{g(e.selectionIndex)},[g,e.selectionIndex]),p=n.useCallback(t=>{let s=null,c,C;a(e)?(c=m.Keys.left,C=m.Keys.right):(c=m.Keys.up,C=m.Keys.down),t.keyCode===c?s=i(!1):t.keyCode===C&&(s=i(!0)),s!==null&&(t.preventDefault(),t.stopPropagation())},[i,a,e]),K=n.useCallback(t=>{f(),d(t)},[f]),k=n.useCallback(t=>{f(),i(t,1)},[f,i]),R=n.useCallback(()=>{let t=null;return a(e)&&l&&(t=n.createElement(S.Button,{icon:"chevron-left",onClick:()=>k(!1),svgIcon:v.chevronLeftIcon})),t},[a,e,l,k]),q=n.useCallback(()=>{let t=null;return a(e)&&l!==b()&&(t=n.createElement(S.Button,{icon:"chevron-right",onClick:()=>k(!0),svgIcon:v.chevronRightIcon})),t},[a,e,l,b,k]),w=n.useCallback(()=>m.classNames({"k-card-list":e.attachmentLayout,"k-card-deck":a(e)}),[e.attachmentLayout,e,a]),y=a(e),I=n.createElement("div",{className:w(),onKeyDown:y?void 0:p},e.attachments.map((t,s)=>n.createElement(D,{item:t,template:r,selected:s===l,tabbable:L&&s===l,onClick:()=>K(s),key:t.content})));return y?n.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:p},R(),I,q()):I};module.exports=E;