flexdesk 0.2.0 → 0.4.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/README.md +26 -0
- package/css/base.css +2243 -872
- package/css/flexdesk.css +1375 -14
- package/css/overrides.css +44 -0
- package/css/tokens.css +45 -0
- package/dist/charts.js +5 -3
- package/dist/charts.js.map +1 -1
- package/dist/{chunk-DVU44T77.js → chunk-ELXVW542.js} +196 -75
- package/dist/chunk-ELXVW542.js.map +7 -0
- package/dist/chunk-LH5TSOZW.js +1237 -0
- package/dist/chunk-LH5TSOZW.js.map +7 -0
- package/dist/{chunk-TLZUUFOE.js → chunk-O5OHMWBB.js} +10 -2
- package/dist/chunk-O5OHMWBB.js.map +7 -0
- package/dist/{chunk-CT4YXXLP.js → chunk-QIU5S2RU.js} +371 -73
- package/dist/chunk-QIU5S2RU.js.map +7 -0
- package/dist/chunk-QNQHQ24V.js +408 -0
- package/dist/chunk-QNQHQ24V.js.map +7 -0
- package/dist/{chunk-DRYCDMEG.js → chunk-XKDTIT4Q.js} +168 -12
- package/dist/chunk-XKDTIT4Q.js.map +7 -0
- package/dist/editor.js +3 -380
- package/dist/editor.js.map +3 -3
- package/dist/flexdesk.css +1375 -14
- package/dist/tiles.js +168 -41
- package/dist/tiles.js.map +2 -2
- package/dist/tokens.css +45 -0
- package/dist/widgets.js +44 -14
- package/dist/widgets.js.map +2 -2
- package/dist/wm.js +3140 -157
- package/dist/wm.js.map +4 -4
- package/package.json +3 -2
- package/src/charts/chart_types.js +167 -0
- package/src/charts/plotly_wrapper.js +178 -10
- package/src/editor/notebook_tab_bar.js +39 -3
- package/src/tiles/tile_base.js +143 -35
- package/src/tiles/tile_grid.js +52 -1
- package/src/tiling/command_palette.js +71 -18
- package/src/tiling/desktops.js +36 -12
- package/src/tiling/keymap.js +24 -4
- package/src/tiling/shell.js +156 -25
- package/src/tiling/tab_strip.js +184 -0
- package/src/tiling/tile_breadcrumb.js +34 -2
- package/src/tiling/tile_renderer.js +1386 -21
- package/src/tiling/tile_tab_menu.js +101 -0
- package/src/tiling/tile_tree.js +115 -11
- package/src/tiling/wm.js +2375 -84
- package/src/tiling/zoom.js +248 -0
- package/src/ui/components/action_dropdown.js +34 -3
- package/src/ui/components/autocomplete_field.js +65 -13
- package/src/ui/components/context_menu.js +79 -8
- package/src/ui/components/data_table.js +508 -84
- package/src/ui/components/managed_window.js +928 -36
- package/src/ui/components/modal.js +214 -8
- package/dist/chunk-CT4YXXLP.js.map +0 -7
- package/dist/chunk-DRYCDMEG.js.map +0 -7
- package/dist/chunk-DVU44T77.js.map +0 -7
- package/dist/chunk-TLZUUFOE.js.map +0 -7
- package/dist/chunk-UCJ2WD4D.js +0 -625
- package/dist/chunk-UCJ2WD4D.js.map +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ui/components/managed_window.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * ManagedWindow - A reusable window component with drag, resize, minimize, and persistence.\n *\n * Usage:\n * const win = new ManagedWindow({\n * id: 'my-window',\n * title: 'My Window',\n * icon: 'folder_open', // Material Symbols icon name (optional)\n * content: myDomElement,\n * minWidth: 400,\n * minHeight: 300,\n * defaultWidth: 600,\n * defaultHeight: 400,\n * canMaximize: true,\n * onClose: () => { ... }\n * });\n * win.show();\n */\n\nimport { getSetting } from '../../core/settings.js';\n\nconst STORAGE_KEY = 'ecosim.managedWindows.v1';\nconst BASE_Z_INDEX = 6000;\nconst MAX_Z_INDEX = 6999;\n\n// Bar heights for maximize bounds. Must match the tiling shell's\n// own constants (host.css locks `.global-bottom-bar` to 22 px) so a\n// maximized window stops above the bottom bar instead of slipping\n// under it.\nconst TOP_BAR_HEIGHT = 35;\nconst BOTTOM_BAR_HEIGHT = 22;\n\n/** C11. How close to an edge the POINTER must come for a snap zone to arm.\n * Small enough that it takes intent, large enough to hit without aiming. */\nconst SNAP_EDGE = 12;\n\n// Default icon for windows\nconst DEFAULT_ICON = 'web_asset';\n\n// Global state for z-order management\nlet _zIndexCounter = 0;\nlet _activeWindows = new Map(); // id -> ManagedWindow instance\n\n/** Collect the focusable elements inside `root`, in DOM order. Used\n * by the modal focus trap so Tab cycles within the modal frame and\n * can't escape into the underlying tiles. */\nfunction _collectFocusable(root) {\n if (!root) return [];\n const sel = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n ].join(',');\n return Array.from(root.querySelectorAll(sel)).filter((el) => {\n // Skip hidden / zero-size elements \u2014 Tab visits only what the\n // user can actually see.\n if (el.hidden) return false;\n if (el.closest('[hidden]')) return false;\n const r = el.getBoundingClientRect();\n return r.width > 0 || r.height > 0;\n });\n}\n\n// Global state cache\nlet _stateCache = null;\n\nfunction _loadState() {\n if (_stateCache) return _stateCache;\n try {\n const raw = localStorage.getItem(STORAGE_KEY);\n _stateCache = raw ? JSON.parse(raw) : {};\n } catch {\n _stateCache = {};\n }\n return _stateCache;\n}\n\nfunction _saveState(state) {\n _stateCache = state;\n try {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(state));\n } catch (err) {\n console.warn('[ManagedWindow] Failed to save state:', err);\n }\n}\n\nfunction _getWindowState(id) {\n const state = _loadState();\n return state[id] || null;\n}\n\nfunction _setWindowState(id, windowState) {\n const state = _loadState();\n state[id] = windowState;\n _saveState(state);\n}\n\nexport class ManagedWindow {\n /**\n * @param {Object} options\n * @param {string} options.id - Unique window ID for persistence\n * @param {string} options.title - Window title\n * @param {string} [options.icon] - Material Symbols icon name (default: 'web_asset')\n * @param {HTMLElement|Function} options.content - Content element or render function\n * @param {number} [options.minWidth=400] - Minimum width\n * @param {number} [options.minHeight=300] - Minimum height\n * @param {number} [options.defaultWidth=600] - Default width\n * @param {number} [options.defaultHeight=400] - Default height\n * @param {boolean} [options.canMinimize=true] - Whether minimize button is shown\n * @param {boolean} [options.canMaximize=true] - Whether maximize button is shown\n * @param {boolean} [options.canResize=true] - Whether window can be resized\n * @param {boolean} [options.canDrag=true] - Whether window can be dragged\n * @param {boolean} [options.modal=false] - Whether to show backdrop\n * @param {Function} [options.onClose] - Callback when window is closed\n * @param {Function} [options.beforeClose] - Guard called before close. Return false (or a Promise resolving to false) to prevent closing.\n * @param {Function} [options.onMinimize] - Callback when window is minimized\n * @param {HTMLElement} [options.container] - Mount point. Defaults to\n * `document.body` (every call site that exists today). When given, the\n * window is positioned and CLAMPED inside that element instead of the\n * viewport, and its taskbar events carry the container so a per-panel\n * taskbar can filter on them.\n *\n * The container MUST establish a containing block with\n * `position: relative` or `position: absolute` \u2014 and with NOTHING else.\n * `transform`, `filter`, `contain` and `will-change` also create a\n * containing block, and they additionally trap `position: fixed`\n * descendants. DataTable's filter dropdown (`position: fixed;\n * z-index: 10001`) and the autocomplete dropdown deliberately ESCAPE\n * their tile to the viewport; under a transformed ancestor they become\n * container-relative and get clipped by `overflow: hidden`. The symptom\n * is \"the filter dropdown is cut in half\" and the cause is three files\n * away.\n * @param {Array} [options.titlebarButtons] - Extra buttons left of\n * minimize: `{icon, title, onClick}`.\n */\n constructor(options) {\n this.id = options.id;\n this.title = options.title || 'Window';\n this.icon = options.icon || DEFAULT_ICON;\n this.content = options.content;\n this.minWidth = options.minWidth || 400;\n this.minHeight = options.minHeight || 300;\n this.defaultWidth = options.defaultWidth || 600;\n this.defaultHeight = options.defaultHeight || 400;\n this.canMinimize = options.canMinimize ?? true;\n this.canMaximize = options.canMaximize ?? true;\n this.canResize = options.canResize ?? true;\n this.modal = options.modal ?? false;\n // Backdrop appearance (modal only). `undefined` \u2192 inherit the CSS\n // default (blur 2px over a 50% dim). Override per-modal when the\n // background should stay legible \u2014 e.g. a live-applied editor where\n // you want to watch the content behind update.\n // backdropBlur: blur radius in px; 0 disables the blur.\n // backdropOpacity: dim darkness, 0 (clear) \u2026 1 (opaque black).\n this.backdropBlur = options.backdropBlur;\n this.backdropOpacity = options.backdropOpacity;\n // Modals are non-draggable by default\n this.canDrag = options.canDrag ?? !this.modal;\n this.onClose = options.onClose;\n this.beforeClose = options.beforeClose || null;\n this.onMinimize = options.onMinimize;\n // C1. `document.body` is the default and the legacy path; every bounds\n // computation below reduces to today's expression by substitution when\n // it is in force. See `_bounds`.\n this.container = options.container || null;\n /** C11. AERO SNAP \u2014 drag to an edge, release, the window takes that\n * region. Opt-in and default OFF, so no existing consumer changes\n * behaviour by upgrading. Meaningful only for a draggable window that\n * is allowed to change size. */\n this.snap = (options.snap ?? false) && this.canDrag && this.canResize;\n /** C15. SNAP AS A DELEGATED DECISION.\n *\n * C11's snap answers \"which rectangle\" out of three it computes itself\n * from `_bounds()`. That is the whole and correct answer for a window\n * floating over a region nothing else owns, and only half of it under a\n * TILING window manager: there, dropping on an edge does not move a\n * window, it PROMOTES one \u2014 the window stops being a ManagedWindow and\n * becomes a leaf in a tree this component knows nothing about.\n *\n * So the decision is delegated. A `snapController` is:\n *\n * probe(pointerEvent, win) -> { key, rect } | null\n * `rect` is {left, top, width, height} in VIEWPORT pixels \u2014\n * the space a hit-test against other people's DOM naturally\n * produces. `key` is an opaque identity for the zone; the\n * preview only re-renders when it changes.\n * commit(probe, win) -> falsy | true | Promise\n * Called once on release. Falsy means \"not mine\" and the\n * window keeps the position the drag left it in. Anything\n * truthy means the controller took the window AND the preview:\n * a controller that opens a menu needs the preview to outlive\n * the pointer-up, so it clears it through `clearSnapPreview()`.\n *\n * Absent, every line below reduces to C11 exactly. */\n this.snapController = options.snapController || null;\n /** R1. DRAG ACROSS THE CONTAINER BOUNDARY.\n *\n * A contained window lives inside a box with `overflow: hidden` \u2014 for\n * the WM that box is a tile's leaf wrap \u2014 so at rest it cannot show a\n * single pixel outside it, and a drag that leaves it is a drag that\n * disappears. `dragHost` names the WIDER box the window is re-parented\n * into for the duration of a drag: an element or a `(win) => element`\n * callback, resolved on every pointer-down because the WM's root\n * outlives any particular tile and a captured tile does not.\n *\n * Absent \u2014 every consumer today \u2014 nothing re-parents and the drag is\n * clamped to the container exactly as before. The host must CONTAIN\n * the current container: escaping is meant to widen the box the window\n * may cross, not to move it somewhere it has no business being. */\n this.dragHost = options.dragHost || null;\n /** R12. THE BOX AN ESCAPED WINDOW MAY OCCUPY, in the drag host's own\n * coordinates: `() => {minX, minY, width, height}`.\n *\n * R1 widened the drag from one pane to the whole root, and the root is\n * not all tiles \u2014 the docked panels are inside it too. Without this a\n * window can be dragged down over the bottom panel and left there,\n * which is the one edge of the four that stopped feeling like an edge.\n * The host knows which of its children are panels and this component\n * never will, so it answers rather than guesses.\n *\n * Consulted only while a drag has escaped: at rest the container is\n * the box, exactly as before, and a window that never escapes never\n * reads this. */\n this.dragBounds = options.dragBounds || null;\n /** R7. MAXIMISE IS A GESTURE, NOT NECESSARILY A RECTANGLE.\n *\n * `(win) => truthy` claims the maximise gesture: `toggleMaximize`\n * returns without touching the geometry, and the consumer does\n * whatever it decided maximise means. The WM decides it means \"back\n * into the tree\", which is why the separate demote button it used to\n * inject into this chrome is gone. Falsy \u2014 and absent \u2014 leaves the\n * ordinary maximise, so no existing window changes behaviour. */\n this.onMaximize = options.onMaximize || null;\n /** A Material Symbol name replacing the maximize button's square, and\n * its tooltip. They exist because `onMaximize` can change what the\n * button DOES, and a button that does something else while drawing a\n * square is a lie the user only discovers by pressing it. */\n this.maximizeIcon = options.maximizeIcon || null;\n this.maximizeTitle = options.maximizeTitle || 'Maximize';\n this._snapZone = null;\n this._snapProbe = null;\n /** The container a drag escaped FROM, for as long as that drag lasts.\n * Null at every other moment, including for a window that never\n * escapes. Read by the consumer's snap controller (`dragOrigin`), which\n * needs to know which pane is \"home\" to stay silent inside it. */\n this._escapeOrigin = null;\n this._preSnapState = null;\n this._snapPreviewEl = null;\n // C27. THE TWO ANIMATION TIMERS, HELD SO THEY CAN BE CANCELLED.\n // Each of `minimize`/`_restore` ends in a `setTimeout` that finishes\n // its animation, and each finishes it by writing state the OTHER one\n // owns \u2014 `display`, and the three `--mw-target-*` properties. Fired\n // after the opposite gesture has already run, that write is not a late\n // tidy-up, it is a corruption. See `_restore` for the report.\n this._minimizeTimer = null;\n this._restoreTimer = null;\n this.titlebarButtons = Array.isArray(options.titlebarButtons)\n ? options.titlebarButtons : [];\n\n this.element = null;\n this.backdropElement = null;\n this.contentContainer = null;\n this.isVisible = false;\n this.isMinimized = false;\n this.isMaximized = false;\n this.zIndex = BASE_Z_INDEX;\n\n // Position/size state - clamp to the bounds rectangle\n this.x = 0;\n this.y = 0;\n const initial = this._bounds();\n this.width = Math.min(this.defaultWidth, initial.width);\n this.height = Math.min(this.defaultHeight, initial.height);\n\n // State before maximize (for restore)\n this._preMaximizeState = null;\n\n // Drag state\n this._dragState = null;\n this._resizeState = null;\n\n // Bound handlers for cleanup\n this._boundOnPointerMove = this._onPointerMove.bind(this);\n this._boundOnPointerUp = this._onPointerUp.bind(this);\n this._boundOnKeyDown = this._onKeyDown.bind(this);\n\n // Register globally\n _activeWindows.set(this.id, this);\n }\n\n /**\n * Show the window.\n */\n show() {\n if (this.isVisible && !this.isMinimized) {\n // C27. `show()` IS THE REPAIR PATH, so it repairs. A window that is\n // visible by its own flags and hidden by an inline `display: none`\n // is the state the minimise/restore race used to leave behind, and\n // a consumer holding such a window had nothing to call: this branch\n // raised a window nobody could see. Clearing the property is a\n // no-op for every window that was not in that state \u2014 a shown\n // window's `display` is already `''`.\n if (this.element && this.element.style.display === 'none') {\n this.element.style.display = '';\n }\n this.bringToFront();\n return;\n }\n\n if (!this.element) {\n this._build();\n this._restoreState();\n }\n\n if (this.isMinimized) {\n this._restore();\n } else {\n // A window whose PERSISTED state was maximised is maximised before\n // anyone touches the button, so the modifier has to be written here\n // too and not only in `toggleMaximize`.\n this.element?.classList.toggle(\n 'twm-managed-window--maximized', this.isMaximized);\n this._applyPosition();\n const mount = this.container || document.body;\n // C3. `--contained` switches `position: fixed` to `absolute`; the\n // backdrop follows the same rule so a modal inside a panel dims the\n // panel rather than the page.\n this.element.classList.toggle('twm-managed-window--contained', !!this.container);\n mount.appendChild(this.element);\n if (this.modal && this.backdropElement) {\n this.backdropElement.classList.toggle(\n 'twm-managed-window__backdrop--contained', !!this.container);\n mount.appendChild(this.backdropElement);\n }\n this._installContainerResizeObserver();\n this.isVisible = true;\n }\n\n this.bringToFront();\n document.addEventListener('keydown', this._boundOnKeyDown);\n }\n\n /**\n * Hide/close the window.\n * @param {{ force?: boolean }} [options] - Pass force:true to bypass the beforeClose guard.\n */\n close({ force = false } = {}) {\n if (!this.isVisible) return;\n\n if (!force && this.beforeClose) {\n const result = this.beforeClose();\n if (result && typeof result.then === 'function') {\n result.then(allowed => { if (allowed !== false) this._doClose(); });\n return;\n }\n if (result === false) return;\n }\n\n this._doClose();\n }\n\n /** Internal close \u2014 always executes, no guard. */\n _doClose() {\n if (!this.isVisible) return;\n\n this._saveCurrentState();\n\n // Call onClose BEFORE removing elements so content can still read its state\n // (e.g., expression modal needs to read the editor value before DOM is detached)\n if (this.onClose) {\n this.onClose();\n }\n\n if (this.element && this.element.parentNode) {\n this.element.parentNode.removeChild(this.element);\n }\n if (this.backdropElement && this.backdropElement.parentNode) {\n this.backdropElement.parentNode.removeChild(this.backdropElement);\n }\n\n this.isVisible = false;\n this.isMinimized = false;\n // C27. A window can be closed mid-animation \u2014 \"back to tile\" from the\n // taskbar's menu is exactly that, and it closes a MINIMISED window. The\n // pending timer would then write `display: none` and strip the target\n // properties from an element that has been detached, or, for a window\n // `show()` puts back inside the same 200ms, from a live one.\n this._cancelMinimizeAnimation();\n this._cancelRestoreAnimation();\n this._clearTargetProperties();\n document.removeEventListener('keydown', this._boundOnKeyDown);\n\n // Notify taskbar\n this._teardownContainerResizeObserver();\n // C5. `container` rides on all three window events so a NON-SINGLETON\n // taskbar can filter on receipt: an in-panel taskbar shows only the\n // windows mounted in its own panel, and the viewport taskbar shows only\n // the ones with no container.\n window.dispatchEvent(new CustomEvent('managed-window-closed', {\n detail: { id: this.id, container: this.container }\n }));\n }\n\n /**\n * Minimize to taskbar with animation.\n */\n minimize() {\n if (!this.isVisible || this.isMinimized) return;\n\n this._saveCurrentState();\n this.isMinimized = true;\n\n if (this.onMinimize) {\n this.onMinimize();\n }\n\n if (this.backdropElement) {\n this.backdropElement.style.display = 'none';\n }\n\n // Dispatch event first so the taskbar button is created synchronously\n window.dispatchEvent(new CustomEvent('managed-window-minimized', {\n detail: {\n id: this.id, title: this.title, icon: this.icon,\n container: this.container,\n }\n }));\n\n if (!this.element) return;\n\n // C27. The mirror of the cancellation in `_restore`. A restore in\n // flight owns `--restoring` and the target properties, and its timer\n // would strip both out from under the minimise that replaced it \u2014\n // leaving a window that shrinks toward the taskbar and then snaps back\n // to full size for the rest of the 200ms.\n this._cancelRestoreAnimation();\n\n if (!getSetting('window.animateMinimize', true)) {\n this.element.style.display = 'none';\n return;\n }\n\n // Calculate animation target toward the taskbar button\n this._setMinimizeTargetProperties();\n this.element.classList.add('twm-managed-window--minimizing');\n\n this._minimizeTimer = setTimeout(() => {\n this._minimizeTimer = null;\n if (this.element) {\n this.element.style.display = 'none';\n this.element.classList.remove('twm-managed-window--minimizing');\n this._clearTargetProperties();\n }\n }, 200);\n }\n\n /** C27. Abandon a minimise animation that has not landed yet.\n *\n * The timer is dropped AND the class is removed, because the class is half\n * the damage: `--minimizing` is `opacity: 0` plus a transform that parks\n * the window over the taskbar plus `pointer-events: none`, so a window\n * that keeps it is invisible and unclickable for the rest of the 200ms\n * even before the timer hides it outright. */\n _cancelMinimizeAnimation() {\n if (this._minimizeTimer !== null) {\n clearTimeout(this._minimizeTimer);\n this._minimizeTimer = null;\n }\n this.element?.classList.remove('twm-managed-window--minimizing');\n }\n\n /** C27. Abandon a restore animation that has not landed yet. */\n _cancelRestoreAnimation() {\n if (this._restoreTimer !== null) {\n clearTimeout(this._restoreTimer);\n this._restoreTimer = null;\n }\n this.element?.classList.remove('twm-managed-window--restoring');\n }\n\n /**\n * Restore from minimized state with animation.\n *\n * \u2550\u2550 C27. THE WINDOW THAT COULD NOT BE BROUGHT BACK \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n *\n * `minimize` hides the element inside a `setTimeout(..., 200)` so the\n * shrink-toward-the-taskbar animation has time to play, and this method\n * cleared the `display` IMMEDIATELY. Minimise a window and restore it from\n * the taskbar inside those 200ms \u2014 which is not a stress test, it is what\n * \"I clicked the wrong button\" looks like \u2014 and the sequence ran:\n *\n * minimize() isMinimized = true, timer armed for +200ms\n * _restore() display = '', isMinimized = FALSE, taskbar button gone\n * +200ms the timer fires and writes `display: none`\n *\n * leaving a window that is off screen with `isMinimized === false`. Every\n * route back is closed at once: `static restore` and `show` both funnel\n * through the `isMinimized` guard above and return without doing anything,\n * and a taskbar built from `ManagedWindow.all().filter(isMinimized)` \u2014\n * which is how `syncTaskbars` builds it \u2014 has no button for it either. The\n * window is live, holding its content and its staged edits, and there is no\n * gesture in the product that can reach it. Reported twice.\n *\n * The `--minimizing` CLASS is the same defect one layer up and it bites\n * even before the timer does: it is `opacity: 0` with a transform parking\n * the window over the taskbar and `pointer-events: none`, and it was left\n * on for the remainder of the animation, so the restored window was\n * invisible and unclickable for up to 200ms before disappearing outright.\n *\n * Both are cancelled here rather than worked around in a consumer. A\n * consumer cannot see either one: nothing throws, no state is inconsistent\n * at any moment a caller can observe, and the corruption is written by a\n * timer with no name.\n */\n _restore() {\n if (!this.isMinimized) return;\n\n // Capture taskbar item rect BEFORE dispatching the event (which removes it)\n const taskbarRect = this._getTaskbarItemRect();\n\n // C27. FIRST, before `display` is cleared: the pending timer would\n // otherwise undo this whole method 200ms from now.\n this._cancelMinimizeAnimation();\n\n if (this.element) {\n this.element.style.display = '';\n\n const animate = getSetting('window.animateMinimize', true);\n if (animate) {\n // A restore that interrupts a restore \u2014 two clicks on one\n // taskbar button \u2014 would otherwise have the first timer strip\n // the second one's class and properties at ITS deadline.\n this._cancelRestoreAnimation();\n this._setRestoreTargetProperties(taskbarRect);\n this.element.classList.add('twm-managed-window--restoring');\n this._restoreTimer = setTimeout(() => {\n this._restoreTimer = null;\n if (this.element) {\n this.element.classList.remove('twm-managed-window--restoring');\n this._clearTargetProperties();\n }\n }, 250);\n } else {\n // No animation means no timer to clear the properties, and a\n // minimise that was cancelled mid-flight left three of them\n // set. Harmless while no class reads them and wrong the moment\n // one does.\n this._clearTargetProperties();\n }\n }\n if (this.modal && this.backdropElement) {\n this.backdropElement.style.display = '';\n }\n\n this.isMinimized = false;\n this.bringToFront();\n\n // Notify taskbar (removes the taskbar button)\n window.dispatchEvent(new CustomEvent('managed-window-restored', {\n detail: { id: this.id, container: this.container }\n }));\n }\n\n /**\n * Toggle maximize state.\n */\n /**\n * @param {{claimable?: boolean}} [opts] `claimable: false` performs the\n * GEOMETRIC maximise even when a consumer has claimed the gesture. NOTHING\n * INSIDE THE LIBRARY PASSES IT \u2014 this docstring used to say the topbar's\n * double-click did, and the binding at `:890` has never passed anything\n * (C26 settled the other way; see the note there). It has had two callers\n * outside it and it now has none: the window manager's aero-snap top edge\n * used it for R13's maximise-onto-the-layer, and Tables' window menu drew\n * a \"Maximize\" beside \"Back to tile\" and got its rectangle from here. R14\n * collapsed both into the dock \u2014 maximise means back to tile, everywhere\n * \u2014 so the escape hatch is now a LIBRARY API with no caller in this repo\n * rather than a shared secret between two.\n *\n * IT IS KEPT, and deliberately. A window that came out of a tile has a\n * tile to go back to; a window that never did has only the rectangle, and\n * `openModal`'s dialogs are exactly that case (`modal.js`, `maximizable`)\n * \u2014 they reach the same rectangle through the ordinary claimless path\n * because they set no `onMaximize` at all. Removing this would leave a\n * consumer that HAS claimed the gesture with no way to ask for the other\n * verb, which is the situation the flag was added to fix.\n *\n * A doc that names a caller that does not exist is worse than no doc \u2014 it\n * is the reason a reader concludes the double-click is already handled.\n */\n toggleMaximize({ claimable = true } = {}) {\n if (!this.canMaximize) return;\n\n // R7. THE CONSUMER MAY OWN THIS GESTURE, and under the window manager\n // it does: `adoptWindow` rewrites `onMaximize` to `bringBackWindow`, so\n // both doors \u2014 the button and the topbar's double-click \u2014 DOCK.\n //\n // C28. A CLAIM THAT DECLINES MUST FALL THROUGH, which is what makes\n // \"expand this window into a tile\" a gesture rather than a dead zone.\n // `bringBackWindow` returns false for a window the WM never adopted, so\n // this runs the geometric maximise for it \u2014 the answer every other\n // window manager gives a window with nowhere to go back to. When the\n // wrappers returned `true` regardless, the gesture was claimed, nothing\n // docked and nothing maximised: reported twice, as a title bar whose\n // double-click did nothing at all.\n //\n // Guarded like every other consumer callback here: an exception must not\n // leave the window in a half-maximised state \u2014 and a `throw` is a\n // DECLINE, not a claim, so it falls through to the rectangle too.\n if (claimable && this.onMaximize) {\n let handled = false;\n try { handled = this.onMaximize(this) ?? false; }\n catch (err) { console.error('[managed-window] onMaximize threw', err); }\n if (handled) return;\n }\n\n if (this.isMaximized) {\n // Restore\n if (this._preMaximizeState) {\n this.x = this._preMaximizeState.x;\n this.y = this._preMaximizeState.y;\n this.width = this._preMaximizeState.width;\n this.height = this._preMaximizeState.height;\n this._preMaximizeState = null;\n }\n this.isMaximized = false;\n } else {\n // Maximize - respect top and bottom bars\n this._preMaximizeState = { x: this.x, y: this.y, width: this.width, height: this.height };\n const bounds = this._bounds();\n this.x = bounds.minX;\n this.y = bounds.minY;\n this.width = bounds.width;\n this.height = bounds.height;\n this.isMaximized = true;\n }\n\n // A CLASS THE STYLESHEET HAS ALWAYS KNOWN AND NOTHING EVER SET.\n // `.twm-managed-window--maximized .twm-managed-window__resize\n // { display: none }` is in `css/base.css` \u2014 \"a maximised window is not\n // resized by dragging its edges\" \u2014 and it has never matched anything,\n // because no code path adds the modifier. So a maximised window keeps\n // eight live resize handles hanging 3px outside its edges. Exactly the\n // shape of the `.twm-collapsible-content.visible` and\n // `managed-window__resize--${dir}` bugs: a rule for a class that is\n // never written.\n this.element?.classList.toggle('twm-managed-window--maximized', this.isMaximized);\n this._applyPosition();\n this._saveCurrentState();\n // C16. Maximise is a STATE, and until now nothing outside this class\n // could see it change. A consumer that wants to say \"a maximised window\n // has no minimize\" \u2014 the WM does, for the windows it promotes out of\n // tiles \u2014 had no edge to hang the rule on and would have had to poll.\n // Same detail shape as the other three window events, `container`\n // included, so a per-region consumer can filter on receipt.\n window.dispatchEvent(new CustomEvent('managed-window-maximized', {\n detail: { id: this.id, maximized: this.isMaximized, container: this.container },\n }));\n }\n\n /**\n * Find the taskbar button for this window.\n * @returns {DOMRect|null}\n */\n _getTaskbarItemRect() {\n const btn = document.querySelector(`.twm-bar-windows__item[data-window-id=\"${this.id}\"]`);\n return btn ? btn.getBoundingClientRect() : null;\n }\n\n /**\n * Set CSS custom properties to animate minimize toward the taskbar item.\n */\n _setMinimizeTargetProperties() {\n const targetRect = this._getTaskbarItemRect();\n if (!targetRect || !this.element) return;\n\n const winRect = this.element.getBoundingClientRect();\n const winCenterX = winRect.left + winRect.width / 2;\n const winCenterY = winRect.top + winRect.height / 2;\n const targetCenterX = targetRect.left + targetRect.width / 2;\n const targetCenterY = targetRect.top + targetRect.height / 2;\n\n const dx = targetCenterX - winCenterX;\n const dy = targetCenterY - winCenterY;\n const scale = Math.min(targetRect.width / winRect.width, targetRect.height / winRect.height, 0.15);\n\n this.element.style.setProperty('--mw-target-x', `${dx}px`);\n this.element.style.setProperty('--mw-target-y', `${dy}px`);\n this.element.style.setProperty('--mw-target-scale', scale);\n }\n\n /**\n * Set CSS custom properties to animate restore from the taskbar item position.\n * @param {DOMRect|null} taskbarRect\n */\n _setRestoreTargetProperties(taskbarRect) {\n if (!taskbarRect || !this.element) return;\n\n const winRect = this.element.getBoundingClientRect();\n const winCenterX = winRect.left + winRect.width / 2;\n const winCenterY = winRect.top + winRect.height / 2;\n const targetCenterX = taskbarRect.left + taskbarRect.width / 2;\n const targetCenterY = taskbarRect.top + taskbarRect.height / 2;\n\n const dx = targetCenterX - winCenterX;\n const dy = targetCenterY - winCenterY;\n const scale = Math.min(taskbarRect.width / winRect.width, taskbarRect.height / winRect.height, 0.15);\n\n this.element.style.setProperty('--mw-target-x', `${dx}px`);\n this.element.style.setProperty('--mw-target-y', `${dy}px`);\n this.element.style.setProperty('--mw-target-scale', scale);\n }\n\n /**\n * Clear animation CSS custom properties.\n */\n _clearTargetProperties() {\n if (!this.element) return;\n this.element.style.removeProperty('--mw-target-x');\n this.element.style.removeProperty('--mw-target-y');\n this.element.style.removeProperty('--mw-target-scale');\n }\n\n /**\n * Bring window to front of z-order.\n */\n bringToFront() {\n _zIndexCounter++;\n this.zIndex = Math.min(BASE_Z_INDEX + _zIndexCounter, MAX_Z_INDEX);\n if (this.element) {\n this.element.style.zIndex = this.zIndex.toString();\n }\n if (this.backdropElement) {\n this.backdropElement.style.zIndex = (this.zIndex - 1).toString();\n }\n }\n\n /**\n * Update window title.\n */\n setTitle(title) {\n this.title = title;\n if (this.element) {\n const titleEl = this.element.querySelector('.twm-managed-window__title');\n if (titleEl) titleEl.textContent = title;\n }\n }\n\n // ========== Private Methods ==========\n\n _build() {\n // Create backdrop for modal windows\n if (this.modal) {\n this.backdropElement = document.createElement('div');\n this.backdropElement.className = 'twm-managed-window__backdrop';\n // Apply backdrop overrides as inline styles only when the caller\n // set them; otherwise the CSS default governs (single source of\n // truth for the default look).\n if (this.backdropBlur !== undefined && this.backdropBlur !== null) {\n this.backdropElement.style.backdropFilter =\n this.backdropBlur > 0 ? `blur(${this.backdropBlur}px)` : 'none';\n }\n if (this.backdropOpacity !== undefined && this.backdropOpacity !== null) {\n this.backdropElement.style.background =\n `rgba(0, 0, 0, ${this.backdropOpacity})`;\n }\n }\n\n // Create window element\n this.element = document.createElement('div');\n this.element.className = 'twm-managed-window';\n if (!this.canDrag) {\n this.element.classList.add('twm-managed-window--no-drag');\n }\n if (this.modal) {\n this.element.classList.add('twm-managed-window--modal');\n }\n this.element.setAttribute('data-window-id', this.id);\n\n // Top bar\n const topbar = document.createElement('div');\n topbar.className = 'twm-managed-window__topbar';\n\n // Icon\n const icon = document.createElement('span');\n icon.className = 'twm-managed-window__icon material-symbols-outlined';\n icon.textContent = this.icon;\n\n const title = document.createElement('div');\n title.className = 'twm-managed-window__title';\n title.textContent = this.title;\n\n const buttons = document.createElement('div');\n buttons.className = 'twm-managed-window__buttons';\n\n // C6. Extra titlebar buttons, immediately LEFT of minimize \u2014 which is\n // exactly where the concept asks for the table cogwheel. Added before\n // the built-in buttons so the ordering is positional rather than\n // something each caller has to get right.\n for (const spec of this.titlebarButtons) {\n const btn = document.createElement('button');\n btn.className = 'twm-managed-window__btn twm-managed-window__btn--custom';\n btn.type = 'button';\n btn.title = spec.title || '';\n if (spec.icon) {\n const glyph = document.createElement('span');\n glyph.className = 'material-symbols-outlined';\n glyph.textContent = spec.icon;\n btn.appendChild(glyph);\n } else {\n btn.textContent = spec.label || '';\n }\n btn.addEventListener('click', (e) => {\n e.stopPropagation();\n spec.onClick?.(this, e);\n });\n buttons.appendChild(btn);\n }\n\n // Minimize button (optional)\n if (this.canMinimize) {\n const minBtn = document.createElement('button');\n // BOTH SPELLINGS. The `twm-` prefix was missed on this modifier and\n // on `--maximize` when the component was vendored \u2014 the same slip\n // C13 found on the resize handles, where it meant no rule matched\n // either spelling. Nothing styles these two today, so nothing is\n // broken by it, but a consumer that wants to reach for one (the WM\n // hides minimize on a maximised window it promoted) should not have\n // to know which of the two conventions this particular button\n // landed on. The unprefixed name stays for whoever already queries\n // it; the prefixed one is the one to use.\n minBtn.className = 'twm-managed-window__btn '\n + 'twm-managed-window__btn--minimize managed-window__btn--minimize';\n minBtn.type = 'button';\n minBtn.innerHTML = '<svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\"><path d=\"M1 5h8\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/></svg>';\n minBtn.title = 'Minimize';\n minBtn.addEventListener('click', (e) => { e.stopPropagation(); this.minimize(); });\n buttons.appendChild(minBtn);\n }\n\n // Maximize button (optional)\n if (this.canMaximize) {\n const maxBtn = document.createElement('button');\n maxBtn.className = 'twm-managed-window__btn '\n + 'twm-managed-window__btn--maximize managed-window__btn--maximize';\n maxBtn.type = 'button';\n // R7. The square is the default and stays the default. A consumer\n // that redefined the gesture with `onMaximize` draws its own glyph\n // here rather than reaching into this markup afterwards \u2014 which is\n // what the WM used to do for its \"back to tile\" button, with four\n // internal class names and a silent failure if any of them moved.\n if (this.maximizeIcon) {\n const glyph = document.createElement('span');\n glyph.className = 'material-symbols-outlined';\n glyph.textContent = this.maximizeIcon;\n maxBtn.appendChild(glyph);\n } else {\n maxBtn.innerHTML = '<svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\"><rect x=\"1\" y=\"1\" width=\"8\" height=\"8\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/></svg>';\n }\n maxBtn.title = this.maximizeTitle;\n maxBtn.addEventListener('click', (e) => { e.stopPropagation(); this.toggleMaximize(); });\n buttons.appendChild(maxBtn);\n }\n\n // Close button\n const closeBtn = document.createElement('button');\n closeBtn.className = 'twm-managed-window__btn twm-managed-window__btn--close';\n closeBtn.type = 'button';\n closeBtn.innerHTML = '<svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\"><path d=\"M1 1l8 8M9 1l-8 8\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/></svg>';\n closeBtn.title = 'Close';\n closeBtn.addEventListener('click', (e) => { e.stopPropagation(); this.close(); });\n buttons.appendChild(closeBtn);\n\n topbar.appendChild(icon);\n topbar.appendChild(title);\n topbar.appendChild(buttons);\n\n // Content container\n this.contentContainer = document.createElement('div');\n this.contentContainer.className = 'twm-managed-window__content';\n\n if (this.content instanceof HTMLElement) {\n this.contentContainer.appendChild(this.content);\n } else if (typeof this.content === 'function') {\n const rendered = this.content();\n if (rendered instanceof HTMLElement) {\n this.contentContainer.appendChild(rendered);\n }\n }\n\n this.element.appendChild(topbar);\n this.element.appendChild(this.contentContainer);\n\n // Resize handles (only if resizable)\n if (this.canResize) {\n this._addResizeHandles();\n }\n\n // Event listeners\n topbar.addEventListener('pointerdown', (e) => this._onTopbarPointerDown(e));\n if (this.canMaximize) {\n // C26. THE CLAIMED VERB, which under the window manager is \"back to\n // tile\". This went the other way first, on a reading of *\"double\n // click ... always to maximize window\"* as the geometric maximise \u2014\n // the product owner then said *\"double click on a managed window\n // showing a table needs to maximize to tile\"*, which is the claim.\n // `claimable: false` stays on the method for a consumer that wants\n // the rectangle on a window whose maximise is claimed; nothing\n // INSIDE the library passes it, and this binding never has.\n //\n // C28 is what makes this safe for a window with no tile to go back\n // to: the claim may DECLINE \u2014 `bringBackWindow` returns false for a\n // window the WM never adopted \u2014 and `toggleMaximize` then falls\n // through to the geometric maximise. So the gesture always does\n // something, which is the whole complaint it was reported under.\n topbar.addEventListener('dblclick', () => this.toggleMaximize());\n }\n this.element.addEventListener('pointerdown', () => this.bringToFront());\n }\n\n _addResizeHandles() {\n const directions = ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'];\n for (const dir of directions) {\n const handle = document.createElement('div');\n // BOTH classes carry the `twm-` prefix. The per-direction one was\n // left unprefixed when the framework was namespaced, and no rule for\n // either spelling exists \u2014 so all eight handles were\n // `position: absolute` with no size and no placement, and every\n // window in every consumer was unresizable. The legacy unprefixed\n // class is kept alongside for any embedder still selecting on it.\n handle.className = `twm-managed-window__resize `\n + `twm-managed-window__resize--${dir} managed-window__resize--${dir}`;\n handle.addEventListener('pointerdown', (e) => this._onResizePointerDown(e, dir));\n this.element.appendChild(handle);\n }\n }\n\n /** C2. The bounds rectangle this window is clamped inside.\n *\n * ONE computation replacing four inline copies. The `document.body` case \u2014\n * every call site that exists today \u2014 reduces to the previous expression\n * BY SUBSTITUTION, not by \"should be equivalent\":\n *\n * minX = 0\n * minY = TOP_BAR_HEIGHT\n * width = window.innerWidth\n * height = window.innerHeight - TOP_BAR_HEIGHT - BOTTOM_BAR_HEIGHT\n *\n * so, substituting into the clamps below:\n *\n * maxWidth = width = window.innerWidth \u2713\n * maxHeight = height = innerHeight - TOP - BOTTOM \u2713\n * maxX = max(minX, minX + width - w) = max(0, innerWidth - w) \u2713\n * maxY = max(minY, minY + height - h) = max(TOP, innerHeight - BOTTOM - h) \u2713\n * x = max(minX, min(x, maxX)) = max(0, min(x, maxX)) \u2713\n * y = max(minY, min(y, maxY)) = max(TOP, min(y, maxY)) \u2713\n *\n * EcoAgent's and EcoSim's modals depend on that arithmetic; prove the\n * equivalence in review by substitution rather than by testing.\n */\n _bounds() {\n // R12. Mid-escape the container is the drag HOST \u2014 the root, which\n // contains the panels as well as the tiles. `dragBounds` narrows it to\n // the part a window belongs in; without it the bottom edge is the\n // root's, and the bottom panel is inside that.\n //\n // R13. AND FOR AS LONG AS THE WINDOW IS LEFT THERE. A drop the snap\n // controller CLAIMS ends the escape WITHOUT putting the window back\n // (`_endDragEscape({ taken: true })` returns before re-parenting), and\n // the window manager's aero-snap maximise is exactly that case: the\n // window stays a child of the host, filling the part of it\n // `dragBounds` describes. `_escapeOrigin` is null by then, so the test\n // as it stood stopped applying the moment the drag ended \u2014 and the next\n // re-clamp, which the container's ResizeObserver performs on any\n // splitter drag, would re-read the bounds as the WHOLE ROOT and grow\n // the window out over the docked panels.\n //\n // What the two cases share is not \"mid-drag\", it is THE CONTAINER IS\n // THE DRAG HOST \u2014 never true of a window sitting in its own pane, and\n // true of every window the host is currently holding. `dragHost` is\n // resolved rather than remembered for the same reason `_beginDragEscape`\n // resolves it: it is a function so that it can outlive any one tile.\n if (this.dragBounds) {\n const host = typeof this.dragHost === 'function'\n ? this.dragHost(this) : this.dragHost;\n if (this._escapeOrigin || (host && host === this.container)) {\n const b = this.dragBounds(this);\n if (b && b.width > 0 && b.height > 0) return b;\n }\n }\n if (this.container) {\n // Contained: coordinates are relative to the container, which is a\n // positioned ancestor, so the bars do not apply.\n return {\n minX: 0,\n minY: 0,\n width: this.container.clientWidth,\n height: this.container.clientHeight,\n };\n }\n return {\n minX: 0,\n minY: TOP_BAR_HEIGHT,\n width: window.innerWidth,\n height: window.innerHeight - TOP_BAR_HEIGHT - BOTTOM_BAR_HEIGHT,\n };\n }\n\n _applyPosition() {\n if (!this.element) return;\n\n const bounds = this._bounds();\n const maxWidth = bounds.width;\n const maxHeight = bounds.height;\n\n // Clamp width and height to the bounds (but respect minWidth/minHeight)\n this.width = Math.max(this.minWidth, Math.min(this.width, maxWidth));\n this.height = Math.max(this.minHeight, Math.min(this.height, maxHeight));\n\n // Ensure the window is within the bounds rectangle\n const maxX = Math.max(bounds.minX, bounds.minX + maxWidth - this.width);\n const maxY = Math.max(bounds.minY, bounds.minY + maxHeight - this.height);\n this.x = Math.max(bounds.minX, Math.min(this.x, maxX));\n this.y = Math.max(bounds.minY, Math.min(this.y, maxY));\n\n this.element.style.left = `${this.x}px`;\n this.element.style.top = `${this.y}px`;\n this.element.style.width = `${this.width}px`;\n this.element.style.height = `${this.height}px`;\n }\n\n /** C12. Re-clamp on demand.\n *\n * The ResizeObserver below covers a container that changes size on its\n * own. A container that changes size because a SIBLING did \u2014 a splitter\n * drag moves two panels at once \u2014 needs the caller to say so, and a\n * private `_applyPosition` is not something a caller may reach for. */\n reclamp() {\n this._applyPosition();\n }\n\n /** C12. Move this window into a different container.\n *\n * Re-parents the element and re-clamps against the new bounds, because a\n * window carried into a narrower region would otherwise keep coordinates\n * that put it outside and out of reach. The ResizeObserver follows the new\n * container, or the old one would keep driving the clamp.\n */\n moveTo(container) {\n if (!container || container === this.container) return false;\n this.container = container;\n if (this.element) {\n container.appendChild(this.element);\n this.element.classList.toggle('twm-managed-window--contained', true);\n if (this.backdropElement) container.appendChild(this.backdropElement);\n }\n this._resizeObserver?.disconnect();\n this._resizeObserver = null;\n this._installContainerResizeObserver();\n // A snapped window's rectangle belonged to the old container, so the\n // snap does not survive the move; its pre-snap size does.\n this._preSnapState = null;\n this.element?.classList.remove('twm-managed-window--snapped');\n if (this.isMaximized) {\n const bounds = this._bounds();\n this.x = bounds.minX; this.y = bounds.minY;\n this.width = bounds.width; this.height = bounds.height;\n }\n this._applyPosition();\n window.dispatchEvent(new CustomEvent('managed-window-moved', {\n detail: { id: this.id, container },\n }));\n return true;\n }\n\n /** R1/R3. The container this drag started in, or null when the drag did\n * not have to escape one (an uncontained window, or no `dragHost`).\n *\n * Public because the decision that needs it is not this component's: a snap\n * controller has to know which pane is HOME so that moving a window around\n * inside the pane it already lives in arms nothing. That was the complaint\n * about the old behaviour \u2014 in-pane, virtually any movement was a dock. */\n get dragOrigin() { return this._escapeOrigin; }\n\n /** R1. Take the window out of its container for the duration of a drag.\n *\n * A contained window is clipped by its container (`.twm-leaf` is\n * `overflow: hidden`), so without this it cannot be dragged one pixel past\n * the pane it lives in \u2014 the gesture the tiling model is built on is not\n * merely awkward, it is invisible. The window is re-parented into the\n * wider `dragHost` and its coordinates are converted so the rectangle on\n * screen does not move: same viewport pixels, different reference frame.\n *\n * Deliberately NOT `moveTo` (C12), which is the same re-parent for a\n * different purpose. `moveTo` re-CLAMPS into the new container without\n * converting anything, which is right when a window is carried between\n * regions by a menu and wrong here \u2014 the window would jump out from under\n * the pointer at the first millimetre of every drag. It also drops the snap\n * and announces `managed-window-moved`, and an escape is neither a move the\n * user asked for nor one anybody should hear about: it is undone on\n * release, either by `_endDragEscape` or by the drop taking the window.\n */\n _beginDragEscape() {\n if (this._escapeOrigin || !this.container || !this.dragHost) return false;\n const host = typeof this.dragHost === 'function'\n ? this.dragHost(this) : this.dragHost;\n // CONTAINS, not merely \"different\". The host is meant to be the wider\n // box the window may now cross; anything else would teleport it.\n if (!host || host === this.container || !host.contains(this.container)) return false;\n const origin = this.container;\n this._escapeOrigin = origin;\n this._reparentPreservingPosition(host);\n return true;\n }\n\n /** R1. Put the window back into a container when the drag ends.\n *\n * `taken` means the drop was claimed by the snap controller: the window is\n * being docked into a tree and closed, so re-parenting it into a pane it is\n * about to leave would be work done for a frame nobody sees.\n *\n * Otherwise it goes back where the drag started \u2014 including when the drag\n * ended over nothing (the rail, the gap between two panes, off the edge).\n * A window that lives in a pane has to end every drag in SOME pane, and the\n * one it came from is the only answer that never surprises anyone. The one\n * case that cannot be honoured is an origin that stopped being in the\n * document mid-drag \u2014 a repaint rebuilt the leaf wrap \u2014 and there the\n * window stays on the host rather than being orphaned into a detached\n * node; the WM's own re-home pass adopts it on the next render.\n */\n _endDragEscape({ taken = false } = {}) {\n const origin = this._escapeOrigin;\n this._escapeOrigin = null;\n this.element?.classList.remove('twm-managed-window--detached');\n if (!origin || taken) return false;\n if (!origin.isConnected) return false;\n this._reparentPreservingPosition(origin);\n return true;\n }\n\n /** Move the element into `next` and rewrite `x`/`y` so it occupies the same\n * viewport rectangle it did a moment ago.\n *\n * `x`/`y` are written against the containing block, which for an absolutely\n * positioned child is the PADDING box \u2014 hence `clientLeft`/`clientTop`,\n * which are the border widths `getBoundingClientRect` includes and the\n * offset does not. `scrollLeft`/`scrollTop` are zero for every box either\n * side of this today (panes and the WM root both clip rather than scroll)\n * and are in the expression anyway: the day one of them scrolls, this is\n * the line that would be silently half a screen out.\n *\n * The container's ResizeObserver is deliberately NOT re-pointed. It exists\n * to re-clamp (C4), it re-clamps against whichever container is current\n * because `_applyPosition` reads `_bounds()` afresh, and an escape is\n * transient by construction \u2014 undone on release, or ended by the window\n * closing into a tree. `moveTo`, which is a permanent move, does re-point\n * it, and that difference is the reason these are two methods.\n */\n _reparentPreservingPosition(next) {\n const prev = this.container;\n if (!next || next === prev) return false;\n if (this.element && prev) {\n const from = prev.getBoundingClientRect();\n const to = next.getBoundingClientRect();\n this.x += (from.left + prev.clientLeft - prev.scrollLeft)\n - (to.left + next.clientLeft - next.scrollLeft);\n this.y += (from.top + prev.clientTop - prev.scrollTop)\n - (to.top + next.clientTop - next.scrollTop);\n }\n this.container = next;\n if (this.element) {\n next.appendChild(this.element);\n // Still contained \u2014 a drag host is another box on the page, not the\n // page \u2014 so the `position: absolute` modifier stays exactly as it\n // was. Toggled rather than assumed, because a window whose container\n // was null cannot reach here but a future caller might.\n this.element.classList.toggle('twm-managed-window--contained', !!next);\n if (this.backdropElement) next.appendChild(this.backdropElement);\n }\n this._applyPosition();\n return true;\n }\n\n /** R3. HALF TRANSPARENT THE MOMENT IT LEAVES THE TILE IT CAME FROM.\n *\n * The signal that releasing now will dock the window somewhere, and the\n * complement of the rule that keeps the origin pane silent: inside it, this\n * is just a window being moved and it stays opaque. Only for a window with\n * a snap controller \u2014 nothing else on the page can be docked, so nothing\n * else has anything to promise.\n *\n * A window that never had a pane (opened with Alt+N, floating over the\n * whole root) has no \"inside\" to be in, so it reads as detached for the\n * whole drag. That is not a special case being papered over: every pane\n * under it genuinely is foreign, and every drop on one genuinely docks.\n */\n _syncDragTransparency(e) {\n if (!this.snapController || !this.element) return;\n const origin = this._escapeOrigin;\n let outside = true;\n if (origin && origin.isConnected) {\n const r = origin.getBoundingClientRect();\n outside = e.clientX < r.left || e.clientX > r.right\n || e.clientY < r.top || e.clientY > r.bottom;\n }\n this.element.classList.toggle('twm-managed-window--detached', outside);\n }\n\n /** C4. Re-clamp when the container resizes.\n *\n * `managed_window.js` has NO resize listener at all today: a viewport\n * resize simply leaves windows where they were until the next pointer\n * move re-clamps them. That is survivable for the viewport, which resizes\n * rarely, and not for a panel, which resizes every time someone drags a\n * splitter \u2014 a window would end up outside its own panel and unreachable.\n */\n _installContainerResizeObserver() {\n if (!this.container || this._resizeObserver) return;\n this._resizeObserver = new ResizeObserver(() => {\n if (this.isMaximized) {\n const bounds = this._bounds();\n this.x = bounds.minX;\n this.y = bounds.minY;\n this.width = bounds.width;\n this.height = bounds.height;\n }\n this._applyPosition();\n });\n this._resizeObserver.observe(this.container);\n }\n\n _teardownContainerResizeObserver() {\n this._resizeObserver?.disconnect();\n this._resizeObserver = null;\n }\n\n _restoreState() {\n const bounds = this._bounds();\n const maxWidth = bounds.width;\n const maxHeight = bounds.height;\n\n // Modal windows always center on screen - never restore saved position\n const saved = this.modal ? null : _getWindowState(this.id);\n if (saved) {\n this.x = saved.x ?? this.x;\n this.y = saved.y ?? this.y;\n // Clamp restored dimensions to current viewport\n this.width = Math.min(saved.width ?? this.width, maxWidth);\n this.height = Math.min(saved.height ?? this.height, maxHeight);\n this.isMaximized = saved.maximized ?? false;\n\n if (this.isMaximized && this.canMaximize) {\n this._preMaximizeState = { x: saved.x, y: saved.y, width: saved.width, height: saved.height };\n this.x = bounds.minX;\n this.y = bounds.minY;\n this.width = maxWidth;\n this.height = maxHeight;\n }\n } else {\n // Center on screen (between top and bottom bars)\n this.x = Math.max(0, (maxWidth - this.width) / 2);\n this.y = Math.max(TOP_BAR_HEIGHT, TOP_BAR_HEIGHT + (maxHeight - this.height) / 2);\n }\n }\n\n _saveCurrentState() {\n // Modal windows always center - no need to persist position\n if (this.modal) return;\n\n _setWindowState(this.id, {\n x: this._preMaximizeState?.x ?? this.x,\n y: this._preMaximizeState?.y ?? this.y,\n width: this._preMaximizeState?.width ?? this.width,\n height: this._preMaximizeState?.height ?? this.height,\n maximized: this.isMaximized,\n });\n }\n\n // ========== Drag Handling ==========\n\n _onTopbarPointerDown(e) {\n // Don't start drag if clicking on buttons\n if (e.target.closest('.twm-managed-window__buttons')) return;\n if (this.isMaximized) return;\n if (!this.canDrag) return;\n\n e.preventDefault();\n // Picking up a SNAPPED window restores the size it had before, centred\n // under the pointer \u2014 the same gesture Windows uses, and the reason a\n // snap does not have to be undone through a menu.\n if (this.snap && this._preSnapState) {\n const grabRatio = this.width ? (e.clientX - this.x) / this.width : 0.5;\n this.unsnap();\n this.x = Math.round(e.clientX - this.width * grabRatio);\n this._applyPosition();\n }\n // \u2550\u2550 C28. THE ESCAPE WAITS FOR MOVEMENT, AND THAT IS THE WHOLE OF\n // WHY DOUBLE-CLICKING A TITLE BAR DID NOTHING \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n //\n // R1 escaped the pane HERE, on pointerdown, before the pointer had\n // moved a pixel \u2014 so every press on a title bar tore the window element\n // out of `.tbl-canvas-pane`, appended it to the WM root, and put it\n // back on release. Two DOM removals per click, for a click.\n //\n // Blink and Gecko both drop the pending click when the element the\n // press landed on leaves the document between press and release:\n // `MouseEventManager::NodeWillBeRemoved` clears `mouse_down_element_`,\n // and `click` is dispatched to the common ancestor of that element and\n // the release target \u2014 with it null, no `click` is dispatched at all,\n // and `dblclick`, which counts clicks, never comes. So the `dblclick`\n // listener eleven lines below `_addResizeHandles` has never once fired\n // on a CONTAINED window in a real browser. Reported twice as *\"double\n // click does not maximize to tile\"*, and re-reading the listener could\n // not find it: the listener is correct, the gesture never reaches it.\n //\n // jsdom cannot see this \u2014 it has no click-count model and a test\n // dispatches `dblclick` directly \u2014 which is why every existing check\n // says the gesture works. The assertion that CAN see it is the one\n // about the mechanism: a press with no movement must leave the element\n // where it found it, and `web/js/shell/window_lifecycle.test.mjs`\n // asserts exactly that.\n //\n // Deferring costs nothing the escape was buying. R1 exists so a\n // contained window can be dragged past the pane that clips it, and\n // nothing is clipped until something moves; `_onPointerMove` performs\n // it on the first movement and corrects the drag origin by the same\n // delta `_reparentPreservingPosition` applied, so the window still\n // tracks the pointer exactly. `_onPointerUp` already tolerates a drag\n // that never escaped \u2014 `_endDragEscape` returns early with no origin.\n this._dragState = {\n startX: e.clientX,\n startY: e.clientY,\n startWinX: this.x,\n startWinY: this.y,\n };\n\n document.addEventListener('pointermove', this._boundOnPointerMove);\n document.addEventListener('pointerup', this._boundOnPointerUp);\n // A cancelled pointer never produces a `pointerup` \u2014 a touch turning\n // into a browser gesture, the tab losing the pointer, a device\n // disconnecting. Before C15 that left a window mid-drag, which the next\n // pointerdown corrected; now it can also leave a `position: fixed`\n // preview rectangle painted over the page with nothing to remove it.\n document.addEventListener('pointercancel', this._boundOnPointerUp);\n }\n\n _onPointerMove(e) {\n if (this._dragState) {\n // C28. THE ESCAPE, at the first movement rather than at the press \u2014\n // see `_onTopbarPointerDown` for the click it used to eat.\n //\n // `_reparentPreservingPosition` rewrites `this.x`/`this.y` into the\n // host's reference frame so the rectangle on screen does not move.\n // `_dragState.startWinX` was recorded in the PANE's frame a moment\n // ago and is the origin every subsequent delta is added to, so it\n // has to make the same journey \u2014 otherwise the window jumps by the\n // offset between the two boxes at the first millimetre of the drag,\n // which is the exact failure R1's \"out of the pane FIRST\" comment\n // was written to prevent. Same correction, applied where the escape\n // now happens.\n if (!this._escapeOrigin) {\n const fromX = this.x;\n const fromY = this.y;\n if (this._beginDragEscape()) {\n this._dragState.startWinX += this.x - fromX;\n this._dragState.startWinY += this.y - fromY;\n }\n }\n const dx = e.clientX - this._dragState.startX;\n const dy = e.clientY - this._dragState.startY;\n this.x = this._dragState.startWinX + dx;\n this.y = this._dragState.startWinY + dy;\n this._applyPosition();\n this._syncDragTransparency(e);\n if (this.snap) this._updateSnapZone(e);\n } else if (this._resizeState) {\n this._handleResize(e);\n }\n }\n\n _onPointerUp() {\n // The snap is applied BEFORE the state is saved, so what is persisted is\n // where the window ended up rather than where it was let go.\n let taken = false;\n if (this._dragState && this.snap && this._snapZone) {\n // C15. A controller answers instead of `_applySnap` when there is\n // one. It may answer asynchronously (a three-way choice is a menu),\n // which is why a truthy return also transfers ownership of the\n // preview \u2014 clearing it here would blank the affordance the menu is\n // still describing.\n if (this.snapController) {\n // Guarded, exactly as `probe` is. `commit` is not a leaf call \u2014\n // it reaches all the way into somebody else's tree mutation and\n // back out through a window close \u2014 and an exception escaping\n // here would leave the drag listeners attached and the window\n // following the pointer for ever.\n try {\n taken = this.snapController.commit?.(this._snapProbe, this) ?? false;\n } catch (err) {\n console.error('[managed-window] snap commit threw', err);\n taken = false;\n }\n } else {\n this._applySnap(this._snapZone);\n }\n }\n if (!taken) this.clearSnapPreview();\n this._snapZone = null;\n // R1. Back into a container before `_saveCurrentState`, or what is\n // persisted is a rectangle in the drag host's space that will be read\n // back as if it were the pane's.\n if (this._dragState) this._endDragEscape({ taken });\n if (this._dragState || this._resizeState) {\n this._saveCurrentState();\n }\n this._dragState = null;\n this._resizeState = null;\n document.removeEventListener('pointermove', this._boundOnPointerMove);\n document.removeEventListener('pointerup', this._boundOnPointerUp);\n document.removeEventListener('pointercancel', this._boundOnPointerUp);\n }\n\n // ========== C11. Aero Snap ==========\n\n /** The rectangle a zone would give this window, in the SAME coordinate\n * space `_applyPosition` writes \u2014 container-relative when contained,\n * viewport-relative otherwise. One source for the preview and the apply,\n * so the preview cannot promise a rectangle the drop does not deliver. */\n _snapRect(zone) {\n const b = this._bounds();\n const half = Math.round(b.width / 2);\n switch (zone) {\n case 'top': return { x: b.minX, y: b.minY, width: b.width, height: b.height };\n case 'left': return { x: b.minX, y: b.minY, width: half, height: b.height };\n case 'right': return { x: b.minX + b.width - half, y: b.minY,\n width: half, height: b.height };\n default: return null;\n }\n }\n\n /** Which zone the POINTER is in \u2014 not the window. Using the window's own\n * edge would make a wide window snap the moment it is picked up, because\n * it is already touching the edge it did not move towards. */\n _zoneFor(e) {\n const host = this.container || document.documentElement;\n const rect = this.container\n ? host.getBoundingClientRect()\n : { left: 0, top: 0, width: window.innerWidth, height: window.innerHeight };\n const x = e.clientX - rect.left;\n const y = e.clientY - rect.top;\n // Outside the host entirely: no zone. Dragging a contained window over\n // the page chrome must not snap it to the container's edge.\n if (x < 0 || y < 0 || x > rect.width || y > rect.height) return null;\n if (y <= SNAP_EDGE) return 'top';\n if (x <= SNAP_EDGE) return 'left';\n if (x >= rect.width - SNAP_EDGE) return 'right';\n return null;\n }\n\n _updateSnapZone(e) {\n if (this.snapController) { this._updateControlledSnapZone(e); return; }\n const zone = this._zoneFor(e);\n if (zone === this._snapZone) return;\n this._snapZone = zone;\n if (!zone) { this.clearSnapPreview(); return; }\n this.showSnapPreview(this._snapRect(zone));\n }\n\n /** C15. The controller's half of `_updateSnapZone`. The probe runs on every\n * move because the rectangle can change while the KEY does not \u2014 a tile\n * resized underneath the pointer, a menu re-previewing the same zone \u2014 but\n * the DOM is only touched when something actually differs. */\n _updateControlledSnapZone(e) {\n let probe = null;\n try { probe = this.snapController.probe?.(e, this) ?? null; }\n catch (err) { console.warn('[managed-window] snap probe threw', err); }\n this._snapProbe = probe;\n this._snapZone = probe?.key ?? null;\n if (!probe?.rect) { this.clearSnapPreview(); return; }\n this.showSnapPreview(probe.rect, { viewport: true });\n }\n\n /** Paint the drag affordance. `rect` is container-relative by default \u2014\n * the same space `_applyPosition` writes \u2014 and viewport-relative for a\n * controller, whose rectangles come from hit-testing other people's DOM.\n * Public because a controller that survives the pointer-up owns it. */\n showSnapPreview(rect, { viewport = false } = {}) {\n if (!rect) { this.clearSnapPreview(); return; }\n const host = viewport ? document.body : (this.container || document.body);\n if (!this._snapPreviewEl) {\n this._snapPreviewEl = document.createElement('div');\n // `aria-hidden`: it is a drag affordance, not content.\n this._snapPreviewEl.setAttribute('aria-hidden', 'true');\n }\n this._snapPreviewEl.className =\n `twm-snap-preview${viewport ? ' twm-snap-preview--viewport' : ''}`;\n const left = rect.left ?? rect.x;\n const top = rect.top ?? rect.y;\n Object.assign(this._snapPreviewEl.style, {\n left: `${left}px`, top: `${top}px`,\n width: `${rect.width}px`, height: `${rect.height}px`,\n });\n if (this._snapPreviewEl.parentNode !== host) host.appendChild(this._snapPreviewEl);\n }\n\n clearSnapPreview() {\n this._snapPreviewEl?.remove();\n this._snapProbe = null;\n }\n\n /** @deprecated retained so nothing inside this file has to change spelling\n * in the same commit that adds the public one. */\n _clearSnapPreview() { this.clearSnapPreview(); }\n\n /** Applied on release. The pre-snap geometry is remembered so dragging the\n * window off an edge restores the size it had \u2014 a snap that eats the\n * original size makes the gesture one-way and people stop using it. */\n _applySnap(zone) {\n const rect = this._snapRect(zone);\n if (!rect) return;\n if (!this._preSnapState) {\n this._preSnapState = { x: this._dragState.startWinX, y: this._dragState.startWinY,\n width: this.width, height: this.height };\n }\n this.x = rect.x;\n this.y = rect.y;\n this.width = rect.width;\n this.height = rect.height;\n this._applyPosition();\n this.element?.classList.add('twm-managed-window--snapped');\n window.dispatchEvent(new CustomEvent('managed-window-snapped', {\n detail: { id: this.id, zone, container: this.container },\n }));\n }\n\n /** Restore the geometry a snap replaced. Called when a snapped window is\n * picked up again, which is the gesture that means \"un-snap\". */\n unsnap() {\n if (!this._preSnapState) return false;\n const { x, y, width, height } = this._preSnapState;\n this._preSnapState = null;\n this.x = x; this.y = y; this.width = width; this.height = height;\n this._applyPosition();\n this.element?.classList.remove('twm-managed-window--snapped');\n return true;\n }\n\n // ========== Resize Handling ==========\n\n _onResizePointerDown(e, direction) {\n if (this.isMaximized) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n this._resizeState = {\n direction,\n startX: e.clientX,\n startY: e.clientY,\n startWinX: this.x,\n startWinY: this.y,\n startWidth: this.width,\n startHeight: this.height,\n };\n\n document.addEventListener('pointermove', this._boundOnPointerMove);\n document.addEventListener('pointerup', this._boundOnPointerUp);\n }\n\n _handleResize(e) {\n const state = this._resizeState;\n if (!state) return;\n\n const dx = e.clientX - state.startX;\n const dy = e.clientY - state.startY;\n const dir = state.direction;\n\n // Calculate max available dimensions\n const maxWidth = window.innerWidth;\n const maxHeight = window.innerHeight - TOP_BAR_HEIGHT - BOTTOM_BAR_HEIGHT;\n\n let newX = state.startWinX;\n let newY = state.startWinY;\n let newW = state.startWidth;\n let newH = state.startHeight;\n\n // Handle horizontal resize\n if (dir.includes('e')) {\n newW = Math.max(this.minWidth, Math.min(state.startWidth + dx, maxWidth - newX));\n }\n if (dir.includes('w')) {\n const maxDx = state.startWidth - this.minWidth;\n const actualDx = Math.min(dx, maxDx);\n newX = Math.max(0, state.startWinX + actualDx);\n newW = state.startWidth - (newX - state.startWinX);\n }\n\n // Handle vertical resize\n if (dir.includes('s')) {\n newH = Math.max(this.minHeight, Math.min(state.startHeight + dy, maxHeight - (newY - TOP_BAR_HEIGHT)));\n }\n if (dir.includes('n')) {\n const maxDy = state.startHeight - this.minHeight;\n const actualDy = Math.min(dy, maxDy);\n newY = Math.max(TOP_BAR_HEIGHT, state.startWinY + actualDy);\n newH = state.startHeight - (newY - state.startWinY);\n }\n\n this.x = newX;\n this.y = newY;\n this.width = newW;\n this.height = newH;\n this._applyPosition();\n }\n\n // ========== Keyboard Handling ==========\n\n _onKeyDown(e) {\n if (!this.isVisible || this.isMinimized) return;\n // Only the top-most window owns global keydowns \u2014 otherwise a\n // background window would steal focus from an open modal.\n const topWindow = Array.from(_activeWindows.values())\n .filter(w => w.isVisible && !w.isMinimized)\n .sort((a, b) => b.zIndex - a.zIndex)[0];\n if (topWindow !== this) return;\n\n if (e.key === 'Escape') {\n this.close();\n return;\n }\n // Focus trap for modals: Tab and Shift+Tab cycle through the\n // focusable elements inside the modal's frame instead of\n // escaping to underlying tiles. Without this, Tab moves the\n // active element into the background \u2014 bad UX, and a\n // genuine WCAG focus-trap violation for accessibility tools.\n if (e.key === 'Tab' && this.modal && this.element) {\n const focusables = _collectFocusable(this.element);\n if (focusables.length === 0) {\n e.preventDefault();\n return;\n }\n const first = focusables[0];\n const last = focusables[focusables.length - 1];\n const active = document.activeElement;\n if (e.shiftKey) {\n if (active === first || !this.element.contains(active)) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (active === last || !this.element.contains(active)) {\n e.preventDefault();\n first.focus();\n }\n }\n }\n }\n\n // ========== Static Methods ==========\n\n /**\n * Get a window by ID.\n */\n static get(id) {\n return _activeWindows.get(id) || null;\n }\n\n /**\n * Every window this class currently holds, newest last.\n *\n * `get`/`restore` answer about a window whose id you already have, which is\n * enough for a consumer reacting to an EVENT \u2014 it carries the id. It is not\n * enough for one that has to repaint from scratch: a taskbar rebuilt with\n * its pane has missed every event that came before it existed, and the only\n * honest source for \"which windows are minimised right now\" is the registry\n * itself. Returned as an array rather than the live map, so a consumer\n * iterating it cannot mutate what it is iterating.\n */\n static all() {\n return [..._activeWindows.values()];\n }\n\n /**\n * Restore a minimized window by ID.\n */\n static restore(id) {\n const win = _activeWindows.get(id);\n if (win && win.isMinimized) {\n win._restore();\n win.bringToFront();\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAqBA,IAAM,cAAc;AACpB,IAAM,eAAe;AACrB,IAAM,cAAc;AAMpB,IAAM,iBAAiB;AAC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AAS,KAAK,SAAS,KAAK,SAAS;AAC/C,YAAM,aAAa,kBAAkB,KAAK,OAAO;AACjD,UAAI,WAAW,WAAW,GAAG;AACzB,UAAE,eAAe;AACjB;AAAA,MACJ;AACA,YAAM,QAAQ,WAAW,CAAC;AAC1B,YAAM,OAAQ,WAAW,WAAW,SAAS,CAAC;AAC9C,YAAM,SAAS,SAAS;AACxB,UAAI,EAAE,UAAU;AACZ,YAAI,WAAW,SAAS,CAAC,KAAK,QAAQ,SAAS,MAAM,GAAG;AACpD,YAAE,eAAe;AACjB,eAAK,MAAM;AAAA,QACf;AAAA,MACJ,OAAO;AACH,YAAI,WAAW,QAAQ,CAAC,KAAK,QAAQ,SAAS,MAAM,GAAG;AACnD,YAAE,eAAe;AACjB,gBAAM,MAAM;AAAA,QAChB;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,IAAI,IAAI;AACX,WAAO,eAAe,IAAI,EAAE,KAAK;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,OAAO,MAAM;AACT,WAAO,CAAC,GAAG,eAAe,OAAO,CAAC;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,QAAQ,IAAI;AACf,UAAM,MAAM,eAAe,IAAI,EAAE;AACjC,QAAI,OAAO,IAAI,aAAa;AACxB,UAAI,SAAS;AACb,UAAI,aAAa;AAAA,IACrB;AAAA,EACJ;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -113,9 +113,12 @@ var ActionDropdown = class _ActionDropdown {
|
|
|
113
113
|
this.menuEl.hidden = false;
|
|
114
114
|
_ActionDropdown.position(this.trigger, this.menuEl);
|
|
115
115
|
requestAnimationFrame(() => {
|
|
116
|
-
this.menuEl
|
|
116
|
+
this.menuEl?.classList.add("visible");
|
|
117
117
|
});
|
|
118
118
|
this.trigger?.classList.add("twm-is-open");
|
|
119
|
+
if (this.trigger?.hasAttribute("aria-expanded")) {
|
|
120
|
+
this.trigger.setAttribute("aria-expanded", "true");
|
|
121
|
+
}
|
|
119
122
|
document.addEventListener("click", this._boundHandleDocumentClick, true);
|
|
120
123
|
document.addEventListener("keydown", this._boundHandleKeydown);
|
|
121
124
|
const firstOption = this.menuEl.querySelector(".twm-action-dropdown-option");
|
|
@@ -132,6 +135,9 @@ var ActionDropdown = class _ActionDropdown {
|
|
|
132
135
|
this.menuEl.hidden = true;
|
|
133
136
|
}
|
|
134
137
|
this.trigger?.classList.remove("twm-is-open");
|
|
138
|
+
if (this.trigger?.hasAttribute("aria-expanded")) {
|
|
139
|
+
this.trigger.setAttribute("aria-expanded", "false");
|
|
140
|
+
}
|
|
135
141
|
document.removeEventListener("click", this._boundHandleDocumentClick, true);
|
|
136
142
|
document.removeEventListener("keydown", this._boundHandleKeydown);
|
|
137
143
|
}
|
|
@@ -154,6 +160,8 @@ var ActionDropdown = class _ActionDropdown {
|
|
|
154
160
|
*/
|
|
155
161
|
_handleKeydown(e) {
|
|
156
162
|
if (e.key === "Escape") {
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
e.stopPropagation();
|
|
157
165
|
this.close();
|
|
158
166
|
this.trigger?.focus();
|
|
159
167
|
return;
|
|
@@ -273,4 +281,4 @@ var ActionDropdown = class _ActionDropdown {
|
|
|
273
281
|
export {
|
|
274
282
|
ActionDropdown
|
|
275
283
|
};
|
|
276
|
-
//# sourceMappingURL=chunk-
|
|
284
|
+
//# sourceMappingURL=chunk-O5OHMWBB.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ui/components/action_dropdown.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * action_dropdown.js\n *\n * Reusable dropdown component for action buttons (Add Scenario, Add Widget, etc).\n * Handles opening, closing, auto-positioning, keyboard navigation, and outside clicks.\n *\n * Auto-positioning: measures available viewport space around the trigger element\n * and picks the best direction (above/below) and alignment (left/right).\n * Adds scrolling when the menu would exceed available vertical space.\n */\n\n/** Viewport margin in px \u2014 dropdown stays this far from edges. */\nconst EDGE_MARGIN = 8;\n/** Gap between trigger and dropdown in px. */\nconst GAP = 8;\n\n/**\n * ActionDropdown - A reusable dropdown component with smart auto-positioning.\n *\n * Usage:\n * ```javascript\n * const dropdown = new ActionDropdown({\n * trigger: buttonElement,\n * options: [\n * { type: 'option1', label: 'Option 1', icon: 'icon_name', description: 'Description' },\n * { type: 'option2', label: 'Option 2', icon: 'icon_name', description: 'Description' }\n * ],\n * onSelect: (option) => console.log('Selected:', option.type),\n * });\n *\n * // Control programmatically\n * dropdown.open();\n * dropdown.close();\n * dropdown.toggle();\n * dropdown.destroy();\n * ```\n */\nexport class ActionDropdown {\n /**\n * @param {Object} config\n * @param {HTMLElement} config.trigger - Button element that triggers the dropdown\n * @param {Array} config.options - Array of option objects with { type, label, icon, description? }\n * @param {Function} config.onSelect - Callback when an option is selected\n * @param {string} [config.className=''] - Additional CSS class for the dropdown\n * @param {string} [config.menuId] - Optional ID for the menu element\n */\n constructor(config) {\n this.trigger = config.trigger;\n this.options = config.options || [];\n this.onSelect = config.onSelect;\n this.className = config.className || '';\n this.menuId = config.menuId;\n\n this.isOpen = false;\n this.menuEl = null;\n\n this._boundHandleDocumentClick = this._handleDocumentClick.bind(this);\n this._boundHandleKeydown = this._handleKeydown.bind(this);\n this._boundHandleTriggerClick = this._handleTriggerClick.bind(this);\n\n this._init();\n }\n\n /**\n * Initialize the dropdown.\n * @private\n */\n _init() {\n if (!this.trigger) {\n console.warn('[ActionDropdown] No trigger element provided');\n return;\n }\n\n this._createMenu();\n this.trigger.addEventListener('click', this._boundHandleTriggerClick);\n }\n\n /**\n * Create the dropdown menu element.\n * @private\n */\n _createMenu() {\n const menu = document.createElement('div');\n menu.className = `twm-action-dropdown-menu ${this.className}`.trim();\n menu.setAttribute('role', 'menu');\n menu.hidden = true;\n\n if (this.menuId) {\n menu.id = this.menuId;\n }\n\n this._renderOptions(menu);\n\n // Append to body so position:fixed works without clipping.\n document.body.appendChild(menu);\n\n this.menuEl = menu;\n }\n\n /**\n * Render option buttons into a container element.\n * @param {HTMLElement} container\n * @private\n */\n _renderOptions(container) {\n container.innerHTML = '';\n this.options.forEach((opt, index) => {\n const optionBtn = document.createElement('button');\n optionBtn.type = 'button';\n optionBtn.className = 'twm-action-dropdown-option';\n optionBtn.dataset.index = index;\n optionBtn.dataset.type = opt.type;\n optionBtn.setAttribute('role', 'menuitem');\n\n const iconHtml = opt.icon\n ? `<span class=\"material-symbols-outlined twm-option-icon\">${opt.icon}</span>`\n : '';\n\n const descHtml = opt.description\n ? `<span class=\"twm-option-desc\">${opt.description}</span>`\n : '';\n\n optionBtn.innerHTML = `\n ${iconHtml}\n <span class=\"option-text\">\n <span class=\"twm-option-label\">${opt.label}</span>\n ${descHtml}\n </span>\n `;\n\n optionBtn.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n this._selectOption(opt);\n });\n\n container.appendChild(optionBtn);\n });\n }\n\n /**\n * Handle trigger button click.\n * @param {MouseEvent} e\n * @private\n */\n _handleTriggerClick(e) {\n e.preventDefault();\n e.stopPropagation();\n this.toggle();\n }\n\n /**\n * Toggle the dropdown open/closed.\n * @param {boolean} [forceState] - Optional forced state\n */\n toggle(forceState) {\n const shouldOpen = typeof forceState === 'boolean' ? forceState : !this.isOpen;\n if (shouldOpen) {\n this.open();\n } else {\n this.close();\n }\n }\n\n /**\n * Open the dropdown with auto-positioning.\n */\n open() {\n if (this.isOpen || !this.menuEl) return;\n\n this.isOpen = true;\n this.menuEl.hidden = false;\n\n // Position against trigger\n ActionDropdown.position(this.trigger, this.menuEl);\n\n // Animate in.\n //\n // OPTIONAL CHAINING, AND IT IS LOAD-BEARING. This callback runs a frame\n // after `open()` returned, and `destroy()` sets `this.menuEl = null`\n // (see below) \u2014 so a dropdown that is opened and then destroyed inside\n // one frame threw an uncaught `TypeError: Cannot read properties of\n // null` out of an animation-frame callback, where no caller has a stack\n // to catch it. That is not a hypothetical: it is what a user does every\n // time they open a picker and then click something that unmounts the\n // pane around it, and it was reproduced eighteen times in one run of a\n // consumer's settings suite. Nothing is lost by skipping the class \u2014 the\n // element it would have been added to no longer exists.\n requestAnimationFrame(() => {\n this.menuEl?.classList.add('visible');\n });\n\n // Update trigger state\n this.trigger?.classList.add('twm-is-open');\n if (this.trigger?.hasAttribute('aria-expanded')) {\n this.trigger.setAttribute('aria-expanded', 'true');\n }\n\n // Add document listeners\n document.addEventListener('click', this._boundHandleDocumentClick, true);\n document.addEventListener('keydown', this._boundHandleKeydown);\n\n // Focus first option for keyboard accessibility\n const firstOption = this.menuEl.querySelector('.twm-action-dropdown-option');\n firstOption?.focus();\n }\n\n /**\n * Close the dropdown.\n */\n close() {\n if (!this.isOpen) return;\n\n this.isOpen = false;\n\n if (this.menuEl) {\n this.menuEl.classList.remove('visible');\n this.menuEl.hidden = true;\n }\n\n // Update trigger state. `aria-expanded` belongs on the TRIGGER and has\n // to be written on every close, not only on the ones a click caused \u2014\n // an embedder that synced it from its own click handler was announcing\n // an expanded menu to a screen reader every time Escape or an outside\n // click dismissed one. The component knows when it closed; nothing else\n // reliably does.\n this.trigger?.classList.remove('twm-is-open');\n if (this.trigger?.hasAttribute('aria-expanded')) {\n this.trigger.setAttribute('aria-expanded', 'false');\n }\n\n // Remove document listeners\n document.removeEventListener('click', this._boundHandleDocumentClick, true);\n document.removeEventListener('keydown', this._boundHandleKeydown);\n }\n\n /**\n * Handle document click (close on outside click).\n * @param {MouseEvent} e\n * @private\n */\n _handleDocumentClick(e) {\n if (!this.isOpen) return;\n\n // Don't close if clicking inside dropdown or trigger\n if (this.menuEl?.contains(e.target) || this.trigger?.contains(e.target)) {\n return;\n }\n\n this.close();\n }\n\n /**\n * Handle keyboard events.\n * @param {KeyboardEvent} e\n * @private\n */\n _handleKeydown(e) {\n if (e.key === 'Escape') {\n // AND NOBODY ELSE GETS IT. An open dropdown is the innermost thing\n // on screen, so Escape means \"close this\" and nothing further \u2014\n // but the event was left to bubble, and inside a `ManagedWindow`\n // (which binds its own Escape to dismiss) that meant one keystroke\n // closed the dropdown AND the dialog around it. The user loses a\n // form they were filling in because they changed their mind about\n // one field.\n e.preventDefault();\n e.stopPropagation();\n this.close();\n this.trigger?.focus();\n return;\n }\n\n // Arrow key navigation\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n this._navigateOptions(e.key === 'ArrowDown' ? 1 : -1);\n }\n }\n\n /**\n * Navigate options with arrow keys.\n * @param {number} direction - 1 for down, -1 for up\n * @private\n */\n _navigateOptions(direction) {\n const options = this.menuEl?.querySelectorAll('.twm-action-dropdown-option');\n if (!options || options.length === 0) return;\n\n const currentIndex = Array.from(options).findIndex(opt => opt === document.activeElement);\n let nextIndex = currentIndex + direction;\n\n if (nextIndex < 0) nextIndex = options.length - 1;\n if (nextIndex >= options.length) nextIndex = 0;\n\n options[nextIndex]?.focus();\n }\n\n /**\n * Handle option selection.\n * @param {Object} option - The selected option\n * @private\n */\n _selectOption(option) {\n this.close();\n\n if (this.onSelect) {\n this.onSelect(option);\n }\n }\n\n /**\n * Update the options dynamically.\n * @param {Array} newOptions - New options array\n */\n setOptions(newOptions) {\n this.options = newOptions;\n if (this.menuEl) {\n this._renderOptions(this.menuEl);\n }\n }\n\n /**\n * Destroy the dropdown and clean up.\n */\n destroy() {\n this.close();\n\n // Remove trigger listener\n this.trigger?.removeEventListener('click', this._boundHandleTriggerClick);\n\n // Remove menu element\n this.menuEl?.remove();\n this.menuEl = null;\n\n this.trigger = null;\n this.options = [];\n this.onSelect = null;\n }\n\n // =========================================================================\n // STATIC \u2014 shared auto-positioning for any trigger + menu pair\n // =========================================================================\n\n /**\n * Position a dropdown menu relative to a trigger element.\n * Uses `position: fixed` to avoid overflow clipping.\n * Picks above/below based on available space, aligns left/right edge,\n * and applies `max-height` + `overflow-y: auto` when the menu is taller\n * than the available space.\n *\n * @param {HTMLElement} trigger - The element the dropdown opens from\n * @param {HTMLElement} menu - The dropdown menu element to position\n */\n static position(trigger, menu) {\n if (!trigger || !menu) return;\n\n // Reset any prior inline position so natural size can be measured.\n Object.assign(menu.style, {\n position: 'fixed',\n top: 'auto',\n bottom: 'auto',\n left: 'auto',\n right: 'auto',\n maxHeight: '',\n overflowY: ''\n });\n\n const triggerRect = trigger.getBoundingClientRect();\n const menuRect = menu.getBoundingClientRect();\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n // \u2500\u2500 Vertical: prefer below, flip above if insufficient room \u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const spaceBelow = vh - triggerRect.bottom - GAP - EDGE_MARGIN;\n const spaceAbove = triggerRect.top - GAP - EDGE_MARGIN;\n\n let top;\n let maxHeight;\n\n if (menuRect.height <= spaceBelow) {\n // Fits below \u2014 use natural height.\n top = triggerRect.bottom + GAP;\n maxHeight = spaceBelow;\n } else if (menuRect.height <= spaceAbove) {\n // Fits above \u2014 use natural height.\n top = triggerRect.top - GAP - menuRect.height;\n maxHeight = spaceAbove;\n } else if (spaceBelow >= spaceAbove) {\n // More space below \u2014 scroll.\n top = triggerRect.bottom + GAP;\n maxHeight = spaceBelow;\n } else {\n // More space above \u2014 scroll.\n maxHeight = spaceAbove;\n top = EDGE_MARGIN;\n }\n\n // \u2500\u2500 Horizontal: align left-edge with trigger, flip if off-screen \u2500\u2500\n let left = triggerRect.left;\n\n if (left + menuRect.width > vw - EDGE_MARGIN) {\n // Align right edges instead.\n left = triggerRect.right - menuRect.width;\n }\n\n // Still off-screen? Clamp to edges.\n left = Math.max(EDGE_MARGIN, Math.min(left, vw - menuRect.width - EDGE_MARGIN));\n\n Object.assign(menu.style, {\n position: 'fixed',\n top: `${Math.round(top)}px`,\n left: `${Math.round(left)}px`,\n maxHeight: `${Math.round(maxHeight)}px`,\n overflowY: 'auto'\n });\n }\n}\n\nexport default ActionDropdown;\n"],
|
|
5
|
+
"mappings": ";AAYA,I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