flexdesk 0.16.1 → 0.17.1
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 +112 -0
- package/LICENSE +0 -0
- package/README.md +2435 -42
- package/THIRD_PARTY_LICENSES.md +0 -0
- package/canvas.js +18 -0
- package/charts.js +21 -0
- package/core.js +14 -0
- package/css/base.css +1834 -75
- package/css/flexdesk.css +3165 -159
- package/css/overrides.css +16 -0
- package/css/reset.css +0 -0
- package/css/tokens.css +0 -0
- package/dist/canvas.js +6 -239
- package/dist/canvas.js.map +3 -3
- package/dist/charts.js +707 -18
- package/dist/charts.js.map +4 -4
- package/dist/chunk-3PHCPZHT.js +0 -0
- package/dist/chunk-3PHCPZHT.js.map +0 -0
- package/dist/chunk-4A7SJC3T.js +503 -0
- package/dist/chunk-4A7SJC3T.js.map +7 -0
- package/dist/{chunk-6JSOVNID.js → chunk-CVMCZZX2.js} +635 -10
- package/dist/chunk-CVMCZZX2.js.map +7 -0
- package/dist/chunk-D3COLZZ2.js +1311 -0
- package/dist/chunk-D3COLZZ2.js.map +7 -0
- package/dist/chunk-FOOS3T5L.js +0 -0
- package/dist/chunk-FOOS3T5L.js.map +0 -0
- package/dist/{chunk-SN4LSOAR.js → chunk-GOQLR5WR.js} +452 -2
- package/dist/chunk-GOQLR5WR.js.map +7 -0
- package/dist/{chunk-FL5KFNQH.js → chunk-HNU6MM2B.js} +52 -17
- package/dist/chunk-HNU6MM2B.js.map +7 -0
- package/dist/chunk-HYJYYEPK.js +375 -0
- package/dist/chunk-HYJYYEPK.js.map +7 -0
- package/dist/chunk-JKZLNKG6.js +2041 -0
- package/dist/chunk-JKZLNKG6.js.map +7 -0
- package/dist/chunk-JYWURG5T.js +0 -0
- package/dist/chunk-JYWURG5T.js.map +0 -0
- package/dist/{chunk-FBGP5KN5.js → chunk-LWV23YVE.js} +5073 -532
- package/dist/chunk-LWV23YVE.js.map +7 -0
- package/dist/chunk-N7HC3ADV.js +30 -0
- package/dist/chunk-N7HC3ADV.js.map +7 -0
- package/dist/{chunk-RQM5Z2MU.js → chunk-RMTRWWEO.js} +633 -311
- package/dist/chunk-RMTRWWEO.js.map +7 -0
- package/dist/{chunk-NLTOY57M.js → chunk-UURZ37SD.js} +28 -48
- package/dist/chunk-UURZ37SD.js.map +7 -0
- package/dist/{chunk-B5Q53LAJ.js → chunk-UWO43BZU.js} +2 -2
- package/dist/chunk-UWO43BZU.js.map +7 -0
- package/dist/chunk-WVFGV5FT.js +0 -0
- package/dist/chunk-WVFGV5FT.js.map +0 -0
- package/dist/core.js +170 -118
- package/dist/core.js.map +2 -2
- package/dist/editor.js +156 -70
- package/dist/editor.js.map +2 -2
- package/dist/flexdesk.css +3165 -159
- package/dist/flow.js +2789 -306
- package/dist/flow.js.map +4 -4
- package/dist/host.js +109 -3
- package/dist/host.js.map +3 -3
- package/dist/reset.css +0 -0
- package/dist/tile_registry-6WZPTUZV.js +0 -0
- package/dist/tile_registry-6WZPTUZV.js.map +0 -0
- package/dist/tiles.js +657 -234
- package/dist/tiles.js.map +4 -4
- package/dist/tokens.css +0 -0
- package/dist/widgets.js +3290 -2124
- package/dist/widgets.js.map +4 -4
- package/dist/wm.js +1227 -347
- package/dist/wm.js.map +4 -4
- package/editor.js +20 -0
- package/flow.js +21 -0
- package/host.js +14 -0
- package/package.json +12 -1
- package/src/canvas/canvas_adapter.js +5 -0
- package/src/canvas/edge_router.js +0 -0
- package/src/canvas/graph/connector_router.js +0 -0
- package/src/canvas/graph/history_service.js +0 -0
- package/src/canvas/graph/node_platform.js +0 -0
- package/src/canvas/index.js +1 -0
- package/src/canvas/layered_layout.js +244 -0
- package/src/charts/chart_types.js +0 -0
- package/src/charts/data_series_plot_window.js +0 -0
- package/src/charts/downsample.js +2 -2
- package/src/charts/plot_config.js +53 -29
- package/src/charts/plot_config_editor.js +627 -0
- package/src/charts/plot_grid.js +449 -0
- package/src/charts/plot_popout_window.js +103 -317
- package/src/charts/plotly_wrapper.js +22 -2
- package/src/charts/series_transforms.js +206 -0
- package/src/core/event_bus.js +0 -0
- package/src/core/logging.js +1 -1
- package/src/core/settings.js +105 -19
- package/src/core/state_guard.js +93 -51
- package/src/core/state_guard_config.js +85 -74
- package/src/core/state_machine.js +0 -0
- package/src/editor/editor_pane.js +3 -3
- package/src/editor/monaco_editor_factory.js +124 -60
- package/src/editor/monaco_loader.js +103 -28
- package/src/editor/notebook_search.js +0 -0
- package/src/editor/notebook_tab_bar.js +38 -52
- package/src/editor/notebook_undo_manager.js +0 -0
- package/src/editor/split_pane_container.js +6 -3
- package/src/flow/canvas_editor/connections.js +90 -0
- package/src/flow/canvas_editor/editor.js +2351 -153
- package/src/flow/canvas_editor/index.js +2 -1
- package/src/flow/canvas_editor/layout.js +119 -12
- package/src/flow/canvas_editor/strings.js +80 -0
- package/src/flow/kit/always_before.js +0 -0
- package/src/flow/kit/catalogue.js +97 -3
- package/src/flow/kit/chip_input.js +0 -0
- package/src/flow/kit/dom.js +0 -0
- package/src/flow/kit/findings.js +0 -0
- package/src/flow/kit/history.js +0 -0
- package/src/flow/kit/index.js +3 -3
- package/src/flow/kit/keys.js +7 -1
- package/src/flow/kit/logic_graph.js +97 -15
- package/src/flow/kit/references.js +0 -0
- package/src/flow/kit/settings_panel.js +0 -0
- package/src/flow/kit/settings_schema.js +2 -1
- package/src/flow/kit/step_picker.js +0 -0
- package/src/flow/kit/strings.js +3 -1
- package/src/flow/kit/value_picker.js +0 -0
- package/src/flow/kit/widgets.js +86 -109
- package/src/flow/lanes/editor.js +136 -14
- package/src/flow/lanes/index.js +3 -1
- package/src/flow/lanes/layout.js +0 -0
- package/src/flow/lanes/pipeline.js +44 -2
- package/src/flow/lanes/preview.js +0 -0
- package/src/flow/lanes/strings.js +1 -0
- package/src/flow/outline/editor.js +0 -0
- package/src/flow/outline/index.js +0 -0
- package/src/flow/outline/mapping.js +0 -0
- package/src/flow/outline/menu.js +0 -0
- package/src/flow/outline/operations.js +0 -0
- package/src/flow/outline/recognise.js +0 -0
- package/src/flow/outline/strings.js +0 -0
- package/src/help/help_modal.js +168 -42
- package/src/help/help_registry.js +12 -1
- package/src/host/external_links.js +0 -0
- package/src/host/file_picker.js +117 -0
- package/src/host/host.js +10 -2
- package/src/host/photino_host.js +9 -0
- package/src/host/photino_host.md +21 -3
- package/src/host/pywebview_host.js +10 -0
- package/src/tiles/chart_tiles.js +53 -245
- package/src/tiles/config_schema.js +8 -0
- package/src/tiles/figure_tile.js +322 -0
- package/src/tiles/layout_persistence.js +3 -3
- package/src/tiles/list_tiles.js +7 -7
- package/src/tiles/scope_picker.js +0 -0
- package/src/tiles/tile_base.js +1 -1
- package/src/tiles/tile_config_form.js +442 -0
- package/src/tiles/tile_grid.js +2 -0
- package/src/tiles/tile_registry.js +0 -0
- package/src/tiling/bottom_panel_tabs.js +67 -99
- package/src/tiling/command_palette.js +64 -19
- package/src/tiling/content_registry.js +4 -1
- package/src/tiling/desktops.js +11 -1
- package/src/tiling/entity_sources.js +0 -0
- package/src/tiling/keymap.js +403 -128
- package/src/tiling/kind_taxonomy.js +78 -0
- package/src/tiling/landing_table.js +0 -0
- package/src/tiling/loading_overlay.js +0 -0
- package/src/tiling/nav_panel.js +59 -10
- package/src/tiling/page_factory.js +5 -5
- package/src/tiling/panel_availability.js +49 -0
- package/src/tiling/panel_keys.js +0 -0
- package/src/tiling/shell.js +114 -12
- package/src/tiling/tab_strip.js +0 -0
- package/src/tiling/tile_breadcrumb.js +0 -0
- package/src/tiling/tile_renderer.js +105 -9
- package/src/tiling/tile_tab_menu.js +0 -0
- package/src/tiling/tile_tree.js +0 -0
- package/src/tiling/wm.js +562 -30
- package/src/tiling/zoom.js +0 -0
- package/src/ui/base/component_base.js +0 -0
- package/src/ui/base/controller_base.js +0 -0
- package/src/ui/base/page_base.js +0 -0
- package/src/ui/components/about_dialog.js +0 -0
- package/src/ui/components/action_dropdown.js +30 -2
- package/src/ui/components/alert_log.js +0 -0
- package/src/ui/components/alerts_pane.js +0 -0
- package/src/ui/components/attribute_list_editor.js +0 -0
- package/src/ui/components/autocomplete_field.js +0 -0
- package/src/ui/components/cell_editor_host.js +293 -0
- package/src/ui/components/cell_editors.js +480 -0
- package/src/ui/components/cell_grid.js +761 -0
- package/src/ui/components/cell_paste.js +243 -0
- package/src/ui/components/cell_selection.js +220 -0
- package/src/ui/components/choice_controls.js +351 -0
- package/src/ui/components/color_field.js +211 -0
- package/src/ui/components/color_list_field.js +210 -0
- package/src/ui/components/column_fit.js +0 -0
- package/src/ui/components/column_groups.js +314 -0
- package/src/ui/components/column_order.js +142 -0
- package/src/ui/components/computing_status_window.js +98 -25
- package/src/ui/components/confirm_dialog.js +81 -38
- package/src/ui/components/context_menu.js +2 -2
- package/src/ui/components/conversation_view.js +440 -0
- package/src/ui/components/crosstab.js +289 -0
- package/src/ui/components/data_table.js +696 -71
- package/src/ui/components/detail_header.js +22 -11
- package/src/ui/components/document_outline.js +397 -0
- package/src/ui/components/drag_reorder.js +0 -0
- package/src/ui/components/fact_table.js +0 -0
- package/src/ui/components/fill_handle.js +322 -0
- package/src/ui/components/gallery_picker.js +19 -8
- package/src/ui/components/header_actions.js +55 -0
- package/src/ui/components/inline_renamer.js +0 -0
- package/src/ui/components/job_progress.js +51 -0
- package/src/ui/components/managed_window.js +27 -4
- package/src/ui/components/menu_bar.js +745 -0
- package/src/ui/components/modal.js +449 -75
- package/src/ui/components/notification_history.js +3 -3
- package/src/ui/components/progress.js +483 -0
- package/src/ui/components/record_list.js +0 -0
- package/src/ui/components/row_activation.js +0 -0
- package/src/ui/components/section_stack.js +298 -0
- package/src/ui/components/series.js +173 -0
- package/src/ui/components/settings_view.js +634 -0
- package/src/ui/components/slide_out_panel.js +43 -6
- package/src/ui/components/slider_field.js +275 -18
- package/src/ui/components/sortable_list.js +0 -0
- package/src/ui/components/staged_edits.js +361 -0
- package/src/ui/components/staged_history.js +172 -0
- package/src/ui/components/table_filter_chips.js +0 -0
- package/src/ui/components/table_state_store.js +0 -0
- package/src/ui/components/table_structure.js +182 -0
- package/src/ui/components/table_values.js +0 -0
- package/src/ui/components/tabs.js +497 -0
- package/src/ui/components/tag_input.js +215 -0
- package/src/ui/components/toast.js +25 -8
- package/src/ui/components/toggle_field.js +175 -0
- package/src/ui/components/tree_view.js +55 -34
- package/src/ui/components/tsv.js +74 -0
- package/src/ui/components/window_taskbar.js +0 -0
- package/src/ui/components/wizard.js +563 -0
- package/src/ui/controllers/window_chrome_controller.js +2 -2
- package/src/ui/notification_center.js +375 -119
- package/src/ui/utils/auto_scrollbars.js +0 -0
- package/src/ui/utils/markdown.js +709 -0
- package/src/ui/utils/native_context_menu.js +0 -0
- package/src/ui/utils/overlay_scrollbar.js +16 -12
- package/src/ui/utils/raf_resize_observer.js +0 -0
- package/src/ui/utils/scroll_lock.js +0 -0
- package/src/ui/utils/strip_scroll.js +55 -0
- package/src/ui/utils/tooltip_service.js +0 -8
- package/tiles.js +27 -0
- package/widgets.js +69 -0
- package/wm.js +28 -0
- package/dist/chunk-6JSOVNID.js.map +0 -7
- package/dist/chunk-B5Q53LAJ.js.map +0 -7
- package/dist/chunk-FBGP5KN5.js.map +0 -7
- package/dist/chunk-FL5KFNQH.js.map +0 -7
- package/dist/chunk-NLTOY57M.js.map +0 -7
- package/dist/chunk-NNFTETK3.js +0 -633
- package/dist/chunk-NNFTETK3.js.map +0 -7
- package/dist/chunk-O5OHMWBB.js +0 -284
- package/dist/chunk-O5OHMWBB.js.map +0 -7
- package/dist/chunk-RQM5Z2MU.js.map +0 -7
- package/dist/chunk-SN4LSOAR.js.map +0 -7
- package/dist/chunk-W6FBJLPW.js +0 -367
- package/dist/chunk-W6FBJLPW.js.map +0 -7
- package/src/ui/controllers/panel_state_machine.js +0 -634
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ui/components/sortable_list.js", "../src/ui/components/color_list_field.js", "../src/ui/components/modal.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Sortable List Component\n * Location: ui/components/sortable_list.js\n *\n * Purpose: Provide a reusable list component with add, remove, reorder, and rename\n * capabilities. Used for named inputs in function nodes, rules in switch nodes, etc.\n *\n * Features:\n * - Add/remove items\n * - Drag-and-drop reordering\n * - Inline rename\n * - Custom item renderer\n * - Persistence via onChange callback\n *\n * Reordering is delegated to the shared DragReorder module (the same\n * ghost + drop-placeholder technique used by the tab bars and the schema\n * editor) so the reorder behaviour is implemented once.\n */\n\nimport { DragReorder } from './drag_reorder.js';\n\n/** The class every row carries, and therefore what DragReorder must match. */\nconst ROW_CLASS = 'twm-sortable-list__row';\nconst ROW_SELECTOR = `.${ROW_CLASS}`;\nconst HANDLE_CLASS = 'twm-sortable-list__handle';\nconst HANDLE_SELECTOR = `.${HANDLE_CLASS}`;\n\nexport class SortableList {\n /**\n * Create a sortable list.\n * @param {Object} options - Configuration options\n * @param {string} options.containerId - Unique ID for the container\n * @param {Array} options.items - Initial items array\n * @param {Function} options.onChange - Called with updated items array when list changes\n * @param {Function} options.renderItem - Custom renderer for item content (receives item, index, callbacks)\n * @param {Function} options.createItem - Factory function to create new items\n * @param {string} options.emptyMessage - Message to show when list is empty\n * @param {string} options.addButtonText - Text for add button\n * @param {boolean} options.allowReorder - Whether to allow drag-and-drop reordering\n * @param {boolean} options.allowRemove - Whether to allow removing items\n * @param {number} options.minItems - Minimum number of items (blocks removal if at min)\n */\n constructor({\n containerId,\n items = [],\n onChange = null,\n renderItem = null,\n createItem = null,\n emptyMessage = 'No items',\n addButtonText = 'Add Item',\n allowReorder = true,\n allowRemove = true,\n minItems = 0,\n } = {}) {\n this.containerId = containerId || `sortable-list-${Date.now()}`;\n this.items = Array.isArray(items) ? [...items] : [];\n this.onChange = typeof onChange === 'function' ? onChange : null;\n this.renderItem = typeof renderItem === 'function' ? renderItem : this.#defaultRenderItem.bind(this);\n this.createItem = typeof createItem === 'function' ? createItem : this.#defaultCreateItem.bind(this);\n this.emptyMessage = emptyMessage;\n this.addButtonText = addButtonText;\n this.allowReorder = allowReorder;\n this.allowRemove = allowRemove;\n this.minItems = minItems;\n\n this.root = null;\n this.listEl = null;\n this._dragReorder = null;\n this._pressedHandle = false;\n }\n\n /**\n * Render the sortable list.\n * @returns {HTMLElement} The root container element\n */\n render() {\n if (this.root) {\n this.#refresh();\n return this.root;\n }\n\n this.root = document.createElement('div');\n this.root.className = 'twm-sortable-list';\n this.root.id = this.containerId;\n\n this.listEl = document.createElement('div');\n this.listEl.className = 'twm-sortable-list__items';\n\n this.root.appendChild(this.listEl);\n\n // Only show add button if addButtonText is provided\n if (this.addButtonText) {\n const addBtn = document.createElement('button');\n addBtn.type = 'button';\n addBtn.className = 'twm-sortable-list__add';\n addBtn.innerHTML = `<span class=\"material-symbols-outlined\">add</span> ${this.#escapeHtml(this.addButtonText)}`;\n addBtn.addEventListener('click', () => this.addItem());\n this.root.appendChild(addBtn);\n }\n\n this.#refresh();\n return this.root;\n }\n\n /**\n * Get current items.\n * @returns {Array} Copy of items array\n */\n getItems() {\n return [...this.items];\n }\n\n /**\n * Set items and re-render.\n * @param {Array} items - New items array\n */\n setItems(items) {\n this.items = Array.isArray(items) ? [...items] : [];\n this.#refresh();\n }\n\n /**\n * Add a new item.\n */\n addItem() {\n const newItem = this.createItem(this.items.length);\n this.items.push(newItem);\n this.#notifyChange();\n this.#refresh();\n }\n\n /**\n * Remove an item by index.\n * @param {number} index - Index of item to remove\n */\n removeItem(index) {\n if (index < 0 || index >= this.items.length) return;\n if (this.items.length <= this.minItems) return;\n \n this.items.splice(index, 1);\n this.#notifyChange();\n this.#refresh();\n }\n\n /**\n * Update an item at index.\n * @param {number} index - Index of item to update\n * @param {Object} updates - Properties to merge into item\n */\n updateItem(index, updates) {\n if (index < 0 || index >= this.items.length) return;\n \n this.items[index] = { ...this.items[index], ...updates };\n this.#notifyChange();\n }\n\n /**\n * Move an item from one index to another.\n * @param {number} fromIndex - Source index\n * @param {number} toIndex - Destination index\n */\n moveItem(fromIndex, toIndex) {\n if (fromIndex < 0 || fromIndex >= this.items.length) return;\n if (toIndex < 0 || toIndex >= this.items.length) return;\n if (fromIndex === toIndex) return;\n\n const [item] = this.items.splice(fromIndex, 1);\n this.items.splice(toIndex, 0, item);\n this.#notifyChange();\n this.#refresh();\n }\n\n /**\n * Dispose the component.\n */\n dispose() {\n this._dragReorder?.destroy();\n this._dragReorder = null;\n this.root = null;\n this.listEl = null;\n this.items = [];\n }\n\n // \u2500\u2500\u2500 Private Methods \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n #refresh() {\n if (!this.listEl) return;\n\n this.listEl.innerHTML = '';\n\n if (this.items.length === 0) {\n const empty = document.createElement('div');\n empty.className = 'twm-sortable-list__empty';\n empty.textContent = this.emptyMessage;\n this.listEl.appendChild(empty);\n return;\n }\n\n this.items.forEach((item, index) => {\n const row = this.#createRow(item, index);\n this.listEl.appendChild(row);\n });\n\n // Drag-to-reorder via the shared DragReorder module (ghost +\n // placeholder). Created once, bound to the persistent list\n // element; re-attached after each refresh to wire the rebuilt\n // rows. Drag is restricted to the grip handle.\n //\n // The item selector is ROW_SELECTOR, the class #createRow puts on\n // every row: a selector that matches no row makes nothing draggable.\n //\n // The handle restriction cannot read `dragstart`'s target: a browser\n // fires `dragstart` at the draggable element itself (the row), never\n // at the child the pointer went down on. So the press is recorded on\n // `mousedown` (which does target the handle) and the guard reads that.\n if (this.allowReorder) {\n if (!this._dragReorder) {\n this.listEl.addEventListener('mousedown', (e) => {\n this._pressedHandle = !!e.target.closest?.(HANDLE_SELECTOR);\n });\n this._dragReorder = new DragReorder({\n container: this.listEl,\n itemSelector: ROW_SELECTOR,\n keyAttr: 'index',\n axis: 'y',\n indicatorClass: 'twm-sortable-list__drop',\n draggableGuard: () => {\n const fromHandle = this._pressedHandle;\n this._pressedHandle = false;\n return fromHandle;\n },\n onReorder: (order) => this.#applyReorder(order),\n });\n }\n this._dragReorder.attach();\n }\n }\n\n /** Reorder `items` to match the new DOM order produced by a drag,\n * then notify + re-render. `order` holds the rows' pre-drag\n * `data-index` values in their new arrangement. */\n #applyReorder(order) {\n const next = order\n .map((i) => this.items[Number(i)])\n .filter((it) => it !== undefined);\n if (next.length !== this.items.length) return; // guard against drift\n this.items = next;\n this.#notifyChange();\n this.#refresh();\n }\n\n #createRow(item, index) {\n const row = document.createElement('div');\n row.className = ROW_CLASS;\n row.dataset.index = index;\n\n // Drag handle (if reordering enabled). The drag mechanics are\n // owned by the shared DragReorder instance (see #refresh); the\n // handle is just the grab affordance the drag is restricted to.\n if (this.allowReorder) {\n const handle = document.createElement('div');\n handle.className = HANDLE_CLASS;\n handle.innerHTML = '<span class=\"material-symbols-outlined\">drag_indicator</span>';\n row.appendChild(handle);\n }\n\n // Item content (custom renderer)\n const content = document.createElement('div');\n content.className = 'twm-sortable-list__content';\n \n const callbacks = {\n update: (updates) => this.updateItem(index, updates),\n remove: () => this.removeItem(index),\n moveUp: () => this.moveItem(index, index - 1),\n moveDown: () => this.moveItem(index, index + 1),\n };\n \n this.renderItem(content, item, index, callbacks);\n row.appendChild(content);\n\n // Remove button (if removal enabled)\n if (this.allowRemove) {\n const canRemove = this.items.length > this.minItems;\n const removeBtn = document.createElement('button');\n removeBtn.type = 'button';\n removeBtn.className = 'twm-sortable-list__remove';\n removeBtn.disabled = !canRemove;\n removeBtn.title = canRemove ? 'Remove' : `Minimum ${this.minItems} items required`;\n removeBtn.innerHTML = '<span class=\"material-symbols-outlined\">close</span>';\n removeBtn.addEventListener('click', () => {\n if (canRemove) this.removeItem(index);\n });\n row.appendChild(removeBtn);\n }\n\n return row;\n }\n\n #defaultRenderItem(container, item, index, callbacks) {\n const input = document.createElement('input');\n input.type = 'text';\n input.className = 'twm-sortable-list__input';\n input.value = item.name ?? item.label ?? '';\n input.placeholder = `Item ${index + 1}`;\n input.addEventListener('change', () => {\n callbacks.update({ name: input.value });\n });\n container.appendChild(input);\n }\n\n #defaultCreateItem(index) {\n return {\n id: `item_${Date.now()}_${Math.random().toString(36).substr(2, 6)}`,\n name: `item${index + 1}`,\n };\n }\n\n #notifyChange() {\n if (this.onChange) {\n this.onChange([...this.items]);\n }\n }\n\n\n #escapeHtml(str) {\n return String(str ?? '')\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n }\n}\n", "/**\n * ColorListField \u2014 an ordered list of colours: add, remove, and reorder by\n * the grip (drag) or the up / down buttons, each row a `ColorField`.\n *\n * const list = new ColorListField({\n * value: ['#1f77b4', 'rgb(255, 127, 14)'],\n * onChange: (colors, { commit }) => { ... },\n * });\n * host.appendChild(list.render());\n * list.getValue(); // ['#1f77b4', '#ff7f0e'] \u2014 or null, see below\n *\n * The list is a `SortableList` (the same add / remove / drag-reorder every\n * list in the library uses) whose rows render a `ColorField` and a pair of\n * move buttons, so the order can be changed without a pointer.\n *\n * `getValue()` is the colours in their current order as lowercase `#rrggbb`,\n * or `null` while any row holds something that is not a hex colour \u2014\n * `invalidIndexes()` says which. Empty rows count as invalid: a list entry\n * with no colour is not a colour.\n *\n * Given a `name`, the list also carries a hidden `<input name>` whose value is\n * the rows as JSON, and fires `input` on it for every edit and `change` for\n * every committed one (a row's `change`, add, remove, move). That is the\n * surface a host form listens on; `openForm` reads the list through\n * `getValue()`, not through that input.\n */\n\nimport { SortableList } from './sortable_list.js';\nimport { ColorField, isHexColor, normalizeHex } from './color_field.js';\n\nlet _seq = 0;\n\n/** A row's text as `#rrggbb`, or null when it is not a hex colour. */\nconst hexOf = (text) => {\n const t = String(text ?? '').trim();\n return isHexColor(t) ? normalizeHex(t) : null;\n};\n\nexport class ColorListField {\n /**\n * @param {Object} [o]\n * @param {string[]} [o.value] initial colours (hex or rgb())\n * @param {string[]} [o.presets] preset colours offered on every row\n * @param {string} [o.newColor] colour a newly added row starts on\n * @param {string} [o.addLabel] text of the add button\n * @param {string} [o.name] `name` of the hidden input, for a host form\n * @param {Function} [o.onChange] `(colors, { commit })`, colors as `getValue()`\n */\n constructor({\n value = [], presets = [], newColor = '#000000', addLabel = 'Add colour',\n name = null, onChange = null,\n } = {}) {\n this.presets = Array.isArray(presets) ? presets : [];\n // Converted once, as #toItems does, so an added row is what it shows.\n this.newColor = normalizeHex(String(newColor ?? '')) ?? String(newColor ?? '');\n this.addLabel = addLabel;\n this.name = name;\n this.onChange = typeof onChange === 'function' ? onChange : null;\n\n /** Row index -> its ColorField; always exactly the rendered rows. */\n this._fields = [];\n /** Whether the SortableList change being reported is a committed one. */\n this._commit = true;\n /** True while a row's own edit is written into the list's items. */\n this._rowEdit = false;\n this.list = new SortableList({\n items: this.#toItems(value),\n addButtonText: addLabel,\n emptyMessage: 'No colours',\n createItem: () => ({ id: ++_seq, text: this.newColor }),\n renderItem: (container, item, index, callbacks) =>\n this.#renderRow(container, item, index, callbacks),\n // Every SortableList change but a row's own edit (add, remove,\n // move, drag) is followed by a refresh that rebuilds all rows \u2014\n // down to none \u2014 so the old fields go first.\n onChange: () => {\n if (!this._rowEdit) this.#dropFields();\n this.#emit(this._commit);\n },\n });\n this.root = null;\n this.input = null;\n }\n\n render() {\n if (this.root) return this.root;\n const root = document.createElement('div');\n root.className = 'twm-color-list';\n if (this.name) {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = this.name;\n root.appendChild(input);\n this.input = input;\n }\n root.appendChild(this.list.render());\n this.root = root;\n this.#writeInput();\n return root;\n }\n\n /** The colours in order as `#rrggbb`, or null while any row is not one. */\n getValue() {\n const out = this.getTexts().map(hexOf);\n return out.includes(null) ? null : out;\n }\n\n /** The rows' text as it stands, valid or not. */\n getTexts() {\n return this.list.getItems().map((item) => String(item.text ?? ''));\n }\n\n /** Indexes of the rows that do not hold a hex colour. */\n invalidIndexes() {\n const bad = [];\n this.getTexts().forEach((text, i) => { if (!hexOf(text)) bad.push(i); });\n return bad;\n }\n\n /** Replace the colours without firing `onChange`. */\n setValue(colors) {\n this.#dropFields();\n this.list.setItems(this.#toItems(colors));\n this.#writeInput();\n }\n\n /** Focus the first invalid row, else the first row, else the add button. */\n focus() {\n const bad = this.invalidIndexes()[0];\n const field = this._fields[bad ?? 0];\n if (field) { field.focus(); return; }\n this.root?.querySelector('.twm-sortable-list__add')?.focus();\n }\n\n dispose() {\n this.#dropFields();\n this.list.dispose();\n this.root = null;\n this.input = null;\n }\n\n #toItems(colors) {\n // A colour that converts is kept as its hex; anything else is kept as\n // typed, so it shows \u2014 and is reported \u2014 rather than vanishing.\n return (Array.isArray(colors) ? colors : []).map((c) => ({\n id: ++_seq,\n text: normalizeHex(String(c ?? '')) ?? String(c ?? ''),\n }));\n }\n\n /** Dispose every row's field: the rows are about to be rebuilt. */\n #dropFields() {\n for (const f of this._fields) f?.dispose();\n this._fields = [];\n }\n\n #renderRow(container, item, index, callbacks) {\n const count = this.list.getItems().length;\n\n const row = document.createElement('div');\n row.className = 'twm-color-list__row';\n const field = new ColorField({\n value: item.text,\n presets: this.presets,\n label: `Colour ${index + 1}`,\n // Every edit goes into the list's items, so the list never holds\n // a stale row; `_commit` tells its onChange which kind it was.\n onChange: (_v, { commit }) => {\n this._commit = commit;\n this._rowEdit = true;\n try { callbacks.update({ text: field.getText() }); }\n finally { this._commit = true; this._rowEdit = false; }\n },\n });\n this._fields[index] = field;\n row.appendChild(field.render());\n\n const move = (icon, label, disabled, fn) => {\n const btn = document.createElement('button');\n btn.type = 'button';\n btn.className = 'twm-color-list__move';\n btn.title = label;\n btn.setAttribute('aria-label', label);\n btn.disabled = disabled;\n const glyph = document.createElement('span');\n glyph.className = 'material-symbols-outlined';\n glyph.setAttribute('aria-hidden', 'true');\n glyph.textContent = icon;\n btn.appendChild(glyph);\n btn.addEventListener('click', fn);\n row.appendChild(btn);\n };\n move('arrow_upward', 'Move up', index === 0, callbacks.moveUp);\n move('arrow_downward', 'Move down', index === count - 1, callbacks.moveDown);\n container.appendChild(row);\n }\n\n #writeInput() {\n if (this.input) this.input.value = JSON.stringify(this.getTexts());\n }\n\n #emit(commit) {\n this.#writeInput();\n if (this.input) {\n this.input.dispatchEvent(new Event('input', { bubbles: true }));\n if (commit) this.input.dispatchEvent(new Event('change', { bubbles: true }));\n }\n this.onChange?.(this.getValue(), { commit });\n }\n}\n", "/**\n * Modal helpers \u2014 prompt with form, yes/no confirm.\n *\n * Built on the canonical `ManagedWindow` (with `modal: true`) so dialogs\n * go through the same window system as everything else: same chrome,\n * same backdrop, same Esc-to-close behaviour, same z-stacking.\n *\n * Returns Promises that resolve with the form data (or null on cancel)\n * / a boolean (confirm).\n *\n * Field schema:\n * { name, label, type='text', default, step?, min?, max?, options?, required?,\n * placeholder?, hint?, validator?, rows?, create?, pick?, displayFor?,\n * onText?, offText?, disabled?, compact? }\n *\n * - type: 'text' | 'number' | 'password' | 'select' | 'textarea' |\n * 'checkbox' | 'toggle' | 'picker' | 'checklist' | 'radio' |\n * 'color' | 'colorList'\n * - hint: small dim help line rendered under the field\n * - validator: fn(value, allValues) => string | null (inline error)\n * - min / max: a `number` field's bounds \u2014 the input's own `min` / `max`\n * attributes, and on submit a value outside them is refused with a field\n * error under that field (\"Must be between 2 and 200.\"), not the browser's\n * bubble. An empty, non-required field is not out of range.\n * - rows: number of textarea rows (only used for type='textarea')\n * - toggle: a `ToggleField` switch, submitted as a boolean like a checkbox;\n * `onText` / `offText` label its state, `disabled` and `compact` pass\n * through to it\n *\n * Options \u2014 `select`, `checklist` and `radio` take `options`: bare values, or\n * `{ value, label?, disabled?, reason?, description? }`. A value comes back AS\n * ITSELF \u2014 an option whose value is the number 2 submits 2, not '2' \u2014 and a\n * default matches an option of the same text (`'2'` selects 2). A `disabled`\n * option is shown with its `reason` and is never the submitted value: it is not\n * selected by a default or by `api.set`, the reader cannot pick it, and a\n * submit that finds one selected anyway is refused with a field error.\n * `{ group: 'Heading', options: [...] }` in a select's list is an `<optgroup>`;\n * in a checklist or radio it is a `.twm-choice__group` heading over its\n * options. A combobox (a `select` with `create`) offers a group's enabled\n * options, flattened, and an entry naming a disabled one \u2014 a default or an\n * `api.set` \u2014 leaves the box empty.\n *\n * - `checklist`: toggle chips; submits the ARRAY of chosen values in the\n * list's order (`[]` for none). `required` means at least one.\n * - `radio`: one radio row per option, each with its `description` under it;\n * submits the chosen value, or null. `required` means one is chosen.\n *\n * These three are drawn by `choice_controls.js` \u2014 the same select, chips and\n * radio list as the flow kit's settings widgets, so there is one of each.\n *\n * Section dividers \u2014 entries of the form `{ section: 'Label' }` are\n * rendered as a small uppercase heading that groups the fields below\n * them. Useful for longer forms. A section that also carries a `name`\n * can be hidden and shown by `onFieldChange`'s `setVisible`.\n *\n * Rows \u2014 an entry of the form `{ row: [field, field, ...] }` puts its fields\n * side by side (a min and a max, say). Each is an ordinary field: its own\n * label, hint, error, `setVisible`, value and submitted key \u2014 the row is\n * layout only and has no name. The row stacks its fields when the form is\n * narrower than 360px (a container query on `.twm-modal__form`).\n *\n * Picker \u2014 a value the user LOOKS UP rather than types (an id chosen in a\n * search dialog, say). The row shows a read-only box and a search button;\n * the button (or a click on the box) awaits `pick(currentValue)`, which\n * resolves to `{ value, label }`, a bare value, or null to leave the field\n * alone. The value is what is submitted, the label is what is shown, and\n * `displayFor(value)` gives the label for the value the form opens with:\n *\n * {\n * name: 'parent', label: 'Parent', type: 'picker',\n * pick: async (current) => ({ value: 'EPIC-0001', label: 'EPIC-0001 \u2014 Auth' }),\n * displayFor: (value) => titleOf(value),\n * }\n *\n * Dependent-property pick-or-create \u2014 a `select` field that carries a\n * `create` spec renders as a **type-ahead combobox** instead of a\n * dropdown: the user picks an existing option OR types a new value.\n * On submit, a value that isn't an existing option is created via\n * `create.onCreate(value)` before the form resolves:\n *\n * {\n * name: 'asset_kind', label: 'Asset kind', type: 'select',\n * options: [...], // existing values (autocomplete)\n * create: {\n * onCreate: async (typed) => finalValue | null, // make the entity\n * hint: 'new asset kind', // shown when the typed value is new\n * },\n * }\n *\n * `create: true` is the degenerate case \u2014 \"pick one of these, or type\n * anything\" \u2014 where the typed value IS the value and there is no entity to\n * create, so there is no \"will create\" hint either. A bare `true` used to\n * reach `f.create.onCreate(v)` and fail the submit with \"onCreate is not a\n * function\", blaming the user for typing their own name.\n *\n * Colours \u2014 `type: 'color'` is a `ColorField` (swatch + native picker, a hex\n * box kept in step, `presets?` as swatch buttons) and submits lowercase\n * `#rrggbb`, or `''` when left empty. `type: 'colorList'` is a\n * `ColorListField` (add, remove, reorder; `presets?` on every row) and submits\n * an ordered array of `#rrggbb`. An `rgb()` default is shown as its hex. A box\n * that holds no hex colour is a field error and the form does not resolve;\n * `required` on either is checked by the form, not the browser:\n *\n * { name: 'accent', label: 'Accent', type: 'color', default: 'rgb(31,119,180)',\n * presets: ['#1f77b4', '#ff7f0e'] }\n * { name: 'palette', label: 'Palette', type: 'colorList', default: ['#1f77b4'] }\n */\n\nimport { ManagedWindow } from '../../ui/components/managed_window.js';\nimport { ToggleField } from '../../ui/components/toggle_field.js';\nimport { ColorField } from './color_field.js';\nimport { ColorListField } from './color_list_field.js';\nimport { choiceList, findChoice, flatChoices, selectBox, toggleChips } from './choice_controls.js';\n\n/**\n * C25. WHERE A DIALOG OPENS, when the application spans more than one window.\n *\n * Every modal here is a `ManagedWindow` with no `container`, so it mounts into\n * `document.body` \u2014 and \"document\" is the document this MODULE was loaded in.\n * A consumer that opens a second browser window with `window.open` and builds\n * its DOM from the opener's realm (which is how a pop-out grid works: same\n * modules, same JS context, a different document) therefore gets its dialogs in\n * the window it popped OUT of. The user presses \"Add column\" on their second\n * monitor and a dialog appears on the first, behind whatever is there.\n *\n * Passing a container at each call site was the other option and it is worse:\n * twenty-one of them across eleven files, every one of which would have to be\n * given a document it has no other reason to know about, and any one missed is\n * this bug again with no way to see it from here.\n *\n * So the HOST is ambient and the consumer sets it when its focus moves. Null \u2014\n * every consumer today \u2014 means `document.body`, exactly as before.\n */\nlet _modalHost = null;\nexport function setModalHost(el) { _modalHost = el || null; }\nexport function modalHost() { return _modalHost; }\n\nlet _modalSeq = 1;\n\n/**\n * @param {object} o\n * @param {Function?} o.onFieldChange `(name, value, api)` \u2014 called after any\n * field's `change`, and ONCE on open with `name === null` so the form starts\n * consistent with its defaults. `api` is\n * `{ setVisible(name, on), get(name), set(name, value), setOptions(name,\n * options) }`, addressing fields and named sections by name. `get` reads the\n * control as it stands (a checkbox or toggle as a boolean, a select or radio as its\n * option's own value \u2014 a select with no option selected as '', a radio\n * with none as null \u2014 a combobox as the value of the option its text names,\n * exactly as it submits, or as its text when it names none \u2014 a checklist as\n * the array of chosen values, a colorList as the array of its rows' text,\n * everything else \u2014 a colour too \u2014 as its string). An option\n * whose value IS the given one wins over one that only has its text, here,\n * in `set` and in defaults. `set` writes it (a value a select or radio does not\n * offer, or offers only disabled, clears it; so does a disabled option's\n * value in a combobox) and does NOT call\n * `onFieldChange` back, so a hook that fills one field from another cannot\n * loop. `setOptions` replaces the options of a `select` (a combobox's too),\n * `checklist` or `radio` while the form is open, keeping the current value\n * when the new list still offers it enabled \u2014 otherwise a select falls to its\n * first enabled option, a radio to none, and a checklist drops what is gone.\n * It does not call `onFieldChange` back either.\n *\n * It exists for the form whose Type select spans two record kinds and must\n * show the fields of the kind actually chosen. Rebuilding the form on every\n * change would lose what the user had already typed, so every field is\n * built once and the irrelevant rows are hidden. A hidden row keeps its\n * value and is still submitted \u2014 the caller drops what its chosen kind does\n * not use; a disabled option it holds submits as no value ('' for a select\n * or combobox, null for a radio) \u2014 but it is not ASKED about: its `required` and its `validator`\n * stand down until it is shown again, because a constraint on a field the\n * user cannot see is a submit button that silently does nothing.\n *\n * Absent \u2014 every caller before it \u2014 nothing here runs.\n */\nexport function openForm({ title, fields = [], defaults = {}, submitLabel = 'OK', onFieldChange = null } = {}) {\n return new Promise((resolve) => {\n // Build the form body \u2014 same markup as the legacy overlay,\n // minus the outer .ea-modal wrapper (ManagedWindow owns the\n // chrome now).\n const body = document.createElement('div');\n body.className = 'twm-modal__body-host';\n body.innerHTML = `\n <form class=\"twm-modal__form\">\n <div class=\"twm-modal__fields\">\n ${fields.map((f) => _renderEntry(f, defaults)).join('')}\n </div>\n <div class=\"twm-modal__error\" data-role=\"form-error\" hidden></div>\n <div class=\"twm-modal__actions\">\n <button type=\"button\" class=\"twm-btn\" data-action=\"cancel\">Cancel</button>\n <button type=\"submit\" class=\"twm-btn twm-btn--primary\">${submitLabel}</button>\n </div>\n </form>\n `;\n\n const win = new ManagedWindow({\n container: _modalHost,\n id: `twm-modal-${_modalSeq++}`,\n title: title || 'Dialog',\n icon: 'edit_note',\n content: body,\n modal: true,\n canMinimize: false,\n canMaximize: false,\n canResize: false,\n canDrag: true,\n defaultWidth: _estimateWidth(fields),\n defaultHeight: _estimateHeight(fields),\n onClose: () => {\n disposeControls();\n if (!_resolved) { _resolved = true; resolve(null); }\n },\n });\n\n let _resolved = false;\n const close = (result) => {\n if (_resolved) return;\n _resolved = true;\n resolve(result);\n try { win.close({ force: true }); } catch {}\n disposeControls();\n };\n\n const errEl = body.querySelector('[data-role=\"form-error\"]');\n const showError = (msg) => {\n if (!errEl) return;\n errEl.textContent = msg;\n errEl.hidden = !msg;\n };\n body.querySelector('[data-action=\"cancel\"]')?.addEventListener('click', () => close(null));\n\n const formFields = _formFields(fields);\n // The options each field offers NOW \u2014 `setOptions` replaces them, the\n // caller's field object is never written to.\n const optionsOf = new Map(formFields.map((f) => [f.name, f.options]));\n const comboHints = new Map();\n for (const f of formFields) {\n if (f.type === 'select' && f.create) {\n const update = _wireComboboxHint(body, f, () => optionsOf.get(f.name));\n if (update) comboHints.set(f.name, update);\n }\n if (f.type === 'picker') _wirePicker(body, f);\n }\n const rowHidden = (name) => !!body.querySelector(`[data-field-row=\"${name}\"]`)?.hidden;\n\n const clearFieldError = (name) => {\n const row = body.querySelector(`[data-field-row=\"${name}\"]`);\n const errEl = body.querySelector(`[data-field-error=\"${name}\"]`);\n if (row) row.classList.remove('twm-is-invalid');\n if (errEl) { errEl.textContent = ''; errEl.hidden = true; }\n };\n const setFieldError = (name, msg) => {\n const row = body.querySelector(`[data-field-row=\"${name}\"]`);\n const errEl = body.querySelector(`[data-field-error=\"${name}\"]`);\n if (row) row.classList.add('twm-is-invalid');\n if (errEl) { errEl.textContent = msg; errEl.hidden = false; }\n };\n // Fields that are components, not markup \u2014 toggles, selects,\n // checklists, radios and colours \u2014 are mounted into the slot their\n // row left (`_mountControl`) and read back through it: a toggle as a\n // boolean, a choice as its option's own value, a colour as its hex. `onChoice` is what a checklist or\n // radio calls when the reader changes it (a toggle or select is a\n // named control and is heard by the loops below).\n let onChoice = (name) => clearFieldError(name);\n const controls = new Map();\n for (const f of formFields) {\n const c = _mountControl(body, f, defaults[f.name] ?? f.default, (name) => onChoice(name));\n if (c) controls.set(f.name, c);\n }\n function disposeControls() {\n for (const c of controls.values()) c.dispose?.();\n controls.clear();\n }\n win.show();\n /** The option a combobox entry names \u2014 the one whose value IS it, else the\n * one whose value has its text \u2014 or undefined. `get` and the submit both\n * read a combobox through this, so they agree (`'2'` is option `2`). */\n const comboOption = (f, text) => findChoice(flatChoices(optionsOf.get(f.name)), text, true);\n /** A disabled option's reason ('' with none) when one is the value, else null. */\n const unavailable = (f, value) => {\n const c = controls.get(f.name);\n if (c) return c.unavailable();\n if (f.type !== 'select' || !f.create || value == null || value === '') return null;\n const o = comboOption(f, value);\n return o?.disabled ? (o.reason || '') : null;\n };\n\n // Clear per-field errors on input so the user sees the row recover.\n for (const f of formFields) {\n const el = body.querySelector(`[name=\"${f.name}\"]`);\n el?.addEventListener('input', () => clearFieldError(f.name));\n el?.addEventListener('change', () => clearFieldError(f.name));\n // The browser refuses a number outside its min / max before the\n // submit handler runs; its bubble is replaced by the field error\n // the submit would have shown.\n if (f.type === 'number' && _bounded(f)) {\n el?.addEventListener('invalid', (e) => {\n if (!el.validity.rangeUnderflow && !el.validity.rangeOverflow) return;\n e.preventDefault();\n setFieldError(f.name, _rangeMessage(f));\n });\n }\n }\n\n // Adaptive fields \u2014 see `onFieldChange` above.\n if (typeof onFieldChange === 'function') {\n const fieldOf = (name) => formFields.find((f) => f.name === name) || null;\n const api = {\n setVisible(name, on) {\n const row = body.querySelector(`[data-field-row=\"${name}\"]`);\n if (!row) return;\n // The attribute alone loses to `.twm-modal__row { display:\n // grid }` in any stylesheet that has not got the `[hidden]`\n // rule flexdesk.css carries, so the inline style says it too.\n row.hidden = !on;\n row.style.display = on ? '' : 'none';\n clearFieldError(name);\n // A required control nobody can see blocks the submit with\n // no message the user can find, and so does a number out\n // of its min or max. Remembered on the control, so showing\n // the row gives back exactly what it had.\n for (const el of row.querySelectorAll('input, select, textarea')) {\n if (!on && el.required) { el.required = false; el.dataset.twmRequired = '1'; }\n else if (on && el.dataset.twmRequired) { el.required = true; delete el.dataset.twmRequired; }\n for (const [attr, key] of [['min', 'twmMin'], ['max', 'twmMax']]) {\n if (!on && el.hasAttribute(attr)) { el.dataset[key] = el.getAttribute(attr); el.removeAttribute(attr); }\n else if (on && el.dataset[key] != null) { el.setAttribute(attr, el.dataset[key]); delete el.dataset[key]; }\n }\n }\n },\n get(name) {\n if (controls.has(name)) return controls.get(name).read();\n const el = body.querySelector(`[name=\"${name}\"]`);\n if (!el) return undefined;\n if (el.type === 'checkbox') return !!el.checked;\n const f = fieldOf(name);\n if (f?.type === 'select' && f.create) {\n const match = comboOption(f, el.value);\n return match ? match.value : el.value;\n }\n return el.value;\n },\n set(name, value) {\n if (controls.has(name)) { controls.get(name).write(value); return; }\n const el = body.querySelector(`[name=\"${name}\"]`);\n if (!el) return;\n if (el.type === 'checkbox') { el.checked = !!value; return; }\n const f = fieldOf(name);\n // A combobox does not take a disabled option's text either.\n const shut = f?.type === 'select' && f.create && comboOption(f, value)?.disabled;\n el.value = value == null || shut ? '' : String(value);\n comboHints.get(name)?.();\n if (f?.type === 'picker') {\n const display = body.querySelector(`[data-picker-display=\"${name}\"]`);\n if (display) display.value = _pickerLabel(f, el.value);\n }\n },\n setOptions(name, options) {\n const f = fieldOf(name);\n if (!f) return;\n const c = controls.get(name);\n if (c?.setOptions) {\n optionsOf.set(name, options);\n c.setOptions(options);\n return;\n }\n if (f.type !== 'select' || !f.create) return;\n optionsOf.set(name, options);\n const list = body.querySelector(`[data-datalist-for=\"${name}\"]`);\n if (list) list.innerHTML = _datalistOptions(options);\n comboHints.get(name)?.();\n },\n };\n const fire = (name) => {\n try { onFieldChange(name, name == null ? undefined : api.get(name), api); }\n catch (err) { console.error('[modal] onFieldChange threw', err); }\n };\n for (const f of formFields) {\n const el = body.querySelector(`[name=\"${f.name}\"]`);\n el?.addEventListener('change', () => fire(f.name));\n }\n onChoice = (name) => { clearFieldError(name); fire(name); };\n // Once on open, so a preselected value is reflected immediately\n // rather than only after the user touches something.\n fire(null);\n }\n\n body.querySelector('form').addEventListener('submit', async (e) => {\n e.preventDefault();\n const submitBtn = body.querySelector('button[type=\"submit\"]');\n showError('');\n const data = {};\n for (const f of formFields) {\n const control = controls.get(f.name);\n const el = control ? null : body.querySelector(`[name=\"${f.name}\"]`);\n if (!control && !el) continue;\n let v;\n if (control) {\n // A colour reads as its text but submits as its hex.\n v = control.submit ? control.submit() : control.read();\n // An option with no value submits '', as an empty select does.\n if (v === undefined) v = f.type === 'select' ? '' : null;\n } else if (f.type === 'checkbox') {\n v = !!el.checked;\n } else if (f.type === 'number') {\n v = (el.value === '' ? null : Number(el.value));\n } else {\n v = el.value;\n }\n if (f.type === 'select' && f.create) {\n const spec = _createSpec(f);\n // A typed value that is an option's text IS that option,\n // with the option's own value (a number stays a number).\n const match = comboOption(f, v);\n if (match) v = match.value;\n else if (v) {\n if (submitBtn) submitBtn.disabled = true;\n let created;\n let failMsg = null;\n try { created = await spec.onCreate(v); }\n catch (err) { created = null; failMsg = err?.message || String(err); }\n if (submitBtn) submitBtn.disabled = false;\n if (created == null) {\n const hint = spec.hint || f.label.toLowerCase();\n showError(failMsg\n ? `Couldn't create ${hint} \"${v}\": ${failMsg}`\n : `Couldn't create ${hint} \"${v}\". See the toast for details.`);\n return;\n }\n v = created;\n }\n }\n data[f.name] = v;\n }\n // Per-field validators run after collection so they can see\n // peer values (e.g. confirm-password matches password).\n let firstBadName = null;\n for (const f of formFields) {\n clearFieldError(f.name);\n if (rowHidden(f.name)) {\n // Not asked about \u2014 but a disabled option is still never\n // the value: a hidden row holding one submits no value.\n if (unavailable(f, data[f.name]) != null) data[f.name] = f.type === 'radio' ? null : '';\n continue;\n }\n const v = data[f.name];\n // A picker's value lives in a hidden input, and a checklist or\n // radio is no single control, so the browser's own `required`\n // check never sees them \u2014 they are checked here.\n let msg = f.required && _missing(f, v) ? 'Required.' : null;\n if (!msg && _outOfRange(f, v)) msg = _rangeMessage(f);\n if (!msg) {\n const reason = unavailable(f, v);\n if (reason != null) msg = reason ? `Not available: ${reason}` : 'Not available.';\n }\n if (!msg) msg = controls.get(f.name)?.error?.() ?? null;\n if (!msg && typeof f.validator === 'function') {\n try { msg = f.validator(v, data); } catch (err) { msg = err?.message || String(err); }\n }\n if (msg) {\n setFieldError(f.name, msg);\n if (!firstBadName) firstBadName = f.name;\n }\n }\n if (firstBadName) {\n controls.get(firstBadName)?.focus();\n body.querySelector(`[data-picker=\"${firstBadName}\"]`)?.focus();\n body.querySelector(`[name=\"${firstBadName}\"]:not([type=\"hidden\"])`)?.focus();\n return;\n }\n close(data);\n });\n\n // Focus first field on next frame so the managed-window mount\n // settles before we steal focus.\n // Not a picker's hidden value, and not a field in a row that\n // `onFieldChange` hid on open.\n requestAnimationFrame(() => {\n const first = [...body.querySelectorAll('input:not([type=\"hidden\"]), select, textarea')]\n .find((el) => !el.closest('[data-field-row]')?.hidden);\n first?.focus();\n });\n });\n}\n\n\n/**\n * `openConfirm` \u2014 a yes/no modal. Resolves `true` on confirm, `false` on\n * cancel, Esc, X or backdrop.\n *\n * `message`, `confirmLabel` and `cancelLabel` are TEXT, never markup: callers\n * put user-named things in them (\"Delete flow \"<name>\"?\"), so they are set\n * with `textContent` and a `<` in a name shows as a `<`. A `\\n` in `message`\n * breaks the line (`white-space: pre-line` on `.twm-modal__body--text`).\n */\nexport function openConfirm({\n title, message, confirmLabel = 'OK',\n cancelLabel = 'Cancel',\n danger = false, icon = null,\n} = {}) {\n return new Promise((resolve) => {\n const body = document.createElement('div');\n body.className = 'twm-modal__body-host';\n\n const messageEl = document.createElement('div');\n messageEl.className = 'twm-modal__body twm-modal__body--text';\n messageEl.textContent = message == null ? '' : String(message);\n\n const actionsEl = document.createElement('div');\n actionsEl.className = 'twm-modal__actions';\n const button = (action, className, label) => {\n const btn = document.createElement('button');\n btn.type = 'button';\n btn.className = className;\n btn.dataset.action = action;\n btn.textContent = label == null ? '' : String(label);\n actionsEl.appendChild(btn);\n };\n button('cancel', 'twm-btn', cancelLabel);\n button('confirm', danger ? 'twm-btn twm-btn--danger' : 'twm-btn twm-btn--primary', confirmLabel);\n\n body.append(messageEl, actionsEl);\n\n let _resolved = false;\n const win = new ManagedWindow({\n container: _modalHost,\n id: `twm-confirm-${_modalSeq++}`,\n title: title || 'Confirm',\n icon: icon || (danger ? 'warning' : 'help'),\n content: body,\n modal: true,\n canMinimize: false,\n canMaximize: false,\n canResize: false,\n canDrag: true,\n defaultWidth: 380,\n defaultHeight: 180,\n onClose: () => { if (!_resolved) { _resolved = true; resolve(false); } },\n });\n win.show();\n const close = (v) => {\n if (_resolved) return;\n _resolved = true;\n resolve(v);\n try { win.close({ force: true }); } catch {}\n };\n body.querySelector('[data-action=\"cancel\"]').addEventListener('click', () => close(false));\n body.querySelector('[data-action=\"confirm\"]').addEventListener('click', () => close(true));\n requestAnimationFrame(() => {\n body.querySelector(`[data-action=\"${danger ? 'cancel' : 'confirm'}\"]`)?.focus();\n });\n });\n}\n\n\n/**\n * `openModal` \u2014 rich-content modal. The third helper alongside\n * `openForm` (field-based) and `openConfirm` (yes/no).\n *\n * Use when the modal body is arbitrary DOM the caller renders itself\n * \u2014 a chart, a Monaco editor, a table, a diff view. The shell still\n * goes through ManagedWindow so the chrome, focus trap, Esc handling,\n * and z-stacking match every other modal in the app.\n *\n * Schema:\n * - `title` window title (string)\n * - `icon` optional material-symbols-outlined glyph for the\n * title bar; defaults to `info`\n * - `content` HTMLElement appended into the body. Caller owns\n * rendering \u2014 `openModal` doesn't size or style the\n * internal content beyond making it scrollable.\n * - `actions` `[{ label, value, primary?, danger?, icon? }, \u2026]`. If\n * omitted, defaults to a single `[Close]` action that\n * resolves with `null`. The first action with\n * `primary: true` is the rightmost; otherwise the\n * last action wins. Esc / X / backdrop resolve with\n * `null` regardless of what's in `actions`. `icon` is\n * an optional material-symbols-outlined ligature drawn\n * BEFORE the label; when it is given the label lives in\n * a `.twm-btn__label` span, because an icon font's\n * ligature name is itself text and would otherwise be\n * read back as part of the label.\n * - `width`,\n * `height` initial size in px. Defaults: 640 \u00D7 480.\n * - `onMount` optional `(contentEl) => void` invoked once after\n * the content is appended \u2014 handy when the caller\n * needs the bounding rect to size a chart / Monaco /\n * SVG inside the body.\n * - `backdropBlur` backdrop blur radius in px (`0` disables it).\n * - `backdropOpacity` backdrop dim, 0 (clear) \u2026 1 (opaque). Use a low\n * value (with `backdropBlur: 0`) to keep the background\n * legible \u2014 e.g. a live-applied editor where you want to\n * watch the content behind update. Omit both to inherit\n * the default look (blur 2px over a 50% dim).\n * - `maximizable` C29. Draw a maximise button in the title bar.\n * Default `false`, which is byte-for-byte what every\n * existing caller has always got.\n * - `onMaximizeChange` `(maximized, contentEl) => void`, called on each\n * flip. Only useful with `maximizable`.\n *\n * \u2550\u2550 C29. WHY A DIALOG'S MAXIMISE IS THE GEOMETRIC ONE \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n *\n * Everywhere else in this library maximise means BACK TO TILE: the window\n * stops being a window and its content returns to the tile it came out of.\n * That is R14, it is the product owner's ruling \u2014 *\"maximize here means back\n * to tile\"* \u2014 and it holds for the chrome button, the title bar's\n * double-click, an embedder's window menu and the aero-snap top edge alike.\n *\n * A DIALOG HAS NO TILE. It was never lifted out of one; it is modal, it owns\n * the screen until it resolves, and \"back to tile\" names a destination that\n * does not exist for it. So here maximise can only mean the rectangle, and\n * that is not a contradiction of the ruling but its boundary: THE RULING IS\n * ABOUT WINDOWS THAT CAME FROM A TILE. Do not \"fix\" this into a dock \u2014 there\n * is nothing to dock into, and `bringBackWindow` would refuse it anyway.\n *\n * Mechanically that means setting no `onMaximize` at all rather than reaching\n * for `toggleMaximize({claimable: false})`: with nothing claiming the gesture,\n * the ordinary path IS the rectangle, and the escape hatch is for consumers\n * who have claimed it.\n *\n * The dialog stays a dialog while maximised \u2014 `modal: true` is untouched, so\n * the backdrop, the Esc handler and the Tab focus trap (all of which hang off\n * `this.element` and the top-most-window test, not off geometry) go on working\n * exactly as they did.\n *\n * Returns a Promise resolving with the chosen action's `value`, or\n * `null` if the user dismissed the modal.\n */\nexport function openModal({\n title = 'Dialog',\n icon = 'info',\n content = null,\n actions = null,\n width = 640,\n height = 480,\n onMount = null,\n backdropBlur = undefined,\n backdropOpacity = undefined,\n maximizable = false,\n onMaximizeChange = null,\n} = {}) {\n return new Promise((resolve) => {\n const body = document.createElement('div');\n body.className = 'twm-modal__body-host';\n\n const bodyInner = document.createElement('div');\n bodyInner.className = 'twm-modal__body twm-modal__body--rich';\n if (content instanceof HTMLElement) bodyInner.appendChild(content);\n body.appendChild(bodyInner);\n\n // Actions row \u2014 default = single Close button. Esc / backdrop /\n // X all bypass this and resolve with null.\n const acts = Array.isArray(actions) && actions.length > 0\n ? actions\n : [{ label: 'Close', value: null }];\n const actionsEl = document.createElement('div');\n actionsEl.className = 'twm-modal__actions';\n acts.forEach((a, i) => {\n const btn = document.createElement('button');\n btn.type = 'button';\n let cls = 'twm-btn';\n if (a.primary) cls += ' twm-btn--primary';\n if (a.danger) cls += ' twm-btn--danger';\n btn.className = cls;\n // C26. AN ACTION MAY CARRY A GLYPH \u2014 additively, and only when it\n // asks for one. Without `icon` the button is byte-identical to what\n // every existing caller gets today: one text node, so a consumer\n // reading `btn.textContent` to find its own button keeps working.\n //\n // With one, the label moves into its own span so that reading it\n // back is still possible: an icon font's ligature name IS text\n // content (\"save\" renders as a glyph but reads as the word), so a\n // bare `textContent` on a button with an icon would answer\n // \"saveSave\". `.twm-btn__label` is the answer to \"what does this\n // button say\", and `aria-hidden` on the glyph is what keeps a screen\n // reader from saying the ligature name out loud beside the label.\n if (a.icon) {\n const glyph = document.createElement('span');\n glyph.className = 'material-symbols-outlined twm-btn__glyph';\n glyph.textContent = String(a.icon);\n glyph.setAttribute('aria-hidden', 'true');\n const text = document.createElement('span');\n text.className = 'twm-btn__label';\n text.textContent = String(a.label || '');\n btn.append(glyph, text);\n } else {\n btn.textContent = String(a.label || '');\n }\n btn.dataset.actionIdx = String(i);\n // C27. AN ACTION MAY START DISABLED, and be enabled later.\n //\n // Every action here dismisses the dialog and resolves the promise \u2014\n // that is the documented contract, and it is why a caller cannot\n // \"refuse\" a submit: by the time it sees the value, the form and\n // everything typed into it are gone. So a dialog whose primary\n // action is not yet valid has had exactly two options: let the user\n // press it and lose their work to a toast, or reach into this markup\n // from outside, which is the coupling C6 exists to remove.\n //\n // `disabled` plus the controller handed to `onMount` is the third.\n // Absent \u2014 every existing caller \u2014 the button is enabled exactly as\n // before.\n if (a.disabled) btn.disabled = true;\n if (a.value !== undefined && a.value !== null) {\n btn.dataset.actionValue = String(a.value);\n }\n actionsEl.appendChild(btn);\n });\n body.appendChild(actionsEl);\n\n let _resolved = false;\n // DECLARED BEFORE THE WINDOW, INSTALLED AFTER IT. `onClose` below closes\n // over `_dropMaxListener`, and `show()` runs between the two \u2014 so\n // leaving the declaration down where the listener is installed would\n // stretch a temporal dead zone across a call that could come back\n // through `onClose`. The cost of getting that wrong is a ReferenceError\n // inside a dismissal, which is the least debuggable place in this file.\n let _onMax = null;\n const _dropMaxListener = () => {\n if (!_onMax) return;\n window.removeEventListener('managed-window-maximized', _onMax);\n _onMax = null;\n };\n const win = new ManagedWindow({\n container: _modalHost,\n id: `twm-modal-${_modalSeq++}`,\n title,\n icon,\n content: body,\n modal: true,\n backdropBlur,\n backdropOpacity,\n canMinimize: false,\n // C29. OPT-IN, and `false` is still the default \u2014 a confirmation\n // and a two-field form have nothing to do with the extra room, and\n // a button that grows a dialog nobody wanted grown is noise in the\n // one place a user looks for the X. `onMaximize` is deliberately\n // NOT set: see the C29 note in the header \u2014 with nothing claiming\n // the gesture, `toggleMaximize` runs the rectangle, which is the\n // only thing maximise can mean for a window with no tile.\n canMaximize: !!maximizable,\n canResize: true,\n canDrag: true,\n defaultWidth: width,\n defaultHeight: height,\n // Esc, the X and the backdrop all land here without passing through\n // `close`, so the listener is dropped here as well as there \u2014 the\n // three dismissals a user reaches for most are exactly the ones\n // that would otherwise leak it.\n onClose: () => {\n _dropMaxListener();\n if (!_resolved) { _resolved = true; resolve(null); }\n },\n });\n win.show();\n\n // C29. THE STATE, FOR A CALLER WHOSE LAYOUT DEPENDS ON IT.\n //\n // `managed-window-maximized` (C16) is the framework's own edge and it\n // is global, so it is filtered on the id \u2014 the alternative, wrapping\n // `win.toggleMaximize`, would miss `_restoreState`'s replay of a\n // persisted maximised window and any consumer calling the method\n // directly. Removed on close: a dialog is short-lived and twenty of\n // them over a session leaving listeners behind is a leak with no\n // symptom until the twenty-first.\n //\n // The CSS half needs no listener at all \u2014 `ManagedWindow` toggles\n // `.twm-managed-window--maximized` on its own element, which is an\n // ancestor of everything in here, so a stylesheet can respond without\n // any of this. The callback is for the layout a stylesheet cannot\n // reach: content whose height was fixed by the CALLER's own rules.\n if (maximizable && typeof onMaximizeChange === 'function') {\n _onMax = (e) => {\n if (e.detail?.id !== win.id) return;\n try { onMaximizeChange(!!e.detail.maximized, bodyInner); }\n catch (err) { console.warn('[modal] onMaximizeChange threw', err); }\n };\n window.addEventListener('managed-window-maximized', _onMax);\n }\n\n const close = (value) => {\n if (_resolved) return;\n _resolved = true;\n _dropMaxListener();\n resolve(value);\n try { win.close({ force: true }); } catch {}\n };\n actionsEl.addEventListener('click', (e) => {\n const btn = e.target.closest('[data-action-idx]');\n if (!btn) return;\n const idx = Number(btn.dataset.actionIdx);\n const a = acts[idx];\n if (!a) return;\n // `keepOpen` actions are side-effects (Copy, Apply\n // Without Close, etc.): if the action's `onClick` returns\n // anything (or just runs), the modal stays open. Use this\n // for Copy buttons and the like.\n if (a.keepOpen) {\n // `onClick` receives `close` so the handler can\n // validate, do an async side-effect, and only then\n // dismiss the modal with whatever value it chooses.\n // Returning early without calling `close` leaves the\n // modal open (which is the whole point of keepOpen).\n try { a.onClick?.(close); } catch (err) { console.warn(err); }\n return;\n }\n close(a.value);\n });\n\n /**\n * C27. What `onMount` is handed alongside the body, so a form can keep\n * its own submit honest without knowing this file's markup.\n *\n * Addressed by an action's VALUE rather than its index: an index is a\n * fact about the order the caller happened to list them in, and a caller\n * that inserted a \"Save and add another\" in the middle would silently\n * start disabling Cancel.\n */\n const controls = {\n // NOT `CSS.escape`. It is a browser global that jsdom does not\n // provide, and this file is mounted under jsdom by four render\n // tests \u2014 so reaching for it turns \"the dialog is valid\" into a\n // ReferenceError in every one of them, and into nothing at all in a\n // headless consumer. An attribute selector needs `\"` and `\\`\n // escaped and nothing else.\n actionButton: (value) => actionsEl.querySelector(\n `[data-action-value=\"${String(value).replace(/[\"\\\\]/g, '\\\\$&')}\"]`),\n setActionEnabled(value, enabled) {\n const btn = controls.actionButton(value);\n if (btn) btn.disabled = !enabled;\n return !!btn;\n },\n };\n\n // onMount runs after the next frame so layout has settled and\n // the inner content has a real bounding box for sizing.\n if (typeof onMount === 'function') {\n requestAnimationFrame(() => {\n try { onMount(bodyInner, controls); } catch (err) { console.warn(err); }\n });\n }\n // C28. THE FIRST FIELD, IF THERE IS ONE. Otherwise the primary button.\n //\n // A dialog that asks for a name should let you type it: *\"on any 'new'\n // dialog I would like to have the first input focused by default, so\n // that I can directly start typing.\"* Focusing the action button first\n // means every new table, project and column begins with a click into a\n // field that was the only place the caret could sensibly have been.\n //\n // The button remains the fallback, which is what keeps Enter useful on\n // a dialog that asks nothing \u2014 a confirmation has no field, and there\n // the primary action IS the answer.\n //\n // DISABLED CONTROLS ARE SKIPPED, and so is anything `readonly`: a form\n // whose first control is a read-only statement panel (C27's disabled\n // primary is the sibling case) would swallow the caret into a box that\n // cannot take it.\n requestAnimationFrame(() => {\n const field = bodyInner.querySelector(\n 'input:not([type=\"hidden\"]):not([disabled]):not([readonly]),'\n + ' textarea:not([disabled]):not([readonly]),'\n + ' select:not([disabled])');\n if (field) {\n field.focus();\n // The caret at the END of whatever is already there, not\n // selecting it: an edit dialog opens on a value the user means\n // to amend, and a selected value is one keystroke from gone.\n try { field.setSelectionRange?.(field.value.length, field.value.length); }\n catch { /* a `select`, or an input type with no selection */ }\n return;\n }\n const idx = acts.findIndex((a) => a.primary);\n const which = idx >= 0 ? idx : acts.length - 1;\n actionsEl.querySelector(`[data-action-idx=\"${which}\"]`)?.focus();\n });\n });\n}\n\n\n// \u2500\u2500\u2500 helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction _estimateHeight(fields) {\n // Header (~36) + actions row (~46) + section dividers (~32 each)\n // + per-field rows (~46 text, ~140 textarea, ~32 checkbox)\n // + body padding. Clamped to 200..80vh. A `{ row }` is as tall as its\n // tallest field.\n const height = (f) => {\n if (f.section) return 32;\n const hint = f.hint ? 16 : 0;\n if (f.type === 'textarea') return 32 + (Number(f.rows) || 4) * 18 + hint;\n if (f.type === 'checkbox' || f.type === 'toggle') return 32 + hint;\n if (f.type === 'colorList') {\n const n = Array.isArray(f.default) ? f.default.length : 0;\n return 46 + Math.max(n, 1) * 40 + 40 + hint;\n }\n if (f.type === 'color') return 46 + (Array.isArray(f.presets) && f.presets.length ? 28 : 0) + hint;\n if (f.type === 'radio') {\n const opts = flatChoices(f.options);\n return 12 + opts.reduce((h, o) => h + 22 + (o.description || o.reason ? 16 : 0), 0) + hint;\n }\n return 46 + hint;\n };\n let body = 0;\n for (const f of fields) {\n body += Array.isArray(f?.row) ? Math.max(0, ..._formFields(f.row).map(height)) : height(f);\n }\n const base = 36 + 46 + 28 + body;\n const max = Math.floor(window.innerHeight * 0.8);\n return Math.max(200, Math.min(base, max));\n}\n\nfunction _estimateWidth(fields) {\n // Forms with a textarea, a colour list, a section divider or a row of\n // fields get the wider layout so multi-line content + grouped fields\n // breathe; otherwise 480 px is enough for label + single-line input pairs.\n const wide = fields.some((f) => f && (f.type === 'textarea' || f.type === 'colorList' || f.section || Array.isArray(f.row)));\n return wide ? 640 : 480;\n}\n\n/** The fields of a form's entries, rows opened up, headings left out. */\nfunction _formFields(entries) {\n return entries.flatMap((e) => (Array.isArray(e?.row) ? e.row : [e])).filter((f) => f && f.section == null);\n}\n\n/** Does a field carry a `min` or a `max`? */\nfunction _bounded(f) {\n return f.min != null || f.max != null;\n}\n\n/** Is a `number` field's submitted value outside its `min` / `max`? */\nfunction _outOfRange(f, v) {\n if (f.type !== 'number' || !_bounded(f) || v == null || Number.isNaN(v)) return false;\n return (f.min != null && v < Number(f.min)) || (f.max != null && v > Number(f.max));\n}\n\n/** The field error for a number outside its bounds. */\nfunction _rangeMessage(f) {\n if (f.min != null && f.max != null) return `Must be between ${f.min} and ${f.max}.`;\n return f.min != null ? `Must be at least ${f.min}.` : `Must be at most ${f.max}.`;\n}\n\n/** A combobox's offered options: enabled, groups flattened. */\nfunction _offered(options) {\n return flatChoices(options).filter((o) => !o.disabled);\n}\n\nfunction _datalistOptions(options) {\n return _offered(options).map((o) => `<option value=\"${_esc(o.value)}\"></option>`).join('');\n}\n\n/**\n * Mount a field that is a component rather than markup \u2014 a `toggle`, a\n * `select` (not a combobox), `checklist` or `radio` drawn by\n * `choice_controls.js`, or a `color` / `colorList` \u2014 into the\n * `data-control-slot` its row left, and hand back what the form needs of it:\n * `{ read(), write(v), focus(), unavailable(), submit?(), error?(),\n * setOptions?(options), dispose?() }`. `unavailable()` is the reason (or '')\n * when the selected option is disabled, else null. `submit()`, where given,\n * is the value submitted when it differs from what `read()` shows (a colour's\n * hex, null while its box holds none), and `error()` is the field's own\n * message for a value it cannot submit, else null. `onChange(name)` hears the\n * reader's choice on a checklist or radio; a toggle or select is a named\n * control, heard as one. Null for any other field.\n */\nfunction _mountControl(host, f, value, onChange) {\n const slot = host.querySelector(`[data-control-slot=\"${f.name}\"]`);\n if (!slot) return null;\n if (f.type === 'toggle') {\n // Mounted INTO the slot: the slot is the row's `.twm-modal__toggle`\n // cell, and the switch's own root is the <label>.\n const toggle = new ToggleField({\n name: f.name,\n checked: value === true || value === 'true',\n ariaLabel: f.label || f.name,\n onText: f.onText ?? null,\n offText: f.offText ?? null,\n disabled: !!f.disabled,\n compact: !!f.compact,\n });\n slot.appendChild(toggle.render());\n return {\n read: () => toggle.get(),\n write: (v) => toggle.set(v),\n focus: () => toggle.input?.focus(),\n unavailable: () => null,\n dispose: () => toggle.dispose(),\n };\n }\n if (f.type === 'color' || f.type === 'colorList') {\n // Read as their text as it stands (a list as its rows' text), submitted\n // as hex: `getValue()` is null while a box holds no hex colour.\n const c = f.type === 'color'\n ? new ColorField({ name: f.name, value: value ?? '', presets: f.presets, label: f.label })\n : new ColorListField({ name: f.name, value: value ?? [], presets: f.presets });\n slot.replaceWith(c.render());\n const list = f.type === 'colorList';\n return {\n read: () => (list ? c.getTexts() : c.getText()),\n submit: () => c.getValue(),\n write: (v) => c.setValue(v),\n focus: () => c.focus(),\n unavailable: () => null,\n error: () => {\n if (c.getValue() !== null) return null;\n if (!list) return 'Not a hex colour: use #rgb or #rrggbb.';\n const bad = c.invalidIndexes().map((i) => i + 1).join(', ');\n return `Not a hex colour (row ${bad}): use #rgb or #rrggbb.`;\n },\n dispose: () => c.dispose(),\n };\n }\n const common = { keepMissing: false, loose: true };\n const disabledReason = (entry) => (entry?.disabled ? (entry.reason || '') : null);\n if (f.type === 'select') {\n const c = selectBox(f.options, value, { ...common, valueAttr: 'value', className: '' });\n c.box.name = f.name;\n if (f.required) c.box.required = true;\n slot.replaceWith(c.box);\n return {\n // No option selected reads '', as an empty select always has (and\n // as it submits); a selected option reads as its own value.\n read: () => (c.entry() ? c.entry().value : ''),\n // A value the list does not offer enabled clears the select, as\n // writing an unknown `.value` always has (it then submits '').\n write: (v) => { if (!c.select(v)) c.box.selectedIndex = -1; },\n focus: () => c.box.focus(),\n unavailable: () => disabledReason(c.entry()),\n setOptions: c.setOptions,\n };\n }\n const list = (v) => (Array.isArray(v) ? v : (v == null || v === '' ? [] : [v]));\n if (f.type === 'checklist') {\n const c = toggleChips({ ...common, options: f.options, value: list(value), label: f.label || f.name,\n onChange: () => onChange(f.name) });\n slot.replaceWith(c.el);\n return {\n read: c.valueOf,\n write: (v) => c.setValue(list(v)),\n focus: () => c.el.querySelector('button:not(:disabled)')?.focus(),\n unavailable: () => null, // a disabled chip cannot be pressed, by hand or by set\n setOptions: c.setOptions,\n };\n }\n const c = choiceList({ ...common, options: f.options, value, label: f.label || f.name,\n name: `twm-form-${_modalSeq}-${f.name}`, onChange: () => onChange(f.name) });\n slot.replaceWith(c.el);\n return {\n read: () => c.valueOf() ?? null,\n write: (v) => { c.select(v); },\n focus: c.focus,\n unavailable: () => disabledReason(c.entry()),\n setOptions: c.setOptions,\n };\n}\n\n/** Is a `required` field without a value the browser cannot check for itself? */\nfunction _missing(f, v) {\n if (f.type === 'picker') return !v;\n if (f.type === 'checklist') return !Array.isArray(v) || v.length === 0;\n if (f.type === 'radio') return v == null;\n // A colour that is not a hex (null) is its own error, not a missing one.\n if (f.type === 'color') return v === '';\n if (f.type === 'colorList') return Array.isArray(v) && v.length === 0;\n return false;\n}\n\n/** Normalise a `create` spec. `true` means the typed value is accepted as-is. */\nfunction _createSpec(f) {\n if (!f || !f.create) return null;\n if (f.create === true) return { onCreate: async (v) => v, hint: null };\n return {\n onCreate: typeof f.create.onCreate === 'function' ? f.create.onCreate : async (v) => v,\n hint: f.create.hint ?? null,\n };\n}\n\n/** What a picker shows for `value`: the caller's `displayFor`, else the value. */\nfunction _pickerLabel(f, value) {\n if (typeof f.displayFor !== 'function') return value == null ? '' : String(value);\n try { return String(f.displayFor(value) ?? ''); }\n catch (err) { console.warn('[modal] displayFor threw', err); return String(value ?? ''); }\n}\n\n/** Hook a picker field's search button up to the caller's `pick()`, and keep\n * the hidden value and the visible display in step. */\nfunction _wirePicker(host, f) {\n const hidden = host.querySelector(`input[type=\"hidden\"][name=\"${f.name}\"]`);\n const display = host.querySelector(`[data-picker-display=\"${f.name}\"]`);\n const btn = host.querySelector(`[data-picker=\"${f.name}\"]`);\n if (!hidden || !display || !btn || typeof f.pick !== 'function') return;\n\n let busy = false;\n const open = async () => {\n if (busy) return; // one search at a time\n busy = true;\n let picked;\n try { picked = await f.pick(hidden.value); }\n catch (err) { console.warn('[modal] pick threw', err); picked = null; }\n finally { busy = false; }\n if (picked == null) return; // cancelled \u2014 leave it alone\n const isPair = typeof picked === 'object';\n hidden.value = String((isPair ? picked.value : picked) ?? '');\n display.value = isPair && picked.label != null\n ? String(picked.label) : _pickerLabel(f, hidden.value);\n // A hidden input fires no `change` of its own; this is the one the\n // field-error clear and `onFieldChange` listen for.\n hidden.dispatchEvent(new Event('change', { bubbles: true }));\n };\n btn.addEventListener('click', open);\n // The read-only box is the obvious thing to click; make it work too.\n display.addEventListener('click', open);\n}\n\n\n/** Show / hide the \"\u21B3 will create \u2026\" hint as the user types into a\n * create-capable combobox. */\nfunction _wireComboboxHint(host, f, optionsOf) {\n const input = host.querySelector(`input[name=\"${f.name}\"]`);\n const hintEl = host.querySelector(`.twm-combobox__hint[data-for=\"${f.name}\"]`);\n if (!input || !hintEl) return;\n // With `create: true` the typed value simply IS the value \u2014 there is no\n // entity being made, so promising to \"create\" one is a lie that reads as\n // a warning.\n if (f.create === true) return;\n const label = _createSpec(f).hint || 'new entry';\n const update = () => {\n const v = input.value.trim();\n const known = new Set(flatChoices(optionsOf()).map((o) => String(o.value)));\n if (v && !known.has(v)) {\n hintEl.textContent = `\u21B3 will create ${label} \u201C${v}\u201D`;\n hintEl.hidden = false;\n } else {\n hintEl.hidden = true;\n }\n };\n input.addEventListener('input', update);\n update();\n return update;\n}\n\n\nfunction _renderEntry(f, defaults) {\n if (f && f.section != null) {\n // A named section is addressable by `setVisible`, so a heading can be\n // hidden along with the group it introduces.\n const attr = f.name ? ` data-field-row=\"${f.name}\"` : '';\n return `<div class=\"twm-modal__section\"${attr}>${_esc(f.section)}</div>`;\n }\n // A row is layout only: each field in it is rendered exactly as it would\n // be on its own line, with its own `data-field-row`.\n if (Array.isArray(f?.row)) {\n const cells = _formFields(f.row).map((g) => _renderField(g, defaults[g.name] ?? g.default));\n return `<div class=\"twm-modal__field-group\">${cells.join('')}</div>`;\n }\n return _renderField(f, defaults[f.name] ?? f.default);\n}\n\nfunction _renderField(f, value) {\n const required = f.required ? 'required' : '';\n const rowMod = (f.type === 'textarea' || f.type === 'checklist' || f.type === 'radio')\n ? ' twm-modal__row--multiline' : '';\n const hintHtml = f.hint\n ? `<div class=\"twm-modal__hint--field\">${_esc(f.hint)}</div>` : '';\n const errHtml = `<div class=\"twm-modal__field-error\" data-field-error=\"${f.name}\" hidden></div>`;\n const wrap = (inner, tag = 'label') => `\n <${tag} class=\"twm-modal__row${rowMod}\" data-field-row=\"${f.name}\">\n <span>${_esc(f.label || '')}</span>\n ${inner}\n ${hintHtml}\n ${errHtml}\n </${tag}>\n `;\n // A component's place, filled once the markup is in (`_mountControl`).\n const slot = `<span data-control-slot=\"${f.name}\"></span>`;\n\n if (f.type === 'checkbox') {\n const checked = (value === true || value === 'true') ? 'checked' : '';\n return `\n <label class=\"twm-modal__row\" data-field-row=\"${f.name}\">\n <span></span>\n <span class=\"twm-modal__check\">\n <input name=\"${f.name}\" type=\"checkbox\" ${checked}>\n <span>${_esc(f.label || '')}</span>\n </span>\n ${hintHtml}\n ${errHtml}\n </label>\n `;\n }\n\n // A group of controls is not one labelable control: a `<label>` round it\n // would hand every click on the row to its first chip or radio.\n if (f.type === 'checklist' || f.type === 'radio') return wrap(slot, 'div');\n\n // A div, not a label: the switch's own root is the <label>, and a label\n // may not hold another.\n if (f.type === 'toggle') {\n return wrap(`<span class=\"twm-modal__toggle\" data-control-slot=\"${f.name}\"></span>`, 'div');\n }\n\n if (f.type === 'textarea') {\n const v = value == null ? '' : String(value);\n const rows = f.rows != null ? `rows=\"${Number(f.rows) || 4}\"` : 'rows=\"4\"';\n const placeholder = f.placeholder ? `placeholder=\"${_esc(f.placeholder)}\"` : '';\n return wrap(`<textarea name=\"${f.name}\" ${rows} ${placeholder} ${required}>${_esc(v)}</textarea>`);\n }\n\n if (f.type === 'color' || f.type === 'colorList') {\n // The component is mounted into the slot by `_mountControl`. A list\n // is a group of controls, so its row is not a <label>: a label would\n // hand every click on it to the first row's swatch.\n if (f.type === 'color') return wrap(slot);\n return `\n <div class=\"twm-modal__row twm-modal__row--multiline\" data-field-row=\"${f.name}\" role=\"group\" aria-label=\"${_esc(f.label || '')}\">\n <span>${_esc(f.label || '')}</span>\n ${slot}\n ${hintHtml}\n ${errHtml}\n </div>\n `;\n }\n const v = value == null ? '' : String(value);\n if (f.type === 'picker') {\n // The display text and the stored value are different things (an id\n // vs. \"EPIC-0001 \u2014 Auth rewrite\"), so the value rides in a hidden\n // input \u2014 the one the submit reads by name \u2014 and the visible box is\n // read-only.\n const placeholder = f.placeholder ? `placeholder=\"${_esc(f.placeholder)}\"` : '';\n return wrap(`\n <div class=\"twm-picker\">\n <input type=\"hidden\" name=\"${f.name}\" value=\"${_esc(v)}\">\n <input class=\"twm-picker__display\" data-picker-display=\"${f.name}\" type=\"text\"\n value=\"${_esc(_pickerLabel(f, v))}\" ${placeholder} readonly>\n <button type=\"button\" class=\"twm-btn twm-picker__btn\" data-picker=\"${f.name}\"\n aria-label=\"Search\" title=\"Search\">\n <span class=\"material-symbols-outlined\" aria-hidden=\"true\">search</span>\n </button>\n </div>\n `);\n }\n if (f.type === 'select' && f.create) {\n // A default naming a disabled option is not taken, as in a select.\n const shown = findChoice(flatChoices(f.options), value, true)?.disabled ? '' : v;\n const dlId = `ea-dl-${f.name}-${_modalSeq}`;\n const opts = _datalistOptions(f.options);\n const placeholder = f.placeholder\n ? `placeholder=\"${_esc(f.placeholder)}\"` : 'placeholder=\"type to pick or create\u2026\"';\n return wrap(`\n <div class=\"twm-combobox\">\n <input name=\"${f.name}\" type=\"text\" list=\"${dlId}\"\n value=\"${_esc(shown)}\" ${placeholder} ${required}\n autocomplete=\"off\">\n <datalist id=\"${dlId}\" data-datalist-for=\"${f.name}\">${opts}</datalist>\n <span class=\"twm-combobox__hint\" data-for=\"${f.name}\" hidden></span>\n </div>\n `);\n }\n if (f.type === 'select') return wrap(slot);\n const step = f.step != null ? `step=\"${f.step}\"` : '';\n const placeholder = f.placeholder ? `placeholder=\"${_esc(f.placeholder)}\"` : '';\n const type = (f.type === 'number' || f.type === 'password') ? f.type : 'text';\n // Attributes only a bounded number has, so no other input's markup moves.\n let bounds = '';\n if (f.type === 'number' && f.min != null) bounds += ` min=\"${_esc(f.min)}\"`;\n if (f.type === 'number' && f.max != null) bounds += ` max=\"${_esc(f.max)}\"`;\n return wrap(`<input name=\"${f.name}\" type=\"${type}\" value=\"${_esc(v)}\" ${step}${bounds} ${placeholder} ${required}>`);\n}\n\nfunction _esc(s) {\n return String(s == null ? '' : s)\n .replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')\n .replace(/\"/g, '"');\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAsBA,IAAM,YAAY;AAClB,IAAM,eAAe,IAAI,SAAS;AAClC,IAAM,e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