@kwirthmagnify/kwirth-common-front 0.5.34 → 0.5.35
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/dist/HelpButton.js +14 -1
- package/package.json +1 -1
package/dist/HelpButton.js
CHANGED
|
@@ -14,10 +14,23 @@ const icons_material_1 = require("@mui/icons-material");
|
|
|
14
14
|
const DEFAULT_DOCS_URL = 'http://localhost:4000'; // fallback si no hay docsUrl configurado
|
|
15
15
|
const HelpButton = ({ docsUrl, section }) => {
|
|
16
16
|
const open = () => {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
17
18
|
const base = (docsUrl || DEFAULT_DOCS_URL).replace(/\/+$/, '');
|
|
18
19
|
// Popup del navegador (ventana aparte, no pestaña): las features de tamaño fuerzan el popup.
|
|
20
|
+
// Tamaño: 60% ancho × 80% alto de la pantalla ACTUAL. Centrado en su monitor (multi-monitor) vía
|
|
21
|
+
// availLeft/availTop (origen del monitor donde está la ventana). left/top solo los respeta si es popup real.
|
|
22
|
+
const scr = window.screen;
|
|
23
|
+
const sw = scr.availWidth;
|
|
24
|
+
const sh = scr.availHeight;
|
|
25
|
+
const width = Math.round(sw * 0.6);
|
|
26
|
+
const height = Math.round(sh * 0.8);
|
|
27
|
+
const originX = (_b = (_a = scr.availLeft) !== null && _a !== void 0 ? _a : window.screenX) !== null && _b !== void 0 ? _b : 0;
|
|
28
|
+
const originY = (_d = (_c = scr.availTop) !== null && _c !== void 0 ? _c : window.screenY) !== null && _d !== void 0 ? _d : 0;
|
|
29
|
+
const left = Math.round(originX + (sw - width) / 2);
|
|
30
|
+
const top = Math.round(originY + (sh - height) / 2);
|
|
31
|
+
const features = `popup=yes,width=${width},height=${height},left=${left},top=${top},scrollbars=yes,resizable=yes`;
|
|
19
32
|
// Nombre estable → clics sucesivos reusan la misma ventana (navega a la nueva sección).
|
|
20
|
-
const w = window.open(`${base}/#/${section}`, 'kwirth-guide',
|
|
33
|
+
const w = window.open(`${base}/#/${section}`, 'kwirth-guide', features);
|
|
21
34
|
if (w) {
|
|
22
35
|
w.opener = null;
|
|
23
36
|
w.focus();
|