@elurjs/universal 0.1.2 → 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 +67 -4
- 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/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
package/src/native/http.ts
CHANGED
|
@@ -31,7 +31,7 @@ export const httpModuleDef: NativeModuleDef = {
|
|
|
31
31
|
abiVersion: NATIVE_ABI_VERSION,
|
|
32
32
|
version: "1.0.0",
|
|
33
33
|
capabilities: ["http-client"],
|
|
34
|
-
platforms: ["android", "linux"],
|
|
34
|
+
platforms: ["android", "linux", "windows"],
|
|
35
35
|
commands: {
|
|
36
36
|
request: {
|
|
37
37
|
input: {
|
|
@@ -18,7 +18,7 @@ export const uiModuleDef: NativeModuleDef = {
|
|
|
18
18
|
abiVersion: NATIVE_ABI_VERSION,
|
|
19
19
|
version: "1.0.0",
|
|
20
20
|
capabilities: ["ui-host"],
|
|
21
|
-
platforms: ["android", "linux"],
|
|
21
|
+
platforms: ["android", "linux", "windows"],
|
|
22
22
|
commands: {
|
|
23
23
|
measureInWindow: {
|
|
24
24
|
input: { id: "number" },
|
package/src/sdui/cryptoModule.ts
CHANGED
|
@@ -40,7 +40,7 @@ export const cryptoModuleDef: NativeModuleDef = {
|
|
|
40
40
|
abiVersion: NATIVE_ABI_VERSION,
|
|
41
41
|
version: "1.0.0",
|
|
42
42
|
capabilities: ["ed25519-verify"],
|
|
43
|
-
platforms: ["android", "linux"],
|
|
43
|
+
platforms: ["android", "linux", "windows"],
|
|
44
44
|
commands: {
|
|
45
45
|
verify: {
|
|
46
46
|
input: { payload: "string", sig: "string", key: "string" },
|
package/src/sdui/profile.ts
CHANGED
|
@@ -53,14 +53,15 @@ export function profileFromRuntime(
|
|
|
53
53
|
): { profile: SduiProfile | null; diagnostics: Diagnostic[] } {
|
|
54
54
|
const platform = v.platform as CapabilityPlatform;
|
|
55
55
|
if (platform !== "web" && platform !== "android" &&
|
|
56
|
-
platform !== "linux") {
|
|
56
|
+
platform !== "linux" && platform !== "windows") {
|
|
57
57
|
return {
|
|
58
58
|
profile: null,
|
|
59
59
|
diagnostics: [diagnostic("sdui.profile.platform", "capability",
|
|
60
60
|
"error",
|
|
61
61
|
`plataforma "${v.platform}" sin columna en la matriz — ` +
|
|
62
62
|
"no hay perfil servible",
|
|
63
|
-
{ actual: v.platform,
|
|
63
|
+
{ actual: v.platform,
|
|
64
|
+
expected: "web|android|linux|windows" })],
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
67
|
const profile: SduiProfile = { platform, ir: v.ir };
|
|
@@ -225,6 +225,8 @@ class ElurRenderer(
|
|
|
225
225
|
var hover: InputChannel? = null
|
|
226
226
|
var pointer: InputChannel? = null
|
|
227
227
|
var contextMenu: InputChannel? = null
|
|
228
|
+
var pinch: InputChannel? = null
|
|
229
|
+
private var scaleDet: android.view.ScaleGestureDetector? = null
|
|
228
230
|
private val density = view.resources.displayMetrics.density
|
|
229
231
|
private val slop =
|
|
230
232
|
android.view.ViewConfiguration.get(view.context).scaledTouchSlop.toDouble()
|
|
@@ -240,7 +242,8 @@ class ElurRenderer(
|
|
|
240
242
|
pan == null &&
|
|
241
243
|
hover == null &&
|
|
242
244
|
pointer == null &&
|
|
243
|
-
contextMenu == null
|
|
245
|
+
contextMenu == null &&
|
|
246
|
+
pinch == null
|
|
244
247
|
|
|
245
248
|
fun install() {
|
|
246
249
|
view.setOnTouchListener { v, ev -> onTouch(v, ev) }
|
|
@@ -265,6 +268,51 @@ class ElurRenderer(
|
|
|
265
268
|
view.setOnContextClickListener(null)
|
|
266
269
|
view.isContextClickable = false
|
|
267
270
|
}
|
|
271
|
+
// pinch: ScaleGestureDetector del framework — payload del
|
|
272
|
+
// contrato {scale,focalX,focalY,phase} en dp (events.ts).
|
|
273
|
+
scaleDet =
|
|
274
|
+
if (pinch != null)
|
|
275
|
+
android.view.ScaleGestureDetector(
|
|
276
|
+
view.context,
|
|
277
|
+
object :
|
|
278
|
+
android.view.ScaleGestureDetector
|
|
279
|
+
.SimpleOnScaleGestureListener() {
|
|
280
|
+
override fun onScaleBegin(
|
|
281
|
+
d: android.view.ScaleGestureDetector
|
|
282
|
+
): Boolean {
|
|
283
|
+
emitPinch("start", d)
|
|
284
|
+
return true
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
override fun onScale(
|
|
288
|
+
d: android.view.ScaleGestureDetector
|
|
289
|
+
): Boolean {
|
|
290
|
+
emitPinch("move", d)
|
|
291
|
+
return true
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
override fun onScaleEnd(
|
|
295
|
+
d: android.view.ScaleGestureDetector
|
|
296
|
+
) {
|
|
297
|
+
emitPinch("end", d)
|
|
298
|
+
}
|
|
299
|
+
})
|
|
300
|
+
else null
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
private fun emitPinch(phase: String, d: android.view.ScaleGestureDetector) {
|
|
304
|
+
val ch = pinch ?: return
|
|
305
|
+
callEventHandler(
|
|
306
|
+
ch.handler,
|
|
307
|
+
"pinch",
|
|
308
|
+
"user",
|
|
309
|
+
"{\"phase\":\"$phase\",\"scale\":${d.scaleFactor}," +
|
|
310
|
+
"\"focalX\":${lg(d.focusX)},\"focalY\":${lg(d.focusY)}}",
|
|
311
|
+
ch.continuous && phase == "move",
|
|
312
|
+
ch.payload,
|
|
313
|
+
"pinch:$id"
|
|
314
|
+
)
|
|
315
|
+
scheduleFrameCallback()
|
|
268
316
|
}
|
|
269
317
|
|
|
270
318
|
fun uninstall() {
|
|
@@ -274,6 +322,7 @@ class ElurRenderer(
|
|
|
274
322
|
view.isLongClickable = false
|
|
275
323
|
view.setOnContextClickListener(null)
|
|
276
324
|
view.isContextClickable = false
|
|
325
|
+
scaleDet = null
|
|
277
326
|
}
|
|
278
327
|
|
|
279
328
|
private fun lg(px: Float) = px / density
|
|
@@ -312,6 +361,7 @@ class ElurRenderer(
|
|
|
312
361
|
}
|
|
313
362
|
|
|
314
363
|
private fun onTouch(v: View, ev: MotionEvent): Boolean {
|
|
364
|
+
scaleDet?.onTouchEvent(ev)
|
|
315
365
|
when (ev.actionMasked) {
|
|
316
366
|
MotionEvent.ACTION_DOWN -> {
|
|
317
367
|
downX = ev.x
|
|
@@ -4817,7 +4867,7 @@ class ElurRenderer(
|
|
|
4817
4867
|
"endReached" -> {
|
|
4818
4868
|
// Sintetizado por el reconciler sobre `scroll`.
|
|
4819
4869
|
}
|
|
4820
|
-
"longPress", "pan", "hover", "pointer", "contextMenu", "contextmenu" -> {
|
|
4870
|
+
"longPress", "pan", "hover", "pointer", "contextMenu", "contextmenu", "pinch" -> {
|
|
4821
4871
|
val view = views[id] ?: return
|
|
4822
4872
|
val g = gestures.getOrPut(id) { NodeGestures(id, view) }
|
|
4823
4873
|
val ch = InputChannel(handler, continuous, payload)
|
|
@@ -4826,6 +4876,7 @@ class ElurRenderer(
|
|
|
4826
4876
|
"pan" -> g.pan = ch
|
|
4827
4877
|
"hover" -> g.hover = ch
|
|
4828
4878
|
"pointer" -> g.pointer = ch
|
|
4879
|
+
"pinch" -> g.pinch = ch
|
|
4829
4880
|
else -> g.contextMenu = ch
|
|
4830
4881
|
}
|
|
4831
4882
|
g.install()
|
|
@@ -5115,13 +5166,14 @@ class ElurRenderer(
|
|
|
5115
5166
|
(views[id] as? ElurScrollView)?.onRefreshTrigger = null
|
|
5116
5167
|
}
|
|
5117
5168
|
"endReached" -> {}
|
|
5118
|
-
"longPress", "pan", "hover", "pointer", "contextMenu", "contextmenu" -> {
|
|
5169
|
+
"longPress", "pan", "hover", "pointer", "contextMenu", "contextmenu", "pinch" -> {
|
|
5119
5170
|
val g = gestures[id] ?: return
|
|
5120
5171
|
when (event) {
|
|
5121
5172
|
"longPress" -> g.longPress = null
|
|
5122
5173
|
"pan" -> g.pan = null
|
|
5123
5174
|
"hover" -> g.hover = null
|
|
5124
5175
|
"pointer" -> g.pointer = null
|
|
5176
|
+
"pinch" -> g.pinch = null
|
|
5125
5177
|
else -> g.contextMenu = null
|
|
5126
5178
|
}
|
|
5127
5179
|
if (g.isEmpty()) {
|