flexdesk 0.5.0 → 0.6.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/README.md +654 -1
- package/css/base.css +2868 -0
- package/css/flexdesk.css +2868 -0
- package/css/tokens.css +72 -0
- package/dist/canvas.js +390 -0
- package/dist/canvas.js.map +7 -0
- package/dist/charts.js +2 -2
- package/dist/{chunk-24MS7W5Y.js → chunk-6NG7YVBG.js} +2 -470
- package/dist/chunk-6NG7YVBG.js.map +7 -0
- package/dist/chunk-H4LT43RS.js +475 -0
- package/dist/chunk-H4LT43RS.js.map +7 -0
- package/dist/{chunk-KH2GJTKR.js → chunk-IYV5JVYB.js} +29 -1
- package/dist/chunk-IYV5JVYB.js.map +7 -0
- package/dist/chunk-SN4LSOAR.js +532 -0
- package/dist/chunk-SN4LSOAR.js.map +7 -0
- package/dist/{chunk-CNXP3SIN.js → chunk-ZMCRDOCF.js} +2 -2
- package/dist/flexdesk.css +2868 -0
- package/dist/flow.js +10030 -0
- package/dist/flow.js.map +7 -0
- package/dist/tiles.js +9 -9
- package/dist/tokens.css +72 -0
- package/dist/widgets.js +87 -5
- package/dist/widgets.js.map +3 -3
- package/dist/wm.js +4 -2
- package/dist/wm.js.map +1 -1
- package/package.json +9 -1
- package/src/canvas/canvas_adapter.js +523 -0
- package/src/canvas/edge_router.js +392 -0
- package/src/canvas/graph/connector_router.js +189 -0
- package/src/canvas/graph/history_service.js +170 -0
- package/src/canvas/graph/node_platform.js +116 -0
- package/src/canvas/index.js +16 -0
- package/src/flow/canvas_editor/editor.js +1081 -0
- package/src/flow/canvas_editor/index.js +16 -0
- package/src/flow/canvas_editor/layout.js +118 -0
- package/src/flow/canvas_editor/strings.js +37 -0
- package/src/flow/kit/always_before.js +325 -0
- package/src/flow/kit/catalogue.js +170 -0
- package/src/flow/kit/chip_input.js +461 -0
- package/src/flow/kit/dom.js +205 -0
- package/src/flow/kit/findings.js +129 -0
- package/src/flow/kit/history.js +173 -0
- package/src/flow/kit/index.js +38 -0
- package/src/flow/kit/keys.js +127 -0
- package/src/flow/kit/logic_graph.js +210 -0
- package/src/flow/kit/references.js +199 -0
- package/src/flow/kit/settings_panel.js +357 -0
- package/src/flow/kit/settings_schema.js +175 -0
- package/src/flow/kit/step_picker.js +209 -0
- package/src/flow/kit/strings.js +102 -0
- package/src/flow/kit/value_picker.js +238 -0
- package/src/flow/kit/widgets.js +763 -0
- package/src/flow/lanes/editor.js +1469 -0
- package/src/flow/lanes/index.js +26 -0
- package/src/flow/lanes/layout.js +525 -0
- package/src/flow/lanes/pipeline.js +327 -0
- package/src/flow/lanes/preview.js +109 -0
- package/src/flow/lanes/strings.js +98 -0
- package/src/flow/outline/editor.js +1511 -0
- package/src/flow/outline/index.js +20 -0
- package/src/flow/outline/mapping.js +286 -0
- package/src/flow/outline/menu.js +154 -0
- package/src/flow/outline/operations.js +738 -0
- package/src/flow/outline/recognise.js +755 -0
- package/src/flow/outline/strings.js +135 -0
- package/src/ui/components/data_table.js +40 -0
- package/src/ui/utils/scroll_lock.js +111 -0
- package/dist/chunk-24MS7W5Y.js.map +0 -7
- package/dist/chunk-KH2GJTKR.js.map +0 -7
- /package/dist/{chunk-CNXP3SIN.js.map → chunk-ZMCRDOCF.js.map} +0 -0
|
@@ -2,365 +2,6 @@ import {
|
|
|
2
2
|
ManagedWindow
|
|
3
3
|
} from "./chunk-6JSOVNID.js";
|
|
4
4
|
|
|
5
|
-
// src/help/help_registry.js
|
|
6
|
-
var EMPTY_PROVIDER = Object.freeze({
|
|
7
|
-
getCategories: () => [],
|
|
8
|
-
getTopicsByCategory: () => [],
|
|
9
|
-
loadTopic: async () => null,
|
|
10
|
-
searchTopics: () => []
|
|
11
|
-
});
|
|
12
|
-
var DEFAULT_COPY = Object.freeze({
|
|
13
|
-
title: "Help",
|
|
14
|
-
welcome: "Select a topic from the sidebar or browse the categories below."
|
|
15
|
-
});
|
|
16
|
-
var _provider = EMPTY_PROVIDER;
|
|
17
|
-
var _categories = Object.freeze({});
|
|
18
|
-
var _copy = DEFAULT_COPY;
|
|
19
|
-
function setHelpProvider(provider, categories = {}, copy = {}) {
|
|
20
|
-
_provider = provider ?? EMPTY_PROVIDER;
|
|
21
|
-
_categories = Object.freeze({ ...categories });
|
|
22
|
-
_copy = Object.freeze({ ...DEFAULT_COPY, ...copy });
|
|
23
|
-
}
|
|
24
|
-
function helpProvider() {
|
|
25
|
-
return _provider;
|
|
26
|
-
}
|
|
27
|
-
function helpCategories() {
|
|
28
|
-
return _categories;
|
|
29
|
-
}
|
|
30
|
-
function helpCopy() {
|
|
31
|
-
return _copy;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// src/help/help_modal.js
|
|
35
|
-
var _activeModal = null;
|
|
36
|
-
var HelpModal = class _HelpModal {
|
|
37
|
-
/** The application's help, resolved at use time. */
|
|
38
|
-
get _service() {
|
|
39
|
-
return helpProvider();
|
|
40
|
-
}
|
|
41
|
-
get _categories() {
|
|
42
|
-
return helpCategories();
|
|
43
|
-
}
|
|
44
|
-
get _copy() {
|
|
45
|
-
return helpCopy();
|
|
46
|
-
}
|
|
47
|
-
constructor() {
|
|
48
|
-
this._overlay = null;
|
|
49
|
-
this._modal = null;
|
|
50
|
-
this._currentTopic = null;
|
|
51
|
-
this._searchQuery = "";
|
|
52
|
-
this._boundKeyHandler = this._handleKeyDown.bind(this);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Open the help modal.
|
|
56
|
-
* @param {string} [topicId] - Initial topic to display
|
|
57
|
-
*/
|
|
58
|
-
async open(topicId = null) {
|
|
59
|
-
if (_activeModal && _activeModal !== this) {
|
|
60
|
-
_activeModal.close();
|
|
61
|
-
}
|
|
62
|
-
_activeModal = this;
|
|
63
|
-
this._createModal();
|
|
64
|
-
document.body.appendChild(this._overlay);
|
|
65
|
-
document.addEventListener("keydown", this._boundKeyHandler);
|
|
66
|
-
const searchInput = this._modal.querySelector(".help-search-input");
|
|
67
|
-
if (searchInput) {
|
|
68
|
-
setTimeout(() => searchInput.focus(), 100);
|
|
69
|
-
}
|
|
70
|
-
if (topicId) {
|
|
71
|
-
await this._loadTopic(topicId);
|
|
72
|
-
} else {
|
|
73
|
-
this._showIndex();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Close the help modal.
|
|
78
|
-
*/
|
|
79
|
-
close() {
|
|
80
|
-
if (this._overlay) {
|
|
81
|
-
document.removeEventListener("keydown", this._boundKeyHandler);
|
|
82
|
-
this._overlay.remove();
|
|
83
|
-
this._overlay = null;
|
|
84
|
-
this._modal = null;
|
|
85
|
-
}
|
|
86
|
-
if (_activeModal === this) {
|
|
87
|
-
_activeModal = null;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Create the modal DOM structure.
|
|
92
|
-
* @private
|
|
93
|
-
*/
|
|
94
|
-
_createModal() {
|
|
95
|
-
this._overlay = document.createElement("div");
|
|
96
|
-
this._overlay.className = "help-modal-overlay";
|
|
97
|
-
this._overlay.addEventListener("click", (e) => {
|
|
98
|
-
if (e.target === this._overlay) this.close();
|
|
99
|
-
});
|
|
100
|
-
this._modal = document.createElement("div");
|
|
101
|
-
this._modal.className = "help-modal";
|
|
102
|
-
this._modal.innerHTML = `
|
|
103
|
-
<div class="help-modal__header">
|
|
104
|
-
<div class="help-modal__title">
|
|
105
|
-
<span class="material-symbols-outlined">help</span>
|
|
106
|
-
<span>Help</span>
|
|
107
|
-
</div>
|
|
108
|
-
<button class="help-modal__close" title="Close (Esc)">
|
|
109
|
-
<span class="material-symbols-outlined">close</span>
|
|
110
|
-
</button>
|
|
111
|
-
</div>
|
|
112
|
-
<div class="help-modal__search">
|
|
113
|
-
<span class="material-symbols-outlined">search</span>
|
|
114
|
-
<input type="text" class="help-search-input" placeholder="Search help topics..." autocomplete="off">
|
|
115
|
-
</div>
|
|
116
|
-
<div class="help-modal__body">
|
|
117
|
-
<nav class="help-modal__sidebar">
|
|
118
|
-
<div class="help-sidebar__categories"></div>
|
|
119
|
-
</nav>
|
|
120
|
-
<main class="help-modal__content">
|
|
121
|
-
<div class="help-content__loading">Loading...</div>
|
|
122
|
-
</main>
|
|
123
|
-
</div>
|
|
124
|
-
`;
|
|
125
|
-
const closeBtn = this._modal.querySelector(".help-modal__close");
|
|
126
|
-
closeBtn.addEventListener("click", () => this.close());
|
|
127
|
-
const searchInput = this._modal.querySelector(".help-search-input");
|
|
128
|
-
searchInput.addEventListener("input", (e) => this._handleSearch(e.target.value));
|
|
129
|
-
searchInput.addEventListener("keydown", (e) => {
|
|
130
|
-
if (e.key === "Escape") {
|
|
131
|
-
if (e.target.value) {
|
|
132
|
-
e.target.value = "";
|
|
133
|
-
this._handleSearch("");
|
|
134
|
-
e.stopPropagation();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
this._buildSidebar();
|
|
139
|
-
this._overlay.appendChild(this._modal);
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Build the sidebar navigation.
|
|
143
|
-
* @private
|
|
144
|
-
*/
|
|
145
|
-
_buildSidebar() {
|
|
146
|
-
const container = this._modal.querySelector(".help-sidebar__categories");
|
|
147
|
-
const categories = this._service.getCategories();
|
|
148
|
-
const categoryOrder = Object.keys(this._categories);
|
|
149
|
-
categories.sort((a, b) => {
|
|
150
|
-
const orderA = categoryOrder.indexOf(a);
|
|
151
|
-
const orderB = categoryOrder.indexOf(b);
|
|
152
|
-
return (orderA === -1 ? 99 : orderA) - (orderB === -1 ? 99 : orderB);
|
|
153
|
-
});
|
|
154
|
-
container.innerHTML = categories.map((category) => {
|
|
155
|
-
const topics = this._service.getTopicsByCategory(category);
|
|
156
|
-
const label = this._categories[category]?.label || category;
|
|
157
|
-
const icon = this._categories[category]?.icon || "folder";
|
|
158
|
-
return `
|
|
159
|
-
<div class="help-category" data-category="${category}">
|
|
160
|
-
<div class="help-category__header">
|
|
161
|
-
<span class="material-symbols-outlined">${icon}</span>
|
|
162
|
-
<span>${label}</span>
|
|
163
|
-
</div>
|
|
164
|
-
<ul class="help-category__topics">
|
|
165
|
-
${topics.map((topic) => `
|
|
166
|
-
<li class="help-topic-item" data-topic="${topic.id}">
|
|
167
|
-
${topic.title}
|
|
168
|
-
</li>
|
|
169
|
-
`).join("")}
|
|
170
|
-
</ul>
|
|
171
|
-
</div>
|
|
172
|
-
`;
|
|
173
|
-
}).join("");
|
|
174
|
-
container.querySelectorAll(".help-topic-item").forEach((item) => {
|
|
175
|
-
item.addEventListener("click", () => {
|
|
176
|
-
this._loadTopic(item.dataset.topic);
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
container.querySelectorAll(".help-category__header").forEach((header) => {
|
|
180
|
-
header.addEventListener("click", () => {
|
|
181
|
-
header.parentElement.classList.toggle("collapsed");
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Show the help index page.
|
|
187
|
-
* @private
|
|
188
|
-
*/
|
|
189
|
-
_showIndex() {
|
|
190
|
-
const content = this._modal.querySelector(".help-modal__content");
|
|
191
|
-
const categories = this._service.getCategories();
|
|
192
|
-
const categoryOrder = Object.keys(this._categories);
|
|
193
|
-
categories.sort((a, b) => {
|
|
194
|
-
const orderA = categoryOrder.indexOf(a);
|
|
195
|
-
const orderB = categoryOrder.indexOf(b);
|
|
196
|
-
return (orderA === -1 ? 99 : orderA) - (orderB === -1 ? 99 : orderB);
|
|
197
|
-
});
|
|
198
|
-
content.innerHTML = `
|
|
199
|
-
<div class="help-index">
|
|
200
|
-
<h1>${this._copy.title}</h1>
|
|
201
|
-
<p>${this._copy.welcome}</p>
|
|
202
|
-
|
|
203
|
-
<div class="help-index__grid">
|
|
204
|
-
${categories.map((category) => {
|
|
205
|
-
const topics = this._service.getTopicsByCategory(category);
|
|
206
|
-
const label = this._categories[category]?.label || category;
|
|
207
|
-
const icon = this._categories[category]?.icon || "folder";
|
|
208
|
-
return `
|
|
209
|
-
<div class="help-index__category" data-category="${category}">
|
|
210
|
-
<div class="help-index__category-header">
|
|
211
|
-
<span class="material-symbols-outlined">${icon}</span>
|
|
212
|
-
<span>${label}</span>
|
|
213
|
-
</div>
|
|
214
|
-
<ul class="help-index__topics">
|
|
215
|
-
${topics.slice(0, 3).map((topic) => `
|
|
216
|
-
<li class="help-index__topic" data-topic="${topic.id}">
|
|
217
|
-
${topic.title}
|
|
218
|
-
</li>
|
|
219
|
-
`).join("")}
|
|
220
|
-
${topics.length > 3 ? `<li class="help-index__more">+${topics.length - 3} more</li>` : ""}
|
|
221
|
-
</ul>
|
|
222
|
-
</div>
|
|
223
|
-
`;
|
|
224
|
-
}).join("")}
|
|
225
|
-
</div>
|
|
226
|
-
</div>
|
|
227
|
-
`;
|
|
228
|
-
content.querySelectorAll(".help-index__topic").forEach((item) => {
|
|
229
|
-
item.addEventListener("click", () => {
|
|
230
|
-
this._loadTopic(item.dataset.topic);
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Load and display a topic.
|
|
236
|
-
* @param {string} topicId - Topic ID
|
|
237
|
-
* @private
|
|
238
|
-
*/
|
|
239
|
-
async _loadTopic(topicId) {
|
|
240
|
-
const content = this._modal.querySelector(".help-modal__content");
|
|
241
|
-
content.innerHTML = '<div class="help-content__loading">Loading...</div>';
|
|
242
|
-
this._modal.querySelectorAll(".help-topic-item").forEach((item) => {
|
|
243
|
-
item.classList.toggle("active", item.dataset.topic === topicId);
|
|
244
|
-
});
|
|
245
|
-
try {
|
|
246
|
-
const topic = await this._service.loadTopic(topicId);
|
|
247
|
-
this._currentTopic = topicId;
|
|
248
|
-
content.innerHTML = `
|
|
249
|
-
<div class="help-content__article">
|
|
250
|
-
<div class="help-content__breadcrumb">
|
|
251
|
-
<a href="#" class="help-breadcrumb__home" title="Help Index">
|
|
252
|
-
<span class="material-symbols-outlined">home</span>
|
|
253
|
-
</a>
|
|
254
|
-
<span class="help-breadcrumb__separator">/</span>
|
|
255
|
-
<span class="help-breadcrumb__title">${topic.title}</span>
|
|
256
|
-
</div>
|
|
257
|
-
<article class="help-article">
|
|
258
|
-
${topic.html}
|
|
259
|
-
</article>
|
|
260
|
-
</div>
|
|
261
|
-
`;
|
|
262
|
-
content.querySelector(".help-breadcrumb__home").addEventListener("click", (e) => {
|
|
263
|
-
e.preventDefault();
|
|
264
|
-
this._showIndex();
|
|
265
|
-
});
|
|
266
|
-
} catch (error) {
|
|
267
|
-
content.innerHTML = `
|
|
268
|
-
<div class="help-content__error">
|
|
269
|
-
<span class="material-symbols-outlined">error</span>
|
|
270
|
-
<p>Failed to load help topic.</p>
|
|
271
|
-
</div>
|
|
272
|
-
`;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Handle search input.
|
|
277
|
-
* @param {string} query - Search query
|
|
278
|
-
* @private
|
|
279
|
-
*/
|
|
280
|
-
_handleSearch(query) {
|
|
281
|
-
this._searchQuery = query;
|
|
282
|
-
const content = this._modal.querySelector(".help-modal__content");
|
|
283
|
-
if (!query.trim()) {
|
|
284
|
-
this._showIndex();
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
const results = this._service.searchTopics(query);
|
|
288
|
-
if (results.length === 0) {
|
|
289
|
-
content.innerHTML = `
|
|
290
|
-
<div class="help-search-results">
|
|
291
|
-
<h2>Search Results</h2>
|
|
292
|
-
<p class="help-search-empty">No results found for "${query}"</p>
|
|
293
|
-
</div>
|
|
294
|
-
`;
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
content.innerHTML = `
|
|
298
|
-
<div class="help-search-results">
|
|
299
|
-
<h2>Search Results</h2>
|
|
300
|
-
<p class="help-search-count">${results.length} result${results.length !== 1 ? "s" : ""} for "${query}"</p>
|
|
301
|
-
<ul class="help-search-list">
|
|
302
|
-
${results.map((topic) => `
|
|
303
|
-
<li class="help-search-item" data-topic="${topic.id}">
|
|
304
|
-
<span class="help-search-item__title">${topic.title}</span>
|
|
305
|
-
<span class="help-search-item__category">${this._categories[topic.category]?.label || topic.category}</span>
|
|
306
|
-
</li>
|
|
307
|
-
`).join("")}
|
|
308
|
-
</ul>
|
|
309
|
-
</div>
|
|
310
|
-
`;
|
|
311
|
-
content.querySelectorAll(".help-search-item").forEach((item) => {
|
|
312
|
-
item.addEventListener("click", () => {
|
|
313
|
-
this._loadTopic(item.dataset.topic);
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Handle keyboard events.
|
|
319
|
-
* @param {KeyboardEvent} event
|
|
320
|
-
* @private
|
|
321
|
-
*/
|
|
322
|
-
_handleKeyDown(event) {
|
|
323
|
-
if (event.key === "Escape") {
|
|
324
|
-
this.close();
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Static method to open help modal.
|
|
329
|
-
* @param {string} [topicId] - Initial topic
|
|
330
|
-
* @returns {HelpModal}
|
|
331
|
-
*/
|
|
332
|
-
static open(topicId = null) {
|
|
333
|
-
const modal = new _HelpModal();
|
|
334
|
-
modal.open(topicId);
|
|
335
|
-
return modal;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Get the currently active modal.
|
|
339
|
-
* @returns {HelpModal|null}
|
|
340
|
-
*/
|
|
341
|
-
static getActive() {
|
|
342
|
-
return _activeModal;
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
function setupGlobalHelpShortcut() {
|
|
346
|
-
document.addEventListener("keydown", (event) => {
|
|
347
|
-
if (event.key !== "?") return;
|
|
348
|
-
const t = event.target;
|
|
349
|
-
if (t?.closest?.(
|
|
350
|
-
'input, textarea, select, [contenteditable="true"]'
|
|
351
|
-
)) return;
|
|
352
|
-
event.preventDefault();
|
|
353
|
-
if (_activeModal) {
|
|
354
|
-
_activeModal.close();
|
|
355
|
-
} else {
|
|
356
|
-
HelpModal.open();
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
if (typeof document !== "undefined") {
|
|
361
|
-
setupGlobalHelpShortcut();
|
|
362
|
-
}
|
|
363
|
-
|
|
364
5
|
// src/ui/components/modal.js
|
|
365
6
|
var _modalHost = null;
|
|
366
7
|
function setModalHost(el) {
|
|
@@ -857,120 +498,11 @@ function _esc(s) {
|
|
|
857
498
|
return String(s == null ? "" : s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
858
499
|
}
|
|
859
500
|
|
|
860
|
-
// src/ui/components/context_menu.js
|
|
861
|
-
var _activeMenu = null;
|
|
862
|
-
var _returnFocusTo = null;
|
|
863
|
-
function showContextMenu(x, y, items, onAction) {
|
|
864
|
-
hideContextMenu();
|
|
865
|
-
_returnFocusTo = document.activeElement;
|
|
866
|
-
const menu = document.createElement("div");
|
|
867
|
-
menu.className = "twm-context-menu ea-context-menu";
|
|
868
|
-
menu.setAttribute("role", "menu");
|
|
869
|
-
for (const it of items) {
|
|
870
|
-
if (it.separator) {
|
|
871
|
-
const sep = document.createElement("div");
|
|
872
|
-
sep.className = "twm-context-menu__separator";
|
|
873
|
-
sep.setAttribute("role", "separator");
|
|
874
|
-
menu.appendChild(sep);
|
|
875
|
-
continue;
|
|
876
|
-
}
|
|
877
|
-
const row = document.createElement("button");
|
|
878
|
-
row.type = "button";
|
|
879
|
-
row.setAttribute("role", "menuitem");
|
|
880
|
-
let cls = "twm-context-menu-item";
|
|
881
|
-
if (it.danger) cls += " twm-delete-node";
|
|
882
|
-
if (it.disabled) cls += " disabled";
|
|
883
|
-
row.className = cls;
|
|
884
|
-
if (it.disabled) {
|
|
885
|
-
row.disabled = true;
|
|
886
|
-
row.setAttribute("aria-disabled", "true");
|
|
887
|
-
}
|
|
888
|
-
if (it.title) row.title = it.title;
|
|
889
|
-
row.innerHTML = `
|
|
890
|
-
<span class="material-symbols-outlined">${it.icon || ""}</span>
|
|
891
|
-
<span>${escapeHtml(it.label)}</span>
|
|
892
|
-
`;
|
|
893
|
-
if (!it.disabled) {
|
|
894
|
-
row.addEventListener("click", (e) => {
|
|
895
|
-
e.stopPropagation();
|
|
896
|
-
hideContextMenu();
|
|
897
|
-
onAction?.(it.action);
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
menu.appendChild(row);
|
|
901
|
-
}
|
|
902
|
-
(modalHost() || document.body).appendChild(menu);
|
|
903
|
-
menu.style.display = "block";
|
|
904
|
-
_activeMenu = menu;
|
|
905
|
-
const rect = menu.getBoundingClientRect();
|
|
906
|
-
const left = Math.min(x, window.innerWidth - rect.width - 8);
|
|
907
|
-
const top = Math.min(y, window.innerHeight - rect.height - 8);
|
|
908
|
-
menu.style.left = `${Math.max(0, left)}px`;
|
|
909
|
-
menu.style.top = `${Math.max(0, top)}px`;
|
|
910
|
-
setTimeout(() => {
|
|
911
|
-
document.addEventListener("mousedown", _outsideHandler, { once: true, capture: true });
|
|
912
|
-
}, 0);
|
|
913
|
-
document.addEventListener("keydown", _keyHandler);
|
|
914
|
-
window.addEventListener("scroll", hideContextMenu, { once: true, capture: true });
|
|
915
|
-
_enabledItems(menu)[0]?.focus({ preventScroll: true });
|
|
916
|
-
}
|
|
917
|
-
function hideContextMenu() {
|
|
918
|
-
if (!_activeMenu) return;
|
|
919
|
-
const returnTo = _returnFocusTo;
|
|
920
|
-
const held = _activeMenu.contains(document.activeElement);
|
|
921
|
-
_activeMenu.remove();
|
|
922
|
-
_activeMenu = null;
|
|
923
|
-
_returnFocusTo = null;
|
|
924
|
-
document.removeEventListener("keydown", _keyHandler);
|
|
925
|
-
if (held && returnTo?.isConnected) returnTo.focus?.({ preventScroll: true });
|
|
926
|
-
}
|
|
927
|
-
function _enabledItems(menu) {
|
|
928
|
-
return [...menu.querySelectorAll(".twm-context-menu-item:not(.disabled)")];
|
|
929
|
-
}
|
|
930
|
-
function _keyHandler(e) {
|
|
931
|
-
if (!_activeMenu) return;
|
|
932
|
-
if (e.key === "Escape") {
|
|
933
|
-
e.preventDefault();
|
|
934
|
-
hideContextMenu();
|
|
935
|
-
return;
|
|
936
|
-
}
|
|
937
|
-
const items = _enabledItems(_activeMenu);
|
|
938
|
-
if (items.length === 0) return;
|
|
939
|
-
const at = items.indexOf(document.activeElement);
|
|
940
|
-
let next = null;
|
|
941
|
-
if (e.key === "ArrowDown") next = items[(at + 1 + items.length) % items.length];
|
|
942
|
-
else if (e.key === "ArrowUp") next = items[(at - 1 + items.length) % items.length];
|
|
943
|
-
else if (e.key === "Home") next = items[0];
|
|
944
|
-
else if (e.key === "End") next = items[items.length - 1];
|
|
945
|
-
if (!next) return;
|
|
946
|
-
e.preventDefault();
|
|
947
|
-
next.focus({ preventScroll: true });
|
|
948
|
-
}
|
|
949
|
-
function _outsideHandler(e) {
|
|
950
|
-
if (_activeMenu && !_activeMenu.contains(e.target)) hideContextMenu();
|
|
951
|
-
}
|
|
952
|
-
function escapeHtml(s) {
|
|
953
|
-
return String(s).replace(/[&<>"']/g, (c) => ({
|
|
954
|
-
"&": "&",
|
|
955
|
-
"<": "<",
|
|
956
|
-
">": ">",
|
|
957
|
-
'"': """,
|
|
958
|
-
"'": "'"
|
|
959
|
-
})[c]);
|
|
960
|
-
}
|
|
961
|
-
|
|
962
501
|
export {
|
|
963
|
-
setHelpProvider,
|
|
964
|
-
helpProvider,
|
|
965
|
-
helpCategories,
|
|
966
|
-
helpCopy,
|
|
967
|
-
HelpModal,
|
|
968
502
|
setModalHost,
|
|
969
503
|
modalHost,
|
|
970
504
|
openForm,
|
|
971
505
|
openConfirm,
|
|
972
|
-
openModal
|
|
973
|
-
showContextMenu,
|
|
974
|
-
hideContextMenu
|
|
506
|
+
openModal
|
|
975
507
|
};
|
|
976
|
-
//# sourceMappingURL=chunk-
|
|
508
|
+
//# sourceMappingURL=chunk-6NG7YVBG.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ui/components/modal.js"],
|
|
4
|
+
"sourcesContent": ["/**\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?, options?, required?,\n * placeholder?, hint?, validator?, rows?, create? }\n *\n * - type: 'text' | 'number' | 'password' | 'select' | 'textarea' |\n * 'checkbox'\n * - hint: small dim help line rendered under the field\n * - validator: fn(value, allValues) => string | null (inline error)\n * - rows: number of textarea rows (only used for type='textarea')\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.\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\nimport { ManagedWindow } from '../../ui/components/managed_window.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\nexport function openForm({ title, fields = [], defaults = {}, submitLabel = 'OK' } = {}) {\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 ${fields.map((f) => _renderEntry(f, defaults[f.name] ?? f.default)).join('')}\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: () => { if (!_resolved) { _resolved = true; resolve(null); } },\n });\n win.show();\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 };\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 = fields.filter((f) => !f.section);\n for (const f of formFields) {\n if (f.type === 'select' && f.create) _wireComboboxHint(body, f);\n }\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 // 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 }\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 el = body.querySelector(`[name=\"${f.name}\"]`);\n if (!el) continue;\n let v;\n 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 known = new Set(_optionValues(f.options));\n if (v && !known.has(v)) {\n if (submitBtn) submitBtn.disabled = true;\n let created;\n let failMsg = null;\n try { created = await f.create.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 = (f.create && f.create.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 (typeof f.validator !== 'function') continue;\n let msg = null;\n try { msg = f.validator(data[f.name], data); } catch (err) { msg = err?.message || String(err); }\n if (msg) {\n setFieldError(f.name, msg);\n if (!firstBadName) firstBadName = f.name;\n }\n }\n if (firstBadName) {\n body.querySelector(`[name=\"${firstBadName}\"]`)?.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 requestAnimationFrame(() => {\n body.querySelector('input, select, textarea')?.focus();\n });\n });\n}\n\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 const cls = danger ? 'twm-btn twm-btn--danger' : 'twm-btn twm-btn--primary';\n body.innerHTML = `\n <div class=\"twm-modal__body\">${message}</div>\n <div class=\"twm-modal__actions\">\n <button type=\"button\" class=\"twm-btn\" data-action=\"cancel\">${cancelLabel}</button>\n <button type=\"button\" class=\"${cls}\" data-action=\"confirm\">${confirmLabel}</button>\n </div>\n `;\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.\n let body = 0;\n for (const f of fields) {\n if (f.section) body += 32;\n else if (f.type === 'textarea') {\n const rows = Number(f.rows) || 4;\n body += 32 + rows * 18;\n if (f.hint) body += 16;\n }\n else if (f.type === 'checkbox') body += 32;\n else { body += 46; if (f.hint) body += 16; }\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 or section divider get the wider layout so\n // multi-line content + grouped fields breathe; otherwise 480 px is\n // enough for label + single-line input pairs.\n const wide = fields.some((f) => f && (f.type === 'textarea' || f.section));\n return wide ? 640 : 480;\n}\n\nfunction _optionValues(options) {\n return (options || []).map((o) => (typeof o === 'object') ? o.value : o);\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) {\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 const known = new Set(_optionValues(f.options));\n const label = (f.create && f.create.hint) || 'new entry';\n const update = () => {\n const v = input.value.trim();\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}\n\n\nfunction _renderEntry(f, value) {\n if (f && f.section != null) {\n return `<div class=\"twm-modal__section\">${_esc(f.section)}</div>`;\n }\n return _renderField(f, value);\n}\n\nfunction _renderField(f, value) {\n const required = f.required ? 'required' : '';\n const rowMod = (f.type === 'textarea') ? ' 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) => `\n <label class=\"twm-modal__row${rowMod}\" data-field-row=\"${f.name}\">\n <span>${_esc(f.label || '')}</span>\n ${inner}\n ${hintHtml}\n ${errHtml}\n </label>\n `;\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 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 const v = value == null ? '' : String(value);\n if (f.type === 'select' && f.create) {\n const dlId = `ea-dl-${f.name}-${_modalSeq}`;\n const opts = _optionValues(f.options)\n .map((ov) => `<option value=\"${_esc(ov)}\"></option>`).join('');\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(v)}\" ${placeholder} ${required}\n autocomplete=\"off\">\n <datalist id=\"${dlId}\">${opts}</datalist>\n <span class=\"twm-combobox__hint\" data-for=\"${f.name}\" hidden></span>\n </div>\n `);\n }\n if (f.type === 'select') {\n const opts = (f.options || []).map((o) => {\n const ov = (typeof o === 'object') ? o.value : o;\n const ol = (typeof o === 'object') ? o.label : o;\n return `<option value=\"${_esc(ov)}\" ${ov === v ? 'selected' : ''}>${_esc(ol)}</option>`;\n }).join('');\n return wrap(`<select name=\"${f.name}\" ${required}>${opts}</select>`);\n }\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 return wrap(`<input name=\"${f.name}\" type=\"${type}\" value=\"${_esc(v)}\" ${step} ${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
|
+
"m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