@limetech/lime-crm-building-blocks 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.3.1](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v2.3.0...v2.3.1) (2026-09-10)
2
+
3
+ ### Bug Fixes
4
+
5
+
6
+ * **chat-list:** key items by kind so a replaced list renders correctly ([b97ea65](https://github.com/Lundalogik/lime-crm-building-blocks/commit/b97ea656a5dba5b9251f45ddb2caa0493cbc371f))
7
+
1
8
  ## [2.3.0](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v2.2.1...v2.3.0) (2026-09-10)
2
9
 
3
10
  ### Features
@@ -459,11 +459,16 @@ const ChatList = class {
459
459
  const dateHeading = (index.h("a", { id: headingId, class: "date-heading", role: "heading", "aria-level": 2 }, group.heading));
460
460
  return (index.h("section", { class: "date-group", key: sectionKey, "aria-labelledby": headingId }, dateHeading, chatItems));
461
461
  }
462
+ // Keys carry the item kind because Stencil builds the replacement
463
+ // for a key that changed tag from the wrong vnode, corrupting the
464
+ // list. Consumers reuse ids across item kinds (and across the
465
+ // conversations they render into one list), so a bare id can name
466
+ // a bubble in one render and an icon row in the next.
462
467
  renderChatItem(item) {
463
- return (index.h("limebb-chat-item", { platform: this.platform, context: this.context, item: item, helperText: item.helperText, hasError: item.hasError, key: item.id }));
468
+ return (index.h("limebb-chat-item", { platform: this.platform, context: this.context, item: item, helperText: item.helperText, hasError: item.hasError, key: `chat-${item.id}` }));
464
469
  }
465
470
  renderIconList(item) {
466
- return index.h("limebb-chat-icon-list", { item: item, key: item.id });
471
+ return (index.h("limebb-chat-icon-list", { item: item, key: `icon-list-${item.id}` }));
467
472
  }
468
473
  renderIndicator() {
469
474
  return (index.h("div", { class: "new-items-indicator", role: "separator" }, index.h("hr", null), index.h("h3", null, this.translator.get('webclient.new'))));
@@ -193,11 +193,16 @@ export class ChatList {
193
193
  const dateHeading = (h("a", { id: headingId, class: "date-heading", role: "heading", "aria-level": 2 }, group.heading));
194
194
  return (h("section", { class: "date-group", key: sectionKey, "aria-labelledby": headingId }, dateHeading, chatItems));
195
195
  }
196
+ // Keys carry the item kind because Stencil builds the replacement
197
+ // for a key that changed tag from the wrong vnode, corrupting the
198
+ // list. Consumers reuse ids across item kinds (and across the
199
+ // conversations they render into one list), so a bare id can name
200
+ // a bubble in one render and an icon row in the next.
196
201
  renderChatItem(item) {
197
- return (h("limebb-chat-item", { platform: this.platform, context: this.context, item: item, helperText: item.helperText, hasError: item.hasError, key: item.id }));
202
+ return (h("limebb-chat-item", { platform: this.platform, context: this.context, item: item, helperText: item.helperText, hasError: item.hasError, key: `chat-${item.id}` }));
198
203
  }
199
204
  renderIconList(item) {
200
- return h("limebb-chat-icon-list", { item: item, key: item.id });
205
+ return (h("limebb-chat-icon-list", { item: item, key: `icon-list-${item.id}` }));
201
206
  }
202
207
  renderIndicator() {
203
208
  return (h("div", { class: "new-items-indicator", role: "separator" }, h("hr", null), h("h3", null, this.translator.get('webclient.new'))));
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as i,Host as r,transformTag as n}from"@stencil/core/internal/client";import{n as s}from"./index.esm.js";import{d as o}from"./chat-icon-list.js";import{d as a}from"./chat-item.js";import{d as l}from"./typing-indicator.js";function c(t){return"type"in t&&"iconList"===t.type}function h(t){if("chat"===t.type||"iconList"===t.type)return t.item.timestamp}function d(t){for(const e of t.items)c(e)?t.processedItems.push({type:"iconList",item:e}):t.processedItems.push({type:"chat",item:e});return t}function m(t){if(!t.lastVisitedTimestamp)return t;const e=t.processedItems,i=t.lastVisitedTimestamp;for(let r=e.length-1;r>=0;r--){const n=e[r];if("group"!==n.type)continue;const s=p(n.items,i);if(-1!==s)return b(t,e,r,n,s)}return t}function p(t,e){for(let i=t.length-1;i>=0;i--){const r=h(t[i]);if(void 0!==r&&new Date(r)<=e)return i}return-1}function b(t,e,i,r,n){const s=n===r.items.length-1;if(s&&i===e.length-1)return t;if(s)return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i+1),{type:"newItemIndicator"},...e.slice(i+1)]});const o=[...r.items.slice(0,n+1),{type:"newItemIndicator"},...r.items.slice(n+1)];return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i),Object.assign(Object.assign({},r),{items:o}),...e.slice(i+1)]})}function g(t){const e=[];let i=null,r=null;for(const n of t.processedItems){if("chat"!==n.type&&"iconList"!==n.type)continue;const s=t.dateTimeFormatter.format(new Date(n.item.timestamp),"date");s===r?null==i||i.items.push(n):(i&&e.push(i),i={type:"group",groupType:"dateGroup",heading:s,items:[n]},r=s)}return i&&e.push(i),Object.assign(Object.assign({},t),{processedItems:e})}class u{constructor(t,e,i,r){var n;this.scrollContainer=t,this.getOrder=e,this.onFollowingChanged=r,this.isSticky=!0,this.paintedOrder=i,null===(n=this.onFollowingChanged)||void 0===n||n.call(this,this.isSticky)}beforeRender(){this.scrollContainer.isConnected&&this.handleScroll()}handleScroll(){var t;if(!this.scrollContainer.isConnected)return;const e=this.scrollContainer.scrollTop;if(e===this.lastScrollTop)return;const i=this.distanceFromNewestEdge(this.paintedOrder)<50;i!==this.isSticky&&(this.isSticky=i,null===(t=this.onFollowingChanged)||void 0===t||t.call(this,i)),this.lastScrollTop=e}afterRender(){this.scrollContainer.isConnected&&(this.paintedOrder=this.getOrder(),this.isSticky&&this.scrollToNewest())}repinIfSticky(){this.scrollContainer.isConnected&&(this.handleScroll(),this.isSticky&&this.scrollToNewest())}scrollToNewest(){const t="oldest-on-top"===this.getOrder()?Math.max(0,this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight):0;this.scrollContainer.scrollTop!==t&&(this.scrollContainer.scrollTop=t,this.lastScrollTop=this.scrollContainer.scrollTop)}distanceFromNewestEdge(t){return"oldest-on-top"===t?this.scrollContainer.scrollHeight-this.scrollContainer.scrollTop-this.scrollContainer.clientHeight:this.scrollContainer.scrollTop}}const f=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.items=[],this.order="oldest-on-top",this.processedItems=[],this.handleScroll=t=>{var e;t.target===this.host&&(null===(e=this.scrollAnchor)||void 0===e||e.handleScroll())}}handleItemsChange(){let t=null;this.lastVisitedTimestamp&&(t=function(t){return new Date("string"==typeof t?Date.parse(t):t)}(this.lastVisitedTimestamp));const e=function(t,e,i){return function(t){return[d,g,m].reduce(((t,e)=>e(t)),t)}({items:t,processedItems:[],lastVisitedTimestamp:i,dateTimeFormatter:e}).processedItems}(this.items,this.dateTimeFormatter,t);this.processedItems="newest-on-top"===this.order?function(t){return t.toReversed().map((t=>"group"!==t.type?t:Object.assign(Object.assign({},t),{items:t.items.toReversed()})))}(e):e}componentWillLoad(){this.handleItemsChange()}connectedCallback(){this.observeSize()}componentDidLoad(){this.observeSize()}disconnectedCallback(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.resizeObserver=void 0}observeSize(){var t;const e=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".content");e&&!this.resizeObserver&&(this.resizeObserver=new ResizeObserver((()=>{var t;return null===(t=this.scrollAnchor)||void 0===t?void 0:t.repinIfSticky()})),this.resizeObserver.observe(e),this.resizeObserver.observe(this.host))}componentWillRender(){if(0===this.items.length)return this.scrollAnchor&&(this.host.scrollTop=0),this.scrollAnchor=void 0,void this.host.classList.remove("is-following");this.scrollAnchor?this.scrollAnchor.beforeRender():this.scrollAnchor=new u(this.host,(()=>this.order),this.order,(t=>this.host.classList.toggle("is-following",t)))}componentDidRender(){var t;null===(t=this.scrollAnchor)||void 0===t||t.afterRender()}render(){return i(r,{key:"f99cc3baf1dd34c6a8949976c71042ce0d809046",class:{"is-empty":0===this.items.length&&!this.isTypingIndicatorVisible},onScroll:this.handleScroll},i("div",{key:"1d77b03beb2c5d61b4e50f15d7458f9b28f35d67",class:"content"},i("div",{key:"7d1b5577c5f79ef49fe8f1fe33513b60576ee3b4",class:"messages",role:"log","aria-busy":this.isBusy()},this.renderSpinner(),"newest-on-top"===this.order&&this.renderTypingIndicatorBlock(),this.renderChatItems(),"oldest-on-top"===this.order&&this.renderTypingIndicatorBlock()),i("slot",{key:"04ae84b855377c9407f266ca9edffaefdd69f721",name:"after"})))}renderSpinner(){if(this.loading)return i("limel-spinner",null)}renderTypingIndicatorBlock(){return i("div",{class:"typing-indicator-height-animation"},i("div",null,this.renderTypingIndicator()))}renderTypingIndicator(){if(this.isTypingIndicatorVisible)return i("limebb-typing-indicator",null)}renderChatItems(){return this.processedItems.map((t=>{switch(t.type){case"group":return this.renderGroup(t);case"newItemIndicator":return this.renderIndicator();case"chat":case"iconList":return null;default:return y(t)}}))}renderGroup(t){const e=t.items.map((t=>{switch(t.type){case"chat":return this.renderChatItem(t.item);case"iconList":return this.renderIconList(t.item);case"newItemIndicator":return this.renderIndicator();case"group":return null;default:return y(t)}})),r="date-group-"+t.heading,n=("heading-"+r).replaceAll(/[^a-zA-Z0-9_-]/g,"_"),s=i("a",{id:n,class:"date-heading",role:"heading","aria-level":2},t.heading);return i("section",{class:"date-group",key:r,"aria-labelledby":n},s,e)}renderChatItem(t){return i("limebb-chat-item",{platform:this.platform,context:this.context,item:t,helperText:t.helperText,hasError:t.hasError,key:t.id})}renderIconList(t){return i("limebb-chat-icon-list",{item:t,key:t.id})}renderIndicator(){return i("div",{class:"new-items-indicator",role:"separator"},i("hr",null),i("h3",null,this.translator.get("webclient.new")))}isBusy(){return this.loading||this.isTypingIndicatorVisible?"true":"false"}get dateTimeFormatter(){return this.platform.get(s.DateTimeFormatter)}get translator(){return this.platform.get(s.Translate)}get host(){return this}static get watchers(){return{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}}static get style(){return'@charset "UTF-8";:host(limebb-chat-list){--limel-top-edge-fade-height:0.75rem;isolation:isolate;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);box-sizing:border-box;display:flex;flex-direction:column;height:100%;width:100%;min-width:0;min-height:0;padding:var(--limel-top-edge-fade-height) 0.5rem;overflow:hidden auto}:host(limebb-chat-list.is-empty){padding:0}:host(limebb-chat-list.is-following){overflow-anchor:none}*{box-sizing:border-box}.content{display:flex;flex-direction:column;flex:1 0 auto;gap:0.5rem;min-width:0}.messages{display:flex;flex-direction:column;flex-shrink:0;gap:0.5rem}:host(limebb-chat-list[loading]) .messages{flex-grow:1}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:inherit;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:rgb(var(--contrast-100))}.typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.1s;--limebb-chat-typing-opacity-transition-delay:0s;--limebb-chat-typing-grid-template-rows-transition-speed:0.3s;position:sticky;z-index:1;transition:grid-template-rows var(--limebb-chat-typing-grid-template-rows-transition-speed) ease;display:grid;grid-template-rows:0}.typing-indicator-height-animation div{transition:opacity var(--limebb-chat-typing-opacity-transition-speed) ease var(--limebb-chat-typing-opacity-transition-delay);overflow:hidden;opacity:0}:host(limebb-chat-list[order=oldest-on-top]) .typing-indicator-height-animation{bottom:0}:host(limebb-chat-list[order=newest-on-top]) .typing-indicator-height-animation{top:0}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.4s;--limebb-chat-typing-opacity-transition-delay:0.3s;--limebb-chat-typing-grid-template-rows-transition-speed:0.46s;grid-template-rows:1.5rem}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation div{opacity:1}.date-group limebb-chat-item{--limebb-promoted-action-bar-grid-template-rows:0fr}:host(limebb-chat-list[order=oldest-on-top]) .date-group:last-of-type limebb-chat-item:last-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}:host(limebb-chat-list[order=newest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}'}},[257,"limebb-chat-list",{platform:[16],context:[16],items:[16],loading:[516],isTypingIndicatorVisible:[516,"is-typing-indicator-visible"],lastVisitedTimestamp:[513,"last-visited-timestamp"],order:[513]},void 0,{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}]);function y(t){throw Error("Unexpected value in exhaustive switch: "+JSON.stringify(t))}const v=f,w=function(){"undefined"!=typeof customElements&&["limebb-chat-list","limebb-chat-icon-list","limebb-chat-item","limebb-typing-indicator"].forEach((t=>{switch(t){case"limebb-chat-list":customElements.get(n(t))||customElements.define(n(t),f);break;case"limebb-chat-icon-list":customElements.get(n(t))||o();break;case"limebb-chat-item":customElements.get(n(t))||a();break;case"limebb-typing-indicator":customElements.get(n(t))||l()}}))};export{v as LimebbChatList,w as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as i,Host as r,transformTag as n}from"@stencil/core/internal/client";import{n as s}from"./index.esm.js";import{d as o}from"./chat-icon-list.js";import{d as a}from"./chat-item.js";import{d as l}from"./typing-indicator.js";function c(t){return"type"in t&&"iconList"===t.type}function h(t){if("chat"===t.type||"iconList"===t.type)return t.item.timestamp}function d(t){for(const e of t.items)c(e)?t.processedItems.push({type:"iconList",item:e}):t.processedItems.push({type:"chat",item:e});return t}function m(t){if(!t.lastVisitedTimestamp)return t;const e=t.processedItems,i=t.lastVisitedTimestamp;for(let r=e.length-1;r>=0;r--){const n=e[r];if("group"!==n.type)continue;const s=p(n.items,i);if(-1!==s)return b(t,e,r,n,s)}return t}function p(t,e){for(let i=t.length-1;i>=0;i--){const r=h(t[i]);if(void 0!==r&&new Date(r)<=e)return i}return-1}function b(t,e,i,r,n){const s=n===r.items.length-1;if(s&&i===e.length-1)return t;if(s)return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i+1),{type:"newItemIndicator"},...e.slice(i+1)]});const o=[...r.items.slice(0,n+1),{type:"newItemIndicator"},...r.items.slice(n+1)];return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i),Object.assign(Object.assign({},r),{items:o}),...e.slice(i+1)]})}function g(t){const e=[];let i=null,r=null;for(const n of t.processedItems){if("chat"!==n.type&&"iconList"!==n.type)continue;const s=t.dateTimeFormatter.format(new Date(n.item.timestamp),"date");s===r?null==i||i.items.push(n):(i&&e.push(i),i={type:"group",groupType:"dateGroup",heading:s,items:[n]},r=s)}return i&&e.push(i),Object.assign(Object.assign({},t),{processedItems:e})}class u{constructor(t,e,i,r){var n;this.scrollContainer=t,this.getOrder=e,this.onFollowingChanged=r,this.isSticky=!0,this.paintedOrder=i,null===(n=this.onFollowingChanged)||void 0===n||n.call(this,this.isSticky)}beforeRender(){this.scrollContainer.isConnected&&this.handleScroll()}handleScroll(){var t;if(!this.scrollContainer.isConnected)return;const e=this.scrollContainer.scrollTop;if(e===this.lastScrollTop)return;const i=this.distanceFromNewestEdge(this.paintedOrder)<50;i!==this.isSticky&&(this.isSticky=i,null===(t=this.onFollowingChanged)||void 0===t||t.call(this,i)),this.lastScrollTop=e}afterRender(){this.scrollContainer.isConnected&&(this.paintedOrder=this.getOrder(),this.isSticky&&this.scrollToNewest())}repinIfSticky(){this.scrollContainer.isConnected&&(this.handleScroll(),this.isSticky&&this.scrollToNewest())}scrollToNewest(){const t="oldest-on-top"===this.getOrder()?Math.max(0,this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight):0;this.scrollContainer.scrollTop!==t&&(this.scrollContainer.scrollTop=t,this.lastScrollTop=this.scrollContainer.scrollTop)}distanceFromNewestEdge(t){return"oldest-on-top"===t?this.scrollContainer.scrollHeight-this.scrollContainer.scrollTop-this.scrollContainer.clientHeight:this.scrollContainer.scrollTop}}const f=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.items=[],this.order="oldest-on-top",this.processedItems=[],this.handleScroll=t=>{var e;t.target===this.host&&(null===(e=this.scrollAnchor)||void 0===e||e.handleScroll())}}handleItemsChange(){let t=null;this.lastVisitedTimestamp&&(t=function(t){return new Date("string"==typeof t?Date.parse(t):t)}(this.lastVisitedTimestamp));const e=function(t,e,i){return function(t){return[d,g,m].reduce(((t,e)=>e(t)),t)}({items:t,processedItems:[],lastVisitedTimestamp:i,dateTimeFormatter:e}).processedItems}(this.items,this.dateTimeFormatter,t);this.processedItems="newest-on-top"===this.order?function(t){return t.toReversed().map((t=>"group"!==t.type?t:Object.assign(Object.assign({},t),{items:t.items.toReversed()})))}(e):e}componentWillLoad(){this.handleItemsChange()}connectedCallback(){this.observeSize()}componentDidLoad(){this.observeSize()}disconnectedCallback(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.resizeObserver=void 0}observeSize(){var t;const e=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".content");e&&!this.resizeObserver&&(this.resizeObserver=new ResizeObserver((()=>{var t;return null===(t=this.scrollAnchor)||void 0===t?void 0:t.repinIfSticky()})),this.resizeObserver.observe(e),this.resizeObserver.observe(this.host))}componentWillRender(){if(0===this.items.length)return this.scrollAnchor&&(this.host.scrollTop=0),this.scrollAnchor=void 0,void this.host.classList.remove("is-following");this.scrollAnchor?this.scrollAnchor.beforeRender():this.scrollAnchor=new u(this.host,(()=>this.order),this.order,(t=>this.host.classList.toggle("is-following",t)))}componentDidRender(){var t;null===(t=this.scrollAnchor)||void 0===t||t.afterRender()}render(){return i(r,{key:"f99cc3baf1dd34c6a8949976c71042ce0d809046",class:{"is-empty":0===this.items.length&&!this.isTypingIndicatorVisible},onScroll:this.handleScroll},i("div",{key:"1d77b03beb2c5d61b4e50f15d7458f9b28f35d67",class:"content"},i("div",{key:"7d1b5577c5f79ef49fe8f1fe33513b60576ee3b4",class:"messages",role:"log","aria-busy":this.isBusy()},this.renderSpinner(),"newest-on-top"===this.order&&this.renderTypingIndicatorBlock(),this.renderChatItems(),"oldest-on-top"===this.order&&this.renderTypingIndicatorBlock()),i("slot",{key:"04ae84b855377c9407f266ca9edffaefdd69f721",name:"after"})))}renderSpinner(){if(this.loading)return i("limel-spinner",null)}renderTypingIndicatorBlock(){return i("div",{class:"typing-indicator-height-animation"},i("div",null,this.renderTypingIndicator()))}renderTypingIndicator(){if(this.isTypingIndicatorVisible)return i("limebb-typing-indicator",null)}renderChatItems(){return this.processedItems.map((t=>{switch(t.type){case"group":return this.renderGroup(t);case"newItemIndicator":return this.renderIndicator();case"chat":case"iconList":return null;default:return y(t)}}))}renderGroup(t){const e=t.items.map((t=>{switch(t.type){case"chat":return this.renderChatItem(t.item);case"iconList":return this.renderIconList(t.item);case"newItemIndicator":return this.renderIndicator();case"group":return null;default:return y(t)}})),r="date-group-"+t.heading,n=("heading-"+r).replaceAll(/[^a-zA-Z0-9_-]/g,"_"),s=i("a",{id:n,class:"date-heading",role:"heading","aria-level":2},t.heading);return i("section",{class:"date-group",key:r,"aria-labelledby":n},s,e)}renderChatItem(t){return i("limebb-chat-item",{platform:this.platform,context:this.context,item:t,helperText:t.helperText,hasError:t.hasError,key:"chat-"+t.id})}renderIconList(t){return i("limebb-chat-icon-list",{item:t,key:"icon-list-"+t.id})}renderIndicator(){return i("div",{class:"new-items-indicator",role:"separator"},i("hr",null),i("h3",null,this.translator.get("webclient.new")))}isBusy(){return this.loading||this.isTypingIndicatorVisible?"true":"false"}get dateTimeFormatter(){return this.platform.get(s.DateTimeFormatter)}get translator(){return this.platform.get(s.Translate)}get host(){return this}static get watchers(){return{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}}static get style(){return'@charset "UTF-8";:host(limebb-chat-list){--limel-top-edge-fade-height:0.75rem;isolation:isolate;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);box-sizing:border-box;display:flex;flex-direction:column;height:100%;width:100%;min-width:0;min-height:0;padding:var(--limel-top-edge-fade-height) 0.5rem;overflow:hidden auto}:host(limebb-chat-list.is-empty){padding:0}:host(limebb-chat-list.is-following){overflow-anchor:none}*{box-sizing:border-box}.content{display:flex;flex-direction:column;flex:1 0 auto;gap:0.5rem;min-width:0}.messages{display:flex;flex-direction:column;flex-shrink:0;gap:0.5rem}:host(limebb-chat-list[loading]) .messages{flex-grow:1}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:inherit;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:rgb(var(--contrast-100))}.typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.1s;--limebb-chat-typing-opacity-transition-delay:0s;--limebb-chat-typing-grid-template-rows-transition-speed:0.3s;position:sticky;z-index:1;transition:grid-template-rows var(--limebb-chat-typing-grid-template-rows-transition-speed) ease;display:grid;grid-template-rows:0}.typing-indicator-height-animation div{transition:opacity var(--limebb-chat-typing-opacity-transition-speed) ease var(--limebb-chat-typing-opacity-transition-delay);overflow:hidden;opacity:0}:host(limebb-chat-list[order=oldest-on-top]) .typing-indicator-height-animation{bottom:0}:host(limebb-chat-list[order=newest-on-top]) .typing-indicator-height-animation{top:0}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.4s;--limebb-chat-typing-opacity-transition-delay:0.3s;--limebb-chat-typing-grid-template-rows-transition-speed:0.46s;grid-template-rows:1.5rem}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation div{opacity:1}.date-group limebb-chat-item{--limebb-promoted-action-bar-grid-template-rows:0fr}:host(limebb-chat-list[order=oldest-on-top]) .date-group:last-of-type limebb-chat-item:last-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}:host(limebb-chat-list[order=newest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}'}},[257,"limebb-chat-list",{platform:[16],context:[16],items:[16],loading:[516],isTypingIndicatorVisible:[516,"is-typing-indicator-visible"],lastVisitedTimestamp:[513,"last-visited-timestamp"],order:[513]},void 0,{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}]);function y(t){throw Error("Unexpected value in exhaustive switch: "+JSON.stringify(t))}const v=f,w=function(){"undefined"!=typeof customElements&&["limebb-chat-list","limebb-chat-icon-list","limebb-chat-item","limebb-typing-indicator"].forEach((t=>{switch(t){case"limebb-chat-list":customElements.get(n(t))||customElements.define(n(t),f);break;case"limebb-chat-icon-list":customElements.get(n(t))||o();break;case"limebb-chat-item":customElements.get(n(t))||a();break;case"limebb-typing-indicator":customElements.get(n(t))||l()}}))};export{v as LimebbChatList,w as defineCustomElement}
@@ -457,11 +457,16 @@ const ChatList = class {
457
457
  const dateHeading = (h("a", { id: headingId, class: "date-heading", role: "heading", "aria-level": 2 }, group.heading));
458
458
  return (h("section", { class: "date-group", key: sectionKey, "aria-labelledby": headingId }, dateHeading, chatItems));
459
459
  }
460
+ // Keys carry the item kind because Stencil builds the replacement
461
+ // for a key that changed tag from the wrong vnode, corrupting the
462
+ // list. Consumers reuse ids across item kinds (and across the
463
+ // conversations they render into one list), so a bare id can name
464
+ // a bubble in one render and an icon row in the next.
460
465
  renderChatItem(item) {
461
- return (h("limebb-chat-item", { platform: this.platform, context: this.context, item: item, helperText: item.helperText, hasError: item.hasError, key: item.id }));
466
+ return (h("limebb-chat-item", { platform: this.platform, context: this.context, item: item, helperText: item.helperText, hasError: item.hasError, key: `chat-${item.id}` }));
462
467
  }
463
468
  renderIconList(item) {
464
- return h("limebb-chat-icon-list", { item: item, key: item.id });
469
+ return (h("limebb-chat-icon-list", { item: item, key: `icon-list-${item.id}` }));
465
470
  }
466
471
  renderIndicator() {
467
472
  return (h("div", { class: "new-items-indicator", role: "separator" }, h("hr", null), h("h3", null, this.translator.get('webclient.new'))));
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-COtSgrC5.js";export{s as setNonce}from"./p-COtSgrC5.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t(JSON.parse('[["p-cf03a756",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32],"description":[32]}]]],["p-a58c9e1e",[[1,"limebb-rule-arg-filter-editor",{"platform":[16],"context":[16],"value":[16],"resolvedContext":[32]}]]],["p-cf66256a",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":[{"highlightedItemIdChanged":0}]}]]],["p-da35bcc7",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-e7dee7ac",[[257,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":[{"handleItemsChange":0}],"order":[{"handleItemsChange":0}]}]]],["p-f5c1ed0c",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"helperText":[1,"helper-text"],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-705c53c0",[[1,"limebb-condition-tree",{"platform":[16],"context":[16],"value":[8],"adapter":[16],"combinators":[16],"addOptions":[16],"readonly":[516],"disabled":[516],"openState":[32]},null,{"adapter":[{"buildWalker":0}],"value":[{"syncOpenState":0}]}]]],["p-551a36f6",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-84ad9159",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-a201df35",[[17,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowPasteImages":[4,"allow-paste-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"appName":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-dacf9e77",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-ddc4ede8",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-97e75dee",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-0193ed83",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-5f682c06",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-6331f9c5",[[1,"limebb-rule-editor",{"platform":[16],"context":[16],"value":[16],"availableContexts":[16],"modes":[16],"required":[516],"readonly":[516],"disabled":[516],"invalid":[516],"label":[513],"helperText":[1,"helper-text"],"help":[1],"resolvedContext":[32],"issues":[32],"openChipPath":[32],"modeOverride":[32],"availablePrimitiveOptions":[32]},null,{"value":[{"onValueChange":0}],"availableContexts":[{"onAvailableContextsChange":0}]}]]],["p-dfaef740",[[1,"limebb-value-comparison-editor",{"value":[16],"platform":[16],"operandKey":[32],"direction":[32],"unit":[32],"count":[32],"countInput":[32],"countInvalid":[32],"specificDate":[32]},null,{"value":[{"onValueChange":0}]}]]],["p-b44b9dbc",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-ab0f8170",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-f9991c35",[[1,"limebb-color-palette-picker",{"value":[513],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"]}]]],["p-79d743bb",[[1,"limebb-color-palette-swatches",{"colors":[16]}]]],["p-a5f3913d",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":[{"watchFormInfo":0}],"configComponent":[{"watchconfigComponent":0}]}]]],["p-ce723c21",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-3babfbe0",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-8e9fcf3c",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-d3c58bc1",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-28550961",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"reducedPresence":[516,"reduced-presence"],"reducedPresenceRule":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-021e452a",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-49d042aa",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-1990e369",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-eed0b2c2",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-6a8422d2",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-8a17a7ea",[[1,"limebb-inline-image",{"imageId":[1,"image-id"],"alt":[1],"width":[1],"height":[1],"appName":[32]}]]],["p-d495cc19",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-f3539042",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-ce2755a0",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-08797129",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-0ed9a7cc",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-6f923112",[[257,"limebb-rule-gate",{"platform":[16],"rule":[16],"scope":[16],"shouldRender":[32]},null,{"rule":[{"onRuleChange":0}],"scope":[{"onScopeChange":0}]}]]],["p-dcb49a62",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":[{"valueChanged":0}]}]]],["p-0cbe2180",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-32a81271",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-c0d49532",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-1ebe45b8",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-1578c8f0",[[1,"limebb-condition-tree-editor",{"platform":[16],"context":[16],"open":[4],"editor":[16],"value":[8],"heading":[1],"negated":[4],"readonly":[516],"disabled":[516]}]]],["p-a953d48e",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-e6cc320a",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-ad5dcefd",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-7ae27308",[[1,"limebb-live-docs-info"]]],["p-bf05d9de",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-635a45ad",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":[{"valueChanged":0}]}]]],["p-229d018c",[[1,"limebb-rule-chip-popover",{"platform":[16],"context":[16],"refNode":[16],"isNegated":[4,"is-negated"],"metadata":[16],"readonly":[4],"disabled":[4],"isMutable":[4,"is-mutable"],"focusOnOpen":[4,"focus-on-open"]}]]],["p-0370200d",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-90f0c96b",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-dd02821e",[[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":[{"handleValueChange":0}]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-46aec244",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-cc53a8ca",[[1,"limebb-chat-icon-list",{"item":[16]}],[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-07a9c8f2",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-ffca266e",[[17,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-95ba7a84",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-402a9c97",[[2,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[513],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"isOpen":[32]}]]],["p-8c36b847",[[257,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"file":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-81783bd4",[[17,"limebb-lime-query-filter-comparison-editor",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"propertyType":[1,"property-type"]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[17,"limebb-filter-chip",{"label":[1],"value":[1],"conjunction":[1],"condition":[1],"propertyType":[1,"property-type"],"icon":[1],"helperLabel":[1,"helper-label"],"removable":[4],"readonly":[516],"disabled":[4],"invalid":[516],"selected":[516],"identifier":[8],"platform":[16],"maxLength":[2,"max-length"]},[[2,"click","filterClickWhenInactive"]]],[1,"limebb-filter-condition-picker",{"platform":[16],"value":[1],"propertyType":[1,"property-type"],"conditions":[16],"disabled":[516]}]]]]'),e))));
1
+ import{p as e,b as t}from"./p-COtSgrC5.js";export{s as setNonce}from"./p-COtSgrC5.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t(JSON.parse('[["p-cf03a756",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32],"description":[32]}]]],["p-a58c9e1e",[[1,"limebb-rule-arg-filter-editor",{"platform":[16],"context":[16],"value":[16],"resolvedContext":[32]}]]],["p-cf66256a",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":[{"highlightedItemIdChanged":0}]}]]],["p-da35bcc7",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-0cc47cad",[[257,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":[{"handleItemsChange":0}],"order":[{"handleItemsChange":0}]}]]],["p-f5c1ed0c",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"helperText":[1,"helper-text"],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-705c53c0",[[1,"limebb-condition-tree",{"platform":[16],"context":[16],"value":[8],"adapter":[16],"combinators":[16],"addOptions":[16],"readonly":[516],"disabled":[516],"openState":[32]},null,{"adapter":[{"buildWalker":0}],"value":[{"syncOpenState":0}]}]]],["p-551a36f6",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-84ad9159",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-a201df35",[[17,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowPasteImages":[4,"allow-paste-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"appName":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-dacf9e77",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-ddc4ede8",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-97e75dee",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-0193ed83",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-5f682c06",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-6331f9c5",[[1,"limebb-rule-editor",{"platform":[16],"context":[16],"value":[16],"availableContexts":[16],"modes":[16],"required":[516],"readonly":[516],"disabled":[516],"invalid":[516],"label":[513],"helperText":[1,"helper-text"],"help":[1],"resolvedContext":[32],"issues":[32],"openChipPath":[32],"modeOverride":[32],"availablePrimitiveOptions":[32]},null,{"value":[{"onValueChange":0}],"availableContexts":[{"onAvailableContextsChange":0}]}]]],["p-dfaef740",[[1,"limebb-value-comparison-editor",{"value":[16],"platform":[16],"operandKey":[32],"direction":[32],"unit":[32],"count":[32],"countInput":[32],"countInvalid":[32],"specificDate":[32]},null,{"value":[{"onValueChange":0}]}]]],["p-b44b9dbc",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-ab0f8170",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-f9991c35",[[1,"limebb-color-palette-picker",{"value":[513],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"]}]]],["p-79d743bb",[[1,"limebb-color-palette-swatches",{"colors":[16]}]]],["p-a5f3913d",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":[{"watchFormInfo":0}],"configComponent":[{"watchconfigComponent":0}]}]]],["p-ce723c21",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-3babfbe0",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-8e9fcf3c",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-d3c58bc1",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-28550961",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"reducedPresence":[516,"reduced-presence"],"reducedPresenceRule":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-021e452a",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-49d042aa",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-1990e369",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-eed0b2c2",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-6a8422d2",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-8a17a7ea",[[1,"limebb-inline-image",{"imageId":[1,"image-id"],"alt":[1],"width":[1],"height":[1],"appName":[32]}]]],["p-d495cc19",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-f3539042",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-ce2755a0",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-08797129",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-0ed9a7cc",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-6f923112",[[257,"limebb-rule-gate",{"platform":[16],"rule":[16],"scope":[16],"shouldRender":[32]},null,{"rule":[{"onRuleChange":0}],"scope":[{"onScopeChange":0}]}]]],["p-dcb49a62",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":[{"valueChanged":0}]}]]],["p-0cbe2180",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-32a81271",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-c0d49532",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-1ebe45b8",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-1578c8f0",[[1,"limebb-condition-tree-editor",{"platform":[16],"context":[16],"open":[4],"editor":[16],"value":[8],"heading":[1],"negated":[4],"readonly":[516],"disabled":[516]}]]],["p-a953d48e",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-e6cc320a",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-ad5dcefd",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-7ae27308",[[1,"limebb-live-docs-info"]]],["p-bf05d9de",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-635a45ad",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":[{"valueChanged":0}]}]]],["p-229d018c",[[1,"limebb-rule-chip-popover",{"platform":[16],"context":[16],"refNode":[16],"isNegated":[4,"is-negated"],"metadata":[16],"readonly":[4],"disabled":[4],"isMutable":[4,"is-mutable"],"focusOnOpen":[4,"focus-on-open"]}]]],["p-0370200d",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-90f0c96b",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-dd02821e",[[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":[{"handleValueChange":0}]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-46aec244",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-cc53a8ca",[[1,"limebb-chat-icon-list",{"item":[16]}],[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-07a9c8f2",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-ffca266e",[[17,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-95ba7a84",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-402a9c97",[[2,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[513],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"isOpen":[32]}]]],["p-8c36b847",[[257,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"file":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-81783bd4",[[17,"limebb-lime-query-filter-comparison-editor",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"propertyType":[1,"property-type"]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[17,"limebb-filter-chip",{"label":[1],"value":[1],"conjunction":[1],"condition":[1],"propertyType":[1,"property-type"],"icon":[1],"helperLabel":[1,"helper-label"],"removable":[4],"readonly":[516],"disabled":[4],"invalid":[516],"selected":[516],"identifier":[8],"platform":[16],"maxLength":[2,"max-length"]},[[2,"click","filterClickWhenInactive"]]],[1,"limebb-filter-condition-picker",{"platform":[16],"value":[1],"propertyType":[1,"property-type"],"conditions":[16],"disabled":[516]}]]]]'),e))));
@@ -1 +1 @@
1
- import{r as t,h as e,H as i,g as r}from"./p-COtSgrC5.js";import{n as o}from"./p-Cj_3f9vm.js";function s(t){return"type"in t&&"iconList"===t.type}function n(t){if("chat"===t.type||"iconList"===t.type)return t.item.timestamp}function a(t){for(const e of t.items)s(e)?t.processedItems.push({type:"iconList",item:e}):t.processedItems.push({type:"chat",item:e});return t}function l(t){if(!t.lastVisitedTimestamp)return t;const e=t.processedItems,i=t.lastVisitedTimestamp;for(let r=e.length-1;r>=0;r--){const o=e[r];if("group"!==o.type)continue;const s=h(o.items,i);if(-1!==s)return c(t,e,r,o,s)}return t}function h(t,e){for(let i=t.length-1;i>=0;i--){const r=n(t[i]);if(void 0!==r&&new Date(r)<=e)return i}return-1}function c(t,e,i,r,o){const s=o===r.items.length-1;if(s&&i===e.length-1)return t;if(s)return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i+1),{type:"newItemIndicator"},...e.slice(i+1)]});const n=[...r.items.slice(0,o+1),{type:"newItemIndicator"},...r.items.slice(o+1)];return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i),Object.assign(Object.assign({},r),{items:n}),...e.slice(i+1)]})}function d(t){const e=[];let i=null,r=null;for(const o of t.processedItems){if("chat"!==o.type&&"iconList"!==o.type)continue;const s=t.dateTimeFormatter.format(new Date(o.item.timestamp),"date");s===r?null==i||i.items.push(o):(i&&e.push(i),i={type:"group",groupType:"dateGroup",heading:s,items:[o]},r=s)}return i&&e.push(i),Object.assign(Object.assign({},t),{processedItems:e})}class m{constructor(t,e,i,r){var o;this.scrollContainer=t,this.getOrder=e,this.onFollowingChanged=r,this.isSticky=!0,this.paintedOrder=i,null===(o=this.onFollowingChanged)||void 0===o||o.call(this,this.isSticky)}beforeRender(){this.scrollContainer.isConnected&&this.handleScroll()}handleScroll(){var t;if(!this.scrollContainer.isConnected)return;const e=this.scrollContainer.scrollTop;if(e===this.lastScrollTop)return;const i=this.distanceFromNewestEdge(this.paintedOrder)<50;i!==this.isSticky&&(this.isSticky=i,null===(t=this.onFollowingChanged)||void 0===t||t.call(this,i)),this.lastScrollTop=e}afterRender(){this.scrollContainer.isConnected&&(this.paintedOrder=this.getOrder(),this.isSticky&&this.scrollToNewest())}repinIfSticky(){this.scrollContainer.isConnected&&(this.handleScroll(),this.isSticky&&this.scrollToNewest())}scrollToNewest(){const t="oldest-on-top"===this.getOrder()?Math.max(0,this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight):0;this.scrollContainer.scrollTop!==t&&(this.scrollContainer.scrollTop=t,this.lastScrollTop=this.scrollContainer.scrollTop)}distanceFromNewestEdge(t){return"oldest-on-top"===t?this.scrollContainer.scrollHeight-this.scrollContainer.scrollTop-this.scrollContainer.clientHeight:this.scrollContainer.scrollTop}}const p=class{constructor(e){t(this,e),this.items=[],this.order="oldest-on-top",this.processedItems=[],this.handleScroll=t=>{var e;t.target===this.host&&(null===(e=this.scrollAnchor)||void 0===e||e.handleScroll())}}handleItemsChange(){let t=null;var e;this.lastVisitedTimestamp&&(t="string"==typeof(e=this.lastVisitedTimestamp)?new Date(Date.parse(e)):new Date(e));const i=(r={items:this.items,processedItems:[],lastVisitedTimestamp:t,dateTimeFormatter:this.dateTimeFormatter},[a,d,l].reduce(((t,e)=>e(t)),r)).processedItems;var r;this.processedItems="newest-on-top"===this.order?i.toReversed().map((t=>"group"!==t.type?t:Object.assign(Object.assign({},t),{items:t.items.toReversed()}))):i}componentWillLoad(){this.handleItemsChange()}connectedCallback(){this.observeSize()}componentDidLoad(){this.observeSize()}disconnectedCallback(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.resizeObserver=void 0}observeSize(){var t;const e=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".content");e&&!this.resizeObserver&&(this.resizeObserver=new ResizeObserver((()=>{var t;return null===(t=this.scrollAnchor)||void 0===t?void 0:t.repinIfSticky()})),this.resizeObserver.observe(e),this.resizeObserver.observe(this.host))}componentWillRender(){if(0===this.items.length)return this.scrollAnchor&&(this.host.scrollTop=0),this.scrollAnchor=void 0,void this.host.classList.remove("is-following");this.scrollAnchor?this.scrollAnchor.beforeRender():this.scrollAnchor=new m(this.host,(()=>this.order),this.order,(t=>this.host.classList.toggle("is-following",t)))}componentDidRender(){var t;null===(t=this.scrollAnchor)||void 0===t||t.afterRender()}render(){return e(i,{key:"f99cc3baf1dd34c6a8949976c71042ce0d809046",class:{"is-empty":0===this.items.length&&!this.isTypingIndicatorVisible},onScroll:this.handleScroll},e("div",{key:"1d77b03beb2c5d61b4e50f15d7458f9b28f35d67",class:"content"},e("div",{key:"7d1b5577c5f79ef49fe8f1fe33513b60576ee3b4",class:"messages",role:"log","aria-busy":this.isBusy()},this.renderSpinner(),"newest-on-top"===this.order&&this.renderTypingIndicatorBlock(),this.renderChatItems(),"oldest-on-top"===this.order&&this.renderTypingIndicatorBlock()),e("slot",{key:"04ae84b855377c9407f266ca9edffaefdd69f721",name:"after"})))}renderSpinner(){if(this.loading)return e("limel-spinner",null)}renderTypingIndicatorBlock(){return e("div",{class:"typing-indicator-height-animation"},e("div",null,this.renderTypingIndicator()))}renderTypingIndicator(){if(this.isTypingIndicatorVisible)return e("limebb-typing-indicator",null)}renderChatItems(){return this.processedItems.map((t=>{switch(t.type){case"group":return this.renderGroup(t);case"newItemIndicator":return this.renderIndicator();case"chat":case"iconList":return null;default:return b(t)}}))}renderGroup(t){const i=t.items.map((t=>{switch(t.type){case"chat":return this.renderChatItem(t.item);case"iconList":return this.renderIconList(t.item);case"newItemIndicator":return this.renderIndicator();case"group":return null;default:return b(t)}})),r="date-group-"+t.heading,o=`heading-${r}`.replaceAll(/[^a-zA-Z0-9_-]/g,"_"),s=e("a",{id:o,class:"date-heading",role:"heading","aria-level":2},t.heading);return e("section",{class:"date-group",key:r,"aria-labelledby":o},s,i)}renderChatItem(t){return e("limebb-chat-item",{platform:this.platform,context:this.context,item:t,helperText:t.helperText,hasError:t.hasError,key:t.id})}renderIconList(t){return e("limebb-chat-icon-list",{item:t,key:t.id})}renderIndicator(){return e("div",{class:"new-items-indicator",role:"separator"},e("hr",null),e("h3",null,this.translator.get("webclient.new")))}isBusy(){return this.loading||this.isTypingIndicatorVisible?"true":"false"}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){return this.platform.get(o.Translate)}get host(){return r(this)}static get watchers(){return{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}}};function b(t){throw new Error(`Unexpected value in exhaustive switch: ${JSON.stringify(t)}`)}p.style='@charset "UTF-8";:host(limebb-chat-list){--limel-top-edge-fade-height:0.75rem;isolation:isolate;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);box-sizing:border-box;display:flex;flex-direction:column;height:100%;width:100%;min-width:0;min-height:0;padding:var(--limel-top-edge-fade-height) 0.5rem;overflow:hidden auto}:host(limebb-chat-list.is-empty){padding:0}:host(limebb-chat-list.is-following){overflow-anchor:none}*{box-sizing:border-box}.content{display:flex;flex-direction:column;flex:1 0 auto;gap:0.5rem;min-width:0}.messages{display:flex;flex-direction:column;flex-shrink:0;gap:0.5rem}:host(limebb-chat-list[loading]) .messages{flex-grow:1}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:inherit;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:rgb(var(--contrast-100))}.typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.1s;--limebb-chat-typing-opacity-transition-delay:0s;--limebb-chat-typing-grid-template-rows-transition-speed:0.3s;position:sticky;z-index:1;transition:grid-template-rows var(--limebb-chat-typing-grid-template-rows-transition-speed) ease;display:grid;grid-template-rows:0}.typing-indicator-height-animation div{transition:opacity var(--limebb-chat-typing-opacity-transition-speed) ease var(--limebb-chat-typing-opacity-transition-delay);overflow:hidden;opacity:0}:host(limebb-chat-list[order=oldest-on-top]) .typing-indicator-height-animation{bottom:0}:host(limebb-chat-list[order=newest-on-top]) .typing-indicator-height-animation{top:0}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.4s;--limebb-chat-typing-opacity-transition-delay:0.3s;--limebb-chat-typing-grid-template-rows-transition-speed:0.46s;grid-template-rows:1.5rem}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation div{opacity:1}.date-group limebb-chat-item{--limebb-promoted-action-bar-grid-template-rows:0fr}:host(limebb-chat-list[order=oldest-on-top]) .date-group:last-of-type limebb-chat-item:last-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}:host(limebb-chat-list[order=newest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}';export{p as limebb_chat_list}
1
+ import{r as t,h as e,H as i,g as r}from"./p-COtSgrC5.js";import{n as o}from"./p-Cj_3f9vm.js";function s(t){return"type"in t&&"iconList"===t.type}function n(t){if("chat"===t.type||"iconList"===t.type)return t.item.timestamp}function a(t){for(const e of t.items)s(e)?t.processedItems.push({type:"iconList",item:e}):t.processedItems.push({type:"chat",item:e});return t}function l(t){if(!t.lastVisitedTimestamp)return t;const e=t.processedItems,i=t.lastVisitedTimestamp;for(let r=e.length-1;r>=0;r--){const o=e[r];if("group"!==o.type)continue;const s=h(o.items,i);if(-1!==s)return c(t,e,r,o,s)}return t}function h(t,e){for(let i=t.length-1;i>=0;i--){const r=n(t[i]);if(void 0!==r&&new Date(r)<=e)return i}return-1}function c(t,e,i,r,o){const s=o===r.items.length-1;if(s&&i===e.length-1)return t;if(s)return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i+1),{type:"newItemIndicator"},...e.slice(i+1)]});const n=[...r.items.slice(0,o+1),{type:"newItemIndicator"},...r.items.slice(o+1)];return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i),Object.assign(Object.assign({},r),{items:n}),...e.slice(i+1)]})}function d(t){const e=[];let i=null,r=null;for(const o of t.processedItems){if("chat"!==o.type&&"iconList"!==o.type)continue;const s=t.dateTimeFormatter.format(new Date(o.item.timestamp),"date");s===r?null==i||i.items.push(o):(i&&e.push(i),i={type:"group",groupType:"dateGroup",heading:s,items:[o]},r=s)}return i&&e.push(i),Object.assign(Object.assign({},t),{processedItems:e})}class m{constructor(t,e,i,r){var o;this.scrollContainer=t,this.getOrder=e,this.onFollowingChanged=r,this.isSticky=!0,this.paintedOrder=i,null===(o=this.onFollowingChanged)||void 0===o||o.call(this,this.isSticky)}beforeRender(){this.scrollContainer.isConnected&&this.handleScroll()}handleScroll(){var t;if(!this.scrollContainer.isConnected)return;const e=this.scrollContainer.scrollTop;if(e===this.lastScrollTop)return;const i=this.distanceFromNewestEdge(this.paintedOrder)<50;i!==this.isSticky&&(this.isSticky=i,null===(t=this.onFollowingChanged)||void 0===t||t.call(this,i)),this.lastScrollTop=e}afterRender(){this.scrollContainer.isConnected&&(this.paintedOrder=this.getOrder(),this.isSticky&&this.scrollToNewest())}repinIfSticky(){this.scrollContainer.isConnected&&(this.handleScroll(),this.isSticky&&this.scrollToNewest())}scrollToNewest(){const t="oldest-on-top"===this.getOrder()?Math.max(0,this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight):0;this.scrollContainer.scrollTop!==t&&(this.scrollContainer.scrollTop=t,this.lastScrollTop=this.scrollContainer.scrollTop)}distanceFromNewestEdge(t){return"oldest-on-top"===t?this.scrollContainer.scrollHeight-this.scrollContainer.scrollTop-this.scrollContainer.clientHeight:this.scrollContainer.scrollTop}}const p=class{constructor(e){t(this,e),this.items=[],this.order="oldest-on-top",this.processedItems=[],this.handleScroll=t=>{var e;t.target===this.host&&(null===(e=this.scrollAnchor)||void 0===e||e.handleScroll())}}handleItemsChange(){let t=null;var e;this.lastVisitedTimestamp&&(t="string"==typeof(e=this.lastVisitedTimestamp)?new Date(Date.parse(e)):new Date(e));const i=(r={items:this.items,processedItems:[],lastVisitedTimestamp:t,dateTimeFormatter:this.dateTimeFormatter},[a,d,l].reduce(((t,e)=>e(t)),r)).processedItems;var r;this.processedItems="newest-on-top"===this.order?i.toReversed().map((t=>"group"!==t.type?t:Object.assign(Object.assign({},t),{items:t.items.toReversed()}))):i}componentWillLoad(){this.handleItemsChange()}connectedCallback(){this.observeSize()}componentDidLoad(){this.observeSize()}disconnectedCallback(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.resizeObserver=void 0}observeSize(){var t;const e=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".content");e&&!this.resizeObserver&&(this.resizeObserver=new ResizeObserver((()=>{var t;return null===(t=this.scrollAnchor)||void 0===t?void 0:t.repinIfSticky()})),this.resizeObserver.observe(e),this.resizeObserver.observe(this.host))}componentWillRender(){if(0===this.items.length)return this.scrollAnchor&&(this.host.scrollTop=0),this.scrollAnchor=void 0,void this.host.classList.remove("is-following");this.scrollAnchor?this.scrollAnchor.beforeRender():this.scrollAnchor=new m(this.host,(()=>this.order),this.order,(t=>this.host.classList.toggle("is-following",t)))}componentDidRender(){var t;null===(t=this.scrollAnchor)||void 0===t||t.afterRender()}render(){return e(i,{key:"f99cc3baf1dd34c6a8949976c71042ce0d809046",class:{"is-empty":0===this.items.length&&!this.isTypingIndicatorVisible},onScroll:this.handleScroll},e("div",{key:"1d77b03beb2c5d61b4e50f15d7458f9b28f35d67",class:"content"},e("div",{key:"7d1b5577c5f79ef49fe8f1fe33513b60576ee3b4",class:"messages",role:"log","aria-busy":this.isBusy()},this.renderSpinner(),"newest-on-top"===this.order&&this.renderTypingIndicatorBlock(),this.renderChatItems(),"oldest-on-top"===this.order&&this.renderTypingIndicatorBlock()),e("slot",{key:"04ae84b855377c9407f266ca9edffaefdd69f721",name:"after"})))}renderSpinner(){if(this.loading)return e("limel-spinner",null)}renderTypingIndicatorBlock(){return e("div",{class:"typing-indicator-height-animation"},e("div",null,this.renderTypingIndicator()))}renderTypingIndicator(){if(this.isTypingIndicatorVisible)return e("limebb-typing-indicator",null)}renderChatItems(){return this.processedItems.map((t=>{switch(t.type){case"group":return this.renderGroup(t);case"newItemIndicator":return this.renderIndicator();case"chat":case"iconList":return null;default:return b(t)}}))}renderGroup(t){const i=t.items.map((t=>{switch(t.type){case"chat":return this.renderChatItem(t.item);case"iconList":return this.renderIconList(t.item);case"newItemIndicator":return this.renderIndicator();case"group":return null;default:return b(t)}})),r="date-group-"+t.heading,o=`heading-${r}`.replaceAll(/[^a-zA-Z0-9_-]/g,"_"),s=e("a",{id:o,class:"date-heading",role:"heading","aria-level":2},t.heading);return e("section",{class:"date-group",key:r,"aria-labelledby":o},s,i)}renderChatItem(t){return e("limebb-chat-item",{platform:this.platform,context:this.context,item:t,helperText:t.helperText,hasError:t.hasError,key:`chat-${t.id}`})}renderIconList(t){return e("limebb-chat-icon-list",{item:t,key:`icon-list-${t.id}`})}renderIndicator(){return e("div",{class:"new-items-indicator",role:"separator"},e("hr",null),e("h3",null,this.translator.get("webclient.new")))}isBusy(){return this.loading||this.isTypingIndicatorVisible?"true":"false"}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){return this.platform.get(o.Translate)}get host(){return r(this)}static get watchers(){return{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}}};function b(t){throw new Error(`Unexpected value in exhaustive switch: ${JSON.stringify(t)}`)}p.style='@charset "UTF-8";:host(limebb-chat-list){--limel-top-edge-fade-height:0.75rem;isolation:isolate;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);box-sizing:border-box;display:flex;flex-direction:column;height:100%;width:100%;min-width:0;min-height:0;padding:var(--limel-top-edge-fade-height) 0.5rem;overflow:hidden auto}:host(limebb-chat-list.is-empty){padding:0}:host(limebb-chat-list.is-following){overflow-anchor:none}*{box-sizing:border-box}.content{display:flex;flex-direction:column;flex:1 0 auto;gap:0.5rem;min-width:0}.messages{display:flex;flex-direction:column;flex-shrink:0;gap:0.5rem}:host(limebb-chat-list[loading]) .messages{flex-grow:1}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:inherit;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:rgb(var(--contrast-100))}.typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.1s;--limebb-chat-typing-opacity-transition-delay:0s;--limebb-chat-typing-grid-template-rows-transition-speed:0.3s;position:sticky;z-index:1;transition:grid-template-rows var(--limebb-chat-typing-grid-template-rows-transition-speed) ease;display:grid;grid-template-rows:0}.typing-indicator-height-animation div{transition:opacity var(--limebb-chat-typing-opacity-transition-speed) ease var(--limebb-chat-typing-opacity-transition-delay);overflow:hidden;opacity:0}:host(limebb-chat-list[order=oldest-on-top]) .typing-indicator-height-animation{bottom:0}:host(limebb-chat-list[order=newest-on-top]) .typing-indicator-height-animation{top:0}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.4s;--limebb-chat-typing-opacity-transition-delay:0.3s;--limebb-chat-typing-grid-template-rows-transition-speed:0.46s;grid-template-rows:1.5rem}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation div{opacity:1}.date-group limebb-chat-item{--limebb-promoted-action-bar-grid-template-rows:0fr}:host(limebb-chat-list[order=oldest-on-top]) .date-group:last-of-type limebb-chat-item:last-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}:host(limebb-chat-list[order=newest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}';export{p as limebb_chat_list}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-crm-building-blocks",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "A home for shared components meant for use with Lime CRM",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",