u2ui 1.5.18 → 1.5.19

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.
@@ -1,3 +1,5 @@
1
+ // todo: shadowrootreferencetarget
2
+
1
3
  import U2Element from '../../u2/Element.js';
2
4
  export default class U2Fields extends U2Element {
3
5
  constructor() {
@@ -1,4 +1,3 @@
1
-
2
1
  class Menu {
3
2
  constructor(menuItem) {
4
3
  this.menuItem = menuItem;
@@ -323,6 +322,9 @@ document.documentElement.addEventListener('contextmenu', e=>{
323
322
  e.preventDefault();
324
323
 
325
324
  rootEl.showPopover();
325
+ // pointerup still pending (not on Windows): capture it, so it does not light-dismiss the popover
326
+ if (e.buttons) rootEl.setPointerCapture(e.pointerId);
327
+
326
328
  rootEl.querySelector('button').focus();
327
329
 
328
330
  let top = e.clientY + 2;
@@ -402,8 +402,8 @@ its replacement, as a promise or directly. `surface` comes along rather than a
402
402
  digest of it: `surface.config` says what the field allows — with `null` where
403
403
  nothing is restricted — because an answer using anything else is cleaned away on
404
404
  the way back in, and `surface.element` is where an application reads whatever
405
- else its own fields carry; a rejection is shown in the answer
406
- pane and leaves the field untouched. `prompts` fills a datalist beside the
405
+ else its own fields carry; a rejection is shown as an alert
406
+ (`js/dialog`) and leaves the panes and the field untouched. `prompts` fills a datalist beside the
407
407
  input. Without `diff` the dialog shows two panes — comparing two HTML strings is
408
408
  a library question, not an editor one, so none is pulled in. Answers that arrive
409
409
  after the next prompt, or after the dialog closed, are dropped.
@@ -148,7 +148,11 @@ async function ask(state) {
148
148
  parts.apply.disabled = false;
149
149
  await update(state, pending, run);
150
150
  } catch (error) {
151
- if (state.pending === pending && pending.run === run) parts.answer.textContent = String(error?.message ?? error);
151
+ // A failure is no answer: it comes as an alert, and the panes keep what they had.
152
+ if (state.pending === pending && pending.run === run) {
153
+ const {alert} = await import('../../../dialog/dialog.js');
154
+ alert(String(error?.message ?? error), {root: state.dialog.parentNode});
155
+ }
152
156
  } finally {
153
157
  if (state.pending === pending && pending.run === run) parts.busy.disabled = false;
154
158
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u2ui",
3
- "version": "1.5.18",
3
+ "version": "1.5.19",
4
4
  "description": "HTML Advanced: More Capabilities, Same Feel, Same Simplicity",
5
5
  "keywords": ["web-components","pattern-library","component-library","ui-toolkit","design-system"],
6
6
  "author": "Tobias Buschor",