@elurjs/universal 0.1.1 → 0.1.3
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/cli/commands.mjs +2 -2
- package/cli/create-app.mjs +88 -5
- package/cli/dev.mjs +50 -0
- package/cli/tck-platform-windows.mjs +450 -0
- package/cli/tck-windows-uia.ps1 +312 -0
- package/cli/vm-agent.ps1 +25 -0
- package/cli/vm-job-server.py +97 -0
- package/cli/vm-job.py +46 -0
- package/docs/ESTADO.md +5 -1
- package/docs/PENDIENTES.md +160 -8
- package/docs/adr/0218-sdui-gateway-live-mcp-y-scaffold.md +1 -0
- package/docs/adr/0220-target-windows-winui3.md +331 -0
- package/docs/adr/0221-shell-tabs-desktop-normativa.md +45 -0
- package/docs/adr/README.md +11 -10
- package/docs/doc-data.json +395 -104
- package/docs/propuestas/demo-google-devfest-a2ui-sdui.md +169 -54
- package/docs/skills/elur-sdui-mcp/SKILL.md +100 -0
- package/examples/natprobe/entry-a11y.ts +52 -0
- package/examples/natprobe/entry-tinput.ts +73 -0
- package/examples/natprobe/entry-tml.ts +46 -0
- package/examples/natprobe/entry.ts +89 -0
- package/examples/uiprops/elur.app.json +8 -0
- package/examples/uiprops/entry.ts +65 -0
- package/native/ed25519/tweetnacl.c +809 -0
- package/native/ed25519/tweetnacl.h +272 -0
- package/package.json +1 -1
- package/src/app/state.ts +1 -1
- package/src/backends/web/base-css.ts +5 -0
- package/src/backends/web/index.ts +55 -2
- package/src/ir/catalog.ts +17 -3
- package/src/ir/schema.ts +245 -94
- package/src/native/http.ts +1 -1
- package/src/runtime/environment.ts +1 -1
- package/src/sdui/cryptoModule.ts +1 -1
- package/src/sdui/profile.ts +3 -2
- package/targets/android/app/src/main/java/com/elur/universal/ElurRenderer.kt +55 -3
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// examples/natprobe — probe aislado de text-input (control que crashaba en
|
|
2
|
+
// la VM vieja): render + input/submit/select/composition events.
|
|
3
|
+
import { mountApp } from "../../src/app/mount";
|
|
4
|
+
import { signal, computed } from "@elurjs/core/signals";
|
|
5
|
+
import { ui } from "../../src/ir/ui";
|
|
6
|
+
import { createRouter, defineRoutes } from "../../src/router";
|
|
7
|
+
|
|
8
|
+
const log = (m: string) => {
|
|
9
|
+
console.log("[tinput] " + m);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const stateText = signal("evt: —");
|
|
13
|
+
const valText = signal("value: —");
|
|
14
|
+
const selText = signal("sel: —");
|
|
15
|
+
const compText = signal("comp: —");
|
|
16
|
+
|
|
17
|
+
const STAGE: number = 1;
|
|
18
|
+
|
|
19
|
+
function screen() {
|
|
20
|
+
const input = STAGE === 0
|
|
21
|
+
? ui``
|
|
22
|
+
: STAGE === 1
|
|
23
|
+
? ui`<text-input />`
|
|
24
|
+
: STAGE === 2
|
|
25
|
+
? ui`<text-input placeholder="escribe aqui" maxlength=${24} />`
|
|
26
|
+
: STAGE === 3
|
|
27
|
+
? ui`<text-input placeholder="escribe aqui" maxlength=${24}
|
|
28
|
+
@input=${(e: { data?: { value?: string } }) => {
|
|
29
|
+
valText.value = "value: " + (e?.data?.value ?? "?");
|
|
30
|
+
log("input " + JSON.stringify(e?.data));
|
|
31
|
+
}}
|
|
32
|
+
@submit=${(e: unknown) => {
|
|
33
|
+
stateText.value = "evt: submit";
|
|
34
|
+
log("submit " + JSON.stringify(e));
|
|
35
|
+
}}
|
|
36
|
+
@focus=${() => { stateText.value = "evt: focus"; log("focus"); }}
|
|
37
|
+
@blur=${() => { stateText.value = "evt: blur"; log("blur"); }} />`
|
|
38
|
+
: ui`<text-input placeholder="escribe aqui" maxlength=${24}
|
|
39
|
+
@input=${(e: { data?: { value?: string } }) => {
|
|
40
|
+
valText.value = "value: " + (e?.data?.value ?? "?");
|
|
41
|
+
log("input " + JSON.stringify(e?.data));
|
|
42
|
+
}}
|
|
43
|
+
@submit=${(e: unknown) => {
|
|
44
|
+
stateText.value = "evt: submit";
|
|
45
|
+
log("submit " + JSON.stringify(e));
|
|
46
|
+
}}
|
|
47
|
+
@select=${(e: unknown) => {
|
|
48
|
+
selText.value = "sel: " + JSON.stringify(e);
|
|
49
|
+
log("select " + JSON.stringify(e));
|
|
50
|
+
}}
|
|
51
|
+
@composition=${(e: unknown) => {
|
|
52
|
+
compText.value = "comp: " + JSON.stringify(e);
|
|
53
|
+
log("comp " + JSON.stringify(e));
|
|
54
|
+
}}
|
|
55
|
+
@focus=${() => { stateText.value = "evt: focus"; log("focus"); }}
|
|
56
|
+
@blur=${() => { stateText.value = "evt: blur"; log("blur"); }} />`;
|
|
57
|
+
return ui`
|
|
58
|
+
<column style=${{ gap: 12, padding: 16, backgroundColor: "#111827", flexGrow: 1 }}>
|
|
59
|
+
<text style=${{ color: "#f9fafb", fontSize: 18 }}>tinput s${STAGE}</text>
|
|
60
|
+
${input}
|
|
61
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => stateText.value)}</text>
|
|
62
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => valText.value)}</text>
|
|
63
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => selText.value)}</text>
|
|
64
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => compText.value)}</text>
|
|
65
|
+
</column>`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const routes = defineRoutes([{ path: "/", component: async () => ({ default: screen }) }]);
|
|
69
|
+
|
|
70
|
+
const router = createRouter({ routes });
|
|
71
|
+
void mountApp({ router, routes, handlers: {} }).then(() => {
|
|
72
|
+
log("mounted");
|
|
73
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// examples/natprobe — probe de text-input multiline (swap
|
|
2
|
+
// GtkEntry→GtkTextView, ADR-0216): render, input, select, maxlength,
|
|
3
|
+
// rows y Enter=salto de línea (sin submit).
|
|
4
|
+
import { mountApp } from "../../src/app/mount";
|
|
5
|
+
import { signal, computed } from "@elurjs/core/signals";
|
|
6
|
+
import { ui } from "../../src/ir/ui";
|
|
7
|
+
import { createRouter, defineRoutes } from "../../src/router";
|
|
8
|
+
|
|
9
|
+
const log = (m: string) => {
|
|
10
|
+
console.log("[tml] " + m);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const stateText = signal("evt: —");
|
|
14
|
+
const valText = signal("value: —");
|
|
15
|
+
const selText = signal("sel: —");
|
|
16
|
+
|
|
17
|
+
function screen() {
|
|
18
|
+
return ui`
|
|
19
|
+
<column style=${{ gap: 12, padding: 16, backgroundColor: "#111827", flexGrow: 1 }}>
|
|
20
|
+
<text style=${{ color: "#f9fafb", fontSize: 18 }}>multiline</text>
|
|
21
|
+
<text-input multiline=${true} rows=${4} maxlength=${40}
|
|
22
|
+
style=${{ height: 140 }}
|
|
23
|
+
@input=${(e: { data?: { text?: string } }) => {
|
|
24
|
+
valText.value = "value: " + (e?.data?.text ?? "?");
|
|
25
|
+
log("input " + JSON.stringify(e?.data));
|
|
26
|
+
}}
|
|
27
|
+
@select=${(e: unknown) => {
|
|
28
|
+
selText.value = "sel: " + JSON.stringify(e);
|
|
29
|
+
log("select " + JSON.stringify(e));
|
|
30
|
+
}}
|
|
31
|
+
@focus=${() => { stateText.value = "evt: focus-ml"; log("focus-ml"); }}
|
|
32
|
+
@blur=${() => { stateText.value = "evt: blur-ml"; log("blur-ml"); }} />
|
|
33
|
+
<text-input placeholder="single"
|
|
34
|
+
@focus=${() => { stateText.value = "evt: focus-1l"; log("focus-1l"); }} />
|
|
35
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => stateText.value)}</text>
|
|
36
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => valText.value)}</text>
|
|
37
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => selText.value)}</text>
|
|
38
|
+
</column>`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const routes = defineRoutes([{ path: "/", component: async () => ({ default: screen }) }]);
|
|
42
|
+
|
|
43
|
+
const router = createRouter({ routes });
|
|
44
|
+
void mountApp({ router, routes, handlers: {} }).then(() => {
|
|
45
|
+
log("mounted");
|
|
46
|
+
});
|
|
@@ -21,6 +21,10 @@ const refreshing = signal(false);
|
|
|
21
21
|
const checkVal = signal(false);
|
|
22
22
|
const radioVal = signal(false);
|
|
23
23
|
const switchVal = signal(false);
|
|
24
|
+
const evtText = signal("evt: —");
|
|
25
|
+
const inputText = signal("input: —");
|
|
26
|
+
const sliderText = signal("slider: —");
|
|
27
|
+
const imgText = signal("img: —");
|
|
24
28
|
|
|
25
29
|
const log = (m: string) => {
|
|
26
30
|
console.log("[natprobe] " + m);
|
|
@@ -105,6 +109,37 @@ const handlers: Record<string, (e?: unknown) => void> = {
|
|
|
105
109
|
log("refresh x" + refreshCount.value);
|
|
106
110
|
setTimeout(() => { refreshing.value = false; }, 2500);
|
|
107
111
|
},
|
|
112
|
+
probeEvt: (e) => {
|
|
113
|
+
const d = (e as { data?: Record<string, unknown> })?.data ?? {};
|
|
114
|
+
evtText.value = `evt: ${JSON.stringify(d).slice(0, 42)}`;
|
|
115
|
+
log("evt " + evtText.value);
|
|
116
|
+
},
|
|
117
|
+
probeInput: (e) => {
|
|
118
|
+
const d = (e as { data?: Record<string, unknown> })?.data ?? {};
|
|
119
|
+
inputText.value = `input: ${JSON.stringify(d).slice(0, 42)}`;
|
|
120
|
+
log("input " + inputText.value);
|
|
121
|
+
},
|
|
122
|
+
probeSlider: (e) => {
|
|
123
|
+
const d = (e as { data?: Record<string, unknown> })?.data ?? {};
|
|
124
|
+
sliderText.value = `slider: ${d.value}`;
|
|
125
|
+
log(sliderText.value);
|
|
126
|
+
},
|
|
127
|
+
probeImgLoad: (e) => {
|
|
128
|
+
const d = (e as { data?: Record<string, unknown> })?.data ?? {};
|
|
129
|
+
imgText.value = `img: load ${JSON.stringify(d)}`;
|
|
130
|
+
log(imgText.value);
|
|
131
|
+
},
|
|
132
|
+
probeImgErr: (e) => {
|
|
133
|
+
const d = (e as { data?: Record<string, unknown> })?.data ?? {};
|
|
134
|
+
imgText.value = `img: error ${JSON.stringify(d)}`;
|
|
135
|
+
log(imgText.value);
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const probeNamed = (name: string) => (e?: unknown) => {
|
|
140
|
+
const d = (e as { data?: Record<string, unknown> })?.data ?? {};
|
|
141
|
+
evtText.value = `evt ${name}: ${JSON.stringify(d).slice(0, 40)}`;
|
|
142
|
+
log(evtText.value);
|
|
108
143
|
};
|
|
109
144
|
|
|
110
145
|
export const routes = defineRoutes([
|
|
@@ -124,7 +159,14 @@ const STAGE: number = 3;
|
|
|
124
159
|
|
|
125
160
|
function probeScreenInner() {
|
|
126
161
|
if (STAGE === 0) return ui`<column><text>hola</text></column>`;
|
|
162
|
+
if (STAGE === 5) return ui`<column><text-input placeholder="escribe…" /></column>`;
|
|
127
163
|
const btnRef = createNodeRef();
|
|
164
|
+
const evtRef = createNodeRef();
|
|
165
|
+
setTimeout(() => {
|
|
166
|
+
void evtRef.measureInWindow().then((r) => {
|
|
167
|
+
log(`evtbtn x=${Math.round(r.x)} y=${Math.round(r.y)} w=${Math.round(r.width)} h=${Math.round(r.height)}`);
|
|
168
|
+
});
|
|
169
|
+
}, 1500);
|
|
128
170
|
const measure = () => {
|
|
129
171
|
void btnRef.measureInWindow().then((r) => {
|
|
130
172
|
const s = `rect: x=${Math.round(r.x)} y=${Math.round(r.y)} w=${Math.round(r.width)} h=${Math.round(r.height)}`;
|
|
@@ -142,6 +184,25 @@ function probeScreenInner() {
|
|
|
142
184
|
</button>
|
|
143
185
|
<text style=${{ color: "#a5f3fc" }}>${computed(() => rectText.value)}</text>
|
|
144
186
|
|
|
187
|
+
<button id="evtbtn" ref=${evtRef} style=${{ height: 40 }}
|
|
188
|
+
@press=${(e: unknown) => probeNamed("press")(e)}
|
|
189
|
+
@hover=${(e: unknown) => probeNamed("hover")(e)}
|
|
190
|
+
@pointer=${(e: unknown) => probeNamed("pointer")(e)}
|
|
191
|
+
@contextMenu=${(e: unknown) => probeNamed("contextMenu")(e)}
|
|
192
|
+
@longPress=${(e: unknown) => probeNamed("longPress")(e)}
|
|
193
|
+
@pan=${(e: unknown) => probeNamed("pan")(e)}
|
|
194
|
+
@pinch=${(e: unknown) => probeNamed("pinch")(e)}
|
|
195
|
+
@key=${(e: unknown) => probeNamed("key")(e)}
|
|
196
|
+
@focus=${(e: unknown) => probeNamed("focus")(e)}
|
|
197
|
+
@blur=${(e: unknown) => probeNamed("blur")(e)}>
|
|
198
|
+
<text>eventos</text>
|
|
199
|
+
</button>
|
|
200
|
+
|
|
201
|
+
<text spans=${[
|
|
202
|
+
{ start: 0, end: 5, style: { fontWeight: "bold", color: "#fbbf24" } },
|
|
203
|
+
{ start: 10, end: 16, style: { color: "#38bdf8", textDecoration: "underline" }, href: "https://elur.dev/spans" },
|
|
204
|
+
]}>spans con enlace azul</text>
|
|
205
|
+
|
|
145
206
|
<row style=${{ gap: 14, height: 44, alignItems: "center" }}>
|
|
146
207
|
<switch checked=${switchVal} @change=${(e: { data?: { checked?: boolean } }) => {
|
|
147
208
|
switchVal.value = e?.data?.checked === true;
|
|
@@ -157,6 +218,34 @@ function probeScreenInner() {
|
|
|
157
218
|
}} />
|
|
158
219
|
</row>
|
|
159
220
|
|
|
221
|
+
<text style=${{ color: "#f9fafb" }}>input/slider/image</text>
|
|
222
|
+
${STAGE >= 4 ? ui`<text-input placeholder="escribe…" />` : ""}
|
|
223
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => inputText.value)}</text>
|
|
224
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => evtText.value)}</text>
|
|
225
|
+
<slider min=${0} max=${10} @change=${(e: unknown) => handlers.probeSlider(e)} />
|
|
226
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => sliderText.value)}</text>
|
|
227
|
+
<row style=${{ gap: 8, height: 52 }}>
|
|
228
|
+
<image src="file:///C:/elur/generated/probe-ok.png"
|
|
229
|
+
style=${{ width: 48, height: 48 }}
|
|
230
|
+
@load=${(e: unknown) => handlers.probeImgLoad(e)}
|
|
231
|
+
@error=${(e: unknown) => handlers.probeImgErr(e)} />
|
|
232
|
+
<image src="file:///C:/no-existe.png"
|
|
233
|
+
fallbackSrc="file:///C:/elur/generated/probe-ok.png"
|
|
234
|
+
style=${{ width: 48, height: 48 }}
|
|
235
|
+
@load=${(e: unknown) => handlers.probeImgLoad(e)}
|
|
236
|
+
@error=${(e: unknown) => handlers.probeImgErr(e)} />
|
|
237
|
+
<image src="file:///C:/no-existe-nunca.png"
|
|
238
|
+
style=${{ width: 48, height: 48 }}
|
|
239
|
+
@load=${(e: unknown) => handlers.probeImgLoad(e)}
|
|
240
|
+
@error=${(e: unknown) => handlers.probeImgErr(e)} />
|
|
241
|
+
</row>
|
|
242
|
+
<text style=${{ color: "#a5f3fc" }}>${computed(() => imgText.value)}</text>
|
|
243
|
+
<button disabled=${true}><text>disabled</text></button>
|
|
244
|
+
<text maxLines=${1} textOverflow="ellipsis"
|
|
245
|
+
style=${{ color: "#9ca3af" }}>
|
|
246
|
+
línea larga que debe truncarse con ellipsis en una sola línea de texto visible
|
|
247
|
+
</text>
|
|
248
|
+
|
|
160
249
|
<text style=${{ color: "#a5f3fc" }}>${computed(() => scrollText.value)}</text>
|
|
161
250
|
<text style=${{ color: "#a5f3fc" }}>${computed(() => listScrollX.value)}</text>
|
|
162
251
|
<text style=${{ color: "#a5f3fc" }}>${computed(() => scrollKeys.value)}</text>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// examples/uiprops — medición UIA on-device de props approx en Windows:
|
|
2
|
+
// dir rtl (orden de hijos), scrollTop/scrollLeft programáticos
|
|
3
|
+
// (ScrollPattern tras ChangeView), shortcut (SendKeys → emit),
|
|
4
|
+
// readOnly (ValuePattern.IsReadOnly), load de image con data-URI
|
|
5
|
+
// (ImageOpened), focused inicial. Marca [uiprops] en el log.
|
|
6
|
+
import { mountApp } from "../../src/app/mount";
|
|
7
|
+
import { signal } from "@elurjs/core/signals";
|
|
8
|
+
import { ui } from "../../src/ir/ui";
|
|
9
|
+
import { createNodeRef } from "../../src/runtime/environment";
|
|
10
|
+
|
|
11
|
+
const evt = signal("evt: —");
|
|
12
|
+
const scrollPos = signal(0);
|
|
13
|
+
const hscrollPos = signal(0);
|
|
14
|
+
|
|
15
|
+
const PNG_1PX =
|
|
16
|
+
"data:image/png;base64," +
|
|
17
|
+
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
|
|
18
|
+
|
|
19
|
+
const log = (m: string) => console.log("[uiprops] " + m);
|
|
20
|
+
|
|
21
|
+
const svRef = createNodeRef();
|
|
22
|
+
|
|
23
|
+
mountApp(ui`
|
|
24
|
+
<scroll-view ref=${svRef} scrollTop=${() => scrollPos.value}
|
|
25
|
+
style=${{ flexGrow: 1, backgroundColor: "#0f172a", padding: 12 }}>
|
|
26
|
+
<column style=${{ gap: 10 }}>
|
|
27
|
+
<text style=${{ color: "#f9fafb" }}>uiprops</text>
|
|
28
|
+
<row dir="rtl" label="rtl-row" style=${{ gap: 8 }}>
|
|
29
|
+
<text style=${{ color: "#fff" }}>primero</text>
|
|
30
|
+
<text style=${{ color: "#fff" }}>segundo</text>
|
|
31
|
+
</row>
|
|
32
|
+
<text-input label="ro-input" readOnly=${true} value="solo lectura"
|
|
33
|
+
style=${{ height: 34 }} />
|
|
34
|
+
<text-input label="rw-input" placeholder="escribe" focused=${true}
|
|
35
|
+
style=${{ height: 34 }} />
|
|
36
|
+
<button label="scroll+120" shortcut="ctrl+s"
|
|
37
|
+
@press=${() => { scrollPos.value = 120; log("scrollTop set 120"); }}
|
|
38
|
+
@shortcut=${(e: unknown) => {
|
|
39
|
+
evt.value = "evt shortcut: " + JSON.stringify(e);
|
|
40
|
+
log("shortcut fired");
|
|
41
|
+
}}>
|
|
42
|
+
<text>scroll+</text>
|
|
43
|
+
</button>
|
|
44
|
+
<image src=${PNG_1PX} label="img1" style=${{ width: 32, height: 32 }}
|
|
45
|
+
@load=${(e: unknown) => {
|
|
46
|
+
evt.value = "evt load: " + JSON.stringify(e);
|
|
47
|
+
log("load " + JSON.stringify(e));
|
|
48
|
+
}}
|
|
49
|
+
@error=${(e: unknown) => log("imgerr " + JSON.stringify(e))} />
|
|
50
|
+
<scroll-view horizontal=${true} label="hscroll"
|
|
51
|
+
scrollLeft=${() => hscrollPos.value}
|
|
52
|
+
style=${{ height: 56 }}>
|
|
53
|
+
<row style=${{ gap: 8 }}>
|
|
54
|
+
${[...Array(20)].map((_, i) => ui`<text style=${{ color: "#fde68a" }}>col${i}</text>`)}
|
|
55
|
+
</row>
|
|
56
|
+
</scroll-view>
|
|
57
|
+
<button label="hscroll+150"
|
|
58
|
+
@press=${() => { hscrollPos.value = 150; log("scrollLeft set 150"); }}>
|
|
59
|
+
<text>h+</text>
|
|
60
|
+
</button>
|
|
61
|
+
<text style=${{ color: "#a5f3fc" }}>${() => evt.value}</text>
|
|
62
|
+
${[...Array(40)].map((_, i) => ui`<text style=${{ color: "#9ca3af" }}>fila ${i}</text>`)}
|
|
63
|
+
</column>
|
|
64
|
+
</scroll-view>
|
|
65
|
+
`);
|