@ccslabs/xtend 0.1.0-rc.1 → 0.1.2

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 (566) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +4 -0
  3. package/catalog/component-catalog-coverage.js +2 -0
  4. package/catalog/epic13-package-export-lock.js +11 -1
  5. package/catalog/epic13-rmt-production-readiness.js +0 -1
  6. package/catalog/epic18-rmt-action-effect-runtime.d.ts +36 -0
  7. package/catalog/epic18-rmt-action-effect-runtime.js +249 -0
  8. package/catalog/epic18-rmt-app-platform-authoring.d.ts +39 -0
  9. package/catalog/epic18-rmt-app-platform-authoring.js +319 -0
  10. package/catalog/epic18-rmt-app-platform-fixture.d.ts +33 -0
  11. package/catalog/epic18-rmt-app-platform-fixture.js +221 -0
  12. package/catalog/epic18-rmt-app-platform-release-handoff.d.ts +30 -0
  13. package/catalog/epic18-rmt-app-platform-release-handoff.js +231 -0
  14. package/catalog/epic18-rmt-app-platform-tooling.d.ts +38 -0
  15. package/catalog/epic18-rmt-app-platform-tooling.js +242 -0
  16. package/catalog/epic18-rmt-component-template-primitives.d.ts +33 -0
  17. package/catalog/epic18-rmt-component-template-primitives.js +240 -0
  18. package/catalog/epic18-rmt-dom-descriptor-renderer.d.ts +35 -0
  19. package/catalog/epic18-rmt-dom-descriptor-renderer.js +232 -0
  20. package/catalog/epic18-rmt-event-routing-runtime.d.ts +35 -0
  21. package/catalog/epic18-rmt-event-routing-runtime.js +234 -0
  22. package/catalog/epic18-rmt-state-selector-runtime.d.ts +34 -0
  23. package/catalog/epic18-rmt-state-selector-runtime.js +216 -0
  24. package/catalog/epic18-rmt-surface-resource-graph-runtime.d.ts +36 -0
  25. package/catalog/epic18-rmt-surface-resource-graph-runtime.js +256 -0
  26. package/catalog/surface-manager-controller.js +5 -1
  27. package/catalog/surface-manager-materialization.js +7 -1
  28. package/catalog/surface-manager-overlay-bridge.js +41 -6
  29. package/catalog/surface-manager-workbench-fixture.js +1 -1
  30. package/catalog/surface-type-capability-matrix.d.ts +61 -0
  31. package/catalog/surface-type-capability-matrix.js +183 -0
  32. package/catalog/type-exports-rmt.js +37 -1
  33. package/catalog/type-exports.js +3 -3
  34. package/components/icon-packs/lucide.js +4 -0
  35. package/components/manifest.json +2 -0
  36. package/components/prism-rmt.d.ts +34 -0
  37. package/components/prism-rmt.js +130 -0
  38. package/components/xcards.js +15 -0
  39. package/components/xcode.d.ts +36 -1
  40. package/components/xcode.js +215 -20
  41. package/components/xfooter.js +17 -0
  42. package/components/xheader.js +14 -0
  43. package/components/xhero.js +16 -1
  44. package/components/xlink.js +97 -14
  45. package/components/xmasonry.js +15 -0
  46. package/components/xplayer.d.ts +44 -2
  47. package/components/xplayer.js +242 -15
  48. package/components/xrouter.js +27 -2
  49. package/components/xsection.js +15 -0
  50. package/components/xsidepanel.js +10 -2
  51. package/components/xsurfacemanager-controller.d.ts +2 -1
  52. package/components/xsurfacemanager-controller.js +27 -3
  53. package/components/xsurfacemanager.d.ts +2 -0
  54. package/components/xsurfacemanager.js +20 -8
  55. package/components/xsurfaceoverlay-bridge.d.ts +20 -5
  56. package/components/xsurfaceoverlay-bridge.js +114 -18
  57. package/components/xsurfaceportal.d.ts +29 -0
  58. package/components/xsurfaceportal.js +122 -0
  59. package/components/xsurfaceregion.d.ts +50 -0
  60. package/components/xsurfaceregion.js +285 -0
  61. package/components/xsurfacewindow.js +2 -1
  62. package/components/xtooltip.js +89 -23
  63. package/docs/README.md +222 -298
  64. package/docs/changelog.md +107 -0
  65. package/docs/component-catalog-coverage.md +9 -9
  66. package/docs/component-platform.md +19 -1
  67. package/docs/component-ux-app-authoring.md +56 -63
  68. package/docs/components/xcode.md +83 -53
  69. package/docs/components/xsurfaceportal.md +32 -0
  70. package/docs/components/xsurfaceregion.md +37 -0
  71. package/docs/components.md +105 -69
  72. package/docs/de/README.md +264 -0
  73. package/docs/de/XTend-ADR.md +221 -0
  74. package/docs/de/a11y-keyboard-smokes.md +62 -0
  75. package/docs/de/about.md +18 -0
  76. package/docs/de/api.md +157 -0
  77. package/docs/de/best-practices.md +76 -0
  78. package/docs/de/changelog.md +107 -0
  79. package/docs/de/component-catalog-coverage.md +58 -0
  80. package/docs/de/component-lab.md +103 -0
  81. package/docs/de/component-long-tail-migration.md +41 -0
  82. package/docs/de/component-platform.md +177 -0
  83. package/docs/de/component-ux-app-authoring.md +123 -0
  84. package/docs/de/component-ux-authoring.md +96 -0
  85. package/docs/de/component-ux-gates.md +45 -0
  86. package/docs/de/components/x-rmt-lifecycle-demo-build.md +60 -0
  87. package/docs/de/components/xalert.md +81 -0
  88. package/docs/de/components/xbutton.md +103 -0
  89. package/docs/de/components/xcalendar.md +82 -0
  90. package/docs/de/components/xcards.md +128 -0
  91. package/docs/de/components/xcheckbox.md +102 -0
  92. package/docs/de/components/xcode.md +156 -0
  93. package/docs/de/components/xdialog.md +92 -0
  94. package/docs/de/components/xdrawer.md +84 -0
  95. package/docs/de/components/xfooter.md +126 -0
  96. package/docs/de/components/xform.md +128 -0
  97. package/docs/de/components/xheader.md +308 -0
  98. package/docs/de/components/xhero.md +142 -0
  99. package/docs/de/components/xicon.md +125 -0
  100. package/docs/de/components/xinput.md +129 -0
  101. package/docs/de/components/xlightbox.md +98 -0
  102. package/docs/de/components/xlink.md +109 -0
  103. package/docs/de/components/xmasonry.md +124 -0
  104. package/docs/de/components/xmenu.md +158 -0
  105. package/docs/de/components/xmodal.md +82 -0
  106. package/docs/de/components/xplayer.md +104 -0
  107. package/docs/de/components/xpopover.md +67 -0
  108. package/docs/de/components/xprogress.md +56 -0
  109. package/docs/de/components/xradio.md +103 -0
  110. package/docs/de/components/xrouter.md +260 -0
  111. package/docs/de/components/xsection.md +125 -0
  112. package/docs/de/components/xselect.md +105 -0
  113. package/docs/de/components/xsidepanel.md +30 -0
  114. package/docs/de/components/xspinner.md +102 -0
  115. package/docs/de/components/xstate.md +148 -0
  116. package/docs/de/components/xstatus.md +55 -0
  117. package/docs/de/components/xsummary.md +78 -0
  118. package/docs/de/components/xsurfacemanager.md +27 -0
  119. package/docs/de/components/xsurfacewindow.md +21 -0
  120. package/docs/de/components/xtabs.md +160 -0
  121. package/docs/de/components/xtextarea.md +98 -0
  122. package/docs/de/components/xtheme.md +167 -0
  123. package/docs/de/components/xtoast.md +62 -0
  124. package/docs/de/components/xtooltip.md +66 -0
  125. package/docs/de/components/xtype.md +82 -0
  126. package/docs/de/components/xutils.md +144 -0
  127. package/docs/de/components/xwriter.md +94 -0
  128. package/docs/de/components.md +153 -0
  129. package/docs/de/conditional-network-evidence-ci.md +38 -0
  130. package/docs/de/conditional-network-evidence.md +50 -0
  131. package/docs/de/core-migration-guide.md +110 -0
  132. package/docs/de/design-tokens.md +116 -0
  133. package/docs/de/docs-rmt-production-hardening.md +31 -0
  134. package/docs/de/enterprise-adoption.md +413 -0
  135. package/docs/de/enterprise-component-flex-release-handoff.md +129 -0
  136. package/docs/de/epic10-platform-gates.md +62 -0
  137. package/docs/de/epic10-release-handoff.md +81 -0
  138. package/docs/de/epic11-enterprise-ux-handoff.md +70 -0
  139. package/docs/de/epic12-rc0-handoff.md +61 -0
  140. package/docs/de/epic18-media-manager-vendor-upstream.md +318 -0
  141. package/docs/de/epic18-rmt-app-platform-release-handoff.md +67 -0
  142. package/docs/de/epic18-vendor-bugfixes.md +34 -0
  143. package/docs/de/existing-component-metadata.md +67 -0
  144. package/docs/de/hydration-performance-closure.md +34 -0
  145. package/docs/de/hydration-policies.md +71 -0
  146. package/docs/de/known-residual-triage.md +22 -0
  147. package/docs/de/manifest-import-policy.md +79 -0
  148. package/docs/de/manifest.md +112 -0
  149. package/docs/de/motion-contrast.md +67 -0
  150. package/docs/de/package-export-lock.md +44 -0
  151. package/docs/de/performance-measurements.md +106 -0
  152. package/docs/de/performance-regression.md +89 -0
  153. package/docs/de/performance.md +94 -0
  154. package/docs/de/previews/README.md +17 -0
  155. package/docs/de/prod-browser-csp-smokes.md +40 -0
  156. package/docs/de/public-component-types.md +79 -0
  157. package/docs/de/quick-start-guide.md +220 -0
  158. package/docs/de/rc0-adoption-guide.md +102 -0
  159. package/docs/de/rc0-gate-matrix.md +58 -0
  160. package/docs/de/rc1-gate-matrix-ci-handoff.md +56 -0
  161. package/docs/de/rc1-migration-notes.md +69 -0
  162. package/docs/de/rc1-readiness.md +46 -0
  163. package/docs/de/release-owner-acceptance.md +56 -0
  164. package/docs/de/release-report-pack-dry-run-evidence.md +39 -0
  165. package/docs/de/rmt-action-effect-runtime.md +81 -0
  166. package/docs/de/rmt-app-platform-authoring.md +54 -0
  167. package/docs/de/rmt-app-platform-fixture.md +46 -0
  168. package/docs/de/rmt-app-platform-migration-guide.md +88 -0
  169. package/docs/de/rmt-app-platform-tooling.md +79 -0
  170. package/docs/de/rmt-component-template-primitives.md +57 -0
  171. package/docs/de/rmt-dom-descriptor-renderer.md +64 -0
  172. package/docs/de/rmt-dsl-authoring-polish.md +145 -0
  173. package/docs/de/rmt-event-routing-runtime.md +81 -0
  174. package/docs/de/rmt-first-demo-app.md +77 -0
  175. package/docs/de/rmt-first-xtend-apps.md +129 -0
  176. package/docs/de/rmt-kernel-panic-recovery-incident-handoff.md +61 -0
  177. package/docs/de/rmt-kernel-security-hardening-migration.md +50 -0
  178. package/docs/de/rmt-kernel-trusted-output-authoring.md +69 -0
  179. package/docs/de/rmt-language-server.md +234 -0
  180. package/docs/de/rmt-lifecycle-demo.md +24 -0
  181. package/docs/de/rmt-linter.md +140 -0
  182. package/docs/de/rmt-node-ssr-adapter.md +100 -0
  183. package/docs/de/rmt-php-ssr-adapter.md +120 -0
  184. package/docs/de/rmt-production-readiness.md +63 -0
  185. package/docs/de/rmt-state-selector-runtime.md +47 -0
  186. package/docs/de/rmt-surface-resource-graph-runtime.md +92 -0
  187. package/docs/de/rmt-tooling-release-gates.md +77 -0
  188. package/docs/de/rmt-vnext-authoring.md +170 -0
  189. package/docs/de/rmt-vnext-component-primitives.md +188 -0
  190. package/docs/de/rmt-vnext-cross-surface-events.md +68 -0
  191. package/docs/de/rmt-vnext-enterprise-mfe-handoff.md +70 -0
  192. package/docs/de/rmt-vnext-fabric-bridge-evidence.md +81 -0
  193. package/docs/de/rmt-vnext-migration-notes.md +62 -0
  194. package/docs/de/rmt-vnext-primitive-authoring-tooling.md +247 -0
  195. package/docs/de/rmt-vnext-primitive-grammar-design.md +289 -0
  196. package/docs/de/rmt-vnext-primitive-lowering.md +108 -0
  197. package/docs/de/rmt-vnext-primitive-migration.md +119 -0
  198. package/docs/de/rmt-vnext-primitive-parser-ast.md +76 -0
  199. package/docs/de/rmt-vnext-primitive-semantic-graph.md +118 -0
  200. package/docs/de/rmt-vnext-primitives-compiler-backlog.md +739 -0
  201. package/docs/de/rmt-vnext-release-handoff.md +83 -0
  202. package/docs/de/rmt-vnext-remote-surfaces.md +90 -0
  203. package/docs/de/rmt-vnext-source-to-sea-gate.md +612 -0
  204. package/docs/de/rmt-vnext-surface-registry-enterprise.md +76 -0
  205. package/docs/de/screenreader-signals.md +56 -0
  206. package/docs/de/supply-chain-gates.md +100 -0
  207. package/docs/de/surface-manager-authoring-guide.md +94 -0
  208. package/docs/de/surface-manager-browser-lab.md +45 -0
  209. package/docs/de/surface-manager-component-lab.md +43 -0
  210. package/docs/de/surface-manager-controller.md +66 -0
  211. package/docs/de/surface-manager-layout-engines.md +32 -0
  212. package/docs/de/surface-manager-lazy-hydration.md +63 -0
  213. package/docs/de/surface-manager-migration-guide.md +122 -0
  214. package/docs/de/surface-manager-native-rmt-surfaces.md +38 -0
  215. package/docs/de/surface-manager-overlay-bridge.md +53 -0
  216. package/docs/de/surface-manager-persistence.md +30 -0
  217. package/docs/de/surface-manager-quality-gates.md +51 -0
  218. package/docs/de/surface-manager-release-handoff.md +68 -0
  219. package/docs/de/surface-manager-remote-policy.md +54 -0
  220. package/docs/de/surface-manager-rmt-authoring.md +102 -0
  221. package/docs/de/surface-manager-route-lifecycle.md +59 -0
  222. package/docs/de/surface-manager-runtime-release-handoff.md +69 -0
  223. package/docs/de/surface-manager-side-panel-runtime.md +36 -0
  224. package/docs/de/surface-manager-stack-policy.md +39 -0
  225. package/docs/de/surface-manager-window-runtime.md +47 -0
  226. package/docs/de/surface-manager-workbench-fixture.md +43 -0
  227. package/docs/de/third-party-design-authoring.md +406 -0
  228. package/docs/de/trusted-dom-boundary-browser-proof.md +32 -0
  229. package/docs/de/trusted-dom-sanitizing.md +110 -0
  230. package/docs/de/type-exports.md +61 -0
  231. package/docs/de/typescript-components.md +63 -0
  232. package/docs/de/visual-browser-regression.md +83 -0
  233. package/docs/de/visual-owner-artifacts.md +46 -0
  234. package/docs/de/visual-snapshot-automation.md +87 -0
  235. package/docs/de/xtend-api-types.md +55 -0
  236. package/docs/de/xtend-builder-types.md +55 -0
  237. package/docs/de/xtend-catalog-types.md +44 -0
  238. package/docs/de/xtend-fabric-rmt-lane-mapping.md +143 -0
  239. package/docs/de/xtend-fabric.md +474 -0
  240. package/docs/de/xtend-loader-types.md +58 -0
  241. package/docs/de/xtend-loader.md +265 -0
  242. package/docs/de/xtend-policy-types.md +38 -0
  243. package/docs/de/xtend-rmt-types.md +40 -0
  244. package/docs/de/xtend-vendor-types.md +36 -0
  245. package/docs/de/xtendrmt-app-dsl.md +334 -0
  246. package/docs/de/xtendrmt-migration-guide.md +266 -0
  247. package/docs/de/xtendrmt-native-authoring.md +333 -0
  248. package/docs/de/xtendrmt-overview.md +109 -0
  249. package/docs/de/xtendrmt-parsedown-scheduling.md +301 -0
  250. package/docs/de/xtendrmt-runtime-bridge.md +155 -0
  251. package/docs/en/README.md +163 -0
  252. package/docs/en/XTend-ADR.md +221 -0
  253. package/docs/en/a11y-keyboard-smokes.md +68 -0
  254. package/docs/en/about.md +25 -0
  255. package/docs/en/api.md +171 -0
  256. package/docs/en/best-practices.md +125 -0
  257. package/docs/en/changelog.md +104 -0
  258. package/docs/en/component-catalog-coverage.md +104 -0
  259. package/docs/en/component-lab.md +103 -0
  260. package/docs/en/component-long-tail-migration.md +41 -0
  261. package/docs/en/component-platform.md +243 -0
  262. package/docs/en/component-ux-app-authoring.md +118 -0
  263. package/docs/en/component-ux-authoring.md +96 -0
  264. package/docs/en/component-ux-gates.md +45 -0
  265. package/docs/en/components/x-rmt-lifecycle-demo-build.md +75 -0
  266. package/docs/en/components/xalert.md +94 -0
  267. package/docs/en/components/xbutton.md +118 -0
  268. package/docs/en/components/xcalendar.md +95 -0
  269. package/docs/en/components/xcards.md +139 -0
  270. package/docs/en/components/xcheckbox.md +118 -0
  271. package/docs/en/components/xcode.md +153 -0
  272. package/docs/en/components/xdialog.md +108 -0
  273. package/docs/en/components/xdrawer.md +110 -0
  274. package/docs/en/components/xfooter.md +138 -0
  275. package/docs/en/components/xform.md +147 -0
  276. package/docs/en/components/xheader.md +308 -0
  277. package/docs/en/components/xhero.md +157 -0
  278. package/docs/en/components/xicon.md +149 -0
  279. package/docs/en/components/xinput.md +147 -0
  280. package/docs/en/components/xlightbox.md +113 -0
  281. package/docs/en/components/xlink.md +130 -0
  282. package/docs/en/components/xmasonry.md +136 -0
  283. package/docs/en/components/xmenu.md +185 -0
  284. package/docs/en/components/xmodal.md +102 -0
  285. package/docs/en/components/xplayer.md +114 -0
  286. package/docs/en/components/xpopover.md +87 -0
  287. package/docs/en/components/xprogress.md +73 -0
  288. package/docs/en/components/xradio.md +119 -0
  289. package/docs/en/components/xrouter.md +260 -0
  290. package/docs/en/components/xsection.md +136 -0
  291. package/docs/en/components/xselect.md +122 -0
  292. package/docs/en/components/xsidepanel.md +48 -0
  293. package/docs/en/components/xspinner.md +118 -0
  294. package/docs/en/components/xstate.md +163 -0
  295. package/docs/en/components/xstatus.md +71 -0
  296. package/docs/en/components/xsummary.md +90 -0
  297. package/docs/en/components/xsurfacemanager.md +42 -0
  298. package/docs/en/components/xsurfacewindow.md +31 -0
  299. package/docs/en/components/xtabs.md +187 -0
  300. package/docs/en/components/xtextarea.md +115 -0
  301. package/docs/en/components/xtheme.md +203 -0
  302. package/docs/en/components/xtoast.md +78 -0
  303. package/docs/en/components/xtooltip.md +85 -0
  304. package/docs/en/components/xtype.md +91 -0
  305. package/docs/en/components/xutils.md +161 -0
  306. package/docs/en/components/xwriter.md +106 -0
  307. package/docs/en/components.md +151 -0
  308. package/docs/en/conditional-network-evidence-ci.md +38 -0
  309. package/docs/en/conditional-network-evidence.md +50 -0
  310. package/docs/en/core-migration-guide.md +110 -0
  311. package/docs/en/design-tokens.md +137 -0
  312. package/docs/en/docs-rmt-production-hardening.md +31 -0
  313. package/docs/en/enterprise-adoption.md +413 -0
  314. package/docs/en/enterprise-component-flex-release-handoff.md +129 -0
  315. package/docs/en/epic10-platform-gates.md +62 -0
  316. package/docs/en/epic10-release-handoff.md +81 -0
  317. package/docs/en/epic11-enterprise-ux-handoff.md +70 -0
  318. package/docs/en/epic12-rc0-handoff.md +61 -0
  319. package/docs/en/epic18-media-manager-vendor-upstream.md +232 -0
  320. package/docs/en/epic18-rmt-app-platform-release-handoff.md +60 -0
  321. package/docs/en/epic18-vendor-bugfixes.md +29 -0
  322. package/docs/en/existing-component-metadata.md +67 -0
  323. package/docs/en/hydration-performance-closure.md +34 -0
  324. package/docs/en/hydration-policies.md +75 -0
  325. package/docs/en/known-residual-triage.md +22 -0
  326. package/docs/en/manifest-import-policy.md +81 -0
  327. package/docs/en/manifest.md +135 -0
  328. package/docs/en/motion-contrast.md +67 -0
  329. package/docs/en/package-export-lock.md +44 -0
  330. package/docs/en/performance-measurements.md +106 -0
  331. package/docs/en/performance-regression.md +89 -0
  332. package/docs/en/performance.md +132 -0
  333. package/docs/en/previews/README.md +17 -0
  334. package/docs/en/prod-browser-csp-smokes.md +40 -0
  335. package/docs/en/public-component-types.md +79 -0
  336. package/docs/en/quick-start-guide.md +189 -0
  337. package/docs/en/rc0-adoption-guide.md +102 -0
  338. package/docs/en/rc0-gate-matrix.md +58 -0
  339. package/docs/en/rc1-gate-matrix-ci-handoff.md +56 -0
  340. package/docs/en/rc1-migration-notes.md +69 -0
  341. package/docs/en/rc1-readiness.md +46 -0
  342. package/docs/en/release-owner-acceptance.md +56 -0
  343. package/docs/en/release-report-pack-dry-run-evidence.md +39 -0
  344. package/docs/en/rmt-action-effect-runtime.md +101 -0
  345. package/docs/en/rmt-app-platform-authoring.md +47 -0
  346. package/docs/en/rmt-app-platform-fixture.md +35 -0
  347. package/docs/en/rmt-app-platform-migration-guide.md +75 -0
  348. package/docs/en/rmt-app-platform-tooling.md +58 -0
  349. package/docs/en/rmt-component-template-primitives.md +49 -0
  350. package/docs/en/rmt-dom-descriptor-renderer.md +54 -0
  351. package/docs/en/rmt-dsl-authoring-polish.md +143 -0
  352. package/docs/en/rmt-event-routing-runtime.md +98 -0
  353. package/docs/en/rmt-first-demo-app.md +87 -0
  354. package/docs/en/rmt-first-xtend-apps.md +127 -0
  355. package/docs/en/rmt-kernel-panic-recovery-incident-handoff.md +60 -0
  356. package/docs/en/rmt-kernel-security-hardening-migration.md +49 -0
  357. package/docs/en/rmt-kernel-trusted-output-authoring.md +68 -0
  358. package/docs/en/rmt-language-server.md +243 -0
  359. package/docs/en/rmt-lifecycle-demo.md +23 -0
  360. package/docs/en/rmt-linter.md +146 -0
  361. package/docs/en/rmt-node-ssr-adapter.md +99 -0
  362. package/docs/en/rmt-php-ssr-adapter.md +118 -0
  363. package/docs/en/rmt-production-readiness.md +63 -0
  364. package/docs/en/rmt-state-selector-runtime.md +34 -0
  365. package/docs/en/rmt-surface-resource-graph-runtime.md +68 -0
  366. package/docs/en/rmt-tooling-release-gates.md +77 -0
  367. package/docs/en/rmt-vnext-authoring.md +102 -0
  368. package/docs/en/rmt-vnext-component-primitives.md +185 -0
  369. package/docs/en/rmt-vnext-cross-surface-events.md +59 -0
  370. package/docs/en/rmt-vnext-enterprise-mfe-handoff.md +62 -0
  371. package/docs/en/rmt-vnext-fabric-bridge-evidence.md +64 -0
  372. package/docs/en/rmt-vnext-migration-notes.md +62 -0
  373. package/docs/en/rmt-vnext-primitive-authoring-tooling.md +174 -0
  374. package/docs/en/rmt-vnext-primitive-grammar-design.md +268 -0
  375. package/docs/en/rmt-vnext-primitive-lowering.md +91 -0
  376. package/docs/en/rmt-vnext-primitive-migration.md +93 -0
  377. package/docs/en/rmt-vnext-primitive-parser-ast.md +59 -0
  378. package/docs/en/rmt-vnext-primitive-semantic-graph.md +103 -0
  379. package/docs/en/rmt-vnext-primitives-compiler-backlog.md +327 -0
  380. package/docs/en/rmt-vnext-release-handoff.md +83 -0
  381. package/docs/en/rmt-vnext-remote-surfaces.md +81 -0
  382. package/docs/en/rmt-vnext-source-to-sea-gate.md +482 -0
  383. package/docs/en/rmt-vnext-surface-registry-enterprise.md +68 -0
  384. package/docs/en/screenreader-signals.md +56 -0
  385. package/docs/en/supply-chain-gates.md +106 -0
  386. package/docs/en/surface-manager-authoring-guide.md +94 -0
  387. package/docs/en/surface-manager-browser-lab.md +45 -0
  388. package/docs/en/surface-manager-component-lab.md +43 -0
  389. package/docs/en/surface-manager-controller.md +66 -0
  390. package/docs/en/surface-manager-layout-engines.md +32 -0
  391. package/docs/en/surface-manager-lazy-hydration.md +63 -0
  392. package/docs/en/surface-manager-migration-guide.md +113 -0
  393. package/docs/en/surface-manager-native-rmt-surfaces.md +38 -0
  394. package/docs/en/surface-manager-overlay-bridge.md +53 -0
  395. package/docs/en/surface-manager-persistence.md +30 -0
  396. package/docs/en/surface-manager-quality-gates.md +51 -0
  397. package/docs/en/surface-manager-release-handoff.md +68 -0
  398. package/docs/en/surface-manager-remote-policy.md +54 -0
  399. package/docs/en/surface-manager-rmt-authoring.md +89 -0
  400. package/docs/en/surface-manager-route-lifecycle.md +59 -0
  401. package/docs/en/surface-manager-runtime-release-handoff.md +69 -0
  402. package/docs/en/surface-manager-side-panel-runtime.md +36 -0
  403. package/docs/en/surface-manager-stack-policy.md +39 -0
  404. package/docs/en/surface-manager-window-runtime.md +47 -0
  405. package/docs/en/surface-manager-workbench-fixture.md +43 -0
  406. package/docs/en/third-party-design-authoring.md +406 -0
  407. package/docs/en/trusted-dom-boundary-browser-proof.md +32 -0
  408. package/docs/en/trusted-dom-sanitizing.md +124 -0
  409. package/docs/en/type-exports.md +61 -0
  410. package/docs/en/typescript-components.md +63 -0
  411. package/docs/en/visual-browser-regression.md +83 -0
  412. package/docs/en/visual-owner-artifacts.md +46 -0
  413. package/docs/en/visual-snapshot-automation.md +87 -0
  414. package/docs/en/xtend-api-types.md +55 -0
  415. package/docs/en/xtend-builder-types.md +55 -0
  416. package/docs/en/xtend-catalog-types.md +44 -0
  417. package/docs/en/xtend-fabric-rmt-lane-mapping.md +143 -0
  418. package/docs/en/xtend-fabric.md +474 -0
  419. package/docs/en/xtend-loader-types.md +58 -0
  420. package/docs/en/xtend-loader.md +265 -0
  421. package/docs/en/xtend-policy-types.md +38 -0
  422. package/docs/en/xtend-rmt-types.md +40 -0
  423. package/docs/en/xtend-vendor-types.md +36 -0
  424. package/docs/en/xtendrmt-app-dsl.md +331 -0
  425. package/docs/en/xtendrmt-migration-guide.md +256 -0
  426. package/docs/en/xtendrmt-native-authoring.md +336 -0
  427. package/docs/en/xtendrmt-overview.md +63 -0
  428. package/docs/en/xtendrmt-parsedown-scheduling.md +301 -0
  429. package/docs/en/xtendrmt-runtime-bridge.md +155 -0
  430. package/docs/enterprise-adoption.md +4 -2
  431. package/docs/epic18-media-manager-vendor-upstream.md +318 -0
  432. package/docs/epic18-rmt-app-platform-release-handoff.md +67 -0
  433. package/docs/epic18-vendor-bugfixes.md +34 -0
  434. package/docs/index.php +1056 -109
  435. package/docs/manifest.md +8 -2
  436. package/docs/menu.json +986 -133
  437. package/docs/package-export-lock.md +2 -2
  438. package/docs/public-component-types.md +2 -2
  439. package/docs/quick-start-guide.md +126 -58
  440. package/docs/rmt-action-effect-runtime.md +101 -0
  441. package/docs/rmt-app-platform-authoring.md +54 -0
  442. package/docs/rmt-app-platform-fixture.md +46 -0
  443. package/docs/rmt-app-platform-migration-guide.md +88 -0
  444. package/docs/rmt-app-platform-tooling.md +79 -0
  445. package/docs/rmt-component-template-primitives.md +57 -0
  446. package/docs/rmt-dom-descriptor-renderer.md +64 -0
  447. package/docs/rmt-dsl-authoring-polish.md +67 -44
  448. package/docs/rmt-event-routing-runtime.md +98 -0
  449. package/docs/rmt-first-demo-app.md +2 -2
  450. package/docs/rmt-first-xtend-apps.md +70 -46
  451. package/docs/rmt-language-server.md +61 -4
  452. package/docs/rmt-lifecycle-demo.md +1 -2
  453. package/docs/rmt-node-ssr-adapter.md +144 -0
  454. package/docs/rmt-php-ssr-adapter.md +158 -0
  455. package/docs/rmt-state-selector-runtime.md +47 -0
  456. package/docs/rmt-surface-resource-graph-runtime.md +92 -0
  457. package/docs/rmt-vnext-authoring.md +128 -18
  458. package/docs/rmt-vnext-component-primitives.md +188 -0
  459. package/docs/rmt-vnext-fabric-bridge-evidence.md +81 -0
  460. package/docs/rmt-vnext-primitive-authoring-tooling.md +247 -0
  461. package/docs/rmt-vnext-primitive-grammar-design.md +289 -0
  462. package/docs/rmt-vnext-primitive-lowering.md +108 -0
  463. package/docs/rmt-vnext-primitive-migration.md +119 -0
  464. package/docs/rmt-vnext-primitive-parser-ast.md +76 -0
  465. package/docs/rmt-vnext-primitive-semantic-graph.md +118 -0
  466. package/docs/rmt-vnext-primitives-compiler-backlog.md +742 -0
  467. package/docs/rmt-vnext-release-handoff.md +14 -0
  468. package/docs/rmt-vnext-source-to-sea-gate.md +629 -0
  469. package/docs/surface-manager-migration-guide.md +34 -6
  470. package/docs/surface-manager-overlay-bridge.md +9 -4
  471. package/docs/surface-manager-rmt-authoring.md +50 -34
  472. package/docs/surface-manager-workbench-fixture.md +1 -2
  473. package/docs/third-party-design-authoring.md +1 -1
  474. package/docs/type-exports.md +3 -3
  475. package/docs/utils/pageloader.js +811 -62
  476. package/docs/visual-browser-regression.md +1 -1
  477. package/docs/xtend-rmt-types.md +3 -2
  478. package/docs/xtendrmt-app-dsl.md +187 -122
  479. package/docs/xtendrmt-docs-shell-vnext.rmt +165 -0
  480. package/docs/xtendrmt-migration-guide.md +48 -17
  481. package/docs/xtendrmt-native-authoring.md +213 -217
  482. package/docs/xtendrmt-overview.md +81 -61
  483. package/docs/xtendrmt-parsedown-scheduling.md +23 -8
  484. package/fabric/package.json +1 -1
  485. package/package.json +684 -21
  486. package/tools/package.json +5 -1
  487. package/tools/rmt-editor/vscode/README.md +72 -5
  488. package/tools/rmt-editor/vscode/XTend-Logo.png +0 -0
  489. package/tools/rmt-editor/vscode/extension.d.ts +33 -0
  490. package/tools/rmt-editor/vscode/extension.js +1816 -7
  491. package/tools/rmt-editor/vscode/language-configuration.json +2 -1
  492. package/tools/rmt-editor/vscode/package.json +193 -2
  493. package/tools/rmt-editor/vscode/snippets/rmt.code-snippets +41 -0
  494. package/tools/rmt-editor/vscode/syntaxes/rmt.tmLanguage.json +103 -1
  495. package/tools/rmt-editor/vscode/templates/launch.json +70 -0
  496. package/tools/rmt-editor/vscode/templates/tasks.json +172 -0
  497. package/tools/rmt-editor/vscode/xtend-rmt-language-0.0.0-enterprise-readiness.vsix +0 -0
  498. package/tools/rmt-language/app-platform-tooling.d.ts +128 -0
  499. package/tools/rmt-language/app-platform-tooling.js +677 -0
  500. package/tools/rmt-language/completions.d.ts +5 -0
  501. package/tools/rmt-language/completions.js +185 -3
  502. package/tools/rmt-language/diagnostics.js +54 -0
  503. package/tools/rmt-language/hover.js +36 -0
  504. package/tools/rmt-language/rmt-tooling-public-types.d.ts +7 -0
  505. package/tools/rmt-language/rules/app-platform-policy.js +39 -0
  506. package/tools/rmt-language/rules/index.js +5 -1
  507. package/tools/rmt-language/semantic-graph.d.ts +6 -0
  508. package/tools/rmt-language/semantic-graph.js +928 -0
  509. package/tools/rmt-language/snippets/index.js +44 -0
  510. package/tools/rmt-language/snippets/rmt.code-snippets +41 -0
  511. package/tools/rmt-language/vnext-compatibility.d.ts +10 -0
  512. package/tools/rmt-language/vnext-compatibility.js +642 -0
  513. package/tools/rmt-language/vnext-compiler.d.ts +5 -0
  514. package/tools/rmt-language/vnext-compiler.js +863 -17
  515. package/tools/rmt-language/vnext-parser.js +725 -9
  516. package/tools/rmt-language/vnext-release.d.ts +1 -0
  517. package/tools/rmt-language/vnext-release.js +20 -0
  518. package/tools/rmt-language/vnext-source-to-sea.d.ts +33 -0
  519. package/tools/rmt-language/vnext-source-to-sea.js +2227 -0
  520. package/tools/rmt-language/vnext-surfaces.js +111 -52
  521. package/tools/rmt-language/vnext-tooling.d.ts +19 -1
  522. package/tools/rmt-language/vnext-tooling.js +1247 -5
  523. package/tools/rmt-language-server/protocol.js +3 -0
  524. package/tools/rmt-language-server/server.d.ts +2 -0
  525. package/tools/rmt-language-server/server.js +176 -22
  526. package/tools/rmt-linter/cli.d.ts +2 -0
  527. package/tools/rmt-linter/cli.js +62 -0
  528. package/xtend-builder/generators/registry.js +11 -0
  529. package/xtend-builder/generators/rmt-app-platform.js +239 -0
  530. package/xtend-builder/generators/rmt-lifecycle-demo.js +3 -11
  531. package/xtend-builder/lib/cli.js +38 -0
  532. package/xtend-builder/package.json +3 -3
  533. package/xtend-builder/scaffold.config.js +29 -2
  534. package/xtend.css +49 -2
  535. package/xtendrmt/package.json +49 -1
  536. package/xtendrmt/rmt-action-effect-runtime.d.ts +126 -0
  537. package/xtendrmt/rmt-action-effect-runtime.js +494 -0
  538. package/xtendrmt/rmt-component-capability-registry.d.ts +180 -0
  539. package/xtendrmt/rmt-component-capability-registry.js +636 -0
  540. package/xtendrmt/rmt-core.d.ts +6 -0
  541. package/xtendrmt/rmt-core.esm.js +32 -6
  542. package/xtendrmt/rmt-dom-descriptor-renderer.d.ts +107 -0
  543. package/xtendrmt/rmt-dom-descriptor-renderer.js +1066 -0
  544. package/xtendrmt/rmt-event-routing-runtime.d.ts +144 -0
  545. package/xtendrmt/rmt-event-routing-runtime.js +666 -0
  546. package/xtendrmt/rmt-lifecycle-demo.app.js +2 -2
  547. package/xtendrmt/rmt-lifecycle-demo.core.json +4 -0
  548. package/xtendrmt/rmt-lifecycle-demo.rmt-build.app.js +1 -1
  549. package/xtendrmt/rmt-lifecycle-demo.rmt-build.scaffold.json +2 -2
  550. package/xtendrmt/rmt-lifecycle-demo.scaffold.json +4 -4
  551. package/xtendrmt/rmt-native-shell-runtime.d.ts +77 -0
  552. package/xtendrmt/rmt-native-shell-runtime.js +309 -0
  553. package/xtendrmt/rmt-node-ssr-adapter.d.ts +197 -0
  554. package/xtendrmt/rmt-node-ssr-adapter.js +1006 -0
  555. package/xtendrmt/rmt-php-ssr-adapter.php +976 -0
  556. package/xtendrmt/rmt-runtime.browser.js +32 -6
  557. package/xtendrmt/rmt-runtime.esm.js +32 -6
  558. package/xtendrmt/rmt-state-selector-runtime.d.ts +166 -0
  559. package/xtendrmt/rmt-state-selector-runtime.js +866 -0
  560. package/xtendrmt/rmt-surface-resource-graph-runtime.d.ts +224 -0
  561. package/xtendrmt/rmt-surface-resource-graph-runtime.js +932 -0
  562. package/xtendrmt/rmt-vnext-enterprise-mfe-demo.core.json +3 -0
  563. package/xtendrmt/rmt-vnext-reference-demo.core.json +3 -0
  564. package/xtendrmt/xtendrmt-bestcase-demo.core.json +3420 -372
  565. package/xtendrmt/xtendrmt-bestcase-demo.js +424 -8
  566. package/xtendrmt/xtendrmt-bestcase-demo.rmt +214 -6
@@ -80,8 +80,17 @@ const LIFECYCLE_OPERATIONS = new Set([
80
80
  'reattach'
81
81
  ]);
82
82
 
83
- const SOURCE_KINDS = new Set(['endpoint', 'sse', 'worker']);
83
+ const SOURCE_KINDS = new Set(['endpoint', 'sse', 'worker', 'selector', 'state', 'datasource', 'fixture', 'resource']);
84
84
  const COMPARISON_OPERATORS = new Set(['==', '!=', '>', '>=', '<', '<=']);
85
+ const PRIMITIVE_DECLARATIONS = new Set([
86
+ 'state',
87
+ 'selector',
88
+ 'datasource',
89
+ 'action',
90
+ 'portal',
91
+ 'overlay',
92
+ 'resource'
93
+ ]);
85
94
 
86
95
  function normalizeSourceInput(input = {}, options = {}) {
87
96
  if (typeof input === 'string') {
@@ -283,7 +292,7 @@ function tokenizeVNextSource(sourceModel) {
283
292
  continue;
284
293
  }
285
294
 
286
- if ('{}().;!<>'.includes(character)) {
295
+ if ('{}().;!<>[]=,:[]'.includes(character)) {
287
296
  index += 1;
288
297
  tokens.push(createToken('symbol', character, start, index));
289
298
  continue;
@@ -398,6 +407,8 @@ class VNextParser {
398
407
  body.push(this.parseRemoteSurfaceDeclaration());
399
408
  } else if (this.matches('surface')) {
400
409
  body.push(this.parseSurfaceDeclaration(null));
410
+ } else if (this.isPrimitiveDeclarationStart()) {
411
+ body.push(this.parsePrimitiveDeclaration({ topLevel: true }));
401
412
  } else if (LIFECYCLE_OPERATIONS.has(this.current().value) || this.matches('stream')) {
402
413
  this.addDiagnostic(this.current(), 'Lifecycle and stream statements must be inside a lane or slot.', RMT_VNEXT_CONTEXT_ERROR_CODE);
403
414
  this.skipStatementOrBlock();
@@ -463,7 +474,10 @@ class VNextParser {
463
474
  if (this.matches('surface')) {
464
475
  return this.parseSurfaceDeclaration(name && name.value);
465
476
  }
466
- this.addDiagnostic(this.current(), 'Templates may contain imports and surfaces only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
477
+ if (this.isPrimitiveDeclarationStart()) {
478
+ return this.parsePrimitiveDeclaration({ templateName: name && name.value });
479
+ }
480
+ this.addDiagnostic(this.current(), 'Templates may contain imports, surfaces and App Platform primitives only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
467
481
  this.skipStatementOrBlock();
468
482
  return null;
469
483
  });
@@ -479,11 +493,17 @@ class VNextParser {
479
493
  parseSurfaceDeclaration(templateName) {
480
494
  const start = this.expectValue('surface', 'Expected surface declaration.');
481
495
  const name = this.parseQualifiedIdentifier('Expected surface identifier.');
496
+ const metadata = this.parseSurfaceHeaderMetadata();
482
497
  const body = this.parseBlock(() => {
483
498
  if (this.matches('lane')) {
484
499
  return this.parseLaneDeclaration(templateName, name && name.value);
485
500
  }
486
- this.addDiagnostic(this.current(), 'Surfaces may contain lanes only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
501
+ if (this.matches('on')) {
502
+ return this.parseEventBinding();
503
+ }
504
+ const item = this.parseSurfacePrimitiveItem();
505
+ if (item) return item;
506
+ this.addDiagnostic(this.current(), 'Surfaces may contain lanes, event bindings and surface primitive clauses only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
487
507
  this.skipStatementOrBlock();
488
508
  return null;
489
509
  });
@@ -492,10 +512,647 @@ class VNextParser {
492
512
  return this.createNode('RmtSurfaceDeclaration', start, end, {
493
513
  name: name && name.value,
494
514
  nameNode: name,
515
+ metadata,
495
516
  body: body.items
496
517
  });
497
518
  }
498
519
 
520
+ isPrimitiveDeclarationStart() {
521
+ return PRIMITIVE_DECLARATIONS.has(this.current().value);
522
+ }
523
+
524
+ parsePrimitiveDeclaration(scope = {}) {
525
+ if (this.matches('state')) return this.parseStateDeclaration(scope);
526
+ if (this.matches('selector')) return this.parseSelectorDeclaration(scope);
527
+ if (this.matches('datasource')) return this.parseDataSourceDeclaration(scope);
528
+ if (this.matches('action')) return this.parseActionDeclaration(scope);
529
+ if (this.matches('portal')) return this.parsePortalDeclaration(scope);
530
+ if (this.matches('overlay')) return this.parseOverlayDeclaration(scope);
531
+ if (this.matches('resource')) return this.parseResourceDeclaration(scope);
532
+ this.addDiagnostic(this.current(), 'Expected App Platform primitive declaration.', RMT_VNEXT_CONTEXT_ERROR_CODE);
533
+ this.skipStatementOrBlock();
534
+ return null;
535
+ }
536
+
537
+ parseStateDeclaration(scope = {}) {
538
+ const start = this.expectValue('state', 'Expected state declaration.');
539
+ const name = this.parseQualifiedIdentifierAllowReserved('Expected state identifier.');
540
+ const fields = [];
541
+ let dataType = null;
542
+ let initial = null;
543
+ let preserve = false;
544
+
545
+ while (!this.isAtEnd() && !this.matches('{') && !this.isStatementBoundary()) {
546
+ if (this.matches('type')) {
547
+ this.consume();
548
+ dataType = this.parseTypeReference('Expected state type.', ['initial', 'preserve']);
549
+ } else if (this.matches('initial')) {
550
+ this.consume();
551
+ initial = this.parsePrimitiveValue();
552
+ } else if (this.matches('preserve')) {
553
+ preserve = true;
554
+ this.consume();
555
+ } else {
556
+ this.addDiagnostic(this.current(), 'State declarations may contain type, initial and preserve clauses only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
557
+ this.consume();
558
+ }
559
+ }
560
+
561
+ if (this.matches('{')) {
562
+ const body = this.parseBlock(() => {
563
+ if (this.matches('initial')) return this.parseInitialBlock();
564
+ this.addDiagnostic(this.current(), 'State blocks may contain initial blocks only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
565
+ this.skipStatementOrBlock();
566
+ return null;
567
+ });
568
+ fields.push(...body.items);
569
+ this.consumeOptionalStatementEnd();
570
+ const end = body.endToken || this.previous();
571
+ return this.createNode('RmtStateDeclaration', start, end, {
572
+ name: name && name.value,
573
+ nameNode: name,
574
+ dataType,
575
+ initial,
576
+ preserve,
577
+ body: fields,
578
+ scope
579
+ });
580
+ }
581
+
582
+ this.consumeStatementEnd('Expected statement end after state declaration.');
583
+ const end = this.previous();
584
+ return this.createNode('RmtStateDeclaration', start, end, {
585
+ name: name && name.value,
586
+ nameNode: name,
587
+ dataType,
588
+ initial,
589
+ preserve,
590
+ body: fields,
591
+ scope
592
+ });
593
+ }
594
+
595
+ parseInitialBlock() {
596
+ const start = this.expectValue('initial', 'Expected initial block.');
597
+ const body = this.parseBlock(() => {
598
+ const key = this.parseQualifiedIdentifierAllowReserved('Expected initial value key.');
599
+ const value = this.parsePrimitiveValue();
600
+ this.consumeStatementEnd('Expected statement end after initial value.');
601
+ const end = value ? getNodeEndToken(value) : this.previous();
602
+ return this.createNode('RmtInitialValueEntry', key && key.startToken, end, {
603
+ key: key && key.value,
604
+ keyNode: key,
605
+ value
606
+ });
607
+ });
608
+ const end = body.endToken || this.previous();
609
+ return this.createNode('RmtInitialBlock', start, end, {
610
+ body: body.items
611
+ });
612
+ }
613
+
614
+ parseSelectorDeclaration(scope = {}) {
615
+ const start = this.expectValue('selector', 'Expected selector declaration.');
616
+ const name = this.parseQualifiedIdentifierAllowReserved('Expected selector identifier.');
617
+ const source = this.matches('from') ? this.parsePrimitiveSourceReference() : null;
618
+ const body = this.parseBlock(() => {
619
+ if (this.matches('where')) return this.parseRawPrimitiveClause('where', 'RmtSelectorWhereClause');
620
+ if (this.matches('find')) return this.parseRawPrimitiveClause('find', 'RmtSelectorFindClause');
621
+ if (this.matches('sort')) return this.parseSelectorSortClause();
622
+ if (this.matches('output')) return this.parseOutputClause();
623
+ this.addDiagnostic(this.current(), 'Selector blocks may contain where, find, sort and output clauses only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
624
+ this.skipStatementOrBlock();
625
+ return null;
626
+ });
627
+ const end = body.endToken || this.previous();
628
+ return this.createNode('RmtSelectorDeclaration', start, end, {
629
+ name: name && name.value,
630
+ nameNode: name,
631
+ source,
632
+ body: body.items,
633
+ scope
634
+ });
635
+ }
636
+
637
+ parseDataSourceDeclaration(scope = {}) {
638
+ const start = this.expectValue('datasource', 'Expected datasource declaration.');
639
+ const name = this.parseQualifiedIdentifierAllowReserved('Expected datasource identifier.');
640
+ const source = this.matches('from') ? this.parsePrimitiveSourceReference() : null;
641
+ const body = this.parseBlock(() => {
642
+ if (this.matches('method')) return this.parseKeywordValueClause('method', 'RmtDataSourceMethodClause');
643
+ if (this.matches('contract')) return this.parseKeywordValueClause('contract', 'RmtDataSourceContractClause');
644
+ if (this.matches('result')) return this.parseKeywordValueClause('result', 'RmtDataSourceResultClause');
645
+ if (this.matches('fallback')) return this.parseFallbackClause();
646
+ this.addDiagnostic(this.current(), 'DataSource blocks may contain method, contract, result and fallback clauses only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
647
+ this.skipStatementOrBlock();
648
+ return null;
649
+ });
650
+ const end = body.endToken || this.previous();
651
+ return this.createNode('RmtDataSourceDeclaration', start, end, {
652
+ name: name && name.value,
653
+ nameNode: name,
654
+ source,
655
+ body: body.items,
656
+ scope
657
+ });
658
+ }
659
+
660
+ parseActionDeclaration(scope = {}) {
661
+ const start = this.expectValue('action', 'Expected action declaration.');
662
+ const name = this.parseQualifiedIdentifierAllowReserved('Expected action identifier.');
663
+ const body = this.parseBlock(() => {
664
+ if (this.matches('input')) return this.parseActionInputClause();
665
+ if (this.matches('status')) return this.parseKeywordPathClause('status', 'RmtActionStatusClause');
666
+ if (this.matches('effect')) return this.parseActionEffectStatement();
667
+ if (this.matches('reduce')) return this.parseReduceStatement();
668
+ if (this.matches('emit')) return this.parseEmitStatement();
669
+ if (this.matches('on')) return this.parseActionResultHandler();
670
+ this.addDiagnostic(this.current(), 'Action blocks may contain input, status, effect, reduce, emit and result handlers only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
671
+ this.skipStatementOrBlock();
672
+ return null;
673
+ });
674
+ const end = body.endToken || this.previous();
675
+ return this.createNode('RmtActionDeclaration', start, end, {
676
+ name: name && name.value,
677
+ nameNode: name,
678
+ body: body.items,
679
+ scope
680
+ });
681
+ }
682
+
683
+ parsePortalDeclaration(scope = {}) {
684
+ const start = this.expectValue('portal', 'Expected portal declaration.');
685
+ const name = this.parseQualifiedIdentifierAllowReserved('Expected portal identifier.');
686
+ const attributes = this.parseInlinePrimitiveAttributes(['root', 'layer', 'z']);
687
+ const body = this.matches('{') ? this.parseGenericPrimitiveBlock('RmtPortalPolicyClause') : { items: [], endToken: null };
688
+ if (!body.endToken) this.consumeStatementEnd('Expected statement end after portal declaration.');
689
+ else this.consumeOptionalStatementEnd();
690
+ const end = body.endToken || this.previous();
691
+ return this.createNode('RmtPortalDeclaration', start, end, {
692
+ name: name && name.value,
693
+ nameNode: name,
694
+ attributes,
695
+ body: body.items,
696
+ scope
697
+ });
698
+ }
699
+
700
+ parseOverlayDeclaration(scope = {}) {
701
+ const start = this.expectValue('overlay', 'Expected overlay declaration.');
702
+ const name = this.parseQualifiedIdentifierAllowReserved('Expected overlay identifier.');
703
+ const attributes = this.parseInlinePrimitiveAttributes(['kind', 'portal']);
704
+ const body = this.matches('{') ? this.parseGenericPrimitiveBlock('RmtOverlayPolicyClause') : { items: [], endToken: null };
705
+ if (!body.endToken) this.consumeStatementEnd('Expected statement end after overlay declaration.');
706
+ else this.consumeOptionalStatementEnd();
707
+ const end = body.endToken || this.previous();
708
+ return this.createNode('RmtOverlayDeclaration', start, end, {
709
+ name: name && name.value,
710
+ nameNode: name,
711
+ attributes,
712
+ body: body.items,
713
+ scope
714
+ });
715
+ }
716
+
717
+ parseResourceDeclaration(scope = {}) {
718
+ const start = this.expectValue('resource', 'Expected resource declaration.');
719
+ const name = this.parseQualifiedIdentifierAllowReserved('Expected resource identifier.');
720
+ const attributes = this.parseInlinePrimitiveAttributes(['kind', 'owner', 'source']);
721
+ const body = this.matches('{') ? this.parseResourceBlock() : { items: [], endToken: null };
722
+ if (!body.endToken) this.consumeStatementEnd('Expected statement end after resource declaration.');
723
+ else this.consumeOptionalStatementEnd();
724
+ const end = body.endToken || this.previous();
725
+ return this.createNode('RmtResourceDeclaration', start, end, {
726
+ name: name && name.value,
727
+ nameNode: name,
728
+ attributes,
729
+ body: body.items,
730
+ scope
731
+ });
732
+ }
733
+
734
+ parseSurfaceHeaderMetadata() {
735
+ const attributes = [];
736
+ while (!this.isAtEnd() && !this.matches('{') && !this.isStatementBoundary()) {
737
+ if (['kind', 'component'].includes(this.current().value)) {
738
+ attributes.push(this.parseInlineAttribute(this.current().value, 'RmtSurfaceHeaderClause'));
739
+ } else {
740
+ this.addDiagnostic(this.current(), 'Surface headers may contain kind and component clauses before the body.', RMT_VNEXT_CONTEXT_ERROR_CODE);
741
+ this.consume();
742
+ }
743
+ }
744
+ return attributes;
745
+ }
746
+
747
+ parseSurfacePrimitiveItem() {
748
+ if (this.matches('source')) return this.parsePrimitiveReferenceClause('source', 'RmtSurfaceSourceClause');
749
+ if (this.matches('repeat')) return this.parseRepeatClause();
750
+ if (this.matches('key')) return this.parseKeywordPathClause('key', 'RmtSurfaceKeyClause');
751
+ if (this.matches('portal')) return this.parseKeywordPathClause('portal', 'RmtSurfacePortalClause');
752
+ if (this.matches('bounds')) return this.parseBoundsClause();
753
+ if (this.matches('preserve')) return this.parseRawPrimitiveClause('preserve', 'RmtSurfacePreserveClause');
754
+ if (this.matches('destroy')) return this.parseRawPrimitiveClause('destroy', 'RmtSurfaceDestroyClause');
755
+ return null;
756
+ }
757
+
758
+ isStatementBoundary() {
759
+ const token = this.current();
760
+ return token.type === 'newline' || token.value === ';' || token.value === '}' || token.type === 'eof';
761
+ }
762
+
763
+ tokenText(token) {
764
+ if (!token) return '';
765
+ if (token.raw) return token.raw;
766
+ if (token.type === 'string') return JSON.stringify(token.value);
767
+ return String(token.value);
768
+ }
769
+
770
+ rawTextFromTokens(tokens) {
771
+ if (!tokens || tokens.length === 0) return '';
772
+ const start = tokens[0].startOffset;
773
+ const end = tokens[tokens.length - 1].endOffset;
774
+ return this.sourceModel.text.slice(start, end).trim();
775
+ }
776
+
777
+ collectTokensUntilStatementEnd(options = {}) {
778
+ const stopValues = new Set(options.stopValues || []);
779
+ const tokens = [];
780
+ let parenDepth = 0;
781
+ let bracketDepth = 0;
782
+
783
+ while (!this.isAtEnd()) {
784
+ const token = this.current();
785
+ if (parenDepth === 0 && bracketDepth === 0 && (this.isStatementBoundary() || stopValues.has(token.value))) {
786
+ break;
787
+ }
788
+ if (token.value === '(') parenDepth += 1;
789
+ if (token.value === ')') parenDepth = Math.max(0, parenDepth - 1);
790
+ if (token.value === '[') bracketDepth += 1;
791
+ if (token.value === ']') bracketDepth = Math.max(0, bracketDepth - 1);
792
+ tokens.push(this.consume());
793
+ }
794
+
795
+ return tokens;
796
+ }
797
+
798
+ parseTypeReference(message, stopValues = []) {
799
+ const start = this.current();
800
+ const tokens = this.collectTokensUntilStatementEnd({ stopValues });
801
+ if (tokens.length === 0) {
802
+ this.addDiagnostic(start, message || 'Expected type reference.');
803
+ return null;
804
+ }
805
+ const end = tokens[tokens.length - 1];
806
+ return this.createNode('RmtTypeReference', tokens[0], end, {
807
+ value: this.rawTextFromTokens(tokens),
808
+ tokens: tokens.map((token) => this.tokenText(token))
809
+ });
810
+ }
811
+
812
+ parsePrimitiveValue() {
813
+ const token = this.current();
814
+ if (token.type === 'string' || token.type === 'integer' || token.value === 'true' || token.value === 'false' || token.value === 'null') {
815
+ this.consume();
816
+ let value = token.value;
817
+ if (token.value === 'true') value = true;
818
+ if (token.value === 'false') value = false;
819
+ if (token.value === 'null') value = null;
820
+ return this.createNode('RmtPrimitiveValue', token, token, {
821
+ kind: 'literal',
822
+ value
823
+ });
824
+ }
825
+
826
+ if (token.value === '[') {
827
+ const start = this.consume();
828
+ const items = [];
829
+ while (!this.isAtEnd() && !this.matches(']')) {
830
+ if (this.matches(',')) {
831
+ this.consume();
832
+ } else {
833
+ items.push(this.parsePrimitiveValue());
834
+ }
835
+ }
836
+ const end = this.expectValue(']', 'Expected closing bracket for array literal.') || this.previous();
837
+ return this.createNode('RmtPrimitiveValue', start, end, {
838
+ kind: 'array',
839
+ items
840
+ });
841
+ }
842
+
843
+ if (token.type === 'identifier') {
844
+ const path = this.parseQualifiedIdentifierAllowReserved('Expected value.');
845
+ return this.createNode('RmtPrimitiveValue', path.startToken, path.endToken, {
846
+ kind: 'path',
847
+ value: path.value,
848
+ path: path.parts,
849
+ pathNode: path
850
+ });
851
+ }
852
+
853
+ this.addDiagnostic(token, 'Expected primitive value.');
854
+ this.consume();
855
+ return this.createNode('RmtPrimitiveValue', token, token, {
856
+ kind: 'missing',
857
+ value: null
858
+ });
859
+ }
860
+
861
+ parsePrimitiveSourceReference() {
862
+ const start = this.expectValue('from', 'Expected from clause.');
863
+ const kindToken = this.current();
864
+ let kind = null;
865
+ if (kindToken.type === 'identifier') {
866
+ kind = kindToken.value;
867
+ this.consume();
868
+ } else {
869
+ this.addDiagnostic(kindToken, 'Expected source kind.');
870
+ this.consume();
871
+ }
872
+
873
+ const valueToken = this.current();
874
+ let value = null;
875
+ let valueNode = null;
876
+ if (valueToken.type === 'string') {
877
+ value = valueToken.value;
878
+ valueNode = this.createNode('RmtPrimitiveValue', valueToken, valueToken, { kind: 'literal', value });
879
+ this.consume();
880
+ } else {
881
+ valueNode = this.parseQualifiedIdentifierAllowReserved('Expected source reference.');
882
+ value = valueNode && valueNode.value;
883
+ }
884
+
885
+ const end = valueNode && (valueNode.endToken || getNodeEndToken(valueNode)) || this.previous();
886
+ return this.createNode('RmtPrimitiveSourceReference', start, end, {
887
+ kind,
888
+ value,
889
+ valueNode
890
+ });
891
+ }
892
+
893
+ parseRawPrimitiveClause(keyword, nodeType) {
894
+ const start = this.expectValue(keyword, `Expected ${keyword} clause.`);
895
+ const tokens = this.collectTokensUntilStatementEnd();
896
+ this.consumeStatementEnd(`Expected statement end after ${keyword} clause.`);
897
+ const end = tokens.length > 0 ? tokens[tokens.length - 1] : this.previous();
898
+ return this.createNode(nodeType, start, end, {
899
+ keyword,
900
+ text: this.rawTextFromTokens(tokens),
901
+ tokens: tokens.map((token) => this.tokenText(token))
902
+ });
903
+ }
904
+
905
+ parseSelectorSortClause() {
906
+ const start = this.expectValue('sort', 'Expected sort clause.');
907
+ let by = null;
908
+ if (this.matches('by')) {
909
+ this.consume();
910
+ by = this.parseQualifiedIdentifierAllowReserved('Expected sort path.');
911
+ }
912
+ let direction = null;
913
+ if (!this.isStatementBoundary()) {
914
+ direction = this.current().value;
915
+ this.consume();
916
+ }
917
+ this.consumeStatementEnd('Expected statement end after sort clause.');
918
+ const end = this.previous();
919
+ return this.createNode('RmtSelectorSortClause', start, end, {
920
+ by: by && by.value,
921
+ byNode: by,
922
+ direction
923
+ });
924
+ }
925
+
926
+ parseOutputClause() {
927
+ const start = this.expectValue('output', 'Expected output clause.');
928
+ const dataType = this.parseTypeReference('Expected output type.');
929
+ this.consumeStatementEnd('Expected statement end after output clause.');
930
+ const end = dataType ? getNodeEndToken(dataType) : this.previous();
931
+ return this.createNode('RmtSelectorOutputClause', start, end, {
932
+ dataType
933
+ });
934
+ }
935
+
936
+ parseKeywordValueClause(keyword, nodeType) {
937
+ const start = this.expectValue(keyword, `Expected ${keyword} clause.`);
938
+ const value = this.parsePrimitiveValue();
939
+ this.consumeStatementEnd(`Expected statement end after ${keyword} clause.`);
940
+ const end = value ? getNodeEndToken(value) : this.previous();
941
+ return this.createNode(nodeType, start, end, {
942
+ keyword,
943
+ value
944
+ });
945
+ }
946
+
947
+ parseInlineAttribute(keyword, nodeType) {
948
+ const start = this.expectValue(keyword, `Expected ${keyword} attribute.`);
949
+ const value = this.parsePrimitiveValue();
950
+ const end = value ? getNodeEndToken(value) : this.previous();
951
+ return this.createNode(nodeType, start, end, {
952
+ keyword,
953
+ value
954
+ });
955
+ }
956
+
957
+ parseKeywordPathClause(keyword, nodeType) {
958
+ const start = this.expectValue(keyword, `Expected ${keyword} clause.`);
959
+ const path = this.parseQualifiedIdentifierAllowReserved(`Expected ${keyword} path.`);
960
+ this.consumeStatementEnd(`Expected statement end after ${keyword} clause.`);
961
+ const end = path && path.endToken ? path.endToken : this.previous();
962
+ return this.createNode(nodeType, start, end, {
963
+ keyword,
964
+ path: path && path.value,
965
+ pathNode: path
966
+ });
967
+ }
968
+
969
+ parseFallbackClause() {
970
+ const start = this.expectValue('fallback', 'Expected fallback clause.');
971
+ const kind = this.current().type === 'identifier' ? this.consume() : null;
972
+ const value = this.parseQualifiedIdentifierAllowReserved('Expected fallback reference.');
973
+ this.consumeStatementEnd('Expected statement end after fallback clause.');
974
+ const end = value && value.endToken ? value.endToken : this.previous();
975
+ return this.createNode('RmtDataSourceFallbackClause', start, end, {
976
+ kind: kind && kind.value,
977
+ value: value && value.value,
978
+ valueNode: value
979
+ });
980
+ }
981
+
982
+ parseActionInputClause() {
983
+ const start = this.expectValue('input', 'Expected input clause.');
984
+ const name = this.parseQualifiedIdentifierAllowReserved('Expected input identifier.');
985
+ const dataType = this.parseTypeReference('Expected input type.');
986
+ this.consumeStatementEnd('Expected statement end after input clause.');
987
+ const end = dataType ? getNodeEndToken(dataType) : this.previous();
988
+ return this.createNode('RmtActionInputClause', start, end, {
989
+ name: name && name.value,
990
+ nameNode: name,
991
+ dataType
992
+ });
993
+ }
994
+
995
+ parseActionEffectStatement() {
996
+ const start = this.expectValue('effect', 'Expected effect statement.');
997
+ const effectKind = this.current().type === 'identifier' ? this.consume() : null;
998
+ let source = null;
999
+ if (this.matches('datasource') || this.matches('resource') || this.matches('selector')) {
1000
+ const sourceKind = this.consume();
1001
+ const sourceRef = this.parseQualifiedIdentifierAllowReserved('Expected effect source reference.');
1002
+ source = {
1003
+ kind: sourceKind.value,
1004
+ value: sourceRef && sourceRef.value,
1005
+ valueNode: sourceRef
1006
+ };
1007
+ }
1008
+ this.consumeStatementEnd('Expected statement end after effect statement.');
1009
+ const end = this.previous();
1010
+ return this.createNode('RmtEffectStatement', start, end, {
1011
+ effectKind: effectKind && effectKind.value,
1012
+ source
1013
+ });
1014
+ }
1015
+
1016
+ parseReduceStatement() {
1017
+ const start = this.expectValue('reduce', 'Expected reduce statement.');
1018
+ const target = this.parseQualifiedIdentifierAllowReserved('Expected reducer target.');
1019
+ this.expectValue('=', 'Expected = in reduce statement.');
1020
+ const expressionTokens = this.collectTokensUntilStatementEnd();
1021
+ this.consumeStatementEnd('Expected statement end after reduce statement.');
1022
+ const end = expressionTokens.length > 0 ? expressionTokens[expressionTokens.length - 1] : this.previous();
1023
+ return this.createNode('RmtReducerStatement', start, end, {
1024
+ target: target && target.value,
1025
+ targetNode: target,
1026
+ expression: this.rawTextFromTokens(expressionTokens),
1027
+ expressionTokens: expressionTokens.map((token) => this.tokenText(token))
1028
+ });
1029
+ }
1030
+
1031
+ parseEmitStatement() {
1032
+ const start = this.expectValue('emit', 'Expected emit statement.');
1033
+ const event = this.parseQualifiedIdentifierAllowReserved('Expected emitted event identifier.');
1034
+ const payload = [];
1035
+ if (this.matches('with')) {
1036
+ this.consume();
1037
+ while (!this.isStatementBoundary()) {
1038
+ const key = this.parseQualifiedIdentifierAllowReserved('Expected payload key.');
1039
+ const value = this.parsePrimitiveValue();
1040
+ payload.push({
1041
+ key: key && key.value,
1042
+ keyNode: key,
1043
+ value
1044
+ });
1045
+ }
1046
+ }
1047
+ this.consumeStatementEnd('Expected statement end after emit statement.');
1048
+ const end = this.previous();
1049
+ return this.createNode('RmtEmitStatement', start, end, {
1050
+ event: event && event.value,
1051
+ eventNode: event,
1052
+ payload
1053
+ });
1054
+ }
1055
+
1056
+ parseActionResultHandler() {
1057
+ const start = this.expectValue('on', 'Expected action result handler.');
1058
+ const phase = this.parseQualifiedIdentifierAllowReserved('Expected action result phase.');
1059
+ this.expectValue('->', 'Expected -> in action result handler.');
1060
+ const effectTokens = this.collectTokensUntilStatementEnd();
1061
+ this.consumeStatementEnd('Expected statement end after action result handler.');
1062
+ const end = effectTokens.length > 0 ? effectTokens[effectTokens.length - 1] : this.previous();
1063
+ return this.createNode('RmtActionResultHandler', start, end, {
1064
+ phase: phase && phase.value,
1065
+ phaseNode: phase,
1066
+ effect: {
1067
+ kind: effectTokens[0] && effectTokens[0].value || null,
1068
+ text: this.rawTextFromTokens(effectTokens),
1069
+ tokens: effectTokens.map((token) => this.tokenText(token))
1070
+ }
1071
+ });
1072
+ }
1073
+
1074
+ parseInlinePrimitiveAttributes(keywords = []) {
1075
+ const allowed = new Set(keywords);
1076
+ const attributes = [];
1077
+ while (!this.isAtEnd() && !this.matches('{') && !this.isStatementBoundary()) {
1078
+ const keyword = this.current().value;
1079
+ if (allowed.has(keyword)) {
1080
+ attributes.push(this.parseInlineAttribute(keyword, 'RmtPrimitiveAttribute'));
1081
+ } else {
1082
+ this.addDiagnostic(this.current(), `Unexpected inline primitive attribute "${keyword}".`, RMT_VNEXT_CONTEXT_ERROR_CODE);
1083
+ this.consume();
1084
+ }
1085
+ }
1086
+ return attributes;
1087
+ }
1088
+
1089
+ parseGenericPrimitiveBlock(nodeType) {
1090
+ return this.parseBlock(() => {
1091
+ const start = this.current();
1092
+ const tokens = this.collectTokensUntilStatementEnd();
1093
+ this.consumeStatementEnd('Expected statement end after primitive policy clause.');
1094
+ const end = tokens.length > 0 ? tokens[tokens.length - 1] : start;
1095
+ return this.createNode(nodeType, start, end, {
1096
+ text: this.rawTextFromTokens(tokens),
1097
+ tokens: tokens.map((token) => this.tokenText(token))
1098
+ });
1099
+ });
1100
+ }
1101
+
1102
+ parseResourceBlock() {
1103
+ return this.parseBlock(() => {
1104
+ if (this.matches('import')) return this.parseKeywordValueClause('import', 'RmtResourceImportClause');
1105
+ if (this.matches('source')) return this.parsePrimitiveReferenceClause('source', 'RmtResourceSourceClause');
1106
+ if (this.matches('dispose')) return this.parseRawPrimitiveClause('dispose', 'RmtResourceDisposeClause');
1107
+ this.addDiagnostic(this.current(), 'Resource blocks may contain import, source and dispose clauses only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
1108
+ this.skipStatementOrBlock();
1109
+ return null;
1110
+ });
1111
+ }
1112
+
1113
+ parsePrimitiveReferenceClause(keyword, nodeType) {
1114
+ const start = this.expectValue(keyword, `Expected ${keyword} clause.`);
1115
+ const kind = this.current().type === 'identifier' ? this.consume() : null;
1116
+ const ref = this.parseQualifiedIdentifierAllowReserved(`Expected ${keyword} reference.`);
1117
+ this.consumeStatementEnd(`Expected statement end after ${keyword} clause.`);
1118
+ const end = ref && ref.endToken ? ref.endToken : this.previous();
1119
+ return this.createNode(nodeType, start, end, {
1120
+ keyword,
1121
+ kind: kind && kind.value,
1122
+ ref: ref && ref.value,
1123
+ refNode: ref
1124
+ });
1125
+ }
1126
+
1127
+ parseRepeatClause() {
1128
+ const start = this.expectValue('repeat', 'Expected repeat clause.');
1129
+ const source = this.matches('from') ? this.parsePrimitiveSourceReference() : null;
1130
+ this.consumeStatementEnd('Expected statement end after repeat clause.');
1131
+ const end = source ? getNodeEndToken(source) : this.previous();
1132
+ return this.createNode('RmtSurfaceRepeatClause', start, end, {
1133
+ source
1134
+ });
1135
+ }
1136
+
1137
+ parseBoundsClause() {
1138
+ const start = this.expectValue('bounds', 'Expected bounds clause.');
1139
+ const fields = [];
1140
+ while (!this.isStatementBoundary()) {
1141
+ const key = this.parseQualifiedIdentifierAllowReserved('Expected bounds key.');
1142
+ const value = this.parsePrimitiveValue();
1143
+ fields.push({
1144
+ key: key && key.value,
1145
+ keyNode: key,
1146
+ value
1147
+ });
1148
+ }
1149
+ this.consumeStatementEnd('Expected statement end after bounds clause.');
1150
+ const end = this.previous();
1151
+ return this.createNode('RmtSurfaceBoundsClause', start, end, {
1152
+ fields
1153
+ });
1154
+ }
1155
+
499
1156
  parseRemoteSurfaceDeclaration() {
500
1157
  const start = this.expectValue('remote', 'Expected remote surface declaration.');
501
1158
  this.expectValue('surface', 'Expected surface keyword after remote.');
@@ -1042,19 +1699,78 @@ class VNextParser {
1042
1699
  parseEventBinding() {
1043
1700
  const start = this.expectValue('on', 'Expected event binding.');
1044
1701
  const event = this.parseQualifiedIdentifier('Expected event identifier.');
1702
+ let selector = null;
1703
+ let target = null;
1704
+ if (this.current().type === 'string') {
1705
+ const selectorToken = this.consume();
1706
+ selector = this.createNode('RmtEventSelector', selectorToken, selectorToken, {
1707
+ value: selectorToken.value
1708
+ });
1709
+ }
1710
+ if (this.matches('target')) {
1711
+ this.consume();
1712
+ target = this.parseQualifiedIdentifierAllowReserved('Expected event target.');
1713
+ }
1045
1714
  this.expectValue('->', 'Expected -> in event binding.');
1046
1715
  this.expectValue('action', 'Expected action keyword in event binding.');
1047
1716
  const action = this.parseQualifiedIdentifier('Expected action identifier.');
1048
1717
  const condition = this.matches('when') ? this.parseConditionClause() : null;
1049
- this.consumeStatementEnd('Expected statement end after event binding.');
1050
- const end = this.previous();
1718
+ const policy = this.matches('{') ? this.parseEventPayloadBlock() : null;
1719
+ if (!policy) {
1720
+ this.consumeStatementEnd('Expected statement end after event binding.');
1721
+ } else {
1722
+ this.consumeOptionalStatementEnd();
1723
+ }
1724
+ const end = policy ? getNodeEndToken(policy) : this.previous();
1051
1725
 
1052
1726
  return this.createNode('RmtEventBinding', start, end, {
1053
1727
  event: event && event.value,
1054
1728
  eventNode: event,
1729
+ selector,
1730
+ target: target && target.value,
1731
+ targetNode: target,
1055
1732
  action: action && action.value,
1056
1733
  actionNode: action,
1057
- condition
1734
+ condition,
1735
+ policy
1736
+ });
1737
+ }
1738
+
1739
+ parseEventPayloadBlock() {
1740
+ const start = this.expectValue('{', 'Expected event payload block.');
1741
+ const body = [];
1742
+ this.skipSeparators();
1743
+ while (!this.isAtEnd() && !this.matches('}')) {
1744
+ let item = null;
1745
+ if (this.matches('payload')) {
1746
+ item = this.parseEventPayloadMapping();
1747
+ } else if (this.matches('preventDefault')) {
1748
+ item = this.parseKeywordValueClause('preventDefault', 'RmtEventOptionClause');
1749
+ } else {
1750
+ this.addDiagnostic(this.current(), 'Event payload blocks may contain payload and preventDefault clauses only.', RMT_VNEXT_CONTEXT_ERROR_CODE);
1751
+ this.skipStatementOrBlock();
1752
+ }
1753
+ if (item) body.push(item);
1754
+ this.skipSeparators();
1755
+ }
1756
+ const end = this.expectValue('}', 'Expected closing brace for event payload block.') || this.previous();
1757
+ return this.createNode('RmtEventPayloadBlock', start, end, {
1758
+ body
1759
+ });
1760
+ }
1761
+
1762
+ parseEventPayloadMapping() {
1763
+ const start = this.expectValue('payload', 'Expected payload mapping.');
1764
+ const name = this.parseQualifiedIdentifierAllowReserved('Expected payload field name.');
1765
+ this.expectValue('from', 'Expected from in payload mapping.');
1766
+ const source = this.parseQualifiedIdentifierAllowReserved('Expected payload source path.');
1767
+ this.consumeStatementEnd('Expected statement end after payload mapping.');
1768
+ const end = source && source.endToken ? source.endToken : this.previous();
1769
+ return this.createNode('RmtEventPayloadMapping', start, end, {
1770
+ name: name && name.value,
1771
+ nameNode: name,
1772
+ source: source && source.value,
1773
+ sourceNode: source
1058
1774
  });
1059
1775
  }
1060
1776
 
@@ -1312,7 +2028,7 @@ function assignAstPointers(node, pointer = '') {
1312
2028
  node.astPointer = pointer || '/';
1313
2029
  }
1314
2030
 
1315
- ['body'].forEach((key) => {
2031
+ ['body', 'attributes', 'metadata', 'payload', 'fields', 'items'].forEach((key) => {
1316
2032
  const value = node[key];
1317
2033
  if (!Array.isArray(value)) return;
1318
2034
  value.forEach((child, index) => {
@@ -1320,7 +2036,7 @@ function assignAstPointers(node, pointer = '') {
1320
2036
  });
1321
2037
  });
1322
2038
 
1323
- ['source', 'condition', 'policy', 'expression', 'left', 'right', 'argument'].forEach((key) => {
2039
+ ['source', 'condition', 'policy', 'expression', 'left', 'right', 'argument', 'value', 'dataType', 'initial'].forEach((key) => {
1324
2040
  const value = node[key];
1325
2041
  if (value && typeof value === 'object' && value.type) {
1326
2042
  assignAstPointers(value, `${pointer}/${key}`);