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