@limetech/lime-crm-building-blocks 1.21.11 → 1.21.13
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 +13 -3
- package/dist/collection/components/feed/feed-item/feed-timeline-item.css +28 -22
- package/dist/collection/components/feed/feed-item/feed-timeline-item.js +12 -2
- package/dist/components/feed-timeline-item.js +13 -3
- package/dist/esm/limebb-feed_2.entry.js +13 -3
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/p-e35e1007.entry.js +1 -0
- package/dist/types/components/feed/feed-item/feed-timeline-item.d.ts +3 -1
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-9380b07d.entry.js +0 -1
|
@@ -198,7 +198,7 @@ const Feed = class {
|
|
|
198
198
|
};
|
|
199
199
|
Feed.style = feedCss;
|
|
200
200
|
|
|
201
|
-
const feedTimelineItemCss = "@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{color:rgb(var(--contrast-1100))}: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:before{content:\"\";position:absolute;z-index:0;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;background-color:rgb(var(--contrast-600));z-index:-1}.info{position:sticky;top:0.5rem;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(--limebb-feed-item-background-color));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:smaller}: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:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;text-align:center;color:rgb(var(--contrast-800));background-color:var(--limebb-feed-background-color);padding:0.125rem 0}.icon{--icon-background-color:var(--limebb-feed-background-color);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;margin-bottom:-0.5rem}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}:host(limebb-feed-timeline-item.is-tall) .
|
|
201
|
+
const feedTimelineItemCss = "@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{color:rgb(var(--contrast-1100))}: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:before{content:\"\";position:absolute;z-index:0;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;background-color:rgb(var(--contrast-600));z-index:-1}.info{position:sticky;top:0.5rem;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(--limebb-feed-item-background-color));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:smaller}: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:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;text-align:center;color:rgb(var(--contrast-800));background-color:var(--limebb-feed-background-color);padding:0.125rem 0}.icon{--icon-background-color:var(--limebb-feed-background-color);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;margin-bottom:-0.5rem}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}:host(limebb-feed-timeline-item.is-tall) .markdown-container{margin-bottom:0.5rem}:host(limebb-feed-timeline-item.is-tall) .body-text{min-height:10.25rem}:host(limebb-feed-timeline-item.is-tall) .body-text:after{transition:opacity 0.6s ease;content:\"\";opacity:0.26;pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{opacity:1}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{transition:grid-template-rows calc(var(--body-text-height) * 1.2ms) cubic-bezier(1, 0.09, 0, 0.89);position:relative;display:grid}.body-text{display:block;overflow:hidden}#show-more-button{all:unset;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);z-index:1;position:absolute;right:0;bottom:-0.6rem;left:0;margin:0 auto;display:flex;align-items:center;justify-content:center;border-radius:3rem;width:2rem;height:1rem}#show-more-button:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}#show-more-button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}#show-more-button:focus{outline:none}#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}";
|
|
202
202
|
|
|
203
203
|
const FeedTimelineItem = class {
|
|
204
204
|
constructor(hostRef) {
|
|
@@ -232,6 +232,9 @@ const FeedTimelineItem = class {
|
|
|
232
232
|
const height = entries[0].contentRect.height;
|
|
233
233
|
const maxHeight = 160;
|
|
234
234
|
this.isTall = height > maxHeight ? true : false;
|
|
235
|
+
if (this.bodyTextHeight === undefined) {
|
|
236
|
+
this.bodyTextHeight = height;
|
|
237
|
+
}
|
|
235
238
|
};
|
|
236
239
|
this.renderHeader = () => {
|
|
237
240
|
if ((this.isBundled && !this.item.heading) ||
|
|
@@ -281,6 +284,8 @@ const FeedTimelineItem = class {
|
|
|
281
284
|
'shows-less': !this.showMore,
|
|
282
285
|
'shows-more': this.showMore,
|
|
283
286
|
'is-tall': this.isTall,
|
|
287
|
+
}, style: {
|
|
288
|
+
'--body-text-height': `${this.bodyTextHeight}`,
|
|
284
289
|
} }, this.renderBadgeAndTimestamp(), this.renderContent()));
|
|
285
290
|
}
|
|
286
291
|
renderBadgeAndTimestamp() {
|
|
@@ -345,10 +350,11 @@ const FeedTimelineItem = class {
|
|
|
345
350
|
];
|
|
346
351
|
}
|
|
347
352
|
toggleShowMoreLabel() {
|
|
353
|
+
var _a, _b;
|
|
348
354
|
if (this.showMore) {
|
|
349
|
-
return '
|
|
355
|
+
return (_a = this.translator) === null || _a === void 0 ? void 0 : _a.get('webclient.show-less');
|
|
350
356
|
}
|
|
351
|
-
return '
|
|
357
|
+
return (_b = this.translator) === null || _b === void 0 ? void 0 : _b.get('webclient.show-more');
|
|
352
358
|
}
|
|
353
359
|
renderUnpromotedActionsMenu() {
|
|
354
360
|
var _a;
|
|
@@ -374,6 +380,10 @@ const FeedTimelineItem = class {
|
|
|
374
380
|
get dateTimeFormatter() {
|
|
375
381
|
return this.platform.get(types.PlatformServiceName.DateTimeFormatter);
|
|
376
382
|
}
|
|
383
|
+
get translator() {
|
|
384
|
+
var _a;
|
|
385
|
+
return (_a = this.platform) === null || _a === void 0 ? void 0 : _a.get(types.PlatformServiceName.Translate);
|
|
386
|
+
}
|
|
377
387
|
get el() { return index$1.getElement(this); }
|
|
378
388
|
};
|
|
379
389
|
FeedTimelineItem.style = feedTimelineItemCss;
|
|
@@ -231,18 +231,32 @@ limel-action-bar {
|
|
|
231
231
|
--limebb-feed-item-action-bar-grid-template-rows-transition-delay: 0.5s;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
:host(limebb-feed-timeline-item.is-tall) .markdown-container {
|
|
235
|
+
margin-bottom: 0.5rem;
|
|
236
|
+
}
|
|
234
237
|
:host(limebb-feed-timeline-item.is-tall) .body-text {
|
|
235
|
-
min-height:
|
|
238
|
+
min-height: 10.25rem;
|
|
239
|
+
}
|
|
240
|
+
:host(limebb-feed-timeline-item.is-tall) .body-text:after {
|
|
241
|
+
transition: opacity 0.6s ease;
|
|
242
|
+
content: "";
|
|
243
|
+
opacity: 0.26;
|
|
244
|
+
pointer-events: none;
|
|
245
|
+
position: absolute;
|
|
246
|
+
bottom: -0.125rem;
|
|
247
|
+
right: -0.125rem;
|
|
248
|
+
left: -0.125rem;
|
|
249
|
+
height: 2.5rem;
|
|
250
|
+
background: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);
|
|
251
|
+
background-repeat: no-repeat;
|
|
252
|
+
background-size: 100% 0.5rem, 100% 100%;
|
|
236
253
|
}
|
|
237
254
|
|
|
238
255
|
:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container {
|
|
239
256
|
grid-template-rows: 0fr;
|
|
240
257
|
}
|
|
241
258
|
:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after {
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
:host(limebb-feed-timeline-item.is-tall.shows-less) #show-more-button {
|
|
245
|
-
transform: translateY(0.5rem);
|
|
259
|
+
opacity: 1;
|
|
246
260
|
}
|
|
247
261
|
|
|
248
262
|
:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container {
|
|
@@ -253,7 +267,7 @@ limel-action-bar {
|
|
|
253
267
|
}
|
|
254
268
|
|
|
255
269
|
.markdown-container {
|
|
256
|
-
transition: grid-template-rows
|
|
270
|
+
transition: grid-template-rows calc(var(--body-text-height) * 1.2ms) cubic-bezier(1, 0.09, 0, 0.89);
|
|
257
271
|
position: relative;
|
|
258
272
|
display: grid;
|
|
259
273
|
}
|
|
@@ -262,17 +276,6 @@ limel-action-bar {
|
|
|
262
276
|
display: block;
|
|
263
277
|
overflow: hidden;
|
|
264
278
|
}
|
|
265
|
-
.body-text:after {
|
|
266
|
-
pointer-events: none;
|
|
267
|
-
position: absolute;
|
|
268
|
-
bottom: -0.125rem;
|
|
269
|
-
right: -0.125rem;
|
|
270
|
-
left: -0.125rem;
|
|
271
|
-
height: 2.5rem;
|
|
272
|
-
background: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);
|
|
273
|
-
background-repeat: no-repeat;
|
|
274
|
-
background-size: 100% 0.5rem, 100% 100%;
|
|
275
|
-
}
|
|
276
279
|
|
|
277
280
|
#show-more-button {
|
|
278
281
|
all: unset;
|
|
@@ -281,15 +284,18 @@ limel-action-bar {
|
|
|
281
284
|
color: var(--mdc-theme-on-surface);
|
|
282
285
|
background-color: var(--lime-elevated-surface-background-color);
|
|
283
286
|
box-shadow: var(--button-shadow-normal);
|
|
284
|
-
position: relative;
|
|
285
287
|
z-index: 1;
|
|
288
|
+
position: absolute;
|
|
289
|
+
right: 0;
|
|
290
|
+
bottom: -0.6rem;
|
|
291
|
+
left: 0;
|
|
292
|
+
margin: 0 auto;
|
|
286
293
|
display: flex;
|
|
287
294
|
align-items: center;
|
|
288
295
|
justify-content: center;
|
|
289
|
-
border-radius:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
height: 1.25rem;
|
|
296
|
+
border-radius: 3rem;
|
|
297
|
+
width: 2rem;
|
|
298
|
+
height: 1rem;
|
|
293
299
|
}
|
|
294
300
|
#show-more-button:hover {
|
|
295
301
|
color: var(--mdc-theme-on-surface);
|
|
@@ -34,6 +34,9 @@ export class FeedTimelineItem {
|
|
|
34
34
|
const height = entries[0].contentRect.height;
|
|
35
35
|
const maxHeight = 160;
|
|
36
36
|
this.isTall = height > maxHeight ? true : false;
|
|
37
|
+
if (this.bodyTextHeight === undefined) {
|
|
38
|
+
this.bodyTextHeight = height;
|
|
39
|
+
}
|
|
37
40
|
};
|
|
38
41
|
this.renderHeader = () => {
|
|
39
42
|
if ((this.isBundled && !this.item.heading) ||
|
|
@@ -83,6 +86,8 @@ export class FeedTimelineItem {
|
|
|
83
86
|
'shows-less': !this.showMore,
|
|
84
87
|
'shows-more': this.showMore,
|
|
85
88
|
'is-tall': this.isTall,
|
|
89
|
+
}, style: {
|
|
90
|
+
'--body-text-height': `${this.bodyTextHeight}`,
|
|
86
91
|
} }, this.renderBadgeAndTimestamp(), this.renderContent()));
|
|
87
92
|
}
|
|
88
93
|
renderBadgeAndTimestamp() {
|
|
@@ -147,10 +152,11 @@ export class FeedTimelineItem {
|
|
|
147
152
|
];
|
|
148
153
|
}
|
|
149
154
|
toggleShowMoreLabel() {
|
|
155
|
+
var _a, _b;
|
|
150
156
|
if (this.showMore) {
|
|
151
|
-
return '
|
|
157
|
+
return (_a = this.translator) === null || _a === void 0 ? void 0 : _a.get('webclient.show-less');
|
|
152
158
|
}
|
|
153
|
-
return '
|
|
159
|
+
return (_b = this.translator) === null || _b === void 0 ? void 0 : _b.get('webclient.show-more');
|
|
154
160
|
}
|
|
155
161
|
renderUnpromotedActionsMenu() {
|
|
156
162
|
var _a;
|
|
@@ -176,6 +182,10 @@ export class FeedTimelineItem {
|
|
|
176
182
|
get dateTimeFormatter() {
|
|
177
183
|
return this.platform.get(PlatformServiceName.DateTimeFormatter);
|
|
178
184
|
}
|
|
185
|
+
get translator() {
|
|
186
|
+
var _a;
|
|
187
|
+
return (_a = this.platform) === null || _a === void 0 ? void 0 : _a.get(PlatformServiceName.Translate);
|
|
188
|
+
}
|
|
179
189
|
static get is() { return "limebb-feed-timeline-item"; }
|
|
180
190
|
static get encapsulation() { return "shadow"; }
|
|
181
191
|
static get originalStyleUrls() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { P as PlatformServiceName } from './types.js';
|
|
3
3
|
|
|
4
|
-
const feedTimelineItemCss = "@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{color:rgb(var(--contrast-1100))}: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:before{content:\"\";position:absolute;z-index:0;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;background-color:rgb(var(--contrast-600));z-index:-1}.info{position:sticky;top:0.5rem;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(--limebb-feed-item-background-color));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:smaller}: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:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;text-align:center;color:rgb(var(--contrast-800));background-color:var(--limebb-feed-background-color);padding:0.125rem 0}.icon{--icon-background-color:var(--limebb-feed-background-color);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;margin-bottom:-0.5rem}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}:host(limebb-feed-timeline-item.is-tall) .
|
|
4
|
+
const feedTimelineItemCss = "@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{color:rgb(var(--contrast-1100))}: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:before{content:\"\";position:absolute;z-index:0;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;background-color:rgb(var(--contrast-600));z-index:-1}.info{position:sticky;top:0.5rem;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(--limebb-feed-item-background-color));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:smaller}: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:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;text-align:center;color:rgb(var(--contrast-800));background-color:var(--limebb-feed-background-color);padding:0.125rem 0}.icon{--icon-background-color:var(--limebb-feed-background-color);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;margin-bottom:-0.5rem}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}:host(limebb-feed-timeline-item.is-tall) .markdown-container{margin-bottom:0.5rem}:host(limebb-feed-timeline-item.is-tall) .body-text{min-height:10.25rem}:host(limebb-feed-timeline-item.is-tall) .body-text:after{transition:opacity 0.6s ease;content:\"\";opacity:0.26;pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{opacity:1}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{transition:grid-template-rows calc(var(--body-text-height) * 1.2ms) cubic-bezier(1, 0.09, 0, 0.89);position:relative;display:grid}.body-text{display:block;overflow:hidden}#show-more-button{all:unset;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);z-index:1;position:absolute;right:0;bottom:-0.6rem;left:0;margin:0 auto;display:flex;align-items:center;justify-content:center;border-radius:3rem;width:2rem;height:1rem}#show-more-button:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}#show-more-button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}#show-more-button:focus{outline:none}#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}";
|
|
5
5
|
|
|
6
6
|
const FeedTimelineItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -37,6 +37,9 @@ const FeedTimelineItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
37
37
|
const height = entries[0].contentRect.height;
|
|
38
38
|
const maxHeight = 160;
|
|
39
39
|
this.isTall = height > maxHeight ? true : false;
|
|
40
|
+
if (this.bodyTextHeight === undefined) {
|
|
41
|
+
this.bodyTextHeight = height;
|
|
42
|
+
}
|
|
40
43
|
};
|
|
41
44
|
this.renderHeader = () => {
|
|
42
45
|
if ((this.isBundled && !this.item.heading) ||
|
|
@@ -86,6 +89,8 @@ const FeedTimelineItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
86
89
|
'shows-less': !this.showMore,
|
|
87
90
|
'shows-more': this.showMore,
|
|
88
91
|
'is-tall': this.isTall,
|
|
92
|
+
}, style: {
|
|
93
|
+
'--body-text-height': `${this.bodyTextHeight}`,
|
|
89
94
|
} }, this.renderBadgeAndTimestamp(), this.renderContent()));
|
|
90
95
|
}
|
|
91
96
|
renderBadgeAndTimestamp() {
|
|
@@ -150,10 +155,11 @@ const FeedTimelineItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
150
155
|
];
|
|
151
156
|
}
|
|
152
157
|
toggleShowMoreLabel() {
|
|
158
|
+
var _a, _b;
|
|
153
159
|
if (this.showMore) {
|
|
154
|
-
return '
|
|
160
|
+
return (_a = this.translator) === null || _a === void 0 ? void 0 : _a.get('webclient.show-less');
|
|
155
161
|
}
|
|
156
|
-
return '
|
|
162
|
+
return (_b = this.translator) === null || _b === void 0 ? void 0 : _b.get('webclient.show-more');
|
|
157
163
|
}
|
|
158
164
|
renderUnpromotedActionsMenu() {
|
|
159
165
|
var _a;
|
|
@@ -179,6 +185,10 @@ const FeedTimelineItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
179
185
|
get dateTimeFormatter() {
|
|
180
186
|
return this.platform.get(PlatformServiceName.DateTimeFormatter);
|
|
181
187
|
}
|
|
188
|
+
get translator() {
|
|
189
|
+
var _a;
|
|
190
|
+
return (_a = this.platform) === null || _a === void 0 ? void 0 : _a.get(PlatformServiceName.Translate);
|
|
191
|
+
}
|
|
182
192
|
get el() { return this; }
|
|
183
193
|
static get style() { return feedTimelineItemCss; }
|
|
184
194
|
}, [1, "limebb-feed-timeline-item", {
|
|
@@ -194,7 +194,7 @@ const Feed = class {
|
|
|
194
194
|
};
|
|
195
195
|
Feed.style = feedCss;
|
|
196
196
|
|
|
197
|
-
const feedTimelineItemCss = "@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{color:rgb(var(--contrast-1100))}: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:before{content:\"\";position:absolute;z-index:0;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;background-color:rgb(var(--contrast-600));z-index:-1}.info{position:sticky;top:0.5rem;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(--limebb-feed-item-background-color));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:smaller}: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:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;text-align:center;color:rgb(var(--contrast-800));background-color:var(--limebb-feed-background-color);padding:0.125rem 0}.icon{--icon-background-color:var(--limebb-feed-background-color);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;margin-bottom:-0.5rem}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}:host(limebb-feed-timeline-item.is-tall) .
|
|
197
|
+
const feedTimelineItemCss = "@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{color:rgb(var(--contrast-1100))}: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:before{content:\"\";position:absolute;z-index:0;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;background-color:rgb(var(--contrast-600));z-index:-1}.info{position:sticky;top:0.5rem;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(--limebb-feed-item-background-color));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:smaller}: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:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;text-align:center;color:rgb(var(--contrast-800));background-color:var(--limebb-feed-background-color);padding:0.125rem 0}.icon{--icon-background-color:var(--limebb-feed-background-color);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;margin-bottom:-0.5rem}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}:host(limebb-feed-timeline-item.is-tall) .markdown-container{margin-bottom:0.5rem}:host(limebb-feed-timeline-item.is-tall) .body-text{min-height:10.25rem}:host(limebb-feed-timeline-item.is-tall) .body-text:after{transition:opacity 0.6s ease;content:\"\";opacity:0.26;pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{opacity:1}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{transition:grid-template-rows calc(var(--body-text-height) * 1.2ms) cubic-bezier(1, 0.09, 0, 0.89);position:relative;display:grid}.body-text{display:block;overflow:hidden}#show-more-button{all:unset;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);z-index:1;position:absolute;right:0;bottom:-0.6rem;left:0;margin:0 auto;display:flex;align-items:center;justify-content:center;border-radius:3rem;width:2rem;height:1rem}#show-more-button:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}#show-more-button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}#show-more-button:focus{outline:none}#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}";
|
|
198
198
|
|
|
199
199
|
const FeedTimelineItem = class {
|
|
200
200
|
constructor(hostRef) {
|
|
@@ -228,6 +228,9 @@ const FeedTimelineItem = class {
|
|
|
228
228
|
const height = entries[0].contentRect.height;
|
|
229
229
|
const maxHeight = 160;
|
|
230
230
|
this.isTall = height > maxHeight ? true : false;
|
|
231
|
+
if (this.bodyTextHeight === undefined) {
|
|
232
|
+
this.bodyTextHeight = height;
|
|
233
|
+
}
|
|
231
234
|
};
|
|
232
235
|
this.renderHeader = () => {
|
|
233
236
|
if ((this.isBundled && !this.item.heading) ||
|
|
@@ -277,6 +280,8 @@ const FeedTimelineItem = class {
|
|
|
277
280
|
'shows-less': !this.showMore,
|
|
278
281
|
'shows-more': this.showMore,
|
|
279
282
|
'is-tall': this.isTall,
|
|
283
|
+
}, style: {
|
|
284
|
+
'--body-text-height': `${this.bodyTextHeight}`,
|
|
280
285
|
} }, this.renderBadgeAndTimestamp(), this.renderContent()));
|
|
281
286
|
}
|
|
282
287
|
renderBadgeAndTimestamp() {
|
|
@@ -341,10 +346,11 @@ const FeedTimelineItem = class {
|
|
|
341
346
|
];
|
|
342
347
|
}
|
|
343
348
|
toggleShowMoreLabel() {
|
|
349
|
+
var _a, _b;
|
|
344
350
|
if (this.showMore) {
|
|
345
|
-
return '
|
|
351
|
+
return (_a = this.translator) === null || _a === void 0 ? void 0 : _a.get('webclient.show-less');
|
|
346
352
|
}
|
|
347
|
-
return '
|
|
353
|
+
return (_b = this.translator) === null || _b === void 0 ? void 0 : _b.get('webclient.show-more');
|
|
348
354
|
}
|
|
349
355
|
renderUnpromotedActionsMenu() {
|
|
350
356
|
var _a;
|
|
@@ -370,6 +376,10 @@ const FeedTimelineItem = class {
|
|
|
370
376
|
get dateTimeFormatter() {
|
|
371
377
|
return this.platform.get(PlatformServiceName.DateTimeFormatter);
|
|
372
378
|
}
|
|
379
|
+
get translator() {
|
|
380
|
+
var _a;
|
|
381
|
+
return (_a = this.platform) === null || _a === void 0 ? void 0 : _a.get(PlatformServiceName.Translate);
|
|
382
|
+
}
|
|
373
383
|
get el() { return getElement(this); }
|
|
374
384
|
};
|
|
375
385
|
FeedTimelineItem.style = feedTimelineItemCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-2912b7e7.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((e=>a([["p-23d68f3e",[[1,"limebb-example-date-picker-date",{value:[32]}]]],["p-02ed3a92",[[1,"limebb-example-date-picker-datetime",{value:[32]}]]],["p-c7e749f8",[[1,"limebb-example-date-picker-time",{value:[32]}]]],["p-c4da03cb",[[1,"limebb-example-date-picker-week",{value:[32]}]]],["p-24a19099",[[1,"limebb-example-date-range"]]],["p-e37e8e1a",[[1,"limebb-example-feed"]]],["p-eb122f28",[[1,"limebb-example-feed-author"]]],["p-b0ca91ce",[[1,"limebb-example-feed-author-picture"]]],["p-33174280",[[1,"limebb-example-feed-item-heading"]]],["p-5faf8443",[[1,"limebb-example-feed-load-more",{objectIds:[32]}]]],["p-d768ffbb",[[1,"limebb-example-feed-promoted-actions"]]],["p-3372d170",[[1,"limebb-example-feed-relations"]]],["p-5e8d501a",[[1,"limebb-example-feed-tall-item"]]],["p-c362a46c",[[1,"limebb-example-feed-unpromoted-actions"]]],["p-a437678e",[[1,"limebb-example-currency-picker",{selectedCurrency:[32]}]]],["p-e0627848",[[1,"limebb-example-currency-picker-european",{selectedCurrency:[32]}]]],["p-57e53a2d",[[1,"limebb-example-currency-picker-nordic",{selectedCurrency:[32]}]]],["p-0f8928a9",[[1,"limebb-dashboard-widget",{heading:[513],subheading:[513],supportingText:[513,"supporting-text"],icon:[513]}]]],["p-43a286a7",[[1,"limebb-example-dashboard-widget"]]],["p-0aaaaca0",[[1,"limebb-example-dashboard-widget-slots",{filterMyDeals:[32]}]]],["p-56ba707b",[[1,"limebb-example-dashboard-widget-styles"]]],["p-791741c6",[[1,"limebb-example-icon-picker",{value:[32]}]]],["p-11f8f221",[[1,"limebb-example-locale-picker",{value:[1]}]]],["p-d5f700c5",[[1,"limebb-example-locale-picker-multiple",{value:[1]}]]],["p-6ad70097",[[1,"limebb-navigation-button",{href:[513],tooltipLabel:[513,"tooltip-label"],tooltipHelperLabel:[513,"tooltip-helper-label"],type:[513]}]]],["p-79de4c38",[[1,"limebb-example-navigation-button-back"]]],["p-e7607495",[[1,"limebb-example-navigation-button-close"]]],["p-1ffc17ec",[[1,"limebb-example-navigation-button-expand"]]],["p-94fb580f",[[1,"limebb-example-navigation-button-float"]]],["p-7c3e338d",[[1,"limebb-example-navigation-button-maximize"]]],["p-bca75a1a",[[1,"limebb-example-navigation-button-minimize"]]],["p-6b000acf",[[1,"limebb-example-navigation-button-new-tab"]]],["p-636a38e8",[[1,"limebb-example-navigation-button-shrink"]]],["p-9e026e05",[[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-81bfe796",[[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-3998474e",[[1,"limebb-icon-picker",{value:[1],required:[4],readonly:[4],invalid:[4],disabled:[4],label:[1],helperText:[1,"helper-text"]}]]],["p-32e4364a",[[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-354078b7",[[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 a}from"./p-2912b7e7.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((e=>a([["p-23d68f3e",[[1,"limebb-example-date-picker-date",{value:[32]}]]],["p-02ed3a92",[[1,"limebb-example-date-picker-datetime",{value:[32]}]]],["p-c7e749f8",[[1,"limebb-example-date-picker-time",{value:[32]}]]],["p-c4da03cb",[[1,"limebb-example-date-picker-week",{value:[32]}]]],["p-24a19099",[[1,"limebb-example-date-range"]]],["p-e37e8e1a",[[1,"limebb-example-feed"]]],["p-eb122f28",[[1,"limebb-example-feed-author"]]],["p-b0ca91ce",[[1,"limebb-example-feed-author-picture"]]],["p-33174280",[[1,"limebb-example-feed-item-heading"]]],["p-5faf8443",[[1,"limebb-example-feed-load-more",{objectIds:[32]}]]],["p-d768ffbb",[[1,"limebb-example-feed-promoted-actions"]]],["p-3372d170",[[1,"limebb-example-feed-relations"]]],["p-5e8d501a",[[1,"limebb-example-feed-tall-item"]]],["p-c362a46c",[[1,"limebb-example-feed-unpromoted-actions"]]],["p-a437678e",[[1,"limebb-example-currency-picker",{selectedCurrency:[32]}]]],["p-e0627848",[[1,"limebb-example-currency-picker-european",{selectedCurrency:[32]}]]],["p-57e53a2d",[[1,"limebb-example-currency-picker-nordic",{selectedCurrency:[32]}]]],["p-0f8928a9",[[1,"limebb-dashboard-widget",{heading:[513],subheading:[513],supportingText:[513,"supporting-text"],icon:[513]}]]],["p-43a286a7",[[1,"limebb-example-dashboard-widget"]]],["p-0aaaaca0",[[1,"limebb-example-dashboard-widget-slots",{filterMyDeals:[32]}]]],["p-56ba707b",[[1,"limebb-example-dashboard-widget-styles"]]],["p-791741c6",[[1,"limebb-example-icon-picker",{value:[32]}]]],["p-11f8f221",[[1,"limebb-example-locale-picker",{value:[1]}]]],["p-d5f700c5",[[1,"limebb-example-locale-picker-multiple",{value:[1]}]]],["p-6ad70097",[[1,"limebb-navigation-button",{href:[513],tooltipLabel:[513,"tooltip-label"],tooltipHelperLabel:[513,"tooltip-helper-label"],type:[513]}]]],["p-79de4c38",[[1,"limebb-example-navigation-button-back"]]],["p-e7607495",[[1,"limebb-example-navigation-button-close"]]],["p-1ffc17ec",[[1,"limebb-example-navigation-button-expand"]]],["p-94fb580f",[[1,"limebb-example-navigation-button-float"]]],["p-7c3e338d",[[1,"limebb-example-navigation-button-maximize"]]],["p-bca75a1a",[[1,"limebb-example-navigation-button-minimize"]]],["p-6b000acf",[[1,"limebb-example-navigation-button-new-tab"]]],["p-636a38e8",[[1,"limebb-example-navigation-button-shrink"]]],["p-9e026e05",[[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-81bfe796",[[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-3998474e",[[1,"limebb-icon-picker",{value:[1],required:[4],readonly:[4],invalid:[4],disabled:[4],label:[1],helperText:[1,"helper-text"]}]]],["p-32e4364a",[[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-354078b7",[[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-e35e1007",[[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"],unpromotedActionsMenuLabel:[1,"unpromoted-actions-menu-label"]}],[1,"limebb-feed-timeline-item",{platform:[16],context:[16],item:[16],isBundled:[516,"is-bundled"],unpromotedActionsMenuLabel:[1,"unpromoted-actions-menu-label"],showMore:[32],isTall:[32]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as i,H as o,g as r}from"./p-2912b7e7.js";import{P as s}from"./p-bc052012.js";import{r as a,t as n}from"./p-1095efdb.js";function l(e,t){return a(2,arguments),n(e).getTime()-n(t).getTime()}var d={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function m(e){return e?d[e]:d.trunc}const h=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,o,r;if(0===t)return!1;if((null===(o=null===(i=this.items[t-1])||void 0===i?void 0:i.author)||void 0===o?void 0:o.id)!==(null===(r=null==e?void 0:e.author)||void 0===r?void 0:r.id))return!1;const s=new Date(e.timestamp),n=new Date(this.items[t-1].timestamp),d=new Date(n);return function(e,t,i){a(2,arguments);var o=l(e,t)/6e4;return m(null==i?void 0:i.roundingMethod)(o)}(new Date(s),d)<=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,key:e.id,isBundled:this.isBundled(e,t),unpromotedActionsMenuLabel:this.unpromotedActionsMenuLabel})]))}renderDateHeader(e,t){const o=this.dateTimeFormatter.format(e,"date");return 0===t||this.dateTimeFormatter.format(this.items[t-1].timestamp,"date")!==o?i("a",{class:"date-heading"},o):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(s.DateTimeFormatter)}};h.style=":host(limebb-feed){--limebb-feed-background-color:var(\n --feed-background-color,\n rgb(var(--contrast-100))\n );--limebb-feed-item-background-color:var(--contrast-300);display:flex;flex-direction:column;gap:0.25rem;max-width:45rem;background-color:var(--limebb-feed-background-color)}.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 c=class{constructor(o){e(this,o),this.itemSelected=t(this,"itemSelected",7),this.promotedActionSelected=t(this,"promotedActionSelected",7),this.isBundled=!1,this.showMore=!1,this.isTall=!1,this.bodyTextTall=e=>{if(!(null==e?void 0:e.length))return;const t=e[0].contentRect.height;this.isTall=t>160,void 0===this.bodyTextHeight&&(this.bodyTextHeight=t)},this.renderHeader=()=>{if((!this.isBundled||this.item.heading)&&(this.item.author||this.item.heading))return i("div",{class:"header"},this.renderAuthor(),this.renderHeading())},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.setBodyTextElement=e=>{this.bodyTextElement=e},this.toggleShowMore=()=>{this.showMore=!this.showMore},this.handleMenuItemSelect=e=>{e.stopPropagation(),this.itemSelected.emit(e.detail)},this.handleActionBarItemSelect=e=>{e.stopPropagation(),this.promotedActionSelected.emit(e.detail)}}componentDidLoad(){this.bodyTextElement&&(this.resizeObserver=new ResizeObserver(this.bodyTextTall),this.resizeObserver.observe(this.bodyTextElement))}disconnectedCallback(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect()}render(){var e,t;return i(o,{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),"shows-less":!this.showMore,"shows-more":this.showMore,"is-tall":this.isTall},style:{"--body-text-height":`${this.bodyTextHeight}`}},this.renderBadgeAndTimestamp(),this.renderContent())}renderBadgeAndTimestamp(){return i("div",{class:"left"},i("div",{class:"info"},this.renderAuthorPicture(),this.renderIcon(),i("span",{class:"timestamp"},this.renderTimestamp())))}renderIcon(){var e,t,o,r,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!==(o=null===(t=this.item.icon)||void 0===t?void 0:t.name)&&void 0!==o?o:"dot_circle",style:{color:`${null===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(s=this.item.icon)||void 0===s?void 0:s.backgroundColor}`}})}renderContent(){return i("div",{class:"right"},i("div",{class:"content"},this.renderHeader(),this.renderUnpromotedActionsMenu(),this.renderValue(),this.renderRelations()),this.renderPromotedActions())}renderAuthor(){if(this.item.author&&(!this.isBundled||this.item.heading)){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:o}=this.item.author.name;return i("a",{class:"author",href:e,title:t},o)}}}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("div",{class:"markdown-container"},i("limel-markdown",{class:"body-text",value:this.item.value,ref:this.setBodyTextElement}),this.renderShowMoreButton())]}renderShowMoreButton(){if(this.isTall)return[i("button",{id:"show-more-button",type:"button",onClick:this.toggleShowMore},i("limel-icon",{name:"angle_down"})),i("limel-tooltip",{label:this.toggleShowMoreLabel(),elementId:"show-more-button",openDirection:"top"})]}toggleShowMoreLabel(){var e,t;return this.showMore?null===(e=this.translator)||void 0===e?void 0:e.get("webclient.show-less"):null===(t=this.translator)||void 0===t?void 0:t.get("webclient.show-more")}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.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(s.DateTimeFormatter)}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(s.Translate)}get el(){return r(this)}};c.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{color:rgb(var(--contrast-1100))}: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:before{content:"";position:absolute;z-index:0;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;background-color:rgb(var(--contrast-600));z-index:-1}.info{position:sticky;top:0.5rem;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(--limebb-feed-item-background-color));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:smaller}: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:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;text-align:center;color:rgb(var(--contrast-800));background-color:var(--limebb-feed-background-color);padding:0.125rem 0}.icon{--icon-background-color:var(--limebb-feed-background-color);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;margin-bottom:-0.5rem}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}:host(limebb-feed-timeline-item.is-tall) .markdown-container{margin-bottom:0.5rem}:host(limebb-feed-timeline-item.is-tall) .body-text{min-height:10.25rem}:host(limebb-feed-timeline-item.is-tall) .body-text:after{transition:opacity 0.6s ease;content:"";opacity:0.26;pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{opacity:1}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{transition:grid-template-rows calc(var(--body-text-height) * 1.2ms) cubic-bezier(1, 0.09, 0, 0.89);position:relative;display:grid}.body-text{display:block;overflow:hidden}#show-more-button{all:unset;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);z-index:1;position:absolute;right:0;bottom:-0.6rem;left:0;margin:0 auto;display:flex;align-items:center;justify-content:center;border-radius:3rem;width:2rem;height:1rem}#show-more-button:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}#show-more-button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}#show-more-button:focus{outline:none}#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}';export{h as limebb_feed,c as limebb_feed_timeline_item}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
2
|
import { FeedItem } from './feed-item.types';
|
|
3
|
-
import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
|
|
3
|
+
import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator as TranslateService } from '@limetech/lime-web-components';
|
|
4
4
|
import { MenuItem, ActionBarItem } from '@limetech/lime-elements';
|
|
5
5
|
/**
|
|
6
6
|
* Feed item
|
|
@@ -53,6 +53,7 @@ export declare class FeedTimelineItem implements LimeWebComponent {
|
|
|
53
53
|
el: HTMLElement;
|
|
54
54
|
private bodyTextElement;
|
|
55
55
|
private resizeObserver;
|
|
56
|
+
private bodyTextHeight;
|
|
56
57
|
componentDidLoad(): void;
|
|
57
58
|
disconnectedCallback(): void;
|
|
58
59
|
private bodyTextTall;
|
|
@@ -76,4 +77,5 @@ export declare class FeedTimelineItem implements LimeWebComponent {
|
|
|
76
77
|
private handleMenuItemSelect;
|
|
77
78
|
private handleActionBarItemSelect;
|
|
78
79
|
private get dateTimeFormatter();
|
|
80
|
+
get translator(): TranslateService;
|
|
79
81
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as o,g as r}from"./p-2912b7e7.js";import{P as s}from"./p-bc052012.js";import{r as a,t as n}from"./p-1095efdb.js";function l(e,t){return a(2,arguments),n(e).getTime()-n(t).getTime()}var d={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function m(e){return e?d[e]:d.trunc}const h=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,o,r;if(0===t)return!1;if((null===(o=null===(i=this.items[t-1])||void 0===i?void 0:i.author)||void 0===o?void 0:o.id)!==(null===(r=null==e?void 0:e.author)||void 0===r?void 0:r.id))return!1;const s=new Date(e.timestamp),n=new Date(this.items[t-1].timestamp),d=new Date(n);return function(e,t,i){a(2,arguments);var o=l(e,t)/6e4;return m(null==i?void 0:i.roundingMethod)(o)}(new Date(s),d)<=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,key:e.id,isBundled:this.isBundled(e,t),unpromotedActionsMenuLabel:this.unpromotedActionsMenuLabel})]))}renderDateHeader(e,t){const o=this.dateTimeFormatter.format(e,"date");return 0===t||this.dateTimeFormatter.format(this.items[t-1].timestamp,"date")!==o?i("a",{class:"date-heading"},o):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(s.DateTimeFormatter)}};h.style=":host(limebb-feed){--limebb-feed-background-color:var(\n --feed-background-color,\n rgb(var(--contrast-100))\n );--limebb-feed-item-background-color:var(--contrast-300);display:flex;flex-direction:column;gap:0.25rem;max-width:45rem;background-color:var(--limebb-feed-background-color)}.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 c=class{constructor(o){e(this,o),this.itemSelected=t(this,"itemSelected",7),this.promotedActionSelected=t(this,"promotedActionSelected",7),this.isBundled=!1,this.showMore=!1,this.isTall=!1,this.bodyTextTall=e=>{(null==e?void 0:e.length)&&(this.isTall=e[0].contentRect.height>160)},this.renderHeader=()=>{if((!this.isBundled||this.item.heading)&&(this.item.author||this.item.heading))return i("div",{class:"header"},this.renderAuthor(),this.renderHeading())},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.setBodyTextElement=e=>{this.bodyTextElement=e},this.toggleShowMore=()=>{this.showMore=!this.showMore},this.handleMenuItemSelect=e=>{e.stopPropagation(),this.itemSelected.emit(e.detail)},this.handleActionBarItemSelect=e=>{e.stopPropagation(),this.promotedActionSelected.emit(e.detail)}}componentDidLoad(){this.bodyTextElement&&(this.resizeObserver=new ResizeObserver(this.bodyTextTall),this.resizeObserver.observe(this.bodyTextElement))}disconnectedCallback(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect()}render(){var e,t;return i(o,{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),"shows-less":!this.showMore,"shows-more":this.showMore,"is-tall":this.isTall}},this.renderBadgeAndTimestamp(),this.renderContent())}renderBadgeAndTimestamp(){return i("div",{class:"left"},i("div",{class:"info"},this.renderAuthorPicture(),this.renderIcon(),i("span",{class:"timestamp"},this.renderTimestamp())))}renderIcon(){var e,t,o,r,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!==(o=null===(t=this.item.icon)||void 0===t?void 0:t.name)&&void 0!==o?o:"dot_circle",style:{color:`${null===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(s=this.item.icon)||void 0===s?void 0:s.backgroundColor}`}})}renderContent(){return i("div",{class:"right"},i("div",{class:"content"},this.renderHeader(),this.renderUnpromotedActionsMenu(),this.renderValue(),this.renderRelations()),this.renderPromotedActions())}renderAuthor(){if(this.item.author&&(!this.isBundled||this.item.heading)){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:o}=this.item.author.name;return i("a",{class:"author",href:e,title:t},o)}}}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("div",{class:"markdown-container"},i("limel-markdown",{class:"body-text",value:this.item.value,ref:this.setBodyTextElement}),this.renderShowMoreButton())]}renderShowMoreButton(){if(this.isTall)return[i("button",{id:"show-more-button",type:"button",onClick:this.toggleShowMore},i("limel-icon",{name:"angle_down"})),i("limel-tooltip",{label:this.toggleShowMoreLabel(),elementId:"show-more-button",openDirection:"top"})]}toggleShowMoreLabel(){return this.showMore?"Show less":"Show more"}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.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(s.DateTimeFormatter)}get el(){return r(this)}};c.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{color:rgb(var(--contrast-1100))}: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:before{content:"";position:absolute;z-index:0;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;background-color:rgb(var(--contrast-600));z-index:-1}.info{position:sticky;top:0.5rem;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(--limebb-feed-item-background-color));padding:var(--limebb-feed-item-paddings)}.header{display:flex;align-items:center;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:smaller}: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:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);font-size:0.75rem;text-align:center;color:rgb(var(--contrast-800));background-color:var(--limebb-feed-background-color);padding:0.125rem 0}.icon{--icon-background-color:var(--limebb-feed-background-color);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;margin-bottom:-0.5rem}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}:host(limebb-feed-timeline-item.is-tall) .body-text{min-height:11rem}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{content:""}:host(limebb-feed-timeline-item.is-tall.shows-less) #show-more-button{transform:translateY(0.5rem)}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{transition:grid-template-rows 0.46s cubic-bezier(1, 0.09, 0, 0.89);position:relative;display:grid}.body-text{display:block;overflow:hidden}.body-text:after{pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}#show-more-button{all:unset;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);position:relative;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:0.25rem;margin:auto;width:1.25rem;height:1.25rem}#show-more-button:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}#show-more-button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}#show-more-button:focus{outline:none}#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}';export{h as limebb_feed,c as limebb_feed_timeline_item}
|