@nonoun/native-ui 0.2.8 → 0.2.9
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/dist/components-lean.css +119 -6
- package/dist/components.css +119 -6
- package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-element.d.ts.map +1 -1
- package/dist/core/trait-runtime.d.ts.map +1 -1
- package/dist/custom-elements.json +1602 -1602
- package/dist/dialog-controller.js +38 -350
- package/dist/foundation.css +1 -15
- package/dist/{nav/inspector → inspector}/build-inspector.d.ts +2 -2
- package/dist/inspector/build-inspector.d.ts.map +1 -0
- package/dist/{nav/inspector → inspector}/ds-color-swatch-element.d.ts +1 -1
- package/dist/inspector/ds-color-swatch-element.d.ts.map +1 -0
- package/dist/inspector/ds-color-swatch.d.ts.map +1 -0
- package/dist/{nav/inspector → inspector}/ds-colors-element.d.ts +1 -1
- package/dist/inspector/ds-colors-element.d.ts.map +1 -0
- package/dist/inspector/ds-colors.d.ts.map +1 -0
- package/dist/inspector/ds-inspector-element.d.ts +15 -0
- package/dist/inspector/ds-inspector-element.d.ts.map +1 -0
- package/dist/inspector/ds-inspector.d.ts +3 -0
- package/dist/inspector/ds-inspector.d.ts.map +1 -0
- package/dist/{nav/inspector → inspector}/ds-themes-element.d.ts +1 -1
- package/dist/inspector/ds-themes-element.d.ts.map +1 -0
- package/dist/inspector/ds-themes.d.ts.map +1 -0
- package/dist/{nav/inspector → inspector}/ds-variable-element.d.ts +1 -1
- package/dist/inspector/ds-variable-element.d.ts.map +1 -0
- package/dist/inspector/ds-variable.d.ts.map +1 -0
- package/dist/{nav/inspector → inspector}/index.d.ts +1 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector.css +1 -1
- package/dist/inspector.d.ts +10 -6
- package/dist/inspector.d.ts.map +1 -1
- package/dist/inspector.js +94 -75
- package/dist/kernel.js +185 -186
- package/dist/list-navigate-controller.js +457 -0
- package/dist/native-ui-lean.css +120 -21
- package/dist/native-ui.css +120 -21
- package/dist/native-ui.js +7 -7
- package/dist/register-all.js +4 -3
- package/dist/register-all2.js +20 -19
- package/dist/traits/adapters/draggable-adapter.d.ts.map +1 -1
- package/dist/traits/drag-controller.d.ts +3 -0
- package/dist/traits/drag-controller.d.ts.map +1 -1
- package/dist/traits.js +5 -6
- package/dist/ui-icon-element.js +391 -4153
- package/dist/ui-layout-inspector-element.js +3777 -0
- package/dist/uid.js +63 -3
- package/package.json +1 -1
- package/dist/define.js +0 -62
- package/dist/nav/inspector/build-inspector.d.ts.map +0 -1
- package/dist/nav/inspector/ds-color-swatch-element.d.ts.map +0 -1
- package/dist/nav/inspector/ds-color-swatch.d.ts.map +0 -1
- package/dist/nav/inspector/ds-colors-element.d.ts.map +0 -1
- package/dist/nav/inspector/ds-colors.d.ts.map +0 -1
- package/dist/nav/inspector/ds-themes-element.d.ts.map +0 -1
- package/dist/nav/inspector/ds-themes.d.ts.map +0 -1
- package/dist/nav/inspector/ds-variable-element.d.ts.map +0 -1
- package/dist/nav/inspector/ds-variable.d.ts.map +0 -1
- package/dist/nav/inspector/index.d.ts.map +0 -1
- package/dist/ui-element.js +0 -133
- /package/dist/{nav/inspector → inspector}/ds-color-swatch.d.ts +0 -0
- /package/dist/{nav/inspector → inspector}/ds-colors.d.ts +0 -0
- /package/dist/{nav/inspector → inspector}/ds-themes.d.ts +0 -0
- /package/dist/{nav/inspector → inspector}/ds-variable.d.ts +0 -0
package/dist/kernel.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as n, n as r, r as i, t as a } from "./define.js";
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "./uid.js";
|
|
3
2
|
var o = class {
|
|
4
3
|
#e = /* @__PURE__ */ new Map();
|
|
5
4
|
#t = [];
|
|
6
5
|
#n = [];
|
|
7
|
-
#r =
|
|
8
|
-
#i =
|
|
9
|
-
#a =
|
|
6
|
+
#r = r(null);
|
|
7
|
+
#i = r(!1);
|
|
8
|
+
#a = r(null);
|
|
10
9
|
#o = 0;
|
|
11
|
-
lastCommand =
|
|
12
|
-
dispatching =
|
|
13
|
-
errors =
|
|
10
|
+
lastCommand = e(() => this.#r.value);
|
|
11
|
+
dispatching = e(() => this.#i.value);
|
|
12
|
+
errors = e(() => this.#a.value);
|
|
14
13
|
on(e, t) {
|
|
15
14
|
if (typeof e == "string") {
|
|
16
15
|
let n = e, r = this.#e.get(n);
|
|
@@ -33,24 +32,24 @@ var o = class {
|
|
|
33
32
|
t !== -1 && this.#n.splice(t, 1);
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
|
-
dispatch(e,
|
|
37
|
-
let
|
|
35
|
+
dispatch(e, t, n) {
|
|
36
|
+
let r = typeof e == "string" ? Object.freeze({
|
|
38
37
|
type: e,
|
|
39
|
-
payload:
|
|
40
|
-
id:
|
|
38
|
+
payload: t ?? null,
|
|
39
|
+
id: a("cmd"),
|
|
41
40
|
timestamp: Date.now(),
|
|
42
41
|
source: "human",
|
|
43
|
-
...
|
|
42
|
+
...n ? { meta: Object.freeze(n) } : {}
|
|
44
43
|
}) : e, o = this.#n, s = 0, c = () => {
|
|
45
44
|
if (s < o.length) {
|
|
46
45
|
let e = o[s++];
|
|
47
|
-
return e(
|
|
46
|
+
return e(r, c);
|
|
48
47
|
}
|
|
49
|
-
this.#s(
|
|
48
|
+
this.#s(r);
|
|
50
49
|
};
|
|
51
|
-
return c(),
|
|
52
|
-
this.#r.value =
|
|
53
|
-
}),
|
|
50
|
+
return c(), i(() => {
|
|
51
|
+
this.#r.value = r;
|
|
52
|
+
}), r;
|
|
54
53
|
}
|
|
55
54
|
#s(e) {
|
|
56
55
|
let t = this.#e.get(e.type);
|
|
@@ -77,15 +76,15 @@ function s() {
|
|
|
77
76
|
return new o();
|
|
78
77
|
}
|
|
79
78
|
var c = class {
|
|
80
|
-
#e =
|
|
81
|
-
#t =
|
|
79
|
+
#e = r([]);
|
|
80
|
+
#t = r([]);
|
|
82
81
|
#n = 100;
|
|
83
|
-
undoStack =
|
|
84
|
-
redoStack =
|
|
85
|
-
canUndo =
|
|
86
|
-
canRedo =
|
|
82
|
+
undoStack = e(() => this.#e.value);
|
|
83
|
+
redoStack = e(() => this.#t.value);
|
|
84
|
+
canUndo = e(() => this.#e.value.length > 0);
|
|
85
|
+
canRedo = e(() => this.#t.value.length > 0);
|
|
87
86
|
push(e) {
|
|
88
|
-
e.meta?.undoType &&
|
|
87
|
+
e.meta?.undoType && i(() => {
|
|
89
88
|
let t = [...this.#e.value, e];
|
|
90
89
|
t.length > this.#n && t.shift(), this.#e.value = t, this.#t.value = [];
|
|
91
90
|
});
|
|
@@ -94,7 +93,7 @@ var c = class {
|
|
|
94
93
|
let t = this.#e.value;
|
|
95
94
|
if (t.length === 0) return null;
|
|
96
95
|
let n = t[t.length - 1];
|
|
97
|
-
return
|
|
96
|
+
return i(() => {
|
|
98
97
|
this.#e.value = t.slice(0, -1), this.#t.value = [...this.#t.value, n];
|
|
99
98
|
}), e.dispatch(n.meta.undoType, n.meta.undoPayload ?? null, { planId: n.meta?.planId }), n;
|
|
100
99
|
}
|
|
@@ -102,16 +101,16 @@ var c = class {
|
|
|
102
101
|
let t = this.#t.value;
|
|
103
102
|
if (t.length === 0) return null;
|
|
104
103
|
let n = t[t.length - 1];
|
|
105
|
-
|
|
104
|
+
i(() => {
|
|
106
105
|
this.#t.value = t.slice(0, -1);
|
|
107
106
|
let e = [...this.#e.value, n];
|
|
108
107
|
e.length > this.#n && e.shift(), this.#e.value = e;
|
|
109
108
|
});
|
|
110
|
-
let
|
|
109
|
+
let r = Object.freeze({
|
|
111
110
|
...n,
|
|
112
111
|
source: "replay"
|
|
113
112
|
});
|
|
114
|
-
return e.dispatch(
|
|
113
|
+
return e.dispatch(r), n;
|
|
115
114
|
}
|
|
116
115
|
getLog() {
|
|
117
116
|
return this.#e.value;
|
|
@@ -122,7 +121,7 @@ var c = class {
|
|
|
122
121
|
t.length > e && (this.#e.value = t.slice(t.length - e));
|
|
123
122
|
}
|
|
124
123
|
clear() {
|
|
125
|
-
|
|
124
|
+
i(() => {
|
|
126
125
|
this.#e.value = [], this.#t.value = [];
|
|
127
126
|
});
|
|
128
127
|
}
|
|
@@ -132,27 +131,27 @@ function l(e) {
|
|
|
132
131
|
return e !== void 0 && t.setMaxSize(e), t;
|
|
133
132
|
}
|
|
134
133
|
var u = 1e3, d = 10, f = class {
|
|
135
|
-
#e =
|
|
134
|
+
#e = r([]);
|
|
136
135
|
#t = !1;
|
|
137
136
|
#n = /* @__PURE__ */ new Map();
|
|
138
|
-
stack =
|
|
139
|
-
topOverlay =
|
|
137
|
+
stack = e(() => this.#e.value);
|
|
138
|
+
topOverlay = e(() => {
|
|
140
139
|
let e = this.#e.value;
|
|
141
140
|
return e.length > 0 ? e[e.length - 1] : null;
|
|
142
141
|
});
|
|
143
142
|
open(e) {
|
|
144
|
-
let
|
|
145
|
-
id:
|
|
143
|
+
let t = a("overlay"), n = this.getNextZIndex(), r = Object.freeze({
|
|
144
|
+
id: t,
|
|
146
145
|
type: e.type,
|
|
147
146
|
element: e.element,
|
|
148
|
-
zIndex:
|
|
147
|
+
zIndex: n,
|
|
149
148
|
...e.owner ? { owner: e.owner } : {}
|
|
150
|
-
}),
|
|
151
|
-
this.#n.set(
|
|
149
|
+
}), i = new Promise((e) => {
|
|
150
|
+
this.#n.set(t, e);
|
|
152
151
|
});
|
|
153
|
-
return this.#e.value = [...this.#e.value,
|
|
154
|
-
id:
|
|
155
|
-
closed:
|
|
152
|
+
return this.#e.value = [...this.#e.value, r], this.#i(), {
|
|
153
|
+
id: t,
|
|
154
|
+
closed: i
|
|
156
155
|
};
|
|
157
156
|
}
|
|
158
157
|
close(e) {
|
|
@@ -214,9 +213,9 @@ function p() {
|
|
|
214
213
|
}
|
|
215
214
|
var m = 0, h = class {
|
|
216
215
|
#e = [];
|
|
217
|
-
#t =
|
|
216
|
+
#t = r(["global"]);
|
|
218
217
|
#n = !1;
|
|
219
|
-
activeScope =
|
|
218
|
+
activeScope = e(() => {
|
|
220
219
|
let e = this.#t.value;
|
|
221
220
|
return e[e.length - 1];
|
|
222
221
|
});
|
|
@@ -398,17 +397,17 @@ function se(e) {
|
|
|
398
397
|
return new oe(e);
|
|
399
398
|
}
|
|
400
399
|
var ce = class {
|
|
401
|
-
#e =
|
|
400
|
+
#e = r([]);
|
|
402
401
|
#t = 1e3;
|
|
403
|
-
entries =
|
|
404
|
-
size =
|
|
402
|
+
entries = e(() => this.#e.value);
|
|
403
|
+
size = e(() => this.#e.value.length);
|
|
405
404
|
log(e) {
|
|
406
|
-
let
|
|
407
|
-
id:
|
|
405
|
+
let t = Object.freeze({
|
|
406
|
+
id: a("log"),
|
|
408
407
|
timestamp: Date.now(),
|
|
409
408
|
...e
|
|
410
|
-
}),
|
|
411
|
-
return
|
|
409
|
+
}), n = [t, ...this.#e.value];
|
|
410
|
+
return n.length > this.#t && (n.length = this.#t), this.#e.value = n, t;
|
|
412
411
|
}
|
|
413
412
|
query(e) {
|
|
414
413
|
let t = this.#e.value;
|
|
@@ -463,9 +462,9 @@ function le(e) {
|
|
|
463
462
|
return e !== void 0 && t.setMaxSize(e), t;
|
|
464
463
|
}
|
|
465
464
|
var v = class {
|
|
466
|
-
#e =
|
|
465
|
+
#e = r([]);
|
|
467
466
|
#t = 500;
|
|
468
|
-
samples =
|
|
467
|
+
samples = e(() => this.#e.value);
|
|
469
468
|
measure(e, t) {
|
|
470
469
|
let n = performance.now();
|
|
471
470
|
try {
|
|
@@ -522,31 +521,31 @@ function pe(e) {
|
|
|
522
521
|
var y = class {
|
|
523
522
|
#e = /* @__PURE__ */ new Map();
|
|
524
523
|
#t = /* @__PURE__ */ new Map();
|
|
525
|
-
#n =
|
|
526
|
-
#r =
|
|
524
|
+
#n = r(!1);
|
|
525
|
+
#r = r(null);
|
|
527
526
|
#i = 0;
|
|
528
|
-
loading =
|
|
529
|
-
error =
|
|
530
|
-
query(
|
|
531
|
-
let
|
|
532
|
-
if (a &&
|
|
527
|
+
loading = e(() => this.#n.value);
|
|
528
|
+
error = e(() => this.#r.value);
|
|
529
|
+
query(t) {
|
|
530
|
+
let n = pe(t), i = t.cacheTtl ?? 0, a = this.#e.get(n);
|
|
531
|
+
if (a && i > 0 && Date.now() - a.entry.timestamp < i) return e(() => a.signal.value);
|
|
533
532
|
let o = a;
|
|
534
533
|
return o || (o = {
|
|
535
534
|
entry: {
|
|
536
535
|
data: null,
|
|
537
536
|
timestamp: 0
|
|
538
537
|
},
|
|
539
|
-
signal:
|
|
540
|
-
}, this.#e.set(
|
|
538
|
+
signal: r(null)
|
|
539
|
+
}, this.#e.set(n, o)), this.#a(t, n), e(() => o.signal.value);
|
|
541
540
|
}
|
|
542
541
|
async mutate(e, t) {
|
|
543
|
-
let
|
|
544
|
-
if (t) if (a = this.#e.get(t.key),
|
|
542
|
+
let n, a;
|
|
543
|
+
if (t) if (a = this.#e.get(t.key), n = a?.signal.peek() ?? null, a) a.signal.value = t.value, a.entry = Object.freeze({
|
|
545
544
|
data: t.value,
|
|
546
545
|
timestamp: Date.now()
|
|
547
546
|
});
|
|
548
547
|
else {
|
|
549
|
-
let e =
|
|
548
|
+
let e = r(t.value);
|
|
550
549
|
a = {
|
|
551
550
|
entry: Object.freeze({
|
|
552
551
|
data: t.value,
|
|
@@ -556,29 +555,29 @@ var y = class {
|
|
|
556
555
|
}, this.#e.set(t.key, a);
|
|
557
556
|
}
|
|
558
557
|
try {
|
|
559
|
-
let
|
|
560
|
-
return
|
|
558
|
+
let n = await this.#s(e), a = pe(e);
|
|
559
|
+
return i(() => {
|
|
561
560
|
let e = Object.freeze({
|
|
562
|
-
data:
|
|
561
|
+
data: n,
|
|
563
562
|
timestamp: Date.now()
|
|
564
|
-
}),
|
|
565
|
-
if (
|
|
563
|
+
}), i = this.#e.get(a);
|
|
564
|
+
if (i ? (i.signal.value = n, i.entry = e) : this.#e.set(a, {
|
|
566
565
|
entry: e,
|
|
567
|
-
signal: n
|
|
566
|
+
signal: r(n)
|
|
568
567
|
}), t && t.key !== a) {
|
|
569
|
-
let
|
|
570
|
-
|
|
568
|
+
let r = this.#e.get(t.key);
|
|
569
|
+
r && (r.signal.value = n, r.entry = e);
|
|
571
570
|
}
|
|
572
|
-
}),
|
|
571
|
+
}), n;
|
|
573
572
|
} catch (e) {
|
|
574
|
-
t && a &&
|
|
575
|
-
a.signal.value =
|
|
576
|
-
data:
|
|
573
|
+
t && a && i(() => {
|
|
574
|
+
a.signal.value = n, a.entry = Object.freeze({
|
|
575
|
+
data: n,
|
|
577
576
|
timestamp: Date.now()
|
|
578
577
|
});
|
|
579
578
|
});
|
|
580
|
-
let
|
|
581
|
-
throw this.#r.value =
|
|
579
|
+
let r = e instanceof Error ? e : Error(String(e));
|
|
580
|
+
throw this.#r.value = r, r;
|
|
582
581
|
}
|
|
583
582
|
}
|
|
584
583
|
invalidate(e) {
|
|
@@ -604,22 +603,22 @@ var y = class {
|
|
|
604
603
|
this.#t.clear();
|
|
605
604
|
}
|
|
606
605
|
destroy() {
|
|
607
|
-
this.abortAll(), this.#e.clear(),
|
|
606
|
+
this.abortAll(), this.#e.clear(), i(() => {
|
|
608
607
|
this.#n.value = !1, this.#r.value = null;
|
|
609
608
|
}), this.#i = 0;
|
|
610
609
|
}
|
|
611
610
|
async #a(e, t) {
|
|
612
611
|
this.#c();
|
|
613
612
|
try {
|
|
614
|
-
let
|
|
615
|
-
|
|
613
|
+
let n = await this.#o(e);
|
|
614
|
+
i(() => {
|
|
616
615
|
let e = Object.freeze({
|
|
617
|
-
data:
|
|
616
|
+
data: n,
|
|
618
617
|
timestamp: Date.now()
|
|
619
|
-
}),
|
|
620
|
-
|
|
618
|
+
}), i = this.#e.get(t);
|
|
619
|
+
i ? (i.signal.value = n, i.entry = e) : this.#e.set(t, {
|
|
621
620
|
entry: e,
|
|
622
|
-
signal: n
|
|
621
|
+
signal: r(n)
|
|
623
622
|
}), this.#r.value = null;
|
|
624
623
|
});
|
|
625
624
|
} catch (e) {
|
|
@@ -692,11 +691,11 @@ var y = class {
|
|
|
692
691
|
function me() {
|
|
693
692
|
return new y();
|
|
694
693
|
}
|
|
695
|
-
function x(e,
|
|
694
|
+
function x(e, t) {
|
|
696
695
|
return Object.freeze({
|
|
697
|
-
id:
|
|
696
|
+
id: a("bind"),
|
|
698
697
|
source: e,
|
|
699
|
-
...
|
|
698
|
+
...t
|
|
700
699
|
});
|
|
701
700
|
}
|
|
702
701
|
var he = new Set(/* @__PURE__ */ "alert.alertdialog.application.article.banner.button.cell.checkbox.columnheader.combobox.complementary.contentinfo.definition.dialog.directory.document.feed.figure.form.grid.gridcell.group.heading.img.link.list.listbox.listitem.log.main.marquee.math.menu.menubar.menuitem.menuitemcheckbox.menuitemradio.meter.navigation.none.note.option.presentation.progressbar.radio.radiogroup.region.row.rowgroup.rowheader.scrollbar.search.searchbox.separator.slider.spinbutton.status.switch.tab.table.tablist.tabpanel.term.textbox.timer.toolbar.tooltip.tree.treegrid.treeitem".split(".")), ge = new Set([
|
|
@@ -1066,21 +1065,21 @@ function E(e, t) {
|
|
|
1066
1065
|
return !1;
|
|
1067
1066
|
}
|
|
1068
1067
|
var D = class {
|
|
1069
|
-
#e =
|
|
1070
|
-
#t =
|
|
1068
|
+
#e = r([]);
|
|
1069
|
+
#t = r([]);
|
|
1071
1070
|
#n = /* @__PURE__ */ new Map();
|
|
1072
|
-
#r =
|
|
1073
|
-
#i =
|
|
1074
|
-
capabilities =
|
|
1075
|
-
rules =
|
|
1076
|
-
lastDecision =
|
|
1077
|
-
deniedCount =
|
|
1071
|
+
#r = r(null);
|
|
1072
|
+
#i = r(0);
|
|
1073
|
+
capabilities = e(() => this.#e.value);
|
|
1074
|
+
rules = e(() => this.#t.value);
|
|
1075
|
+
lastDecision = e(() => this.#r.value);
|
|
1076
|
+
deniedCount = e(() => this.#i.value);
|
|
1078
1077
|
grant(e) {
|
|
1079
|
-
let
|
|
1080
|
-
id:
|
|
1078
|
+
let t = a("cap"), n = Object.freeze({
|
|
1079
|
+
id: t,
|
|
1081
1080
|
...e
|
|
1082
1081
|
});
|
|
1083
|
-
return this.#e.value = [...this.#e.value,
|
|
1082
|
+
return this.#e.value = [...this.#e.value, n], t;
|
|
1084
1083
|
}
|
|
1085
1084
|
revoke(e) {
|
|
1086
1085
|
let t = this.#e.value.filter((t) => t.id !== e);
|
|
@@ -1094,11 +1093,11 @@ var D = class {
|
|
|
1094
1093
|
return this.#e.value.some((n) => n.name === e && (n.expiresAt === void 0 || n.expiresAt > t));
|
|
1095
1094
|
}
|
|
1096
1095
|
addRule(e) {
|
|
1097
|
-
let
|
|
1098
|
-
id:
|
|
1096
|
+
let t = a("rule"), n = Object.freeze({
|
|
1097
|
+
id: t,
|
|
1099
1098
|
...e
|
|
1100
1099
|
});
|
|
1101
|
-
return this.#t.value = [...this.#t.value,
|
|
1100
|
+
return this.#t.value = [...this.#t.value, n], t;
|
|
1102
1101
|
}
|
|
1103
1102
|
removeRule(e) {
|
|
1104
1103
|
let t = this.#t.value.filter((t) => t.id !== e);
|
|
@@ -1127,13 +1126,13 @@ var D = class {
|
|
|
1127
1126
|
middleware() {
|
|
1128
1127
|
return (e, t) => {
|
|
1129
1128
|
let n = this.evaluate(e);
|
|
1130
|
-
if (
|
|
1129
|
+
if (i(() => {
|
|
1131
1130
|
this.#r.value = n, n.allowed || (this.#i.value = this.#i.value + 1);
|
|
1132
1131
|
}), n.allowed) return t();
|
|
1133
1132
|
};
|
|
1134
1133
|
}
|
|
1135
1134
|
destroy() {
|
|
1136
|
-
|
|
1135
|
+
i(() => {
|
|
1137
1136
|
this.#e.value = [], this.#t.value = [], this.#r.value = null, this.#i.value = 0;
|
|
1138
1137
|
}), this.#n.clear();
|
|
1139
1138
|
}
|
|
@@ -1717,12 +1716,12 @@ function mt(e) {
|
|
|
1717
1716
|
/**
|
|
1718
1717
|
* Wrap a conversion result as a UIPlan.
|
|
1719
1718
|
*/
|
|
1720
|
-
function ht(e,
|
|
1719
|
+
function ht(e, t = "generated") {
|
|
1721
1720
|
return Object.freeze({
|
|
1722
|
-
id:
|
|
1721
|
+
id: a("a2ui-plan"),
|
|
1723
1722
|
version: 1,
|
|
1724
1723
|
root: e.root,
|
|
1725
|
-
source:
|
|
1724
|
+
source: t,
|
|
1726
1725
|
timestamp: Date.now()
|
|
1727
1726
|
});
|
|
1728
1727
|
}
|
|
@@ -1759,48 +1758,48 @@ var L = class {
|
|
|
1759
1758
|
#t;
|
|
1760
1759
|
#n;
|
|
1761
1760
|
#r = /* @__PURE__ */ new Map();
|
|
1762
|
-
#i =
|
|
1763
|
-
surfaceCount =
|
|
1761
|
+
#i = r(0);
|
|
1762
|
+
surfaceCount = e(() => this.#i.value);
|
|
1764
1763
|
constructor(e, t, n) {
|
|
1765
1764
|
this.#e = e, this.#t = t, this.#n = n ?? null;
|
|
1766
1765
|
}
|
|
1767
1766
|
handleMessage(e, t) {
|
|
1768
1767
|
Ye(e) ? this.#a(e, t) : Xe(e) ? this.#o(e, t) : Ze(e) ? this.#l(e) : Qe(e) && this.#u(e);
|
|
1769
1768
|
}
|
|
1770
|
-
#a(e,
|
|
1771
|
-
let { surfaceId:
|
|
1769
|
+
#a(e, t) {
|
|
1770
|
+
let { surfaceId: n, catalogId: i, theme: o } = e.createSurface, s = this.#r.get(n);
|
|
1772
1771
|
if (s) {
|
|
1773
|
-
s.catalogId =
|
|
1772
|
+
s.catalogId = i, s.theme = o;
|
|
1774
1773
|
return;
|
|
1775
1774
|
}
|
|
1776
1775
|
let c = {
|
|
1777
|
-
surfaceId:
|
|
1778
|
-
planId:
|
|
1779
|
-
catalogId:
|
|
1776
|
+
surfaceId: n,
|
|
1777
|
+
planId: a("a2ui-plan"),
|
|
1778
|
+
catalogId: i,
|
|
1780
1779
|
theme: o,
|
|
1781
|
-
container:
|
|
1780
|
+
container: t ?? document.createElement("div"),
|
|
1782
1781
|
components: [],
|
|
1783
|
-
dataModel:
|
|
1782
|
+
dataModel: r({}),
|
|
1784
1783
|
bindings: /* @__PURE__ */ new Map(),
|
|
1785
1784
|
bindingDisposers: [],
|
|
1786
1785
|
actionDisposer: null,
|
|
1787
1786
|
rendered: !1
|
|
1788
1787
|
};
|
|
1789
|
-
this.#r.set(
|
|
1790
|
-
}
|
|
1791
|
-
#o(e,
|
|
1792
|
-
let { surfaceId:
|
|
1793
|
-
o ?
|
|
1794
|
-
surfaceId:
|
|
1795
|
-
planId:
|
|
1796
|
-
container:
|
|
1788
|
+
this.#r.set(n, c), this.#i.value = this.#r.size;
|
|
1789
|
+
}
|
|
1790
|
+
#o(e, t) {
|
|
1791
|
+
let { surfaceId: n, components: i } = e.updateComponents, o = this.#r.get(n);
|
|
1792
|
+
o ? t && (o.container = t) : (o = {
|
|
1793
|
+
surfaceId: n,
|
|
1794
|
+
planId: a("a2ui-plan"),
|
|
1795
|
+
container: t ?? document.createElement("div"),
|
|
1797
1796
|
components: [],
|
|
1798
|
-
dataModel:
|
|
1797
|
+
dataModel: r({}),
|
|
1799
1798
|
bindings: /* @__PURE__ */ new Map(),
|
|
1800
1799
|
bindingDisposers: [],
|
|
1801
1800
|
actionDisposer: null,
|
|
1802
1801
|
rendered: !1
|
|
1803
|
-
}, this.#r.set(
|
|
1802
|
+
}, this.#r.set(n, o), this.#i.value = this.#r.size), o.rendered ? (this.#c(o, i), o.components = [...i]) : (o.components = [...i], this.#s(o)), o.rendered && this.#n?.(o.surfaceId, o.container);
|
|
1804
1803
|
}
|
|
1805
1804
|
#s(e) {
|
|
1806
1805
|
let t = P(e.components, { surfaceId: e.surfaceId });
|
|
@@ -1842,15 +1841,15 @@ var L = class {
|
|
|
1842
1841
|
n.bindingDisposers = [], n.actionDisposer?.(), this.#r.delete(t), this.#i.value = this.#r.size;
|
|
1843
1842
|
}
|
|
1844
1843
|
}
|
|
1845
|
-
#d(
|
|
1846
|
-
for (let [r, i] of
|
|
1844
|
+
#d(e, n) {
|
|
1845
|
+
for (let [r, i] of e.bindings) {
|
|
1847
1846
|
let a = n.get(r);
|
|
1848
1847
|
if (a) for (let n of i) {
|
|
1849
|
-
let r =
|
|
1850
|
-
let
|
|
1848
|
+
let r = t(() => {
|
|
1849
|
+
let t = e.dataModel.value, r = I(t, n.path);
|
|
1851
1850
|
r !== void 0 && (n.property === "textContent" ? a.textContent = String(r) : n.property === "src" || n.property === "alt" || n.property.startsWith("aria-") ? a.setAttribute(n.property, String(r)) : a[n.property] = r);
|
|
1852
1851
|
});
|
|
1853
|
-
|
|
1852
|
+
e.bindingDisposers.push(r);
|
|
1854
1853
|
}
|
|
1855
1854
|
}
|
|
1856
1855
|
}
|
|
@@ -2122,10 +2121,10 @@ var Et = class {
|
|
|
2122
2121
|
perf;
|
|
2123
2122
|
data;
|
|
2124
2123
|
policy;
|
|
2125
|
-
#e =
|
|
2124
|
+
#e = r(/* @__PURE__ */ new Map());
|
|
2126
2125
|
#t;
|
|
2127
2126
|
#n = null;
|
|
2128
|
-
registry =
|
|
2127
|
+
registry = e(() => this.#e.value);
|
|
2129
2128
|
/** Lazy-initialized A2UI protocol adapter. Only created on first access. */
|
|
2130
2129
|
get a2ui() {
|
|
2131
2130
|
return this.#n ||= new R(this), this.#n;
|
|
@@ -2143,8 +2142,8 @@ var Et = class {
|
|
|
2143
2142
|
}), i = new Map(this.#e.peek());
|
|
2144
2143
|
i.set(r.tag, r), this.#e.value = i;
|
|
2145
2144
|
}
|
|
2146
|
-
registerAndDefine(e, t,
|
|
2147
|
-
this.register(e, t,
|
|
2145
|
+
registerAndDefine(e, t, r) {
|
|
2146
|
+
this.register(e, t, r), n(e, t);
|
|
2148
2147
|
}
|
|
2149
2148
|
executePlan(e, t) {
|
|
2150
2149
|
let n = this.perf.measure("plan:execute", () => this.executor.execute(e, t, this.bus, { allowUnregistered: this.#t.allowUnregistered }));
|
|
@@ -2173,7 +2172,7 @@ function Dt(e) {
|
|
|
2173
2172
|
function Ot() {
|
|
2174
2173
|
z &&= (z.destroy(), null);
|
|
2175
2174
|
}
|
|
2176
|
-
var kt = 200, At = class
|
|
2175
|
+
var kt = 200, At = class t {
|
|
2177
2176
|
#e;
|
|
2178
2177
|
#t;
|
|
2179
2178
|
#n;
|
|
@@ -2186,44 +2185,44 @@ var kt = 200, At = class e {
|
|
|
2186
2185
|
context;
|
|
2187
2186
|
history;
|
|
2188
2187
|
running;
|
|
2189
|
-
constructor(
|
|
2190
|
-
this.#e =
|
|
2188
|
+
constructor(t, n) {
|
|
2189
|
+
this.#e = t, this.#t = n, this.#n = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#c(t.states, void 0), this.#i = r(t.initial), this.#a = r(t.context ? Object.freeze({ ...t.context }) : Object.freeze({})), this.#o = r(Object.freeze([])), this.#s = r(!1), this.currentState = e(() => this.#i.value), this.context = e(() => this.#a.value), this.history = e(() => this.#o.value), this.running = e(() => this.#s.value);
|
|
2191
2190
|
}
|
|
2192
2191
|
#c(e, t) {
|
|
2193
2192
|
for (let n of e) this.#n.set(n.id, n), t !== void 0 && this.#r.set(n.id, t), n.children && this.#c(n.children, n.id);
|
|
2194
2193
|
}
|
|
2195
2194
|
start() {
|
|
2196
|
-
this.#s.peek() ||
|
|
2195
|
+
this.#s.peek() || i(() => {
|
|
2197
2196
|
this.#s.value = !0, this.#l(this.#e.initial);
|
|
2198
2197
|
});
|
|
2199
2198
|
}
|
|
2200
|
-
send(e,
|
|
2199
|
+
send(e, t) {
|
|
2201
2200
|
if (!this.#s.peek()) return null;
|
|
2202
|
-
let
|
|
2201
|
+
let n = this.#i.peek(), r = this.#a.peek(), o = this.#p(n, e), s = [], c = [], l = null;
|
|
2203
2202
|
for (let e of o) if (e.guard) {
|
|
2204
2203
|
let t = e.guard.name || `${e.from}->${e.to}`;
|
|
2205
|
-
e.guard(
|
|
2204
|
+
e.guard(r) ? (s.push(t), l ||= e) : c.push(t);
|
|
2206
2205
|
} else l ||= e;
|
|
2207
2206
|
if (!l) return null;
|
|
2208
2207
|
let u = Object.freeze({
|
|
2209
|
-
id:
|
|
2208
|
+
id: a("wf"),
|
|
2210
2209
|
timestamp: Date.now(),
|
|
2211
2210
|
event: e,
|
|
2212
|
-
from:
|
|
2211
|
+
from: n,
|
|
2213
2212
|
to: l.to,
|
|
2214
2213
|
guardsPassed: Object.freeze(s),
|
|
2215
2214
|
guardsBlocked: Object.freeze(c),
|
|
2216
2215
|
action: l.action
|
|
2217
2216
|
});
|
|
2218
|
-
return
|
|
2219
|
-
this.#u(
|
|
2217
|
+
return i(() => {
|
|
2218
|
+
this.#u(n), l.action && this.#m(l.action, {
|
|
2220
2219
|
event: e,
|
|
2221
|
-
data:
|
|
2220
|
+
data: t
|
|
2222
2221
|
}), this.#h(u), this.#i.value = l.to, this.#l(l.to);
|
|
2223
2222
|
}), u;
|
|
2224
2223
|
}
|
|
2225
2224
|
stop() {
|
|
2226
|
-
this.#s.peek() &&
|
|
2225
|
+
this.#s.peek() && i(() => {
|
|
2227
2226
|
this.#u(this.#i.peek()), this.#s.value = !1;
|
|
2228
2227
|
});
|
|
2229
2228
|
}
|
|
@@ -2270,14 +2269,14 @@ var kt = 200, At = class e {
|
|
|
2270
2269
|
timestamp: Date.now()
|
|
2271
2270
|
});
|
|
2272
2271
|
}
|
|
2273
|
-
static restore(
|
|
2274
|
-
let a = new
|
|
2275
|
-
return
|
|
2276
|
-
a.#i.value =
|
|
2272
|
+
static restore(e, n, r) {
|
|
2273
|
+
let a = new t(n, r);
|
|
2274
|
+
return i(() => {
|
|
2275
|
+
a.#i.value = e.currentState, a.#a.value = Object.freeze({ ...e.context }), a.#o.value = Object.freeze([...e.history]), a.#s.value = !0;
|
|
2277
2276
|
}), a;
|
|
2278
2277
|
}
|
|
2279
2278
|
destroy() {
|
|
2280
|
-
|
|
2279
|
+
i(() => {
|
|
2281
2280
|
this.#s.peek() && this.#u(this.#i.peek()), this.#s.value = !1, this.#o.value = Object.freeze([]), this.#n.clear(), this.#r.clear();
|
|
2282
2281
|
});
|
|
2283
2282
|
}
|
|
@@ -2451,53 +2450,53 @@ function zt(e) {
|
|
|
2451
2450
|
}
|
|
2452
2451
|
var Bt = class {
|
|
2453
2452
|
#e;
|
|
2454
|
-
#t =
|
|
2453
|
+
#t = r([]);
|
|
2455
2454
|
#n = /* @__PURE__ */ new Map();
|
|
2456
2455
|
#r = /* @__PURE__ */ new Map();
|
|
2457
|
-
activeBindings =
|
|
2456
|
+
activeBindings = e(() => this.#t.value);
|
|
2458
2457
|
constructor(e) {
|
|
2459
2458
|
this.#e = e;
|
|
2460
2459
|
}
|
|
2461
|
-
bind(n, r, i,
|
|
2462
|
-
let s = x(
|
|
2463
|
-
method:
|
|
2464
|
-
headers:
|
|
2465
|
-
cacheTtl:
|
|
2466
|
-
}), c = this.#e.query(s), l =
|
|
2460
|
+
bind(e, n, r, i, o) {
|
|
2461
|
+
let s = x(i.source, {
|
|
2462
|
+
method: i.method,
|
|
2463
|
+
headers: i.headers,
|
|
2464
|
+
cacheTtl: i.cacheTtl
|
|
2465
|
+
}), c = this.#e.query(s), l = t(() => {
|
|
2467
2466
|
let e = c.value;
|
|
2468
2467
|
if (e === null) return;
|
|
2469
|
-
let t =
|
|
2470
|
-
switch (
|
|
2468
|
+
let t = i.transform ? Rt(e, i.transform) : e;
|
|
2469
|
+
switch (i.target) {
|
|
2471
2470
|
case "textContent":
|
|
2472
|
-
|
|
2471
|
+
r.textContent = String(t ?? "");
|
|
2473
2472
|
break;
|
|
2474
2473
|
case "attribute":
|
|
2475
|
-
|
|
2474
|
+
i.targetName && t != null && r.setAttribute(i.targetName, String(t));
|
|
2476
2475
|
break;
|
|
2477
2476
|
case "property":
|
|
2478
|
-
|
|
2477
|
+
i.targetName && (r[i.targetName] = t);
|
|
2479
2478
|
break;
|
|
2480
2479
|
case "children":
|
|
2481
|
-
Array.isArray(t) && this.#o(
|
|
2480
|
+
Array.isArray(t) && this.#o(r, t, o);
|
|
2482
2481
|
break;
|
|
2483
2482
|
}
|
|
2484
|
-
}), u =
|
|
2485
|
-
|
|
2483
|
+
}), u = a("dbind"), d;
|
|
2484
|
+
i.refreshInterval && i.refreshInterval > 0 && (d = setInterval(() => {
|
|
2486
2485
|
this.#e.invalidate(zt(s)), this.#e.query(s);
|
|
2487
|
-
},
|
|
2486
|
+
}, i.refreshInterval)), this.#n.set(u, {
|
|
2488
2487
|
effectDispose: l,
|
|
2489
2488
|
intervalId: d
|
|
2490
2489
|
});
|
|
2491
2490
|
let f = Object.freeze({
|
|
2492
2491
|
id: u,
|
|
2493
|
-
planId:
|
|
2494
|
-
nodeId:
|
|
2495
|
-
binding:
|
|
2492
|
+
planId: e,
|
|
2493
|
+
nodeId: n,
|
|
2494
|
+
binding: i,
|
|
2496
2495
|
dispose: () => {
|
|
2497
|
-
this.#i(u), this.#t.value = this.#t.value.filter((e) => e.id !== u), this.#a(
|
|
2496
|
+
this.#i(u), this.#t.value = this.#t.value.filter((e) => e.id !== u), this.#a(e, u);
|
|
2498
2497
|
}
|
|
2499
|
-
}), p = this.#r.get(
|
|
2500
|
-
return p || (p = /* @__PURE__ */ new Set(), this.#r.set(
|
|
2498
|
+
}), p = this.#r.get(e);
|
|
2499
|
+
return p || (p = /* @__PURE__ */ new Set(), this.#r.set(e, p)), p.add(u), this.#t.value = [...this.#t.value, f], f;
|
|
2501
2500
|
}
|
|
2502
2501
|
bindPlan(e, t, n, r) {
|
|
2503
2502
|
let i = [];
|
|
@@ -3558,20 +3557,20 @@ var Tn = class e {
|
|
|
3558
3557
|
constructor(e) {
|
|
3559
3558
|
this.#e = e ?? /* @__PURE__ */ new Map();
|
|
3560
3559
|
}
|
|
3561
|
-
generate(e,
|
|
3560
|
+
generate(e, t) {
|
|
3562
3561
|
this.#t = 0;
|
|
3563
|
-
let
|
|
3564
|
-
id: e.id ??
|
|
3562
|
+
let n = this.#n(e), r = Cn({
|
|
3563
|
+
id: e.id ?? a("plan"),
|
|
3565
3564
|
version: 1,
|
|
3566
|
-
root:
|
|
3567
|
-
source:
|
|
3565
|
+
root: n,
|
|
3566
|
+
source: t ?? "generated",
|
|
3568
3567
|
timestamp: Date.now()
|
|
3569
3568
|
});
|
|
3570
3569
|
return Cn({
|
|
3571
|
-
plan:
|
|
3572
|
-
validation: g(
|
|
3573
|
-
accessibility: w(
|
|
3574
|
-
warnings: Object.freeze(this.#c(e,
|
|
3570
|
+
plan: r,
|
|
3571
|
+
validation: g(r, this.#e, { allowUnregistered: !0 }),
|
|
3572
|
+
accessibility: w(r.root),
|
|
3573
|
+
warnings: Object.freeze(this.#c(e, r))
|
|
3575
3574
|
});
|
|
3576
3575
|
}
|
|
3577
3576
|
#n(e) {
|