feat: multi-material overlays, presentation guides, and release prebuilds
Align control/presentation with presentation screen rect and darkness z-order; sync window titles and session window cleanup. Pack Win/Mac/Linux with npmRebuild disabled and release-native-prep for classic-level and sharp. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import React, { useCallback, useRef, useState } from 'react';
|
||||
|
||||
type Props = {
|
||||
text: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
/** Однострочный текст с ellipsis; полный title при обрезке. */
|
||||
export function EllipsisText({ text, className }: Props) {
|
||||
const ref = useRef<HTMLDivElement | null>(null);
|
||||
const [title, setTitle] = useState<string | undefined>(undefined);
|
||||
|
||||
const syncTitle = useCallback(() => {
|
||||
const el = ref.current;
|
||||
if (!el) {
|
||||
setTitle(undefined);
|
||||
return;
|
||||
}
|
||||
setTitle(el.scrollWidth > el.clientWidth + 1 ? text : undefined);
|
||||
}, [text]);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={ref}
|
||||
className={className}
|
||||
title={title}
|
||||
onMouseEnter={syncTitle}
|
||||
onMouseLeave={() => setTitle(undefined)}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
.root {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
Reference in New Issue
Block a user