@telia-ace/widget-conversation 1.0.34-experimental.19 → 1.0.34-experimental.20

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.
@@ -20,7 +20,7 @@ import { LitElement as v, html as c, nothing as u, css as M, unsafeCSS as A } fr
20
20
  import { property as i, state as E } from "lit/decorators.js";
21
21
  import { classMap as f } from "lit/directives/class-map.js";
22
22
  import { createRef as U, ref as I } from "lit/directives/ref.js";
23
- import { ConversationMessageType as b, ConversationMessageListItemType as g } from "./index.js";
23
+ import { ConversationMessageType as y, ConversationMessageListItemType as g } from "./index.js";
24
24
  import { spread as q } from "@open-wc/lit-helpers";
25
25
  import { html as l, unsafeStatic as B } from "lit/static-html.js";
26
26
  import "@telia-ace/widget-services";
@@ -28,7 +28,7 @@ import "@telia-ace/widget-utilities";
28
28
  import "@telia-ace/widget-forms";
29
29
  import "@telia-ace/widget-plugins";
30
30
  import "react";
31
- const K = `:host{--send-button-color: #a6a6a6}.wrapper{position:absolute;inset:0;overflow:hidden;display:flex;flex-direction:column;overflow-y:auto}.scrollable{display:flex;flex-direction:column;align-items:stretch;padding:0 var(--size-medium)}.scrollable:focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent}.message-container{display:flex}.message-container-left{justify-content:start}.message-container-center{justify-content:center}.message-container-right{justify-content:end}.conversation-entry{margin:0;margin-bottom:var(--size-medium)}.conversation-entry:first-of-type{margin-top:var(--size-medium)}.conversation-entry:last-of-type{padding-bottom:var(--size-medium)}.conversation-entry span,.conversation-entry p,.conversation-entry a,.conversation-entry div{font-weight:300}.conversation-entry b,.conversation-entry h1{font-weight:400}.conversation-entry .agent-message{display:grid;margin-right:10%;width:90%;grid-template-columns:1fr;grid-template-rows:1fr auto;grid-template-areas:"content" "info"}.conversation-entry .agent-message.has-avatar{grid-template-columns:auto 1fr;grid-template-rows:1fr auto;grid-template-areas:"avatar content" ". info"}.conversation-entry .user-message{margin-left:10%;width:90%;display:flex;flex-direction:column;align-items:flex-end}.conversation-entry .content-bundle{grid-area:content;max-width:100%;overflow:hidden}.conversation-entry .timestamp{font-size:var(--fonts-small);color:var(--colors-text);font-weight:300;margin:0;line-height:1.5em;grid-area:info}.content{display:inline-block;margin-top:var(--size-normal);max-width:100%}.content>*{overflow-wrap:break-word;word-wrap:break-word;word-break:break-all;word-break:break-word;hyphens:auto}.content.full-width{width:100%}.content.padded{padding:var(--sized-medium)}.content.user.stacked{background-color:var(--colors-primary);color:var(--colors-accent);border-top-left-radius:var(--borderRadius);border-bottom-left-radius:var(--borderRadius)}.content.user.stacked.stacked-first{border-top-right-radius:var(--borderRadius)}.content.user.stacked.stacked-last{border-bottom-right-radius:var(--borderRadius)}.content.stacked:not(.user){background-color:var(--colors-accent);color:var(--colors-text);border:var(--border, "none");border-top-right-radius:var(--borderRadius);border-bottom-right-radius:var(--borderRadius)}.content.stacked:not(.user).stacked-first{border-top-left-radius:var(--borderRadius)}.content.stacked:not(.user).stacked-last{border-bottom-left-radius:var(--borderRadius)}.message-type-text{margin:var(--size-medium) 0;padding:0 var(--size-medium)}.message-type-html{font-size:var(--fonts-normal);font-weight:300;line-height:1.5em;color:var(--colors-text);margin:var(--size-medium) 0;padding:0 var(--size-medium);color:inherit}.message-type-html h1,.message-type-html h2,.message-type-html h3,.message-type-html h4,.message-type-html h5,.message-type-html h6{word-break:break-word}.message-type-html h1:first-child,.message-type-html h2:first-child,.message-type-html h3:first-child,.message-type-html h4:first-child,.message-type-html h5:first-child,.message-type-html h6:first-child{margin-top:0}.message-type-html h1:only-child,.message-type-html h2:only-child,.message-type-html h3:only-child,.message-type-html h4:only-child,.message-type-html h5:only-child,.message-type-html h6:only-child{margin:0}.message-type-html h1:last-child,.message-type-html h2:last-child,.message-type-html h3:last-child,.message-type-html h4:last-child,.message-type-html h5:last-child,.message-type-html h6:last-child{margin-bottom:0}.message-type-html a:focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent;text-decoration:underline}.message-type-html img{max-width:100%!important;height:auto!important}.message-type-html p{word-break:break-word;margin:var(--size-normal) 0}.message-type-html p:first-child{margin:0 0 var(--size-normal)}.message-type-html p:last-child{margin:var(--size-normal) 0 0}.message-type-html p:only-child{margin:0}.message-type-html a{color:var(--colors-link)}.message-type-html a:focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent}.message-type-separator{width:100%;border-bottom:var(--border)}.message-type-button-list{margin:var(--size-medium) 0;padding:0 var(--size-medium)}.message-type-button-list ul{list-style:none;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:var(--size-normal)}.message-type-button-list ul>li{margin:0}.message-type-button-list-button{text-align:center;font-weight:300;border-radius:var(--borderRadius);font-family:inherit;font-size:var(--fonts-normal);display:block;padding:var(--size-normal);background-color:var(--colors-primary);width:100%;color:#fff;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-size:inherit;border:none}.message-type-button-list-button:focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent;background-color:transparent}.message-type-button-list-button i,.message-type-button-list-button svg{margin-right:var(--size-small)}.message-type-link-list{margin:var(--size-medium) 0;padding:0 var(--size-medium)}.message-type-link-list h1{white-space:normal;font-size:var(--fonts-medium);font-weight:400;margin:0 0 var(--size-normal);color:var(--colors-text);line-height:1.8em}.message-type-link-list ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:var(--size-normal)}.message-type-link-list ul>li{margin:0}.message-type-link-list-button{display:block;text-align:left;font-weight:300;color:var(--colors-primary);max-width:100%;text-overflow:ellipsis;overflow:hidden;background-color:transparent;cursor:pointer;font-size:inherit;border:none}.message-list{list-style:none;padding:0;margin:0}.message-list .message-list-item p{padding:0;margin:0}.conversation-input{display:flex;align-items:center;background-color:var(--colors-accent);border-top:var(--inputBorder)}.conversation-input.has-content{--send-button-color: var(--colors-primary)}.conversation-input input{flex:1;border:none;background-color:transparent;font-weight:300;font-size:var(--fonts-normal);line-height:1.2em;outline:none;padding:var(--size-medium);color:var(--colors-text)}.conversation-input input::placeholder{color:var(--colors-textLight);font-style:italic}.conversation-input button{flex:0 0 50px;align-self:stretch;background-color:transparent;display:flex;align-items:center;justify-content:center;border:none;color:var(--send-button-color)}conversation-content{flex:0 1 100%;overflow-y:auto;overflow-x:hidden;-ms-overflow-style:none;scrollbar-width:thin;scrollbar-color:transparent transparent;scrollbar-color:#7f7f7f transparent!important;scrollbar-width:thin!important;-ms-overflow-style:none!important}conversation-content::-webkit-scrollbar{width:3px!important;background-color:transparent;border-left:none}conversation-content::-webkit-scrollbar-thumb{background-color:#7f7f7f!important}conversation-content::-webkit-scrollbar-track{-webkit-box-shadow:none!important;background-color:transparent}conversation-content ::-webkit-scrollbar-thumb{background-color:#7f7f7f!important}conversation-input{flex:0 0 auto;min-height:50px;max-height:150px}
31
+ const K = `:host{--send-button-color: #a6a6a6}.wrapper{background-color:var(--conversation-bg-color);position:absolute;inset:0;overflow:hidden;display:flex;flex-direction:column;overflow-y:auto}.scrollable{display:flex;flex-direction:column;align-items:stretch;padding:0 var(--size-medium)}.scrollable:focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent}.message-container{display:flex}.message-container-left{justify-content:start}.message-container-center{justify-content:center}.message-container-right{justify-content:end}.conversation-entry{margin:0;margin-bottom:var(--size-medium)}.conversation-entry:first-of-type{margin-top:var(--size-medium)}.conversation-entry:last-of-type{padding-bottom:var(--size-medium)}.conversation-entry span,.conversation-entry p,.conversation-entry a,.conversation-entry div{font-weight:300}.conversation-entry b,.conversation-entry h1{font-weight:400}.conversation-entry .agent-message{display:grid;margin-right:10%;width:90%;grid-template-columns:1fr;grid-template-rows:1fr auto;grid-template-areas:"content" "info"}.conversation-entry .agent-message.has-avatar{grid-template-columns:auto 1fr;grid-template-rows:1fr auto;grid-template-areas:"avatar content" ". info"}.conversation-entry .user-message{margin-left:10%;width:90%;display:flex;flex-direction:column;align-items:flex-end}.conversation-entry .content-bundle{grid-area:content;max-width:100%;overflow:hidden}.conversation-entry .timestamp{font-size:var(--fonts-small);color:var(--colors-text);font-weight:300;margin:0;line-height:1.5em;grid-area:info}.content{display:inline-block;margin-top:var(--size-normal);max-width:100%}.content>*{overflow-wrap:break-word;word-wrap:break-word;word-break:break-all;word-break:break-word;hyphens:auto}.content.full-width{width:100%}.content.padded{padding:var(--sized-medium)}.content.user.stacked{background-color:var(--colors-primary);color:var(--colors-accent);border-top-left-radius:var(--borderRadius);border-bottom-left-radius:var(--borderRadius)}.content.user.stacked.stacked-first{border-top-right-radius:var(--borderRadius)}.content.user.stacked.stacked-last{border-bottom-right-radius:var(--borderRadius)}.content.stacked:not(.user){background-color:var(--colors-accent);color:var(--colors-text);border:var(--border, "none");border-top-right-radius:var(--borderRadius);border-bottom-right-radius:var(--borderRadius)}.content.stacked:not(.user).stacked-first{border-top-left-radius:var(--borderRadius)}.content.stacked:not(.user).stacked-last{border-bottom-left-radius:var(--borderRadius)}.message-type-text{margin:var(--size-medium) 0;padding:0 var(--size-medium)}.message-type-html{font-size:var(--fonts-normal);font-weight:300;line-height:1.5em;color:var(--colors-text);margin:var(--size-medium) 0;padding:0 var(--size-medium);color:inherit}.message-type-html h1,.message-type-html h2,.message-type-html h3,.message-type-html h4,.message-type-html h5,.message-type-html h6{word-break:break-word}.message-type-html h1:first-child,.message-type-html h2:first-child,.message-type-html h3:first-child,.message-type-html h4:first-child,.message-type-html h5:first-child,.message-type-html h6:first-child{margin-top:0}.message-type-html h1:only-child,.message-type-html h2:only-child,.message-type-html h3:only-child,.message-type-html h4:only-child,.message-type-html h5:only-child,.message-type-html h6:only-child{margin:0}.message-type-html h1:last-child,.message-type-html h2:last-child,.message-type-html h3:last-child,.message-type-html h4:last-child,.message-type-html h5:last-child,.message-type-html h6:last-child{margin-bottom:0}.message-type-html a:focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent;text-decoration:underline}.message-type-html img{max-width:100%!important;height:auto!important}.message-type-html p{word-break:break-word;margin:var(--size-normal) 0}.message-type-html p:first-child{margin:0 0 var(--size-normal)}.message-type-html p:last-child{margin:var(--size-normal) 0 0}.message-type-html p:only-child{margin:0}.message-type-html a{color:var(--colors-link)}.message-type-html a:focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent}.message-type-separator{width:100%;border-bottom:var(--border)}.message-type-button-list{margin:var(--size-medium) 0;padding:0 var(--size-medium)}.message-type-button-list ul{list-style:none;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:var(--size-normal)}.message-type-button-list ul>li{margin:0}.message-type-button-list-button{text-align:center;font-weight:300;border-radius:var(--borderRadius);font-family:inherit;font-size:var(--fonts-normal);display:block;padding:var(--size-normal);background-color:var(--colors-primary);width:100%;color:#fff;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-size:inherit;border:none}.message-type-button-list-button:focus-visible{outline:var(--accessibility-border);color:var(--accessibility-colors-inactiveText);border-color:transparent;background-color:transparent}.message-type-button-list-button i,.message-type-button-list-button svg{margin-right:var(--size-small)}.message-type-link-list{margin:var(--size-medium) 0;padding:0 var(--size-medium)}.message-type-link-list h1{white-space:normal;font-size:var(--fonts-medium);font-weight:400;margin:0 0 var(--size-normal);color:var(--colors-text);line-height:1.8em}.message-type-link-list ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:var(--size-normal)}.message-type-link-list ul>li{margin:0}.message-type-link-list-button{display:block;text-align:left;font-weight:300;color:var(--colors-primary);max-width:100%;text-overflow:ellipsis;overflow:hidden;background-color:transparent;cursor:pointer;font-size:inherit;border:none}.message-list{list-style:none;padding:0;margin:0}.message-list .message-list-item p{padding:0;margin:0}.conversation-input{height:50px;display:flex;align-items:center;background-color:var(--colors-accent);border-top:var(--inputBorder)}.conversation-input.has-content{--send-button-color: var(--colors-primary)}.conversation-input input{flex:1;border:none;background-color:transparent;font-weight:300;font-size:var(--fonts-normal);line-height:1.2em;outline:none;padding:var(--size-medium);color:var(--colors-text)}.conversation-input input::placeholder{color:var(--colors-textLight);font-style:italic}.conversation-input button{flex:0 0 50px;align-self:stretch;background-color:transparent;display:flex;align-items:center;justify-content:center;border:none;color:var(--send-button-color)}conversation-content{flex:0 1 100%;overflow-y:auto;overflow-x:hidden;-ms-overflow-style:none;scrollbar-width:thin;scrollbar-color:transparent transparent;scrollbar-color:#7f7f7f transparent!important;scrollbar-width:thin!important;-ms-overflow-style:none!important}conversation-content::-webkit-scrollbar{width:3px!important;background-color:transparent;border-left:none}conversation-content::-webkit-scrollbar-thumb{background-color:#7f7f7f!important}conversation-content::-webkit-scrollbar-track{-webkit-box-shadow:none!important;background-color:transparent}conversation-content ::-webkit-scrollbar-thumb{background-color:#7f7f7f!important}conversation-input{flex:0 0 auto;min-height:50px;max-height:150px}
32
32
  `;
33
33
  var N = Object.defineProperty, W = Object.getOwnPropertyDescriptor, S = (a, e, s, r) => {
34
34
  for (var t = r > 1 ? void 0 : r ? W(e, s) : e, n = a.length - 1, o; n >= 0; n--)
@@ -129,14 +129,14 @@ O([
129
129
  O([
130
130
  i({ type: String })
131
131
  ], _.prototype, "placeholder", 2);
132
- var F = Object.defineProperty, G = Object.getOwnPropertyDescriptor, y = (a, e, s, r) => {
132
+ var F = Object.defineProperty, G = Object.getOwnPropertyDescriptor, b = (a, e, s, r) => {
133
133
  for (var t = r > 1 ? void 0 : r ? G(e, s) : e, n = a.length - 1, o; n >= 0; n--)
134
134
  (o = a[n]) && (t = (r ? o(e, s, t) : o(t)) || t);
135
135
  return r && t && F(e, s, t), t;
136
136
  };
137
137
  class d extends v {
138
138
  constructor() {
139
- super(), this.content = [], this.sender = null, this.messageType = b.System, this.userLabel = "";
139
+ super(), this.content = [], this.sender = null, this.messageType = y.System, this.userLabel = "";
140
140
  }
141
141
  getMessageStackPosition(e) {
142
142
  let s = "first";
@@ -197,11 +197,11 @@ class d extends v {
197
197
  </div>
198
198
  `;
199
199
  switch (this.messageType) {
200
- case b.System:
200
+ case y.System:
201
201
  return s();
202
- case b.Agent:
202
+ case y.Agent:
203
203
  return e();
204
- case b.User:
204
+ case y.User:
205
205
  return r();
206
206
  default:
207
207
  return u;
@@ -248,19 +248,19 @@ d.styles = [
248
248
  }
249
249
  `
250
250
  ];
251
- y([
251
+ b([
252
252
  i({ type: Object })
253
253
  ], d.prototype, "sender", 2);
254
- y([
254
+ b([
255
255
  i({ type: Array })
256
256
  ], d.prototype, "content", 2);
257
- y([
257
+ b([
258
258
  i({ type: Number })
259
259
  ], d.prototype, "timestamp", 2);
260
- y([
260
+ b([
261
261
  i({ type: String })
262
262
  ], d.prototype, "messageType", 2);
263
- y([
263
+ b([
264
264
  i({ type: String })
265
265
  ], d.prototype, "userLabel", 2);
266
266
  var J = Object.defineProperty, V = Object.getOwnPropertyDescriptor, C = (a, e, s, r) => {
@@ -472,4 +472,4 @@ class he extends T(h) {
472
472
  export {
473
473
  he as default
474
474
  };
475
- //# sourceMappingURL=conversation-wrapper.fa02c133.js.map
475
+ //# sourceMappingURL=conversation-wrapper.bfcf4c5c.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-wrapper.fa02c133.js","sources":["../src/components/conversation/ui/conversation-content.ts","../src/components/conversation/ui/conversation-input.ts","../src/components/conversation/ui/conversation-message.ts","../src/components/conversation/ui/message.ts","../src/components/conversation/conversation.ts","../src/components/conversation/conversation-wrapper.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n// import styles from './conversation-content.scss?inline';\n\n// @customElement('conversation-content')\nexport class ConversationContent extends LitElement {\n @property({ type: Array })\n declare messages: any[];\n @property({ type: String })\n declare userLabel: string;\n\n constructor() {\n super();\n\n this.userLabel = '';\n this.messages = [];\n }\n\n // async dispatch(type: string, data: any) {\n // const container = this.requestInstance('container');\n // const descriptor = this.getDescriptor();\n\n // if (!container || !descriptor) {\n // return;\n // }\n // const platform = await ComponentPlatform.getInstance(container);\n // if (!platform) {\n // return;\n // }\n\n // const component = new ComponentQuery(platform).withId(descriptor.id);\n // const actions = platform.actions(component, descriptor.type /*|| uuid()*/);\n\n // actions.dispatch(type, data);\n // }\n\n // getDescriptor() {\n // const ev: CustomEvent<{ descriptor?: { [key: string]: any } }> = new CustomEvent(\n // 'request-descriptor',\n // {\n // detail: {},\n // bubbles: true,\n // composed: true,\n // cancelable: true,\n // }\n // );\n // this.dispatchEvent(ev);\n // return ev.detail.descriptor || null;\n // }\n\n // onUserSubmit(event: CustomEvent<{ text: string }>) {\n // this.dispatch('user-submit', event.detail);\n // }\n\n // onUserTyping(event: CustomEvent<{ length: number }>) {\n // this.dispatch('user-typing', event.detail);\n // }\n\n render() {\n return html`\n <div class=\"scrollable\">\n ${this.messages.map(\n (message) => html`<div class=\"conversation-entry\">\n <conversation-message\n .content=${message.content}\n .sender=${message.sender}\n .messageType=${message.type}\n .timestamp=${message.timestamp}\n .userLabel=${this.userLabel}\n />\n </div>`\n )}\n </div>\n `;\n }\n\n protected createRenderRoot(): Element | ShadowRoot {\n return this;\n }\n}\n// <conversation-input\n// @user-submit=${this.onUserSubmit}\n// @user-typing=${this.onUserTyping}\n// />\n","import { html, LitElement, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { createRef, ref, Ref } from 'lit/directives/ref.js';\n\n// @customElement('conversation-input')\nexport class ConversationInput extends LitElement {\n inputRef: Ref<HTMLInputElement> = createRef<HTMLInputElement>();\n\n @state()\n declare hasContent: boolean;\n\n @property({ type: String })\n declare placeholder: string;\n\n constructor() {\n super();\n this.hasContent = false;\n // this.inputText = '';\n }\n\n onSubmit(e: any) {\n const multiline = false; // TODO:\n if (!e.shiftKey || !multiline) {\n e.preventDefault();\n if (this.inputRef.value!.value.length > 0) {\n this.dispatchEvent(\n new CustomEvent('user-submit', {\n detail: {\n // text: this.inputEl.value,\n text: this.inputRef.value!.value,\n },\n })\n );\n this.inputRef.value!.value = '';\n // dispatch('user-submit', { text: inputText });\n // setInputText('');\n // onChange('');\n }\n } else if (this.inputRef.value!.value.length < 1) {\n e.preventDefault();\n }\n }\n\n onChange(e: any) {\n if (e.target.value.length > 0) {\n this.hasContent = true;\n } else {\n this.hasContent = false;\n }\n // calculateHeight(value);\n if (e.target.value && e.target.value.length > 0) {\n this.dispatchEvent(\n new CustomEvent('user-typing', {\n detail: {\n textLength: e.target.value.length,\n },\n })\n );\n }\n }\n\n render() {\n const multiline = false; // TODO:\n const secondaryAction = false; // TODO:\n\n return html`\n <div\n class=${classMap({\n 'conversation-input': true,\n 'has-content': this.hasContent,\n })}\n >\n ${secondaryAction ? html`Secondary` : nothing}\n ${multiline\n ? html`Multiline`\n : html`\n <input\n ${ref(this.inputRef)}\n @input=${this.onChange}\n placeholder=${this.placeholder}\n />\n `}\n\n <button @click=\"${this.onSubmit}\">\n <ui-symbol-badge\n size=\"22\"\n .symbol=${{ type: 'Svg', content: 'send' }}\n ></ui-symbol-badge>\n </button>\n </div>\n `;\n }\n\n protected createRenderRoot(): Element | ShadowRoot {\n return this;\n }\n}\n","import { css, html, LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ConversationMessageType } from '../../../conversation-controller';\nimport { BundledConversationMessage } from '../plugin';\n\n// @customElement('conversation-message')\nexport class ConversationMessage extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n }\n .agent-message {\n display: grid;\n margin-right: 10%;\n width: 90%;\n grid-template-columns: 1fr;\n grid-template-rows: 1fr auto;\n grid-template-areas:\n 'content'\n 'info';\n }\n .agent-message.has-avatar {\n grid-template-columns: auto 1fr;\n grid-template-rows: 1fr auto;\n grid-template-areas:\n 'avatar content'\n '. info';\n }\n .content-bundle {\n grid-area: content;\n max-width: 100%;\n overflow: hidden;\n }\n .timestamp {\n font-size: var(--fonts-small);\n color: var(--colors-text);\n font-weight: 300;\n margin: 0;\n line-height: 1.5em;\n grid-area: info;\n }\n `,\n ];\n\n @property({ type: Object })\n declare sender: BundledConversationMessage['sender'] | null;\n\n @property({ type: Array })\n declare content: BundledConversationMessage['content'];\n\n @property({ type: Number })\n declare timestamp: number;\n\n @property({ type: String })\n declare messageType: ConversationMessageType;\n\n @property({ type: String })\n declare userLabel: string;\n\n constructor() {\n super();\n this.content = [];\n this.sender = null;\n this.messageType = ConversationMessageType.System;\n this.userLabel = '';\n }\n\n getMessageStackPosition(index: number) {\n let messageOrder: 'first' | 'last' | 'middle' = 'first';\n if (this.content.length > 1) {\n messageOrder =\n index === 0 ? 'first' : index + 1 === this.content.length ? 'last' : 'middle';\n }\n return messageOrder;\n }\n\n renderTimestamp(name: string, timestamp: number) {\n const getTimestamp = (raw: number) => {\n return new Date(raw).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n };\n if (!name && !timestamp) {\n return nothing;\n }\n let output = '';\n if (name) {\n if (timestamp) {\n output = `${name}: ${getTimestamp(timestamp)}`;\n } else {\n output = name;\n }\n } else if (timestamp) {\n output = getTimestamp(timestamp);\n }\n\n return html`<p class=\"timestamp\">${output}</p>`;\n }\n\n render() {\n const createAgentMessage = () => {\n return html`\n <div\n class=${classMap({\n 'conversation-entry': true,\n 'agent-message': true,\n 'has-avatar': !!this.sender?.avatar,\n })}\n >\n ${this.sender?.avatar ? html`` : html`` /* TODO: */}\n <div class=\"content-bundle\">\n ${this.content.map((item, index) => {\n return html`\n <div class=\"message-container message-container-left\">\n <conversation-message-item\n .content=${item}\n .isUser=${this.messageType === 'user'}\n .stacked=${this.getMessageStackPosition(index)}\n />\n </div>\n `;\n })}\n </div>\n ${this.renderTimestamp(this.sender?.name || '', this.timestamp)}\n </div>\n `;\n };\n\n const createSystemMessage = () => {\n return html`SystemMessage`;\n };\n\n const createUserMessage = () => {\n return html`\n <div\n class=${classMap({\n 'conversation-entry': true,\n 'user-message': true,\n })}\n >\n <div class=\"content-bundle\">\n ${this.content.map((item, index) => {\n return html`\n <div class=\"message-container message-container-right\">\n <conversation-message-item\n .content=${item}\n .isUser=${this.messageType === 'user'}\n .stacked=${this.getMessageStackPosition(index)}\n />\n </div>\n `;\n })}\n </div>\n ${this.renderTimestamp(this.userLabel || '', this.timestamp)}\n </div>\n `;\n };\n\n switch (this.messageType) {\n case ConversationMessageType.System:\n return createSystemMessage();\n case ConversationMessageType.Agent:\n return createAgentMessage();\n case ConversationMessageType.User:\n return createUserMessage();\n default:\n return nothing;\n }\n }\n\n protected createRenderRoot(): Element | ShadowRoot {\n return this;\n }\n}\n","import { spread } from '@open-wc/lit-helpers';\nimport { LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html, unsafeStatic } from 'lit/static-html.js';\nimport { ConversationMessageListItemType, ItemPayload } from '../../../types';\nimport { BundledMessageContent } from '../plugin';\n\nconst mapActions = (actions: any) =>\n Array.isArray(actions)\n ? actions\n : Object.keys(actions).map((i) => {\n return {\n label: actions[i],\n actionKey: i,\n };\n });\n\n// @customElement('conversation-message-item')\nexport class Message extends LitElement {\n @property({ type: Object })\n declare content: BundledMessageContent;\n\n @property({ type: Boolean })\n declare isUser: boolean;\n\n @property({ type: String })\n declare stacked: 'first' | 'last' | 'middle';\n\n constructor() {\n super();\n this.isUser = false;\n this.stacked = 'first';\n }\n\n onActionClick(action: any) {\n this.dispatchEvent(\n new CustomEvent('action', {\n detail: action,\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n }\n\n renderItem(item: ItemPayload) {\n const [type, content] = item;\n\n switch (type) {\n case ConversationMessageListItemType.Text:\n return html`<span class=\"message-type-text\">${content}</span>`;\n case ConversationMessageListItemType.HTML:\n return html`<div class=\"message-type-html\">\n <ui-html .html=${content.body}></ui-html>\n </div>`;\n case ConversationMessageListItemType.Separator: {\n return html`<div class=\"message-type-separator\"></div>`;\n }\n case ConversationMessageListItemType.LinkList: {\n return html`\n <div class=\"message-type-link-list\">\n ${content.header ? html`<h1>${content.header}</h1>` : nothing}\n <ul>\n ${mapActions(content.actions).map((action) => {\n return html`<li>\n <button\n class=\"message-type-link-list-button\"\n aria-label=${action.label}\n title=${action.label}\n @click=${(e: Event) => {\n this.onActionClick(action);\n }}\n >\n ${action.label}\n ${action.actionKey === 'help'\n ? html`\n <ui-symbol-badge\n .size=${14}\n .symbol=${{\n type: 'Svg',\n content: 'caret-down',\n }}\n ></ui-symbol-badge>\n `\n : nothing}\n </button>\n </li>`;\n })}\n </ul>\n </div>\n `;\n }\n case ConversationMessageListItemType.ButtonList: {\n return html`\n <div class=\"message-type-button-list\">\n ${content.header ? html`<h1>${content.header}</h1>` : nothing}\n <ul>\n ${mapActions(content.actions).map((action) => {\n return html`<li>\n <button\n class=\"message-type-button-list-button\"\n aria-label=${action.label}\n title=${action.label}\n @click=${(e: Event) => {\n this.onActionClick(action);\n }}\n >\n <!-- <ui-symbol-badge /> -->\n ${action.label}\n </button>\n </li>`;\n })}\n </ul>\n </div>\n `;\n }\n // case ConversationMessageListItemType.VideoRequest: {\n // return <VideoRequest {...item.content} dispatch={dispatch} />;\n // }\n default: {\n let itemProps = Object.entries(content).reduce<{ [key: string]: any }>(\n (acc, [key, value]) => {\n acc[`.${key}`] = value;\n return acc;\n },\n {}\n );\n return html`<${unsafeStatic(type)} ${spread(itemProps)} />`;\n }\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n content: true,\n user: this.isUser,\n stacked: true,\n 'stacked-first': this.stacked === 'first',\n 'stacked-middle': this.stacked === 'middle',\n 'stacked-last': this.stacked === 'last',\n })}\n >\n <ul class=\"message-list\">\n ${(this.content.items || []).map((item) => {\n return html`<li class=\"message-list-item\">${this.renderItem(item)}</li>`;\n })}\n </ul>\n </div>\n `;\n }\n\n protected createRenderRoot(): Element | ShadowRoot {\n return this;\n }\n}\n","import { ComponentPlatform, ComponentQuery } from '@telia-ace/widget-core';\nimport { Requester } from '@telia-ace/widget-ui';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport styles from './conversation.scss?inline';\n\nimport { ConversationContent } from './ui/conversation-content';\nimport { ConversationInput } from './ui/conversation-input';\nimport { ConversationMessage } from './ui/conversation-message';\nimport { Message } from './ui/message';\n\ncustomElements.define('conversation-content', ConversationContent);\ncustomElements.define('conversation-input', ConversationInput);\ncustomElements.define('conversation-message', ConversationMessage);\ncustomElements.define('conversation-message-item', Message);\n\nexport default class Conversation extends Requester(LitElement) {\n static styles = unsafeCSS(styles);\n\n @property({ type: Array })\n declare _messages: any[];\n\n @property({ type: String })\n declare _inputPlaceholder: string;\n\n @property({ type: String })\n declare _userLabel: string;\n\n @property({ type: String })\n declare _conversationControllerId: string;\n\n constructor() {\n super();\n this._messages = [];\n this._userLabel = '';\n this._inputPlaceholder = 'Type your message';\n }\n\n onUserSubmit(event: CustomEvent<{ text: string }>) {\n this.dispatch('user-submit', event.detail);\n }\n\n onUserTyping(event: CustomEvent<{ length: number }>) {\n this.dispatch('user-typing', event.detail);\n }\n\n onActionClick(event: CustomEvent<{ action: any }>) {\n this.dispatch('action', event.detail);\n }\n\n async dispatch(type: string, data: any) {\n const container = this.requestInstance('container');\n const descriptor = this.getDescriptor();\n\n if (!container || !descriptor) {\n return;\n }\n const platform = await ComponentPlatform.getInstance(container);\n if (!platform) {\n return;\n }\n\n const component = new ComponentQuery(platform).withId(descriptor.id);\n const actions = platform.actions(component, descriptor.type /*|| uuid()*/);\n\n actions.dispatch(type, data);\n }\n\n getDescriptor() {\n const ev: CustomEvent<{ descriptor?: { [key: string]: any } }> = new CustomEvent(\n 'request-descriptor',\n {\n detail: {},\n bubbles: true,\n composed: true,\n cancelable: true,\n }\n );\n this.dispatchEvent(ev);\n return ev.detail.descriptor || null;\n }\n\n render() {\n return html`\n <div class=\"wrapper\">\n <conversation-content\n .messages=${this._messages}\n .userLabel=${this._userLabel}\n @action=${this.onActionClick}\n ></conversation-content>\n <conversation-input\n @user-submit=${this.onUserSubmit}\n @user-typing=${this.onUserTyping}\n .placeholder=${this._inputPlaceholder}\n >\n </conversation-input>\n </div>\n `;\n }\n}\n","import { NodeConnector, WidgetComponentMixin } from '@telia-ace/widget-ui';\nimport Conversation from './conversation';\n\nexport default class ConversationWrapper extends WidgetComponentMixin(Conversation) {\n connector = new NodeConnector(this);\n\n constructor() {\n super();\n }\n}\n"],"names":["ConversationContent","LitElement","html","message","__decorateClass","property","ConversationInput","createRef","classMap","nothing","ref","state","ConversationMessage","ConversationMessageType","index","messageOrder","name","timestamp","getTimestamp","raw","output","createAgentMessage","_a","_b","item","_c","createSystemMessage","createUserMessage","css","mapActions","actions","i","Message","action","type","content","ConversationMessageListItemType","e","itemProps","acc","key","value","unsafeStatic","spread","Conversation","Requester","event","data","__async","container","descriptor","platform","ComponentPlatform","component","ComponentQuery","ev","unsafeCSS","styles","ConversationWrapper","WidgetComponentMixin","NodeConnector"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAMA,UAA4BC,EAAW;AAAA,EAMhD,cAAc;AACJ,aAEN,KAAK,YAAY,IACjB,KAAK,WAAW;EACpB;AAAA,EA0CA,SAAS;AACE,WAAAC;AAAA;AAAA,kBAEG,KAAK,SAAS;AAAA,MACZ,CAACC,MAAYD;AAAA;AAAA,uCAEMC,EAAQ;AAAA,sCACTA,EAAQ;AAAA,2CACHA,EAAQ;AAAA,yCACVA,EAAQ;AAAA,yCACR,KAAK;AAAA;AAAA;AAAA,IAAA;AAAA;AAAA;AAAA,EAM1C;AAAA,EAEU,mBAAyC;AACxC,WAAA;AAAA,EACX;AACJ;AAxEYC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,OAAO;AAAA,GADhBL,EAED,WAAA,YAAA,CAAA;AAEAI,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GAHjBL,EAID,WAAA,aAAA,CAAA;;;;;;ACHL,MAAMM,UAA0BL,EAAW;AAAA,EAS9C,cAAc;AACJ,aATV,KAAA,WAAkCM,KAU9B,KAAK,aAAa;AAAA,EAEtB;AAAA,EAEA,SAAS,GAAQ;AAET,I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D;AAAA;AAAA;AAAA,gCAGiB,KAAK;AAAA,iCACJ,KAAK;AAAA,8BACR,KAAK;AAAA;AAAA;AAAA,mCAGA,KAAK;AAAA,mCACL,KAAK;AAAA,mCACL,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpC;AACJ;AAnFqB0C,EACV,SAASY,EAAUC,CAAM;AAGxBrD,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,OAAO;AAAA,GAHRuC,EAIT,WAAA,aAAA,CAAA;AAGAxC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GANTuC,EAOT,WAAA,qBAAA,CAAA;AAGAxC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GATTuC,EAUT,WAAA,cAAA,CAAA;AAGAxC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GAZTuC,EAaT,WAAA,6BAAA,CAAA;AC1BS,MAAAc,WAA4BC,EAAqBf,CAAY,EAAE;AAAA,EAGhF,cAAc;AACJ,aAHE,KAAA,YAAA,IAAIgB,EAAc,IAAI;AAAA,EAIlC;AACJ;"}
1
+ {"version":3,"file":"conversation-wrapper.bfcf4c5c.js","sources":["../src/components/conversation/ui/conversation-content.ts","../src/components/conversation/ui/conversation-input.ts","../src/components/conversation/ui/conversation-message.ts","../src/components/conversation/ui/message.ts","../src/components/conversation/conversation.ts","../src/components/conversation/conversation-wrapper.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n// import styles from './conversation-content.scss?inline';\n\n// @customElement('conversation-content')\nexport class ConversationContent extends LitElement {\n @property({ type: Array })\n declare messages: any[];\n @property({ type: String })\n declare userLabel: string;\n\n constructor() {\n super();\n\n this.userLabel = '';\n this.messages = [];\n }\n\n // async dispatch(type: string, data: any) {\n // const container = this.requestInstance('container');\n // const descriptor = this.getDescriptor();\n\n // if (!container || !descriptor) {\n // return;\n // }\n // const platform = await ComponentPlatform.getInstance(container);\n // if (!platform) {\n // return;\n // }\n\n // const component = new ComponentQuery(platform).withId(descriptor.id);\n // const actions = platform.actions(component, descriptor.type /*|| uuid()*/);\n\n // actions.dispatch(type, data);\n // }\n\n // getDescriptor() {\n // const ev: CustomEvent<{ descriptor?: { [key: string]: any } }> = new CustomEvent(\n // 'request-descriptor',\n // {\n // detail: {},\n // bubbles: true,\n // composed: true,\n // cancelable: true,\n // }\n // );\n // this.dispatchEvent(ev);\n // return ev.detail.descriptor || null;\n // }\n\n // onUserSubmit(event: CustomEvent<{ text: string }>) {\n // this.dispatch('user-submit', event.detail);\n // }\n\n // onUserTyping(event: CustomEvent<{ length: number }>) {\n // this.dispatch('user-typing', event.detail);\n // }\n\n render() {\n return html`\n <div class=\"scrollable\">\n ${this.messages.map(\n (message) => html`<div class=\"conversation-entry\">\n <conversation-message\n .content=${message.content}\n .sender=${message.sender}\n .messageType=${message.type}\n .timestamp=${message.timestamp}\n .userLabel=${this.userLabel}\n />\n </div>`\n )}\n </div>\n `;\n }\n\n protected createRenderRoot(): Element | ShadowRoot {\n return this;\n }\n}\n// <conversation-input\n// @user-submit=${this.onUserSubmit}\n// @user-typing=${this.onUserTyping}\n// />\n","import { html, LitElement, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { createRef, ref, Ref } from 'lit/directives/ref.js';\n\n// @customElement('conversation-input')\nexport class ConversationInput extends LitElement {\n inputRef: Ref<HTMLInputElement> = createRef<HTMLInputElement>();\n\n @state()\n declare hasContent: boolean;\n\n @property({ type: String })\n declare placeholder: string;\n\n constructor() {\n super();\n this.hasContent = false;\n // this.inputText = '';\n }\n\n onSubmit(e: any) {\n const multiline = false; // TODO:\n if (!e.shiftKey || !multiline) {\n e.preventDefault();\n if (this.inputRef.value!.value.length > 0) {\n this.dispatchEvent(\n new CustomEvent('user-submit', {\n detail: {\n // text: this.inputEl.value,\n text: this.inputRef.value!.value,\n },\n })\n );\n this.inputRef.value!.value = '';\n // dispatch('user-submit', { text: inputText });\n // setInputText('');\n // onChange('');\n }\n } else if (this.inputRef.value!.value.length < 1) {\n e.preventDefault();\n }\n }\n\n onChange(e: any) {\n if (e.target.value.length > 0) {\n this.hasContent = true;\n } else {\n this.hasContent = false;\n }\n // calculateHeight(value);\n if (e.target.value && e.target.value.length > 0) {\n this.dispatchEvent(\n new CustomEvent('user-typing', {\n detail: {\n textLength: e.target.value.length,\n },\n })\n );\n }\n }\n\n render() {\n const multiline = false; // TODO:\n const secondaryAction = false; // TODO:\n\n return html`\n <div\n class=${classMap({\n 'conversation-input': true,\n 'has-content': this.hasContent,\n })}\n >\n ${secondaryAction ? html`Secondary` : nothing}\n ${multiline\n ? html`Multiline`\n : html`\n <input\n ${ref(this.inputRef)}\n @input=${this.onChange}\n placeholder=${this.placeholder}\n />\n `}\n\n <button @click=\"${this.onSubmit}\">\n <ui-symbol-badge\n size=\"22\"\n .symbol=${{ type: 'Svg', content: 'send' }}\n ></ui-symbol-badge>\n </button>\n </div>\n `;\n }\n\n protected createRenderRoot(): Element | ShadowRoot {\n return this;\n }\n}\n","import { css, html, LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ConversationMessageType } from '../../../conversation-controller';\nimport { BundledConversationMessage } from '../plugin';\n\n// @customElement('conversation-message')\nexport class ConversationMessage extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n }\n .agent-message {\n display: grid;\n margin-right: 10%;\n width: 90%;\n grid-template-columns: 1fr;\n grid-template-rows: 1fr auto;\n grid-template-areas:\n 'content'\n 'info';\n }\n .agent-message.has-avatar {\n grid-template-columns: auto 1fr;\n grid-template-rows: 1fr auto;\n grid-template-areas:\n 'avatar content'\n '. info';\n }\n .content-bundle {\n grid-area: content;\n max-width: 100%;\n overflow: hidden;\n }\n .timestamp {\n font-size: var(--fonts-small);\n color: var(--colors-text);\n font-weight: 300;\n margin: 0;\n line-height: 1.5em;\n grid-area: info;\n }\n `,\n ];\n\n @property({ type: Object })\n declare sender: BundledConversationMessage['sender'] | null;\n\n @property({ type: Array })\n declare content: BundledConversationMessage['content'];\n\n @property({ type: Number })\n declare timestamp: number;\n\n @property({ type: String })\n declare messageType: ConversationMessageType;\n\n @property({ type: String })\n declare userLabel: string;\n\n constructor() {\n super();\n this.content = [];\n this.sender = null;\n this.messageType = ConversationMessageType.System;\n this.userLabel = '';\n }\n\n getMessageStackPosition(index: number) {\n let messageOrder: 'first' | 'last' | 'middle' = 'first';\n if (this.content.length > 1) {\n messageOrder =\n index === 0 ? 'first' : index + 1 === this.content.length ? 'last' : 'middle';\n }\n return messageOrder;\n }\n\n renderTimestamp(name: string, timestamp: number) {\n const getTimestamp = (raw: number) => {\n return new Date(raw).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n };\n if (!name && !timestamp) {\n return nothing;\n }\n let output = '';\n if (name) {\n if (timestamp) {\n output = `${name}: ${getTimestamp(timestamp)}`;\n } else {\n output = name;\n }\n } else if (timestamp) {\n output = getTimestamp(timestamp);\n }\n\n return html`<p class=\"timestamp\">${output}</p>`;\n }\n\n render() {\n const createAgentMessage = () => {\n return html`\n <div\n class=${classMap({\n 'conversation-entry': true,\n 'agent-message': true,\n 'has-avatar': !!this.sender?.avatar,\n })}\n >\n ${this.sender?.avatar ? html`` : html`` /* TODO: */}\n <div class=\"content-bundle\">\n ${this.content.map((item, index) => {\n return html`\n <div class=\"message-container message-container-left\">\n <conversation-message-item\n .content=${item}\n .isUser=${this.messageType === 'user'}\n .stacked=${this.getMessageStackPosition(index)}\n />\n </div>\n `;\n })}\n </div>\n ${this.renderTimestamp(this.sender?.name || '', this.timestamp)}\n </div>\n `;\n };\n\n const createSystemMessage = () => {\n return html`SystemMessage`;\n };\n\n const createUserMessage = () => {\n return html`\n <div\n class=${classMap({\n 'conversation-entry': true,\n 'user-message': true,\n })}\n >\n <div class=\"content-bundle\">\n ${this.content.map((item, index) => {\n return html`\n <div class=\"message-container message-container-right\">\n <conversation-message-item\n .content=${item}\n .isUser=${this.messageType === 'user'}\n .stacked=${this.getMessageStackPosition(index)}\n />\n </div>\n `;\n })}\n </div>\n ${this.renderTimestamp(this.userLabel || '', this.timestamp)}\n </div>\n `;\n };\n\n switch (this.messageType) {\n case ConversationMessageType.System:\n return createSystemMessage();\n case ConversationMessageType.Agent:\n return createAgentMessage();\n case ConversationMessageType.User:\n return createUserMessage();\n default:\n return nothing;\n }\n }\n\n protected createRenderRoot(): Element | ShadowRoot {\n return this;\n }\n}\n","import { spread } from '@open-wc/lit-helpers';\nimport { LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html, unsafeStatic } from 'lit/static-html.js';\nimport { ConversationMessageListItemType, ItemPayload } from '../../../types';\nimport { BundledMessageContent } from '../plugin';\n\nconst mapActions = (actions: any) =>\n Array.isArray(actions)\n ? actions\n : Object.keys(actions).map((i) => {\n return {\n label: actions[i],\n actionKey: i,\n };\n });\n\n// @customElement('conversation-message-item')\nexport class Message extends LitElement {\n @property({ type: Object })\n declare content: BundledMessageContent;\n\n @property({ type: Boolean })\n declare isUser: boolean;\n\n @property({ type: String })\n declare stacked: 'first' | 'last' | 'middle';\n\n constructor() {\n super();\n this.isUser = false;\n this.stacked = 'first';\n }\n\n onActionClick(action: any) {\n this.dispatchEvent(\n new CustomEvent('action', {\n detail: action,\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n }\n\n renderItem(item: ItemPayload) {\n const [type, content] = item;\n\n switch (type) {\n case ConversationMessageListItemType.Text:\n return html`<span class=\"message-type-text\">${content}</span>`;\n case ConversationMessageListItemType.HTML:\n return html`<div class=\"message-type-html\">\n <ui-html .html=${content.body}></ui-html>\n </div>`;\n case ConversationMessageListItemType.Separator: {\n return html`<div class=\"message-type-separator\"></div>`;\n }\n case ConversationMessageListItemType.LinkList: {\n return html`\n <div class=\"message-type-link-list\">\n ${content.header ? html`<h1>${content.header}</h1>` : nothing}\n <ul>\n ${mapActions(content.actions).map((action) => {\n return html`<li>\n <button\n class=\"message-type-link-list-button\"\n aria-label=${action.label}\n title=${action.label}\n @click=${(e: Event) => {\n this.onActionClick(action);\n }}\n >\n ${action.label}\n ${action.actionKey === 'help'\n ? html`\n <ui-symbol-badge\n .size=${14}\n .symbol=${{\n type: 'Svg',\n content: 'caret-down',\n }}\n ></ui-symbol-badge>\n `\n : nothing}\n </button>\n </li>`;\n })}\n </ul>\n </div>\n `;\n }\n case ConversationMessageListItemType.ButtonList: {\n return html`\n <div class=\"message-type-button-list\">\n ${content.header ? html`<h1>${content.header}</h1>` : nothing}\n <ul>\n ${mapActions(content.actions).map((action) => {\n return html`<li>\n <button\n class=\"message-type-button-list-button\"\n aria-label=${action.label}\n title=${action.label}\n @click=${(e: Event) => {\n this.onActionClick(action);\n }}\n >\n <!-- <ui-symbol-badge /> -->\n ${action.label}\n </button>\n </li>`;\n })}\n </ul>\n </div>\n `;\n }\n // case ConversationMessageListItemType.VideoRequest: {\n // return <VideoRequest {...item.content} dispatch={dispatch} />;\n // }\n default: {\n let itemProps = Object.entries(content).reduce<{ [key: string]: any }>(\n (acc, [key, value]) => {\n acc[`.${key}`] = value;\n return acc;\n },\n {}\n );\n return html`<${unsafeStatic(type)} ${spread(itemProps)} />`;\n }\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n content: true,\n user: this.isUser,\n stacked: true,\n 'stacked-first': this.stacked === 'first',\n 'stacked-middle': this.stacked === 'middle',\n 'stacked-last': this.stacked === 'last',\n })}\n >\n <ul class=\"message-list\">\n ${(this.content.items || []).map((item) => {\n return html`<li class=\"message-list-item\">${this.renderItem(item)}</li>`;\n })}\n </ul>\n </div>\n `;\n }\n\n protected createRenderRoot(): Element | ShadowRoot {\n return this;\n }\n}\n","import { ComponentPlatform, ComponentQuery } from '@telia-ace/widget-core';\nimport { Requester } from '@telia-ace/widget-ui';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport styles from './conversation.scss?inline';\n\nimport { ConversationContent } from './ui/conversation-content';\nimport { ConversationInput } from './ui/conversation-input';\nimport { ConversationMessage } from './ui/conversation-message';\nimport { Message } from './ui/message';\n\ncustomElements.define('conversation-content', ConversationContent);\ncustomElements.define('conversation-input', ConversationInput);\ncustomElements.define('conversation-message', ConversationMessage);\ncustomElements.define('conversation-message-item', Message);\n\nexport default class Conversation extends Requester(LitElement) {\n static styles = unsafeCSS(styles);\n\n @property({ type: Array })\n declare _messages: any[];\n\n @property({ type: String })\n declare _inputPlaceholder: string;\n\n @property({ type: String })\n declare _userLabel: string;\n\n @property({ type: String })\n declare _conversationControllerId: string;\n\n constructor() {\n super();\n this._messages = [];\n this._userLabel = '';\n this._inputPlaceholder = 'Type your message';\n }\n\n onUserSubmit(event: CustomEvent<{ text: string }>) {\n this.dispatch('user-submit', event.detail);\n }\n\n onUserTyping(event: CustomEvent<{ length: number }>) {\n this.dispatch('user-typing', event.detail);\n }\n\n onActionClick(event: CustomEvent<{ action: any }>) {\n this.dispatch('action', event.detail);\n }\n\n async dispatch(type: string, data: any) {\n const container = this.requestInstance('container');\n const descriptor = this.getDescriptor();\n\n if (!container || !descriptor) {\n return;\n }\n const platform = await ComponentPlatform.getInstance(container);\n if (!platform) {\n return;\n }\n\n const component = new ComponentQuery(platform).withId(descriptor.id);\n const actions = platform.actions(component, descriptor.type /*|| uuid()*/);\n\n actions.dispatch(type, data);\n }\n\n getDescriptor() {\n const ev: CustomEvent<{ descriptor?: { [key: string]: any } }> = new CustomEvent(\n 'request-descriptor',\n {\n detail: {},\n bubbles: true,\n composed: true,\n cancelable: true,\n }\n );\n this.dispatchEvent(ev);\n return ev.detail.descriptor || null;\n }\n\n render() {\n return html`\n <div class=\"wrapper\">\n <conversation-content\n .messages=${this._messages}\n .userLabel=${this._userLabel}\n @action=${this.onActionClick}\n ></conversation-content>\n <conversation-input\n @user-submit=${this.onUserSubmit}\n @user-typing=${this.onUserTyping}\n .placeholder=${this._inputPlaceholder}\n >\n </conversation-input>\n </div>\n `;\n }\n}\n","import { NodeConnector, WidgetComponentMixin } from '@telia-ace/widget-ui';\nimport Conversation from './conversation';\n\nexport default class ConversationWrapper extends WidgetComponentMixin(Conversation) {\n connector = new NodeConnector(this);\n\n constructor() {\n super();\n }\n}\n"],"names":["ConversationContent","LitElement","html","message","__decorateClass","property","ConversationInput","createRef","classMap","nothing","ref","state","ConversationMessage","ConversationMessageType","index","messageOrder","name","timestamp","getTimestamp","raw","output","createAgentMessage","_a","_b","item","_c","createSystemMessage","createUserMessage","css","mapActions","actions","i","Message","action","type","content","ConversationMessageListItemType","e","itemProps","acc","key","value","unsafeStatic","spread","Conversation","Requester","event","data","__async","container","descriptor","platform","ComponentPlatform","component","ComponentQuery","ev","unsafeCSS","styles","ConversationWrapper","WidgetComponentMixin","NodeConnector"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAMA,UAA4BC,EAAW;AAAA,EAMhD,cAAc;AACJ,aAEN,KAAK,YAAY,IACjB,KAAK,WAAW;EACpB;AAAA,EA0CA,SAAS;AACE,WAAAC;AAAA;AAAA,kBAEG,KAAK,SAAS;AAAA,MACZ,CAACC,MAAYD;AAAA;AAAA,uCAEMC,EAAQ;AAAA,sCACTA,EAAQ;AAAA,2CACHA,EAAQ;AAAA,yCACVA,EAAQ;AAAA,yCACR,KAAK;AAAA;AAAA;AAAA,IAAA;AAAA;AAAA;AAAA,EAM1C;AAAA,EAEU,mBAAyC;AACxC,WAAA;AAAA,EACX;AACJ;AAxEYC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,OAAO;AAAA,GADhBL,EAED,WAAA,YAAA,CAAA;AAEAI,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GAHjBL,EAID,WAAA,aAAA,CAAA;;;;;;ACHL,MAAMM,UAA0BL,EAAW;AAAA,EAS9C,cAAc;AACJ,aATV,KAAA,WAAkCM,KAU9B,KAAK,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AAO,cAAc;AAAA,EACnC;AAAA,EAEA,SAAS;AACE,WAAArD;AAAA;AAAA;AAAA,gCAGiB,KAAK;AAAA,iCACJ,KAAK;AAAA,8BACR,KAAK;AAAA;AAAA;AAAA,mCAGA,KAAK;AAAA,mCACL,KAAK;AAAA,mCACL,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpC;AACJ;AAnFqB0C,EACV,SAASY,EAAUC,CAAM;AAGxBrD,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,OAAO;AAAA,GAHRuC,EAIT,WAAA,aAAA,CAAA;AAGAxC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GANTuC,EAOT,WAAA,qBAAA,CAAA;AAGAxC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GATTuC,EAUT,WAAA,cAAA,CAAA;AAGAxC,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ;AAAA,GAZTuC,EAaT,WAAA,6BAAA,CAAA;AC1BS,MAAAc,WAA4BC,EAAqBf,CAAY,EAAE;AAAA,EAGhF,cAAc;AACJ,aAHE,KAAA,YAAA,IAAIgB,EAAc,IAAI;AAAA,EAIlC;AACJ;"}
package/dist/index.js CHANGED
@@ -755,7 +755,7 @@ const de = (r, e) => r.reduce((t, s, i) => {
755
755
  ]).then(([e, t]) => Y(
756
756
  r,
757
757
  "conversation",
758
- import("./conversation-wrapper.fa02c133.js"),
758
+ import("./conversation-wrapper.bfcf4c5c.js"),
759
759
  (s) => u(void 0, null, function* () {
760
760
  const { rehydrate: i = !1 } = s.properties(), a = t.getRouteData().params.id || s.node.name || "component", o = yield e.createController(a, { rehydrate: i }), c = e.registerController(o, s), d = 3 * 60 * 1e3, l = (v) => {
761
761
  const { providers: h = [] } = v;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-conversation",
3
- "version": "1.0.34-experimental.19",
3
+ "version": "1.0.34-experimental.20",
4
4
  "description": "ACE Widget Conversation Platform",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",
@@ -22,19 +22,19 @@
22
22
  "sideEffects": false,
23
23
  "dependencies": {
24
24
  "@open-wc/lit-helpers": "^0.5.1",
25
- "@telia-ace/widget-core": "1.0.21-experimental.19",
26
- "@telia-ace/widget-forms": "1.0.28-experimental.19",
27
- "@telia-ace/widget-plugins": "1.0.22-experimental.19",
28
- "@telia-ace/widget-routing": "1.0.22-experimental.19",
29
- "@telia-ace/widget-services": "1.0.21-experimental.19",
30
- "@telia-ace/widget-ui": "1.0.28-experimental.19",
31
- "@telia-ace/widget-utilities": "1.0.10-experimental.19",
25
+ "@telia-ace/widget-core": "1.0.21-experimental.20",
26
+ "@telia-ace/widget-forms": "1.0.28-experimental.20",
27
+ "@telia-ace/widget-plugins": "1.0.22-experimental.20",
28
+ "@telia-ace/widget-routing": "1.0.22-experimental.20",
29
+ "@telia-ace/widget-services": "1.0.21-experimental.20",
30
+ "@telia-ace/widget-ui": "1.0.28-experimental.20",
31
+ "@telia-ace/widget-utilities": "1.0.10-experimental.20",
32
32
  "@webprovisions/platform": "^1.1.2"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@emotion/react": "^11.10.5",
36
36
  "@emotion/styled": "^11.10.5",
37
- "@telia-ace/widget-developer-tools": "1.0.16-experimental.19",
37
+ "@telia-ace/widget-developer-tools": "1.0.16-experimental.20",
38
38
  "@types/react": "^18.0.26",
39
39
  "lit": "^2.6.1",
40
40
  "react": "^18.2.0",