@datamoc/mw_games 0.37.0 → 0.39.1

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 (113) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +26 -0
  3. package/api-surface.json +650 -2
  4. package/dist/assets/SvgParts.d.ts +31 -0
  5. package/dist/assets/SvgParts.d.ts.map +1 -0
  6. package/dist/assets/SvgParts.js +54 -0
  7. package/dist/assets/SvgParts.js.map +1 -0
  8. package/dist/assets/SvgSource.d.ts +3 -0
  9. package/dist/assets/SvgSource.d.ts.map +1 -0
  10. package/dist/assets/SvgSource.js +22 -0
  11. package/dist/assets/SvgSource.js.map +1 -0
  12. package/dist/assets/index.d.ts +2 -0
  13. package/dist/assets/index.d.ts.map +1 -1
  14. package/dist/assets/index.js +1 -0
  15. package/dist/assets/index.js.map +1 -1
  16. package/dist/assets/svg.d.ts.map +1 -1
  17. package/dist/assets/svg.js +9 -5
  18. package/dist/assets/svg.js.map +1 -1
  19. package/dist/mw_games.global.js +110 -110
  20. package/dist/mwl/presentation.d.ts +70 -0
  21. package/dist/mwl/presentation.d.ts.map +1 -0
  22. package/dist/mwl/presentation.js +419 -0
  23. package/dist/mwl/presentation.js.map +1 -0
  24. package/dist/physics/PhysicsWorld.d.ts +49 -17
  25. package/dist/physics/PhysicsWorld.d.ts.map +1 -1
  26. package/dist/physics/PhysicsWorld.js +297 -59
  27. package/dist/physics/PhysicsWorld.js.map +1 -1
  28. package/dist/physics/XpbdWorld.d.ts +1 -1
  29. package/dist/physics/XpbdWorld.js +1 -1
  30. package/dist/physics/cloth/index.d.ts +98 -0
  31. package/dist/physics/cloth/index.d.ts.map +1 -0
  32. package/dist/physics/cloth/index.js +207 -0
  33. package/dist/physics/cloth/index.js.map +1 -0
  34. package/dist/physics/index.d.ts +4 -0
  35. package/dist/physics/index.d.ts.map +1 -1
  36. package/dist/physics/index.js +2 -0
  37. package/dist/physics/index.js.map +1 -1
  38. package/dist/physics/spring/index.d.ts +90 -0
  39. package/dist/physics/spring/index.d.ts.map +1 -0
  40. package/dist/physics/spring/index.js +97 -0
  41. package/dist/physics/spring/index.js.map +1 -0
  42. package/dist/skeleton/index.d.ts +94 -13
  43. package/dist/skeleton/index.d.ts.map +1 -1
  44. package/dist/skeleton/index.js +192 -73
  45. package/dist/skeleton/index.js.map +1 -1
  46. package/dist/two-d/presentation/MwlPresentation.d.ts +110 -0
  47. package/dist/two-d/presentation/MwlPresentation.d.ts.map +1 -0
  48. package/dist/two-d/presentation/MwlPresentation.js +755 -0
  49. package/dist/two-d/presentation/MwlPresentation.js.map +1 -0
  50. package/dist/two-d/presentation/index.d.ts +3 -0
  51. package/dist/two-d/presentation/index.d.ts.map +1 -0
  52. package/dist/two-d/presentation/index.js +2 -0
  53. package/dist/two-d/presentation/index.js.map +1 -0
  54. package/dist/two-d/render/ClothSprite.d.ts +83 -0
  55. package/dist/two-d/render/ClothSprite.d.ts.map +1 -0
  56. package/dist/two-d/render/ClothSprite.js +105 -0
  57. package/dist/two-d/render/ClothSprite.js.map +1 -0
  58. package/dist/two-d/render/HazeLayer.d.ts +112 -0
  59. package/dist/two-d/render/HazeLayer.d.ts.map +1 -0
  60. package/dist/two-d/render/HazeLayer.js +185 -0
  61. package/dist/two-d/render/HazeLayer.js.map +1 -0
  62. package/dist/two-d/render/NeonGlow.d.ts +100 -0
  63. package/dist/two-d/render/NeonGlow.d.ts.map +1 -0
  64. package/dist/two-d/render/NeonGlow.js +183 -0
  65. package/dist/two-d/render/NeonGlow.js.map +1 -0
  66. package/dist/two-d/render/SkeletalSprite.d.ts +5 -2
  67. package/dist/two-d/render/SkeletalSprite.d.ts.map +1 -1
  68. package/dist/two-d/render/SkeletalSprite.js +27 -3
  69. package/dist/two-d/render/SkeletalSprite.js.map +1 -1
  70. package/dist/two-d/render/SpringSprite.d.ts +40 -0
  71. package/dist/two-d/render/SpringSprite.d.ts.map +1 -0
  72. package/dist/two-d/render/SpringSprite.js +39 -0
  73. package/dist/two-d/render/SpringSprite.js.map +1 -0
  74. package/dist/two-d/render/SpriteDeform.d.ts +156 -0
  75. package/dist/two-d/render/SpriteDeform.d.ts.map +1 -0
  76. package/dist/two-d/render/SpriteDeform.js +278 -0
  77. package/dist/two-d/render/SpriteDeform.js.map +1 -0
  78. package/dist/two-d/render/SvgSkeleton.d.ts +54 -0
  79. package/dist/two-d/render/SvgSkeleton.d.ts.map +1 -0
  80. package/dist/two-d/render/SvgSkeleton.js +112 -0
  81. package/dist/two-d/render/SvgSkeleton.js.map +1 -0
  82. package/dist/two-d/render/index.d.ts +12 -0
  83. package/dist/two-d/render/index.d.ts.map +1 -1
  84. package/dist/two-d/render/index.js +6 -0
  85. package/dist/two-d/render/index.js.map +1 -1
  86. package/dist/two-d/ui/Bar.d.ts +3 -1
  87. package/dist/two-d/ui/Bar.d.ts.map +1 -1
  88. package/dist/two-d/ui/Bar.js +5 -0
  89. package/dist/two-d/ui/Bar.js.map +1 -1
  90. package/dist/two-d/ui/Button.d.ts +12 -0
  91. package/dist/two-d/ui/Button.d.ts.map +1 -1
  92. package/dist/two-d/ui/Button.js +16 -4
  93. package/dist/two-d/ui/Button.js.map +1 -1
  94. package/dist/two-d/ui/Window.d.ts +10 -0
  95. package/dist/two-d/ui/Window.d.ts.map +1 -1
  96. package/dist/two-d/ui/Window.js +17 -6
  97. package/dist/two-d/ui/Window.js.map +1 -1
  98. package/dist/two-d/ui/index.d.ts +2 -0
  99. package/dist/two-d/ui/index.d.ts.map +1 -1
  100. package/dist/two-d/ui/index.js.map +1 -1
  101. package/dist/version.d.ts +1 -1
  102. package/dist/version.js +1 -1
  103. package/package.json +24 -7
  104. package/sbom.cdx.json +6 -58
  105. package/tools/asset-report.d.mts +37 -0
  106. package/tools/asset-report.mjs +157 -0
  107. package/tools/compile-resources.d.mts +2 -0
  108. package/tools/compile-resources.mjs +23 -2
  109. package/tools/emit-page.d.mts +2 -0
  110. package/tools/emit-page.mjs +11 -1
  111. package/tools/verify-scenarios.d.mts +15 -0
  112. package/tools/verify-scenarios.mjs +129 -0
  113. package/tools/vite.mjs +4 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,85 @@ the public API may still change between minor versions.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.39.1] - 2026-10-15
11
+
12
+ Fixes the 0.39.0 publish gate on Linux: the WebP skip-shrink test asserted one
13
+ platform's encoder answer instead of the real guarantee, and failed where sharp
14
+ genuinely shrinks the noise fixture.
15
+
16
+ ### Fixed
17
+
18
+ - The WebP test embeds whichever encoding is smaller and asserts byte-exact output
19
+ with a lossless round-trip either way, instead of assuming the conversion always
20
+ loses on tiny noise.
21
+
22
+ ## [0.39.0] - 2026-10-15
23
+
24
+ The skeleton cluster (two-bone IK, joint limits, full clip channels, diagnostics, SVG
25
+ parts loading), the asset and deformation cluster (pinned deformation, SVG skeletons,
26
+ asset filtering and the embedded assets report), and the effects cluster (cloth, spring,
27
+ haze and neon glow, each with a stated frame budget and reduced-motion handling).
28
+ `PhysicsWorld` leaves `matter-js` behind for an in-repo solver, so the dependency is gone.
29
+
30
+ ### Added
31
+
32
+ - Pinned sprite deformation with atomic vertex batches and one GPU upload per batch, checked
33
+ against a local Pontifex bird with fixed attachments and unchanged UVs.
34
+ - `loadSvgSkeleton`: SVG limb extraction, authored/manifest pivots, rest-angle normalization
35
+ and automatic `SkeletalSprite` binding, including nested parts without duplicate drawing.
36
+ - `assetFiles` on `mwgPage`, `emitPage` and `compileResources`: exact embedding lists with
37
+ named failures for unknown entries and unchanged defaults when omitted.
38
+ - `mwg-assets` (`assetReport`): per-file raw/gzip/brotli weights with each share of
39
+ the compressed page, plus the embedded source inventory with byte-identical
40
+ duplicates grouped by hash.
41
+
42
+ - Two-bone skeleton IK with named unreachable-target failures, absolute local joint limits,
43
+ and translation/scale clip channels through `sampleTransformPose` and `advancePose`.
44
+ - Explicit `SkeletalSprite.setDiagnostics` overlay for bones, pivots, joints and tips.
45
+ - `loadSvgParts` / `releaseSvgParts`: named SVG group textures with resolution-aware caching,
46
+ compiled local-file asset support and a browser check against a local Pontifex vehicle.
47
+
48
+ - Pinned-point cloth (`Cloth` Verlet mesh plus textured `ClothSprite` on the 414 mesh
49
+ path) with gravity, wind, damping and a browser drape check; a damped 2D chase
50
+ `Spring` for secondary motion with a stated O(1) frame budget, plus a `SpringSprite`
51
+ debug line.
52
+ - `HazeLayer` (with `hazeField` / `paintHazePixels`): drifting atmospheric sheets on
53
+ stacked depth planes, checked in the browser over a painted harbour; `NeonGlow`
54
+ (with `glowFalloff` / `paintGlowPixels`): additive neon light with colour, radius,
55
+ intensity and flicker, checked in the browser over a dark lane of signs.
56
+
57
+ ### Removed
58
+
59
+ - The `matter-js` (and `@types/matter-js`) dependency: `PhysicsWorld` is recoded in TypeScript in this repo (semi-implicit Euler, impulse contacts, projected distance joints) with the same options, methods and signals. Bodies no longer spin: `angle` stays a display offset. The dropped `engine` field exposed the whole matter engine; nothing in this repo used it.
60
+ ### Fixed
61
+
62
+ - SVG group splitting retains group transforms, shared definitions and styles, and handles
63
+ nested self-closing groups. Skeleton creation reports cycles instead of overflowing the stack.
64
+
65
+ ## [0.38.0] - 2026-10-14
66
+
67
+ Optional MWL scene and UI composition with its bridge-editor example, the
68
+ all-scenarios browser verifier, instance palette setters, and a powered-by badge
69
+ games can carry on their login screen. Roadmap 393 and 394 move to parked: no
70
+ fixture files for the proprietary groove formats, and the neural humanizer costs
71
+ more than the game use case justifies.
72
+
73
+ ### Added
74
+
75
+ - Optional MWL presentation compiler (`mwl/presentation`) and Pixi runtime
76
+ (`two-d/presentation`): scene layers, camera, reusable UI, responsive layouts, keyed
77
+ collections, typed bindings and biome-selected palette/scenery overrides. The local-file
78
+ bridge-editor example checks keyboard/pointer focus, modal input, cleanup and update cost.
79
+ - `Button.setColors`, `Window.setColors` and `Bar.setBackground` update instance palettes
80
+ without rebuilding widgets.
81
+
82
+ - `mwg-scenarios`: verifies every scenario in one local-file browser page through game-owned
83
+ `SceneControls` steps for entry, bot turns, assertions and cleanup, with bounded execution
84
+ and per-scenario failures.
85
+ - `webpage/assets/powered-by-mwg.svg`: a badge games can copy onto their login screen,
86
+ linked to the framework site, with the snippet in the README's new "Powered by mwg"
87
+ section and the badge itself in the website footer.
88
+
10
89
  ## [0.37.0] - 2026-10-14
11
90
 
12
91
  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