flexdesk 0.17.15 → 0.17.17
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 +42 -0
- package/css/base.css +236 -5
- package/css/flexdesk.css +326 -13
- package/css/tokens.css +3 -0
- package/dist/charts.js +104 -34
- package/dist/charts.js.map +3 -3
- package/dist/{chunk-2PM6ZMNS.js → chunk-2Z2ENHR3.js} +2 -2
- package/dist/{chunk-AD7FIA3Z.js → chunk-7JI7HHSY.js} +2 -2
- package/dist/{chunk-TLIV6QSU.js → chunk-7OL6F2AM.js} +3 -3
- package/dist/{chunk-MADMGRX2.js → chunk-PGZ4EHSE.js} +156 -9
- package/dist/chunk-PGZ4EHSE.js.map +7 -0
- package/dist/{chunk-OEG6NPAN.js → chunk-XJNADRGR.js} +2 -2
- package/dist/flexdesk.css +326 -13
- package/dist/flow.js +3 -3
- package/dist/tiles.js +84 -9
- package/dist/tiles.js.map +2 -2
- package/dist/tokens.css +3 -0
- package/dist/widgets.js +4559 -4091
- package/dist/widgets.js.map +4 -4
- package/dist/wm.js +212 -40
- package/dist/wm.js.map +2 -2
- package/docs/README.md +1 -1
- package/docs/components/charts.md +70 -3
- package/docs/components/forms-and-dialogs.md +61 -0
- package/docs/components/menus.md +85 -1
- package/docs/components/notifications.md +23 -1
- package/docs/components/panels-and-desktops.md +22 -0
- package/docs/components/shell.md +91 -0
- package/docs/components/tiles.md +37 -0
- package/package.json +1 -1
- package/src/charts/plot_config_editor.js +125 -29
- package/src/tiles/tile_base.js +48 -2
- package/src/tiles/tile_grid.js +42 -1
- package/src/tiling/kind_taxonomy.js +66 -13
- package/src/tiling/shell.js +4 -1
- package/src/tiling/wm.js +205 -35
- package/src/ui/components/category_picker.js +556 -0
- package/src/ui/components/computing_status_window.js +3 -0
- package/src/ui/components/confirm_dialog.js +3 -0
- package/src/ui/components/managed_window.js +204 -9
- package/src/ui/components/notification_history.js +11 -1
- package/src/ui/components/wizard.js +4 -1
- package/src/ui/notification_center.js +47 -1
- package/widgets.js +2 -1
- package/dist/chunk-MADMGRX2.js.map +0 -7
- /package/dist/{chunk-2PM6ZMNS.js.map → chunk-2Z2ENHR3.js.map} +0 -0
- /package/dist/{chunk-AD7FIA3Z.js.map → chunk-7JI7HHSY.js.map} +0 -0
- /package/dist/{chunk-TLIV6QSU.js.map → chunk-7OL6F2AM.js.map} +0 -0
- /package/dist/{chunk-OEG6NPAN.js.map → chunk-XJNADRGR.js.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/ui/components/managed_window.js", "../src/ui/components/toggle_field.js", "../src/ui/components/color_field.js", "../src/ui/components/choice_controls.js", "../src/ui/components/row_activation.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\n/** Where window geometry lives when the embedder names no key. An embedder\n * that saved geometry under another key keeps it by passing that key to\n * `ManagedWindow.configure({ storageKey })` before the first window opens. */\nexport const DEFAULT_WINDOW_STORAGE_KEY = 'flexdesk.managedWindows.v1';\nlet _storageKey = DEFAULT_WINDOW_STORAGE_KEY;\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/** STORY-0119. The space above a window on `document.body`: the top bar, and\n * under it a shell's menu row (`.twm-global-menu-bar`, a sibling of the top\n * bar in body.twm-body's column) when the page has one. The row is measured,\n * not assumed, because its height is its content's. Without a row this is\n * TOP_BAR_HEIGHT, exactly as before. */\nfunction _topInset() {\n const row = typeof document !== 'undefined'\n ? document.querySelector('body > .twm-global-menu-bar') : null;\n return TOP_BAR_HEIGHT + (row ? row.getBoundingClientRect().height : 0);\n}\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(_storageKey);\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(_storageKey, 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 * (STORY-0119: TOP_BAR_HEIGHT here is `_topInset()`, which is\n * TOP_BAR_HEIGHT on a page without a menu row and adds the row's height\n * on a page with one.)\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 * Embedders' 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 const top = _topInset();\n return {\n minX: 0,\n minY: top,\n width: window.innerWidth,\n height: window.innerHeight - top - 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 const top = _topInset();\n this.y = Math.max(top, top + (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 top = _topInset();\n const maxHeight = window.innerHeight - top - 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)));\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, 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 * Choose where window geometry is saved and restored. Call once at boot,\n * before the first window opens; from then on windows read and write only\n * `storageKey`. The geometry already read from another key is dropped, so\n * a window shown afterwards restores what `storageKey` holds.\n *\n * @param {object} [opts]\n * @param {string} [opts.storageKey=DEFAULT_WINDOW_STORAGE_KEY]\n */\n static configure({ storageKey = DEFAULT_WINDOW_STORAGE_KEY } = {}) {\n _storageKey = storageKey;\n _stateCache = null;\n }\n\n /** @returns {string} The localStorage key window geometry uses. */\n static get storageKey() {\n return _storageKey;\n }\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", "/**\n * ToggleField \u2014 an on/off switch: a track and a knob drawn over a REAL\n * checkbox, so the form, the label and assistive technology all see a native\n * control.\n *\n * const t = new ToggleField({ label: 'Autosave', onText: 'On', offText: 'Off',\n * checked: true, onChange: (on) => save(on) });\n * host.appendChild(t.render());\n * t.get(); // true\n * t.set(false); // no onChange: the caller already knows\n * t.setDisabled(true);\n * t.dispose();\n *\n * The input carries `role=\"switch\"` and an `aria-checked` that follows it.\n * Space toggles it (as it does any checkbox) and so does Enter, which a\n * checkbox ignores but a switch is expected to honour. Both go through the\n * input's own `click()`, so a disabled switch ignores them exactly as it\n * ignores the mouse, and a toggle fires the input's `input` and `change` like\n * any other control. The root is a `<label>`, so a click on the track, the\n * on/off text or the label toggles it too.\n *\n * Markup \u2014 every class is styled by `flexdesk.css` from tokens alone:\n *\n * label.twm-toggle[.twm-toggle--compact][.twm-toggle--disabled]\n * span.twm-toggle__control\n * input.twm-toggle__input[type=checkbox][role=switch]\n * span.twm-toggle__track > span.twm-toggle__knob\n * span.twm-toggle__state (onText / offText, when either is given)\n * span.twm-toggle__label (label, when given)\n */\nexport class ToggleField {\n /**\n * @param {object} o\n * @param {boolean} [o.checked=false]\n * @param {string?} [o.label] text beside the switch, and its accessible name\n * @param {string?} [o.ariaLabel] accessible name when there is no visible label\n * @param {string?} [o.onText] state text shown while on\n * @param {string?} [o.offText] state text shown while off\n * @param {boolean} [o.disabled=false]\n * @param {boolean} [o.compact=false] a smaller track, for dense rows\n * @param {string?} [o.name] the input's name, for a surrounding form\n * @param {string?} [o.id] the input's id\n * @param {Function?}[o.onChange] `(checked: boolean)` after a user toggle\n */\n constructor({\n checked = false, label = null, ariaLabel = null, onText = null, offText = null,\n disabled = false, compact = false, name = null, id = null, onChange = null,\n } = {}) {\n this._initial = !!checked;\n this._label = label == null ? null : String(label);\n this._ariaLabel = ariaLabel == null ? null : String(ariaLabel);\n this._onText = onText == null ? null : String(onText);\n this._offText = offText == null ? null : String(offText);\n this._disabled = !!disabled;\n this._compact = !!compact;\n this._name = name == null ? null : String(name);\n this._id = id == null ? null : String(id);\n this._onChange = typeof onChange === 'function' ? onChange : null;\n\n this.root = null;\n this.input = null;\n this._stateEl = null;\n this._disposers = [];\n }\n\n /** Build the switch once and hand back its root; later calls return it. */\n render() {\n if (this.root) return this.root;\n\n const root = document.createElement('label');\n root.className = 'twm-toggle';\n if (this._compact) root.classList.add('twm-toggle--compact');\n\n const control = document.createElement('span');\n control.className = 'twm-toggle__control';\n\n const input = document.createElement('input');\n input.type = 'checkbox';\n input.className = 'twm-toggle__input';\n input.setAttribute('role', 'switch');\n if (this._name) input.name = this._name;\n if (this._id) input.id = this._id;\n if (this._ariaLabel && !this._label) input.setAttribute('aria-label', this._ariaLabel);\n input.checked = this._initial;\n\n const track = document.createElement('span');\n track.className = 'twm-toggle__track';\n track.setAttribute('aria-hidden', 'true');\n const knob = document.createElement('span');\n knob.className = 'twm-toggle__knob';\n track.appendChild(knob);\n\n control.append(input, track);\n root.appendChild(control);\n\n if (this._onText != null || this._offText != null) {\n this._stateEl = document.createElement('span');\n this._stateEl.className = 'twm-toggle__state';\n // The switch already says on/off to a screen reader.\n this._stateEl.setAttribute('aria-hidden', 'true');\n root.appendChild(this._stateEl);\n }\n if (this._label != null) {\n const labelEl = document.createElement('span');\n labelEl.className = 'twm-toggle__label';\n labelEl.textContent = this._label;\n root.appendChild(labelEl);\n }\n\n this.root = root;\n this.input = input;\n this.setDisabled(this._disabled);\n this._sync();\n\n const onKeyDown = (e) => {\n if (e.key !== ' ' && e.key !== 'Enter') return;\n // Ours, not the browser's: Space would otherwise activate on keyup\n // as well, and Enter would submit the surrounding form.\n e.preventDefault();\n if (e.repeat) return;\n input.click();\n };\n const onKeyUp = (e) => { if (e.key === ' ') e.preventDefault(); };\n const onChange = () => {\n this._sync();\n this._onChange?.(input.checked);\n };\n input.addEventListener('keydown', onKeyDown);\n input.addEventListener('keyup', onKeyUp);\n input.addEventListener('change', onChange);\n this._disposers.push(\n () => input.removeEventListener('keydown', onKeyDown),\n () => input.removeEventListener('keyup', onKeyUp),\n () => input.removeEventListener('change', onChange),\n );\n return root;\n }\n\n /** Whether the switch is on. */\n get() {\n return this.input ? this.input.checked : this._initial;\n }\n\n /** Turn it on or off. Does NOT call `onChange`. */\n set(checked) {\n if (!this.input) { this._initial = !!checked; return; }\n this.input.checked = !!checked;\n this._sync();\n }\n\n /** A disabled switch ignores clicks and keys alike. */\n setDisabled(disabled) {\n this._disabled = !!disabled;\n if (!this.input) return;\n this.input.disabled = this._disabled;\n this.root.classList.toggle('twm-toggle--disabled', this._disabled);\n }\n\n dispose() {\n for (const d of this._disposers) {\n try { d(); } catch { /* the element is already gone */ }\n }\n this._disposers = [];\n this.root?.remove();\n this.root = null;\n this.input = null;\n this._stateEl = null;\n }\n\n _sync() {\n const on = this.input.checked;\n this.input.setAttribute('aria-checked', on ? 'true' : 'false');\n if (this._stateEl) this._stateEl.textContent = (on ? this._onText : this._offText) ?? '';\n }\n}\n", "/**\n * ColorField \u2014 one colour: a swatch that opens the native picker, a hex text\n * box kept in step with it, and an optional row of preset swatches.\n *\n * const field = new ColorField({\n * value: 'rgb(31, 119, 180)', // shown as #1f77b4\n * presets: ['#1f77b4', '#ff7f0e', '#2ca02c'],\n * onChange: (hex, { commit }) => { ... },\n * });\n * host.appendChild(field.render());\n * field.getValue(); // '#1f77b4' | '' | null\n *\n * THE HEX BOX IS THE CONTROL. Picking in the swatch writes the box and fires\n * the box's own `input` (and, when the picker commits, `change`); a preset\n * does the same. So there is one path from any gesture to the value, and a\n * host listening on the box \u2014 `openForm` does, by its `name` \u2014 hears every\n * change whatever made it. Typing a valid hex moves the swatch; typing an\n * invalid one leaves the swatch on the last good colour and marks the field\n * `.twm-color-field--invalid`.\n *\n * VALUES. `getValue()` is the colour as lowercase `#rrggbb`, `''` when the box\n * is empty, and `null` when what is typed is not a hex colour (`#rgb` and\n * `#rrggbb` are). An `rgb()` / `rgba()` value handed IN \u2014 a default, a preset,\n * `setValue` \u2014 is converted to its hex equivalent first; alpha is dropped,\n * because the native picker has no alpha channel.\n *\n * `onChange(value, { commit })` runs on every edit with `commit: false` and on\n * the box's `change` (blur, Enter, a preset, the picker closing) with\n * `commit: true`.\n */\n\nconst HEX_RE = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst RGB_RE = /^rgba?\\(\\s*([^)]*)\\)$/i;\n\n/** True for `#rgb` and `#rrggbb` (any case), and nothing else. */\nexport function isHexColor(value) {\n return typeof value === 'string' && HEX_RE.test(value.trim());\n}\n\n/**\n * A colour as lowercase `#rrggbb`, or null when `value` is not one.\n * Accepts `#rgb`, `#rrggbb` and `rgb()` / `rgba()` in comma or space syntax,\n * with channels as 0\u2013255 or percentages; an alpha channel is dropped.\n */\nexport function normalizeHex(value) {\n if (typeof value !== 'string') return null;\n const s = value.trim();\n if (HEX_RE.test(s)) {\n const h = s.slice(1).toLowerCase();\n return h.length === 3 ? `#${h[0]}${h[0]}${h[1]}${h[1]}${h[2]}${h[2]}` : `#${h}`;\n }\n const m = RGB_RE.exec(s);\n if (!m) return null;\n const parts = m[1].split(/\\s*[,/]\\s*|\\s+/).filter(Boolean);\n if (parts.length < 3 || parts.length > 4) return null;\n const channels = [];\n for (const p of parts.slice(0, 3)) {\n const pct = p.endsWith('%');\n const n = Number(pct ? p.slice(0, -1) : p);\n if (!Number.isFinite(n)) return null;\n const v = pct ? (n / 100) * 255 : n;\n if (v < 0 || v > 255) return null;\n channels.push(Math.round(v));\n }\n return `#${channels.map((c) => c.toString(16).padStart(2, '0')).join('')}`;\n}\n\n/** What the box shows for a value handed in: its hex if it is a colour, else as given. */\nfunction displayText(value) {\n if (value == null) return '';\n return normalizeHex(String(value)) ?? String(value);\n}\n\nexport class ColorField {\n /**\n * @param {Object} [o]\n * @param {string} [o.value] initial colour (hex or rgb()); '' for none\n * @param {string[]} [o.presets] preset colours drawn as buttons; ones that\n * are not colours are left out\n * @param {string} [o.name] `name` of the hex box, for a host form\n * @param {string} [o.label] accessible name of the swatch and the box\n * @param {Function} [o.onChange] `(value, { commit })`, value as `getValue()`\n */\n constructor({ value = '', presets = [], name = null, label = null, onChange = null } = {}) {\n this.initial = displayText(value);\n this.presets = (Array.isArray(presets) ? presets : []).map(normalizeHex).filter(Boolean);\n this.name = name;\n this.label = label;\n this.onChange = typeof onChange === 'function' ? onChange : null;\n\n this.root = null;\n this.swatch = null;\n this.hex = null;\n this._disposers = [];\n }\n\n render() {\n if (this.root) return this.root;\n const root = document.createElement('div');\n root.className = 'twm-color-field';\n\n const swatch = document.createElement('input');\n swatch.type = 'color';\n swatch.className = 'twm-color-field__swatch';\n swatch.value = normalizeHex(this.initial) ?? '#000000';\n if (this.label) swatch.title = this.label;\n\n const hex = document.createElement('input');\n hex.type = 'text';\n hex.className = 'twm-color-field__hex';\n hex.value = this.initial;\n hex.placeholder = '#rrggbb';\n hex.spellcheck = false;\n hex.autocomplete = 'off';\n hex.maxLength = 7;\n if (this.name) hex.name = this.name;\n if (this.label) hex.setAttribute('aria-label', this.label);\n\n root.append(swatch, hex);\n this.root = root;\n this.swatch = swatch;\n this.hex = hex;\n\n if (this.presets.length) {\n const strip = document.createElement('div');\n strip.className = 'twm-color-field__presets';\n for (const color of this.presets) {\n const btn = document.createElement('button');\n btn.type = 'button';\n btn.className = 'twm-color-field__preset';\n btn.style.backgroundColor = color;\n btn.title = color;\n btn.setAttribute('aria-label', color);\n this.#listen(btn, 'click', () => this.#writeBox(color, true));\n strip.appendChild(btn);\n }\n root.appendChild(strip);\n }\n\n // Every gesture lands on the box; the box's listeners do the rest.\n this.#listen(swatch, 'input', () => this.#writeBox(swatch.value, false));\n this.#listen(swatch, 'change', () => this.#writeBox(swatch.value, true));\n this.#listen(hex, 'input', () => this.#sync(false));\n this.#listen(hex, 'change', () => {\n const v = this.getValue();\n if (v) hex.value = v; // canonical form once committed\n this.#sync(true);\n });\n\n this.#sync(null);\n return root;\n }\n\n /** `#rrggbb`, `''` when empty, or `null` when the box holds no hex colour. */\n getValue() {\n const text = this.getText().trim();\n if (text === '') return '';\n return isHexColor(text) ? normalizeHex(text) : null;\n }\n\n /** The box as it stands. */\n getText() {\n return this.hex ? this.hex.value : this.initial;\n }\n\n isValid() {\n return this.getValue() !== null;\n }\n\n /** Write a colour (hex or rgb()) without firing `onChange`. */\n setValue(value) {\n const text = displayText(value);\n if (!this.hex) { this.initial = text; return; }\n this.hex.value = text;\n this.#sync(null);\n }\n\n focus() {\n this.hex?.focus();\n }\n\n dispose() {\n for (const d of this._disposers) {\n try { d(); } catch { /* listener already gone */ }\n }\n this._disposers = [];\n this.root = null;\n this.swatch = null;\n this.hex = null;\n }\n\n #listen(el, type, fn) {\n el.addEventListener(type, fn);\n this._disposers.push(() => el.removeEventListener(type, fn));\n }\n\n /** Put `text` in the box and fire the box's own events, as typing would. */\n #writeBox(text, commit) {\n this.hex.value = text;\n this.hex.dispatchEvent(new Event('input', { bubbles: true }));\n if (commit) this.hex.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n /** Swatch and invalid mark follow the box; `commit === null` is silent. */\n #sync(commit) {\n const v = this.getValue();\n if (v) this.swatch.value = v;\n this.root.classList.toggle('twm-color-field--invalid', v === null);\n if (commit !== null) this.onChange?.(v, { commit });\n }\n}\n", "/**\n * CHOICE CONTROLS \u2014 the one select, the one set of toggle chips and the one\n * radio list, shared by `openForm` and the flow kit's settings widgets.\n *\n * Each draws a fixed list of options and reads back the option's OWN value \u2014\n * a number stays a number, an object stays the object \u2014 never the text of an\n * `<option>` or a `value` attribute. That is why every control here keeps the\n * values beside the DOM it draws and resolves the reader's choice by position.\n *\n * An option is a bare value, or `{ value, label?, description?, disabled?,\n * reason? }`. Each also takes `{ group, options }` entries: `selectBox` draws\n * one as an `<optgroup>`, the chips and the radio list as a `.twm-choice__group`\n * heading over its options. A group with no options draws no heading there.\n *\n * A DISABLED OPTION IS SHOWN, WITH ITS REASON, AND IS NEVER CHOSEN BY VALUE:\n * a stored value that names one is not selected (the select falls to its first\n * enabled option, the radios to none, the chips leave it unpressed), unless\n * `keepMissing` keeps it as a value the list does not offer. The reader cannot\n * pick one either. What a caller does about a disabled option selected some\n * other way (a script setting `.value`) is the caller's: `selectBox.entry()`\n * and `choiceList.entry()` say which option is selected, disabled or not.\n *\n * `keepMissing` (the kit's rule, on by default): a stored value the list does\n * not offer is KEPT, marked with `notFound(text)`, so a settings panel cannot\n * silently turn it into the first entry on the next save. A form that should\n * offer only what is listed passes `keepMissing: false`.\n *\n * `loose`: a stored value matches an option whose value has the same TEXT\n * (`2` matches `'2'`), for a caller whose stored values may arrive as strings.\n * Off by default: the kit's values keep their type, and `'2'` is not `2`.\n * Text is only the fallback: an option whose value IS the stored value (`===`)\n * wins over an earlier one that only reads the same (`findChoice`).\n *\n * Nothing here names a consumer's vocabulary; every word on screen is the\n * caller's (`label`, `reason`, `description`, `notFound`).\n */\n\n/** A value as one line of text shows it: a string as itself, anything else as JSON. */\nexport const shownValue = (v) => (v === undefined ? '' : typeof v === 'string' ? v : JSON.stringify(v));\n\nfunction el(tag, className, text) {\n const n = document.createElement(tag);\n if (className) n.className = className;\n if (text !== undefined && text !== null) n.textContent = String(text);\n return n;\n}\n\nconst isGroup = (o) => o !== null && typeof o === 'object' && Array.isArray(o.options) && 'group' in o;\n\n/** One option, normalised: `{value, label, description, disabled, reason}`. */\nfunction choiceOption(o) {\n if (o === null || typeof o !== 'object') {\n return { value: o, label: shownValue(o), description: null, disabled: false, reason: null };\n }\n return {\n value: o.value,\n label: o.label != null ? String(o.label) : shownValue(o.value),\n description: o.description != null ? String(o.description) : null,\n disabled: Boolean(o.disabled),\n reason: o.reason != null && o.reason !== '' ? String(o.reason) : null,\n };\n}\n\n/** Every option of a list, groups flattened in order. */\nexport function flatChoices(options) {\n const out = [];\n for (const o of options || []) {\n if (isGroup(o)) for (const inner of o.options) out.push(choiceOption(inner));\n else out.push(choiceOption(o));\n }\n return out;\n}\n\n/**\n * Where the chips and the radio list draw a group heading: the position in\n * the flattened list of each non-empty group's first option, to its heading.\n */\nfunction groupHeads(options) {\n const heads = new Map();\n let at = 0;\n for (const o of options || []) {\n if (!isGroup(o)) { at += 1; continue; }\n if (o.options.length) heads.set(at, String(o.group ?? ''));\n at += o.options.length;\n }\n return heads;\n}\n\nconst groupHeading = (text) => el('div', 'twm-choice__group', text);\n\n/** Does stored `value` name option value `v`? */\nfunction sameChoice(v, value, loose = false) {\n if (v === value) return true;\n if (!loose || v === undefined || value === undefined || v === null || value === null) return false;\n return String(v) === String(value);\n}\n\n/**\n * The position in `list` (normalised options) of the option stored value `v`\n * names, or -1: the first whose value IS `v`, else \u2014 with `loose` \u2014 the first\n * whose value has the same text. `from` skips the leading entries.\n */\nfunction choiceIndex(list, v, loose = false, from = 0) {\n for (let i = from; i < list.length; i += 1) if (list[i].value === v) return i;\n if (!loose) return -1;\n for (let i = from; i < list.length; i += 1) if (sameChoice(list[i].value, v, true)) return i;\n return -1;\n}\n\n/** The option of `list` stored value `v` names (`choiceIndex`), or undefined. */\nexport function findChoice(list, v, loose = false) {\n const i = choiceIndex(list, v, loose);\n return i >= 0 ? list[i] : undefined;\n}\n\n/** An option's text: its label, and the reason it is unavailable when it is. */\nconst optionText = (o) => (o.disabled && o.reason ? `${o.label} \u2014 ${o.reason}` : o.label);\n\n/**\n * A `<select>` over `options`.\n *\n * `empty` (text) draws a first option that stands for \"no value\" (`undefined`).\n * `valueAttr`: what each `<option value>` carries \u2014 `'index'` (its position;\n * the kit's) or `'value'` (the option's value as text, so a script that sets\n * `.value = 'b'` picks option `'b'`). The value READ BACK is the option's own\n * either way.\n *\n * Returns `{ box, valueOf(), entry(), select(value), setOptions(options, value?) }`:\n * `select` re-selects by value (true when the value is offered and enabled);\n * `setOptions` redraws the list and places `value` (default: the current\n * value) the way the first draw places one, so with `keepMissing` a value the\n * list lacks shows as its own not-found entry.\n */\nexport function selectBox(options, value, {\n empty = null, label = '', notFound = (v) => `${v} (not found)`, keepMissing = true,\n valueAttr = 'index', loose = false, className = 'twm-flow-input twm-flow-input--select',\n} = {}) {\n const box = el('select', className);\n if (label) box.setAttribute('aria-label', label);\n let entries = [];\n\n const add = (parent, o) => {\n const attr = valueAttr === 'index' ? String(entries.length) : (o.value === undefined ? '' : String(o.value));\n // `createElement`, not `new Option`: the constructor is a window\n // global, and a page that installed only `document` has none.\n const opt = el('option', '', optionText(o));\n opt.value = attr;\n if (o.disabled) {\n opt.disabled = true;\n if (o.reason) opt.title = o.reason;\n }\n parent.appendChild(opt);\n entries.push(o);\n };\n const firstEnabled = () => {\n const i = entries.findIndex((e) => !e.disabled);\n return i >= 0 ? i : 0;\n };\n const select = (v) => {\n const start = empty !== null ? 1 : 0;\n const at = choiceIndex(entries, v, loose, start);\n if (at < 0 || entries[at].disabled || entries[at].stray) return false;\n box.selectedIndex = at;\n return true;\n };\n const place = (v) => {\n if (select(v)) return;\n if (keepMissing && v !== undefined && v !== null && v !== '') {\n // A stored value the list no longer offers is KEPT as its own option:\n // it must not silently become the first entry on the next save.\n add(box, { value: v, label: notFound(shownValue(v)), description: null, disabled: false, reason: null,\n stray: true });\n box.selectedIndex = entries.length - 1;\n return;\n }\n box.selectedIndex = empty !== null ? 0 : firstEnabled();\n };\n const fill = (opts, v) => {\n box.replaceChildren();\n entries = [];\n if (empty !== null) add(box, { value: undefined, label: String(empty), description: null, disabled: false,\n reason: null });\n for (const o of opts || []) {\n if (isGroup(o)) {\n const g = el('optgroup');\n g.label = String(o.group ?? '');\n for (const inner of o.options) add(g, choiceOption(inner));\n box.appendChild(g);\n } else {\n add(box, choiceOption(o));\n }\n }\n place(v);\n };\n const entry = () => (box.selectedIndex < 0 ? null : entries[box.selectedIndex] ?? null);\n const valueOf = () => entry()?.value;\n\n fill(options, value);\n return {\n box,\n valueOf,\n entry,\n select,\n setOptions(opts, v = valueOf()) { fill(opts, v); },\n };\n}\n\n/**\n * Toggle chips over a fixed list: a multi-select. The value is the list of\n * pressed values in the list's order, and `onChange(list | undefined)` hears\n * each toggle (`undefined` when none is pressed). With `keepMissing`, a stored\n * entry the list lacks is kept, marked, until it is toggled off. A disabled\n * option is a chip that cannot be pressed, its reason under its label.\n *\n * Returns `{ el, valueOf(), setValue(list), setOptions(options) }`;\n * `setOptions` keeps the pressed values the new list still offers.\n */\nexport function toggleChips({ options, value, label, readOnly, onChange, notFound = (v) => `${v} (not found)`,\n keepMissing = true, loose = false }) {\n const root = el('div', 'twm-flow-togglechips');\n root.setAttribute('role', 'group');\n if (label) root.setAttribute('aria-label', label);\n let shown = []; // the options as given, groups and all\n let list = [];\n let chosen = new Set();\n let strays = [];\n\n const emit = () => {\n const out = valueOf();\n onChange?.(out.length ? out : undefined);\n };\n const chipFor = (text, pressed, toggle, { stray = false, reason = null, disabled = false } = {}) => {\n const b = el('button', `twm-flow-togglechip${stray ? ' twm-flow-togglechip--missing' : ''}`, text);\n b.type = 'button';\n b.setAttribute('aria-pressed', pressed ? 'true' : 'false');\n b.disabled = Boolean(readOnly) || disabled;\n if (reason) {\n b.title = reason;\n b.appendChild(el('span', 'twm-choice__reason', reason));\n }\n b.addEventListener('click', () => {\n const on = toggle();\n b.setAttribute('aria-pressed', on ? 'true' : 'false');\n emit();\n });\n return b;\n };\n const draw = (opts, stored) => {\n shown = opts || [];\n list = flatChoices(shown);\n const heads = groupHeads(shown);\n const wanted = Array.isArray(stored) ? stored : [];\n const offered = (v) => {\n const o = findChoice(list, v, loose);\n return o && !o.disabled ? o : undefined;\n };\n chosen = new Set(wanted.map(offered).filter(Boolean).map((o) => o.value));\n strays = keepMissing ? wanted.filter((v) => !offered(v)) : [];\n root.replaceChildren();\n list.forEach((o, i) => {\n if (heads.has(i)) root.appendChild(groupHeading(heads.get(i)));\n root.appendChild(chipFor(o.label, chosen.has(o.value), () => {\n if (o.disabled) return false; // never chosen, even with the button forced\n if (chosen.has(o.value)) chosen.delete(o.value); else chosen.add(o.value);\n return chosen.has(o.value);\n }, { disabled: o.disabled, reason: o.disabled ? o.reason : null }));\n });\n for (const v of [...strays]) {\n root.appendChild(chipFor(notFound(shownValue(v)), true, () => {\n const i = strays.indexOf(v);\n if (i >= 0) { strays.splice(i, 1); return false; }\n strays.push(v);\n return true;\n }, { stray: true }));\n }\n };\n const valueOf = () => [...list.filter((o) => chosen.has(o.value)).map((o) => o.value), ...strays];\n draw(options, value);\n return {\n el: root,\n valueOf,\n setValue: (stored) => draw(shown, stored),\n setOptions: (opts) => draw(opts, valueOf()),\n };\n}\n\n/**\n * A one-of-N as radio rows, each with its label \u2014 and a sentence under it when\n * the option has a `description`, and its `reason` when it is disabled. `name`\n * groups the radios (the caller's, so it is unique where it needs to be).\n *\n * Returns `{ el, focus(), valueOf(), entry(), select(value), setOptions(options) }`.\n * `onChange(value)` hears the reader's choice. With `keepMissing`, a stored\n * value the list lacks is named in a note under the list (and kept by the\n * caller, since no radio holds it).\n */\nexport function choiceList({ options, value, name, label, readOnly, onChange, notFound = (v) => `${v} (not found)`,\n keepMissing = true, loose = false }) {\n const root = el('div', 'twm-flow-choices');\n root.setAttribute('role', 'radiogroup');\n if (label) root.setAttribute('aria-label', label);\n let list = [];\n let radios = [];\n\n const draw = (opts, current) => {\n list = flatChoices(opts);\n const heads = groupHeads(opts);\n radios = [];\n root.replaceChildren();\n const named = choiceIndex(list, current, loose);\n const at = named >= 0 && !list[named].disabled ? named : -1;\n list.forEach((o, i) => {\n if (heads.has(i)) root.appendChild(groupHeading(heads.get(i)));\n const row = el('label', `twm-flow-choice${o.disabled ? ' twm-choice--disabled' : ''}`);\n const radio = el('input', 'twm-flow-choice__radio');\n radio.type = 'radio';\n radio.name = name;\n radio.checked = i === at;\n radio.disabled = Boolean(readOnly) || o.disabled;\n radio.addEventListener('change', () => { if (radio.checked) onChange?.(o.value); });\n radios.push(radio);\n const words = el('span', 'twm-flow-choice__words');\n words.appendChild(el('span', 'twm-flow-choice__label', o.label));\n if (o.description !== null) words.appendChild(el('span', 'twm-flow-choice__sub', o.description));\n if (o.disabled && o.reason) words.appendChild(el('span', 'twm-choice__reason', o.reason));\n row.append(radio, words);\n root.appendChild(row);\n });\n if (keepMissing && current !== undefined && named < 0) {\n root.appendChild(el('p', 'twm-flow-field__note', notFound(shownValue(current))));\n }\n };\n const checkedAt = () => radios.findIndex((r) => r.checked);\n const entry = () => list[checkedAt()] ?? null;\n const api = {\n el: root,\n focus: () => (radios.find((r) => r.checked && !r.disabled) || radios.find((r) => !r.disabled))\n ?.focus({ preventScroll: true }),\n entry,\n valueOf: () => entry()?.value,\n select(v) {\n const named = choiceIndex(list, v, loose);\n const at = named >= 0 && !list[named].disabled ? named : -1;\n radios.forEach((r, i) => { r.checked = i === at; });\n return at >= 0;\n },\n setOptions(opts) { draw(opts, api.valueOf()); },\n };\n draw(options, value);\n return api;\n}\n", "/**\n * row_activation.js \u2014 WHEN A ROW GESTURE OPENS THE ROW. One rule, shared by\n * `DataTable`'s `onRowActivate` (0.5.0) and the landing helper\n * `attachLandingTableBehavior`, so a list built either way opens on exactly the\n * same gestures and refuses exactly the same ones.\n *\n * A row \"activates\" \u2014 opens the thing it stands for \u2014 on a click, a double-click\n * or Enter, as the table asks. Three things that look like a click are not one:\n *\n * 1. **A control in the row is its own gesture.** A button, a link, a field, a\n * `[data-twm-action]` verb: pressing it does what it says, and must not ALSO\n * open the row underneath it.\n * 2. **Dragging across a cell to copy it is not a click on the row.** A drag\n * that ends a text selection fires `click` on the cell it ends on; the\n * selection being non-empty is how it is told apart. Only a selection that\n * touches the list counts \u2014 one elsewhere on the page is not this gesture.\n * 3. **The second click of a double-click opens nothing.** A double-click is\n * two `click`s (`detail` 1, then 2) before the `dblclick`; the first one has\n * already opened the row. A list that draws the thing it opened IN PLACE\n * would otherwise take the second click as a click on whatever is now under\n * the pointer. `detail` is the platform's click count, not a timing guess;\n * a synthetic or keyboard `click` carries 0 and is a single click.\n *\n * A `dblclick` gesture skips rule 2: a double-click on text selects the word\n * under it, so a selection is the ordinary result of the gesture, not evidence\n * of a drag.\n */\n\n/** What a press inside a row is never a ROW gesture on: a control or a verb. */\nexport const ROW_CONTROL_SELECTOR = [\n 'button', 'a', 'input', 'select', 'textarea', 'label', 'summary',\n '[contenteditable=\"\"]', '[contenteditable=\"true\"]', '[data-twm-action]',\n].join(', ');\n\n/** Did this press land on a control inside the row (rule 1)? */\nexport function isRowControl(target, scope = null) {\n const hit = target?.closest?.(ROW_CONTROL_SELECTOR);\n return !!hit && (!scope || scope.contains(hit));\n}\n\n/** Does a non-empty text selection touch `scope` (rule 2)? Without a scope,\n * any non-empty selection in the target's document counts. */\nexport function endsTextSelection(target, scope = null) {\n const doc = target?.ownerDocument || (typeof document !== 'undefined' ? document : null);\n const sel = doc?.getSelection?.();\n if (!sel || sel.isCollapsed || !String(sel)) return false;\n if (!scope) return true;\n const inside = (node) => !!node && scope.contains(node);\n return inside(sel.anchorNode) || inside(sel.focusNode);\n}\n\n/**\n * Is this event a row activation of kind `gesture`, by the three rules above?\n *\n * @param {Event} ev\n * @param {'click'|'dblclick'} [gesture='click']\n * @param {{scope?: Element}} [o] the list's own element: a control or a\n * selection outside it is not this list's business\n * @returns {boolean}\n */\nexport function isRowActivation(ev, gesture = 'click', { scope = null } = {}) {\n const target = ev?.target;\n if (!target?.closest) return false;\n if (isRowControl(target, scope)) return false;\n if (gesture === 'click') {\n if ((ev.detail ?? 0) > 1) return false;\n if (endsTextSelection(target, scope)) return false;\n }\n return true;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAwBO,IAAM,6BAA6B;AAC1C,IAAI,cAAc;AAClB,IAAM,eAAe;AACrB,IAAM,cAAc;AAMpB,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAO1B,SAAS,YAAY;AACjB,QAAM,MAAM,OAAO,aAAa,cAC1B,SAAS,cAAc,6BAA6B,IAAI;AAC9D,SAAO,kBAAkB,MAAM,IAAI,sBAAsB,EAAE,SAAS;AACxE;AAIA,IAAM,YAAY;AAGlB,IAAM,eAAe;AAGrB,IAAI,iBAAiB;AACrB,IAAI,iBAAiB,oBAAI,IAAI;AAK7B,SAAS,kBAAkB,MAAM;AAC7B,MAAI,CAAC,KAAM,QAAO,CAAC;AACnB,QAAM,MAAM;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,EAAE,KAAK,GAAG;AACV,SAAO,MAAM,KAAK,KAAK,iBAAiB,GAAG,CAAC,EAAE,OAAO,CAACA,QAAO;AAGzD,QAAIA,IAAG,OAAQ,QAAO;AACtB,QAAIA,IAAG,QAAQ,UAAU,EAAG,QAAO;AACnC,UAAM,IAAIA,IAAG,sBAAsB;AACnC,WAAO,EAAE,QAAQ,KAAK,EAAE,SAAS;AAAA,EACrC,CAAC;AACL;AAGA,IAAI,cAAc;AAElB,SAAS,aAAa;AAClB,MAAI,YAAa,QAAO;AACxB,MAAI;AACA,UAAM,MAAM,aAAa,QAAQ,WAAW;AAC5C,kBAAc,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;AAAA,EAC3C,QAAQ;AACJ,kBAAc,CAAC;AAAA,EACnB;AACA,SAAO;AACX;AAEA,SAAS,WAAW,OAAO;AACvB,gBAAc;AACd,MAAI;AAC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