@progress/kendo-vue-conversational-ui 8.0.3-develop.2 → 8.0.3-develop.3

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.
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-vue-inputs"),require("@progress/kendo-vue-layout"),require("@progress/kendo-vue-intl")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-buttons","@progress/kendo-svg-icons","@progress/kendo-vue-inputs","@progress/kendo-vue-layout","@progress/kendo-vue-intl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueConversationalUi={},e.Vue,e.KendoVueCommon,e.KendoVueButtons,e.KendoSVGIcons,e.KendoVueInputs,e.KendoVueLayout,e.KendoVueIntl)}(this,(function(e,t,o,n,i,a,s,r){"use strict";function l(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const d=t.defineComponent({name:"KendoAIPromptHeader",props:{activeView:String,toolbarItems:Array,onActiveviewchange:Function},methods:{handleClick(e){this.$emit("activeviewchange",e)}},render(){let e;const{activeView:i,toolbarItems:a}=this.$props;return t.createVNode("div",{class:"k-prompt-header"},[t.createVNode(n.Toolbar,{overflow:"none",keyboardNavigation:!1,class:"k-toolbar-flat"},l(e=a.map((function(e){const a=o.getTemplate.call(this,{h:t.h,template:e.content,defaultRendering:null,additionalProps:{item:e}});return e.content?a:t.createVNode(n.Button,{type:"button",key:e.name,class:o.classNames("k-toolbar-item",{"k-selected":i===e.name}),size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>this.handleClick(e.name)},{default:()=>[e.buttonText]})}),this))?e:{default:()=>[e]})])}}),u={name:"Output view",buttonText:"Output",buttonIcon:i.commentIcon},c={name:"Commands view",buttonIcon:i.moreHorizontalIcon},p={name:"Prompt view",buttonText:"Ask AI",buttonIcon:i.sparklesIcon},m={name:"@progress/kendo-vue-conversational-ui",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:0,version:"8.0.3-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"},h=t.defineComponent({name:"KendoAIPrompt",props:{activeView:{type:String,required:!0},dir:String,toolbarItems:Array,outputs:Array,promptPlaceholder:String,streaming:Boolean,loading:Boolean,suggestionsView:{type:String,default:"classic"}},provide(){return{kendoAIPrompt:this.$data.contextState}},data(){return{showLicenseWatermark:!1,licenseMessage:"",contextState:{activeView:this.$props.activeView,streaming:this.$props.streaming,loading:this.$props.loading,onCancel:this.onCancel,onActiveViewChange:this.onActiveViewChange,onPromptRequest:this.onPromptRequest,onCommandExecute:this.onCommandExecute,onStateAction:this.onStateAction,suggestionsView:this.$props.suggestionsView}}},watch:{activeView(e){this.contextState.activeView=e},streaming(e){this.contextState.streaming=e},loading(e){this.contextState.loading=e}},methods:{onStateAction(e){this.contextState.activeView=e.activeView},onActiveViewChange(e){this.$emit("activeviewchange",e)},onPromptRequest(e,t){this.$emit("promptrequest",e,t)},onCommandExecute(e){this.$emit("commandexecute",e)},onCancel(){this.$emit("cancel")}},render(){o.validatePackage(m),this.showLicenseWatermark=o.shouldShowValidationUI(m),this.licenseMessage=o.getLicenseMessage(m);const e=o.getDefaultSlots(this),{toolbarItems:n,dir:i}=this.$props,a=(n||[p,u]).map((e=>{const t=o.templateRendering.call(this,e.content,o.getListeners.call(this));return{...e,content:t}})),s=this.showLicenseWatermark?t.createVNode(o.WatermarkOverlay,{message:this.licenseMessage},null):null;return t.createVNode("div",{class:"k-prompt",dir:i},[t.createVNode(d,{activeView:this.contextState.activeView,toolbarItems:a,onActiveviewchange:this.onActiveViewChange},null),e,s])}}),g=t.defineComponent({name:"KendoAIPromptFooter",render(){const e=o.getDefaultSlots(this);return t.createVNode("div",{class:"k-prompt-footer"},[t.createVNode("div",{class:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},[e])])}}),v=t.defineComponent({name:"KendoAIPromptContent",props:{onCancel:Function,streaming:Boolean},inject:{kendoAIPrompt:{default:null}},computed:{showFloatingButton(){var e;const t=(null==(e=this.kendoAIPrompt)?void 0:e.activeView)===u.name;return this.streaming&&t}},methods:{handleKeyDown(e){"Escape"===e.key&&this.showFloatingButton&&this.onCancel&&(e.preventDefault(),this.$props.onCancel())}},render(){const e=o.getDefaultSlots(this);return t.createVNode("div",{class:"k-prompt-content",onKeydown:this.handleKeyDown},[this.showFloatingButton&&t.createVNode(n.FloatingActionButton,{onClick:this.onCancel,svgIcon:i.stopSmIcon,size:"small",positionMode:"absolute",class:"k-prompt-stop-fab k-generating"},null),t.createVNode("div",{class:"k-prompt-view"},[e])])}}),k=t.defineComponent({name:"KendoAIPromptViewRender",inheritAttrs:!1,props:{name:String},inject:{kendoAIPrompt:{default:null}},render(){const e=o.getDefaultSlots(this);return this.kendoAIPrompt.activeView===this.$props.name?e:null}});function f(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const V=t.defineComponent({name:"KendoAIPromptExpander",props:{title:String},data:()=>({expanded:!0}),methods:{buttonClick(){this.expanded=!this.expanded}},render(){const e=o.getDefaultSlots(this),{title:a}=this.$props;return t.createVNode("div",{class:"k-prompt-expander"},[t.createVNode(n.Button,{type:"button",fillMode:"flat",svgIcon:this.expanded?i.chevronUpIcon:i.chevronDownIcon,title:a,onClick:this.buttonClick},f(a)?a:{default:()=>[a]}),this.expanded&&t.createVNode("div",{class:"k-prompt-expander-content"},[e])])}}),I=t.defineComponent({name:"KendoSuggestionGroup",props:{suggestions:{type:Array,required:!0},onSuggestionClick:{type:Function,required:!0},suggestionsView:{type:String,default:"classic"}},methods:{handleSuggestionClick(e,t){t.disabled||this.onSuggestionClick(e,t)},handleKeyDown(e,t){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this.onSuggestionClick(e,t))}},render(){const{suggestions:e,suggestionsView:n}=this.$props,i=()=>e.map((e=>t.createVNode("span",{role:"button",tabindex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:t=>!e.disabled&&this.handleSuggestionClick(t,e),onKeydown:t=>!e.disabled&&this.handleKeyDown(t,e),key:e.id,title:e.description,class:o.classNames("classic"===n?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},[e.text])));return"classic"===n?i():t.createVNode("div",{role:"group",class:"k-suggestion-group"},[i()])}});function C(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const y=t.defineComponent({name:"KendoAIPromptView",props:{promptInput:[Object,String],generateButton:[Object,String],promptValue:String,promptSuggestions:Array,enableSpeechToText:[Boolean,Object]},inject:{kendoAIPrompt:{default:null}},computed:{computedValue(){return void 0!==this.$props.promptValue?this.$props.promptValue:this.value}},data:()=>({value:""}),methods:{handleOnRequest(){this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,this.computedValue),this.value=""},handleSuggestionSelect(e){this.value=e},onTextChange(e){this.value=e.value},onSpeechResult(e){if(e.isFinal&&e.alternatives.length>0){const t=e.alternatives[0].transcript,o=this.value,n=o&&!o.endsWith(" ")&&!o.endsWith("\n");this.value=o+(n?" ":"")+t}},onSpeechStart(){},onSpeechEnd(){},getButtonDisabledState(){const e=void 0!==this.$props.promptValue?this.$props.promptValue:this.value;return!(null!=e&&e.trim())}},render(){const e="Generate",{promptSuggestions:s,enableSpeechToText:r}=this.$props,l=o.templateRendering.call(this,this.$props.promptInput,o.getListeners.call(this)),d=t.createVNode(a.TextArea,{value:this.computedValue,onInput:this.onTextChange,placeholder:"Ask or generate content with AI ...",rows:2,class:"!k-flex-col",inputSuffix:()=>r?t.createVNode(t.Fragment,null,[t.createVNode(a.InputSeparator,{orientation:"horizontal"},null),t.createVNode("div",{class:"k-input-suffix k-input-suffix-horizontal"},[t.createVNode(n.SpeechToTextButton,t.mergeProps({fillMode:"flat",onStart:this.onSpeechStart,onEnd:this.onSpeechEnd,onResult:this.onSpeechResult},"object"==typeof r?r:{}),null)])]):null},null),u=o.getTemplate.call(this,{h:t.h,template:l,defaultRendering:d}),c=o.templateRendering.call(this,this.$props.generateButton,o.getListeners.call(this)),m=t.createVNode(n.Button,{type:"button",themeColor:"primary",fillMode:"solid","aria-hidden":"true",rounded:"full",size:"medium",onClick:this.handleOnRequest,disabled:this.getButtonDisabledState(),title:"Generate",svgIcon:i.sparklesIcon},C(e)?e:{default:()=>[e]}),h=o.getTemplate.call(this,{h:t.h,template:c,defaultRendering:m});return t.createVNode(k,{name:p.name},{default:()=>{var e,o;return[t.createVNode(v,{streaming:null==(e=this.kendoAIPrompt)?void 0:e.streaming,onCancel:null==(o=this.kendoAIPrompt)?void 0:o.onCancel},{default:()=>[u,s&&s.length>0&&t.createVNode(V,{title:"Prompt Suggestions"},{default:()=>{var e;return[t.createVNode(I,{suggestionsView:null==(e=this.kendoAIPrompt)?void 0:e.suggestionsView,suggestions:s.map(((e,t)=>({id:t,text:e,description:e}))),onSuggestionClick:(e,t)=>this.handleSuggestionSelect(t.text)},null)]}})]}),t.createVNode(g,null,C(h)?h:{default:()=>[h]})]}})}}),b="avatar.alt",w="messageList.ariaLabel",N="aIPrompt.noOutputs",S={[b]:"Avatar",[w]:"Message list",[N]:"No output from Ai available"};function A(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}let P=function(e){return e.positive="positive",e.negative="negative",e}({});const x=t.defineComponent({name:"KendoAIPromptOutputView",emits:{copy:null,retry:null,rating:null},props:{outputs:Array,outputCard:Object,showOutputRating:Boolean},inject:{kendoAIPrompt:{default:null},kendoLocalizationService:{default:null}},data:()=>({copiedIndex:-1,copyButtonIcon:i.copyIcon,contentRef:null}),methods:{retryPrompt(e){this.$emit("retry",e),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),this.scrollToTopOutput()},copyToClipboard(e,t){null!=e&&e.responseContent&&navigator.clipboard.writeText(e.responseContent),this.copiedIndex=t,this.copyButtonIcon=i.checkIcon,this.$emit("copy",null==e?void 0:e.responseContent),setTimeout((()=>{this.copyButtonIcon=i.copyIcon,this.copiedIndex=-1}),1e3)},outputRating(e,t){this.$emit("rating",e,t),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),this.scrollToTopOutput()},scrollToTopOutput(){var e,t;null==(t=null==(e=this.contentRef)?void 0:e.scrollTo)||t.call(e,{top:0,behavior:"smooth"})}},render(){let e;const{outputs:o,showOutputRating:a,outputCard:l}=this.$props,d=r.provideLocalizationService(this),{header:c,body:p,actions:m}=l||{},h=t.createVNode(s.Card,null,{default:()=>[t.createVNode(s.CardHeader,null,{default:()=>[t.createVNode(s.CardTitle,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}},null)]}),t.createVNode(s.CardSubtitle,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),t.createVNode(s.CardBody,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}},null)]}),t.createVNode(s.CardActions,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),g=null==o?void 0:o.map(((e,o)=>t.createVNode(s.Card,{key:`${e.id}_${o}`,class:e.class},{default:()=>[t.createVNode(s.CardHeader,null,{default:()=>[c?c(e):t.createVNode(t.Fragment,null,[e.title&&t.createVNode(s.CardTitle,null,{default:()=>[e.title]}),e.subTitle&&t.createVNode(s.CardSubtitle,null,{default:()=>[e.subTitle]})])]}),t.createVNode(s.CardBody,null,{default:()=>[p?p(e):e.responseContent]}),t.createVNode(s.CardActions,null,{default:()=>[m?m(e):t.createVNode(t.Fragment,null,[t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:this.copiedIndex===o?this.copyButtonIcon:i.copyIcon,"aria-hidden":"true",onClick:()=>this.copyToClipboard(e,o)},{default:()=>["Copy"]}),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:i.arrowRotateCwIcon,"aria-hidden":"true",onClick:()=>this.retryPrompt(e)},{default:()=>["Retry"]}),a&&t.createVNode(t.Fragment,null,[t.createVNode("span",{class:"k-spacer"},null),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:i.thumbUpOutlineIcon,"aria-hidden":"true",onClick:()=>this.outputRating(e,"positive")},null),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:i.thumbDownOutlineIcon,"aria-hidden":"true",onClick:()=>this.outputRating(e,"negative")},null)])])]})]}))),f=t.createVNode(s.Card,null,{default:()=>[t.createVNode(s.CardBody,null,A(e=d.toLanguageString(N,S[N]))?e:{default:()=>[e]})]});return t.createVNode(k,{name:u.name},{default:()=>{var e,o;return[t.createVNode(v,{ref:e=>this.contentRef=e,streaming:null==(e=this.kendoAIPrompt)?void 0:e.streaming,onCancel:null==(o=this.kendoAIPrompt)?void 0:o.onCancel},{default:()=>{var e,o;return[t.createVNode("div",{class:"k-card-list"},[(null==(e=this.kendoAIPrompt)?void 0:e.loading)&&h,g,(!g||0===g.length)&&!(null!=(o=this.kendoAIPrompt)&&o.loading)&&f])]}})]}})}}),R=t.defineComponent({name:"KendoAIPromptCommandsView",props:{commands:Array},inject:{kendoAIPrompt:{default:null}},render(){const{commands:e}=this.$props,o=e=>{var t;const o=e.target;(null==(t=o.items)||!t.length)&&this.kendoAIPrompt.onCommandExecute&&(this.$emit("commandexecute",o),this.kendoAIPrompt.onCommandExecute.call(null,o))};return t.createVNode(k,{name:c.name},{default:()=>{var n,i;return[t.createVNode(v,{streaming:null==(n=this.kendoAIPrompt)?void 0:n.streaming,onCancel:null==(i=this.kendoAIPrompt)?void 0:i.onCancel},{default:()=>[t.createVNode("div",{class:"k-prompt-view"},[t.createVNode(s.PanelBar,{onSelect:o,items:e},null)])]})]}})}});e.AIPrompt=h,e.AIPromptCommandsView=R,e.AIPromptContent=v,e.AIPromptFooter=g,e.AIPromptHeader=d,e.AIPromptOutputRating=P,e.AIPromptOutputView=x,e.AIPromptView=y,e.AIPromptViewRender=k,e.SuggestionGroup=I,e.commandsViewDefaults=c,e.outputViewDefaults=u,e.promptViewDefaults=p}));
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-vue-inputs"),require("@progress/kendo-vue-layout"),require("@progress/kendo-vue-intl")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-buttons","@progress/kendo-svg-icons","@progress/kendo-vue-inputs","@progress/kendo-vue-layout","@progress/kendo-vue-intl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueConversationalUi={},e.Vue,e.KendoVueCommon,e.KendoVueButtons,e.KendoSVGIcons,e.KendoVueInputs,e.KendoVueLayout,e.KendoVueIntl)}(this,function(e,t,o,n,i,a,s,r){"use strict";function l(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const d=t.defineComponent({name:"KendoAIPromptHeader",props:{activeView:String,toolbarItems:Array,onActiveviewchange:Function},methods:{handleClick(e){this.$emit("activeviewchange",e)}},render(){let e;const{activeView:i,toolbarItems:a}=this.$props;return t.createVNode("div",{class:"k-prompt-header"},[t.createVNode(n.Toolbar,{overflow:"none",keyboardNavigation:!1,class:"k-toolbar-flat"},l(e=a.map(function(e){const a=o.getTemplate.call(this,{h:t.h,template:e.content,defaultRendering:null,additionalProps:{item:e}});return e.content?a:t.createVNode(n.Button,{type:"button",key:e.name,class:o.classNames("k-toolbar-item",{"k-selected":i===e.name}),size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>this.handleClick(e.name)},{default:()=>[e.buttonText]})},this))?e:{default:()=>[e]})])}}),u={name:"Output view",buttonText:"Output",buttonIcon:i.commentIcon},c={name:"Commands view",buttonIcon:i.moreHorizontalIcon},p={name:"Prompt view",buttonText:"Ask AI",buttonIcon:i.sparklesIcon},m={name:"@progress/kendo-vue-conversational-ui",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:0,version:"8.0.3-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"},h=t.defineComponent({name:"KendoAIPrompt",props:{activeView:{type:String,required:!0},dir:String,toolbarItems:Array,outputs:Array,promptPlaceholder:String,streaming:Boolean,loading:Boolean,suggestionsView:{type:String,default:"classic"}},provide(){return{kendoAIPrompt:this.$data.contextState}},data(){return{showLicenseWatermark:!1,licenseMessage:"",contextState:{activeView:this.$props.activeView,streaming:this.$props.streaming,loading:this.$props.loading,onCancel:this.onCancel,onActiveViewChange:this.onActiveViewChange,onPromptRequest:this.onPromptRequest,onCommandExecute:this.onCommandExecute,onStateAction:this.onStateAction,suggestionsView:this.$props.suggestionsView}}},watch:{activeView(e){this.contextState.activeView=e},streaming(e){this.contextState.streaming=e},loading(e){this.contextState.loading=e}},methods:{onStateAction(e){this.contextState.activeView=e.activeView},onActiveViewChange(e){this.$emit("activeviewchange",e)},onPromptRequest(e,t){this.$emit("promptrequest",e,t)},onCommandExecute(e){this.$emit("commandexecute",e)},onCancel(){this.$emit("cancel")}},render(){o.validatePackage(m),this.showLicenseWatermark=o.shouldShowValidationUI(m),this.licenseMessage=o.getLicenseMessage(m);const e=o.getDefaultSlots(this),{toolbarItems:n,dir:i}=this.$props,a=(n||[p,u]).map(e=>{const t=o.templateRendering.call(this,e.content,o.getListeners.call(this));return{...e,content:t}}),s=this.showLicenseWatermark?t.createVNode(o.WatermarkOverlay,{message:this.licenseMessage},null):null;return t.createVNode("div",{class:"k-prompt",dir:i},[t.createVNode(d,{activeView:this.contextState.activeView,toolbarItems:a,onActiveviewchange:this.onActiveViewChange},null),e,s])}}),g=t.defineComponent({name:"KendoAIPromptFooter",render(){const e=o.getDefaultSlots(this);return t.createVNode("div",{class:"k-prompt-footer"},[t.createVNode("div",{class:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},[e])])}}),v=t.defineComponent({name:"KendoAIPromptContent",props:{onCancel:Function,streaming:Boolean},inject:{kendoAIPrompt:{default:null}},computed:{showFloatingButton(){var e;const t=(null==(e=this.kendoAIPrompt)?void 0:e.activeView)===u.name;return this.streaming&&t}},methods:{handleKeyDown(e){"Escape"===e.key&&this.showFloatingButton&&this.onCancel&&(e.preventDefault(),this.$props.onCancel())}},render(){const e=o.getDefaultSlots(this);return t.createVNode("div",{class:"k-prompt-content",onKeydown:this.handleKeyDown},[this.showFloatingButton&&t.createVNode(n.FloatingActionButton,{onClick:this.onCancel,svgIcon:i.stopSmIcon,size:"small",positionMode:"absolute",class:"k-prompt-stop-fab k-generating"},null),t.createVNode("div",{class:"k-prompt-view"},[e])])}}),k=t.defineComponent({name:"KendoAIPromptViewRender",inheritAttrs:!1,props:{name:String},inject:{kendoAIPrompt:{default:null}},render(){const e=o.getDefaultSlots(this);return this.kendoAIPrompt.activeView===this.$props.name?e:null}});function f(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const V=t.defineComponent({name:"KendoAIPromptExpander",props:{title:String},data:()=>({expanded:!0}),methods:{buttonClick(){this.expanded=!this.expanded}},render(){const e=o.getDefaultSlots(this),{title:a}=this.$props;return t.createVNode("div",{class:"k-prompt-expander"},[t.createVNode(n.Button,{type:"button",fillMode:"flat",svgIcon:this.expanded?i.chevronUpIcon:i.chevronDownIcon,title:a,onClick:this.buttonClick},f(a)?a:{default:()=>[a]}),this.expanded&&t.createVNode("div",{class:"k-prompt-expander-content"},[e])])}}),I=t.defineComponent({name:"KendoSuggestionGroup",props:{suggestions:{type:Array,required:!0},onSuggestionClick:{type:Function,required:!0},suggestionsView:{type:String,default:"classic"}},methods:{handleSuggestionClick(e,t){t.disabled||this.onSuggestionClick(e,t)},handleKeyDown(e,t){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this.onSuggestionClick(e,t))}},render(){const{suggestions:e,suggestionsView:n}=this.$props,i=()=>e.map(e=>t.createVNode("span",{role:"button",tabindex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:t=>!e.disabled&&this.handleSuggestionClick(t,e),onKeydown:t=>!e.disabled&&this.handleKeyDown(t,e),key:e.id,title:e.description,class:o.classNames("classic"===n?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},[e.text]));return"classic"===n?i():t.createVNode("div",{role:"group",class:"k-suggestion-group"},[i()])}});function C(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const y=t.defineComponent({name:"KendoAIPromptView",props:{promptInput:[Object,String],generateButton:[Object,String],promptValue:String,promptSuggestions:Array,enableSpeechToText:[Boolean,Object]},inject:{kendoAIPrompt:{default:null}},computed:{computedValue(){return void 0!==this.$props.promptValue?this.$props.promptValue:this.value}},data:()=>({value:""}),methods:{handleOnRequest(){this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,this.computedValue),this.value=""},handleSuggestionSelect(e){this.value=e},onTextChange(e){this.value=e.value},onSpeechResult(e){if(e.isFinal&&e.alternatives.length>0){const t=e.alternatives[0].transcript,o=this.value,n=o&&!o.endsWith(" ")&&!o.endsWith("\n");this.value=o+(n?" ":"")+t}},onSpeechStart(){},onSpeechEnd(){},getButtonDisabledState(){const e=void 0!==this.$props.promptValue?this.$props.promptValue:this.value;return!(null!=e&&e.trim())}},render(){const e="Generate",{promptSuggestions:s,enableSpeechToText:r}=this.$props,l=o.templateRendering.call(this,this.$props.promptInput,o.getListeners.call(this)),d=t.createVNode(a.TextArea,{value:this.computedValue,onInput:this.onTextChange,placeholder:"Ask or generate content with AI ...",rows:2,class:"!k-flex-col",inputSuffix:()=>r?t.createVNode(t.Fragment,null,[t.createVNode(a.InputSeparator,{orientation:"horizontal"},null),t.createVNode("div",{class:"k-input-suffix k-input-suffix-horizontal"},[t.createVNode(n.SpeechToTextButton,t.mergeProps({fillMode:"flat",onStart:this.onSpeechStart,onEnd:this.onSpeechEnd,onResult:this.onSpeechResult},"object"==typeof r?r:{}),null)])]):null},null),u=o.getTemplate.call(this,{h:t.h,template:l,defaultRendering:d}),c=o.templateRendering.call(this,this.$props.generateButton,o.getListeners.call(this)),m=t.createVNode(n.Button,{type:"button",themeColor:"primary",fillMode:"solid","aria-hidden":"true",rounded:"full",size:"medium",onClick:this.handleOnRequest,disabled:this.getButtonDisabledState(),title:"Generate",svgIcon:i.sparklesIcon},C(e)?e:{default:()=>[e]}),h=o.getTemplate.call(this,{h:t.h,template:c,defaultRendering:m});return t.createVNode(k,{name:p.name},{default:()=>{var e,o;return[t.createVNode(v,{streaming:null==(e=this.kendoAIPrompt)?void 0:e.streaming,onCancel:null==(o=this.kendoAIPrompt)?void 0:o.onCancel},{default:()=>[u,s&&s.length>0&&t.createVNode(V,{title:"Prompt Suggestions"},{default:()=>{var e;return[t.createVNode(I,{suggestionsView:null==(e=this.kendoAIPrompt)?void 0:e.suggestionsView,suggestions:s.map((e,t)=>({id:t,text:e,description:e})),onSuggestionClick:(e,t)=>this.handleSuggestionSelect(t.text)},null)]}})]}),t.createVNode(g,null,C(h)?h:{default:()=>[h]})]}})}}),b="avatar.alt",w="messageList.ariaLabel",N="aIPrompt.noOutputs",S={[b]:"Avatar",[w]:"Message list",[N]:"No output from Ai available"};function A(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}let P=function(e){return e.positive="positive",e.negative="negative",e}({});const x=t.defineComponent({name:"KendoAIPromptOutputView",emits:{copy:null,retry:null,rating:null},props:{outputs:Array,outputCard:Object,showOutputRating:Boolean},inject:{kendoAIPrompt:{default:null},kendoLocalizationService:{default:null}},data:()=>({copiedIndex:-1,copyButtonIcon:i.copyIcon,contentRef:null}),methods:{retryPrompt(e){this.$emit("retry",e),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),this.scrollToTopOutput()},copyToClipboard(e,t){null!=e&&e.responseContent&&navigator.clipboard.writeText(e.responseContent),this.copiedIndex=t,this.copyButtonIcon=i.checkIcon,this.$emit("copy",null==e?void 0:e.responseContent),setTimeout(()=>{this.copyButtonIcon=i.copyIcon,this.copiedIndex=-1},1e3)},outputRating(e,t){this.$emit("rating",e,t),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),this.scrollToTopOutput()},scrollToTopOutput(){var e,t;null==(t=null==(e=this.contentRef)?void 0:e.scrollTo)||t.call(e,{top:0,behavior:"smooth"})}},render(){let e;const{outputs:o,showOutputRating:a,outputCard:l}=this.$props,d=r.provideLocalizationService(this),{header:c,body:p,actions:m}=l||{},h=t.createVNode(s.Card,null,{default:()=>[t.createVNode(s.CardHeader,null,{default:()=>[t.createVNode(s.CardTitle,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}},null)]}),t.createVNode(s.CardSubtitle,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),t.createVNode(s.CardBody,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}},null)]}),t.createVNode(s.CardActions,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),g=null==o?void 0:o.map((e,o)=>t.createVNode(s.Card,{key:`${e.id}_${o}`,class:e.class},{default:()=>[t.createVNode(s.CardHeader,null,{default:()=>[c?c(e):t.createVNode(t.Fragment,null,[e.title&&t.createVNode(s.CardTitle,null,{default:()=>[e.title]}),e.subTitle&&t.createVNode(s.CardSubtitle,null,{default:()=>[e.subTitle]})])]}),t.createVNode(s.CardBody,null,{default:()=>[p?p(e):e.responseContent]}),t.createVNode(s.CardActions,null,{default:()=>[m?m(e):t.createVNode(t.Fragment,null,[t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:this.copiedIndex===o?this.copyButtonIcon:i.copyIcon,"aria-hidden":"true",onClick:()=>this.copyToClipboard(e,o)},{default:()=>["Copy"]}),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:i.arrowRotateCwIcon,"aria-hidden":"true",onClick:()=>this.retryPrompt(e)},{default:()=>["Retry"]}),a&&t.createVNode(t.Fragment,null,[t.createVNode("span",{class:"k-spacer"},null),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:i.thumbUpOutlineIcon,"aria-hidden":"true",onClick:()=>this.outputRating(e,"positive")},null),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:i.thumbDownOutlineIcon,"aria-hidden":"true",onClick:()=>this.outputRating(e,"negative")},null)])])]})]})),f=t.createVNode(s.Card,null,{default:()=>[t.createVNode(s.CardBody,null,A(e=d.toLanguageString(N,S[N]))?e:{default:()=>[e]})]});return t.createVNode(k,{name:u.name},{default:()=>{var e,o;return[t.createVNode(v,{ref:e=>this.contentRef=e,streaming:null==(e=this.kendoAIPrompt)?void 0:e.streaming,onCancel:null==(o=this.kendoAIPrompt)?void 0:o.onCancel},{default:()=>{var e,o;return[t.createVNode("div",{class:"k-card-list"},[(null==(e=this.kendoAIPrompt)?void 0:e.loading)&&h,g,(!g||0===g.length)&&!(null!=(o=this.kendoAIPrompt)&&o.loading)&&f])]}})]}})}}),R=t.defineComponent({name:"KendoAIPromptCommandsView",props:{commands:Array},inject:{kendoAIPrompt:{default:null}},render(){const{commands:e}=this.$props,o=e=>{var t;const o=e.target;(null==(t=o.items)||!t.length)&&this.kendoAIPrompt.onCommandExecute&&(this.$emit("commandexecute",o),this.kendoAIPrompt.onCommandExecute.call(null,o))};return t.createVNode(k,{name:c.name},{default:()=>{var n,i;return[t.createVNode(v,{streaming:null==(n=this.kendoAIPrompt)?void 0:n.streaming,onCancel:null==(i=this.kendoAIPrompt)?void 0:i.onCancel},{default:()=>[t.createVNode("div",{class:"k-prompt-view"},[t.createVNode(s.PanelBar,{onSelect:o,items:e},null)])]})]}})}});e.AIPrompt=h,e.AIPromptCommandsView=R,e.AIPromptContent=v,e.AIPromptFooter=g,e.AIPromptHeader=d,e.AIPromptOutputRating=P,e.AIPromptOutputView=x,e.AIPromptView=y,e.AIPromptViewRender=k,e.SuggestionGroup=I,e.commandsViewDefaults=c,e.outputViewDefaults=u,e.promptViewDefaults=p});
package/index.d.mts CHANGED
@@ -5,515 +5,13 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { ComponentOptionsMixin } from 'vue';
9
- import { ComponentProvideOptions } from 'vue';
10
- import { DefineComponent } from 'vue';
11
- import { ExtractPropTypes } from 'vue';
12
- import { PropType } from 'vue';
13
- import { PublicProps } from 'vue';
14
- import { SVGIcon } from '@progress/kendo-svg-icons';
15
- import { SVGIcon as SVGIcon_2 } from '@progress/kendo-vue-common';
16
-
17
- /**
18
- * @hidden
19
- */
20
- export declare const AIPrompt: DefineComponent<ExtractPropTypes< {
21
- activeView: {
22
- type: PropType<string>;
23
- required: true;
24
- };
25
- dir: PropType<string>;
26
- toolbarItems: PropType<AIPromptToolbarItemInterface[]>;
27
- outputs: PropType<AIPromptOutputInterface[]>;
28
- promptPlaceholder: PropType<string>;
29
- streaming: PropType<boolean>;
30
- loading: PropType<boolean>;
31
- suggestionsView: {
32
- type: PropType<SuggestionsView>;
33
- default: string;
34
- };
35
- }>, {}, {
36
- showLicenseWatermark: boolean;
37
- licenseMessage: string;
38
- contextState: AIPromptContextInterface;
39
- }, {}, {
40
- onStateAction(action: StateActionInterface): void;
41
- onActiveViewChange(event: string): void;
42
- onPromptRequest(prompt?: string, outputItem?: AIPromptOutputInterface): void;
43
- onCommandExecute(event: AIPromptCommandInterface): void;
44
- onCancel(): void;
45
- }, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
46
- activeView: {
47
- type: PropType<string>;
48
- required: true;
49
- };
50
- dir: PropType<string>;
51
- toolbarItems: PropType<AIPromptToolbarItemInterface[]>;
52
- outputs: PropType<AIPromptOutputInterface[]>;
53
- promptPlaceholder: PropType<string>;
54
- streaming: PropType<boolean>;
55
- loading: PropType<boolean>;
56
- suggestionsView: {
57
- type: PropType<SuggestionsView>;
58
- default: string;
59
- };
60
- }>> & Readonly<{}>, {
61
- suggestionsView: SuggestionsView;
62
- }, {}, {}, {}, string, () => {
63
- kendoAIPrompt: any;
64
- }, true, {}, any>;
65
-
66
- /**
67
- * The fields of the AIPromptOutputView card prop.
68
- */
69
- export declare interface AIPromptCardInterface {
70
- /**
71
- * Custom template for AIPromptCard header.
72
- */
73
- header?: (props: AIPromptOutputInterface) => any;
74
- /**
75
- * Custom template for AIPromptCard body.
76
- */
77
- body?: (props: AIPromptOutputInterface) => any;
78
- /**
79
- * Custom template for AIPromptCard actions.
80
- */
81
- actions?: (props: AIPromptOutputInterface) => any;
82
- }
83
-
84
- /**
85
- * An interface for the Command view command.
86
- */
87
- export declare interface AIPromptCommandInterface extends CommandItemInterface {
88
- /**
89
- * Collection with nested commands.
90
- */
91
- children?: CommandItemInterface[];
92
- }
93
-
94
- /**
95
- * @hidden
96
- */
97
- export declare const AIPromptCommandsView: DefineComponent<ExtractPropTypes< {
98
- commands: PropType<AIPromptCommandInterface[]>;
99
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
100
- commands: PropType<AIPromptCommandInterface[]>;
101
- }>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
102
-
103
- /**
104
- * The props of the AIPromptCommandsView component.
105
- */
106
- export declare interface AIPromptCommandsViewProps {
107
- /**
108
- * The collection of commands that will be rendered in the Command view.
109
- */
110
- commands?: AIPromptCommandInterface[];
111
- /**
112
- * Fires each time the user clicks over a Command view command. Exposes the selected command as event data.
113
- */
114
- onCommandexecute?: (command: CommandItemInterface) => void;
115
- }
116
-
117
- /**
118
- * @hidden
119
- */
120
- export declare const AIPromptContent: DefineComponent<ExtractPropTypes< {
121
- onCancel: PropType<() => void>;
122
- streaming: PropType<boolean>;
123
- }>, {}, {}, {
124
- showFloatingButton(): boolean;
125
- }, {
126
- handleKeyDown(event: KeyboardEvent): void;
127
- }, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
128
- onCancel: PropType<() => void>;
129
- streaming: PropType<boolean>;
130
- }>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
131
-
132
- /**
133
- * The AIPrompt context that is passed to the view.
134
- */
135
- declare interface AIPromptContextInterface {
136
- activeView?: string;
137
- streaming?: boolean;
138
- loading?: boolean;
139
- suggestionsView?: SuggestionsView;
140
- onCancel?: () => void;
141
- onPromptRequest?: (prompt?: string, outputItem?: AIPromptOutputInterface) => void;
142
- onCommandExecute?: (command: AIPromptCommandInterface) => void;
143
- onActiveViewChange?: (view: string) => void;
144
- onStateAction?: (action: StateActionInterface) => void;
145
- }
146
-
147
- /**
148
- * @hidden
149
- */
150
- export declare const AIPromptFooter: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
151
-
152
- /**
153
- * @hidden
154
- */
155
- export declare const AIPromptHeader: DefineComponent<ExtractPropTypes< {
156
- activeView: PropType<string>;
157
- toolbarItems: PropType<AIPromptToolbarItemInterface[]>;
158
- onActiveviewchange: PropType<(event: any) => void>;
159
- }>, {}, {}, {}, {
160
- handleClick(viewName: string): void;
161
- }, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
162
- activeView: PropType<string>;
163
- toolbarItems: PropType<AIPromptToolbarItemInterface[]>;
164
- onActiveviewchange: PropType<(event: any) => void>;
165
- }>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
166
-
167
- export declare interface AIPromptOutputInterface {
168
- /**
169
- * The unique identifier of the command.
170
- */
171
- id: string | number;
172
- /**
173
- * An optional custom title for the prompt output.
174
- */
175
- title?: string;
176
- /**
177
- * An optional custom sub title for the prompt output.
178
- */
179
- subTitle?: string;
180
- /**
181
- * The prompt that initiated the output generation.
182
- */
183
- prompt?: string;
184
- /**
185
- * The class of the prompt that is rendered on the output card.
186
- */
187
- class?: string;
188
- /**
189
- * The text content of the prompt output.
190
- */
191
- responseContent: string;
192
- /**
193
- * Specifies if the prompt generation was initiated via the retry button.
194
- */
195
- isRetry?: boolean;
196
- /**
197
- * The prompt output rating.
198
- */
199
- ratingType?: AIPromptOutputRating;
200
- /**
201
- * Optionally specifies a command, if the prompt generation was triggered via a command.
202
- */
203
- command?: AIPromptCommandInterface;
204
- }
205
-
206
- /**
207
- * Enum option for the output rating
208
- */
209
- export declare enum AIPromptOutputRating {
210
- /**
211
- * Positive output rating
212
- */
213
- positive = "positive",
214
- /**
215
- * Negative output rating
216
- */
217
- negative = "negative"
218
- }
219
-
220
- /**
221
- * @hidden
222
- */
223
- export declare const AIPromptOutputView: DefineComponent<ExtractPropTypes< {
224
- outputs: PropType<AIPromptOutputInterface[]>;
225
- outputCard: PropType<AIPromptCardInterface>;
226
- showOutputRating: PropType<boolean>;
227
- }>, {}, {
228
- copiedIndex: number;
229
- copyButtonIcon: SVGIcon;
230
- contentRef: any;
231
- }, {}, {
232
- retryPrompt(output: AIPromptOutputInterface): void;
233
- copyToClipboard(output: AIPromptOutputInterface, index: number): void;
234
- outputRating(output: AIPromptOutputInterface, ratingType: AIPromptOutputRating): void;
235
- scrollToTopOutput(): void;
236
- }, ComponentOptionsMixin, ComponentOptionsMixin, {
237
- copy: any;
238
- retry: any;
239
- rating: any;
240
- }, string, PublicProps, Readonly<ExtractPropTypes< {
241
- outputs: PropType<AIPromptOutputInterface[]>;
242
- outputCard: PropType<AIPromptCardInterface>;
243
- showOutputRating: PropType<boolean>;
244
- }>> & Readonly<{
245
- onCopy?: (...args: any[] | unknown[]) => any;
246
- onRetry?: (...args: any[] | unknown[]) => any;
247
- onRating?: (...args: any[] | unknown[]) => any;
248
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
249
-
250
- /**
251
- * The props of the AIPromptOutputView component.
252
- */
253
- export declare interface AIPromptOutputViewProps {
254
- /**
255
- * The collection of generated prompt outputs that will be rendered in the Output view.
256
- */
257
- outputs?: AIPromptOutputInterface[];
258
- /**
259
- * Represents a template that allows you to define custom Card fields for:
260
- * header
261
- * body
262
- * actions
263
- * The custom fields will override the default one.
264
- */
265
- outputCard?: AIPromptCardInterface;
266
- /**
267
- * Specifies if the rating buttons in each card will be rendered.
268
- * By default, rating buttons are not rendered.
269
- *
270
- * @default false
271
- */
272
- showOutputRating?: boolean;
273
- /**
274
- * Fires each time the user clicks Retry button in the card.
275
- */
276
- onRetry?: (output: AIPromptOutputInterface) => void;
277
- /**
278
- * Fires each time the user clicks Copy button in the card.
279
- */
280
- onCopy?: (content: string) => void;
281
- /**
282
- * Fires each time the user clicks a rating button in the card.
283
- */
284
- onRating?: (output: AIPromptOutputInterface, ratingType: AIPromptOutputRating) => void;
285
- }
286
-
287
- /**
288
- * The props of the AIPrompt component.
289
- */
290
- export declare interface AIPromptProps {
291
- /**
292
- * Name of the active view.
293
- */
294
- activeView: string;
295
- /**
296
- * Collection with items that will override the default Toolbar items.
297
- */
298
- toolbarItems?: AIPromptToolbarItemInterface[];
299
- /**
300
- * The collection of generated prompt outputs that will be rendered in the Output view.
301
- */
302
- outputs?: AIPromptOutputInterface[];
303
- /**
304
- * The placeholder text for the Prompt view textarea.
305
- */
306
- promptPlaceholder?: string;
307
- /**
308
- * The direction of the Prompt.
309
- */
310
- dir?: string;
311
- /**
312
- * If true, the prompt is in a streaming state.
313
- */
314
- streaming?: boolean;
315
- /**
316
- * If true, the prompt is in a loading state.
317
- */
318
- loading?: boolean;
319
- /**
320
- * The onActiveViewChange event handler of the Kendo UI for Vue AIPrompt component.
321
- * Fires when active view is changed. Exposes the name of the new active view as event data.
322
- */
323
- onActiveviewchange?: (name: string) => void;
324
- /**
325
- * The onCommandExecute event handler of the Kendo UI for Vue AIPrompt component.
326
- * Fires each time the user clicks a command in the Command view. Exposes the selected command as event data.
327
- */
328
- onCommandexecute?: (command: AIPromptCommandInterface) => void;
329
- /**
330
- * The onPromptRequest event handler of the Kendo UI for Vue AIPrompt component.
331
- * Fires when user clicks the `Generate` button in the Prompt view.
332
- */
333
- onPromptrequest?: (prompt?: string, outputItem?: AIPromptOutputInterface) => void;
334
- /**
335
- * Called when the prompt is cancelled.
336
- */
337
- onCancel?: () => void;
338
- /**
339
- * Optionally specifies the rendering for the suggestions displayed in the AI Prompt component.
340
- * 'suggestionsView' can be either 'classic' or 'modern'.
341
- * - 'classic': Uses a rectangular styling for suggestions.
342
- * - 'modern': Uses a chip-like styling for suggestions.
343
- */
344
- suggestionsView?: SuggestionsView;
345
- }
346
-
347
- /**
348
- * An interface for the AIPromptToolbarItem.
349
- */
350
- export declare interface AIPromptToolbarItemInterface {
351
- /**
352
- * Defines the name of the view witch is related to.
353
- */
354
- name: string;
355
- /**
356
- * Defines the svgIcon used in the Toolbar button.
357
- */
358
- buttonIcon?: SVGIcon;
359
- /**
360
- * Defines the text used in the Toolbar button.
361
- */
362
- buttonText?: string;
363
- /**
364
- * Defines custom content for the item. It can be either a name of a named slot or a rendered function.
365
- */
366
- content?: string | Function | Object;
367
- }
368
-
369
- /**
370
- * @hidden
371
- */
372
- export declare const AIPromptView: DefineComponent<ExtractPropTypes< {
373
- promptInput: PropType<any>;
374
- generateButton: PropType<any>;
375
- promptValue: PropType<string>;
376
- promptSuggestions: PropType<string[]>;
377
- enableSpeechToText: PropType<boolean | object>;
378
- }>, {}, {
379
- value: string;
380
- }, {
381
- computedValue(): any;
382
- }, {
383
- handleOnRequest(): void;
384
- handleSuggestionSelect(suggestion: string): void;
385
- onTextChange(event: any): void;
386
- onSpeechResult(event: any): void;
387
- onSpeechStart(): void;
388
- onSpeechEnd(): void;
389
- getButtonDisabledState(): boolean;
390
- }, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
391
- promptInput: PropType<any>;
392
- generateButton: PropType<any>;
393
- promptValue: PropType<string>;
394
- promptSuggestions: PropType<string[]>;
395
- enableSpeechToText: PropType<boolean | object>;
396
- }>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
397
-
398
- /**
399
- * @hidden
400
- */
401
- export declare const AIPromptViewRender: DefineComponent<ExtractPropTypes< {
402
- name: PropType<string>;
403
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
404
- name: PropType<string>;
405
- }>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
406
-
407
- /**
408
- * The props of the AIPromptViewRender component.
409
- */
410
- export declare interface AIPromptViewRenderProps {
411
- /**
412
- * Specifies the name of the view.
413
- */
414
- name: string;
415
- }
416
-
417
- /**
418
- * Represents the structure of a chat suggestion item that can be displayed above the message input.
419
- * @hidden
420
- * @interface ChatSuggestion
421
- */
422
- export declare interface ChatSuggestion {
423
- id: string | number;
424
- text: string;
425
- description?: string;
426
- disabled?: boolean;
427
- suggestionsView?: SuggestionsView;
428
- }
429
-
430
- /**
431
- * @hidden
432
- */
433
- declare interface CommandItemInterface {
434
- /**
435
- * The unique identifier of the command.
436
- */
437
- id: string;
438
- /**
439
- * Specifies the command text.
440
- */
441
- text: string;
442
- /**
443
- * Specifies the name of the SVG icon that will be rendered for the command.
444
- */
445
- svgIcon?: SVGIcon_2;
446
- }
447
-
448
- /**
449
- * Specifies the default values for Commands view Toolbar.
450
- */
451
- export declare const commandsViewDefaults: AIPromptToolbarItemInterface;
452
-
453
- /**
454
- * Specifies the default values for Output view Toolbar.
455
- */
456
- export declare const outputViewDefaults: AIPromptToolbarItemInterface;
457
-
458
- /**
459
- * Specifies the default values for Prompt view Toolbar.
460
- */
461
- export declare const promptViewDefaults: AIPromptToolbarItemInterface;
462
-
463
- /**
464
- * @hidden
465
- */
466
- declare interface StateActionInterface {
467
- activeView: string;
468
- }
469
-
470
- /**
471
- * @hidden
472
- */
473
- export declare const SuggestionGroup: DefineComponent<ExtractPropTypes< {
474
- suggestions: {
475
- type: PropType<ChatSuggestion[]>;
476
- required: true;
477
- };
478
- onSuggestionClick: {
479
- type: PropType<(event: MouseEvent, suggestion: ChatSuggestion) => void>;
480
- required: true;
481
- };
482
- suggestionsView: {
483
- type: PropType<SuggestionsView>;
484
- default: string;
485
- };
486
- }>, {}, {}, {}, {
487
- handleSuggestionClick(event: MouseEvent, suggestion: ChatSuggestion): void;
488
- handleKeyDown(event: KeyboardEvent, suggestion: ChatSuggestion): void;
489
- }, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
490
- suggestions: {
491
- type: PropType<ChatSuggestion[]>;
492
- required: true;
493
- };
494
- onSuggestionClick: {
495
- type: PropType<(event: MouseEvent, suggestion: ChatSuggestion) => void>;
496
- required: true;
497
- };
498
- suggestionsView: {
499
- type: PropType<SuggestionsView>;
500
- default: string;
501
- };
502
- }>> & Readonly<{}>, {
503
- suggestionsView: SuggestionsView;
504
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
505
-
506
- export declare interface SuggestionGroupProps {
507
- suggestions: ChatSuggestion[];
508
- onSuggestionClick: (event: MouseEvent, suggestion: ChatSuggestion) => void;
509
- }
510
-
511
- /**
512
- * Represents the rendering options for suggestions in the AI Prompt component.
513
- * 'suggestionsView' can be either 'classic' or 'modern'.
514
- * - 'classic': Uses a rectangular styling for suggestions.
515
- * - 'modern': Uses a chip-like styling for suggestions.
516
- */
517
- export declare type SuggestionsView = 'classic' | 'modern';
518
-
519
- export { }
8
+ export * from './ai-prompt/AIPrompt.js';
9
+ export * from './ai-prompt/AIPromptHeader.js';
10
+ export * from './ai-prompt/AIPromptFooter.js';
11
+ export * from './ai-prompt/AIPromptContent.js';
12
+ export * from './ai-prompt/views/AIPromptView.js';
13
+ export * from './ai-prompt/views/AIPromptOutputView.js';
14
+ export * from './ai-prompt/views/AIPromptCommandsView.js';
15
+ export * from './ai-prompt/views/AIPromptViewRender.js';
16
+ export * from './ai-prompt/views/constants.js';
17
+ export * from './chat/components/SuggestionGroup.js';