asdsad
All checks were successful
Deploy / deploy-staging (push) Successful in 9s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-07 01:51:55 +02:00
parent 8ffaca85fc
commit 590a5fd92c
2 changed files with 99 additions and 33 deletions

View File

@@ -180,6 +180,42 @@ h1 {
.window-resize-handle { .window-resize-handle {
position: absolute; position: absolute;
z-index: 2;
}
.window-resize-handle[data-edge="right"] {
top: 18px;
right: 0;
width: 8px;
height: calc(100% - 36px);
cursor: ew-resize;
}
.window-resize-handle[data-edge="left"] {
top: 18px;
left: 0;
width: 8px;
height: calc(100% - 36px);
cursor: ew-resize;
}
.window-resize-handle[data-edge="bottom"] {
left: 18px;
bottom: 0;
width: calc(100% - 36px);
height: 8px;
cursor: ns-resize;
}
.window-resize-handle[data-edge="top"] {
left: 18px;
top: 0;
width: calc(100% - 36px);
height: 8px;
cursor: ns-resize;
}
.window-resize-handle[data-edge="corner"] {
right: 0; right: 0;
bottom: 0; bottom: 0;
width: 18px; width: 18px;

View File

@@ -295,16 +295,20 @@ if (payloadNode) {
}; };
const wireResizing = (record) => { const wireResizing = (record) => {
const handle = record.node.querySelector('.window-resize-handle'); const handles = record.node.querySelectorAll('.window-resize-handle');
if (!handle || window.matchMedia('(max-width: 1100px)').matches) { if (!handles.length || window.matchMedia('(max-width: 1100px)').matches) {
return; return;
} }
handles.forEach((handle) => {
let startX = 0; let startX = 0;
let startY = 0; let startY = 0;
let originX = 0;
let originY = 0;
let originWidth = 0; let originWidth = 0;
let originHeight = 0; let originHeight = 0;
let resizing = false; let resizing = false;
const edge = handle.dataset.edge;
handle.addEventListener('pointerdown', (event) => { handle.addEventListener('pointerdown', (event) => {
if (record.state.maximized) { if (record.state.maximized) {
@@ -314,6 +318,8 @@ if (payloadNode) {
resizing = true; resizing = true;
startX = event.clientX; startX = event.clientX;
startY = event.clientY; startY = event.clientY;
originX = record.layout.x;
originY = record.layout.y;
originWidth = record.layout.width; originWidth = record.layout.width;
originHeight = record.layout.height; originHeight = record.layout.height;
handle.setPointerCapture(event.pointerId); handle.setPointerCapture(event.pointerId);
@@ -326,8 +332,27 @@ if (payloadNode) {
return; return;
} }
record.layout.width = originWidth + event.clientX - startX; const deltaX = event.clientX - startX;
record.layout.height = originHeight + event.clientY - startY; const deltaY = event.clientY - startY;
if (edge === 'right' || edge === 'corner') {
record.layout.width = originWidth + deltaX;
}
if (edge === 'bottom' || edge === 'corner') {
record.layout.height = originHeight + deltaY;
}
if (edge === 'left') {
record.layout.x = originX + deltaX;
record.layout.width = originWidth - deltaX;
}
if (edge === 'top') {
record.layout.y = originY + deltaY;
record.layout.height = originHeight - deltaY;
}
clampWindowLayout(record); clampWindowLayout(record);
applyWindowLayout(record); applyWindowLayout(record);
}); });
@@ -336,6 +361,7 @@ if (payloadNode) {
resizing = false; resizing = false;
saveWindowState(); saveWindowState();
}); });
});
}; };
const createWindow = (definition) => { const createWindow = (definition) => {
@@ -354,7 +380,11 @@ if (payloadNode) {
<p>${definition.content}</p> <p>${definition.content}</p>
<p><strong>Route:</strong> ${definition.app_id}</p> <p><strong>Route:</strong> ${definition.app_id}</p>
</div> </div>
<div class="window-resize-handle" aria-hidden="true"></div> <div class="window-resize-handle" data-edge="top" aria-hidden="true"></div>
<div class="window-resize-handle" data-edge="right" aria-hidden="true"></div>
<div class="window-resize-handle" data-edge="bottom" aria-hidden="true"></div>
<div class="window-resize-handle" data-edge="left" aria-hidden="true"></div>
<div class="window-resize-handle" data-edge="corner" aria-hidden="true"></div>
`; `;
const persisted = persistedWindowState[definition.app_id] || {}; const persisted = persistedWindowState[definition.app_id] || {};