u2ui 1.5.17 → 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.
package/el/carousel/carousel.js
CHANGED
package/el/fields/fields.js
CHANGED
|
@@ -12,19 +12,18 @@ function forRoot(root, method, el) {
|
|
|
12
12
|
for (const observer of observers) observer.root === root && observer[method](el);
|
|
13
13
|
}
|
|
14
14
|
function checkMutations(mutations, root) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
for (const target of mutation.removedNodes) {
|
|
21
|
-
target.nodeType === 1 && forRoot(root, '_removeTree', target);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
if (mutation.type==='attributes') {
|
|
25
|
-
forRoot(root, '_treeModified', mutation.target);
|
|
26
|
-
}
|
|
15
|
+
const added = new Set(), removed = new Set(), modified = new Set();
|
|
16
|
+
for (const m of mutations) {
|
|
17
|
+
if (m.type === 'attributes') { modified.add(m.target); continue; }
|
|
18
|
+
for (const n of m.removedNodes) n.nodeType === 1 && removed.add(n);
|
|
19
|
+
for (const n of m.addedNodes) n.nodeType === 1 && added.add(n);
|
|
27
20
|
}
|
|
21
|
+
// a node inside another node of the same batch is covered by that node's subtree
|
|
22
|
+
const top = (n, set) => { for (let p = n.parentNode; p; p = p.parentNode) if (set.has(p)) return false; return true; };
|
|
23
|
+
for (const n of removed) top(n, removed) && forRoot(root, '_removeTree', n);
|
|
24
|
+
// judged by the final state: a node that left again, or was only touched while detached, is not added
|
|
25
|
+
for (const n of added) top(n, added) && root.contains(n) && forRoot(root, '_addTree', n);
|
|
26
|
+
for (const n of modified) root.contains(n) && forRoot(root, '_treeModified', n);
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
|
|
@@ -140,16 +139,15 @@ export class SelectorObserver {
|
|
|
140
139
|
*/
|
|
141
140
|
_addTree(target) {
|
|
142
141
|
target.matches(this.selector) && this._add(target);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
142
|
+
// a scripted insert is reported as its root only, even while parsing; nodes found twice are deduped by targets
|
|
143
|
+
for (const el of target.querySelectorAll(this.selector)) this._add(el);
|
|
146
144
|
}
|
|
147
145
|
|
|
148
146
|
/**
|
|
149
147
|
* @private
|
|
150
148
|
*/
|
|
151
149
|
_removeTree(target) {
|
|
152
|
-
|
|
150
|
+
if (!this.targets.size) return;
|
|
153
151
|
this._remove(target);
|
|
154
152
|
for (const el of target.querySelectorAll('*')) this._remove(el);
|
|
155
153
|
}
|
|
@@ -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
|
|
406
|
-
|
|
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.
|
package/js/rte/src/client/ai.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
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",
|