@nonoun/native-ui 0.2.2 → 0.2.4
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 +53 -0
- package/dist/components.css +53 -0
- package/dist/custom-elements.json +5013 -5013
- package/dist/define.js +62 -0
- package/dist/dialog-controller.js +30 -154
- package/dist/inspector.css +231 -0
- package/dist/inspector.d.ts +7 -0
- package/dist/inspector.d.ts.map +1 -0
- package/dist/inspector.js +591 -0
- package/dist/kernel.js +182 -181
- package/dist/native-ui-lean.css +53 -0
- package/dist/native-ui.css +53 -0
- package/dist/native-ui.js +7 -5
- package/dist/nav/inspector/build-inspector.d.ts +8 -0
- package/dist/nav/inspector/build-inspector.d.ts.map +1 -0
- package/dist/nav/inspector/ds-color-swatch-element.d.ts +15 -0
- package/dist/nav/inspector/ds-color-swatch-element.d.ts.map +1 -0
- package/dist/nav/inspector/ds-color-swatch.d.ts +3 -0
- package/dist/nav/inspector/ds-color-swatch.d.ts.map +1 -0
- package/dist/nav/inspector/ds-colors-element.d.ts +14 -0
- package/dist/nav/inspector/ds-colors-element.d.ts.map +1 -0
- package/dist/nav/inspector/ds-colors.d.ts +4 -0
- package/dist/nav/inspector/ds-colors.d.ts.map +1 -0
- package/dist/nav/inspector/ds-themes-element.d.ts +13 -0
- package/dist/nav/inspector/ds-themes-element.d.ts.map +1 -0
- package/dist/nav/inspector/ds-themes.d.ts +4 -0
- package/dist/nav/inspector/ds-themes.d.ts.map +1 -0
- package/dist/nav/inspector/ds-variable-element.d.ts +19 -0
- package/dist/nav/inspector/ds-variable-element.d.ts.map +1 -0
- package/dist/nav/inspector/ds-variable.d.ts +4 -0
- package/dist/nav/inspector/ds-variable.d.ts.map +1 -0
- package/dist/nav/inspector/index.d.ts +9 -0
- package/dist/nav/inspector/index.d.ts.map +1 -0
- package/dist/register-all.js +1 -1
- package/dist/register-all2.js +25 -24
- package/dist/traits.js +5 -3
- package/dist/ui-element.js +128 -0
- package/dist/ui-icon-element.js +158 -156
- package/dist/uid.js +3 -63
- package/package.json +9 -3
package/dist/kernel.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e, t } from "./uid.js";
|
|
2
|
+
import { i as n, n as r, r as i, t as a } from "./define.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 = n(null);
|
|
8
|
+
#i = n(!1);
|
|
9
|
+
#a = n(null);
|
|
9
10
|
#o = 0;
|
|
10
|
-
lastCommand =
|
|
11
|
-
dispatching =
|
|
12
|
-
errors =
|
|
11
|
+
lastCommand = i(() => this.#r.value);
|
|
12
|
+
dispatching = i(() => this.#i.value);
|
|
13
|
+
errors = i(() => 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 = n([]);
|
|
81
|
+
#t = n([]);
|
|
81
82
|
#n = 100;
|
|
82
|
-
undoStack =
|
|
83
|
-
redoStack =
|
|
84
|
-
canUndo =
|
|
85
|
-
canRedo =
|
|
83
|
+
undoStack = i(() => this.#e.value);
|
|
84
|
+
redoStack = i(() => this.#t.value);
|
|
85
|
+
canUndo = i(() => this.#e.value.length > 0);
|
|
86
|
+
canRedo = i(() => 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,22 +132,22 @@ 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 = n([]);
|
|
135
136
|
#t = !1;
|
|
136
|
-
stack =
|
|
137
|
-
topOverlay =
|
|
137
|
+
stack = i(() => this.#e.value);
|
|
138
|
+
topOverlay = i(() => {
|
|
138
139
|
let e = this.#e.value;
|
|
139
140
|
return e.length > 0 ? e[e.length - 1] : null;
|
|
140
141
|
});
|
|
141
142
|
open(e) {
|
|
142
|
-
let
|
|
143
|
-
id:
|
|
143
|
+
let n = t("overlay"), r = this.getNextZIndex(), i = Object.freeze({
|
|
144
|
+
id: n,
|
|
144
145
|
type: e.type,
|
|
145
146
|
element: e.element,
|
|
146
|
-
zIndex:
|
|
147
|
+
zIndex: r,
|
|
147
148
|
...e.owner ? { owner: e.owner } : {}
|
|
148
149
|
});
|
|
149
|
-
return this.#e.value = [...this.#e.value,
|
|
150
|
+
return this.#e.value = [...this.#e.value, i], this.#n(), n;
|
|
150
151
|
}
|
|
151
152
|
close(e) {
|
|
152
153
|
let t = this.#e.value, n = t.findIndex((t) => t.id === e);
|
|
@@ -194,9 +195,9 @@ function p() {
|
|
|
194
195
|
}
|
|
195
196
|
var m = 0, h = class {
|
|
196
197
|
#e = [];
|
|
197
|
-
#t =
|
|
198
|
+
#t = n(["global"]);
|
|
198
199
|
#n = !1;
|
|
199
|
-
activeScope =
|
|
200
|
+
activeScope = i(() => {
|
|
200
201
|
let e = this.#t.value;
|
|
201
202
|
return e[e.length - 1];
|
|
202
203
|
});
|
|
@@ -378,17 +379,17 @@ function se(e) {
|
|
|
378
379
|
return new oe(e);
|
|
379
380
|
}
|
|
380
381
|
var ce = class {
|
|
381
|
-
#e =
|
|
382
|
+
#e = n([]);
|
|
382
383
|
#t = 1e3;
|
|
383
|
-
entries =
|
|
384
|
-
size =
|
|
384
|
+
entries = i(() => this.#e.value);
|
|
385
|
+
size = i(() => this.#e.value.length);
|
|
385
386
|
log(e) {
|
|
386
|
-
let
|
|
387
|
-
id:
|
|
387
|
+
let n = Object.freeze({
|
|
388
|
+
id: t("log"),
|
|
388
389
|
timestamp: Date.now(),
|
|
389
390
|
...e
|
|
390
|
-
}),
|
|
391
|
-
return
|
|
391
|
+
}), r = [n, ...this.#e.value];
|
|
392
|
+
return r.length > this.#t && (r.length = this.#t), this.#e.value = r, n;
|
|
392
393
|
}
|
|
393
394
|
query(e) {
|
|
394
395
|
let t = this.#e.value;
|
|
@@ -443,9 +444,9 @@ function le(e) {
|
|
|
443
444
|
return e !== void 0 && t.setMaxSize(e), t;
|
|
444
445
|
}
|
|
445
446
|
var v = class {
|
|
446
|
-
#e =
|
|
447
|
+
#e = n([]);
|
|
447
448
|
#t = 500;
|
|
448
|
-
samples =
|
|
449
|
+
samples = i(() => this.#e.value);
|
|
449
450
|
measure(e, t) {
|
|
450
451
|
let n = performance.now();
|
|
451
452
|
try {
|
|
@@ -502,31 +503,31 @@ function pe(e) {
|
|
|
502
503
|
var y = class {
|
|
503
504
|
#e = /* @__PURE__ */ new Map();
|
|
504
505
|
#t = /* @__PURE__ */ new Map();
|
|
505
|
-
#n =
|
|
506
|
-
#r =
|
|
506
|
+
#n = n(!1);
|
|
507
|
+
#r = n(null);
|
|
507
508
|
#i = 0;
|
|
508
|
-
loading =
|
|
509
|
-
error =
|
|
510
|
-
query(
|
|
511
|
-
let
|
|
512
|
-
if (a &&
|
|
509
|
+
loading = i(() => this.#n.value);
|
|
510
|
+
error = i(() => this.#r.value);
|
|
511
|
+
query(e) {
|
|
512
|
+
let t = pe(e), r = e.cacheTtl ?? 0, a = this.#e.get(t);
|
|
513
|
+
if (a && r > 0 && Date.now() - a.entry.timestamp < r) return i(() => a.signal.value);
|
|
513
514
|
let o = a;
|
|
514
515
|
return o || (o = {
|
|
515
516
|
entry: {
|
|
516
517
|
data: null,
|
|
517
518
|
timestamp: 0
|
|
518
519
|
},
|
|
519
|
-
signal:
|
|
520
|
-
}, this.#e.set(
|
|
520
|
+
signal: n(null)
|
|
521
|
+
}, this.#e.set(t, o)), this.#a(e, t), i(() => o.signal.value);
|
|
521
522
|
}
|
|
522
523
|
async mutate(e, t) {
|
|
523
|
-
let
|
|
524
|
-
if (t) if (a = this.#e.get(t.key),
|
|
524
|
+
let i, a;
|
|
525
|
+
if (t) if (a = this.#e.get(t.key), i = a?.signal.peek() ?? null, a) a.signal.value = t.value, a.entry = Object.freeze({
|
|
525
526
|
data: t.value,
|
|
526
527
|
timestamp: Date.now()
|
|
527
528
|
});
|
|
528
529
|
else {
|
|
529
|
-
let e =
|
|
530
|
+
let e = n(t.value);
|
|
530
531
|
a = {
|
|
531
532
|
entry: Object.freeze({
|
|
532
533
|
data: t.value,
|
|
@@ -536,29 +537,29 @@ var y = class {
|
|
|
536
537
|
}, this.#e.set(t.key, a);
|
|
537
538
|
}
|
|
538
539
|
try {
|
|
539
|
-
let
|
|
540
|
-
return
|
|
540
|
+
let i = await this.#s(e), a = pe(e);
|
|
541
|
+
return r(() => {
|
|
541
542
|
let e = Object.freeze({
|
|
542
|
-
data:
|
|
543
|
+
data: i,
|
|
543
544
|
timestamp: Date.now()
|
|
544
|
-
}),
|
|
545
|
-
if (
|
|
545
|
+
}), r = this.#e.get(a);
|
|
546
|
+
if (r ? (r.signal.value = i, r.entry = e) : this.#e.set(a, {
|
|
546
547
|
entry: e,
|
|
547
|
-
signal:
|
|
548
|
+
signal: n(i)
|
|
548
549
|
}), t && t.key !== a) {
|
|
549
|
-
let
|
|
550
|
-
|
|
550
|
+
let n = this.#e.get(t.key);
|
|
551
|
+
n && (n.signal.value = i, n.entry = e);
|
|
551
552
|
}
|
|
552
|
-
}),
|
|
553
|
+
}), i;
|
|
553
554
|
} catch (e) {
|
|
554
|
-
t && a &&
|
|
555
|
-
a.signal.value =
|
|
556
|
-
data:
|
|
555
|
+
t && a && r(() => {
|
|
556
|
+
a.signal.value = i, a.entry = Object.freeze({
|
|
557
|
+
data: i,
|
|
557
558
|
timestamp: Date.now()
|
|
558
559
|
});
|
|
559
560
|
});
|
|
560
|
-
let
|
|
561
|
-
throw this.#r.value =
|
|
561
|
+
let n = e instanceof Error ? e : Error(String(e));
|
|
562
|
+
throw this.#r.value = n, n;
|
|
562
563
|
}
|
|
563
564
|
}
|
|
564
565
|
invalidate(e) {
|
|
@@ -584,22 +585,22 @@ var y = class {
|
|
|
584
585
|
this.#t.clear();
|
|
585
586
|
}
|
|
586
587
|
destroy() {
|
|
587
|
-
this.abortAll(), this.#e.clear(),
|
|
588
|
+
this.abortAll(), this.#e.clear(), r(() => {
|
|
588
589
|
this.#n.value = !1, this.#r.value = null;
|
|
589
590
|
}), this.#i = 0;
|
|
590
591
|
}
|
|
591
592
|
async #a(e, t) {
|
|
592
593
|
this.#c();
|
|
593
594
|
try {
|
|
594
|
-
let
|
|
595
|
-
|
|
595
|
+
let i = await this.#o(e);
|
|
596
|
+
r(() => {
|
|
596
597
|
let e = Object.freeze({
|
|
597
|
-
data:
|
|
598
|
+
data: i,
|
|
598
599
|
timestamp: Date.now()
|
|
599
|
-
}),
|
|
600
|
-
|
|
600
|
+
}), r = this.#e.get(t);
|
|
601
|
+
r ? (r.signal.value = i, r.entry = e) : this.#e.set(t, {
|
|
601
602
|
entry: e,
|
|
602
|
-
signal:
|
|
603
|
+
signal: n(i)
|
|
603
604
|
}), this.#r.value = null;
|
|
604
605
|
});
|
|
605
606
|
} catch (e) {
|
|
@@ -672,11 +673,11 @@ var y = class {
|
|
|
672
673
|
function me() {
|
|
673
674
|
return new y();
|
|
674
675
|
}
|
|
675
|
-
function x(e,
|
|
676
|
+
function x(e, n) {
|
|
676
677
|
return Object.freeze({
|
|
677
|
-
id:
|
|
678
|
+
id: t("bind"),
|
|
678
679
|
source: e,
|
|
679
|
-
...
|
|
680
|
+
...n
|
|
680
681
|
});
|
|
681
682
|
}
|
|
682
683
|
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([
|
|
@@ -1046,21 +1047,21 @@ function E(e, t) {
|
|
|
1046
1047
|
return !1;
|
|
1047
1048
|
}
|
|
1048
1049
|
var D = class {
|
|
1049
|
-
#e =
|
|
1050
|
-
#t =
|
|
1050
|
+
#e = n([]);
|
|
1051
|
+
#t = n([]);
|
|
1051
1052
|
#n = /* @__PURE__ */ new Map();
|
|
1052
|
-
#r =
|
|
1053
|
-
#i =
|
|
1054
|
-
capabilities =
|
|
1055
|
-
rules =
|
|
1056
|
-
lastDecision =
|
|
1057
|
-
deniedCount =
|
|
1053
|
+
#r = n(null);
|
|
1054
|
+
#i = n(0);
|
|
1055
|
+
capabilities = i(() => this.#e.value);
|
|
1056
|
+
rules = i(() => this.#t.value);
|
|
1057
|
+
lastDecision = i(() => this.#r.value);
|
|
1058
|
+
deniedCount = i(() => this.#i.value);
|
|
1058
1059
|
grant(e) {
|
|
1059
|
-
let
|
|
1060
|
-
id:
|
|
1060
|
+
let n = t("cap"), r = Object.freeze({
|
|
1061
|
+
id: n,
|
|
1061
1062
|
...e
|
|
1062
1063
|
});
|
|
1063
|
-
return this.#e.value = [...this.#e.value,
|
|
1064
|
+
return this.#e.value = [...this.#e.value, r], n;
|
|
1064
1065
|
}
|
|
1065
1066
|
revoke(e) {
|
|
1066
1067
|
let t = this.#e.value.filter((t) => t.id !== e);
|
|
@@ -1074,11 +1075,11 @@ var D = class {
|
|
|
1074
1075
|
return this.#e.value.some((n) => n.name === e && (n.expiresAt === void 0 || n.expiresAt > t));
|
|
1075
1076
|
}
|
|
1076
1077
|
addRule(e) {
|
|
1077
|
-
let
|
|
1078
|
-
id:
|
|
1078
|
+
let n = t("rule"), r = Object.freeze({
|
|
1079
|
+
id: n,
|
|
1079
1080
|
...e
|
|
1080
1081
|
});
|
|
1081
|
-
return this.#t.value = [...this.#t.value,
|
|
1082
|
+
return this.#t.value = [...this.#t.value, r], n;
|
|
1082
1083
|
}
|
|
1083
1084
|
removeRule(e) {
|
|
1084
1085
|
let t = this.#t.value.filter((t) => t.id !== e);
|
|
@@ -1107,13 +1108,13 @@ var D = class {
|
|
|
1107
1108
|
middleware() {
|
|
1108
1109
|
return (e, t) => {
|
|
1109
1110
|
let n = this.evaluate(e);
|
|
1110
|
-
if (
|
|
1111
|
+
if (r(() => {
|
|
1111
1112
|
this.#r.value = n, n.allowed || (this.#i.value = this.#i.value + 1);
|
|
1112
1113
|
}), n.allowed) return t();
|
|
1113
1114
|
};
|
|
1114
1115
|
}
|
|
1115
1116
|
destroy() {
|
|
1116
|
-
|
|
1117
|
+
r(() => {
|
|
1117
1118
|
this.#e.value = [], this.#t.value = [], this.#r.value = null, this.#i.value = 0;
|
|
1118
1119
|
}), this.#n.clear();
|
|
1119
1120
|
}
|
|
@@ -1697,12 +1698,12 @@ function mt(e) {
|
|
|
1697
1698
|
/**
|
|
1698
1699
|
* Wrap a conversion result as a UIPlan.
|
|
1699
1700
|
*/
|
|
1700
|
-
function ht(e,
|
|
1701
|
+
function ht(e, n = "generated") {
|
|
1701
1702
|
return Object.freeze({
|
|
1702
|
-
id:
|
|
1703
|
+
id: t("a2ui-plan"),
|
|
1703
1704
|
version: 1,
|
|
1704
1705
|
root: e.root,
|
|
1705
|
-
source:
|
|
1706
|
+
source: n,
|
|
1706
1707
|
timestamp: Date.now()
|
|
1707
1708
|
});
|
|
1708
1709
|
}
|
|
@@ -1739,48 +1740,48 @@ var L = class {
|
|
|
1739
1740
|
#t;
|
|
1740
1741
|
#n;
|
|
1741
1742
|
#r = /* @__PURE__ */ new Map();
|
|
1742
|
-
#i =
|
|
1743
|
-
surfaceCount =
|
|
1743
|
+
#i = n(0);
|
|
1744
|
+
surfaceCount = i(() => this.#i.value);
|
|
1744
1745
|
constructor(e, t, n) {
|
|
1745
1746
|
this.#e = e, this.#t = t, this.#n = n ?? null;
|
|
1746
1747
|
}
|
|
1747
1748
|
handleMessage(e, t) {
|
|
1748
1749
|
Ye(e) ? this.#a(e, t) : Xe(e) ? this.#o(e, t) : Ze(e) ? this.#l(e) : Qe(e) && this.#u(e);
|
|
1749
1750
|
}
|
|
1750
|
-
#a(e,
|
|
1751
|
-
let { surfaceId:
|
|
1751
|
+
#a(e, r) {
|
|
1752
|
+
let { surfaceId: i, catalogId: a, theme: o } = e.createSurface, s = this.#r.get(i);
|
|
1752
1753
|
if (s) {
|
|
1753
|
-
s.catalogId =
|
|
1754
|
+
s.catalogId = a, s.theme = o;
|
|
1754
1755
|
return;
|
|
1755
1756
|
}
|
|
1756
1757
|
let c = {
|
|
1757
|
-
surfaceId:
|
|
1758
|
-
planId:
|
|
1759
|
-
catalogId:
|
|
1758
|
+
surfaceId: i,
|
|
1759
|
+
planId: t("a2ui-plan"),
|
|
1760
|
+
catalogId: a,
|
|
1760
1761
|
theme: o,
|
|
1761
|
-
container:
|
|
1762
|
+
container: r ?? document.createElement("div"),
|
|
1762
1763
|
components: [],
|
|
1763
|
-
dataModel:
|
|
1764
|
+
dataModel: n({}),
|
|
1764
1765
|
bindings: /* @__PURE__ */ new Map(),
|
|
1765
1766
|
bindingDisposers: [],
|
|
1766
1767
|
actionDisposer: null,
|
|
1767
1768
|
rendered: !1
|
|
1768
1769
|
};
|
|
1769
|
-
this.#r.set(
|
|
1770
|
-
}
|
|
1771
|
-
#o(e,
|
|
1772
|
-
let { surfaceId:
|
|
1773
|
-
o ?
|
|
1774
|
-
surfaceId:
|
|
1775
|
-
planId:
|
|
1776
|
-
container:
|
|
1770
|
+
this.#r.set(i, c), this.#i.value = this.#r.size;
|
|
1771
|
+
}
|
|
1772
|
+
#o(e, r) {
|
|
1773
|
+
let { surfaceId: i, components: a } = e.updateComponents, o = this.#r.get(i);
|
|
1774
|
+
o ? r && (o.container = r) : (o = {
|
|
1775
|
+
surfaceId: i,
|
|
1776
|
+
planId: t("a2ui-plan"),
|
|
1777
|
+
container: r ?? document.createElement("div"),
|
|
1777
1778
|
components: [],
|
|
1778
|
-
dataModel:
|
|
1779
|
+
dataModel: n({}),
|
|
1779
1780
|
bindings: /* @__PURE__ */ new Map(),
|
|
1780
1781
|
bindingDisposers: [],
|
|
1781
1782
|
actionDisposer: null,
|
|
1782
1783
|
rendered: !1
|
|
1783
|
-
}, this.#r.set(
|
|
1784
|
+
}, this.#r.set(i, 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);
|
|
1784
1785
|
}
|
|
1785
1786
|
#s(e) {
|
|
1786
1787
|
let t = P(e.components, { surfaceId: e.surfaceId });
|
|
@@ -1822,15 +1823,15 @@ var L = class {
|
|
|
1822
1823
|
n.bindingDisposers = [], n.actionDisposer?.(), this.#r.delete(t), this.#i.value = this.#r.size;
|
|
1823
1824
|
}
|
|
1824
1825
|
}
|
|
1825
|
-
#d(
|
|
1826
|
-
for (let [r, i] of
|
|
1826
|
+
#d(t, n) {
|
|
1827
|
+
for (let [r, i] of t.bindings) {
|
|
1827
1828
|
let a = n.get(r);
|
|
1828
1829
|
if (a) for (let n of i) {
|
|
1829
|
-
let r =
|
|
1830
|
-
let
|
|
1830
|
+
let r = e(() => {
|
|
1831
|
+
let e = t.dataModel.value, r = I(e, n.path);
|
|
1831
1832
|
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);
|
|
1832
1833
|
});
|
|
1833
|
-
|
|
1834
|
+
t.bindingDisposers.push(r);
|
|
1834
1835
|
}
|
|
1835
1836
|
}
|
|
1836
1837
|
}
|
|
@@ -2102,10 +2103,10 @@ var Et = class {
|
|
|
2102
2103
|
perf;
|
|
2103
2104
|
data;
|
|
2104
2105
|
policy;
|
|
2105
|
-
#e =
|
|
2106
|
+
#e = n(/* @__PURE__ */ new Map());
|
|
2106
2107
|
#t;
|
|
2107
2108
|
#n = null;
|
|
2108
|
-
registry =
|
|
2109
|
+
registry = i(() => this.#e.value);
|
|
2109
2110
|
/** Lazy-initialized A2UI protocol adapter. Only created on first access. */
|
|
2110
2111
|
get a2ui() {
|
|
2111
2112
|
return this.#n ||= new R(this), this.#n;
|
|
@@ -2123,8 +2124,8 @@ var Et = class {
|
|
|
2123
2124
|
}), i = new Map(this.#e.peek());
|
|
2124
2125
|
i.set(r.tag, r), this.#e.value = i;
|
|
2125
2126
|
}
|
|
2126
|
-
registerAndDefine(e, t,
|
|
2127
|
-
this.register(e, t,
|
|
2127
|
+
registerAndDefine(e, t, n) {
|
|
2128
|
+
this.register(e, t, n), a(e, t);
|
|
2128
2129
|
}
|
|
2129
2130
|
executePlan(e, t) {
|
|
2130
2131
|
let n = this.perf.measure("plan:execute", () => this.executor.execute(e, t, this.bus, { allowUnregistered: this.#t.allowUnregistered }));
|
|
@@ -2153,7 +2154,7 @@ function Dt(e) {
|
|
|
2153
2154
|
function Ot() {
|
|
2154
2155
|
z &&= (z.destroy(), null);
|
|
2155
2156
|
}
|
|
2156
|
-
var kt = 200, At = class
|
|
2157
|
+
var kt = 200, At = class e {
|
|
2157
2158
|
#e;
|
|
2158
2159
|
#t;
|
|
2159
2160
|
#n;
|
|
@@ -2166,44 +2167,44 @@ var kt = 200, At = class t {
|
|
|
2166
2167
|
context;
|
|
2167
2168
|
history;
|
|
2168
2169
|
running;
|
|
2169
|
-
constructor(
|
|
2170
|
-
this.#e =
|
|
2170
|
+
constructor(e, t) {
|
|
2171
|
+
this.#e = e, this.#t = t, this.#n = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#c(e.states, void 0), this.#i = n(e.initial), this.#a = n(e.context ? Object.freeze({ ...e.context }) : Object.freeze({})), this.#o = n(Object.freeze([])), this.#s = n(!1), this.currentState = i(() => this.#i.value), this.context = i(() => this.#a.value), this.history = i(() => this.#o.value), this.running = i(() => this.#s.value);
|
|
2171
2172
|
}
|
|
2172
2173
|
#c(e, t) {
|
|
2173
2174
|
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);
|
|
2174
2175
|
}
|
|
2175
2176
|
start() {
|
|
2176
|
-
this.#s.peek() ||
|
|
2177
|
+
this.#s.peek() || r(() => {
|
|
2177
2178
|
this.#s.value = !0, this.#l(this.#e.initial);
|
|
2178
2179
|
});
|
|
2179
2180
|
}
|
|
2180
|
-
send(e,
|
|
2181
|
+
send(e, n) {
|
|
2181
2182
|
if (!this.#s.peek()) return null;
|
|
2182
|
-
let
|
|
2183
|
+
let i = this.#i.peek(), a = this.#a.peek(), o = this.#p(i, e), s = [], c = [], l = null;
|
|
2183
2184
|
for (let e of o) if (e.guard) {
|
|
2184
2185
|
let t = e.guard.name || `${e.from}->${e.to}`;
|
|
2185
|
-
e.guard(
|
|
2186
|
+
e.guard(a) ? (s.push(t), l ||= e) : c.push(t);
|
|
2186
2187
|
} else l ||= e;
|
|
2187
2188
|
if (!l) return null;
|
|
2188
2189
|
let u = Object.freeze({
|
|
2189
|
-
id:
|
|
2190
|
+
id: t("wf"),
|
|
2190
2191
|
timestamp: Date.now(),
|
|
2191
2192
|
event: e,
|
|
2192
|
-
from:
|
|
2193
|
+
from: i,
|
|
2193
2194
|
to: l.to,
|
|
2194
2195
|
guardsPassed: Object.freeze(s),
|
|
2195
2196
|
guardsBlocked: Object.freeze(c),
|
|
2196
2197
|
action: l.action
|
|
2197
2198
|
});
|
|
2198
|
-
return
|
|
2199
|
-
this.#u(
|
|
2199
|
+
return r(() => {
|
|
2200
|
+
this.#u(i), l.action && this.#m(l.action, {
|
|
2200
2201
|
event: e,
|
|
2201
|
-
data:
|
|
2202
|
+
data: n
|
|
2202
2203
|
}), this.#h(u), this.#i.value = l.to, this.#l(l.to);
|
|
2203
2204
|
}), u;
|
|
2204
2205
|
}
|
|
2205
2206
|
stop() {
|
|
2206
|
-
this.#s.peek() &&
|
|
2207
|
+
this.#s.peek() && r(() => {
|
|
2207
2208
|
this.#u(this.#i.peek()), this.#s.value = !1;
|
|
2208
2209
|
});
|
|
2209
2210
|
}
|
|
@@ -2250,14 +2251,14 @@ var kt = 200, At = class t {
|
|
|
2250
2251
|
timestamp: Date.now()
|
|
2251
2252
|
});
|
|
2252
2253
|
}
|
|
2253
|
-
static restore(
|
|
2254
|
-
let a = new
|
|
2255
|
-
return
|
|
2256
|
-
a.#i.value =
|
|
2254
|
+
static restore(t, n, i) {
|
|
2255
|
+
let a = new e(n, i);
|
|
2256
|
+
return r(() => {
|
|
2257
|
+
a.#i.value = t.currentState, a.#a.value = Object.freeze({ ...t.context }), a.#o.value = Object.freeze([...t.history]), a.#s.value = !0;
|
|
2257
2258
|
}), a;
|
|
2258
2259
|
}
|
|
2259
2260
|
destroy() {
|
|
2260
|
-
|
|
2261
|
+
r(() => {
|
|
2261
2262
|
this.#s.peek() && this.#u(this.#i.peek()), this.#s.value = !1, this.#o.value = Object.freeze([]), this.#n.clear(), this.#r.clear();
|
|
2262
2263
|
});
|
|
2263
2264
|
}
|
|
@@ -2431,53 +2432,53 @@ function zt(e) {
|
|
|
2431
2432
|
}
|
|
2432
2433
|
var Bt = class {
|
|
2433
2434
|
#e;
|
|
2434
|
-
#t =
|
|
2435
|
+
#t = n([]);
|
|
2435
2436
|
#n = /* @__PURE__ */ new Map();
|
|
2436
2437
|
#r = /* @__PURE__ */ new Map();
|
|
2437
|
-
activeBindings =
|
|
2438
|
+
activeBindings = i(() => this.#t.value);
|
|
2438
2439
|
constructor(e) {
|
|
2439
2440
|
this.#e = e;
|
|
2440
2441
|
}
|
|
2441
|
-
bind(
|
|
2442
|
-
let s = x(
|
|
2443
|
-
method:
|
|
2444
|
-
headers:
|
|
2445
|
-
cacheTtl:
|
|
2446
|
-
}), c = this.#e.query(s), l =
|
|
2442
|
+
bind(n, r, i, a, o) {
|
|
2443
|
+
let s = x(a.source, {
|
|
2444
|
+
method: a.method,
|
|
2445
|
+
headers: a.headers,
|
|
2446
|
+
cacheTtl: a.cacheTtl
|
|
2447
|
+
}), c = this.#e.query(s), l = e(() => {
|
|
2447
2448
|
let e = c.value;
|
|
2448
2449
|
if (e === null) return;
|
|
2449
|
-
let t =
|
|
2450
|
-
switch (
|
|
2450
|
+
let t = a.transform ? Rt(e, a.transform) : e;
|
|
2451
|
+
switch (a.target) {
|
|
2451
2452
|
case "textContent":
|
|
2452
|
-
|
|
2453
|
+
i.textContent = String(t ?? "");
|
|
2453
2454
|
break;
|
|
2454
2455
|
case "attribute":
|
|
2455
|
-
|
|
2456
|
+
a.targetName && t != null && i.setAttribute(a.targetName, String(t));
|
|
2456
2457
|
break;
|
|
2457
2458
|
case "property":
|
|
2458
|
-
|
|
2459
|
+
a.targetName && (i[a.targetName] = t);
|
|
2459
2460
|
break;
|
|
2460
2461
|
case "children":
|
|
2461
|
-
Array.isArray(t) && this.#o(
|
|
2462
|
+
Array.isArray(t) && this.#o(i, t, o);
|
|
2462
2463
|
break;
|
|
2463
2464
|
}
|
|
2464
|
-
}), u =
|
|
2465
|
-
|
|
2465
|
+
}), u = t("dbind"), d;
|
|
2466
|
+
a.refreshInterval && a.refreshInterval > 0 && (d = setInterval(() => {
|
|
2466
2467
|
this.#e.invalidate(zt(s)), this.#e.query(s);
|
|
2467
|
-
},
|
|
2468
|
+
}, a.refreshInterval)), this.#n.set(u, {
|
|
2468
2469
|
effectDispose: l,
|
|
2469
2470
|
intervalId: d
|
|
2470
2471
|
});
|
|
2471
2472
|
let f = Object.freeze({
|
|
2472
2473
|
id: u,
|
|
2473
|
-
planId:
|
|
2474
|
-
nodeId:
|
|
2475
|
-
binding:
|
|
2474
|
+
planId: n,
|
|
2475
|
+
nodeId: r,
|
|
2476
|
+
binding: a,
|
|
2476
2477
|
dispose: () => {
|
|
2477
|
-
this.#i(u), this.#t.value = this.#t.value.filter((e) => e.id !== u), this.#a(
|
|
2478
|
+
this.#i(u), this.#t.value = this.#t.value.filter((e) => e.id !== u), this.#a(n, u);
|
|
2478
2479
|
}
|
|
2479
|
-
}), p = this.#r.get(
|
|
2480
|
-
return p || (p = /* @__PURE__ */ new Set(), this.#r.set(
|
|
2480
|
+
}), p = this.#r.get(n);
|
|
2481
|
+
return p || (p = /* @__PURE__ */ new Set(), this.#r.set(n, p)), p.add(u), this.#t.value = [...this.#t.value, f], f;
|
|
2481
2482
|
}
|
|
2482
2483
|
bindPlan(e, t, n, r) {
|
|
2483
2484
|
let i = [];
|
|
@@ -3538,20 +3539,20 @@ var Tn = class e {
|
|
|
3538
3539
|
constructor(e) {
|
|
3539
3540
|
this.#e = e ?? /* @__PURE__ */ new Map();
|
|
3540
3541
|
}
|
|
3541
|
-
generate(e,
|
|
3542
|
+
generate(e, n) {
|
|
3542
3543
|
this.#t = 0;
|
|
3543
|
-
let
|
|
3544
|
-
id: e.id ??
|
|
3544
|
+
let r = this.#n(e), i = Cn({
|
|
3545
|
+
id: e.id ?? t("plan"),
|
|
3545
3546
|
version: 1,
|
|
3546
|
-
root:
|
|
3547
|
-
source:
|
|
3547
|
+
root: r,
|
|
3548
|
+
source: n ?? "generated",
|
|
3548
3549
|
timestamp: Date.now()
|
|
3549
3550
|
});
|
|
3550
3551
|
return Cn({
|
|
3551
|
-
plan:
|
|
3552
|
-
validation: g(
|
|
3553
|
-
accessibility: w(
|
|
3554
|
-
warnings: Object.freeze(this.#c(e,
|
|
3552
|
+
plan: i,
|
|
3553
|
+
validation: g(i, this.#e, { allowUnregistered: !0 }),
|
|
3554
|
+
accessibility: w(i.root),
|
|
3555
|
+
warnings: Object.freeze(this.#c(e, i))
|
|
3555
3556
|
});
|
|
3556
3557
|
}
|
|
3557
3558
|
#n(e) {
|