@limetech/lime-crm-building-blocks 1.21.1 → 1.21.2
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/dist/cjs/limebb-feed_2.cjs.entry.js +3 -0
- package/dist/collection/components/feed/feed.js +3 -0
- package/dist/components/feed.js +3 -0
- package/dist/esm/limebb-feed_2.entry.js +3 -0
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/p-7e8efca9.entry.js +1 -0
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-f6252b58.entry.js +0 -1
package/dist/components/feed.js
CHANGED
|
@@ -159,6 +159,9 @@ const Feed = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
renderEmptyFeedMessage() {
|
|
162
|
+
if (this.loading) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
162
165
|
if (this.items.length === 0) {
|
|
163
166
|
return h("p", { class: "empty-state" }, this.emptyStateMessage);
|
|
164
167
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as l}from"./p-f2df26cc.js";(()=>{const l=import.meta.url,a={};return""!==l&&(a.resourcesUrl=new URL(".",l).href),e(a)})().then((e=>l([["p-d59131e7",[[1,"limebb-example-date-picker-date",{value:[32]}]]],["p-50a258ea",[[1,"limebb-example-date-picker-datetime",{value:[32]}]]],["p-450fcd74",[[1,"limebb-example-date-picker-time",{value:[32]}]]],["p-2e4860b6",[[1,"limebb-example-date-picker-week",{value:[32]}]]],["p-44b8ed1a",[[1,"limebb-example-date-range"]]],["p-96af3ded",[[1,"limebb-example-feed"]]],["p-e9ccf036",[[1,"limebb-example-feed-author"]]],["p-e53823d4",[[1,"limebb-example-feed-author-picture"]]],["p-d38dc138",[[1,"limebb-example-feed-item-heading"]]],["p-3f9f5b8a",[[1,"limebb-example-feed-load-more",{objectIds:[32]}]]],["p-66d62349",[[1,"limebb-example-feed-promoted-actions"]]],["p-4b65e8b0",[[1,"limebb-example-feed-relations"]]],["p-8806c0c6",[[1,"limebb-example-feed-unpromoted-actions"]]],["p-87446b69",[[1,"limebb-example-currency-picker",{selectedCurrency:[32]}]]],["p-6bed42e3",[[1,"limebb-example-currency-picker-european",{selectedCurrency:[32]}]]],["p-f43374b6",[[1,"limebb-example-currency-picker-nordic",{selectedCurrency:[32]}]]],["p-76a7dc35",[[1,"limebb-dashboard-widget",{heading:[513],subheading:[513],supportingText:[513,"supporting-text"],icon:[513]}]]],["p-38c7f848",[[1,"limebb-example-dashboard-widget"]]],["p-161d3ab4",[[1,"limebb-example-dashboard-widget-slots",{filterMyDeals:[32]}]]],["p-2a21f554",[[1,"limebb-example-dashboard-widget-styles"]]],["p-33c9f8d2",[[1,"limebb-example-icon-picker",{value:[32]}]]],["p-f09bb2bd",[[1,"limebb-example-locale-picker",{value:[1]}]]],["p-efcb287a",[[1,"limebb-example-locale-picker-multiple",{value:[1]}]]],["p-33022901",[[1,"limebb-navigation-button",{href:[513],tooltipLabel:[513,"tooltip-label"],tooltipHelperLabel:[513,"tooltip-helper-label"],type:[513]}]]],["p-c0ceb829",[[1,"limebb-example-navigation-button-back"]]],["p-e9a19780",[[1,"limebb-example-navigation-button-close"]]],["p-9f1cc4db",[[1,"limebb-example-navigation-button-expand"]]],["p-dc4cd07c",[[1,"limebb-example-navigation-button-float"]]],["p-31461bb1",[[1,"limebb-example-navigation-button-maximize"]]],["p-9f2c8392",[[1,"limebb-example-navigation-button-minimize"]]],["p-328a8527",[[1,"limebb-example-navigation-button-new-tab"]]],["p-9f298aae",[[1,"limebb-example-navigation-button-shrink"]]],["p-e44c4258",[[0,"limebb-example-value",{label:[513],value:[8]}],[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-31d13c9e",[[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-c60424fe",[[1,"limebb-icon-picker",{value:[1],required:[4],readonly:[4],invalid:[4],disabled:[4],label:[1],helperText:[1,"helper-text"]}]]],["p-cd01138c",[[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-0466cfe7",[[1,"limebb-currency-picker",{label:[513],platform:[16],currencies:[16],helperText:[513,"helper-text"],required:[516],readonly:[516],invalid:[516],disabled:[516],value:[8]}]]],["p-
|
|
1
|
+
import{p as e,b as l}from"./p-f2df26cc.js";(()=>{const l=import.meta.url,a={};return""!==l&&(a.resourcesUrl=new URL(".",l).href),e(a)})().then((e=>l([["p-d59131e7",[[1,"limebb-example-date-picker-date",{value:[32]}]]],["p-50a258ea",[[1,"limebb-example-date-picker-datetime",{value:[32]}]]],["p-450fcd74",[[1,"limebb-example-date-picker-time",{value:[32]}]]],["p-2e4860b6",[[1,"limebb-example-date-picker-week",{value:[32]}]]],["p-44b8ed1a",[[1,"limebb-example-date-range"]]],["p-96af3ded",[[1,"limebb-example-feed"]]],["p-e9ccf036",[[1,"limebb-example-feed-author"]]],["p-e53823d4",[[1,"limebb-example-feed-author-picture"]]],["p-d38dc138",[[1,"limebb-example-feed-item-heading"]]],["p-3f9f5b8a",[[1,"limebb-example-feed-load-more",{objectIds:[32]}]]],["p-66d62349",[[1,"limebb-example-feed-promoted-actions"]]],["p-4b65e8b0",[[1,"limebb-example-feed-relations"]]],["p-8806c0c6",[[1,"limebb-example-feed-unpromoted-actions"]]],["p-87446b69",[[1,"limebb-example-currency-picker",{selectedCurrency:[32]}]]],["p-6bed42e3",[[1,"limebb-example-currency-picker-european",{selectedCurrency:[32]}]]],["p-f43374b6",[[1,"limebb-example-currency-picker-nordic",{selectedCurrency:[32]}]]],["p-76a7dc35",[[1,"limebb-dashboard-widget",{heading:[513],subheading:[513],supportingText:[513,"supporting-text"],icon:[513]}]]],["p-38c7f848",[[1,"limebb-example-dashboard-widget"]]],["p-161d3ab4",[[1,"limebb-example-dashboard-widget-slots",{filterMyDeals:[32]}]]],["p-2a21f554",[[1,"limebb-example-dashboard-widget-styles"]]],["p-33c9f8d2",[[1,"limebb-example-icon-picker",{value:[32]}]]],["p-f09bb2bd",[[1,"limebb-example-locale-picker",{value:[1]}]]],["p-efcb287a",[[1,"limebb-example-locale-picker-multiple",{value:[1]}]]],["p-33022901",[[1,"limebb-navigation-button",{href:[513],tooltipLabel:[513,"tooltip-label"],tooltipHelperLabel:[513,"tooltip-helper-label"],type:[513]}]]],["p-c0ceb829",[[1,"limebb-example-navigation-button-back"]]],["p-e9a19780",[[1,"limebb-example-navigation-button-close"]]],["p-9f1cc4db",[[1,"limebb-example-navigation-button-expand"]]],["p-dc4cd07c",[[1,"limebb-example-navigation-button-float"]]],["p-31461bb1",[[1,"limebb-example-navigation-button-maximize"]]],["p-9f2c8392",[[1,"limebb-example-navigation-button-minimize"]]],["p-328a8527",[[1,"limebb-example-navigation-button-new-tab"]]],["p-9f298aae",[[1,"limebb-example-navigation-button-shrink"]]],["p-e44c4258",[[0,"limebb-example-value",{label:[513],value:[8]}],[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-31d13c9e",[[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-c60424fe",[[1,"limebb-icon-picker",{value:[1],required:[4],readonly:[4],invalid:[4],disabled:[4],label:[1],helperText:[1,"helper-text"]}]]],["p-cd01138c",[[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-0466cfe7",[[1,"limebb-currency-picker",{label:[513],platform:[16],currencies:[16],helperText:[513,"helper-text"],required:[516],readonly:[516],invalid:[516],disabled:[516],value:[8]}]]],["p-7e8efca9",[[1,"limebb-feed",{platform:[16],context:[16],items:[16],emptyStateMessage:[1,"empty-state-message"],loading:[4],minutesOfProximity:[2,"minutes-of-proximity"],totalCount:[2,"total-count"]}],[1,"limebb-feed-timeline-item",{platform:[16],context:[16],item:[16],isBundled:[516,"is-bundled"]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as i,H as r}from"./p-f2df26cc.js";import{P as o}from"./p-bc052012.js";import{r as s,t as a}from"./p-1095efdb.js";function n(e,t){return s(2,arguments),a(e).getTime()-a(t).getTime()}var l={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function d(e){return e?l[e]:l.trunc}const m=class{constructor(i){e(this,i),this.promotedActionSelected=t(this,"promotedActionSelected",7),this.loadMore=t(this,"loadMore",7),this.items=[],this.minutesOfProximity=5,this.totalCount=0,this.isBundled=(e,t)=>{var i,r,o;if(0===t)return!1;if((null===(r=null===(i=this.items[t-1])||void 0===i?void 0:i.author)||void 0===r?void 0:r.id)!==(null===(o=null==e?void 0:e.author)||void 0===o?void 0:o.id))return!1;const a=new Date(e.timestamp),l=new Date(this.items[t-1].timestamp),m=new Date(l);return function(e,t,i){s(2,arguments);var r=n(e,t)/6e4;return d(null==i?void 0:i.roundingMethod)(r)}(new Date(a),m)<=this.minutesOfProximity},this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit()}}render(){return[this.renderLoadMore(),this.renderEmptyFeedMessage(),this.renderSpinner(),this.renderFeedItems()]}renderSpinner(){if(this.loading)return i("limel-spinner",{size:"small"})}renderEmptyFeedMessage(){if(!this.loading)return 0===this.items.length?i("p",{class:"empty-state"},this.emptyStateMessage):void 0}renderFeedItems(){return this.items.map(((e,t)=>[this.renderDateHeader(e.timestamp,t),i("limebb-feed-timeline-item",{platform:this.platform,context:this.context,item:e,isBundled:this.isBundled(e,t)})]))}renderDateHeader(e,t){const r=this.dateTimeFormatter.format(e,"date");return 0===t||this.dateTimeFormatter.format(this.items[t-1].timestamp,"date")!==r?i("a",{class:"date-heading"},r):void 0}renderLoadMore(){if(this.items.length&&!(this.totalCount<=this.items.length))return i("limel-icon-button",{class:"view-load-more_button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:"Load more"})}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}};m.style=":host(limebb-feed){display:flex;flex-direction:column;gap:0.25rem}.empty-state{text-align:center}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-heading{font-weight:600;font-size:0.875rem;margin:1.25rem 0 0.5rem 0;color:rgb(var(--contrast-900))}limebb-feed-timeline-item:has(+limebb-feed-timeline-item[is-bundled]){--limebb-feed-item-action-bar-grid-template-rows:0fr}";const h=class{constructor(r){e(this,r),this.itemSelected=t(this,"itemSelected",7),this.promotedActionSelected=t(this,"promotedActionSelected",7),this.isBundled=!1,this.renderRelations=()=>{var e,t;if(null===(e=this.item)||void 0===e?void 0:e.relations)return i("limel-chip-set",{value:null===(t=this.item)||void 0===t?void 0:t.relations})},this.handleMenuItemSelect=e=>{e.stopPropagation(),this.itemSelected.emit(e.detail)},this.handleActionBarItemSelect=e=>{e.stopPropagation(),this.promotedActionSelected.emit(e.detail)}}render(){var e,t;return i(r,{id:this.item.id,class:{"has-unpromoted-actions":!!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length),"has-author-picture":!!(null===(t=this.item.author)||void 0===t?void 0:t.picture)}},this.renderBadgeAndTimestamp(),this.renderContent())}renderBadgeAndTimestamp(){return i("div",{class:"left"},this.renderAuthorPicture(),this.renderIcon(),i("span",{class:"timestamp"},this.renderTimestamp()))}renderIcon(){var e,t,r,o,s;if(!this.isBundled&&(this.item.icon||!(null===(e=this.item.author)||void 0===e?void 0:e.picture)))return i("limel-icon",{class:"icon",badge:!0,name:null!==(r=null===(t=this.item.icon)||void 0===t?void 0:t.name)&&void 0!==r?r:"dot_circle",style:{color:`${null===(o=this.item.icon)||void 0===o?void 0:o.color}`,"--icon-background-color":`${null===(s=this.item.icon)||void 0===s?void 0:s.backgroundColor}`}})}renderContent(){return i("div",{class:"right"},i("div",{class:"content"},i("div",{class:"header"},this.renderAuthor(),this.renderHeading(),this.renderUnpromotedActionsMenu()),this.renderValue(),this.renderRelations()),this.renderPromotedActions())}renderAuthor(){if(this.item.author&&!this.isBundled){if("string"==typeof this.item.author.name)return i("span",{class:"author"},this.item.author.name);if("object"==typeof this.item.author.name){const{href:e,title:t,text:r}=this.item.author.name;return i("a",{class:"author",href:e,title:t},r)}}}renderAuthorPicture(){var e;if(null===(e=this.item.author)||void 0===e?void 0:e.picture)return i("img",{loading:"lazy",src:this.item.author.picture})}renderHeading(){if(this.item.heading)return i("limel-markdown",{class:"heading truncate-paragraphs",value:this.item.heading})}renderValue(){if(this.item.value)return i("limel-markdown",{value:this.item.value})}renderUnpromotedActionsMenu(){var e;if(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length)return i("limel-menu",{class:"unpromoted-actions-menu",items:this.item.unpromotedActions,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},i("limel-icon-button",{icon:"menu_2",slot:"trigger",label:this.item.unpromotedActionsMenuLabel}))}renderPromotedActions(){var e;if(null===(e=this.item.promotedActions)||void 0===e?void 0:e.length)return i("div",{class:"action-bar"},i("div",{class:"action-bar-hider"},i("limel-action-bar",{accessibleLabel:"Action bar",actions:this.item.promotedActions,layout:"fullWidth",onItemSelected:this.handleActionBarItemSelect})))}renderTimestamp(){const e=this.item.timestamp;if(e)return this.dateTimeFormatter.format(e,"timeofday")}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}};h.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-feed-timeline-item){--limebb-feed-item-paddings:0.75rem;display:flex;gap:0.75rem;position:relative;isolation:isolate}:host(limebb-feed-timeline-item:hover) .timestamp{opacity:1}:host(limebb-feed-timeline-item[is-bundled]:hover){--limebb-feed-item-timestamp-opacity-delay:0.5s}:host(limebb-feed-timeline-item[is-bundled]:hover) .timestamp{opacity:1}:host(limebb-feed-timeline-item[is-bundled]) .timestamp{opacity:0}.left{display:flex;flex-direction:column;align-items:center;gap:0.25rem}.right,.content{display:flex;flex-direction:column;flex-grow:1;min-width:0}.content{border-radius:1rem;gap:0.25rem;background-color:rgb(var(--contrast-300));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.5rem}:host(.has-unpromoted-actions) .header{padding-right:2rem}.heading{flex-grow:1;overflow:hidden;white-space:nowrap}.unpromoted-actions-menu{position:absolute;top:0;right:0}.timestamp{transition:opacity 0.2s ease var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;opacity:0.8;text-align:center}.icon{width:2rem;padding:0.125rem}:host(.has-author-picture) .icon{width:1.5rem}img{border-radius:50%;width:2rem;height:2rem;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{font-weight:bold;text-decoration:none}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:rgb(var(--color-blue-default))}a.author:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}a.author:hover{color:rgb(var(--color-blue-default))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-chip-set{margin-left:-1rem}limel-action-bar{--action-bar-item-height:1.75rem;transition:opacity 0.2s ease;justify-content:flex-start;opacity:0.8}.action-bar{display:grid;transition:grid-template-rows var(--limebb-feed-item-action-bar-grid-template-rows-transition-speed, 0.2s) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-feed-item-action-bar-grid-template-rows-transition-delay, 0s);grid-template-rows:var(--limebb-feed-item-action-bar-grid-template-rows, 1fr)}.action-bar-hider{overflow:hidden}limel-action-bar{transition:padding var(--limebb-feed-item-action-bar-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-feed-item-action-bar-grid-template-rows-transition-delay);padding-bottom:0.5rem}:host(limebb-feed-timeline-item:hover) .action-bar,:host(limebb-feed-timeline-item:focus-within) .action-bar,:host(limebb-feed-timeline-item:focus-visible) .action-bar{--limebb-feed-item-action-bar-grid-template-rows:1fr;will-change:grid-template-rows}:host(limebb-feed-timeline-item:hover) limel-action-bar,:host(limebb-feed-timeline-item:focus-within) limel-action-bar,:host(limebb-feed-timeline-item:focus-visible) limel-action-bar{will-change:opacity;opacity:1}:host(limebb-feed-timeline-item:hover){--limebb-feed-item-action-bar-grid-template-rows-transition-speed:0.46s;--limebb-feed-item-action-bar-grid-template-rows-transition-delay:0.5s}';export{m as limebb_feed,h as limebb_feed_timeline_item}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as r}from"./p-f2df26cc.js";import{P as o}from"./p-bc052012.js";import{r as a,t as s}from"./p-1095efdb.js";function n(e,t){return a(2,arguments),s(e).getTime()-s(t).getTime()}var l={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function d(e){return e?l[e]:l.trunc}const m=class{constructor(i){e(this,i),this.promotedActionSelected=t(this,"promotedActionSelected",7),this.loadMore=t(this,"loadMore",7),this.items=[],this.minutesOfProximity=5,this.totalCount=0,this.isBundled=(e,t)=>{var i,r,o;if(0===t)return!1;if((null===(r=null===(i=this.items[t-1])||void 0===i?void 0:i.author)||void 0===r?void 0:r.id)!==(null===(o=null==e?void 0:e.author)||void 0===o?void 0:o.id))return!1;const s=new Date(e.timestamp),l=new Date(this.items[t-1].timestamp),m=new Date(l);return function(e,t,i){a(2,arguments);var r=n(e,t)/6e4;return d(null==i?void 0:i.roundingMethod)(r)}(new Date(s),m)<=this.minutesOfProximity},this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit()}}render(){return[this.renderLoadMore(),this.renderEmptyFeedMessage(),this.renderSpinner(),this.renderFeedItems()]}renderSpinner(){if(this.loading)return i("limel-spinner",{size:"small"})}renderEmptyFeedMessage(){if(0===this.items.length)return i("p",{class:"empty-state"},this.emptyStateMessage)}renderFeedItems(){return this.items.map(((e,t)=>[this.renderDateHeader(e.timestamp,t),i("limebb-feed-timeline-item",{platform:this.platform,context:this.context,item:e,isBundled:this.isBundled(e,t)})]))}renderDateHeader(e,t){const r=this.dateTimeFormatter.format(e,"date");return 0===t||this.dateTimeFormatter.format(this.items[t-1].timestamp,"date")!==r?i("a",{class:"date-heading"},r):void 0}renderLoadMore(){if(this.items.length&&!(this.totalCount<=this.items.length))return i("limel-icon-button",{class:"view-load-more_button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:"Load more"})}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}};m.style=":host(limebb-feed){display:flex;flex-direction:column;gap:0.25rem}.empty-state{text-align:center}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-heading{font-weight:600;font-size:0.875rem;margin:1.25rem 0 0.5rem 0;color:rgb(var(--contrast-900))}limebb-feed-timeline-item:has(+limebb-feed-timeline-item[is-bundled]){--limebb-feed-item-action-bar-grid-template-rows:0fr}";const h=class{constructor(r){e(this,r),this.itemSelected=t(this,"itemSelected",7),this.promotedActionSelected=t(this,"promotedActionSelected",7),this.isBundled=!1,this.renderRelations=()=>{var e,t;if(null===(e=this.item)||void 0===e?void 0:e.relations)return i("limel-chip-set",{value:null===(t=this.item)||void 0===t?void 0:t.relations})},this.handleMenuItemSelect=e=>{e.stopPropagation(),this.itemSelected.emit(e.detail)},this.handleActionBarItemSelect=e=>{e.stopPropagation(),this.promotedActionSelected.emit(e.detail)}}render(){var e,t;return i(r,{id:this.item.id,class:{"has-unpromoted-actions":!!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length),"has-author-picture":!!(null===(t=this.item.author)||void 0===t?void 0:t.picture)}},this.renderBadgeAndTimestamp(),this.renderContent())}renderBadgeAndTimestamp(){return i("div",{class:"left"},this.renderAuthorPicture(),this.renderIcon(),i("span",{class:"timestamp"},this.renderTimestamp()))}renderIcon(){var e,t,r,o,a;if(!this.isBundled&&(this.item.icon||!(null===(e=this.item.author)||void 0===e?void 0:e.picture)))return i("limel-icon",{class:"icon",badge:!0,name:null!==(r=null===(t=this.item.icon)||void 0===t?void 0:t.name)&&void 0!==r?r:"dot_circle",style:{color:`${null===(o=this.item.icon)||void 0===o?void 0:o.color}`,"--icon-background-color":`${null===(a=this.item.icon)||void 0===a?void 0:a.backgroundColor}`}})}renderContent(){return i("div",{class:"right"},i("div",{class:"content"},i("div",{class:"header"},this.renderAuthor(),this.renderHeading(),this.renderUnpromotedActionsMenu()),this.renderValue(),this.renderRelations()),this.renderPromotedActions())}renderAuthor(){if(this.item.author&&!this.isBundled){if("string"==typeof this.item.author.name)return i("span",{class:"author"},this.item.author.name);if("object"==typeof this.item.author.name){const{href:e,title:t,text:r}=this.item.author.name;return i("a",{class:"author",href:e,title:t},r)}}}renderAuthorPicture(){var e;if(null===(e=this.item.author)||void 0===e?void 0:e.picture)return i("img",{loading:"lazy",src:this.item.author.picture})}renderHeading(){if(this.item.heading)return i("limel-markdown",{class:"heading truncate-paragraphs",value:this.item.heading})}renderValue(){if(this.item.value)return i("limel-markdown",{value:this.item.value})}renderUnpromotedActionsMenu(){var e;if(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length)return i("limel-menu",{class:"unpromoted-actions-menu",items:this.item.unpromotedActions,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},i("limel-icon-button",{icon:"menu_2",slot:"trigger",label:this.item.unpromotedActionsMenuLabel}))}renderPromotedActions(){var e;if(null===(e=this.item.promotedActions)||void 0===e?void 0:e.length)return i("div",{class:"action-bar"},i("div",{class:"action-bar-hider"},i("limel-action-bar",{accessibleLabel:"Action bar",actions:this.item.promotedActions,layout:"fullWidth",onItemSelected:this.handleActionBarItemSelect})))}renderTimestamp(){const e=this.item.timestamp;if(e)return this.dateTimeFormatter.format(e,"timeofday")}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}};h.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-feed-timeline-item){--limebb-feed-item-paddings:0.75rem;display:flex;gap:0.75rem;position:relative;isolation:isolate}:host(limebb-feed-timeline-item:hover) .timestamp{opacity:1}:host(limebb-feed-timeline-item[is-bundled]:hover){--limebb-feed-item-timestamp-opacity-delay:0.5s}:host(limebb-feed-timeline-item[is-bundled]:hover) .timestamp{opacity:1}:host(limebb-feed-timeline-item[is-bundled]) .timestamp{opacity:0}.left{display:flex;flex-direction:column;align-items:center;gap:0.25rem}.right,.content{display:flex;flex-direction:column;flex-grow:1;min-width:0}.content{border-radius:1rem;gap:0.25rem;background-color:rgb(var(--contrast-300));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.5rem}:host(.has-unpromoted-actions) .header{padding-right:2rem}.heading{flex-grow:1;overflow:hidden;white-space:nowrap}.unpromoted-actions-menu{position:absolute;top:0;right:0}.timestamp{transition:opacity 0.2s ease var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;opacity:0.8;text-align:center}.icon{width:2rem;padding:0.125rem}:host(.has-author-picture) .icon{width:1.5rem}img{border-radius:50%;width:2rem;height:2rem;object-fit:cover;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{font-weight:bold;text-decoration:none}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:rgb(var(--color-blue-default))}a.author:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}a.author:hover{color:rgb(var(--color-blue-default))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-chip-set{margin-left:-1rem}limel-action-bar{--action-bar-item-height:1.75rem;transition:opacity 0.2s ease;justify-content:flex-start;opacity:0.8}.action-bar{display:grid;transition:grid-template-rows var(--limebb-feed-item-action-bar-grid-template-rows-transition-speed, 0.2s) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-feed-item-action-bar-grid-template-rows-transition-delay, 0s);grid-template-rows:var(--limebb-feed-item-action-bar-grid-template-rows, 1fr)}.action-bar-hider{overflow:hidden}limel-action-bar{transition:padding var(--limebb-feed-item-action-bar-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-feed-item-action-bar-grid-template-rows-transition-delay);padding-bottom:0.5rem}:host(limebb-feed-timeline-item:hover) .action-bar,:host(limebb-feed-timeline-item:focus-within) .action-bar,:host(limebb-feed-timeline-item:focus-visible) .action-bar{--limebb-feed-item-action-bar-grid-template-rows:1fr;will-change:grid-template-rows}:host(limebb-feed-timeline-item:hover) limel-action-bar,:host(limebb-feed-timeline-item:focus-within) limel-action-bar,:host(limebb-feed-timeline-item:focus-visible) limel-action-bar{will-change:opacity;opacity:1}:host(limebb-feed-timeline-item:hover){--limebb-feed-item-action-bar-grid-template-rows-transition-speed:0.46s;--limebb-feed-item-action-bar-grid-template-rows-transition-delay:0.5s}';export{m as limebb_feed,h as limebb_feed_timeline_item}
|