mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 07:19:52 +00:00
feat(studio): improve blocks panel UX
- Rename "Blocks" tab to "Catalog" - Replace fullscreen hover popup with inline preview in main area - Fix z-index: newly added blocks/components use max existing z-index + 1 instead of element count, ensuring they appear on top
This commit is contained in:
@@ -126,7 +126,12 @@ export async function addBlockToProject(
|
||||
? Math.max(...relevantElements.map((te) => te.track)) + 1
|
||||
: 1);
|
||||
|
||||
const zIndex = Math.max(1, relevantElements.length + 1);
|
||||
const zIndexMatches = originalContent.matchAll(/z-index:\s*(\d+)/g);
|
||||
let maxExistingZ = 0;
|
||||
for (const m of zIndexMatches) {
|
||||
maxExistingZ = Math.max(maxExistingZ, parseInt(m[1]!, 10));
|
||||
}
|
||||
const zIndex = maxExistingZ + 1;
|
||||
|
||||
const width = isBlock
|
||||
? (block as { dimensions: { width: number } }).dimensions.width
|
||||
|
||||
Reference in New Issue
Block a user