@datamoc/mw_games 0.37.0 → 0.38.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 (37) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +26 -0
  3. package/api-surface.json +150 -0
  4. package/dist/mw_games.global.js +4 -4
  5. package/dist/mwl/presentation.d.ts +70 -0
  6. package/dist/mwl/presentation.d.ts.map +1 -0
  7. package/dist/mwl/presentation.js +412 -0
  8. package/dist/mwl/presentation.js.map +1 -0
  9. package/dist/two-d/presentation/MwlPresentation.d.ts +98 -0
  10. package/dist/two-d/presentation/MwlPresentation.d.ts.map +1 -0
  11. package/dist/two-d/presentation/MwlPresentation.js +704 -0
  12. package/dist/two-d/presentation/MwlPresentation.js.map +1 -0
  13. package/dist/two-d/presentation/index.d.ts +3 -0
  14. package/dist/two-d/presentation/index.d.ts.map +1 -0
  15. package/dist/two-d/presentation/index.js +2 -0
  16. package/dist/two-d/presentation/index.js.map +1 -0
  17. package/dist/two-d/ui/Bar.d.ts +3 -1
  18. package/dist/two-d/ui/Bar.d.ts.map +1 -1
  19. package/dist/two-d/ui/Bar.js +5 -0
  20. package/dist/two-d/ui/Bar.js.map +1 -1
  21. package/dist/two-d/ui/Button.d.ts +12 -0
  22. package/dist/two-d/ui/Button.d.ts.map +1 -1
  23. package/dist/two-d/ui/Button.js +16 -4
  24. package/dist/two-d/ui/Button.js.map +1 -1
  25. package/dist/two-d/ui/Window.d.ts +10 -0
  26. package/dist/two-d/ui/Window.d.ts.map +1 -1
  27. package/dist/two-d/ui/Window.js +17 -6
  28. package/dist/two-d/ui/Window.js.map +1 -1
  29. package/dist/two-d/ui/index.d.ts +2 -0
  30. package/dist/two-d/ui/index.d.ts.map +1 -1
  31. package/dist/two-d/ui/index.js.map +1 -1
  32. package/dist/version.d.ts +1 -1
  33. package/dist/version.js +1 -1
  34. package/package.json +16 -1
  35. package/sbom.cdx.json +6 -6
  36. package/tools/verify-scenarios.d.mts +15 -0
  37. package/tools/verify-scenarios.mjs +129 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,30 @@ the public API may still change between minor versions.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.38.0] - 2026-10-14
11
+
12
+ Optional MWL scene and UI composition with its bridge-editor example, the
13
+ all-scenarios browser verifier, instance palette setters, and a powered-by badge
14
+ games can carry on their login screen. Roadmap 393 and 394 move to parked: no
15
+ fixture files for the proprietary groove formats, and the neural humanizer costs
16
+ more than the game use case justifies.
17
+
18
+ ### Added
19
+
20
+ - Optional MWL presentation compiler (`mwl/presentation`) and Pixi runtime
21
+ (`two-d/presentation`): scene layers, camera, reusable UI, responsive layouts, keyed
22
+ collections, typed bindings and biome-selected palette/scenery overrides. The local-file
23
+ bridge-editor example checks keyboard/pointer focus, modal input, cleanup and update cost.
24
+ - `Button.setColors`, `Window.setColors` and `Bar.setBackground` update instance palettes
25
+ without rebuilding widgets.
26
+
27
+ - `mwg-scenarios`: verifies every scenario in one local-file browser page through game-owned
28
+ `SceneControls` steps for entry, bot turns, assertions and cleanup, with bounded execution
29
+ and per-scenario failures.
30
+ - `webpage/assets/powered-by-mwg.svg`: a badge games can copy onto their login screen,
31
+ linked to the framework site, with the snippet in the README's new "Powered by mwg"
32
+ section and the badge itself in the website footer.
33
+
10
34
  ## [0.37.0] - 2026-10-14
11
35
 
12
36
  Fixes and additions from the first outside game built on mwg (Pontifex, on 0.36.0): sounds compose with synthesized tones, two physics modules (matter-js rigid bodies and a deterministic XPBD structure solver), pointer and dropdown widgets, a project scaffold, and the `@datamoc/mwg` short-name package.
package/README.md CHANGED
@@ -496,6 +496,13 @@ real numbers and booleans for scalar values and `_("...")` marking translatable
496
496
  strings. It describes game data and commands while `mwg` remains responsible for
497
497
  execution, rendering, input, audio, and saves. MWL is a new language, not a WML
498
498
  compatibility layer.
499
+ Optional scene and UI composition is available through `@datamoc/mw_games/mwl/presentation`
500
+ (build-time compiler) and `@datamoc/mw_games/two-d/presentation` (Pixi runtime). Compile
501
+ reusable widgets, responsive layouts, keyed lists, semantic palettes and context overrides
502
+ against a TypeScript binding manifest. The game supplies actions, physics and procedural
503
+ adapters. See [the presentation contract](REFERENCE.md#mwl-presentation) and
504
+ `examples/mwl-presentation`; `npm run visual:smoke:presentation` verifies the compiled
505
+ `file://` page, keyboard/pointer input, modal windows, cleanup and update cost.
499
506
  The Wesnoth port can nevertheless use its native `.cfg` files as build inputs:
500
507
  the port-owned WML front end parses them, the adapter converts the supported
501
508
  nodes to MWL, and the normal MWL compiler emits the runtime module.
@@ -592,6 +599,25 @@ The generated data is plain TypeScript and works with the same local-file build
592
599
  pipeline as the rest of the framework. Wesnoth-specific MWL source belongs in
593
600
  the Wesnoth port, not in this framework package.
594
601
 
602
+ ## Powered by mwg
603
+
604
+ Games built with mwg are welcome to carry the badge on their login screen:
605
+
606
+ [![powered by mwg](webpage/assets/powered-by-mwg.svg)](https://datamoc.github.io/mwg/)
607
+
608
+ Copy `webpage/assets/powered-by-mwg.svg` into your own project (a shipped game
609
+ cannot fetch it from here; local-file pages only load their own assets) and link
610
+ it to the framework site. In plain HTML that is:
611
+
612
+ ```html
613
+ <a href="https://datamoc.github.io/mwg/">
614
+ <img src="./powered-by-mwg.svg" alt="powered by mwg" width="196" height="38">
615
+ </a>
616
+ ```
617
+
618
+ A canvas-drawn login screen loads the same file through the asset pipeline and
619
+ opens the URL on click with `window.open('https://datamoc.github.io/mwg/', '_blank')`.
620
+
595
621
  ## Licence and provenance
596
622
 
597
623
  `mwg` is MPL-2.0. Its dependencies are permissive and compatible: PixiJS and Babylon.js are
package/api-surface.json CHANGED
@@ -311,6 +311,12 @@
311
311
  "subpath": ".",
312
312
  "declaringModule": "two-d/ui/Button.d.ts"
313
313
  },
314
+ {
315
+ "name": "ButtonColors",
316
+ "kind": "interface",
317
+ "subpath": ".",
318
+ "declaringModule": "two-d/ui/Button.d.ts"
319
+ },
314
320
  {
315
321
  "name": "ButtonOptions",
316
322
  "kind": "interface",
@@ -3485,6 +3491,12 @@
3485
3491
  "subpath": ".",
3486
3492
  "declaringModule": "two-d/ui/Window.d.ts"
3487
3493
  },
3494
+ {
3495
+ "name": "WindowColors",
3496
+ "kind": "interface",
3497
+ "subpath": ".",
3498
+ "declaringModule": "two-d/ui/Window.d.ts"
3499
+ },
3488
3500
  {
3489
3501
  "name": "WindowOptions",
3490
3502
  "kind": "interface",
@@ -9041,6 +9053,84 @@
9041
9053
  "subpath": "./mwl",
9042
9054
  "declaringModule": "mwl/schema.d.ts"
9043
9055
  },
9056
+ {
9057
+ "name": "CompiledPresentation",
9058
+ "kind": "interface",
9059
+ "subpath": "./mwl/presentation",
9060
+ "declaringModule": "mwl/presentation.d.ts"
9061
+ },
9062
+ {
9063
+ "name": "compilePresentation",
9064
+ "kind": "function",
9065
+ "subpath": "./mwl/presentation",
9066
+ "declaringModule": "mwl/presentation.d.ts"
9067
+ },
9068
+ {
9069
+ "name": "emitPresentationModule",
9070
+ "kind": "function",
9071
+ "subpath": "./mwl/presentation",
9072
+ "declaringModule": "mwl/presentation.d.ts"
9073
+ },
9074
+ {
9075
+ "name": "PresentationCollection",
9076
+ "kind": "interface",
9077
+ "subpath": "./mwl/presentation",
9078
+ "declaringModule": "mwl/presentation.d.ts"
9079
+ },
9080
+ {
9081
+ "name": "PresentationContext",
9082
+ "kind": "interface",
9083
+ "subpath": "./mwl/presentation",
9084
+ "declaringModule": "mwl/presentation.d.ts"
9085
+ },
9086
+ {
9087
+ "name": "PresentationItem",
9088
+ "kind": "type",
9089
+ "subpath": "./mwl/presentation",
9090
+ "declaringModule": "mwl/presentation.d.ts"
9091
+ },
9092
+ {
9093
+ "name": "PresentationManifest",
9094
+ "kind": "interface",
9095
+ "subpath": "./mwl/presentation",
9096
+ "declaringModule": "mwl/presentation.d.ts"
9097
+ },
9098
+ {
9099
+ "name": "PresentationNode",
9100
+ "kind": "interface",
9101
+ "subpath": "./mwl/presentation",
9102
+ "declaringModule": "mwl/presentation.d.ts"
9103
+ },
9104
+ {
9105
+ "name": "PresentationProperties",
9106
+ "kind": "type",
9107
+ "subpath": "./mwl/presentation",
9108
+ "declaringModule": "mwl/presentation.d.ts"
9109
+ },
9110
+ {
9111
+ "name": "PresentationScalarType",
9112
+ "kind": "type",
9113
+ "subpath": "./mwl/presentation",
9114
+ "declaringModule": "mwl/presentation.d.ts"
9115
+ },
9116
+ {
9117
+ "name": "PresentationScene",
9118
+ "kind": "interface",
9119
+ "subpath": "./mwl/presentation",
9120
+ "declaringModule": "mwl/presentation.d.ts"
9121
+ },
9122
+ {
9123
+ "name": "PresentationTheme",
9124
+ "kind": "interface",
9125
+ "subpath": "./mwl/presentation",
9126
+ "declaringModule": "mwl/presentation.d.ts"
9127
+ },
9128
+ {
9129
+ "name": "PresentationValue",
9130
+ "kind": "type",
9131
+ "subpath": "./mwl/presentation",
9132
+ "declaringModule": "mwl/presentation.d.ts"
9133
+ },
9044
9134
  {
9045
9135
  "name": "createPyroeisRuntime",
9046
9136
  "kind": "function",
@@ -10829,6 +10919,12 @@
10829
10919
  "subpath": "./tools/single-file",
10830
10920
  "declaringModule": "tools/single-file.mjs"
10831
10921
  },
10922
+ {
10923
+ "name": "./tools/verify-scenarios",
10924
+ "kind": "tool",
10925
+ "subpath": "./tools/verify-scenarios",
10926
+ "declaringModule": "tools/verify-scenarios.mjs"
10927
+ },
10832
10928
  {
10833
10929
  "name": "./tools/vite",
10834
10930
  "kind": "tool",
@@ -11087,6 +11183,12 @@
11087
11183
  "subpath": "./two-d",
11088
11184
  "declaringModule": "two-d/ui/Button.d.ts"
11089
11185
  },
11186
+ {
11187
+ "name": "ButtonColors",
11188
+ "kind": "interface",
11189
+ "subpath": "./two-d",
11190
+ "declaringModule": "two-d/ui/Button.d.ts"
11191
+ },
11090
11192
  {
11091
11193
  "name": "ButtonOptions",
11092
11194
  "kind": "interface",
@@ -13145,6 +13247,12 @@
13145
13247
  "subpath": "./two-d",
13146
13248
  "declaringModule": "two-d/ui/Window.d.ts"
13147
13249
  },
13250
+ {
13251
+ "name": "WindowColors",
13252
+ "kind": "interface",
13253
+ "subpath": "./two-d",
13254
+ "declaringModule": "two-d/ui/Window.d.ts"
13255
+ },
13148
13256
  {
13149
13257
  "name": "WindowOptions",
13150
13258
  "kind": "interface",
@@ -13271,6 +13379,36 @@
13271
13379
  "subpath": "./two-d/pixi-interop",
13272
13380
  "declaringModule": "two-d/pixi-interop.d.ts"
13273
13381
  },
13382
+ {
13383
+ "name": "MwlPresentation",
13384
+ "kind": "class",
13385
+ "subpath": "./two-d/presentation",
13386
+ "declaringModule": "two-d/presentation/MwlPresentation.d.ts"
13387
+ },
13388
+ {
13389
+ "name": "PresentationAdapter",
13390
+ "kind": "interface",
13391
+ "subpath": "./two-d/presentation",
13392
+ "declaringModule": "two-d/presentation/MwlPresentation.d.ts"
13393
+ },
13394
+ {
13395
+ "name": "PresentationAdapterContext",
13396
+ "kind": "interface",
13397
+ "subpath": "./two-d/presentation",
13398
+ "declaringModule": "two-d/presentation/MwlPresentation.d.ts"
13399
+ },
13400
+ {
13401
+ "name": "PresentationRuntimeOptions",
13402
+ "kind": "interface",
13403
+ "subpath": "./two-d/presentation",
13404
+ "declaringModule": "two-d/presentation/MwlPresentation.d.ts"
13405
+ },
13406
+ {
13407
+ "name": "PresentationState",
13408
+ "kind": "type",
13409
+ "subpath": "./two-d/presentation",
13410
+ "declaringModule": "two-d/presentation/MwlPresentation.d.ts"
13411
+ },
13274
13412
  {
13275
13413
  "name": "ActorAnimationState",
13276
13414
  "kind": "type",
@@ -14639,6 +14777,12 @@
14639
14777
  "subpath": "./two-d/ui",
14640
14778
  "declaringModule": "two-d/ui/Button.d.ts"
14641
14779
  },
14780
+ {
14781
+ "name": "ButtonColors",
14782
+ "kind": "interface",
14783
+ "subpath": "./two-d/ui",
14784
+ "declaringModule": "two-d/ui/Button.d.ts"
14785
+ },
14642
14786
  {
14643
14787
  "name": "ButtonOptions",
14644
14788
  "kind": "interface",
@@ -15575,6 +15719,12 @@
15575
15719
  "subpath": "./two-d/ui",
15576
15720
  "declaringModule": "two-d/ui/Window.d.ts"
15577
15721
  },
15722
+ {
15723
+ "name": "WindowColors",
15724
+ "kind": "interface",
15725
+ "subpath": "./two-d/ui",
15726
+ "declaringModule": "two-d/ui/Window.d.ts"
15727
+ },
15578
15728
  {
15579
15729
  "name": "WindowOptions",
15580
15730
  "kind": "interface",