release(content-suggestions): v0.1.2

This commit is contained in:
2026-03-11 17:46:03 +03:00
parent 1c1b9748c6
commit 81c5550311
8 changed files with 33 additions and 18 deletions

View File

@@ -374,6 +374,9 @@ var AngularContentTextRenderer = class {
}
return cutoff;
}
hasVerticalOverflow(element) {
return element.scrollHeight - element.clientHeight > 1;
}
render() {
if (!this.host) {
return;
@@ -409,13 +412,13 @@ var AngularContentTextRenderer = class {
paragraph.style.setProperty("-webkit-box-orient", "vertical");
paragraph.style.setProperty("-webkit-line-clamp", String(ellipsisConfig.rows));
paragraph.style.overflow = "hidden";
if (ellipsisConfig.expandable) {
wrapper.append(paragraph);
wrapper.append(paragraph);
this.host.replaceChildren(wrapper);
if (ellipsisConfig.expandable && this.hasVerticalOverflow(paragraph)) {
wrapper.append(this.buildReadMoreButton(ellipsisConfig.symbol));
this.host.replaceChildren(wrapper);
this.emitOnViewIfNeeded(mergedExpanded);
return;
}
this.emitOnViewIfNeeded(mergedExpanded);
return;
}
}
wrapper.append(paragraph);