@zuccadev-labs/zuix-zout 0.2.0 → 0.3.0
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/CHANGELOG.md +75 -0
- package/README.md +11 -3
- package/dist/esm/dom/index.d.ts +30 -1
- package/dist/esm/dom/index.js +639 -10
- package/dist/esm/dom/index.js.map +1 -1
- package/dist/esm/dom/site.d.ts +3 -0
- package/dist/esm/dom/site.js +57 -0
- package/dist/esm/dom/site.js.map +1 -0
- package/dist/esm/edges.d.ts +6 -0
- package/dist/esm/edges.js +47 -0
- package/dist/esm/edges.js.map +1 -0
- package/dist/esm/index.d.ts +13 -2
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/layouts/BottomNavigation.d.ts +30 -0
- package/dist/esm/layouts/BottomNavigation.js +13 -0
- package/dist/esm/layouts/BottomNavigation.js.map +1 -0
- package/dist/esm/layouts/Float.d.ts +18 -0
- package/dist/esm/layouts/Float.js +11 -0
- package/dist/esm/layouts/Float.js.map +1 -0
- package/dist/esm/layouts/FloatingPanel.d.ts +51 -0
- package/dist/esm/layouts/FloatingPanel.js +138 -0
- package/dist/esm/layouts/FloatingPanel.js.map +1 -0
- package/dist/esm/layouts/Navbar.d.ts +28 -0
- package/dist/esm/layouts/Navbar.js +22 -0
- package/dist/esm/layouts/Navbar.js.map +1 -0
- package/dist/esm/layouts/NavigationMenu.d.ts +41 -0
- package/dist/esm/layouts/NavigationMenu.js +37 -0
- package/dist/esm/layouts/NavigationMenu.js.map +1 -0
- package/dist/esm/layouts/Page.d.ts +6 -1
- package/dist/esm/layouts/Page.js +2 -2
- package/dist/esm/layouts/Page.js.map +1 -1
- package/dist/esm/layouts/PaneHeader.d.ts +25 -0
- package/dist/esm/layouts/PaneHeader.js +12 -0
- package/dist/esm/layouts/PaneHeader.js.map +1 -0
- package/dist/esm/layouts/PaneLayout.d.ts +46 -0
- package/dist/esm/layouts/PaneLayout.js +154 -0
- package/dist/esm/layouts/PaneLayout.js.map +1 -0
- package/dist/esm/layouts/SidePanel.d.ts +11 -3
- package/dist/esm/layouts/SidePanel.js +4 -3
- package/dist/esm/layouts/SidePanel.js.map +1 -1
- package/dist/esm/layouts/SidebarItem.d.ts +44 -0
- package/dist/esm/layouts/SidebarItem.js +76 -0
- package/dist/esm/layouts/SidebarItem.js.map +1 -0
- package/dist/esm/layouts/SiteFooter.d.ts +43 -0
- package/dist/esm/layouts/SiteFooter.js +11 -0
- package/dist/esm/layouts/SiteFooter.js.map +1 -0
- package/dist/esm/layouts/SkipLink.d.ts +11 -0
- package/dist/esm/layouts/SkipLink.js +16 -0
- package/dist/esm/layouts/SkipLink.js.map +1 -0
- package/dist/esm/layouts/TabStrip.d.ts +32 -2
- package/dist/esm/layouts/TabStrip.js +124 -15
- package/dist/esm/layouts/TabStrip.js.map +1 -1
- package/dist/esm/layouts/navbar-context.d.ts +4 -0
- package/dist/esm/layouts/navbar-context.js +5 -0
- package/dist/esm/layouts/navbar-context.js.map +1 -0
- package/dist/esm/layouts/sidebar-context.d.ts +6 -0
- package/dist/esm/layouts/sidebar-context.js +6 -0
- package/dist/esm/layouts/sidebar-context.js.map +1 -0
- package/dist/esm/logic.d.ts +130 -2
- package/dist/esm/logic.js +256 -6
- package/dist/esm/logic.js.map +1 -1
- package/dist/esm/site.d.ts +26 -0
- package/dist/esm/site.js +287 -0
- package/dist/esm/site.js.map +1 -0
- package/dist/zout.css +2012 -433
- package/dist/zout.dom.js +1 -1
- package/html.json +236 -7
- package/manifest.json +1197 -61
- package/package.json +5 -5
package/dist/esm/logic.js
CHANGED
|
@@ -93,12 +93,262 @@ export function tabKeyIndex(key, current, count, rtl = false) {
|
|
|
93
93
|
return count - 1;
|
|
94
94
|
return -1;
|
|
95
95
|
}
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Desplazamiento horizontal que deja a la vista una pestaña (`tab`) dentro de la tira (`list`); 0 si ya se ve.
|
|
98
|
+
* `margin` aparta la pestaña del borde (el ancho del difuminado de la tira), para que no quede bajo la máscara.
|
|
99
|
+
*/
|
|
100
|
+
export function revealOffset(tab, list, margin = 0) {
|
|
101
|
+
// Si la pestaña no cabe con el margen a los dos lados, se deja entera sin margen (mejor rozar el borde que cortarla).
|
|
102
|
+
const m = tab.right - tab.left + 2 * margin <= list.right - list.left ? margin : 0;
|
|
103
|
+
if (tab.left < list.left + m)
|
|
104
|
+
return tab.left - list.left - m;
|
|
105
|
+
if (tab.right > list.right - m)
|
|
106
|
+
return tab.right - list.right + m;
|
|
102
107
|
return 0;
|
|
103
108
|
}
|
|
109
|
+
/* ---------- TabStrip: grupos y reordenación ---------- */
|
|
110
|
+
/** Lista con el elemento `from` llevado a la posición final `to` (índices acotados). Sin cambios, la misma lista. */
|
|
111
|
+
export function reorder(list, from, to) {
|
|
112
|
+
const next = [...list];
|
|
113
|
+
if (from < 0 || from >= list.length)
|
|
114
|
+
return next;
|
|
115
|
+
const target = clamp(to, 0, list.length - 1);
|
|
116
|
+
if (target === from)
|
|
117
|
+
return next;
|
|
118
|
+
const [item] = next.splice(from, 1);
|
|
119
|
+
next.splice(target, 0, item);
|
|
120
|
+
return next;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Hueco donde caería lo arrastrado: índice de inserción (0…n) según el punto `at` frente a la mitad de cada pestaña.
|
|
124
|
+
* `spans` va en orden del documento; en RTL la tira se dibuja de derecha a izquierda (la primera, a la derecha).
|
|
125
|
+
*/
|
|
126
|
+
export function dropIndex(at, spans, rtl = false) {
|
|
127
|
+
let index = 0;
|
|
128
|
+
for (const span of spans) {
|
|
129
|
+
const middle = (span.start + span.end) / 2;
|
|
130
|
+
if (rtl ? at < middle : at > middle)
|
|
131
|
+
index += 1;
|
|
132
|
+
}
|
|
133
|
+
return index;
|
|
134
|
+
}
|
|
135
|
+
/** Posición final de un elemento que estaba en `from` y se suelta en el hueco `gap` (índice de inserción). */
|
|
136
|
+
export const finalIndex = (from, gap) => (gap > from ? gap - 1 : gap);
|
|
137
|
+
/**
|
|
138
|
+
* Posición a la que lleva una tecla de mover pestaña (Ctrl+Mayús+flecha, o Inicio/Fin con Ctrl+Mayús) desde
|
|
139
|
+
* `current`, o -1 si la tecla no mueve o ya está en el extremo. En RTL la flecha izquierda avanza.
|
|
140
|
+
*/
|
|
141
|
+
export function tabMoveIndex(key, current, count, rtl = false) {
|
|
142
|
+
let next = -1;
|
|
143
|
+
if (key === (rtl ? "ArrowLeft" : "ArrowRight"))
|
|
144
|
+
next = current + 1;
|
|
145
|
+
else if (key === (rtl ? "ArrowRight" : "ArrowLeft"))
|
|
146
|
+
next = current - 1;
|
|
147
|
+
else if (key === "Home")
|
|
148
|
+
next = 0;
|
|
149
|
+
else if (key === "End")
|
|
150
|
+
next = count - 1;
|
|
151
|
+
return next < 0 || next >= count || next === current ? -1 : next;
|
|
152
|
+
}
|
|
153
|
+
/** Lista de ids con `id` movido delante de `before` (al final si es null). Sin `id` en la lista, la misma lista. */
|
|
154
|
+
export function moveBefore(ids, id, before) {
|
|
155
|
+
if (!ids.includes(id) || id === before)
|
|
156
|
+
return [...ids];
|
|
157
|
+
const rest = ids.filter((x) => x !== id);
|
|
158
|
+
const at = before === null ? -1 : rest.indexOf(before);
|
|
159
|
+
if (at < 0)
|
|
160
|
+
rest.push(id);
|
|
161
|
+
else
|
|
162
|
+
rest.splice(at, 0, id);
|
|
163
|
+
return rest;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Hueco de inserción (índice de `visible`) para mover `id` a la posición `to` de la lista visible: devuelve el id
|
|
167
|
+
* delante del que se coloca (null = al final).
|
|
168
|
+
*/
|
|
169
|
+
export function beforeFor(visible, id, to) {
|
|
170
|
+
const rest = visible.filter((x) => x !== id);
|
|
171
|
+
return rest[to] ?? null;
|
|
172
|
+
}
|
|
173
|
+
/** Margen mínimo entre un panel flotante y el borde de su área. */
|
|
174
|
+
export const FLOAT_MARGIN = 8;
|
|
175
|
+
/** Paso de las flechas al mover o redimensionar; con Mayús, ×10. */
|
|
176
|
+
export const FLOAT_STEP = 10;
|
|
177
|
+
/**
|
|
178
|
+
* Rectángulo acotado al área `bounds` (ancho y alto): el tamaño no pasa del área menos los márgenes ni baja del mínimo,
|
|
179
|
+
* y la posición deja el panel entero dentro (si no cabe, pegado al margen de inicio).
|
|
180
|
+
*/
|
|
181
|
+
export function clampRect(rect, bounds, min = { width: 0, height: 0 }, margin = FLOAT_MARGIN) {
|
|
182
|
+
const width = clamp(rect.width, min.width, Math.max(min.width, bounds.width - margin * 2));
|
|
183
|
+
const height = clamp(rect.height, min.height, Math.max(min.height, bounds.height - margin * 2));
|
|
184
|
+
const x = clamp(rect.x, margin, Math.max(margin, bounds.width - width - margin));
|
|
185
|
+
const y = clamp(rect.y, margin, Math.max(margin, bounds.height - height - margin));
|
|
186
|
+
return { x, y, width, height };
|
|
187
|
+
}
|
|
188
|
+
/** Desplazamiento que pide una flecha en el asa de mover (hacia donde apunta), o null si la tecla no mueve. */
|
|
189
|
+
export function moveDelta(key, step) {
|
|
190
|
+
if (key === "ArrowLeft")
|
|
191
|
+
return { dx: -step, dy: 0 };
|
|
192
|
+
if (key === "ArrowRight")
|
|
193
|
+
return { dx: step, dy: 0 };
|
|
194
|
+
if (key === "ArrowUp")
|
|
195
|
+
return { dx: 0, dy: -step };
|
|
196
|
+
if (key === "ArrowDown")
|
|
197
|
+
return { dx: 0, dy: step };
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Rectángulo tras llevar la esquina de redimensionar `dw`, `dh` píxeles (positivos: hacia la derecha y abajo), acotado
|
|
202
|
+
* al mínimo y al área. La esquina está al final de la línea: en RTL, abajo a la izquierda, así que el panel crece hacia
|
|
203
|
+
* la izquierda y conserva su borde derecho.
|
|
204
|
+
*/
|
|
205
|
+
export function resizeRect(rect, dw, dh, bounds, min, rtl = false, margin = FLOAT_MARGIN) {
|
|
206
|
+
const right = rect.x + rect.width;
|
|
207
|
+
const maxWidth = rtl ? right - margin : bounds.width - margin - rect.x;
|
|
208
|
+
const maxHeight = bounds.height - margin - rect.y;
|
|
209
|
+
const width = clamp(rect.width + (rtl ? -dw : dw), min.width, Math.max(min.width, maxWidth));
|
|
210
|
+
const height = clamp(rect.height + dh, min.height, Math.max(min.height, maxHeight));
|
|
211
|
+
return { x: rtl ? right - width : rect.x, y: rect.y, width, height };
|
|
212
|
+
}
|
|
213
|
+
/** Tamaño que pide una flecha en la esquina de redimensionar: derecha y abajo crecen (en RTL, izquierda crece). */
|
|
214
|
+
export function resizeDelta(key, step) {
|
|
215
|
+
const d = moveDelta(key, step);
|
|
216
|
+
return d ? { dw: d.dx, dh: d.dy } : null;
|
|
217
|
+
}
|
|
218
|
+
/** Ids de los paneles en orden de lectura (profundidad primero). */
|
|
219
|
+
export function paneIds(node) {
|
|
220
|
+
if (!node)
|
|
221
|
+
return [];
|
|
222
|
+
return node.type === "pane" ? [node.id] : node.children.flatMap(paneIds);
|
|
223
|
+
}
|
|
224
|
+
const normalize = (sizes) => {
|
|
225
|
+
const total = sizes.reduce((a, b) => a + b, 0);
|
|
226
|
+
return total > 0 ? sizes.map((s) => s / total) : evenFractions(sizes.length);
|
|
227
|
+
};
|
|
228
|
+
/** Reparto nuevo de la división en `path` (índices de hijos desde la raíz). */
|
|
229
|
+
export function setSizesAt(node, path, sizes) {
|
|
230
|
+
if (node.type !== "split")
|
|
231
|
+
return node;
|
|
232
|
+
if (!path.length)
|
|
233
|
+
return { ...node, sizes: [...sizes] };
|
|
234
|
+
const [head, ...rest] = path;
|
|
235
|
+
return { ...node, children: node.children.map((child, i) => (i === head ? setSizesAt(child, rest, sizes) : child)) };
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Divide el panel `target` y pone `id` delante (`before`) o detrás en `direction`. Si el padre ya divide en esa
|
|
239
|
+
* dirección, el panel nuevo entra como hermano y se queda con la mitad del espacio del panel dividido.
|
|
240
|
+
*/
|
|
241
|
+
export function splitPane(node, target, id, direction, position = "after") {
|
|
242
|
+
const pane = { type: "pane", id };
|
|
243
|
+
if (node.type === "pane") {
|
|
244
|
+
if (node.id !== target)
|
|
245
|
+
return node;
|
|
246
|
+
return { type: "split", direction, sizes: [0.5, 0.5], children: position === "before" ? [pane, node] : [node, pane] };
|
|
247
|
+
}
|
|
248
|
+
const at = node.children.findIndex((c) => c.type === "pane" && c.id === target);
|
|
249
|
+
if (at >= 0 && node.direction === direction) {
|
|
250
|
+
const half = (node.sizes[at] ?? 0) / 2;
|
|
251
|
+
const children = [...node.children];
|
|
252
|
+
const sizes = [...node.sizes];
|
|
253
|
+
const index = position === "before" ? at : at + 1;
|
|
254
|
+
children.splice(index, 0, pane);
|
|
255
|
+
sizes.splice(at, 1, half, half);
|
|
256
|
+
return { ...node, children, sizes };
|
|
257
|
+
}
|
|
258
|
+
return { ...node, children: node.children.map((c) => splitPane(c, target, id, direction, position)) };
|
|
259
|
+
}
|
|
260
|
+
/** Quita el panel `id`. Una división que se queda con un hijo cede su sitio a ese hijo. Sin paneles, null. */
|
|
261
|
+
export function removePane(node, id) {
|
|
262
|
+
if (node.type === "pane")
|
|
263
|
+
return node.id === id ? null : node;
|
|
264
|
+
const kept = [];
|
|
265
|
+
node.children.forEach((child, i) => {
|
|
266
|
+
const next = removePane(child, id);
|
|
267
|
+
if (next)
|
|
268
|
+
kept.push({ child: next, size: node.sizes[i] ?? 0 });
|
|
269
|
+
});
|
|
270
|
+
if (!kept.length)
|
|
271
|
+
return null;
|
|
272
|
+
if (kept.length === 1)
|
|
273
|
+
return kept[0].child;
|
|
274
|
+
return { ...node, children: kept.map((k) => k.child), sizes: normalize(kept.map((k) => k.size)) };
|
|
275
|
+
}
|
|
276
|
+
/** Intercambia dos paneles de sitio. */
|
|
277
|
+
export function swapPanes(node, a, b) {
|
|
278
|
+
if (node.type === "pane")
|
|
279
|
+
return node.id === a ? { type: "pane", id: b } : node.id === b ? { type: "pane", id: a } : node;
|
|
280
|
+
return { ...node, children: node.children.map((c) => swapPanes(c, a, b)) };
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Lleva el panel `id` al borde `edge` del panel `target` (lo divide), o lo intercambia con él (`center`). En RTL un
|
|
284
|
+
* borde `inline-start` queda a la derecha, que en una fila es el primer hijo: el árbol guarda el orden lógico.
|
|
285
|
+
*/
|
|
286
|
+
export function movePane(node, id, target, edge) {
|
|
287
|
+
if (id === target || !paneIds(node).includes(id) || !paneIds(node).includes(target))
|
|
288
|
+
return node;
|
|
289
|
+
if (edge === "center")
|
|
290
|
+
return swapPanes(node, id, target);
|
|
291
|
+
const rest = removePane(node, id);
|
|
292
|
+
if (!rest)
|
|
293
|
+
return node;
|
|
294
|
+
const direction = edge === "inline-start" || edge === "inline-end" ? "row" : "column";
|
|
295
|
+
const position = edge === "inline-start" || edge === "block-start" ? "before" : "after";
|
|
296
|
+
return splitPane(rest, target, id, direction, position);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Borde sobre el que está el punto dentro del rectángulo de un panel: el centro (la mitad interior en los dos ejes)
|
|
300
|
+
* intercambia; fuera de él, el borde más cercano en proporción.
|
|
301
|
+
*/
|
|
302
|
+
export function dropEdge(rect, point, rtl = false) {
|
|
303
|
+
const fx = rect.width > 0 ? (point.x - rect.left) / rect.width : 0.5;
|
|
304
|
+
const fy = rect.height > 0 ? (point.y - rect.top) / rect.height : 0.5;
|
|
305
|
+
if (fx > 0.25 && fx < 0.75 && fy > 0.25 && fy < 0.75)
|
|
306
|
+
return "center";
|
|
307
|
+
const distances = [
|
|
308
|
+
[rtl ? "inline-end" : "inline-start", fx],
|
|
309
|
+
[rtl ? "inline-start" : "inline-end", 1 - fx],
|
|
310
|
+
["block-start", fy],
|
|
311
|
+
["block-end", 1 - fy],
|
|
312
|
+
];
|
|
313
|
+
return distances.reduce((best, d) => (d[1] < best[1] ? d : best))[0];
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Panel vecino de `id` en una dirección física de la pantalla, según los rectángulos de los paneles: el más cercano
|
|
317
|
+
* cuyo centro queda hacia ese lado y que se solapa en el otro eje. Null si no hay.
|
|
318
|
+
*/
|
|
319
|
+
export function neighborPane(rects, id, direction) {
|
|
320
|
+
const from = rects.find((r) => r.id === id)?.rect;
|
|
321
|
+
if (!from)
|
|
322
|
+
return null;
|
|
323
|
+
const cx = from.left + from.width / 2;
|
|
324
|
+
const cy = from.top + from.height / 2;
|
|
325
|
+
let best = null;
|
|
326
|
+
for (const { id: other, rect } of rects) {
|
|
327
|
+
if (other === id)
|
|
328
|
+
continue;
|
|
329
|
+
const ox = rect.left + rect.width / 2;
|
|
330
|
+
const oy = rect.top + rect.height / 2;
|
|
331
|
+
const horizontal = direction === "left" || direction === "right";
|
|
332
|
+
const ahead = direction === "left" ? ox < cx : direction === "right" ? ox > cx : direction === "up" ? oy < cy : oy > cy;
|
|
333
|
+
const overlap = horizontal
|
|
334
|
+
? rect.top < from.top + from.height && rect.top + rect.height > from.top
|
|
335
|
+
: rect.left < from.left + from.width && rect.left + rect.width > from.left;
|
|
336
|
+
if (!ahead || !overlap)
|
|
337
|
+
continue;
|
|
338
|
+
const d = horizontal ? Math.abs(ox - cx) : Math.abs(oy - cy);
|
|
339
|
+
if (!best || d < best.d)
|
|
340
|
+
best = { id: other, d };
|
|
341
|
+
}
|
|
342
|
+
return best?.id ?? null;
|
|
343
|
+
}
|
|
344
|
+
// ── Navbar de sitio ───────────────────────────────────────────────────────────────────────────────────────────
|
|
345
|
+
/**
|
|
346
|
+
* Si hay que volver a medir si la fila del Navbar cabe. En fila se mide en cada cambio; plegado (cajón), solo
|
|
347
|
+
* cuando la barra crece: medir en fila a cada estrechamiento haría parpadear el diseño (guía «navbar»).
|
|
348
|
+
*/
|
|
349
|
+
export function navbarShouldMeasure(collapsed, width, lastWidth) {
|
|
350
|
+
if (!collapsed)
|
|
351
|
+
return true;
|
|
352
|
+
return width > lastWidth;
|
|
353
|
+
}
|
|
104
354
|
//# sourceMappingURL=logic.js.map
|
package/dist/esm/logic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logic.js","sourceRoot":"","sources":["../../src/logic.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,0EAA0E;AAM1E,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,KAAoB,EAAE,UAAkB,EAAE,IAAgC;IAClG,IAAI,IAAI,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AACrE,CAAC;AASD,qEAAqE;AACrE,MAAM,UAAU,YAAY,CAAC,IAAgB,EAAE,GAAY;IACzD,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IACpD,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC;AAC9B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAE9B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,C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AG,IAAI,CAAC,IAAI;QAAE,OAAO,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACtD,IAAI,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IAC1D,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["// Lógica pura de los layouts, sin React ni DOM. La comparten el binding de React (layouts/*.tsx) y\n// @zuccadev-labs/zuix-zout/dom, para que los dos lados calculen lo mismo.\n\n/* ---------- Shell ---------- */\n\nexport type PanelMode = \"docked\" | \"overlay\";\n\n/** Anchos del shell (px) bajo los cuales un panel en modo `auto` pasa a cajón. */\nexport const SIDEBAR_BREAKPOINT = 880;\nexport const INSPECTOR_BREAKPOINT = 1180;\n\n/**\n * Modo que corresponde a un panel, esté abierto o no. `width` es el ancho medido del shell (`null` sin medir:\n * todo acoplado); `mode` es la preferencia del panel (`auto` o sin valor: decide el ancho).\n */\nexport function panelMode(width: number | null, breakpoint: number, mode?: PanelMode | \"auto\" | null): PanelMode {\n if (mode && mode !== \"auto\") return mode;\n return width !== null && width < breakpoint ? \"overlay\" : \"docked\";\n}\n\n/* ---------- ResizeHandle ---------- */\n\n/** Lado físico del panel donde va el tirador. */\nexport type PhysicalSide = \"left\" | \"right\" | \"top\" | \"bottom\";\n/** `start` y `end` son los bordes lógicos en el eje de la escritura: en RTL, `start` es el derecho. */\nexport type ResizeSide = PhysicalSide | \"start\" | \"end\";\n\n/** Lado físico de un lado lógico según la dirección de escritura. */\nexport function physicalSide(side: ResizeSide, rtl: boolean): PhysicalSide {\n if (side === \"start\") return rtl ? \"right\" : \"left\";\n if (side === \"end\") return rtl ? \"left\" : \"right\";\n return side;\n}\n\nexport const RESIZE_MIN = 200;\nexport const RESIZE_MAX = 720;\nexport const RESIZE_STEP = 16;\n\nexport const clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));\n\nexport const isHorizontal = (side: ResizeSide) => side !== \"top\" && side !== \"bottom\";\n\n/** Un tirador en el borde derecho o inferior crece al avanzar; en el izquierdo o superior, al retroceder. */\nexport const resizeSign = (side: PhysicalSide) => (side === \"right\" || side === \"bottom\" ? 1 : -1);\n\n/**\n * Tamaño tras una tecla, o `undefined` si la tecla no mueve el tirador. Las flechas son físicas (patrón\n * «window splitter» de WAI-ARIA): la flecha mueve el tirador hacia donde apunta. Inicio vuelve al tamaño por defecto.\n */\nexport function resizeByKey(\n key: string,\n side: PhysicalSide,\n size: number,\n opts: { min: number; max: number; step: number; defaultSize?: number },\n): number | undefined {\n const sign = resizeSign(side);\n const grow = isHorizontal(side) ? (sign === 1 ? \"ArrowRight\" : \"ArrowLeft\") : sign === 1 ? \"ArrowDown\" : \"ArrowUp\";\n const shrink = isHorizontal(side) ? (sign === 1 ? \"ArrowLeft\" : \"ArrowRight\") : sign === 1 ? \"ArrowUp\" : \"ArrowDown\";\n if (key === grow) return clamp(size + opts.step, opts.min, opts.max);\n if (key === shrink) return clamp(size - opts.step, opts.min, opts.max);\n if (key === \"Home\" && opts.defaultSize !== undefined) return clamp(opts.defaultSize, opts.min, opts.max);\n return undefined;\n}\n\n/* ---------- SplitPane ---------- */\n\nexport const SPLIT_MIN_FRACTION = 0.1;\n/** Fracción que mueve cada flecha del teclado. */\nexport const SPLIT_KEY_STEP = 0.02;\n\nexport const evenFractions = (n: number) => Array.from({ length: n }, () => 1 / n);\n\n/**\n * Mueve el divisor `index` (entre los paneles index e index+1) una fracción `delta`, partiendo de los tamaños\n * `a` y `b` que tenían esos dos paneles. Devuelve el reparto nuevo; el par conserva su suma.\n */\nexport function moveDivider(fractions: number[], index: number, a: number, b: number, delta: number, minFraction: number): number[] {\n const pair = a + b;\n const na = Math.max(minFraction, Math.min(pair - minFraction, a + delta));\n const next = [...fractions];\n next[index] = na;\n next[index + 1] = pair - na;\n return next;\n}\n\n/**\n * Fracción que pide una tecla en un divisor, o 0 si la tecla no lo mueve. Las flechas mueven el divisor hacia\n * donde apuntan: en una fila RTL el primer panel está a la derecha, así que la flecha derecha lo encoge.\n * Inicio y Fin llevan el divisor a su mínimo y a su máximo (±Infinity; `moveDivider` lo acota).\n */\nexport function dividerKeyDelta(key: string, direction: \"row\" | \"column\", rtl = false): number {\n const sign = direction === \"row\" && rtl ? -1 : 1;\n const fwd = direction === \"row\" ? \"ArrowRight\" : \"ArrowDown\";\n const back = direction === \"row\" ? \"ArrowLeft\" : \"ArrowUp\";\n if (key === \"Home\") return -Infinity;\n if (key === \"End\") return Infinity;\n return key === fwd ? sign * SPLIT_KEY_STEP : key === back ? -sign * SPLIT_KEY_STEP : 0;\n}\n\n/* ---------- TabStrip ---------- */\n\n/**\n * Índice de la pestaña a la que lleva una tecla desde `current`, o -1 si la tecla no navega. En RTL la tira\n * se dibuja de derecha a izquierda, así que la flecha izquierda avanza.\n */\nexport function tabKeyIndex(key: string, current: number, count: number, rtl = false): number {\n if (count === 0) return -1;\n if (key === (rtl ? \"ArrowLeft\" : \"ArrowRight\")) return (current + 1) % count;\n if (key === (rtl ? \"ArrowRight\" : \"ArrowLeft\")) return (current - 1 + count) % count;\n if (key === \"Home\") return 0;\n if (key === \"End\") return count - 1;\n return -1;\n}\n\n/** Desplazamiento horizontal que deja a la vista una pestaña (`tab`) dentro de la tira (`list`); 0 si ya se ve. */\nexport function revealOffset(tab: { left: number; right: number }, list: { left: number; right: number }): number {\n if (tab.left < list.left) return tab.left - list.left;\n if (tab.right > list.right) return tab.right - list.right;\n return 0;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"logic.js","sourceRoot":"","sources":["../../src/logic.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,0EAA0E;AAM1E,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,KAAoB,EAAE,UAAkB,EAAE,IA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I,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC;QAC7E,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO;YAAE,SAAS;QACjC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YAAE,IAAI,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACnD,CAAC;IACD,OAAO,IAAI,EAAE,EAAE,IAAI,IAAI,CAAC;AAC1B,CAAC;AAED,iHAAiH;AAEjH;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAkB,EAAE,KAAa,EAAE,SAAiB;IACtF,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,KAAK,GAAG,SAAS,CAAC;AAC3B,CAAC","sourcesContent":["// Lógica pura de los layouts, sin React ni DOM. La comparten el binding de React (layouts/*.tsx) y\n// @zuccadev-labs/zuix-zout/dom, para que los dos lados calculen lo mismo.\n\n/* ---------- Shell ---------- */\n\nexport type PanelMode = \"docked\" | \"overlay\";\n\n/** Anchos del shell (px) bajo los cuales un panel en modo `auto` pasa a cajón. */\nexport const SIDEBAR_BREAKPOINT = 880;\nexport const INSPECTOR_BREAKPOINT = 1180;\n\n/**\n * Modo que corresponde a un panel, esté abierto o no. `width` es el ancho medido del shell (`null` sin medir:\n * todo acoplado); `mode` es la preferencia del panel (`auto` o sin valor: decide el ancho).\n */\nexport function panelMode(width: number | null, breakpoint: number, mode?: PanelMode | \"auto\" | null): PanelMode {\n if (mode && mode !== \"auto\") return mode;\n return width !== null && width < breakpoint ? \"overlay\" : \"docked\";\n}\n\n/* ---------- ResizeHandle ---------- */\n\n/** Lado físico del panel donde va el tirador. */\nexport type PhysicalSide = \"left\" | \"right\" | \"top\" | \"bottom\";\n/** `start` y `end` son los bordes lógicos en el eje de la escritura: en RTL, `start` es el derecho. */\nexport type ResizeSide = PhysicalSide | \"start\" | \"end\";\n\n/** Lado físico de un lado lógico según la dirección de escritura. */\nexport function physicalSide(side: ResizeSide, rtl: boolean): PhysicalSide {\n if (side === \"start\") return rtl ? \"right\" : \"left\";\n if (side === \"end\") return rtl ? \"left\" : \"right\";\n return side;\n}\n\nexport const RESIZE_MIN = 200;\nexport const RESIZE_MAX = 720;\nexport const RESIZE_STEP = 16;\n\nexport const clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));\n\nexport const isHorizontal = (side: ResizeSide) => side !== \"top\" && side !== \"bottom\";\n\n/** Un tirador en el borde derecho o inferior crece al avanzar; en el izquierdo o superior, al retroceder. */\nexport const resizeSign = (side: PhysicalSide) => (side === \"right\" || side === \"bottom\" ? 1 : -1);\n\n/**\n * Tamaño tras una tecla, o `undefined` si la tecla no mueve el tirador. Las flechas son físicas (patrón\n * «window splitter» de WAI-ARIA): la flecha mueve el tirador hacia donde apunta. Inicio vuelve al tamaño por defecto.\n */\nexport function resizeByKey(\n key: string,\n side: PhysicalSide,\n size: number,\n opts: { min: number; max: number; step: number; defaultSize?: number },\n): number | undefined {\n const sign = resizeSign(side);\n const grow = isHorizontal(side) ? (sign === 1 ? \"ArrowRight\" : \"ArrowLeft\") : sign === 1 ? \"ArrowDown\" : \"ArrowUp\";\n const shrink = isHorizontal(side) ? (sign === 1 ? \"ArrowLeft\" : \"ArrowRight\") : sign === 1 ? \"ArrowUp\" : \"ArrowDown\";\n if (key === grow) return clamp(size + opts.step, opts.min, opts.max);\n if (key === shrink) return clamp(size - opts.step, opts.min, opts.max);\n if (key === \"Home\" && opts.defaultSize !== undefined) return clamp(opts.defaultSize, opts.min, opts.max);\n return undefined;\n}\n\n/* ---------- SplitPane ---------- */\n\nexport const SPLIT_MIN_FRACTION = 0.1;\n/** Fracción que mueve cada flecha del teclado. */\nexport const SPLIT_KEY_STEP = 0.02;\n\nexport const evenFractions = (n: number) => Array.from({ length: n }, () => 1 / n);\n\n/**\n * Mueve el divisor `index` (entre los paneles index e index+1) una fracción `delta`, partiendo de los tamaños\n * `a` y `b` que tenían esos dos paneles. Devuelve el reparto nuevo; el par conserva su suma.\n */\nexport function moveDivider(fractions: number[], index: number, a: number, b: number, delta: number, minFraction: number): number[] {\n const pair = a + b;\n const na = Math.max(minFraction, Math.min(pair - minFraction, a + delta));\n const next = [...fractions];\n next[index] = na;\n next[index + 1] = pair - na;\n return next;\n}\n\n/**\n * Fracción que pide una tecla en un divisor, o 0 si la tecla no lo mueve. Las flechas mueven el divisor hacia\n * donde apuntan: en una fila RTL el primer panel está a la derecha, así que la flecha derecha lo encoge.\n * Inicio y Fin llevan el divisor a su mínimo y a su máximo (±Infinity; `moveDivider` lo acota).\n */\nexport function dividerKeyDelta(key: string, direction: \"row\" | \"column\", rtl = false): number {\n const sign = direction === \"row\" && rtl ? -1 : 1;\n const fwd = direction === \"row\" ? \"ArrowRight\" : \"ArrowDown\";\n const back = direction === \"row\" ? \"ArrowLeft\" : \"ArrowUp\";\n if (key === \"Home\") return -Infinity;\n if (key === \"End\") return Infinity;\n return key === fwd ? sign * SPLIT_KEY_STEP : key === back ? -sign * SPLIT_KEY_STEP : 0;\n}\n\n/* ---------- TabStrip ---------- */\n\n/**\n * Índice de la pestaña a la que lleva una tecla desde `current`, o -1 si la tecla no navega. En RTL la tira\n * se dibuja de derecha a izquierda, así que la flecha izquierda avanza.\n */\nexport function tabKeyIndex(key: string, current: number, count: number, rtl = false): number {\n if (count === 0) return -1;\n if (key === (rtl ? \"ArrowLeft\" : \"ArrowRight\")) return (current + 1) % count;\n if (key === (rtl ? \"ArrowRight\" : \"ArrowLeft\")) return (current - 1 + count) % count;\n if (key === \"Home\") return 0;\n if (key === \"End\") return count - 1;\n return -1;\n}\n\n/**\n * Desplazamiento horizontal que deja a la vista una pestaña (`tab`) dentro de la tira (`list`); 0 si ya se ve.\n * `margin` aparta la pestaña del borde (el ancho del difuminado de la tira), para que no quede bajo la máscara.\n */\nexport function revealOffset(tab: { left: number; right: number }, list: { left: number; right: number }, margin = 0): number {\n // Si la pestaña no cabe con el margen a los dos lados, se deja entera sin margen (mejor rozar el borde que cortarla).\n const m = tab.right - tab.left + 2 * margin <= list.right - list.left ? margin : 0;\n if (tab.left < list.left + m) return tab.left - list.left - m;\n if (tab.right > list.right - m) return tab.right - list.right + m;\n return 0;\n}\n\n/* ---------- TabStrip: grupos y reordenación ---------- */\n\n/** Lista con el elemento `from` llevado a la posición final `to` (índices acotados). Sin cambios, la misma lista. */\nexport function reorder<T>(list: readonly T[], from: number, to: number): T[] {\n const next = [...list];\n if (from < 0 || from >= list.length) return next;\n const target = clamp(to, 0, list.length - 1);\n if (target === from) return next;\n const [item] = next.splice(from, 1);\n next.splice(target, 0, item as T);\n return next;\n}\n\n/** Tramo de una pestaña en el eje de la tira, en coordenadas de la ventana. */\nexport interface Span {\n start: number;\n end: number;\n}\n\n/**\n * Hueco donde caería lo arrastrado: índice de inserción (0…n) según el punto `at` frente a la mitad de cada pestaña.\n * `spans` va en orden del documento; en RTL la tira se dibuja de derecha a izquierda (la primera, a la derecha).\n */\nexport function dropIndex(at: number, spans: readonly Span[], rtl = false): number {\n let index = 0;\n for (const span of spans) {\n const middle = (span.start + span.end) / 2;\n if (rtl ? at < middle : at > middle) index += 1;\n }\n return index;\n}\n\n/** Posición final de un elemento que estaba en `from` y se suelta en el hueco `gap` (índice de inserción). */\nexport const finalIndex = (from: number, gap: number) => (gap > from ? gap - 1 : gap);\n\n/**\n * Posición a la que lleva una tecla de mover pestaña (Ctrl+Mayús+flecha, o Inicio/Fin con Ctrl+Mayús) desde\n * `current`, o -1 si la tecla no mueve o ya está en el extremo. En RTL la flecha izquierda avanza.\n */\nexport function tabMoveIndex(key: string, current: number, count: number, rtl = false): number {\n let next = -1;\n if (key === (rtl ? \"ArrowLeft\" : \"ArrowRight\")) next = current + 1;\n else if (key === (rtl ? \"ArrowRight\" : \"ArrowLeft\")) next = current - 1;\n else if (key === \"Home\") next = 0;\n else if (key === \"End\") next = count - 1;\n return next < 0 || next >= count || next === current ? -1 : next;\n}\n\n/** Lista de ids con `id` movido delante de `before` (al final si es null). Sin `id` en la lista, la misma lista. */\nexport function moveBefore(ids: readonly string[], id: string, before: string | null): string[] {\n if (!ids.includes(id) || id === before) return [...ids];\n const rest = ids.filter((x) => x !== id);\n const at = before === null ? -1 : rest.indexOf(before);\n if (at < 0) rest.push(id);\n else rest.splice(at, 0, id);\n return rest;\n}\n\n/**\n * Hueco de inserción (índice de `visible`) para mover `id` a la posición `to` de la lista visible: devuelve el id\n * delante del que se coloca (null = al final).\n */\nexport function beforeFor(visible: readonly string[], id: string, to: number): string | null {\n const rest = visible.filter((x) => x !== id);\n return rest[to] ?? null;\n}\n\n/* ---------- FloatingPanel ---------- */\n\nexport interface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** Margen mínimo entre un panel flotante y el borde de su área. */\nexport const FLOAT_MARGIN = 8;\n/** Paso de las flechas al mover o redimensionar; con Mayús, ×10. */\nexport const FLOAT_STEP = 10;\n\n/**\n * Rectángulo acotado al área `bounds` (ancho y alto): el tamaño no pasa del área menos los márgenes ni baja del mínimo,\n * y la posición deja el panel entero dentro (si no cabe, pegado al margen de inicio).\n */\nexport function clampRect(\n rect: Rect,\n bounds: { width: number; height: number },\n min: { width: number; height: number } = { width: 0, height: 0 },\n margin = FLOAT_MARGIN,\n): Rect {\n const width = clamp(rect.width, min.width, Math.max(min.width, bounds.width - margin * 2));\n const height = clamp(rect.height, min.height, Math.max(min.height, bounds.height - margin * 2));\n const x = clamp(rect.x, margin, Math.max(margin, bounds.width - width - margin));\n const y = clamp(rect.y, margin, Math.max(margin, bounds.height - height - margin));\n return { x, y, width, height };\n}\n\n/** Desplazamiento que pide una flecha en el asa de mover (hacia donde apunta), o null si la tecla no mueve. */\nexport function moveDelta(key: string, step: number): { dx: number; dy: number } | null {\n if (key === \"ArrowLeft\") return { dx: -step, dy: 0 };\n if (key === \"ArrowRight\") return { dx: step, dy: 0 };\n if (key === \"ArrowUp\") return { dx: 0, dy: -step };\n if (key === \"ArrowDown\") return { dx: 0, dy: step };\n return null;\n}\n\n/**\n * Rectángulo tras llevar la esquina de redimensionar `dw`, `dh` píxeles (positivos: hacia la derecha y abajo), acotado\n * al mínimo y al área. La esquina está al final de la línea: en RTL, abajo a la izquierda, así que el panel crece hacia\n * la izquierda y conserva su borde derecho.\n */\nexport function resizeRect(\n rect: Rect,\n dw: number,\n dh: number,\n bounds: { width: number; height: number },\n min: { width: number; height: number },\n rtl = false,\n margin = FLOAT_MARGIN,\n): Rect {\n const right = rect.x + rect.width;\n const maxWidth = rtl ? right - margin : bounds.width - margin - rect.x;\n const maxHeight = bounds.height - margin - rect.y;\n const width = clamp(rect.width + (rtl ? -dw : dw), min.width, Math.max(min.width, maxWidth));\n const height = clamp(rect.height + dh, min.height, Math.max(min.height, maxHeight));\n return { x: rtl ? right - width : rect.x, y: rect.y, width, height };\n}\n\n/** Tamaño que pide una flecha en la esquina de redimensionar: derecha y abajo crecen (en RTL, izquierda crece). */\nexport function resizeDelta(key: string, step: number): { dw: number; dh: number } | null {\n const d = moveDelta(key, step);\n return d ? { dw: d.dx, dh: d.dy } : null;\n}\n\n/* ---------- PaneLayout: mosaico de paneles ---------- */\n\nexport type PaneNode = { type: \"pane\"; id: string } | { type: \"split\"; direction: \"row\" | \"column\"; sizes: number[]; children: PaneNode[] };\n\n/** Borde de un panel donde cae lo arrastrado. Lógico: `inline-start` es la izquierda en LTR y la derecha en RTL. */\nexport type DropEdge = \"inline-start\" | \"inline-end\" | \"block-start\" | \"block-end\" | \"center\";\n\n/** Ids de los paneles en orden de lectura (profundidad primero). */\nexport function paneIds(node: PaneNode | null): string[] {\n if (!node) return [];\n return node.type === \"pane\" ? [node.id] : node.children.flatMap(paneIds);\n}\n\nconst normalize = (sizes: number[]) => {\n const total = sizes.reduce((a, b) => a + b, 0);\n return total > 0 ? sizes.map((s) => s / total) : evenFractions(sizes.length);\n};\n\n/** Reparto nuevo de la división en `path` (índices de hijos desde la raíz). */\nexport function setSizesAt(node: PaneNode, path: readonly number[], sizes: number[]): PaneNode {\n if (node.type !== \"split\") return node;\n if (!path.length) return { ...node, sizes: [...sizes] };\n const [head, ...rest] = path as [number, ...number[]];\n return { ...node, children: node.children.map((child, i) => (i === head ? setSizesAt(child, rest, sizes) : child)) };\n}\n\n/**\n * Divide el panel `target` y pone `id` delante (`before`) o detrás en `direction`. Si el padre ya divide en esa\n * dirección, el panel nuevo entra como hermano y se queda con la mitad del espacio del panel dividido.\n */\nexport function splitPane(\n node: PaneNode,\n target: string,\n id: string,\n direction: \"row\" | \"column\",\n position: \"before\" | \"after\" = \"after\",\n): PaneNode {\n const pane: PaneNode = { type: \"pane\", id };\n if (node.type === \"pane\") {\n if (node.id !== target) return node;\n return { type: \"split\", direction, sizes: [0.5, 0.5], children: position === \"before\" ? [pane, node] : [node, pane] };\n }\n const at = node.children.findIndex((c) => c.type === \"pane\" && c.id === target);\n if (at >= 0 && node.direction === direction) {\n const half = (node.sizes[at] ?? 0) / 2;\n const children = [...node.children];\n const sizes = [...node.sizes];\n const index = position === \"before\" ? at : at + 1;\n children.splice(index, 0, pane);\n sizes.splice(at, 1, half, half);\n return { ...node, children, sizes };\n }\n return { ...node, children: node.children.map((c) => splitPane(c, target, id, direction, position)) };\n}\n\n/** Quita el panel `id`. Una división que se queda con un hijo cede su sitio a ese hijo. Sin paneles, null. */\nexport function removePane(node: PaneNode, id: string): PaneNode | null {\n if (node.type === \"pane\") return node.id === id ? null : node;\n const kept: { child: PaneNode; size: number }[] = [];\n node.children.forEach((child, i) => {\n const next = removePane(child, id);\n if (next) kept.push({ child: next, size: node.sizes[i] ?? 0 });\n });\n if (!kept.length) return null;\n if (kept.length === 1) return kept[0]!.child;\n return { ...node, children: kept.map((k) => k.child), sizes: normalize(kept.map((k) => k.size)) };\n}\n\n/** Intercambia dos paneles de sitio. */\nexport function swapPanes(node: PaneNode, a: string, b: string): PaneNode {\n if (node.type === \"pane\") return node.id === a ? { type: \"pane\", id: b } : node.id === b ? { type: \"pane\", id: a } : node;\n return { ...node, children: node.children.map((c) => swapPanes(c, a, b)) };\n}\n\n/**\n * Lleva el panel `id` al borde `edge` del panel `target` (lo divide), o lo intercambia con él (`center`). En RTL un\n * borde `inline-start` queda a la derecha, que en una fila es el primer hijo: el árbol guarda el orden lógico.\n */\nexport function movePane(node: PaneNode, id: string, target: string, edge: DropEdge): PaneNode {\n if (id === target || !paneIds(node).includes(id) || !paneIds(node).includes(target)) return node;\n if (edge === \"center\") return swapPanes(node, id, target);\n const rest = removePane(node, id);\n if (!rest) return node;\n const direction = edge === \"inline-start\" || edge === \"inline-end\" ? \"row\" : \"column\";\n const position = edge === \"inline-start\" || edge === \"block-start\" ? \"before\" : \"after\";\n return splitPane(rest, target, id, direction, position);\n}\n\n/**\n * Borde sobre el que está el punto dentro del rectángulo de un panel: el centro (la mitad interior en los dos ejes)\n * intercambia; fuera de él, el borde más cercano en proporción.\n */\nexport function dropEdge(rect: Box, point: { x: number; y: number }, rtl = false): DropEdge {\n const fx = rect.width > 0 ? (point.x - rect.left) / rect.width : 0.5;\n const fy = rect.height > 0 ? (point.y - rect.top) / rect.height : 0.5;\n if (fx > 0.25 && fx < 0.75 && fy > 0.25 && fy < 0.75) return \"center\";\n const distances: [DropEdge, number][] = [\n [rtl ? \"inline-end\" : \"inline-start\", fx],\n [rtl ? \"inline-start\" : \"inline-end\", 1 - fx],\n [\"block-start\", fy],\n [\"block-end\", 1 - fy],\n ];\n return distances.reduce((best, d) => (d[1] < best[1] ? d : best))[0];\n}\n\nexport interface Box {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\n/**\n * Panel vecino de `id` en una dirección física de la pantalla, según los rectángulos de los paneles: el más cercano\n * cuyo centro queda hacia ese lado y que se solapa en el otro eje. Null si no hay.\n */\nexport function neighborPane(\n rects: readonly { id: string; rect: Box }[],\n id: string,\n direction: \"left\" | \"right\" | \"up\" | \"down\",\n): string | null {\n const from = rects.find((r) => r.id === id)?.rect;\n if (!from) return null;\n const cx = from.left + from.width / 2;\n const cy = from.top + from.height / 2;\n let best: { id: string; d: number } | null = null;\n for (const { id: other, rect } of rects) {\n if (other === id) continue;\n const ox = rect.left + rect.width / 2;\n const oy = rect.top + rect.height / 2;\n const horizontal = direction === \"left\" || direction === \"right\";\n const ahead = direction === \"left\" ? ox < cx : direction === \"right\" ? ox > cx : direction === \"up\" ? oy < cy : oy > cy;\n const overlap = horizontal\n ? rect.top < from.top + from.height && rect.top + rect.height > from.top\n : rect.left < from.left + from.width && rect.left + rect.width > from.left;\n if (!ahead || !overlap) continue;\n const d = horizontal ? Math.abs(ox - cx) : Math.abs(oy - cy);\n if (!best || d < best.d) best = { id: other, d };\n }\n return best?.id ?? null;\n}\n\n// ── Navbar de sitio ───────────────────────────────────────────────────────────────────────────────────────────\n\n/**\n * Si hay que volver a medir si la fila del Navbar cabe. En fila se mide en cada cambio; plegado (cajón), solo\n * cuando la barra crece: medir en fila a cada estrechamiento haría parpadear el diseño (guía «navbar»).\n */\nexport function navbarShouldMeasure(collapsed: boolean, width: number, lastWidth: number): boolean {\n if (!collapsed) return true;\n return width > lastWidth;\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const navMenuOrientation: (menu: HTMLElement) => "horizontal" | "vertical";
|
|
2
|
+
/** Coloca el panel bajo su botón, alineado al inicio de línea y dentro del viewport. */
|
|
3
|
+
export declare function placeNavPanel(trigger: HTMLElement, panel: HTMLElement): void;
|
|
4
|
+
/** Pone cada grupo en el modo de su orientación, cerrado. */
|
|
5
|
+
export declare function syncNavMenu(menu: HTMLElement): void;
|
|
6
|
+
/** Abre o cierra un grupo (en los dos modos). */
|
|
7
|
+
export declare function setNavGroupOpen(trigger: HTMLElement, open: boolean, preview?: boolean): void;
|
|
8
|
+
/**
|
|
9
|
+
* Conecta un NavigationMenu: clic en modo vertical, `toggle` de los paneles, previsualización al pasar el puntero,
|
|
10
|
+
* cierre al salir el foco y Escape. Devuelve la función que lo desconecta.
|
|
11
|
+
*/
|
|
12
|
+
export declare function wireNavMenu(menu: HTMLElement): () => void;
|
|
13
|
+
/** Pone el Navbar en modo cajón (`collapsed`) o en fila, con su NavigationMenu en la orientación que toca. */
|
|
14
|
+
export declare function applyNavbar(header: HTMLElement, collapsed: boolean): void;
|
|
15
|
+
/** Verdadero si la fila entera (marca, enlaces y acciones) cabe sin plegarse. Mide en fila y deja todo como estaba. */
|
|
16
|
+
export declare function navbarFits(header: HTMLElement): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Conecta un Navbar: mide al cambiar de tamaño (ResizeObserver en la barra y en la lista), sincroniza el botón de
|
|
19
|
+
* menú con el cajón y cierra el cajón al seguir un enlace. `onChange` recibe el modo cada vez que cambia.
|
|
20
|
+
*/
|
|
21
|
+
export declare function wireNavbar(header: HTMLElement, onChange?: (collapsed: boolean) => void): () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Lleva el foco al destino de un enlace de salto. Si el destino no es enfocable, recibe `tabindex="-1"` (lo
|
|
24
|
+
* pueden seguir las lupas de pantalla) sin entrar en el orden de Tab. Devuelve el destino o null.
|
|
25
|
+
*/
|
|
26
|
+
export declare function skipTo(link: HTMLAnchorElement): HTMLElement | null;
|