@elurjs/universal 0.0.0-stage → 0.1.0

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.
Files changed (757) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +24 -0
  3. package/README.md +102 -2
  4. package/THIRD_PARTY_NOTICES.md +153 -0
  5. package/cli/.gitkeep +0 -0
  6. package/cli/build-spec.mjs +46 -0
  7. package/cli/build-ssg.mjs +145 -0
  8. package/cli/build-ssr.mjs +276 -0
  9. package/cli/check-divergences.mjs +135 -0
  10. package/cli/check-doc-sync.mjs +282 -0
  11. package/cli/commands.d.mts +8 -0
  12. package/cli/commands.mjs +124 -0
  13. package/cli/commit-present.py +157 -0
  14. package/cli/create-app.mjs +768 -0
  15. package/cli/debug.mjs +45 -0
  16. package/cli/dev.mjs +488 -0
  17. package/cli/doctor.mjs +197 -0
  18. package/cli/elur.mjs +394 -0
  19. package/cli/font-license.mjs +24 -0
  20. package/cli/gen-bundle.mjs +195 -0
  21. package/cli/gen-doc-data.mjs +274 -0
  22. package/cli/gen-es5.mjs +60 -0
  23. package/cli/gen-hbc.mjs +87 -0
  24. package/cli/gen-host-integration.mjs +386 -0
  25. package/cli/gen-i18n-corpus.mjs +47 -0
  26. package/cli/gen-manifest.mjs +95 -0
  27. package/cli/gen-qjsc.mjs +77 -0
  28. package/cli/gen-route-types.mjs +65 -0
  29. package/cli/gen-routes.mjs +129 -0
  30. package/cli/gen-signals.mjs +151 -0
  31. package/cli/gen-ssr-client.mjs +119 -0
  32. package/cli/gen-wire-codec.mjs +214 -0
  33. package/cli/gen-wire-corpus.mjs +318 -0
  34. package/cli/gen-worklet-src.mjs +200 -0
  35. package/cli/gen-zones.mjs +197 -0
  36. package/cli/hermes-pair.mjs +61 -0
  37. package/cli/inspect.mjs +55 -0
  38. package/cli/layout-oracle-web.mjs +213 -0
  39. package/cli/layout-oracle.mjs +80 -0
  40. package/cli/lib-vlq.mjs +84 -0
  41. package/cli/measure-engines.mjs +206 -0
  42. package/cli/measure-shared.mjs +143 -0
  43. package/cli/package-linux.mjs +440 -0
  44. package/cli/parity-align.mjs +66 -0
  45. package/cli/platform-plugin.ts +97 -0
  46. package/cli/plugin-manifest.mjs +573 -0
  47. package/cli/run-bench.mjs +291 -0
  48. package/cli/run-commit-present.sh +91 -0
  49. package/cli/run-device-ab-surface.sh +94 -0
  50. package/cli/run-device-ab.sh +107 -0
  51. package/cli/run-energy.sh +44 -0
  52. package/cli/run-parity.mjs +164 -0
  53. package/cli/run-semantics.mjs +111 -0
  54. package/cli/run-tck.mjs +243 -0
  55. package/cli/sdui.mjs +1211 -0
  56. package/cli/symbolicate.mjs +90 -0
  57. package/cli/tck-android.sh +21 -0
  58. package/cli/tck-events-android.mjs +101 -0
  59. package/cli/tck-linux-atspi.py +389 -0
  60. package/cli/tck-platform-linux.mjs +638 -0
  61. package/cli/tck-platform.mjs +510 -0
  62. package/cli/visual-parity.mjs +691 -0
  63. package/docs/AUDITORIA-STATE-OF-THE-ART-2026-11.md +981 -0
  64. package/docs/ESTADO.md +679 -0
  65. package/docs/IMPLEMENTACION-NATIVA-v5.md +507 -0
  66. package/docs/PENDIENTES.md +1306 -0
  67. package/docs/adr/0013-transiciones-navegacion.md +169 -0
  68. package/docs/adr/0014-list-renderitem-factory.md +41 -0
  69. package/docs/adr/0015-dl-header-versionado.md +57 -0
  70. package/docs/adr/0016-hermes-v1-runtime.md +78 -0
  71. package/docs/adr/0017-encoder-nativo-dl.md +62 -0
  72. package/docs/adr/0018-yoga-tree-nativo.md +78 -0
  73. package/docs/adr/0019-ssr-universal-hidratacion.md +245 -0
  74. package/docs/adr/0020-canvas-draw-list.md +65 -0
  75. package/docs/adr/0021-text-input-props.md +55 -0
  76. package/docs/adr/0022-deep-links.md +49 -0
  77. package/docs/adr/0023-animacion-declarativa.md +130 -0
  78. package/docs/adr/0024-estilos-reactivos-vocabulario.md +100 -0
  79. package/docs/adr/0025-worklets-contrato-runner.md +181 -0
  80. package/docs/adr/0026-threading-js-dedicado.md +94 -0
  81. package/docs/adr/0027-ui-array-children-y-scope-por-fila.md +58 -0
  82. package/docs/adr/0028-commit-por-frame-en-host-embebido.md +93 -0
  83. package/docs/adr/0029-render-commit-latest-wins-screenhost.md +62 -0
  84. package/docs/adr/0030-destruccion-recursiva-ids-monotonicos.md +79 -0
  85. package/docs/adr/0031-scopes-formales-pool-filas.md +76 -0
  86. package/docs/adr/0032-nav-commit-autoritativo.md +64 -0
  87. package/docs/adr/0033-lista-virtual-ventana.md +80 -0
  88. package/docs/adr/0034-attach-event-class-strict-styles.md +89 -0
  89. package/docs/adr/0035-pipeline-imagenes-acotado.md +133 -0
  90. package/docs/adr/0036-data-por-entry-spa.md +91 -0
  91. package/docs/adr/0037-ir-serializable-factories-por-id.md +73 -0
  92. package/docs/adr/0038-transform-keys-compositor.md +79 -0
  93. package/docs/adr/0039-destroy-postorder-scope-ownership.md +86 -0
  94. package/docs/adr/0040-outbound-barriers-overflow-ack.md +60 -0
  95. package/docs/adr/0041-diff-treap-ir-version-strict.md +65 -0
  96. package/docs/adr/0042-data-endpoint-seguridad-hasloader.md +67 -0
  97. package/docs/adr/0043-aplicador-dom-unico.md +70 -0
  98. package/docs/adr/0044-descriptor-runtime-explicito.md +80 -0
  99. package/docs/adr/0045-navstate-versionado-scroll-settle.md +72 -0
  100. package/docs/adr/0046-harness-build-fail-closed.md +99 -0
  101. package/docs/adr/0047-envelope-evento-normalizado.md +110 -0
  102. package/docs/adr/0048-sesion-embebida-estados.md +91 -0
  103. package/docs/adr/0049-strict-styles-valores-portables.md +78 -0
  104. package/docs/adr/0050-update-style-tipado-abi-v5.md +66 -0
  105. package/docs/adr/0051-plugin-sdk-comandos.md +65 -0
  106. package/docs/adr/0052-benchmarks-reproducibles.md +50 -0
  107. package/docs/adr/0053-fling-target-pool-estructural.md +105 -0
  108. package/docs/adr/0054-lista-nativa-render-policy.md +130 -0
  109. package/docs/adr/0055-cesm-core.md +143 -0
  110. package/docs/adr/0056-dos-ejes-superficie-vs-propietario-de-ventana.md +112 -0
  111. package/docs/adr/0057-reset-node-y-firma-de-reciclaje.md +95 -0
  112. package/docs/adr/0058-rollback-de-montaje.md +83 -0
  113. package/docs/adr/0059-traza-on-device-u01-y-scroll-unico-productor.md +89 -0
  114. package/docs/adr/0060-list-update-patch-por-campo.md +73 -0
  115. package/docs/adr/0061-elegibilidad-de-plantilla-nativa.md +70 -0
  116. package/docs/adr/0062-invalidacion-adapter-lista-nativa.md +77 -0
  117. package/docs/adr/0063-autoridad-eventos-y-scroll.md +66 -0
  118. package/docs/adr/0064-admision-unica-de-commits.md +66 -0
  119. package/docs/adr/0065-runtime-de-sesion-u11.md +97 -0
  120. package/docs/adr/0066-perfil-layout-y-safe-area.md +78 -0
  121. package/docs/adr/0067-sesion-robusta-y-procedencia-de-build.md +121 -0
  122. package/docs/adr/0068-metodologia-de-benchmark-y-carril-verificable.md +94 -0
  123. package/docs/adr/0069-schema-de-wire-y-corpus-comun-de-codecs.md +126 -0
  124. package/docs/adr/0070-modelo-publico-de-aplicacion-y-mount.md +91 -0
  125. package/docs/adr/0071-image-service-y-tck-de-plataforma.md +133 -0
  126. package/docs/adr/0072-par-compilador-runtime-hermes.md +62 -0
  127. package/docs/adr/0073-corpus-de-semantica-y-lowering-por-motor.md +67 -0
  128. package/docs/adr/0074-perfil-i18n-formateo-dom-free.md +85 -0
  129. package/docs/adr/0075-back-predictivo-restore-y-layout-adaptativo.md +126 -0
  130. package/docs/adr/0076-contrato-de-modulos-capa-1.md +159 -0
  131. package/docs/adr/0077-manifest-de-plugin-y-plugin-sync.md +109 -0
  132. package/docs/adr/0078-extraccion-de-i18n-a-paquete-propio.md +114 -0
  133. package/docs/adr/0079-handles-de-host-objects-por-epoch.md +96 -0
  134. package/docs/adr/0080-platform-views-por-contrato.md +93 -0
  135. package/docs/adr/0081-codegen-del-dsl-de-modulos.md +118 -0
  136. package/docs/adr/0082-variante-web-de-modulos-nativos.md +126 -0
  137. package/docs/adr/0083-perfiles-dev-release.md +92 -0
  138. package/docs/adr/0084-instrumentacion-acotada-exportable.md +126 -0
  139. package/docs/adr/0085-medicion-agrupada-en-main.md +125 -0
  140. package/docs/adr/0086-matriz-capacidades-props-eventos.md +75 -0
  141. package/docs/adr/0087-uithread-runner-android.md +271 -0
  142. package/docs/adr/0088-worklet-src-estatico.md +82 -0
  143. package/docs/adr/0089-composicion-animaciones-settle-drag.md +122 -0
  144. package/docs/adr/0090-linter-capturas-build.md +94 -0
  145. package/docs/adr/0091-router-core-vs-universal.md +74 -0
  146. package/docs/adr/0092-sharedregion-type-strings.md +59 -0
  147. package/docs/adr/0093-permission-request-estandar.md +52 -0
  148. package/docs/adr/0094-dispatch-worker-timeoutms.md +51 -0
  149. package/docs/adr/0095-tck-modulos.md +65 -0
  150. package/docs/adr/0096-cesm-ring-deferral.md +47 -0
  151. package/docs/adr/0097-tooling-diferido.md +51 -0
  152. package/docs/adr/0098-handshake-moduleabi.md +46 -0
  153. package/docs/adr/0099-modulos-ambient.md +58 -0
  154. package/docs/adr/0100-auto-declaracion-modulos.md +43 -0
  155. package/docs/adr/0101-plataforma-build.md +49 -0
  156. package/docs/adr/0102-permisos-manifest-build.md +38 -0
  157. package/docs/adr/0103-registrant-ownership.md +45 -0
  158. package/docs/adr/0104-toolchain-release.md +125 -0
  159. package/docs/adr/0105-cesm-ring-mode.md +71 -0
  160. package/docs/adr/0106-module-observabilidad.md +100 -0
  161. package/docs/adr/0107-layout-l1-oraculo.md +67 -0
  162. package/docs/adr/0108-semantica-como-ops.md +69 -0
  163. package/docs/adr/0109-text-input-composition.md +64 -0
  164. package/docs/adr/0110-yoga-3-2.md +63 -0
  165. package/docs/adr/0111-hot-reload-con-estado.md +92 -0
  166. package/docs/adr/0112-metricas-nativas-reales.md +65 -0
  167. package/docs/adr/0113-cesm-proyeccion-ampliada.md +80 -0
  168. package/docs/adr/0114-androidx-deps.md +72 -0
  169. package/docs/adr/0115-coil-imagenes.md +57 -0
  170. package/docs/adr/0116-precomputed-text-off-ui.md +49 -0
  171. package/docs/adr/0117-a11y-state-hint-foco.md +54 -0
  172. package/docs/adr/0118-yoga-3-2-vocabulario.md +98 -0
  173. package/docs/adr/0119-codecs-wire-desde-esquema.md +86 -0
  174. package/docs/adr/0120-unidades-logicas-pointscalefactor.md +73 -0
  175. package/docs/adr/0121-yoga-filas-lista.md +100 -0
  176. package/docs/adr/0122-delegado-layout-subarbol.md +140 -0
  177. package/docs/adr/0123-canvas-sobre-skia-raster.md +101 -0
  178. package/docs/adr/0124-evaluacion-taffy-css-grid.md +52 -0
  179. package/docs/adr/0125-paridad-visual-android.md +89 -0
  180. package/docs/adr/0126-documento-web-metadata-enlaces.md +52 -0
  181. package/docs/adr/0127-perfil-l1-shorthand-flex-herencia-texto.md +70 -0
  182. package/docs/adr/0128-pantalla-llena-fragmentos-transparentes.md +56 -0
  183. package/docs/adr/0129-content-visibility-canvas-unidades-logicas.md +37 -0
  184. package/docs/adr/0130-expresiones-reactivas-ui.md +55 -0
  185. package/docs/adr/0131-state-style.md +59 -0
  186. package/docs/adr/0132-create-theme-system-color-scheme.md +58 -0
  187. package/docs/adr/0133-navegacion-rutas-href-chrome.md +59 -0
  188. package/docs/adr/0134-servicios-ambient-modulos-timers.md +63 -0
  189. package/docs/adr/0135-registro-fuentes.md +67 -0
  190. package/docs/adr/0136-i18n-zonas-dst-locale-reactivo.md +70 -0
  191. package/docs/adr/0137-ssg-universal.md +78 -0
  192. package/docs/adr/0138-plantillas-fila-ui-rowref.md +54 -0
  193. package/docs/adr/0139-paridad-geometrica-e-inspector.md +63 -0
  194. package/docs/adr/0140-medida-line-height-css.md +78 -0
  195. package/docs/adr/0141-build-ssr-autocontenido.md +37 -0
  196. package/docs/adr/0142-tema-ssr-cookie-client-hint.md +42 -0
  197. package/docs/adr/0143-paridad-visual-ci.md +51 -0
  198. package/docs/adr/0144-oraculo-layout-chromium.md +45 -0
  199. package/docs/adr/0145-admision-opcodes-wire.md +89 -0
  200. package/docs/adr/0146-presupuesto-divergencias.md +82 -0
  201. package/docs/adr/0147-spans-texto-enriquecido.md +113 -0
  202. package/docs/adr/0148-scroll-restore.md +92 -0
  203. package/docs/adr/0149-gestion-foco.md +94 -0
  204. package/docs/adr/0150-sticky.md +89 -0
  205. package/docs/adr/0151-politica-migracion-snapshots.md +83 -0
  206. package/docs/adr/0152-vocabulario-semantico-v3.md +112 -0
  207. package/docs/adr/0153-puerta-doc-codigo.md +59 -0
  208. package/docs/adr/0154-matriz-paridad.md +79 -0
  209. package/docs/adr/0155-rtl-ambiente.md +73 -0
  210. package/docs/adr/0156-quickjs-ng-0170.md +55 -0
  211. package/docs/adr/0157-qjsc-bytecode-android.md +73 -0
  212. package/docs/adr/0158-abi-host-explicita.md +62 -0
  213. package/docs/adr/0159-entrada-desktop.md +59 -0
  214. package/docs/adr/0160-port-linux-hallazgos-plataforma.md +91 -0
  215. package/docs/adr/0161-paridad-deeplink-alineacion-estructural.md +76 -0
  216. package/docs/adr/0162-fontscale-linux-fuentes.md +63 -0
  217. package/docs/adr/0163-overflow-hidden-linux-clip.md +67 -0
  218. package/docs/adr/0164-nav-transitions-linux.md +126 -0
  219. package/docs/adr/0165-transiciones-declarativas.md +147 -0
  220. package/docs/adr/0166-ime-composition-linux.md +68 -0
  221. package/docs/adr/0167-spans-pango-linux.md +80 -0
  222. package/docs/adr/0168-statestyle-linux.md +65 -0
  223. package/docs/adr/0169-animate-linux.md +114 -0
  224. package/docs/adr/0170-image-service-linux.md +54 -0
  225. package/docs/adr/0171-semantics-atspi-linux.md +80 -0
  226. package/docs/adr/0172-conformidad-de-host-por-terceros.md +159 -0
  227. package/docs/adr/0173-licencias-espec-y-codigo.md +95 -0
  228. package/docs/adr/0174-tabla-estilo-yoga-compartida.md +67 -0
  229. package/docs/adr/0175-easings-normativos-cubic-bezier.md +68 -0
  230. package/docs/adr/0176-harness-plataforma-linux-y-locale-decimal.md +80 -0
  231. package/docs/adr/0177-gaps-linux-dir-as-navstate.md +84 -0
  232. package/docs/adr/0178-matriz-linux-y-tablas-normativas-generadas.md +104 -0
  233. package/docs/adr/0179-eventos-gesto-y-teclado.md +132 -0
  234. package/docs/adr/0180-desktop-nativo-linux-windows-macos-chromeos.md +58 -0
  235. package/docs/adr/0181-linux-platform-views-uiworklet-y-gaps-certificados.md +101 -0
  236. package/docs/adr/0182-sdui-envelope-dialecto-rico-y-lowering.md +452 -0
  237. package/docs/adr/0183-hermes-es6-block-scoping-en-source-eval.md +99 -0
  238. package/docs/adr/0184-sdui-consumidor-de-referencia-y-modulo-http.md +72 -0
  239. package/docs/adr/0185-sdui-modelo-de-seguridad-del-envelope.md +160 -0
  240. package/docs/adr/0186-linux-packaging-deb-rpm-flatpak.md +61 -0
  241. package/docs/adr/0187-modelo-de-hilos-ejecutores-logicos.md +163 -0
  242. package/docs/adr/0188-sdui-seguridad-hardening.md +214 -0
  243. package/docs/adr/0189-worklets-web-worker-y-egreso-pinning.md +235 -0
  244. package/docs/adr/0190-semantics-actions-linux-via-gaction-muxer.md +102 -0
  245. package/docs/adr/0191-reporte-de-errores-en-produccion.md +126 -0
  246. package/docs/adr/0192-source-maps-y-simbolizacion-de-stacks.md +107 -0
  247. package/docs/adr/0193-renderer-skia-opt-in-en-linux.md +143 -0
  248. package/docs/adr/0194-superficie-declarada-y-carril-skia-tree.md +96 -0
  249. package/docs/adr/0195-bundles-embebidos-subpaths-core.md +66 -0
  250. package/docs/adr/0196-matriz-capacidades-verdad.md +84 -0
  251. package/docs/adr/0197-entorno-reactivo-cableado.md +67 -0
  252. package/docs/adr/0198-csprng-host-wintertc.md +57 -0
  253. package/docs/adr/0199-testing-harness-dom-free.md +59 -0
  254. package/docs/adr/0200-overlays-back-foco.md +84 -0
  255. package/docs/adr/0201-paridad-nativa-props-texto-fase1.md +79 -0
  256. package/docs/adr/0202-node-ref-measure-web.md +61 -0
  257. package/docs/adr/0203-primitivas-headless.md +54 -0
  258. package/docs/adr/0204-imagen-load-error-fallback.md +123 -0
  259. package/docs/adr/0205-primitivas-controls-fase2.md +79 -0
  260. package/docs/adr/0206-a2ui-catalogo-tabs-modal-choicepicker-icon.md +110 -0
  261. package/docs/adr/0207-a2ui-superficie-viva.md +104 -0
  262. package/docs/adr/0208-a2ui-checks-validacion.md +94 -0
  263. package/docs/adr/0209-loaddata-nativo-default.md +56 -0
  264. package/docs/adr/0210-primitivas-navegacion-fase3.md +69 -0
  265. package/docs/adr/0211-a2ui-formato-localizado.md +113 -0
  266. package/docs/adr/0212-red-fuera-del-core.md +67 -0
  267. package/docs/adr/0213-dev-fast-y-rutas-automaticas.md +68 -0
  268. package/docs/adr/0214-dev-web-server-reload.md +55 -0
  269. package/docs/adr/0215-ui-host-noderef-back-http-linux.md +77 -0
  270. package/docs/adr/0216-paridad-nativa-switch-scroll-lista.md +53 -0
  271. package/docs/adr/0217-overlays-drag-y-popover-anclado.md +64 -0
  272. package/docs/adr/0218-sdui-gateway-live-mcp-y-scaffold.md +31 -0
  273. package/docs/adr/README.md +228 -0
  274. package/docs/deuda/i18n-libreria-separada.md +50 -0
  275. package/docs/doc-data.json +2784 -0
  276. package/docs/propuestas/demo-google-devfest-a2ui-sdui.md +374 -0
  277. package/docs/propuestas/dx-y-paridad.md +684 -0
  278. package/docs/propuestas/investigacion-apps-completas/PENDIENTES-CORE-APPS-COMPLETAS.md +226 -0
  279. package/docs/propuestas/investigacion-apps-completas/arquitectura-motor-videojuegos-elur.md +254 -0
  280. package/docs/propuestas/investigacion-apps-completas/auditoria-paridad-frameworks-y-sdui.md +295 -0
  281. package/docs/propuestas/investigacion-apps-completas/ciclo-de-vida-dx-y-apps-completas.md +394 -0
  282. package/docs/propuestas/investigacion-apps-completas/crear-proyecto-desde-npm-y-agentes.md +477 -0
  283. package/docs/propuestas/investigacion-apps-completas/especificacion-arquitectura-capacidades-faltantes.md +407 -0
  284. package/docs/propuestas/investigacion-apps-completas/identidad-y-nombre-elur-universal.md +133 -0
  285. package/docs/propuestas/investigacion-apps-completas/migracion-elur-core-4.md +266 -0
  286. package/docs/propuestas/investigacion-apps-completas/sdui-a2ui-aplicaciones-completas.md +255 -0
  287. package/docs/propuestas/investigacion-apps-completas/verificacion-mejoras-y-brechas-nuevas.md +228 -0
  288. package/docs/propuestas/modelo-de-consumo.md +287 -0
  289. package/docs/propuestas/modulos-nativos.md +1062 -0
  290. package/docs/propuestas/palabras-clave-normativas.md +69 -0
  291. package/docs/propuestas/sdui-seguridad-hardening.md +322 -0
  292. package/docs/propuestas/skia-graphite.md +167 -0
  293. package/docs/propuestas/skia-renderer-arbol.md +603 -0
  294. package/docs/propuestas/targets-nativos-nuevos.md +359 -0
  295. package/docs/propuestas/toolchain-y-distribucion.md +311 -0
  296. package/docs/propuestas/ui-worklet-capacidades-exclusivas.md +114 -0
  297. package/examples/a11ylive/elur.app.json +8 -0
  298. package/examples/a11ylive/entry.ts +22 -0
  299. package/examples/a11ysem/elur.app.json +8 -0
  300. package/examples/a11ysem/entry.ts +24 -0
  301. package/examples/anim/elur.app.json +8 -0
  302. package/examples/anim/entry.ts +50 -0
  303. package/examples/app.ts +10 -0
  304. package/examples/cliprad/elur.app.json +8 -0
  305. package/examples/cliprad/entry.ts +16 -0
  306. package/examples/controls/app.ts +32 -0
  307. package/examples/controls/elur.app.json +8 -0
  308. package/examples/counter/app.ts +21 -0
  309. package/examples/counter/elur.app.json +8 -0
  310. package/examples/counter/entry.ts +7 -0
  311. package/examples/entry.ts +11 -0
  312. package/examples/feedstress/app.ts +334 -0
  313. package/examples/feedstress/elur.app.json +8 -0
  314. package/examples/feedstress/entry.ts +7 -0
  315. package/examples/i18n/app.ts +86 -0
  316. package/examples/i18n/elur.app.json +8 -0
  317. package/examples/i18n/entry.ts +22 -0
  318. package/examples/imecomp/elur.app.json +8 -0
  319. package/examples/imecomp/entry.ts +41 -0
  320. package/examples/imgtest/elur.app.json +8 -0
  321. package/examples/imgtest/entry.ts +18 -0
  322. package/examples/mareas/app/ajustes/page.ts +54 -0
  323. package/examples/mareas/app/page.ts +91 -0
  324. package/examples/mareas/app/puerto/[id]/page.ts +106 -0
  325. package/examples/mareas/app.ts +12 -0
  326. package/examples/mareas/elur.app.json +35 -0
  327. package/examples/mareas/entry.ts +11 -0
  328. package/examples/mareas/fonts/DejaVuSansMono-Bold.ttf +0 -0
  329. package/examples/mareas/fonts/DejaVuSansMono.ttf +0 -0
  330. package/examples/mareas/fonts/DejaVuSerif-Bold.ttf +0 -0
  331. package/examples/mareas/fonts/DejaVuSerif-Italic.ttf +0 -0
  332. package/examples/mareas/fonts/DejaVuSerif.ttf +0 -0
  333. package/examples/mareas/fonts/LICENSE-DejaVu.txt +187 -0
  334. package/examples/mareas/fonts.ts +6 -0
  335. package/examples/mareas/head.ts +12 -0
  336. package/examples/mareas/i18n.ts +163 -0
  337. package/examples/mareas/ports.ts +131 -0
  338. package/examples/mareas/routes.gen.ts +44 -0
  339. package/examples/mareas/serve.ts +70 -0
  340. package/examples/mareas/services.ts +5 -0
  341. package/examples/mareas/services.web.ts +6 -0
  342. package/examples/mareas/state.ts +64 -0
  343. package/examples/mareas/theme.ts +56 -0
  344. package/examples/mareas/ui/controls.ts +42 -0
  345. package/examples/mareas/ui/frame.ts +63 -0
  346. package/examples/mareas/ui/marigram.ts +52 -0
  347. package/examples/masonry/app.ts +32 -0
  348. package/examples/masonry/elur.app.json +8 -0
  349. package/examples/masonry/entry.ts +4 -0
  350. package/examples/natprobe/elur.app.json +8 -0
  351. package/examples/natprobe/entry.ts +196 -0
  352. package/examples/navdemo/app.ts +109 -0
  353. package/examples/navdemo/elur.app.json +8 -0
  354. package/examples/navdemo/entry.ts +7 -0
  355. package/examples/navtrans/elur.app.json +8 -0
  356. package/examples/navtrans/entry.ts +53 -0
  357. package/examples/platformview/app.ts +26 -0
  358. package/examples/platformview/elur.app.json +8 -0
  359. package/examples/sdui-demo/docs/home.envelope.json +588 -0
  360. package/examples/sdui-demo/docs/home.iife.json +582 -0
  361. package/examples/sdui-demo/elur.app.json +8 -0
  362. package/examples/sdui-demo/entry.ts +346 -0
  363. package/examples/select/elur.app.json +8 -0
  364. package/examples/select/entry.ts +20 -0
  365. package/examples/skiacanvas/app.ts +34 -0
  366. package/examples/skiacanvas/elur.app.json +8 -0
  367. package/examples/skiacanvas/entry.ts +4 -0
  368. package/examples/spans/elur.app.json +8 -0
  369. package/examples/spans/entry.ts +28 -0
  370. package/examples/ssr/app/about/page.ts +18 -0
  371. package/examples/ssr/app/items/[id]/page.ts +16 -0
  372. package/examples/ssr/app/layout.ts +21 -0
  373. package/examples/ssr/app/page.action.ts +10 -0
  374. package/examples/ssr/app/page.data.ts +5 -0
  375. package/examples/ssr/app/page.ts +95 -0
  376. package/examples/ssr/app/slow/loading.ts +10 -0
  377. package/examples/ssr/app/slow/page.data.ts +4 -0
  378. package/examples/ssr/app/slow/page.ts +16 -0
  379. package/examples/ssr/app/store.ts +3 -0
  380. package/examples/ssr/serve.ts +53 -0
  381. package/examples/statestyle/elur.app.json +8 -0
  382. package/examples/statestyle/entry.ts +25 -0
  383. package/examples/swipe/elur.app.json +8 -0
  384. package/examples/swipe/entry.ts +39 -0
  385. package/examples/tasks/app.ts +145 -0
  386. package/examples/tasks/elur.app.json +8 -0
  387. package/examples/uiwk/app.ts +288 -0
  388. package/examples/uiwk/elur.app.json +8 -0
  389. package/examples/uiwk/entry.ts +7 -0
  390. package/examples/vertical/app.ts +275 -0
  391. package/examples/vertical/elur.app.json +8 -0
  392. package/examples/vertical/entry.ts +31 -0
  393. package/examples/yogafeatures/app.ts +55 -0
  394. package/examples/yogafeatures/elur.app.json +8 -0
  395. package/examples/yogafeatures/entry.ts +4 -0
  396. package/native/cesm/README.md +94 -0
  397. package/native/cesm/adapters/hermes/HermesAdapter.h +432 -0
  398. package/native/cesm/adapters/quickjs/QuickJsAdapter.h +562 -0
  399. package/native/cesm/core/Bytes.h +236 -0
  400. package/native/cesm/core/Core.h +157 -0
  401. package/native/cesm/core/EngineAdapter.h +20 -0
  402. package/native/cesm/core/Region.h +77 -0
  403. package/native/cesm/core/Ring.h +99 -0
  404. package/native/cesm/core/Slots.h +132 -0
  405. package/native/cesm/core/Types.h +67 -0
  406. package/native/cesm/tests/CMakeLists.txt +50 -0
  407. package/native/cesm/tests/README.md +89 -0
  408. package/native/cesm/tests/compile_check_hermes.cpp +23 -0
  409. package/native/cesm/tests/test_core.cpp +101 -0
  410. package/native/cesm/tests/test_main.cpp +13 -0
  411. package/native/cesm/tests/test_quickjs_adapter.cpp +252 -0
  412. package/native/cesm/tests/test_ring.cpp +131 -0
  413. package/native/cesm/tests/test_slots.cpp +81 -0
  414. package/native/cesm/tests/test_sync.cpp +157 -0
  415. package/native/cesm/tests/test_util.h +24 -0
  416. package/native/layout/elur_layout_style.cpp +297 -0
  417. package/native/layout/elur_layout_style.h +36 -0
  418. package/native/layout-oracle/CMakeLists.txt +22 -0
  419. package/native/layout-oracle/oracle.cpp +140 -0
  420. package/native/rand/elur_random.h +43 -0
  421. package/native/skia-tree/elur_skia_tree.cpp +1293 -0
  422. package/native/skia-tree/elur_skia_tree.h +231 -0
  423. package/native/yoga/LICENSE +21 -0
  424. package/native/yoga/YGConfig.cpp +92 -0
  425. package/native/yoga/YGConfig.h +158 -0
  426. package/native/yoga/YGEnums.cpp +262 -0
  427. package/native/yoga/YGEnums.h +142 -0
  428. package/native/yoga/YGMacros.h +99 -0
  429. package/native/yoga/YGNode.cpp +366 -0
  430. package/native/yoga/YGNode.h +304 -0
  431. package/native/yoga/YGNodeLayout.cpp +92 -0
  432. package/native/yoga/YGNodeLayout.h +35 -0
  433. package/native/yoga/YGNodeStyle.cpp +405 -0
  434. package/native/yoga/YGNodeStyle.h +130 -0
  435. package/native/yoga/YGPixelGrid.cpp +22 -0
  436. package/native/yoga/YGPixelGrid.h +29 -0
  437. package/native/yoga/YGValue.cpp +20 -0
  438. package/native/yoga/YGValue.h +84 -0
  439. package/native/yoga/Yoga.h +21 -0
  440. package/native/yoga/algorithm/AbsoluteLayout.cpp +563 -0
  441. package/native/yoga/algorithm/AbsoluteLayout.h +41 -0
  442. package/native/yoga/algorithm/Align.h +72 -0
  443. package/native/yoga/algorithm/Baseline.cpp +78 -0
  444. package/native/yoga/algorithm/Baseline.h +21 -0
  445. package/native/yoga/algorithm/BoundAxis.h +79 -0
  446. package/native/yoga/algorithm/Cache.cpp +121 -0
  447. package/native/yoga/algorithm/Cache.h +30 -0
  448. package/native/yoga/algorithm/CalculateLayout.cpp +2428 -0
  449. package/native/yoga/algorithm/CalculateLayout.h +38 -0
  450. package/native/yoga/algorithm/FlexDirection.h +120 -0
  451. package/native/yoga/algorithm/FlexLine.cpp +124 -0
  452. package/native/yoga/algorithm/FlexLine.h +75 -0
  453. package/native/yoga/algorithm/PixelGrid.cpp +132 -0
  454. package/native/yoga/algorithm/PixelGrid.h +29 -0
  455. package/native/yoga/algorithm/SizingMode.h +73 -0
  456. package/native/yoga/algorithm/TrailingPosition.h +44 -0
  457. package/native/yoga/config/Config.cpp +135 -0
  458. package/native/yoga/config/Config.h +92 -0
  459. package/native/yoga/debug/AssertFatal.cpp +53 -0
  460. package/native/yoga/debug/AssertFatal.h +29 -0
  461. package/native/yoga/debug/Log.cpp +107 -0
  462. package/native/yoga/debug/Log.h +34 -0
  463. package/native/yoga/enums/Align.h +47 -0
  464. package/native/yoga/enums/BoxSizing.h +40 -0
  465. package/native/yoga/enums/Dimension.h +40 -0
  466. package/native/yoga/enums/Direction.h +41 -0
  467. package/native/yoga/enums/Display.h +41 -0
  468. package/native/yoga/enums/Edge.h +47 -0
  469. package/native/yoga/enums/Errata.h +41 -0
  470. package/native/yoga/enums/ExperimentalFeature.h +39 -0
  471. package/native/yoga/enums/FlexDirection.h +42 -0
  472. package/native/yoga/enums/Gutter.h +41 -0
  473. package/native/yoga/enums/Justify.h +44 -0
  474. package/native/yoga/enums/LogLevel.h +44 -0
  475. package/native/yoga/enums/MeasureMode.h +41 -0
  476. package/native/yoga/enums/NodeType.h +40 -0
  477. package/native/yoga/enums/Overflow.h +41 -0
  478. package/native/yoga/enums/PhysicalEdge.h +21 -0
  479. package/native/yoga/enums/PositionType.h +41 -0
  480. package/native/yoga/enums/Unit.h +42 -0
  481. package/native/yoga/enums/Wrap.h +41 -0
  482. package/native/yoga/enums/YogaEnums.h +85 -0
  483. package/native/yoga/event/event.cpp +87 -0
  484. package/native/yoga/event/event.h +130 -0
  485. package/native/yoga/node/CachedMeasurement.h +53 -0
  486. package/native/yoga/node/LayoutResults.cpp +48 -0
  487. package/native/yoga/node/LayoutResults.h +122 -0
  488. package/native/yoga/node/LayoutableChildren.h +148 -0
  489. package/native/yoga/node/Node.cpp +443 -0
  490. package/native/yoga/node/Node.h +337 -0
  491. package/native/yoga/numeric/Comparison.h +81 -0
  492. package/native/yoga/numeric/FloatOptional.h +93 -0
  493. package/native/yoga/style/SmallValueBuffer.h +133 -0
  494. package/native/yoga/style/Style.h +757 -0
  495. package/native/yoga/style/StyleLength.h +107 -0
  496. package/native/yoga/style/StyleValueHandle.h +98 -0
  497. package/native/yoga/style/StyleValuePool.h +127 -0
  498. package/package.json +111 -3
  499. package/src/adapters/kit-bridge.ts +72 -0
  500. package/src/adapters/kit-ssg.ts +219 -0
  501. package/src/adapters/kit-ssr.ts +577 -0
  502. package/src/adapters/kit-types.ts +28 -0
  503. package/src/adapters/request-adapter.ts +41 -0
  504. package/src/adapters/ssr-resolver.ts +177 -0
  505. package/src/adapters/web-history.ts +218 -0
  506. package/src/adapters/web-nav-executor.ts +72 -0
  507. package/src/animations/.gitkeep +0 -0
  508. package/src/animations/bindWorklets.ts +49 -0
  509. package/src/animations/captureCheck.ts +75 -0
  510. package/src/animations/compose.ts +127 -0
  511. package/src/animations/easing.ts +75 -0
  512. package/src/animations/gestureWorklets.ts +129 -0
  513. package/src/animations/index.ts +23 -0
  514. package/src/animations/runner.ts +404 -0
  515. package/src/animations/scrollWorklets.ts +48 -0
  516. package/src/animations/uiBindings.ts +83 -0
  517. package/src/animations/uiRunner.ts +449 -0
  518. package/src/animations/worklet.ts +157 -0
  519. package/src/animations/workletForm.ts +197 -0
  520. package/src/app/clock.ts +69 -0
  521. package/src/app/embedded.ts +232 -0
  522. package/src/app/index.ts +24 -0
  523. package/src/app/load-data.ts +36 -0
  524. package/src/app/mount.native.ts +18 -0
  525. package/src/app/mount.ts +26 -0
  526. package/src/app/mount.web.ts +21 -0
  527. package/src/app/state.ts +256 -0
  528. package/src/app/types.ts +146 -0
  529. package/src/app/web.ts +291 -0
  530. package/src/backends/native/hostAbi.ts +304 -0
  531. package/src/backends/native/index.ts +1132 -0
  532. package/src/backends/textInputProtocol.ts +111 -0
  533. package/src/backends/web/.gitkeep +0 -0
  534. package/src/backends/web/base-css.ts +148 -0
  535. package/src/backends/web/batcher.ts +162 -0
  536. package/src/backends/web/hydrate.ts +227 -0
  537. package/src/backends/web/index.ts +2231 -0
  538. package/src/backends/web/inspect.ts +80 -0
  539. package/src/backends/web/workerRunner.ts +513 -0
  540. package/src/context/index.ts +19 -0
  541. package/src/events.ts +139 -0
  542. package/src/forms/index.ts +264 -0
  543. package/src/hydration/.gitkeep +0 -0
  544. package/src/index.ts +169 -0
  545. package/src/ir/.gitkeep +0 -0
  546. package/src/ir/catalog.ts +166 -0
  547. package/src/ir/events.ts +54 -0
  548. package/src/ir/schema.ts +1103 -0
  549. package/src/ir/semantics.ts +189 -0
  550. package/src/ir/shortcut.ts +104 -0
  551. package/src/ir/signal-names.ts +27 -0
  552. package/src/ir/ui.ts +709 -0
  553. package/src/layout/.gitkeep +0 -0
  554. package/src/native/.gitkeep +0 -0
  555. package/src/native/binaryCodec.ts +230 -0
  556. package/src/native/codegen.ts +635 -0
  557. package/src/native/hostArtifacts.ts +386 -0
  558. package/src/native/http.ts +558 -0
  559. package/src/native/index.ts +54 -0
  560. package/src/native/manifest.ts +227 -0
  561. package/src/native/module.ts +1108 -0
  562. package/src/native/platformView.ts +107 -0
  563. package/src/native/pluginManifest.ts +269 -0
  564. package/src/native/sharedMemory.ts +168 -0
  565. package/src/native/specType.ts +164 -0
  566. package/src/native/tck.ts +436 -0
  567. package/src/native/trace.ts +97 -0
  568. package/src/native/webModule.ts +281 -0
  569. package/src/overlays/index.ts +579 -0
  570. package/src/platform.ts +89 -0
  571. package/src/primitives/controls.ts +725 -0
  572. package/src/primitives/index.ts +400 -0
  573. package/src/primitives/navigation.ts +407 -0
  574. package/src/reconciler/reconciler.ts +2857 -0
  575. package/src/router/guards.ts +129 -0
  576. package/src/router/index.ts +41 -0
  577. package/src/router/lifecycle.ts +133 -0
  578. package/src/router/match.ts +184 -0
  579. package/src/router/router.ts +508 -0
  580. package/src/router/screen-host.ts +918 -0
  581. package/src/router/state.ts +76 -0
  582. package/src/router/table.ts +55 -0
  583. package/src/router/transitions.ts +87 -0
  584. package/src/router/types.ts +161 -0
  585. package/src/runtime/environment.ts +332 -0
  586. package/src/runtime/wintertc-globals.ts +1067 -0
  587. package/src/sdui/a2ui.ts +1470 -0
  588. package/src/sdui/a2uiSurface.ts +214 -0
  589. package/src/sdui/client.ts +370 -0
  590. package/src/sdui/cryptoModule.ts +107 -0
  591. package/src/sdui/diagnostics.ts +39 -0
  592. package/src/sdui/downlevel.ts +375 -0
  593. package/src/sdui/envelope.ts +729 -0
  594. package/src/sdui/expr.ts +658 -0
  595. package/src/sdui/gateway.ts +223 -0
  596. package/src/sdui/httpModule.ts +29 -0
  597. package/src/sdui/index.ts +74 -0
  598. package/src/sdui/intents.ts +216 -0
  599. package/src/sdui/lower.ts +576 -0
  600. package/src/sdui/machines.ts +141 -0
  601. package/src/sdui/manifest.ts +167 -0
  602. package/src/sdui/oracle.ts +373 -0
  603. package/src/sdui/profile.ts +72 -0
  604. package/src/sdui/seqStore.ts +89 -0
  605. package/src/sdui/sign.ts +155 -0
  606. package/src/sdui/worklets.ts +164 -0
  607. package/src/ssr/html-applicator.ts +515 -0
  608. package/src/ssr/render-page.ts +264 -0
  609. package/src/store/index.ts +28 -0
  610. package/src/style/textInherit.ts +29 -0
  611. package/src/style/theme.ts +178 -0
  612. package/src/testing/index.ts +276 -0
  613. package/src/transport/.gitkeep +0 -0
  614. package/src/transport/format.ts +477 -0
  615. package/src/transport/wireSchema.ts +189 -0
  616. package/src/web.ts +31 -0
  617. package/targets/android/app/build.gradle.kts +192 -0
  618. package/targets/android/app/proguard-rules-elur.pro +12 -0
  619. package/targets/android/app/proguard-rules.pro +3 -0
  620. package/targets/android/app/src/main/AndroidManifest.xml +81 -0
  621. package/targets/android/app/src/main/cpp/CMakeLists.txt +117 -0
  622. package/targets/android/app/src/main/cpp/dlEncoder.h +117 -0
  623. package/targets/android/app/src/main/cpp/dlEncoderJsi.cpp +315 -0
  624. package/targets/android/app/src/main/cpp/dlEncoderQjs.cpp +394 -0
  625. package/targets/android/app/src/main/cpp/dlOps.inc +145 -0
  626. package/targets/android/app/src/main/cpp/elurBridge.cpp +1350 -0
  627. package/targets/android/app/src/main/cpp/elurBridgeHermes.cpp +1294 -0
  628. package/targets/android/app/src/main/cpp/elurSkia.cpp +287 -0
  629. package/targets/android/app/src/main/cpp/elurSkiaTree.cpp +448 -0
  630. package/targets/android/app/src/main/cpp/elurUiWorklet.cpp +1233 -0
  631. package/targets/android/app/src/main/cpp/elurYoga.cpp +1060 -0
  632. package/targets/android/app/src/main/cpp/elurYoga.h +82 -0
  633. package/targets/android/app/src/main/cpp/hermes-libs/LICENSE +21 -0
  634. package/targets/android/app/src/main/cpp/hermes-libs/arm64-v8a/libhermesvm.so +0 -0
  635. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/AsyncDebuggerAPI.h +276 -0
  636. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/CompileJS.h +97 -0
  637. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/DebuggerAPI.h +502 -0
  638. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/Public/CrashManager.h +107 -0
  639. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/Public/CtorConfig.h +145 -0
  640. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/Public/DebuggerTypes.h +193 -0
  641. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/Public/GCConfig.h +211 -0
  642. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/Public/GCTripwireContext.h +40 -0
  643. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/Public/HermesExport.h +14 -0
  644. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/Public/JSOutOfMemoryError.h +27 -0
  645. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/Public/RuntimeConfig.h +141 -0
  646. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/Public/SamplingProfiler.h +270 -0
  647. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/RuntimeTaskRunner.h +64 -0
  648. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/SynthTrace.h +1566 -0
  649. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/SynthTraceParser.h +37 -0
  650. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/ThreadSafetyAnalysis.h +75 -0
  651. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/TimerStats.h +23 -0
  652. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/TraceInterpreter.h +334 -0
  653. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/TracingRuntime.h +328 -0
  654. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/CDPAgent.h +131 -0
  655. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/CDPDebugAPI.h +73 -0
  656. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/CallbackOStream.h +89 -0
  657. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/ConsoleMessage.h +135 -0
  658. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/DebuggerDomainAgent.h +280 -0
  659. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/DebuggerDomainCoordinator.h +137 -0
  660. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/DomainAgent.h +107 -0
  661. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/DomainState.h +140 -0
  662. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/HeapProfilerDomainAgent.h +71 -0
  663. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/JSONValueInterfaces.h +40 -0
  664. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/MessageConverters.h +82 -0
  665. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/MessageInterfaces.h +72 -0
  666. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/MessageTypes.h +1279 -0
  667. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/MessageTypesInlines.h +313 -0
  668. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/ProfilerDomainAgent.h +38 -0
  669. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/RemoteObjectConverters.h +77 -0
  670. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/RemoteObjectsTable.h +127 -0
  671. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/cdp/RuntimeDomainAgent.h +138 -0
  672. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/Dummy.h +24 -0
  673. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/Extensions.h +20 -0
  674. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/ExtensionsBytecode.h +23 -0
  675. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/Intrinsics.h +44 -0
  676. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/JSIUtils.h +123 -0
  677. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/TextEncoder.h +29 -0
  678. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/contrib/ContribDummy.h +24 -0
  679. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/contrib/ContribExtensions.h +23 -0
  680. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/contrib/TextDecoder.h +30 -0
  681. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/extensions/contrib/TextDecoderUtils.h +113 -0
  682. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/hermes.h +242 -0
  683. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes/hermes_tracing.h +52 -0
  684. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_abi/HermesABIHelpers.h +295 -0
  685. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_abi/HermesABIRuntimeWrapper.h +25 -0
  686. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_abi/hermes_abi.h +642 -0
  687. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_abi/hermes_vtable.h +29 -0
  688. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_sandbox/HermesSandboxRuntime.h +41 -0
  689. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_compiled.h +12 -0
  690. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_dbg_compiled-impl.h +8516 -0
  691. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_dbg_compiled.h +137 -0
  692. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_opt_compiled-impl.h +3945 -0
  693. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_opt_compiled.h +119 -0
  694. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/wasm-rt-fb.h +124 -0
  695. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/wasm-rt-impl.h +66 -0
  696. package/targets/android/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/wasm-rt.h +456 -0
  697. package/targets/android/app/src/main/cpp/hermes-libs/include/jsi/JSIDynamic.h +26 -0
  698. package/targets/android/app/src/main/cpp/hermes-libs/include/jsi/decorator.h +1157 -0
  699. package/targets/android/app/src/main/cpp/hermes-libs/include/jsi/hermes-interfaces.h +242 -0
  700. package/targets/android/app/src/main/cpp/hermes-libs/include/jsi/instrumentation.h +132 -0
  701. package/targets/android/app/src/main/cpp/hermes-libs/include/jsi/jsi-inl.h +434 -0
  702. package/targets/android/app/src/main/cpp/hermes-libs/include/jsi/jsi.h +2266 -0
  703. package/targets/android/app/src/main/cpp/hermes-libs/include/jsi/jsilib.h +59 -0
  704. package/targets/android/app/src/main/cpp/hermes-libs/include/jsi/threadsafe.h +79 -0
  705. package/targets/android/app/src/main/cpp/hermes-libs/jsi-impl/jsi.cpp +1111 -0
  706. package/targets/android/app/src/main/cpp/hermes-libs/x86_64/libhermesvm.so +0 -0
  707. package/targets/android/app/src/main/java/com/elur/universal/BinaryCodec.kt +121 -0
  708. package/targets/android/app/src/main/java/com/elur/universal/DlDecoder.kt +260 -0
  709. package/targets/android/app/src/main/java/com/elur/universal/DlOpsDecode.kt +158 -0
  710. package/targets/android/app/src/main/java/com/elur/universal/ElurBoxDrawable.kt +161 -0
  711. package/targets/android/app/src/main/java/com/elur/universal/ElurBridge.kt +238 -0
  712. package/targets/android/app/src/main/java/com/elur/universal/ElurBridgeHermes.kt +223 -0
  713. package/targets/android/app/src/main/java/com/elur/universal/ElurCanvasView.kt +202 -0
  714. package/targets/android/app/src/main/java/com/elur/universal/ElurCryptoModule.kt +206 -0
  715. package/targets/android/app/src/main/java/com/elur/universal/ElurCustomLayout.kt +185 -0
  716. package/targets/android/app/src/main/java/com/elur/universal/ElurEditText.kt +17 -0
  717. package/targets/android/app/src/main/java/com/elur/universal/ElurFontRegistry.kt +190 -0
  718. package/targets/android/app/src/main/java/com/elur/universal/ElurHttpModule.kt +306 -0
  719. package/targets/android/app/src/main/java/com/elur/universal/ElurImageService.kt +348 -0
  720. package/targets/android/app/src/main/java/com/elur/universal/ElurLicensesActivity.kt +84 -0
  721. package/targets/android/app/src/main/java/com/elur/universal/ElurListView.kt +954 -0
  722. package/targets/android/app/src/main/java/com/elur/universal/ElurManifest.kt +117 -0
  723. package/targets/android/app/src/main/java/com/elur/universal/ElurMetrics.kt +325 -0
  724. package/targets/android/app/src/main/java/com/elur/universal/ElurModuleRegistrar.kt +14 -0
  725. package/targets/android/app/src/main/java/com/elur/universal/ElurPermissionGate.kt +36 -0
  726. package/targets/android/app/src/main/java/com/elur/universal/ElurRenderer.kt +6112 -0
  727. package/targets/android/app/src/main/java/com/elur/universal/ElurRowYoga.kt +130 -0
  728. package/targets/android/app/src/main/java/com/elur/universal/ElurScrollView.kt +240 -0
  729. package/targets/android/app/src/main/java/com/elur/universal/ElurShellView.kt +117 -0
  730. package/targets/android/app/src/main/java/com/elur/universal/ElurSkiaCanvasView.kt +162 -0
  731. package/targets/android/app/src/main/java/com/elur/universal/ElurSkiaTreeRenderer.kt +968 -0
  732. package/targets/android/app/src/main/java/com/elur/universal/ElurStateModule.kt +69 -0
  733. package/targets/android/app/src/main/java/com/elur/universal/ElurSwipeDriver.kt +34 -0
  734. package/targets/android/app/src/main/java/com/elur/universal/ElurTckModule.kt +99 -0
  735. package/targets/android/app/src/main/java/com/elur/universal/ElurTextMeasure.kt +16 -0
  736. package/targets/android/app/src/main/java/com/elur/universal/ElurTrace.kt +24 -0
  737. package/targets/android/app/src/main/java/com/elur/universal/ElurUiModule.kt +48 -0
  738. package/targets/android/app/src/main/java/com/elur/universal/ElurUiWorklet.kt +305 -0
  739. package/targets/android/app/src/main/java/com/elur/universal/JsBridge.kt +67 -0
  740. package/targets/android/app/src/main/java/com/elur/universal/JsThread.kt +189 -0
  741. package/targets/android/app/src/main/java/com/elur/universal/MainActivity.kt +844 -0
  742. package/targets/android/app/src/main/java/com/elur/universal/ModuleRegistry.kt +701 -0
  743. package/targets/android/app/src/main/java/com/elur/universal/YogaRowScope.kt +97 -0
  744. package/targets/android/app/src/main/res/values/ids.xml +10 -0
  745. package/targets/android/app/src/main/res/values/strings.xml +8 -0
  746. package/targets/android/app/src/main/res/values-es/strings.xml +5 -0
  747. package/targets/android/app/src/main/res/xml/network_security_config.xml +10 -0
  748. package/targets/android/build.gradle.kts +5 -0
  749. package/targets/android/gradle/libs.versions.toml +12 -0
  750. package/targets/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  751. package/targets/android/gradle/wrapper/gradle-wrapper.properties +8 -0
  752. package/targets/android/gradle.properties +23 -0
  753. package/targets/android/gradlew +251 -0
  754. package/targets/android/gradlew.bat +94 -0
  755. package/targets/android/settings.gradle.kts +32 -0
  756. package/targets/web/.gitkeep +0 -0
  757. package/targets/web/index.html +13 -0
@@ -0,0 +1,1103 @@
1
+ // IR — Capa 0 · CONTRATO CONGELADO v1
2
+ // Spec: documento maestro A.4. Cambios requieren ADR + bump IR_VERSION.
3
+
4
+ import type { Signal } from "@elurjs/core/signals";
5
+
6
+ /** Versión del contrato IR. Bumpear con cada cambio de schema (ADR).
7
+ * 10 (ADR-0127/0129/0131/0133): herencia de estilos de texto, `flex`
8
+ * shorthand, `stateStyle`, `EventBinding.payload`, `ShellDef.chrome`.
9
+ * ADR-0147 (`spans`), ADR-0148 (`scrollTop`) y ADR-0150 (`sticky`) son
10
+ * props aditivas que viajan por update-props — sin cambio estructural
11
+ * del wire (precedente stateStyle/href): no bumpan la versión. */
12
+ export const IR_VERSION = 10;
13
+
14
+ export type IRDocument = {
15
+ irVersion: number; // siempre presente; == IR_VERSION
16
+ root: IRNode; // nodo raíz del árbol
17
+ handlers?: Record<string, HandlerDescriptor>; // funciones/commands NO serializables
18
+ // bindings eliminado: viven inline en los nodos (A.6.1)
19
+ // capabilities eliminado: vive en el envelope SDUI/transporte (A.6.5)
20
+ };
21
+
22
+ export type IRNode = {
23
+ id?: string; // identificador legible (dev, debugging, SDUI)
24
+ type: IRNodeType;
25
+
26
+ // Props universales (as, accessible, label, dir…). Pueden contener bindings inline.
27
+ // dir = "ltr"|"rtl" — dirección de layout/texto (web: atributo dir; Android:
28
+ // layoutDirection + textDirection). §1.4 / ADR-0071.
29
+ props?: Record<string, unknown | Binding>;
30
+
31
+ // Estilo portable strict-flexbox. Solo props escritas; el backend resuelve shorthands (A.6.2).
32
+ style?: StyleInput;
33
+
34
+ children?: IRNode[];
35
+
36
+ // Contenido textual. Si es reactivo, TextBinding con el binding inline.
37
+ text?: string | TextBinding;
38
+
39
+ // Eventos como intención universal. Valor = ref a IRDocument.handlers (§3.3).
40
+ events?: Record<string, EventBinding>;
41
+
42
+ // Solo platform-view (ecosistema de plugins, §6.2)
43
+ module?: string; // ej. "elur.camera"
44
+ view?: string; // ej. "preview"
45
+
46
+ // Solo shell (nodo estructural de navegación, ADR-0011)
47
+ shellKind?: ShellKind;
48
+ shellId?: string;
49
+ activeTab?: string; // para shellKind: "tabs"
50
+
51
+ // Política de render (A.6.4)
52
+ renderPolicy?: RenderPolicy;
53
+
54
+ // Listas keyed — repeat() del core (A.6.4)
55
+ list?: {
56
+ items: Binding; // signal/computed que retorna el array
57
+ keyFn: string; // ref a handler (key extractor)
58
+ /** Template estático (itemSignals merge) o id de factory
59
+ * (ADR-0014 + ADR-0037/F12: la función NO vive en el IR —
60
+ * `repeat()` emite un id `"f<N>"` y registra la closure en
61
+ * `UIResult.factories`; el reconciler la resuelve por
62
+ * `options.factories[id]`. Así `IRDocument` es serializable:
63
+ * JSON round-trip conserva la referencia; los closures son
64
+ * runtime, nunca wire). */
65
+ renderItem: IRNode | string;
66
+ /** ADR-0031 — pool LRU acotado de filas removidas. 0/ausente =
67
+ * destroy directo (contrato F01). N>0: al salir del modelo la
68
+ * fila se detiene (remove-child ya emitido) y se aparca; si la
69
+ * key reaparece se re-adjunta la instancia (conserva estado y
70
+ * handlers); al desbordar, la menos reciente se destruye. */
71
+ poolSize?: number;
72
+ /** ADR-0033 — ventana virtualizada (R5.4). Solo se materializan
73
+ * las filas del rango visible + overscan; el resto nunca existe
74
+ * como nodos. CONTRATO:
75
+ * - `rowHeight` es FIJO en unidades lógicas (filas de altura
76
+ * variable quedan fuera de esta fase del contrato).
77
+ * - El reconciler posee la geometría de fila: emite
78
+ * position:absolute + top=(index*rowHeight) + height=rowHeight
79
+ * por update-style sobre cada raíz de fila, y height=
80
+ * items*rowHeight sobre el nodo lista (rango de scroll real).
81
+ * - `scroll` (opcional) = binding a un signal {y, vh} en
82
+ * unidades lógicas — y=scrollTop, vh=alto del viewport. Si
83
+ * falta, el reconciler auto-cablea el evento "scroll" del
84
+ * scroll-view ancestro (attach-event con handler interno
85
+ * `__elur_vscroll:<listId>`); el payload del evento scroll es
86
+ * {y, vh} normalizado por el backend (web: scrollTop/
87
+ * clientHeight CSS px; android: px físicos / density).
88
+ * - Interacciona con poolSize: filas que salen de ventana se
89
+ * aparcan (recomendado poolSize >= 2*overscan). */
90
+ virtual?: {
91
+ rowHeight: number;
92
+ overscan?: number; // default 4
93
+ scroll?: Binding; // signal {y, vh}
94
+ };
95
+ /** ADR-0056 — propietario de la ventana (eje ORTOGONAL a
96
+ * `renderPolicy`, que solo elige superficie views/Skia).
97
+ * - `host`: widget de colección del host (RecyclerView,
98
+ * UICollectionView…) — el reconciler emite ops a nivel item
99
+ * (`set-list-template`, `set-list-items`, `list-splice`,
100
+ * `list-move`, `list-update`) y el host posee ventana,
101
+ * reciclaje y bind por campo. Exige cap `native-list` +
102
+ * filas template elegibles + superficie de views. Sobre
103
+ * `renderPolicy:"custom"` el equivalente es la lista pintada
104
+ * por la superficie Skia (cap `canvas-list`, aún inexistente)
105
+ * — nunca un widget nativo: bajo `custom` no hay nada nativo.
106
+ * - `js`: ventana virtual + pool estructural en el reconciler —
107
+ * las filas son ops de vista normales sobre cualquier
108
+ * superficie. Es el único camino en hosts sin cap (web).
109
+ * - `auto` (default): `host` si cap + template + views; si
110
+ * no, `js` silencioso.
111
+ * Pedir `host` sin reunir las condiciones degrada a `js` con
112
+ * warning + motivo — la portabilidad manda sobre la preferencia.
113
+ * El estilizado no cambia con el propietario: estáticos al
114
+ * inflar, `{kind:"signal",signal:"<campo>"}` con rebind por
115
+ * campo; bindings a signals ajenos al item hacen la fila
116
+ * inelegible para `host` (U06). */
117
+ materialization?: ListMaterialization;
118
+ /** ADR-0087 §scroll — scroll-worklet conducido por el offset del
119
+ * RecyclerView: el host alimenta la signal `__scroll_<id>` del
120
+ * contexto UI directo desde onScrolled — el worklet se re-evalúa
121
+ * en el tick del cambio SIN despertar el JsThread (parallax,
122
+ * fade-on-scroll, sticky headers). Solo aplica sobre
123
+ * `materialization:"host"`: el path js reporta scroll por el
124
+ * evento normal. Marcador estructural (evita el ciclo con
125
+ * animations/worklet). */
126
+ scrollFx?: { readonly __isWorklet: true };
127
+ /** ADR-0087 §bind — worklet evaluado dentro del onBindViewHolder
128
+ * nativo: la fn recibe (position, row) — `row` es un proxy que
129
+ * escribe props compositor sobre el itemView siendo bindeado
130
+ * (transform por posición, stagger, reveal). Solo aplica sobre
131
+ * `materialization:"host"`; nunca cruza el wire. Marcador
132
+ * estructural (evita el ciclo con animations/worklet). */
133
+ rowFx?: { readonly __isWorklet: true };
134
+ };
135
+
136
+ /** ADR-0087 §gestures — worklet conducido por el canal táctil del
137
+ * host sobre ESTE nodo (drag): el OnTouchListener nativo alimenta
138
+ * las signals externas `__drag_<id>_dx|_dy|_p` al contexto UI —
139
+ * la fn se re-evalúa por gesto sin despertar el JsThread.
140
+ * Marcador estructural (evita el ciclo con animations/worklet);
141
+ * nunca cruza el wire — el runtime lo consume al montar el nodo. */
142
+ dragFx?: { readonly __isWorklet: true };
143
+ /** ADR-0128 — raíz sintética de un `ui``` con varias raíces. Al
144
+ * interpolarse en otro `ui``` se disuelve (sus hijos pasan al padre:
145
+ * `gap`/`flexWrap` siguen aplicando); como raíz de documento actúa
146
+ * de columna. No cruza el wire. */
147
+ fragment?: true;
148
+ };
149
+
150
+ /** Factory por item de lista (ADR-0014). Estructuralmente idéntica al
151
+ * resultado de ui`` — no importamos UIResult para evitar ciclo con ui.ts.
152
+ * `keyFns`/`factories` opcionales: un ui`` anidado con repeat() dentro de
153
+ * la fila los aporta — el reconciler los mergea al scope de la fila. */
154
+ export type ListItemFactory = (item: unknown) => {
155
+ document: IRDocument;
156
+ signals: Record<string, Signal<unknown>>;
157
+ handlers: Record<string, (e?: unknown) => void>;
158
+ keyFns?: Record<string, (item: any) => string>;
159
+ factories?: Record<string, ListItemFactory>;
160
+ };
161
+
162
+ // Vocabulario de nodos — las ~12 primitivas del MVP (§17 Fase 1).
163
+ // Añadir un tipo nuevo requiere ADR + bump IR_VERSION.
164
+ export type IRNodeType =
165
+ | "column" | "row" | "text" | "button" | "image"
166
+ | "text-input" | "switch" | "slider"
167
+ | "scroll-view" | "list"
168
+ | "platform-view" | "canvas" // canvas = Skia opt-in (ADR-0009)
169
+ | "shell"; // nodo estructural (ADR-0011)
170
+
171
+ export type ShellKind = "stack" | "tabs" | "drawer" | "split";
172
+ /** ADR-0009, doc maestro §7.2 — tecnología de render para un nodo/subárbol.
173
+ * `native` = vistas del SO; `custom` = renderer propio Skia (100 %);
174
+ * `auto` = lo decide el host según capacidades. El camino JS (ventana
175
+ * virtualizada en JS) NO es un valor de este dial: es la implementación
176
+ * de respaldo de `native`/`auto` cuando el host no declara la capacidad.
177
+ * `custom` sin renderer Skia disponible debe fallar con diagnóstico,
178
+ * nunca caer en silencio al path JS.
179
+ * ADR-0056: este dial es SOLO la superficie (quién pinta). El propietario
180
+ * de la ventana de una lista es `list.materialization`, eje separado —
181
+ * `native` aquí no implica RecyclerView ni `custom` la lista Skia. */
182
+ export type RenderPolicy = "auto" | "custom" | "native";
183
+
184
+ /** ADR-0056 — propietario de la ventana/reciclaje/bind de una `list`.
185
+ * Independiente de `RenderPolicy`: `native`+`js` es válido (vistas
186
+ * nativas materializadas por la ventana JS). Ver `list.materialization`. */
187
+ export type ListMaterialization = "auto" | "host" | "js";
188
+
189
+ // Binding reactivo (inline en el nodo que lo consume)
190
+ export type TextBinding = {
191
+ binding: Binding; // binding completo, inline (v3.5)
192
+ initial: string; // valor inicial calculado (SSR/hidratación)
193
+ };
194
+
195
+ export type Binding =
196
+ | { kind: "signal"; signal: string }
197
+ | { kind: "computed"; signal: string } // computed expuesto como signal por nombre
198
+ | {
199
+ kind: "template";
200
+ parts: string[]; // partes estáticas del template
201
+ expressions: Array<{ signal: string }>; // partes dinámicas intercaladas
202
+ };
203
+
204
+ // Eventos y handlers
205
+ export type EventBinding = {
206
+ handler: string; // ref a IRDocument.handlers[id]
207
+ class?: "discrete" | "continuous"; // discrete = entrega garantizada
208
+ // continuous = coalescido por frame (§6)
209
+ };
210
+
211
+ export type HandlerDescriptor = {
212
+ name?: string;
213
+ kind: "js" | "command" | "worklet"; // js: hilo principal
214
+ // command: llamada async a módulo nativo (§6.2)
215
+ // worklet: corre en UI thread (Capa 6, Phase 1.5)
216
+ };
217
+
218
+ // Style — keys tipadas (decisión M0.2: autocompletado + compile-time),
219
+ // serialización = solo props escritas (A.6.2). El set runtime valida
220
+ // en el lado embebido mientras no exista el linter (Capa 7).
221
+ // ADR-0024: el vocabulario crece con las claves ya implementadas en los
222
+ // backends (opacity, position+edges, display, overflow, fontFamily,
223
+ // fontStyle, textTransform, boxShadow, objectFit). Unidades: number =
224
+ // unidad lógica (px web / dp Android, density-aware en Yoga); string =
225
+ // valor CSS en web y, para claves de color, Color.parseColor en Android
226
+ // ("#rgb"/"#rrggbb"/"#aarrggbb"/nombres). boxShadow: web pasa el string
227
+ // tal cual; Android aproxima elevation con blur/max-offset del string.
228
+ // Keys no implementadas por un backend se ignoran (contrato best-effort
229
+ // visual — el layout nunca depende de una clave visual).
230
+ export type StyleKey =
231
+ // Dimensiones
232
+ | "width" | "height" | "minWidth" | "maxWidth" | "minHeight" | "maxHeight"
233
+ // ADR-0118: boxSizing — width/height border-box (default Yoga/W3C)
234
+ // o content-box (excluye padding+border). direction — dirección de
235
+ // escritura del nodo y descendientes: resuelve los bordes lógicos
236
+ // Start/End e invierte el orden del flex (CSS direction en web,
237
+ // YGNodeStyleSetDirection en Android).
238
+ | "boxSizing" | "direction"
239
+ // Flexbox
240
+ | "flexDirection" | "flexWrap" | "alignItems" | "alignSelf" | "justifyContent"
241
+ | "alignContent"
242
+ | "flexGrow" | "flexShrink" | "flexBasis" | "gap" | "rowGap" | "columnGap"
243
+ // ADR-0127: `flex` lo expande el reconciler a longhands antes del
244
+ // wire (ningún backend lo interpreta): n > 0 → grow n, shrink 1,
245
+ // basis 0; 0 → inflexible; n < 0 → shrink -n.
246
+ | "flex"
247
+ // ADR-0118: aspectRatio — ratio w/h (número) aplicado por Yoga/CSS
248
+ // cuando una dimensión queda indefinida; igualdad de comportamiento
249
+ // con `aspect-ratio` CSS requiere min/max respetuosos.
250
+ | "aspectRatio"
251
+ // Spacing (ADR-0118: variantes lógicas inline/block — Start/End se
252
+ // resuelven por `direction`; Block* = top/bottom en horizontal-tb)
253
+ | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft"
254
+ | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd"
255
+ | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd"
256
+ | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft"
257
+ | "marginInline" | "marginInlineStart" | "marginInlineEnd"
258
+ | "marginBlock" | "marginBlockStart" | "marginBlockEnd"
259
+ // Posición y apilado (inset*/Start/End: offsets por borde lógico;
260
+ // position:static = en flujo sin offsets — ADR-0118)
261
+ | "position" | "top" | "right" | "bottom" | "left" | "zIndex"
262
+ | "inset" | "insetInlineStart" | "insetInlineEnd"
263
+ | "insetBlockStart" | "insetBlockEnd"
264
+ | "display" | "overflow"
265
+ // ADR-0122: delegado de layout por subárbol — un delegado
266
+ // registrado (masonry built-in, módulos nativos) fija las dims auto
267
+ // del nodo y sustituye los rects flex de sus hijos directos. Sus
268
+ // parámetros viajan por la prop `layoutParams` (update-props).
269
+ | "layout"
270
+ // Texto y color
271
+ | "color" | "backgroundColor" | "fontSize" | "fontWeight" | "lineHeight"
272
+ | "fontFamily" | "fontStyle" | "textTransform" | "textAlign"
273
+ | "textDecoration" | "letterSpacing"
274
+ // Visual
275
+ | "opacity" | "boxShadow" | "objectFit" | "backgroundGradient" | "cursor"
276
+ // Bordes (widths por edge: Yoga reserva el espacio; Android dibuja
277
+ // el trazo por lado con ElurBoxDrawable — ADR-0131; web: CSS)
278
+ | "borderRadius"
279
+ | "borderTopLeftRadius" | "borderTopRightRadius"
280
+ | "borderBottomRightRadius" | "borderBottomLeftRadius"
281
+ | "borderWidth" | "borderColor" | "borderStyle"
282
+ | "borderTopWidth" | "borderRightWidth" | "borderBottomWidth" | "borderLeftWidth"
283
+ | "borderInlineStartWidth" | "borderInlineEndWidth"
284
+ | "borderBlockStartWidth" | "borderBlockEndWidth"
285
+ // Transforms (ADR-0038 — propiedades de compositor, post-layout:
286
+ // no pasan por Yoga — igual que CSS transform no afecta layout.
287
+ // translateX/Y en unidades lógicas; scaleX/Y factor; rotate grados.
288
+ // CONTRATO de propiedad única (R6.1): un valor animado por worklet
289
+ // (UI thread) NO debe escribirse también por update-style desde JS —
290
+ // último-escritor-gana y pisan la animación. El framework no lo
291
+ // detecta aún: es error de la app, como en React Native).
292
+ | "translateX" | "translateY" | "scaleX" | "scaleY" | "rotate";
293
+
294
+ export type Style = {
295
+ [K in StyleKey]?: number | string;
296
+ };
297
+
298
+ // Forma de autoría en IRNode.style: además de valores resueltos, cada
299
+ // clave admite un Binding {kind:"signal"} — el reconciler suscribe el
300
+ // signal y emite update-style parcial por clave (ADR-0024). Los ops en
301
+ // el wire siempre llevan Style resuelto (número/string), nunca bindings.
302
+ export type StyleInput = {
303
+ [K in StyleKey]?: number | string | Binding;
304
+ };
305
+
306
+ // Vocabulario de dibujo de `canvas` (ADR-0020): lista serializable
307
+ // (JSON en update-props — no requiere cambio de ABI). Replay 1:1 en
308
+ // CanvasRenderingContext2D (web), android.graphics.Canvas (Platform
309
+ // Views) y Skia (opt-in, renderer del árbol completo — gate propio).
310
+ //
311
+ // CONTRATO: cada comando lleva su pintura (fill/stroke/lineWidth) —
312
+ // sin estado ambiente entre comandos, replay determinista. save/
313
+ // restore y transforms sí mutan el estado del contexto (son la forma
314
+ // de componer transformaciones sin exponer matrices).
315
+ export type CanvasCmd =
316
+ | { op: "clear"; color?: string } // fondo entero
317
+ | { op: "rect"; x: number; y: number; w: number; h: number; radius?: number; fill?: string; stroke?: string; lineWidth?: number }
318
+ | { op: "circle"; x: number; y: number; r: number; fill?: string; stroke?: string; lineWidth?: number }
319
+ | { op: "arc"; x: number; y: number; r: number; startAngle: number; endAngle: number; counterclockwise?: boolean; fill?: string; stroke?: string; lineWidth?: number }
320
+ | { op: "line"; x1: number; y1: number; x2: number; y2: number; stroke?: string; lineWidth?: number }
321
+ | { op: "path"; d: string; fill?: string; stroke?: string; lineWidth?: number } // d = SVG path data
322
+ | { op: "svgPath"; d: string; fill?: string; stroke?: string; lineWidth?: number }
323
+ | { op: "text"; text: string; x: number; y: number; color?: string; size?: number; font?: string; align?: "left" | "center" | "right" }
324
+ | { op: "save" } | { op: "restore" }
325
+ | { op: "translate"; x: number; y: number }
326
+ | { op: "rotate"; deg: number } // grados (no rad)
327
+ | { op: "scale"; x: number; y?: number };
328
+
329
+ // Props de text-input (ADR-0021) — vocabulario neutral de intención:
330
+ // cada backend mapea al atributo/flag nativo (type+inputmode en web,
331
+ // InputType/imeOptions/autofillHints en Android).
332
+ export type KeyboardType =
333
+ | "default" | "email" | "number" | "decimal" | "phone" | "url" | "password"
334
+ | "date" | "time" | "datetime";
335
+ export type EnterKey = "done" | "go" | "next" | "search" | "send";
336
+ /** `selection` = write-only: fija caret/rango programáticamente. */
337
+ export type SelectionRange = { start: number; end: number };
338
+
339
+ /**
340
+ * ADR-0038/V09 — composición del vocabulario transform a CSS `transform`.
341
+ * Regla ÚNICA compartida por el backend web (applyTransformKey) y el
342
+ * aplicador SSR (html-applicator): ambos serializan idéntico para que la
343
+ * primera pintura hidratada coincida con la servida. Orden fijo
344
+ * translate→scale→rotate; translate en px, rotate en deg, scale factor.
345
+ * DOM-free (QuickJS/Hermes safe). `null`/`undefined` retira la parte.
346
+ */
347
+ export function composeTransformCss(
348
+ parts: Record<string, unknown>,
349
+ ): string {
350
+ const out: string[] = [];
351
+ if (parts.translateX != null) out.push(`translateX(${parts.translateX}px)`);
352
+ if (parts.translateY != null) out.push(`translateY(${parts.translateY}px)`);
353
+ if (parts.scaleX != null || parts.scaleY != null) {
354
+ out.push(`scale(${parts.scaleX ?? 1}, ${parts.scaleY ?? 1})`);
355
+ }
356
+ if (parts.rotate != null) out.push(`rotate(${parts.rotate}deg)`);
357
+ return out.join(" ");
358
+ }
359
+
360
+ export const TRANSFORM_STYLE_KEYS: ReadonlySet<string> = new Set<string>([
361
+ "translateX", "translateY", "scaleX", "scaleY", "rotate",
362
+ ]);
363
+
364
+ /**
365
+ * ADR-0131 — `stateStyle`: variantes visuales por estado de vista, prop
366
+ * serializable (precedente `animate`, ADR-0023 — JSON en update-props,
367
+ * sin ABI). Forma:
368
+ *
369
+ * stateStyle={{ pressed: {opacity: .7}, selected: {backgroundColor: c} }}
370
+ *
371
+ * Solo claves de STATE_STYLE_KEYS — un estado nunca re-layout; el resto
372
+ * se descarta en la serialización (y avisa con strictStyles). El cambio
373
+ * de estado NO cruza el puente JS: web lo materializa en una hoja
374
+ * gestionada (`[data-elur-id]:active`, `:hover` en `@media(hover:hover)`,
375
+ * `:focus-visible`, `[aria-selected]`, `[aria-disabled]` con !important,
376
+ * pues el estilo base viaja inline) y Android en StateListDrawable/
377
+ * ColorStateList/StateListAnimator sobre los estados de vista que ya fija
378
+ * la semántica (ADR-0117). Prioridad (gana el último en empate CSS, el
379
+ * primero en StateListDrawable): disabled > pressed > focused > hovered
380
+ * > selected. `hovered` es `no` en Android sin puntero (approx por
381
+ * state_hovered, solo visible con mouse/TV).
382
+ */
383
+ export type StateStyleName =
384
+ "pressed" | "hovered" | "focused" | "selected" | "disabled";
385
+
386
+ export type StateStyleSpec = {
387
+ [S in StateStyleName]?: Style;
388
+ };
389
+
390
+ /** Claves permitidas dentro de stateStyle — visuales sin re-layout. */
391
+ export const STATE_STYLE_KEYS: ReadonlySet<string> = new Set<string>([
392
+ "color", "backgroundColor", "backgroundGradient", "opacity", "cursor",
393
+ "borderColor", "borderWidth", "borderRadius",
394
+ "borderTopLeftRadius", "borderTopRightRadius",
395
+ "borderBottomRightRadius", "borderBottomLeftRadius",
396
+ "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth",
397
+ "borderInlineStartWidth", "borderInlineEndWidth",
398
+ "borderBlockStartWidth", "borderBlockEndWidth",
399
+ "textDecoration", "fontWeight", "fontStyle", "letterSpacing",
400
+ "translateX", "translateY", "scaleX", "scaleY", "rotate",
401
+ ]);
402
+
403
+ /** Prioridad de estados, de MENOR a MAYOR (CSS: último gana; Android
404
+ * StateListDrawable: primero gana → el host invierte el orden). */
405
+ export const STATE_STYLE_ORDER: readonly StateStyleName[] = [
406
+ "selected", "hovered", "focused", "pressed", "disabled",
407
+ ];
408
+
409
+ /**
410
+ * ADR-0147 — `spans`: texto enriquecido inline sobre nodos `text`,
411
+ * prop serializable (precedente `stateStyle`, ADR-0131 — JSON en
412
+ * update-props, sin cambio de ABI). Un span es un RUN dentro del
413
+ * párrafo, no una caja: puede partirse entre líneas, por eso no se
414
+ * modela como hijo ni delegado de layout.
415
+ *
416
+ * spans=[{ start: 0, end: 12, style: { fontWeight: "bold" } },
417
+ * { start: 21, end: 26, style: { color: "#06c" }, href: "/x" }]
418
+ *
419
+ * CONTRATO:
420
+ * - `start`/`end` son offsets UTF-16 sobre el texto RENDERIZADO
421
+ * (post-textTransform); el backend clampea — el texto puede venir de
422
+ * un binding reactivo más corto que los rangos declarados.
423
+ * - Solapamiento SOLO por anidación (un span contiene entero a otro):
424
+ * el DOM/HTML no puede expresar rangos parcialmente solapados y el
425
+ * contrato debe poder materializarse en ambos backends.
426
+ * - `style` es un subset tipográfico (TEXT_SPAN_STYLE_KEYS); el resto
427
+ * es rechazado por validateTextSpans.
428
+ * - `href` reusa la navegación de ADR-0133: el reconciler registra el
429
+ * handler interno `__elur_span_href` (payload = url); web despacha
430
+ * same-origin por él y deja la externa al <a> nativo, Android la
431
+ * invoca via ClickableSpan → callHandlerWithString.
432
+ * - Aplica a nodos `text` (TextView). text-input/EditText la ignora —
433
+ * spans estáticos sobre contenido IME romperían la composición.
434
+ */
435
+ export type TextSpanStyleKey =
436
+ | "color" | "backgroundColor" | "fontSize" | "fontWeight"
437
+ | "fontFamily" | "fontStyle" | "textDecoration" | "letterSpacing";
438
+
439
+ export interface TextSpan {
440
+ start: number;
441
+ end: number;
442
+ style?: { [K in TextSpanStyleKey]?: number | string };
443
+ href?: string;
444
+ }
445
+
446
+ export const TEXT_SPAN_STYLE_KEYS: ReadonlySet<string> = new Set<string>([
447
+ "color", "backgroundColor", "fontSize", "fontWeight",
448
+ "fontFamily", "fontStyle", "textDecoration", "letterSpacing",
449
+ ]);
450
+
451
+ /**
452
+ * Valida y normaliza la prop `spans` (ADR-0147): ordena por
453
+ * (start asc, end desc), exige enteros 0 ≤ start < end, estilo dentro
454
+ * de TEXT_SPAN_STYLE_KEYS y solapamiento solo por anidación. Devuelve
455
+ * undefined si la forma es inválida o el array está vacío. DOM-free —
456
+ * corre en el reconciler (QuickJS/Hermes).
457
+ */
458
+ export function validateTextSpans(v: unknown): readonly TextSpan[] | undefined {
459
+ if (!Array.isArray(v)) return undefined;
460
+ const norm: TextSpan[] = [];
461
+ for (const raw of v) {
462
+ if (!raw || typeof raw !== "object") return undefined;
463
+ const s = raw as Record<string, unknown>;
464
+ const start = s.start, end = s.end;
465
+ if (!Number.isInteger(start) || !Number.isInteger(end) ||
466
+ (start as number) < 0 || (end as number) <= (start as number)) {
467
+ return undefined;
468
+ }
469
+ if (s.style !== undefined) {
470
+ if (typeof s.style !== "object" || s.style === null) return undefined;
471
+ for (const k of Object.keys(s.style as object)) {
472
+ if (!TEXT_SPAN_STYLE_KEYS.has(k)) return undefined;
473
+ }
474
+ }
475
+ if (s.href !== undefined && typeof s.href !== "string") return undefined;
476
+ const span: TextSpan = {
477
+ start: start as number, end: end as number,
478
+ };
479
+ if (s.style) span.style = s.style as TextSpan["style"];
480
+ if (s.href) span.href = s.href as string;
481
+ norm.push(span);
482
+ }
483
+ if (norm.length === 0) return undefined;
484
+ norm.sort((a, b) => a.start - b.start || b.end - a.end);
485
+ const stack: TextSpan[] = [];
486
+ for (const s of norm) {
487
+ while (stack.length > 0 && stack[stack.length - 1].end <= s.start) stack.pop();
488
+ const top = stack[stack.length - 1];
489
+ // top cubre s.start → s debe caber entero (anidación); si no,
490
+ // el solape es parcial y la forma es inválida.
491
+ if (top && s.end > top.end) return undefined;
492
+ stack.push(s);
493
+ }
494
+ return norm;
495
+ }
496
+
497
+ /** Árbol de spans anidados — raíz virtual [0, text.length]. */
498
+ export interface TextSpanNode extends TextSpan {
499
+ children: TextSpanNode[];
500
+ }
501
+
502
+ /**
503
+ * Materialización del contrato `spans` compartida por el backend web
504
+ * (DOM) y el aplicador SSR (HTML): devuelve el árbol de rangos anidados
505
+ * clampeado a `text`. Ambos recorren `children` emitiendo el texto
506
+ * intercalado — la paridad web/SSR sale de la misma estructura.
507
+ * DOM-free.
508
+ */
509
+ export function spanTree(text: string, spans: readonly TextSpan[]): TextSpanNode {
510
+ const root: TextSpanNode = { start: 0, end: text.length, children: [] };
511
+ const stack: TextSpanNode[] = [root];
512
+ for (const s of spans) {
513
+ if (s.start >= text.length) continue;
514
+ const node: TextSpanNode = {
515
+ start: s.start, end: Math.min(s.end, text.length),
516
+ style: s.style, href: s.href, children: [],
517
+ };
518
+ if (node.end <= node.start) continue;
519
+ while (stack.length > 1 && stack[stack.length - 1].end <= node.start) {
520
+ stack.pop();
521
+ }
522
+ stack[stack.length - 1].children.push(node);
523
+ stack.push(node);
524
+ }
525
+ return root;
526
+ }
527
+
528
+ // V14 — validación de VALORES en modo estricto (no solo claves). La
529
+ // tabla acota al contrato portátil: lo que Yoga (elurYoga.cpp) y el
530
+ // applyStyle de Kotlin interpretan de verdad — un valor fuera de la
531
+ // tabla sería aceptado por CSS en web e ignorado silencioso en Android.
532
+ // DOM-free: corre en el reconciler (QuickJS/Hermes).
533
+
534
+ const PCT_RE = /^-?\d+(\.\d+)?%$/;
535
+
536
+ /** number | "<n>%" — y opcionalmente "auto". */
537
+ function dimValue(v: unknown, allowAuto: boolean): boolean {
538
+ if (typeof v === "number") return true;
539
+ if (typeof v !== "string") return false;
540
+ if (PCT_RE.test(v)) return true;
541
+ return allowAuto && v === "auto";
542
+ }
543
+
544
+ const DIM_AUTO = new Set([
545
+ "width", "height", "flexBasis",
546
+ "margin", "marginTop", "marginRight", "marginBottom", "marginLeft",
547
+ "marginInline", "marginInlineStart", "marginInlineEnd",
548
+ "marginBlock", "marginBlockStart", "marginBlockEnd",
549
+ ]);
550
+ const DIM_NO_AUTO = new Set([
551
+ "minWidth", "maxWidth", "minHeight", "maxHeight",
552
+ "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft",
553
+ "paddingInline", "paddingInlineStart", "paddingInlineEnd",
554
+ "paddingBlock", "paddingBlockStart", "paddingBlockEnd",
555
+ "top", "right", "bottom", "left",
556
+ "inset", "insetInlineStart", "insetInlineEnd",
557
+ "insetBlockStart", "insetBlockEnd",
558
+ ]);
559
+ const NUM_ONLY = new Set([
560
+ "gap", "rowGap", "columnGap", "flex", "flexGrow", "flexShrink", "zIndex",
561
+ "aspectRatio",
562
+ "fontSize", "lineHeight", "letterSpacing",
563
+ "borderRadius",
564
+ "borderTopLeftRadius", "borderTopRightRadius",
565
+ "borderBottomRightRadius", "borderBottomLeftRadius",
566
+ "borderWidth", "borderTopWidth", "borderRightWidth",
567
+ "borderBottomWidth", "borderLeftWidth", "borderInlineStartWidth",
568
+ "borderInlineEndWidth", "borderBlockStartWidth", "borderBlockEndWidth",
569
+ "opacity",
570
+ "translateX", "translateY", "scaleX", "scaleY", "rotate",
571
+ ]);
572
+ const STRING_FREE = new Set([
573
+ "fontFamily", "boxShadow", "color", "backgroundColor", "backgroundGradient",
574
+ "borderColor", "cursor", "layout",
575
+ ]);
576
+ const ENUMS: Record<string, ReadonlySet<string>> = {
577
+ flexDirection: new Set(["row", "column", "row-reverse", "column-reverse"]),
578
+ flexWrap: new Set(["wrap", "nowrap"]),
579
+ justifyContent: new Set([
580
+ "flex-start", "center", "flex-end", "space-between", "space-around",
581
+ "space-evenly",
582
+ ]),
583
+ alignItems: new Set([
584
+ "flex-start", "center", "flex-end", "stretch", "baseline",
585
+ ]),
586
+ alignSelf: new Set([
587
+ "flex-start", "center", "flex-end", "stretch", "baseline",
588
+ ]),
589
+ alignContent: new Set([
590
+ "flex-start", "center", "flex-end", "stretch", "space-between",
591
+ "space-around", "space-evenly", "baseline",
592
+ ]),
593
+ position: new Set(["relative", "absolute", "static"]),
594
+ display: new Set(["flex", "none", "contents"]),
595
+ boxSizing: new Set(["border-box", "content-box"]),
596
+ direction: new Set(["ltr", "rtl"]),
597
+ overflow: new Set(["visible", "hidden", "scroll", "auto"]),
598
+ fontStyle: new Set(["normal", "italic"]),
599
+ textAlign: new Set(["auto", "left", "right", "center", "justify", "start", "end"]),
600
+ textTransform: new Set(["none", "uppercase", "lowercase", "capitalize"]),
601
+ textDecoration: new Set(["none", "underline", "line-through"]),
602
+ borderStyle: new Set(["solid", "dashed", "dotted", "none"]),
603
+ objectFit: new Set(["cover", "contain", "fill", "scale-down", "none"]),
604
+ };
605
+
606
+ /** Valida el VALOR de una clave de estilo contra el contrato portátil
607
+ * (V14). `null`/`undefined` siempre válidos — retirada de parte. */
608
+ export function validateStyleValue(key: string, value: unknown): boolean {
609
+ if (value == null) return true;
610
+ const en = ENUMS[key];
611
+ if (en) return typeof value === "string" && en.has(value);
612
+ if (key === "fontWeight") {
613
+ // Kotlin: "bold" o número ≥600; web: normal/bold/100..900.
614
+ return typeof value === "number" || value === "normal" || value === "bold";
615
+ }
616
+ if (DIM_AUTO.has(key)) return dimValue(value, true);
617
+ if (DIM_NO_AUTO.has(key)) return dimValue(value, false);
618
+ if (NUM_ONLY.has(key)) return typeof value === "number";
619
+ if (STRING_FREE.has(key)) return typeof value === "string";
620
+ // Clave fuera de las tablas pero dentro del vocabulario (ninguna
621
+ // hoy) → aceptar: la clave ya pasó el filtro STRICT_FLEXBOX_KEYS.
622
+ return true;
623
+ }
624
+
625
+ /** Validación runtime en el lado embebido (stand-in del linter de Capa 7). */
626
+ export const STRICT_FLEXBOX_KEYS: ReadonlySet<string> = new Set<string>([
627
+ "width", "height", "minWidth", "maxWidth", "minHeight", "maxHeight",
628
+ "boxSizing", "direction",
629
+ "flexDirection", "flexWrap", "alignItems", "alignSelf", "justifyContent",
630
+ "alignContent",
631
+ "flex", "flexGrow", "flexShrink", "flexBasis", "gap", "rowGap", "columnGap",
632
+ "aspectRatio",
633
+ "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft",
634
+ "paddingInline", "paddingInlineStart", "paddingInlineEnd",
635
+ "paddingBlock", "paddingBlockStart", "paddingBlockEnd",
636
+ "margin", "marginTop", "marginRight", "marginBottom", "marginLeft",
637
+ "marginInline", "marginInlineStart", "marginInlineEnd",
638
+ "marginBlock", "marginBlockStart", "marginBlockEnd",
639
+ "position", "top", "right", "bottom", "left", "zIndex",
640
+ "inset", "insetInlineStart", "insetInlineEnd",
641
+ "insetBlockStart", "insetBlockEnd",
642
+ "display", "overflow", "layout",
643
+ "color", "backgroundColor", "fontSize", "fontWeight", "lineHeight",
644
+ "fontFamily", "fontStyle", "textTransform", "textAlign",
645
+ "textDecoration", "letterSpacing",
646
+ "opacity", "boxShadow", "objectFit", "backgroundGradient", "cursor",
647
+ "borderRadius",
648
+ "borderTopLeftRadius", "borderTopRightRadius",
649
+ "borderBottomRightRadius", "borderBottomLeftRadius",
650
+ "borderWidth", "borderColor", "borderStyle",
651
+ "borderTopWidth", "borderRightWidth", "borderBottomWidth",
652
+ "borderLeftWidth", "borderInlineStartWidth", "borderInlineEndWidth",
653
+ "borderBlockStartWidth", "borderBlockEndWidth",
654
+ "translateX", "translateY", "scaleX", "scaleY", "rotate",
655
+ ]);
656
+
657
+ /**
658
+ * F14/R4.6 (ADR-0086) — nivel de soporte de una capacidad por backend:
659
+ * `exact` = semántica completa; `approx` = aproximación documentada en
660
+ * `note`; `no` = no soportado (el backend la ignora silenciosamente).
661
+ */
662
+ export type CapabilityLevel = "exact" | "approx" | "no";
663
+
664
+ /**
665
+ * ADR-0178 — backends con columna en la matriz normativa. Un host que
666
+ * entra al repo entra aquí: la matriz es la fuente de la portabilidad
667
+ * (`isPortable*`), del presupuesto de divergencias (ADR-0146) y de las
668
+ * tablas §4.2–§4.4 del documento (generadas, no copiadas).
669
+ */
670
+ export const CAPABILITY_PLATFORMS = ["web", "android", "linux"] as const;
671
+ export type CapabilityPlatform = (typeof CAPABILITY_PLATFORMS)[number];
672
+
673
+ export interface CapabilityEntry {
674
+ web: CapabilityLevel;
675
+ android: CapabilityLevel;
676
+ /** Host GTK4 (targets/linux) — nivel del aplicador real, no la intención. */
677
+ linux: CapabilityLevel;
678
+ /** Por qué el nivel no es exact — la aproximación o el hueco real. */
679
+ note?: string;
680
+ /**
681
+ * ADR-0146: ficha de divergencia — OBLIGATORIA cuando los niveles
682
+ * difieren entre backends o alguno no es `exact` (excepto `no`/`no`,
683
+ * que es vocabulario declarado sin implementar, no divergencia).
684
+ * `adr` resuelve a docs/adr/NNNN-*.md (≤12 = índice) o
685
+ * `doc:<referencia>`; el conteo global lo vigila
686
+ * cli/check-divergences.mjs contra tests/divergences/manifest.json.
687
+ */
688
+ divergence?: {
689
+ class: "normativa" | "aproximacion" | "bug-aceptado";
690
+ adr: string;
691
+ };
692
+ }
693
+
694
+ /**
695
+ * Matriz de capacidades de props de `update-props` (F14, ADR-0086).
696
+ * Solo vocabulario portátil — las props de platform-view las define el
697
+ * módulo (ADR-0080) y no entran aquí. El nivel refleja el backend REAL
698
+ * (web: src/backends/web; android: ElurRenderer.applyPropsOnView; linux:
699
+ * Applicator::applyProp/applySemantics), no la intención.
700
+ */
701
+ export const PROPS_CAPABILITY: Readonly<Record<string, CapabilityEntry>> = {
702
+ placeholder: { web: "exact", android: "exact", linux: "exact" },
703
+ value: { web: "exact", android: "exact", linux: "exact" },
704
+ // ADR-0117: `checked` viaja por update-semantics — materializa
705
+ // widget (input.checked / CompoundButton.isChecked / GtkSwitch) y
706
+ // estado a11y.
707
+ checked: { web: "exact", android: "exact", linux: "exact", note: "op update-semantics (SEMANTICS_VERSION 3); \"mixed\" es aprox en android (stateDescription — nodeInfo sin tristate, ADR-0152); linux: tristate nativo AT-SPI" },
708
+ min: {
709
+ web: "approx", android: "exact", linux: "exact",
710
+ note: "web: propiedad DOM genérica (input range)",
711
+ divergence: { class: "aproximacion", adr: "doc:v4.1 §6.2.2" },
712
+ },
713
+ max: {
714
+ web: "approx", android: "exact", linux: "exact",
715
+ note: "web: propiedad DOM genérica (input range)",
716
+ divergence: { class: "aproximacion", adr: "doc:v4.1 §6.2.2" },
717
+ },
718
+ src: { web: "exact", android: "exact", linux: "exact" },
719
+ url: {
720
+ web: "no", android: "exact", linux: "no",
721
+ note: "web: `el.url = v` no navega un iframe — falta mapeo a src; linux: sin WebView en el host GTK4",
722
+ divergence: { class: "aproximacion", adr: "doc:v4.1 §6.2.2" },
723
+ },
724
+ draw: {
725
+ web: "exact", android: "exact", linux: "no",
726
+ note: "linux: sin superficie `canvas` en el host GTK4 (pendiente declarado, ADR-0177)",
727
+ divergence: { class: "aproximacion", adr: "ADR-0177" },
728
+ },
729
+ // ADR-0123: superficie del nodo `canvas` — "custom" elige el backend
730
+ // raster Skia (cap `skia`); "auto"/"native" = Platform Views. Web y
731
+ // Linux tienen una sola superficie: la ignoran.
732
+ renderPolicy: {
733
+ web: "approx", android: "exact", linux: "approx",
734
+ note: "solo `canvas`; web y linux: única superficie (la ignoran)",
735
+ divergence: { class: "normativa", adr: "ADR-0123" },
736
+ },
737
+ keyboard: { web: "exact", android: "exact", linux: "exact", note: "linux: input purpose GTK + visibility=false en password (ADR-0179)" },
738
+ autocomplete: {
739
+ web: "exact", android: "exact", linux: "approx",
740
+ note: "linux: GTK4 no tiene framework de autofill — el token se acepta sin efecto",
741
+ divergence: { class: "normativa", adr: "ADR-0178" },
742
+ },
743
+ enterkey: {
744
+ web: "exact", android: "exact", linux: "approx",
745
+ note: "linux: sin teclado virtual con tecla de acción — Enter dispara `submit` (ADR-0179)",
746
+ divergence: { class: "normativa", adr: "ADR-0178" },
747
+ },
748
+ maxlength: {
749
+ web: "exact", android: "exact", linux: "approx",
750
+ note: "linux: gtk_entry_set_max_length cuenta code points; web/android unidades UTF-16 — difieren fuera del BMP",
751
+ divergence: { class: "aproximacion", adr: "ADR-0179" },
752
+ },
753
+ selection: { web: "exact", android: "exact", linux: "exact" },
754
+ label: {
755
+ web: "exact", android: "exact", linux: "approx",
756
+ note: "linux: en `text` el accessible-name de GtkLabel es su propio texto (GTK4 no deja sobrescribirlo); resto de tipos exact",
757
+ divergence: { class: "aproximacion", adr: "ADR-0176" },
758
+ },
759
+ accessible: { web: "exact", android: "exact", linux: "exact" },
760
+ // ADR-0108: vocabulario semántico dedicado (op update-semantics).
761
+ role: { web: "exact", android: "exact", linux: "exact" },
762
+ live: { web: "exact", android: "exact", linux: "exact" },
763
+ // ADR-0117: estado estructurado + hint + foco (v2).
764
+ selected: { web: "exact", android: "exact", linux: "exact" },
765
+ disabled: { web: "exact", android: "exact", linux: "exact" },
766
+ hint: { web: "exact", android: "exact", linux: "exact" },
767
+ focused: { web: "exact", android: "exact", linux: "exact" },
768
+ focusable: { web: "exact", android: "exact", linux: "exact" },
769
+ // ADR-0152 (SEMANTICS_VERSION 3): estados de formulario real.
770
+ // Android sin flag de expanded <API36 → ACTION_EXPAND/COLLAPSE +
771
+ // invocación al evento `action`/`press` es el mecanismo nativo.
772
+ expanded: { web: "exact", android: "exact", linux: "exact" },
773
+ invalid: { web: "exact", android: "exact", linux: "exact" },
774
+ required: {
775
+ web: "exact", android: "approx", linux: "exact",
776
+ note: "android: sin flag nativo → stateDescription localizada; web: aria-required + attr required; linux: GTK_ACCESSIBLE_PROPERTY_REQUIRED",
777
+ divergence: { class: "aproximacion", adr: "ADR-0152" },
778
+ },
779
+ // Rango para widgets custom — los nativos (SeekBar/input range)
780
+ // ya lo exponen. Android materializa RangeInfo solo con las 3
781
+ // partes presentes.
782
+ valueMin: { web: "exact", android: "exact", linux: "exact" },
783
+ valueMax: { web: "exact", android: "exact", linux: "exact" },
784
+ valueNow: { web: "exact", android: "exact", linux: "exact" },
785
+ valueText: {
786
+ web: "exact", android: "approx", linux: "exact",
787
+ note: "android: stateDescription (sin campo de value-text nativo); linux: GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT",
788
+ divergence: { class: "aproximacion", adr: "ADR-0152" },
789
+ },
790
+ // Acciones a11y personalizadas — DOM no expone acciones invocables
791
+ // por lector de pantalla; web enlaza el evento `action` vía
792
+ // CustomEvent `elur:action` pero nada las anuncia ni las invoca.
793
+ // Linux: GtkActionMuxer del widget → org.a11y.atspi.Action; el AT
794
+ // anuncia/invoca el id — la etiqueta (id|Label) no tiene canal.
795
+ actions: {
796
+ web: "no", android: "exact", linux: "approx",
797
+ note: "web: sin API DOM de acciones SR — CustomEvent programático sí despacha; linux: GAction por instancia vía muxer del widget — AT ve el id, sin canal para la etiqueta (ADR-0190)",
798
+ divergence: { class: "aproximacion", adr: "ADR-0190" },
799
+ },
800
+ dir: { web: "exact", android: "exact", linux: "exact" },
801
+ href: {
802
+ web: "exact", android: "approx", linux: "approx",
803
+ note: "ADR-0133: interna → router.push (sin @press), externa → ElurBridge.openUrl (linux: GtkUriLauncher); web: enlace real con as=\"a\"",
804
+ divergence: { class: "aproximacion", adr: "ADR-0133" },
805
+ },
806
+ as: {
807
+ web: "exact", android: "approx", linux: "approx",
808
+ note: "android/linux: solo h1..h6 → heading de accesibilidad",
809
+ divergence: { class: "aproximacion", adr: "ADR-0049" },
810
+ },
811
+ shell: {
812
+ web: "exact", android: "exact", linux: "no",
813
+ note: "linux: la barra de tabs (BottomNavigationView) es cromo móvil sin equivalente desktop — la vía es chrome:\"none\" + barra propia (ADR-0177)",
814
+ divergence: { class: "normativa", adr: "ADR-0177" },
815
+ },
816
+ animate: {
817
+ web: "exact", android: "approx", linux: "approx",
818
+ note: "android: solo first→last keyframe; sin iterations ni fill; linux: subset de 6 props, easing por iteración (no por intervalo, ADR-0169)",
819
+ divergence: { class: "aproximacion", adr: "ADR-0023" },
820
+ },
821
+ "animate-exit": {
822
+ web: "approx", android: "approx", linux: "approx",
823
+ note: "spec guardada y corrida al delete-node — subset WAAPI en todos",
824
+ divergence: { class: "aproximacion", adr: "ADR-0023" },
825
+ },
826
+ // ADR-0131: variantes visuales por estado (ver StateStyleSpec).
827
+ stateStyle: {
828
+ web: "exact", android: "approx", linux: "approx",
829
+ note: "android: hovered solo con puntero; corners de borde por lado no mitrados; linux: `selected` solo en widgets con selección propia (ADR-0168)",
830
+ divergence: { class: "aproximacion", adr: "ADR-0131" },
831
+ },
832
+ // Prop de nodo shell (ADR-0075): screen-host la emite al cambiar el
833
+ // tab activo — restore/deeplink pueden aterrizar en un tab no-default
834
+ // y el widget nativo (BNV) debe reflejar el modelo, no su init.
835
+ "activeTab": {
836
+ web: "approx", android: "exact", linux: "no",
837
+ note: "shell tabs: android selecciona el item del BNV; web marca aria-current; linux: sin barra de tabs (ver `shell`)",
838
+ divergence: { class: "aproximacion", adr: "ADR-0133" },
839
+ },
840
+ // ADR-0122: parámetros del delegado de layout (`layout:` style) —
841
+ // passthrough opaco al backend; cada target decide el objeto.
842
+ "layoutParams": {
843
+ web: "approx", android: "exact", linux: "approx",
844
+ note: "web y linux: recibida e ignorada explícitamente (sin delegados aún); android: objeto al delegado (masonry: columns/gap)",
845
+ divergence: { class: "aproximacion", adr: "ADR-0122" },
846
+ },
847
+ // ADR-0147: tramos inline con estilo/enlace sobre nodos `text`
848
+ // (rangos UTF-16, solapamiento solo por anidación). Otras hojas la
849
+ // ignoran (text-input: conflicto con composición IME).
850
+ "spans": {
851
+ web: "exact", android: "exact", linux: "exact",
852
+ note: "ADR-0147: {start,end,style,href} — web <span>/<a> inline, android SpannableStringBuilder, linux PangoAttrList + hit-test de enlaces (ADR-0167)",
853
+ },
854
+ // ADR-0148: escritura puntual de la posición de scroll (unidades
855
+ // lógicas) en scroll-view/list — el reconciler la emite al remontar
856
+ // un scroller con `id` de autoría que tenía posición persistida.
857
+ // El backend aplica post-layout (web: rAF hasta que el scrollHeight
858
+ // lo admita; android: ScrollView.scrollTo / RecyclerView por
859
+ // posición+offset según rowHeight). El app también puede emitirla
860
+ // programáticamente; no es un binding reactivo.
861
+ "scrollTop": {
862
+ web: "exact", android: "exact", linux: "exact",
863
+ note: "ADR-0148: restore/set puntual del offset vertical (lógicas); android list → posición+offset por rowHeight; linux: vadjustment del GtkScrolledWindow",
864
+ },
865
+ // ADR-0150: pin al borde top del scroll-view ancestro (sticky
866
+ // header) — ajuste visual post-layout como `transform`: no entra al
867
+ // vocabulario de Yoga ni mueve siblings. `number` = umbral lógico
868
+ // desde el top; `true` = 0. Solo dentro de scroll-view (las listas
869
+ // rematerializan filas — sticky ahí queda diferido). No compone con
870
+ // `transform.translateY` ni con el style `top` del mismo nodo.
871
+ "sticky": {
872
+ web: "exact", android: "exact", linux: "no",
873
+ note: "ADR-0150: web position:sticky+top; android translationY por tick de scroll en ElurScrollView con clamp al padre (containing block); linux: pendiente",
874
+ divergence: { class: "aproximacion", adr: "ADR-0178" },
875
+ },
876
+ // ADR-0179: combo del evento `shortcut` ("Mod+S") — el reconciler lo
877
+ // normaliza al payload del attach; nunca viaja como update-props.
878
+ "shortcut": {
879
+ web: "exact", android: "exact", linux: "exact",
880
+ note: "ADR-0179: forma canónica ctrl+alt+shift+meta+tecla (src/ir/shortcut.ts); solo valor estático",
881
+ },
882
+ "maxLines": {
883
+ web: "exact", android: "approx", linux: "exact",
884
+ note: "ADR-0201: Linux verificado en host GTK (límite de líneas en medida y pintado); Android pendiente on-device",
885
+ divergence: { class: "aproximacion", adr: "ADR-0201" },
886
+ },
887
+ "textOverflow": {
888
+ web: "exact", android: "approx", linux: "approx",
889
+ note: "ADR-0201: implementado en Android/Linux; verificación on-device/GTK pendiente",
890
+ divergence: { class: "aproximacion", adr: "ADR-0201" },
891
+ },
892
+ "selectable": {
893
+ web: "exact", android: "approx", linux: "approx",
894
+ note: "ADR-0201: implementado en Android/Linux; verificación on-device/GTK pendiente",
895
+ divergence: { class: "aproximacion", adr: "ADR-0201" },
896
+ },
897
+ "multiline": {
898
+ web: "exact", android: "approx", linux: "no",
899
+ note: "ADR-0201: Android EditText materializa multiline/rows; Linux GtkEntry aún no",
900
+ divergence: { class: "aproximacion", adr: "ADR-0201" },
901
+ },
902
+ "rows": {
903
+ web: "exact", android: "approx", linux: "no",
904
+ note: "ADR-0201: Android EditText materializa multiline/rows; Linux GtkEntry aún no",
905
+ divergence: { class: "aproximacion", adr: "ADR-0201" },
906
+ },
907
+ "readOnly": {
908
+ web: "exact", android: "approx", linux: "approx",
909
+ note: "ADR-0201: implementado en Android/Linux; verificación on-device/GTK pendiente",
910
+ divergence: { class: "aproximacion", adr: "ADR-0201" },
911
+ },
912
+ "autoCapitalize": {
913
+ web: "exact", android: "approx", linux: "approx",
914
+ note: "ADR-0201: implementado en Android/Linux; verificación on-device/GTK pendiente",
915
+ divergence: { class: "aproximacion", adr: "ADR-0201" },
916
+ },
917
+ "spellcheck": {
918
+ web: "exact", android: "approx", linux: "approx",
919
+ note: "ADR-0201: implementado en Android/Linux; verificación on-device/GTK pendiente",
920
+ divergence: { class: "aproximacion", adr: "ADR-0201" },
921
+ },
922
+ "variant": {
923
+ web: "exact", android: "exact", linux: "exact",
924
+ note: "ADR-0216: <switch variant='switch|checkbox|radio'> en web (<input>), Android (Switch/CheckBox/RadioButton) y Linux (GtkSwitch/GtkCheckButton)",
925
+ },
926
+ "horizontal": {
927
+ web: "exact", android: "exact", linux: "exact",
928
+ note: "ADR-0216: eje horizontal en scroll-view/list (web flex/overflow-x, Android ElurListView HORIZONTAL + ElurHorizontalScrollView, Linux GtkScrolledWindow + Yoga row)",
929
+ },
930
+ "scrollLeft": {
931
+ web: "exact", android: "exact", linux: "exact",
932
+ note: "ADR-0216: posición horizontal lógica en scroll-view/list (espejo de scrollTop)",
933
+ },
934
+ "paging": {
935
+ web: "exact", android: "exact", linux: "approx",
936
+ note: "ADR-0216: web scroll-snap-type, Android PagerSnapHelper / page fling, Linux settle al múltiplo de página",
937
+ divergence: { class: "aproximacion", adr: "ADR-0216" },
938
+ },
939
+ "inverted": {
940
+ web: "exact", android: "exact", linux: "exact",
941
+ note: "ADR-0216: feeds anclados al final (web/Yoga column-reverse|row-reverse, Android reverseLayout+stackFromEnd, Linux ajuste final)",
942
+ },
943
+ "refreshing": {
944
+ web: "exact", android: "approx", linux: "approx",
945
+ note: "ADR-0216: indicador de pull-to-refresh activo en web/Android/Linux; calibración visual on-device pendiente",
946
+ divergence: { class: "aproximacion", adr: "ADR-0216" },
947
+ },
948
+ "endReachedThreshold": {
949
+ web: "exact", android: "exact", linux: "exact",
950
+ note: "ADR-0216: umbral [0..1] evaluado en el reconciliador sobre el payload completo de `scroll`",
951
+ },
952
+ "columns": {
953
+ web: "exact", android: "exact", linux: "exact",
954
+ note: "ADR-0216: multi-columna en list (web CSS Grid, Android GridLayoutManager, Linux Yoga row+wrap 100/N%)",
955
+ },
956
+ "fallbackSrc": {
957
+ web: "exact", android: "approx", linux: "exact",
958
+ note: "ADR-0204: fallback + load/error implementados en web/Linux (probado en host GTK); Android compilado, verificación on-device pendiente",
959
+ divergence: { class: "aproximacion", adr: "ADR-0204" },
960
+ },
961
+ "safeArea": {
962
+ web: "approx", android: "approx", linux: "approx",
963
+ note: "ADR-0196/0197: el reconciliador aplica padding reactivo desde windowInsets (emitidos en Android; 0 por defecto en desktop/web)",
964
+ divergence: { class: "aproximacion", adr: "ADR-0196" },
965
+ },
966
+ "keyboardAvoiding": {
967
+ web: "approx", android: "approx", linux: "approx",
968
+ note: "ADR-0196/0197: el reconciliador aplica paddingBottom reactivo desde windowInsets.imeBottom (emitido en Android)",
969
+ divergence: { class: "aproximacion", adr: "ADR-0196" },
970
+ },
971
+ "ref": { web: "exact", android: "exact", linux: "exact" },
972
+ };
973
+
974
+ /**
975
+ * Matriz de capacidades de eventos (F14, ADR-0086) — el vocabulario
976
+ * completo UniversalEvent §3.3 vs. lo que cada backend despacha de
977
+ * verdad (web: mapEvent + addEventListener; android y linux: attachEvent).
978
+ */
979
+ export const EVENTS_CAPABILITY: Readonly<Record<string, CapabilityEntry>> = {
980
+ press: { web: "exact", android: "exact", linux: "exact" },
981
+ // ADR-0179: umbral del SO (Android ViewConfiguration, GTK long-press;
982
+ // web 500 ms / 8 px); un long-press consumido no produce press.
983
+ longPress: {
984
+ web: "exact", android: "exact", linux: "exact",
985
+ note: "ADR-0179: {x,y}; también en filas template de lista nativa (android)",
986
+ },
987
+ hover: {
988
+ web: "exact", android: "exact", linux: "exact",
989
+ note: "ADR-0179: solo la entrada; android: OnHoverListener (mouse/lápiz)",
990
+ },
991
+ focus: { web: "exact", android: "exact", linux: "exact" },
992
+ blur: { web: "exact", android: "exact", linux: "exact" },
993
+ contextMenu: {
994
+ web: "exact", android: "exact", linux: "exact",
995
+ note: "ADR-0159: payload {x,y}; android: context click (botón secundario/lápiz); linux: click secundario",
996
+ },
997
+ // ADR-0179: prop `shortcut` normalizada por el reconciler; ámbito
998
+ // ventana, gana el último adjuntado.
999
+ shortcut: {
1000
+ web: "exact", android: "exact", linux: "exact",
1001
+ note: "ADR-0179: {combo}; android: Activity.dispatchKeyEvent (teclado físico); linux: key controller en captura sobre la ventana",
1002
+ },
1003
+ pan: {
1004
+ web: "exact", android: "exact", linux: "exact",
1005
+ note: "ADR-0179: {phase,x,y,dx,dy}; un pan iniciado no produce press",
1006
+ },
1007
+ scroll: { web: "exact", android: "exact", linux: "exact" },
1008
+ input: { web: "exact", android: "exact", linux: "exact" },
1009
+ composition: {
1010
+ web: "exact", android: "exact", linux: "exact",
1011
+ note: "ADR-0109: compositionstart/update/end ↔ transiciones del span SPAN_COMPOSING; linux: GtkIMContext propio en paralelo",
1012
+ },
1013
+ change: { web: "exact", android: "exact", linux: "exact" },
1014
+ select: { web: "exact", android: "exact", linux: "exact" },
1015
+ // ADR-0179: acción principal de un text-input — Enter físico o la
1016
+ // acción del IME; nunca durante composición.
1017
+ submit: {
1018
+ web: "exact", android: "exact", linux: "exact",
1019
+ note: "ADR-0179: {text}; android: OnEditorActionListener; web: Enter en <input>; linux: GtkEntry::activate",
1020
+ },
1021
+ // ADR-0152: invocación de acción a11y — Android la dispara desde
1022
+ // performAccessibilityAction; web despacha el CustomEvent
1023
+ // `elur:action` (invocación programática, sin SR nativo); Linux la
1024
+ // dispara desde AT-SPI DoAction → GAction del muxer del widget.
1025
+ action: {
1026
+ web: "exact", android: "exact", linux: "approx",
1027
+ note: "linux: solo invocable por AT (DoAction) — sin disparo programático equivalente a elur:action (ADR-0190)",
1028
+ divergence: { class: "aproximacion", adr: "ADR-0190" },
1029
+ },
1030
+ // ADR-0159 — entrada desktop; ADR-0179 la despacha también Android
1031
+ // cuando el SO la entrega (mouse/lápiz/teclado físico).
1032
+ pointer: {
1033
+ web: "exact", android: "exact", linux: "exact",
1034
+ note: "web: pointerenter/leave/move; android: hover enter/move/exit; linux: GtkEventControllerMotion → {phase,x,y}",
1035
+ },
1036
+ key: {
1037
+ web: "exact", android: "exact", linux: "exact",
1038
+ note: "{key,ctrl,alt,shift,meta} en vocabulario KeyboardEvent.key; android/linux traducen keycode/keyval (ADR-0179)",
1039
+ },
1040
+ refresh: {
1041
+ web: "exact", android: "approx", linux: "approx",
1042
+ note: "ADR-0216: pull-to-refresh (web touch/elur:refresh, Android over-pull en borde superior, Linux GtkScrolledWindow::edge-overshot)",
1043
+ divergence: { class: "aproximacion", adr: "ADR-0216" },
1044
+ },
1045
+ endReached: {
1046
+ web: "exact", android: "exact", linux: "exact",
1047
+ note: "ADR-0216: disparo único por tamaño de contenido en el reconciliador sobre `scroll` {y,x,vh,vw,ch,cw}",
1048
+ },
1049
+ load: {
1050
+ web: "exact", android: "approx", linux: "exact",
1051
+ note: "ADR-0204: carga de imagen {width,height,fallback?}; web/Linux probados, Android compilado (on-device pendiente)",
1052
+ divergence: { class: "aproximacion", adr: "ADR-0204" },
1053
+ },
1054
+ error: {
1055
+ web: "exact", android: "approx", linux: "exact",
1056
+ note: "ADR-0204: fallo definitivo {message,fallback?}; el fallback recuperable no emite error; Android compilado (on-device pendiente)",
1057
+ divergence: { class: "aproximacion", adr: "ADR-0204" },
1058
+ },
1059
+ pinch: {
1060
+ web: "no", android: "no", linux: "no",
1061
+ note: "ADR-0196: vocabulario declarado; sin emisor todavía",
1062
+ },
1063
+ };
1064
+
1065
+ /**
1066
+ * R4.6/ADR-0086 — portable = la clave está en la matriz y NINGÚN backend
1067
+ * la marca `no`. `approx` pasa: la aproximación está documentada en
1068
+ * `note` y el comportamiento degradado es explícito, no silencioso.
1069
+ */
1070
+ export function isPortableProp(key: string): boolean {
1071
+ const c = PROPS_CAPABILITY[key];
1072
+ return c !== undefined && CAPABILITY_PLATFORMS.every((p) => c[p] !== "no");
1073
+ }
1074
+
1075
+ export function isPortableEvent(name: string): boolean {
1076
+ const c = EVENTS_CAPABILITY[name];
1077
+ return c !== undefined && CAPABILITY_PLATFORMS.every((p) => c[p] !== "no");
1078
+ }
1079
+
1080
+ /**
1081
+ * ADR-0146/0178 — una entrada diverge si algún backend no es `exact`,
1082
+ * salvo `no` en todos (vocabulario declarado sin implementar). Una sola
1083
+ * definición para el gate (check-divergences), doc-data y los tests.
1084
+ */
1085
+ export function isDivergentCapability(e: CapabilityEntry): boolean {
1086
+ const levels = CAPABILITY_PLATFORMS.map((p) => e[p]);
1087
+ return levels.some((l) => l !== "exact") && !levels.every((l) => l === "no");
1088
+ }
1089
+
1090
+ /**
1091
+ * Guard de Signal por API pública (U16, ADR-0070): `value` + `peek()` +
1092
+ * `update()` son la superficie de Core — `_value`/`_subs` son privados
1093
+ * de la implementación 3.x y romperían contra Core 4. Un objeto plano
1094
+ * `{value: n}` no cuela: le faltan los métodos.
1095
+ */
1096
+ export function isSignal(v: unknown): v is Signal<unknown> {
1097
+ return (
1098
+ typeof v === "object" && v !== null &&
1099
+ "value" in v &&
1100
+ typeof (v as Signal<unknown>).peek === "function" &&
1101
+ typeof (v as Signal<unknown>).update === "function"
1102
+ );
1103
+ }