@progress/kendo-react-conversational-ui 2.11.0-dev.201905141017 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@progress/kendo-react-conversational-ui",["react","@progress/kendo-react-buttons","@progress/kendo-react-common","@progress/kendo-react-intl"],function(r){var i,a,p,c;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){i=e(t)},function(t){a=e(t)},function(t){p=e(t)},function(t){c=e(t)}],execute:function(){function s(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}var n,o;o={},s.m=n=[function(t,e){t.exports=i},function(t,e){t.exports=p},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=(r=n(0).Component,s(a,r),a.prototype.componentDidUpdate=function(t){!t.selected&&this.props.selected&&this.elementToFocus.focus()},a);function a(){return null!==r&&r.apply(this,arguments)||this}e.FocusableUponSelection=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAuthor=function(t,e){return t&&e.author&&t.id===e.author.id}},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=(r=i.Component,s(c,r),c.prototype.componentWillReceiveProps=function(t){!this.props.selected&&t.selected?this.setState(function(t){return t.selectedItemIndex?{}:{selectedItemIndex:0}}):this.props.selected&&!t.selected&&this.setState({selectedItemIndex:null})},c.prototype.navigate=function(t,e){void 0===e&&(e=0);var n=null,o=this.state.selectedItemIndex;return t?null===o?n=e:o<this.getLastSelectionIndex()&&(n=o+1):null===o?n=0:0<o&&(n=o-1),null!==n&&this.setState({selectedItemIndex:n}),n},c.prototype.getLastSelectionIndex=function(){var t=-1;if("action-group"===this.props.group.type){var e=this.props.group;t=e.actions?e.actions.length-1:-1}else if("attachment-group"===this.props.group.type){var n=this.props.group;t=n.attachments?n.attachments.length-1:-1}return t},c);function c(){var s=null!==r&&r.apply(this,arguments)||this;return s.state={selectedItemIndex:null,isKeyboardNavigationLeftRight:!0},s.onRequestContainerSelection=function(){return s.props.onRequestSelection(s.props.group.selectionIndex)},s.onKeyDown=function(t){var e=null,n=s.state.isKeyboardNavigationLeftRight?a.Keys.left:a.Keys.up,o=s.state.isKeyboardNavigationLeftRight?a.Keys.right:a.Keys.down;t.keyCode===n?e=s.navigate(!1):t.keyCode===o&&(e=s.navigate(!0)),null!==e&&(t.preventDefault(),t.stopPropagation())},s}e.SelectableItemsContainer=p},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=(r=n(2).FocusableUponSelection,s(c,r),c.prototype.render=function(){var e=this;return i.createElement("div",{className:this.getClassNames(),tabIndex:this.getTabIndexValue(),onClick:this.props.onClick,ref:function(t){return e.elementToFocus=t}},this.props.template?i.createElement(this.props.template,{item:this.props.item}):i.createElement("div",{className:"k-card"},i.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView(),this.getContentView())))},c.prototype.getTabIndexValue=function(){return void 0===this.props.tabbable?void 0:this.props.tabbable?0:-1},c.prototype.getClassNames=function(){return a.classNames({"k-state-selected":this.props.selected},{"k-state-focused":this.props.selected},"k-card-wrap",{"k-first":this.props.isFirstItemInGroup},{"k-last":this.props.isLastItemInGroup})},c.prototype.getTitleView=function(){return this.props.item.title?i.createElement("h5",{className:"k-card-title"},this.props.item.title):null},c.prototype.getSubtitleView=function(){return this.props.item.subtitle?i.createElement("h6",{className:"k-card-subtitle"},this.props.item.subtitle):null},c.prototype.getContentView=function(){return 0===this.props.item.contentType.indexOf("image/")?i.createElement("img",{src:this.props.item.content}):this.props.item.content},c);function c(){return null!==r&&r.apply(this,arguments)||this}e.default=p},function(t,e){t.exports=c},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=e(8);n.Chat=o.Chat,function(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}(e(20)),function(t){for(var e in t)r(e,t[e])}(n)},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(1),a=n(9),p=n(0),c=n(12),u=n(13),l=n(15),m=n(16),h=n(17),f=n(19),d=(r=p.Component,s(y,r),y.prototype.render=function(){var e=this;return p.createElement("div",{style:{width:this.props.width},onKeyDown:this.onKeyDown,className:this.getClassNames(),ref:function(t){return e.chatWrapperEl=t}},p.createElement("div",{className:"k-message-list k-avatars",onBlur:this.onBlur,onFocus:this.onFocus,role:"log","aria-live":"polite",ref:function(t){return e.viewItemsWrapperEl=t}},p.createElement("div",{className:"k-message-list-content"},this.renderViewItems())),p.createElement(f.default,{user:this.props.user,onMessageSend:this.onMessageSend,isDirectionRightToLeft:this.state.isDirectionRightToLeft,ref:function(t){return e.newMsgComp=t},placeholder:this.props.placeholder}))},y.prototype.componentWillReceiveProps=function(t){this.setState({viewItems:this.getViewItemsFromMsgs(t.messages),isDirectionRightToLeft:this.checkIsDirectionRightToLeft(t)})},y.prototype.componentDidMount=function(){var t=this;this.setState({isDirectionRightToLeft:this.checkIsDirectionRightToLeft(this.props)},function(){t.nextTickId=setTimeout(function(){return t.scrollViewItemsToBottom()},250)})},y.prototype.componentWillUnmount=function(){clearTimeout(this.nextTickId)},y.prototype.componentDidUpdate=function(t){t.messages.length!==this.props.messages.length&&this.scrollViewItemsToBottom()},y.prototype.getClassNames=function(){return i.classNames("k-widget","k-chat",this.props.className,{"k-rtl":!0===this.state.isDirectionRightToLeft})},y.prototype.checkIsDirectionRightToLeft=function(t){return void 0!==t.dir?"rtl"===t.dir:this.chatWrapperEl&&"rtl"===getComputedStyle(this.chatWrapperEl).direction||!1},y.prototype.selectLastViewItemWhenNoCurrentSelection=function(){null===this.state.selectedItemIndex&&this.setState({selectedItemIndex:this.state.viewItems.lastSelectionIndex})},y.prototype.renderViewItems=function(){var n=this,o=this.state.viewItems.length-1;return this.state.viewItems.map(function(t,e){return"date-marker"===t.type?p.createElement(m.default,{item:t,key:e}):"message-group"===t.type?p.createElement(h.default,{group:t,itemTemplate:n.props.messageTemplate,attachmentTemplate:n.props.attachmentTemplate,user:n.props.user,selectedItemIndex:n.state.selectedItemIndex,onRequestSelection:n.onSelectionRequested,isLastGroup:e===o,key:e}):"attachment-group"===t.type?p.createElement(l.default,{group:t,itemTemplate:n.props.attachmentTemplate,onRequestSelection:n.onSelectionRequested,selected:t.selectionIndex===n.state.selectedItemIndex,isLastGroup:e===o,key:e}):"action-group"===t.type?p.createElement(u.default,{group:t,onActionExecute:n.onActionExecute,onRequestSelection:n.onSelectionRequested,selected:t.selectionIndex===n.state.selectedItemIndex,isLastGroup:e===o,key:e}):void 0})},y.prototype.scrollViewItemsToBottom=function(){this.viewItemsWrapperEl&&(this.viewItemsWrapperEl.scrollTop=this.viewItemsWrapperEl.scrollHeight-this.viewItemsWrapperEl.clientHeight)},y.prototype.getViewItemsFromMsgs=function(t){return 0<t.length?c.convertMsgsToViewItems(t):[]},y.propTypes={messages:a.arrayOf(a.object),user:a.object,messageTemplate:a.any,attachmentTemplate:a.any,width:a.oneOfType([a.string,a.number]),onMessageSend:a.func,onActionExecute:a.func,dir:a.string},y.defaultProps={messages:[]},y);function y(t){var o=r.call(this,t)||this;o.onFocus=function(){clearTimeout(o.timeoutIdForChatLosingFocus),o.selectLastViewItemWhenNoCurrentSelection()},o.onBlur=function(){o.timeoutIdForChatLosingFocus=setTimeout(function(){o.setState({selectedItemIndex:null})},0)},o.onSelectionRequested=function(t){o.setState({selectedItemIndex:t})},o.onKeyDown=function(t){var e=null,n=null!==o.state.selectedItemIndex?o.state.selectedItemIndex:o.state.viewItems.lastSelectionIndex;t.keyCode===i.Keys.up?null===n?e=0:0<n&&(e=n-1):t.keyCode===i.Keys.down&&(null===n?e=0:n<o.state.viewItems.lastSelectionIndex&&(e=n+1)),null!==e&&(o.setState({selectedItemIndex:e}),t.preventDefault())},o.onMessageSend=function(t,e){i.dispatchEvent(o.props.onMessageSend,e,o,{message:t})},o.onActionExecute=function(t,e){if(i.dispatchEvent(o.props.onActionExecute,e,o,{action:t}),!e.isDefaultPrevented()){switch(t.type){case"reply":o.onMessageSend({author:o.props.user,text:t.value,timestamp:new Date},e);break;case"call":window.open("tel:"+t.value);break;case"openUrl":window.open(t.value)}o.newMsgComp.focusInput()}};var e=o.getViewItemsFromMsgs(t.messages);return o.state={viewItems:e,selectedItemIndex:null,isDirectionRightToLeft:null},o}e.Chat=d},function(t,e,n){t.exports=n(10)()},function(t,e,n){"use strict";var a=n(11);function o(){}function s(){}s.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,s,r){if(r!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function e(){return t}var n={array:t.isRequired=t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:s,resetWarningCache:o};return n.PropTypes=n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function u(t){return t[t.length-1]}var l=n(3);e.convertMsgsToViewItems=function(t){var e,n,o=t.reduce(function(c){return function(t,a,e){var n,o,s,r,i,p=e===c-1;return function(t,e){var n,o,s=a.timestamp,r=u(t);if(s&&(!r||(n=s,o=r.timestamp,n&&o&&(o.getDate()!==n.getDate()||o.getMonth()!==n.getMonth()||o.getFullYear()!==n.getFullYear())))){var i={type:"date-marker",timestamp:s,trackBy:s.getTime()};t.push(i)}}(t),o=a,s=p,r=u(n=t),i=void 0,o.typing&&!s||(r&&"message-group"===r.type&&(i=r.messages),i&&l.isAuthor(o.author,u(i))?i.push(o):n.push({type:"message-group",messages:[o],author:o.author,timestamp:o.timestamp,trackBy:o})),a.attachments&&1<a.attachments.length&&t.push({type:"attachment-group",attachments:a.attachments,attachmentLayout:a.attachmentLayout,timestamp:a.timestamp,trackBy:a}),a.suggestedActions&&p&&t.push({type:"action-group",actions:a.suggestedActions,timestamp:a.timestamp,trackBy:a}),t}}(t.length),[]);return n=0,(e=o).forEach(function(t){"message-group"===t.type?t.messages.forEach(function(t){t.selectionIndex=n++}):"attachment-group"!==t.type&&"action-group"!==t.type||(t.selectionIndex=n++)}),e.lastSelectionIndex=n-1,o}},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(14),c=(r=n(4).SelectableItemsContainer,s(u,r),u.prototype.render=function(){var n=this,o=this.props.group.actions?this.props.group.actions.length-1:0;return i.createElement("div",{className:this.getClassNames(),onClick:this.onRequestContainerSelection,onKeyDown:this.onKeyDown},this.props.group.actions&&this.props.group.actions.map(function(t,e){return i.createElement(p.default,{item:t,onActionExecute:n.props.onActionExecute,selected:e===n.state.selectedItemIndex,tabbable:n.props.isLastGroup&&e===n.state.selectedItemIndex,isFirstItemInGroup:0===e,isLastItemInGroup:e===o,key:e})}))},u.prototype.getClassNames=function(){return a.classNames("k-quick-replies")},u);function u(t){return r.call(this,t)||this}e.default=c},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(1),c=(r=n(2).FocusableUponSelection,s(u,r),u.prototype.render=function(){var e=this;return i.createElement("span",{className:this.getClassNames(),onClick:function(t){return e.props.onActionExecute(e.props.item,t)},ref:function(t){return e.elementToFocus=t},onKeyDown:this.onKeyDown,tabIndex:this.props.tabbable?0:-1},this.props.item.title||this.props.item.value)},u.prototype.getClassNames=function(){return p.classNames("k-quick-reply",{"k-first":this.props.isFirstItemInGroup},{"k-last":this.props.isLastItemInGroup},{"k-state-selected":this.props.selected},{"k-state-focused":this.props.selected})},u);function u(){var e=null!==r&&r.apply(this,arguments)||this;return e.onKeyDown=function(t){t.keyCode===a.Keys.enter&&e.props.onActionExecute(e.props.item,t)},e}e.default=c},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(5),c=(r=n(4).SelectableItemsContainer,s(u,r),u.prototype.componentWillReceiveProps=function(t){r.prototype.componentWillReceiveProps.call(this,t),this.setState({isKeyboardNavigationLeftRight:this.isCardDeckLayout(t)})},u.prototype.render=function(){var n=this,t=this.isCardDeckLayout(this.props),e=i.createElement("div",{className:this.getClassNames(),onKeyDown:t?void 0:this.onKeyDown},this.props.group.attachments.map(function(t,e){return i.createElement(p.default,{item:t,template:n.props.itemTemplate,selected:e===n.state.selectedItemIndex,tabbable:n.props.isLastGroup&&e===n.state.selectedItemIndex,isFirstItemInGroup:0===e,isLastItemInGroup:e===n.getLastItemIndex(),onClick:function(){return n.onAttachmentClick(e)},key:e})}));return t?i.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:this.onKeyDown},this.getLeftScrollBtn(),e,this.getRightScrollBtn()):e},u.prototype.getLastItemIndex=function(){return this.props.group.attachments.length-1},u.prototype.getLeftScrollBtn=function(){var t=this,e=null;return this.isCardDeckLayout(this.props)&&this.state.selectedItemIndex&&(e=i.createElement("button",{className:"k-button k-button-icon",onClick:function(){return t.onNavigateBtnClick(!1)}},i.createElement("span",{className:"k-icon k-i-arrow-chevron-left"}))),e},u.prototype.getRightScrollBtn=function(){var t=this,e=null;return this.isCardDeckLayout(this.props)&&this.state.selectedItemIndex!==this.getLastItemIndex()&&(e=i.createElement("button",{className:"k-button k-button-icon",onClick:function(){return t.onNavigateBtnClick(!0)}},i.createElement("span",{className:"k-icon k-i-arrow-chevron-right"}))),e},u.prototype.onAttachmentClick=function(t){this.onRequestContainerSelection(),this.setState({selectedItemIndex:t})},u.prototype.onNavigateBtnClick=function(t){this.onRequestContainerSelection(),this.navigate(t,1)},u.prototype.isCardDeckLayout=function(t){return"list"!==t.group.attachmentLayout},u.prototype.getClassNames=function(){return a.classNames({"k-card-deck":this.isCardDeckLayout(this.props)})},u);function u(t){var e=r.call(this,t)||this;return e.state=Object.assign({},e.state,{isKeyboardNavigationLeftRight:e.isCardDeckLayout(e.props)}),e}e.default=c},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(6),p=(r=i.Component,s(c,r),c.prototype.render=function(){var t=this.props.item;return i.createElement("div",{className:"k-timestamp"},a.provideIntlService(this).formatDate(t.timestamp,"D"))},c);function c(){return null!==r&&r.apply(this,arguments)||this}e.default=p,a.registerForIntl(p)},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(18),c=n(5),u=n(3),l=(r=i.Component,s(m,r),m.prototype.render=function(){return i.createElement("div",{className:this.getMsgGroupClassNames()},this.getAvatarView(),this.getAuthorNameView(),this.getGroupMessagesView())},m.prototype.getMsgGroupClassNames=function(){return a.classNames("k-message-group",{"k-no-avatar":!this.props.group.author.avatarUrl,"k-alt":u.isAuthor(this.props.user,this.props.group.messages[0])})},m.prototype.getAvatarView=function(){var t=null;return this.props.group.author.avatarUrl&&(t=i.createElement("img",{src:this.props.group.author.avatarUrl,className:"k-avatar"})),t},m.prototype.getAuthorNameView=function(){var t=null;return this.props.group.author.name&&(t=i.createElement("p",{className:"k-author"},this.props.group.author.name)),t},m.prototype.getGroupMessagesView=function(){var o=this,s=this.props.group.messages.length-1;return this.props.group.messages.map(function(t,e){var n=[i.createElement(p.default,{item:t,template:o.props.itemTemplate,selected:t.selectionIndex===o.props.selectedItemIndex,onRequestSelection:o.props.onRequestSelection,tabbable:e===s&&o.props.isLastGroup,isFirstItemInGroup:0===e,isLastItemInGroup:e===s,isOnlyItemInGroup:0==s,key:e})];return t.attachments&&1===t.attachments.length&&n.push(i.createElement(c.default,{item:t.attachments[0],template:o.props.attachmentTemplate,selected:!1,key:"att-"+e})),n})},m);function m(){return null!==r&&r.apply(this,arguments)||this}e.default=l},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(6),c=(r=n(2).FocusableUponSelection,s(u,r),u.prototype.render=function(){var e=this;return i.createElement("div",{className:this.getClassNames(),tabIndex:this.props.tabbable?0:-1,onClick:function(){return e.props.onRequestSelection(e.props.item.selectionIndex)},onFocus:function(){return e.props.onRequestSelection(e.props.item.selectionIndex)},ref:function(t){return e.elementToFocus=t}},this.getTimestampView(),this.getMainView(),this.getStatusView())},u.prototype.getMainView=function(){return this.props.item.typing?i.createElement("div",{className:"k-bubble"},i.createElement("div",{className:"k-typing-indicator"},i.createElement("span",null),i.createElement("span",null),i.createElement("span",null))):this.props.template?i.createElement(this.props.template,{item:this.props.item}):this.props.item.text?i.createElement("div",{className:"k-bubble"},this.props.item.text):null},u.prototype.getTimestampView=function(){var t=null;return this.props.item.timestamp&&(t=i.createElement("time",{className:"k-message-time","aria-hidden":!this.props.selected},p.provideIntlService(this).formatDate(this.props.item.timestamp,"g"))),t},u.prototype.getStatusView=function(){var t=null;return this.props.item.status&&(t=i.createElement("span",{className:"k-message-status"},this.props.item.status)),t},u.prototype.getClassNames=function(){return a.classNames({"k-only":this.props.isOnlyItemInGroup},{"k-first":this.props.isFirstItemInGroup&&!this.props.isOnlyItemInGroup},{"k-last":this.props.isLastItemInGroup&&!this.props.isOnlyItemInGroup},{"k-state-selected":this.props.selected},{"k-state-focused":this.props.selected},"k-message")},u);function u(){return null!==r&&r.apply(this,arguments)||this}e.default=c,p.registerForIntl(c)},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(1),a=n(0),p=(r=a.Component,s(c,r),c.prototype.render=function(){var e=this;return a.createElement("div",{className:"k-message-box"},a.createElement("input",{type:"text",className:this.getClassNames(),placeholder:this.props.placeholder,onKeyDown:this.onInputKeyDown,onFocus:function(){return e.setState({focused:!0})},onBlur:function(){return e.setState({focused:!1})},ref:function(t){return e.inputEl=t}}),a.createElement("button",{className:"k-button k-flat k-button-icon k-button-send",onClick:this.sendMessage,"aria-label":"Send...",dir:this.props.isDirectionRightToLeft?"rtl":void 0},a.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 16 16"},a.createElement("path",{d:c.buttonIconPath}))))},c.prototype.focusInput=function(){this.inputEl.focus()},c.prototype.getClassNames=function(){return i.classNames({"k-state-focused":this.state.focused},"k-input")},c.buttonIconPath="M0,14.3c-0.1,0.6,0.3,0.8,0.8,0.6l14.8-6.5c0.5-0.2,0.5-0.6,0-0.8L0.8,1.1C0.3,0.9-0.1,1.1,0,1.7l0.7,4.2C0.8,6.5,1.4,7,1.9,7.1l8.8,0.8c0.6,0.1,0.6,0.1,0,0.2L1.9,8.9C1.4,9,0.8,9.5,0.7,10.1L0,14.3z",c);function c(){var o=null!==r&&r.apply(this,arguments)||this;return o.state={focused:!1},o.onInputKeyDown=function(t){t.keyCode===i.Keys.enter&&o.sendMessage(t)},o.sendMessage=function(t){if(o.props.onMessageSend){var e=o.inputEl.value;if(e){var n={author:o.props.user,text:e,timestamp:new Date};o.props.onMessageSend(n,t)}}o.inputEl.focus(),o.inputEl.value=null},o}e.default=p},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(21),p=n(1),c=(r=i.Component,s(u,r),u.prototype.render=function(){return i.createElement("div",{className:"k-card"},i.createElement("img",{className:"k-card-image",src:this.props.imageUrl,style:{maxWidth:this.props.imageMaxWidth}}),i.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView()),i.createElement("div",{className:"k-card-actions k-card-actions-vertical"},this.getActionsView()))},u.prototype.getActionsView=function(){var n=this;return this.props.actions.map(function(e,t){return i.createElement("span",{className:"k-card-action",key:t},i.createElement(a.Button,{look:"flat",onClick:function(t){return n.onBtnClick(e,t)}},e.title))})},u.prototype.getTitleView=function(){var t=null;return this.props.title&&(t=i.createElement("h5",{className:"k-card-title"},this.props.title)),t},u.prototype.getSubtitleView=function(){var t=null;return this.props.subtitle&&(t=i.createElement("h6",{className:"k-card-subtitle"},this.props.subtitle)),t},u);function u(){var n=null!==r&&r.apply(this,arguments)||this;return n.onBtnClick=function(t,e){p.dispatchEvent(n.props.onActionExecute,e,n,{action:t})},n}e.HeroCard=c},function(t,e){t.exports=a}],s.c=o,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=7)}}});
|
|
1
|
+
System.register("@progress/kendo-react-conversational-ui",["react","@progress/kendo-react-common","@progress/kendo-react-buttons","@progress/kendo-react-intl"],function(r){var i,a,p,c;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){i=e(t)},function(t){a=e(t)},function(t){p=e(t)},function(t){c=e(t)}],execute:function(){function s(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}var n,o;o={},s.m=n=[function(t,e){t.exports=i},function(t,e){t.exports=a},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=(r=n(0).Component,s(a,r),a.prototype.componentDidUpdate=function(t){!t.selected&&this.props.selected&&this.elementToFocus.focus()},a);function a(){return null!==r&&r.apply(this,arguments)||this}e.FocusableUponSelection=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAuthor=function(t,e){return t&&e.author&&t.id===e.author.id}},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=(r=i.Component,s(c,r),c.prototype.componentWillReceiveProps=function(t){!this.props.selected&&t.selected?this.setState(function(t){return t.selectedItemIndex?{}:{selectedItemIndex:0}}):this.props.selected&&!t.selected&&this.setState({selectedItemIndex:null})},c.prototype.navigate=function(t,e){void 0===e&&(e=0);var n=null,o=this.state.selectedItemIndex;return t?null===o?n=e:o<this.getLastSelectionIndex()&&(n=o+1):null===o?n=0:0<o&&(n=o-1),null!==n&&this.setState({selectedItemIndex:n}),n},c.prototype.getLastSelectionIndex=function(){var t=-1;if("action-group"===this.props.group.type){var e=this.props.group;t=e.actions?e.actions.length-1:-1}else if("attachment-group"===this.props.group.type){var n=this.props.group;t=n.attachments?n.attachments.length-1:-1}return t},c);function c(){var s=null!==r&&r.apply(this,arguments)||this;return s.state={selectedItemIndex:null,isKeyboardNavigationLeftRight:!0},s.onRequestContainerSelection=function(){return s.props.onRequestSelection(s.props.group.selectionIndex)},s.onKeyDown=function(t){var e=null,n=s.state.isKeyboardNavigationLeftRight?a.Keys.left:a.Keys.up,o=s.state.isKeyboardNavigationLeftRight?a.Keys.right:a.Keys.down;t.keyCode===n?e=s.navigate(!1):t.keyCode===o&&(e=s.navigate(!0)),null!==e&&(t.preventDefault(),t.stopPropagation())},s}e.SelectableItemsContainer=p},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=(r=n(2).FocusableUponSelection,s(c,r),c.prototype.render=function(){var e=this;return i.createElement("div",{className:this.getClassNames(),tabIndex:this.getTabIndexValue(),onClick:this.props.onClick,ref:function(t){return e.elementToFocus=t}},this.props.template?i.createElement(this.props.template,{item:this.props.item}):i.createElement("div",{className:"k-card"},i.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView(),this.getContentView())))},c.prototype.getTabIndexValue=function(){return void 0===this.props.tabbable?void 0:this.props.tabbable?0:-1},c.prototype.getClassNames=function(){return a.classNames({"k-state-selected":this.props.selected},{"k-state-focused":this.props.selected},"k-card-wrap",{"k-first":this.props.isFirstItemInGroup},{"k-last":this.props.isLastItemInGroup})},c.prototype.getTitleView=function(){return this.props.item.title?i.createElement("h5",{className:"k-card-title"},this.props.item.title):null},c.prototype.getSubtitleView=function(){return this.props.item.subtitle?i.createElement("h6",{className:"k-card-subtitle"},this.props.item.subtitle):null},c.prototype.getContentView=function(){return 0===this.props.item.contentType.indexOf("image/")?i.createElement("img",{src:this.props.item.content}):this.props.item.content},c);function c(){return null!==r&&r.apply(this,arguments)||this}e.default=p},function(t,e){t.exports=c},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=e(8);n.Chat=o.Chat,function(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}(e(20)),function(t){for(var e in t)r(e,t[e])}(n)},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(1),a=n(9),p=n(0),c=n(12),u=n(13),l=n(15),m=n(16),h=n(17),f=n(19),d=(r=p.Component,s(y,r),y.prototype.render=function(){var e=this;return p.createElement("div",{style:{width:this.props.width},onKeyDown:this.onKeyDown,className:this.getClassNames(),ref:function(t){return e.chatWrapperEl=t}},p.createElement("div",{className:"k-message-list k-avatars",onBlur:this.onBlur,onFocus:this.onFocus,role:"log","aria-live":"polite",ref:function(t){return e.viewItemsWrapperEl=t}},p.createElement("div",{className:"k-message-list-content"},this.renderViewItems())),p.createElement(f.default,{user:this.props.user,onMessageSend:this.onMessageSend,isDirectionRightToLeft:this.state.isDirectionRightToLeft,ref:function(t){return e.newMsgComp=t},placeholder:this.props.placeholder}))},y.prototype.componentWillReceiveProps=function(t){this.setState({viewItems:this.getViewItemsFromMsgs(t.messages),isDirectionRightToLeft:this.checkIsDirectionRightToLeft(t)})},y.prototype.componentDidMount=function(){var t=this;this.setState({isDirectionRightToLeft:this.checkIsDirectionRightToLeft(this.props)},function(){t.nextTickId=setTimeout(function(){return t.scrollViewItemsToBottom()},250)})},y.prototype.componentWillUnmount=function(){clearTimeout(this.nextTickId)},y.prototype.componentDidUpdate=function(t){t.messages.length!==this.props.messages.length&&this.scrollViewItemsToBottom()},y.prototype.getClassNames=function(){return i.classNames("k-widget","k-chat",this.props.className,{"k-rtl":!0===this.state.isDirectionRightToLeft})},y.prototype.checkIsDirectionRightToLeft=function(t){return void 0!==t.dir?"rtl"===t.dir:this.chatWrapperEl&&"rtl"===getComputedStyle(this.chatWrapperEl).direction||!1},y.prototype.selectLastViewItemWhenNoCurrentSelection=function(){null===this.state.selectedItemIndex&&this.setState({selectedItemIndex:this.state.viewItems.lastSelectionIndex})},y.prototype.renderViewItems=function(){var n=this,o=this.state.viewItems.length-1;return this.state.viewItems.map(function(t,e){return"date-marker"===t.type?p.createElement(m.default,{item:t,key:e}):"message-group"===t.type?p.createElement(h.default,{group:t,itemTemplate:n.props.messageTemplate,attachmentTemplate:n.props.attachmentTemplate,user:n.props.user,selectedItemIndex:n.state.selectedItemIndex,onRequestSelection:n.onSelectionRequested,isLastGroup:e===o,key:e}):"attachment-group"===t.type?p.createElement(l.default,{group:t,itemTemplate:n.props.attachmentTemplate,onRequestSelection:n.onSelectionRequested,selected:t.selectionIndex===n.state.selectedItemIndex,isLastGroup:e===o,key:e}):"action-group"===t.type?p.createElement(u.default,{group:t,onActionExecute:n.onActionExecute,onRequestSelection:n.onSelectionRequested,selected:t.selectionIndex===n.state.selectedItemIndex,isLastGroup:e===o,key:e}):void 0})},y.prototype.scrollViewItemsToBottom=function(){this.viewItemsWrapperEl&&(this.viewItemsWrapperEl.scrollTop=this.viewItemsWrapperEl.scrollHeight-this.viewItemsWrapperEl.clientHeight)},y.prototype.getViewItemsFromMsgs=function(t){return 0<t.length?c.convertMsgsToViewItems(t):[]},y.propTypes={messages:a.arrayOf(a.object),user:a.object,messageTemplate:a.any,attachmentTemplate:a.any,width:a.oneOfType([a.string,a.number]),onMessageSend:a.func,onActionExecute:a.func,dir:a.string},y.defaultProps={messages:[]},y);function y(t){var o=r.call(this,t)||this;o.onFocus=function(){clearTimeout(o.timeoutIdForChatLosingFocus),o.selectLastViewItemWhenNoCurrentSelection()},o.onBlur=function(){o.timeoutIdForChatLosingFocus=setTimeout(function(){o.setState({selectedItemIndex:null})},0)},o.onSelectionRequested=function(t){o.setState({selectedItemIndex:t})},o.onKeyDown=function(t){var e=null,n=null!==o.state.selectedItemIndex?o.state.selectedItemIndex:o.state.viewItems.lastSelectionIndex;t.keyCode===i.Keys.up?null===n?e=0:0<n&&(e=n-1):t.keyCode===i.Keys.down&&(null===n?e=0:n<o.state.viewItems.lastSelectionIndex&&(e=n+1)),null!==e&&(o.setState({selectedItemIndex:e}),t.preventDefault())},o.onMessageSend=function(t,e){i.dispatchEvent(o.props.onMessageSend,e,o,{message:t})},o.onActionExecute=function(t,e){if(i.dispatchEvent(o.props.onActionExecute,e,o,{action:t}),!e.isDefaultPrevented()){switch(t.type){case"reply":o.onMessageSend({author:o.props.user,text:t.value,timestamp:new Date},e);break;case"call":window.open("tel:"+t.value);break;case"openUrl":window.open(t.value)}o.newMsgComp.focusInput()}};var e=o.getViewItemsFromMsgs(t.messages);return o.state={viewItems:e,selectedItemIndex:null,isDirectionRightToLeft:null},o}e.Chat=d},function(t,e,n){t.exports=n(10)()},function(t,e,n){"use strict";var a=n(11);function o(){}function s(){}s.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,s,r){if(r!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function e(){return t}var n={array:t.isRequired=t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:s,resetWarningCache:o};return n.PropTypes=n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function u(t){return t[t.length-1]}var l=n(3);e.convertMsgsToViewItems=function(t){var e,n,o=t.reduce(function(c){return function(t,a,e){var n,o,s,r,i,p=e===c-1;return function(t,e){var n,o,s=a.timestamp,r=u(t);if(s&&(!r||(n=s,o=r.timestamp,n&&o&&(o.getDate()!==n.getDate()||o.getMonth()!==n.getMonth()||o.getFullYear()!==n.getFullYear())))){var i={type:"date-marker",timestamp:s,trackBy:s.getTime()};t.push(i)}}(t),o=a,s=p,r=u(n=t),i=void 0,o.typing&&!s||(r&&"message-group"===r.type&&(i=r.messages),i&&l.isAuthor(o.author,u(i))?i.push(o):n.push({type:"message-group",messages:[o],author:o.author,timestamp:o.timestamp,trackBy:o})),a.attachments&&1<a.attachments.length&&t.push({type:"attachment-group",attachments:a.attachments,attachmentLayout:a.attachmentLayout,timestamp:a.timestamp,trackBy:a}),a.suggestedActions&&p&&t.push({type:"action-group",actions:a.suggestedActions,timestamp:a.timestamp,trackBy:a}),t}}(t.length),[]);return n=0,(e=o).forEach(function(t){"message-group"===t.type?t.messages.forEach(function(t){t.selectionIndex=n++}):"attachment-group"!==t.type&&"action-group"!==t.type||(t.selectionIndex=n++)}),e.lastSelectionIndex=n-1,o}},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(14),c=(r=n(4).SelectableItemsContainer,s(u,r),u.prototype.render=function(){var n=this,o=this.props.group.actions?this.props.group.actions.length-1:0;return i.createElement("div",{className:this.getClassNames(),onClick:this.onRequestContainerSelection,onKeyDown:this.onKeyDown},this.props.group.actions&&this.props.group.actions.map(function(t,e){return i.createElement(p.default,{item:t,onActionExecute:n.props.onActionExecute,selected:e===n.state.selectedItemIndex,tabbable:n.props.isLastGroup&&e===n.state.selectedItemIndex,isFirstItemInGroup:0===e,isLastItemInGroup:e===o,key:e})}))},u.prototype.getClassNames=function(){return a.classNames("k-quick-replies")},u);function u(t){return r.call(this,t)||this}e.default=c},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(1),c=(r=n(2).FocusableUponSelection,s(u,r),u.prototype.render=function(){var e=this;return i.createElement("span",{className:this.getClassNames(),onClick:function(t){return e.props.onActionExecute(e.props.item,t)},ref:function(t){return e.elementToFocus=t},onKeyDown:this.onKeyDown,tabIndex:this.props.tabbable?0:-1},this.props.item.title||this.props.item.value)},u.prototype.getClassNames=function(){return p.classNames("k-quick-reply",{"k-first":this.props.isFirstItemInGroup},{"k-last":this.props.isLastItemInGroup},{"k-state-selected":this.props.selected},{"k-state-focused":this.props.selected})},u);function u(){var e=null!==r&&r.apply(this,arguments)||this;return e.onKeyDown=function(t){t.keyCode===a.Keys.enter&&e.props.onActionExecute(e.props.item,t)},e}e.default=c},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(5),c=(r=n(4).SelectableItemsContainer,s(u,r),u.prototype.componentWillReceiveProps=function(t){r.prototype.componentWillReceiveProps.call(this,t),this.setState({isKeyboardNavigationLeftRight:this.isCardDeckLayout(t)})},u.prototype.render=function(){var n=this,t=this.isCardDeckLayout(this.props),e=i.createElement("div",{className:this.getClassNames(),onKeyDown:t?void 0:this.onKeyDown},this.props.group.attachments.map(function(t,e){return i.createElement(p.default,{item:t,template:n.props.itemTemplate,selected:e===n.state.selectedItemIndex,tabbable:n.props.isLastGroup&&e===n.state.selectedItemIndex,isFirstItemInGroup:0===e,isLastItemInGroup:e===n.getLastItemIndex(),onClick:function(){return n.onAttachmentClick(e)},key:e})}));return t?i.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:this.onKeyDown},this.getLeftScrollBtn(),e,this.getRightScrollBtn()):e},u.prototype.getLastItemIndex=function(){return this.props.group.attachments.length-1},u.prototype.getLeftScrollBtn=function(){var t=this,e=null;return this.isCardDeckLayout(this.props)&&this.state.selectedItemIndex&&(e=i.createElement("button",{className:"k-button k-button-icon",onClick:function(){return t.onNavigateBtnClick(!1)}},i.createElement("span",{className:"k-icon k-i-arrow-chevron-left"}))),e},u.prototype.getRightScrollBtn=function(){var t=this,e=null;return this.isCardDeckLayout(this.props)&&this.state.selectedItemIndex!==this.getLastItemIndex()&&(e=i.createElement("button",{className:"k-button k-button-icon",onClick:function(){return t.onNavigateBtnClick(!0)}},i.createElement("span",{className:"k-icon k-i-arrow-chevron-right"}))),e},u.prototype.onAttachmentClick=function(t){this.onRequestContainerSelection(),this.setState({selectedItemIndex:t})},u.prototype.onNavigateBtnClick=function(t){this.onRequestContainerSelection(),this.navigate(t,1)},u.prototype.isCardDeckLayout=function(t){return"list"!==t.group.attachmentLayout},u.prototype.getClassNames=function(){return a.classNames({"k-card-deck":this.isCardDeckLayout(this.props)})},u);function u(t){var e=r.call(this,t)||this;return e.state=Object.assign({},e.state,{isKeyboardNavigationLeftRight:e.isCardDeckLayout(e.props)}),e}e.default=c},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(6),p=(r=i.Component,s(c,r),c.prototype.render=function(){var t=this.props.item;return i.createElement("div",{className:"k-timestamp"},a.provideIntlService(this).formatDate(t.timestamp,"D"))},c);function c(){return null!==r&&r.apply(this,arguments)||this}e.default=p,a.registerForIntl(p)},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(18),c=n(5),u=n(3),l=(r=i.Component,s(m,r),m.prototype.render=function(){return i.createElement("div",{className:this.getMsgGroupClassNames()},this.getAvatarView(),this.getAuthorNameView(),this.getGroupMessagesView())},m.prototype.getMsgGroupClassNames=function(){return a.classNames("k-message-group",{"k-no-avatar":!this.props.group.author.avatarUrl,"k-alt":u.isAuthor(this.props.user,this.props.group.messages[0])})},m.prototype.getAvatarView=function(){var t=null;return this.props.group.author.avatarUrl&&(t=i.createElement("img",{src:this.props.group.author.avatarUrl,className:"k-avatar"})),t},m.prototype.getAuthorNameView=function(){var t=null;return this.props.group.author.name&&(t=i.createElement("p",{className:"k-author"},this.props.group.author.name)),t},m.prototype.getGroupMessagesView=function(){var o=this,s=this.props.group.messages.length-1;return this.props.group.messages.map(function(t,e){var n=[i.createElement(p.default,{item:t,template:o.props.itemTemplate,selected:t.selectionIndex===o.props.selectedItemIndex,onRequestSelection:o.props.onRequestSelection,tabbable:e===s&&o.props.isLastGroup,isFirstItemInGroup:0===e,isLastItemInGroup:e===s,isOnlyItemInGroup:0==s,key:e})];return t.attachments&&1===t.attachments.length&&n.push(i.createElement(c.default,{item:t.attachments[0],template:o.props.attachmentTemplate,selected:!1,key:"att-"+e})),n})},m);function m(){return null!==r&&r.apply(this,arguments)||this}e.default=l},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(1),p=n(6),c=(r=n(2).FocusableUponSelection,s(u,r),u.prototype.render=function(){var e=this;return i.createElement("div",{className:this.getClassNames(),tabIndex:this.props.tabbable?0:-1,onClick:function(){return e.props.onRequestSelection(e.props.item.selectionIndex)},onFocus:function(){return e.props.onRequestSelection(e.props.item.selectionIndex)},ref:function(t){return e.elementToFocus=t}},this.getTimestampView(),this.getMainView(),this.getStatusView())},u.prototype.getMainView=function(){return this.props.item.typing?i.createElement("div",{className:"k-bubble"},i.createElement("div",{className:"k-typing-indicator"},i.createElement("span",null),i.createElement("span",null),i.createElement("span",null))):this.props.template?i.createElement(this.props.template,{item:this.props.item}):this.props.item.text?i.createElement("div",{className:"k-bubble"},this.props.item.text):null},u.prototype.getTimestampView=function(){var t=null;return this.props.item.timestamp&&(t=i.createElement("time",{className:"k-message-time","aria-hidden":!this.props.selected},p.provideIntlService(this).formatDate(this.props.item.timestamp,"g"))),t},u.prototype.getStatusView=function(){var t=null;return this.props.item.status&&(t=i.createElement("span",{className:"k-message-status"},this.props.item.status)),t},u.prototype.getClassNames=function(){return a.classNames({"k-only":this.props.isOnlyItemInGroup},{"k-first":this.props.isFirstItemInGroup&&!this.props.isOnlyItemInGroup},{"k-last":this.props.isLastItemInGroup&&!this.props.isOnlyItemInGroup},{"k-state-selected":this.props.selected},{"k-state-focused":this.props.selected},"k-message")},u);function u(){return null!==r&&r.apply(this,arguments)||this}e.default=c,p.registerForIntl(c)},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(1),a=n(0),p=(r=a.Component,s(c,r),c.prototype.render=function(){var e=this;return a.createElement("div",{className:"k-message-box"},a.createElement("input",{type:"text",className:this.getClassNames(),placeholder:this.props.placeholder,onKeyDown:this.onInputKeyDown,onFocus:function(){return e.setState({focused:!0})},onBlur:function(){return e.setState({focused:!1})},ref:function(t){return e.inputEl=t}}),a.createElement("button",{className:"k-button k-flat k-button-icon k-button-send",onClick:this.sendMessage,"aria-label":"Send...",dir:this.props.isDirectionRightToLeft?"rtl":void 0},a.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 16 16"},a.createElement("path",{d:c.buttonIconPath}))))},c.prototype.focusInput=function(){this.inputEl.focus()},c.prototype.getClassNames=function(){return i.classNames({"k-state-focused":this.state.focused},"k-input")},c.buttonIconPath="M0,14.3c-0.1,0.6,0.3,0.8,0.8,0.6l14.8-6.5c0.5-0.2,0.5-0.6,0-0.8L0.8,1.1C0.3,0.9-0.1,1.1,0,1.7l0.7,4.2C0.8,6.5,1.4,7,1.9,7.1l8.8,0.8c0.6,0.1,0.6,0.1,0,0.2L1.9,8.9C1.4,9,0.8,9.5,0.7,10.1L0,14.3z",c);function c(){var o=null!==r&&r.apply(this,arguments)||this;return o.state={focused:!1},o.onInputKeyDown=function(t){t.keyCode===i.Keys.enter&&o.sendMessage(t)},o.sendMessage=function(t){if(o.props.onMessageSend){var e=o.inputEl.value;if(e){var n={author:o.props.user,text:e,timestamp:new Date};o.props.onMessageSend(n,t)}}o.inputEl.focus(),o.inputEl.value=null},o}e.default=p},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),a=n(21),p=n(1),c=(r=i.Component,s(u,r),u.prototype.render=function(){return i.createElement("div",{className:"k-card"},i.createElement("img",{className:"k-card-image",src:this.props.imageUrl,style:{maxWidth:this.props.imageMaxWidth}}),i.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView()),i.createElement("div",{className:"k-card-actions k-card-actions-vertical"},this.getActionsView()))},u.prototype.getActionsView=function(){var n=this;return this.props.actions.map(function(e,t){return i.createElement("span",{className:"k-card-action",key:t},i.createElement(a.Button,{look:"flat",onClick:function(t){return n.onBtnClick(e,t)}},e.title))})},u.prototype.getTitleView=function(){var t=null;return this.props.title&&(t=i.createElement("h5",{className:"k-card-title"},this.props.title)),t},u.prototype.getSubtitleView=function(){var t=null;return this.props.subtitle&&(t=i.createElement("h6",{className:"k-card-subtitle"},this.props.subtitle)),t},u);function u(){var n=null!==r&&r.apply(this,arguments)||this;return n.onBtnClick=function(t,e){p.dispatchEvent(n.props.onActionExecute,e,n,{action:t})},n}e.HeroCard=c},function(t,e){t.exports=p}],s.c=o,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=7)}}});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-conversational-ui",
|
|
3
3
|
"description": "KendoReact Conversational UI components",
|
|
4
|
-
"version": "2.11.0
|
|
4
|
+
"version": "2.11.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/telerik/kendo-react.git"
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"react-dom": "^16.8.2"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@progress/kendo-react-common": "2.11.0
|
|
34
|
+
"@progress/kendo-react-common": "2.11.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@progress/kendo-react-buttons": "2.11.0
|
|
38
|
-
"@progress/kendo-react-dateinputs": "2.11.0
|
|
39
|
-
"@progress/kendo-react-intl": "2.11.0
|
|
37
|
+
"@progress/kendo-react-buttons": "2.11.0",
|
|
38
|
+
"@progress/kendo-react-dateinputs": "2.11.0",
|
|
39
|
+
"@progress/kendo-react-intl": "2.11.0",
|
|
40
40
|
"adaptivecards": "^1.0.0",
|
|
41
41
|
"botframework-directlinejs": "^0.9.15"
|
|
42
42
|
},
|