@ankhorage/zora 21.0.23 → 21.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (554) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +6 -2
  3. package/dist/features/authoring/allowedChildren.d.ts +5 -2
  4. package/dist/features/authoring/allowedChildren.d.ts.map +1 -1
  5. package/dist/features/authoring/allowedChildren.js +13 -2
  6. package/dist/features/authoring/allowedChildren.js.map +1 -1
  7. package/dist/features/authoring/componentMeta.d.ts.map +1 -1
  8. package/dist/features/authoring/componentMeta.js +21 -0
  9. package/dist/features/authoring/componentMeta.js.map +1 -1
  10. package/dist/features/authoring/constants.d.ts +3 -0
  11. package/dist/features/authoring/constants.d.ts.map +1 -1
  12. package/dist/features/authoring/constants.js +3 -0
  13. package/dist/features/authoring/constants.js.map +1 -1
  14. package/dist/features/card/cardMeta.d.ts +1 -1
  15. package/dist/features/card/cardMeta.d.ts.map +1 -1
  16. package/dist/features/card/cardMeta.js +7 -2
  17. package/dist/features/card/cardMeta.js.map +1 -1
  18. package/dist/features/chess/adapters/inbound/ChessBoard.d.ts +5 -0
  19. package/dist/features/chess/adapters/inbound/ChessBoard.d.ts.map +1 -0
  20. package/dist/features/chess/adapters/inbound/ChessBoard.js +119 -0
  21. package/dist/features/chess/adapters/inbound/ChessBoard.js.map +1 -0
  22. package/dist/features/chess/adapters/inbound/OpeningBook.d.ts +5 -0
  23. package/dist/features/chess/adapters/inbound/OpeningBook.d.ts.map +1 -0
  24. package/dist/features/chess/adapters/inbound/OpeningBook.js +94 -0
  25. package/dist/features/chess/adapters/inbound/OpeningBook.js.map +1 -0
  26. package/dist/features/chess/meta.d.ts +219 -0
  27. package/dist/features/chess/meta.d.ts.map +1 -0
  28. package/dist/features/chess/meta.js +165 -0
  29. package/dist/features/chess/meta.js.map +1 -0
  30. package/dist/features/chess/public.d.ts +12 -0
  31. package/dist/features/chess/public.d.ts.map +1 -0
  32. package/dist/features/chess/public.js +10 -0
  33. package/dist/features/chess/public.js.map +1 -0
  34. package/dist/features/chess/utils/chessSquares.d.ts +4 -0
  35. package/dist/features/chess/utils/chessSquares.d.ts.map +1 -0
  36. package/dist/features/chess/utils/chessSquares.js +3 -0
  37. package/dist/features/chess/utils/chessSquares.js.map +1 -0
  38. package/dist/features/chess/utils/createBoardSquares.d.ts +4 -0
  39. package/dist/features/chess/utils/createBoardSquares.d.ts.map +1 -0
  40. package/dist/features/chess/utils/createBoardSquares.js +9 -0
  41. package/dist/features/chess/utils/createBoardSquares.js.map +1 -0
  42. package/dist/features/chess/utils/createChessBoardColorScheme.d.ts +35 -0
  43. package/dist/features/chess/utils/createChessBoardColorScheme.d.ts.map +1 -0
  44. package/dist/features/chess/utils/createChessBoardColorScheme.js +26 -0
  45. package/dist/features/chess/utils/createChessBoardColorScheme.js.map +1 -0
  46. package/dist/features/chess/utils/createOpeningBookColorScheme.d.ts +11 -0
  47. package/dist/features/chess/utils/createOpeningBookColorScheme.d.ts.map +1 -0
  48. package/dist/features/chess/utils/createOpeningBookColorScheme.js +21 -0
  49. package/dist/features/chess/utils/createOpeningBookColorScheme.js.map +1 -0
  50. package/dist/features/chess/utils/getSquareFile.d.ts +4 -0
  51. package/dist/features/chess/utils/getSquareFile.d.ts.map +1 -0
  52. package/dist/features/chess/utils/getSquareFile.js +5 -0
  53. package/dist/features/chess/utils/getSquareFile.js.map +1 -0
  54. package/dist/features/chess/utils/getSquareRank.d.ts +4 -0
  55. package/dist/features/chess/utils/getSquareRank.d.ts.map +1 -0
  56. package/dist/features/chess/utils/getSquareRank.js +5 -0
  57. package/dist/features/chess/utils/getSquareRank.js.map +1 -0
  58. package/dist/features/chess/utils/isLightSquare.d.ts +4 -0
  59. package/dist/features/chess/utils/isLightSquare.d.ts.map +1 -0
  60. package/dist/features/chess/utils/isLightSquare.js +6 -0
  61. package/dist/features/chess/utils/isLightSquare.js.map +1 -0
  62. package/dist/features/game/adapters/inbound/Game.d.ts +5 -0
  63. package/dist/features/game/adapters/inbound/Game.d.ts.map +1 -0
  64. package/dist/features/game/adapters/inbound/Game.js +24 -0
  65. package/dist/features/game/adapters/inbound/Game.js.map +1 -0
  66. package/dist/features/game/adapters/inbound/GameEntity.d.ts +5 -0
  67. package/dist/features/game/adapters/inbound/GameEntity.d.ts.map +1 -0
  68. package/dist/features/game/adapters/inbound/GameEntity.js +29 -0
  69. package/dist/features/game/adapters/inbound/GameEntity.js.map +1 -0
  70. package/dist/features/game/adapters/inbound/GameField.d.ts +4 -0
  71. package/dist/features/game/adapters/inbound/GameField.d.ts.map +1 -0
  72. package/dist/features/game/adapters/inbound/GameField.js +32 -0
  73. package/dist/features/game/adapters/inbound/GameField.js.map +1 -0
  74. package/dist/features/game/adapters/inbound/GameInputZone.d.ts +4 -0
  75. package/dist/features/game/adapters/inbound/GameInputZone.d.ts.map +1 -0
  76. package/dist/features/game/adapters/inbound/GameInputZone.js +50 -0
  77. package/dist/features/game/adapters/inbound/GameInputZone.js.map +1 -0
  78. package/dist/features/game/adapters/inbound/GameMeasurementProbe.d.ts +4 -0
  79. package/dist/features/game/adapters/inbound/GameMeasurementProbe.d.ts.map +1 -0
  80. package/dist/features/game/adapters/inbound/GameMeasurementProbe.js +54 -0
  81. package/dist/features/game/adapters/inbound/GameMeasurementProbe.js.map +1 -0
  82. package/dist/features/game/adapters/inbound/GameOverlay.d.ts +4 -0
  83. package/dist/features/game/adapters/inbound/GameOverlay.d.ts.map +1 -0
  84. package/dist/features/game/adapters/inbound/GameOverlay.js +39 -0
  85. package/dist/features/game/adapters/inbound/GameOverlay.js.map +1 -0
  86. package/dist/features/game/adapters/inbound/createGameKeyboardEvent.d.ts +16 -0
  87. package/dist/features/game/adapters/inbound/createGameKeyboardEvent.d.ts.map +1 -0
  88. package/dist/features/game/adapters/inbound/createGameKeyboardEvent.js +16 -0
  89. package/dist/features/game/adapters/inbound/createGameKeyboardEvent.js.map +1 -0
  90. package/dist/features/game/adapters/inbound/createGameMeasurementEvent.d.ts +14 -0
  91. package/dist/features/game/adapters/inbound/createGameMeasurementEvent.d.ts.map +1 -0
  92. package/dist/features/game/adapters/inbound/createGameMeasurementEvent.js +25 -0
  93. package/dist/features/game/adapters/inbound/createGameMeasurementEvent.js.map +1 -0
  94. package/dist/features/game/adapters/inbound/createGamePointerEvent.d.ts +17 -0
  95. package/dist/features/game/adapters/inbound/createGamePointerEvent.d.ts.map +1 -0
  96. package/dist/features/game/adapters/inbound/createGamePointerEvent.js +20 -0
  97. package/dist/features/game/adapters/inbound/createGamePointerEvent.js.map +1 -0
  98. package/dist/features/game/adapters/inbound/measureGameEntity.d.ts +5 -0
  99. package/dist/features/game/adapters/inbound/measureGameEntity.d.ts.map +1 -0
  100. package/dist/features/game/adapters/inbound/measureGameEntity.js +22 -0
  101. package/dist/features/game/adapters/inbound/measureGameEntity.js.map +1 -0
  102. package/dist/features/game/adapters/inbound/useGameInputZoneResponder.d.ts +15 -0
  103. package/dist/features/game/adapters/inbound/useGameInputZoneResponder.d.ts.map +1 -0
  104. package/dist/features/game/adapters/inbound/useGameInputZoneResponder.js +67 -0
  105. package/dist/features/game/adapters/inbound/useGameInputZoneResponder.js.map +1 -0
  106. package/dist/features/game/composition/GameRuntimeContext.d.ts +5 -0
  107. package/dist/features/game/composition/GameRuntimeContext.d.ts.map +1 -0
  108. package/dist/features/game/composition/GameRuntimeContext.js +4 -0
  109. package/dist/features/game/composition/GameRuntimeContext.js.map +1 -0
  110. package/dist/features/game/composition/createGameBindingContext.d.ts +4 -0
  111. package/dist/features/game/composition/createGameBindingContext.d.ts.map +1 -0
  112. package/dist/features/game/composition/createGameBindingContext.js +10 -0
  113. package/dist/features/game/composition/createGameBindingContext.js.map +1 -0
  114. package/dist/features/game/composition/createGameMeasurementRegistry.d.ts +4 -0
  115. package/dist/features/game/composition/createGameMeasurementRegistry.d.ts.map +1 -0
  116. package/dist/features/game/composition/createGameMeasurementRegistry.js +15 -0
  117. package/dist/features/game/composition/createGameMeasurementRegistry.js.map +1 -0
  118. package/dist/features/game/composition/useGameRuntime.d.ts +5 -0
  119. package/dist/features/game/composition/useGameRuntime.d.ts.map +1 -0
  120. package/dist/features/game/composition/useGameRuntime.js +117 -0
  121. package/dist/features/game/composition/useGameRuntime.js.map +1 -0
  122. package/dist/features/game/composition/useGameScheduledEffects.d.ts +17 -0
  123. package/dist/features/game/composition/useGameScheduledEffects.d.ts.map +1 -0
  124. package/dist/features/game/composition/useGameScheduledEffects.js +40 -0
  125. package/dist/features/game/composition/useGameScheduledEffects.js.map +1 -0
  126. package/dist/features/game/meta/gameEntityMeta.d.ts +403 -0
  127. package/dist/features/game/meta/gameEntityMeta.d.ts.map +1 -0
  128. package/dist/features/game/meta/gameEntityMeta.js +224 -0
  129. package/dist/features/game/meta/gameEntityMeta.js.map +1 -0
  130. package/dist/features/game/meta/gameFieldMeta.d.ts +61 -0
  131. package/dist/features/game/meta/gameFieldMeta.d.ts.map +1 -0
  132. package/dist/features/game/meta/gameFieldMeta.js +48 -0
  133. package/dist/features/game/meta/gameFieldMeta.js.map +1 -0
  134. package/dist/features/game/meta/gameInputZoneMeta.d.ts +163 -0
  135. package/dist/features/game/meta/gameInputZoneMeta.d.ts.map +1 -0
  136. package/dist/features/game/meta/gameInputZoneMeta.js +138 -0
  137. package/dist/features/game/meta/gameInputZoneMeta.js.map +1 -0
  138. package/dist/features/game/meta/gameMeasurementProbeMeta.d.ts +112 -0
  139. package/dist/features/game/meta/gameMeasurementProbeMeta.d.ts.map +1 -0
  140. package/dist/features/game/meta/gameMeasurementProbeMeta.js +70 -0
  141. package/dist/features/game/meta/gameMeasurementProbeMeta.js.map +1 -0
  142. package/dist/features/game/meta/gameMeta.d.ts +130 -0
  143. package/dist/features/game/meta/gameMeta.d.ts.map +1 -0
  144. package/dist/features/game/meta/gameMeta.js +113 -0
  145. package/dist/features/game/meta/gameMeta.js.map +1 -0
  146. package/dist/features/game/meta/gameOverlayMeta.d.ts +55 -0
  147. package/dist/features/game/meta/gameOverlayMeta.d.ts.map +1 -0
  148. package/dist/features/game/meta/gameOverlayMeta.js +65 -0
  149. package/dist/features/game/meta/gameOverlayMeta.js.map +1 -0
  150. package/dist/features/game/public.d.ts +8 -0
  151. package/dist/features/game/public.d.ts.map +1 -0
  152. package/dist/features/game/public.js +7 -0
  153. package/dist/features/game/public.js.map +1 -0
  154. package/dist/features/game/utils/clampGamePercentage.d.ts +3 -0
  155. package/dist/features/game/utils/clampGamePercentage.d.ts.map +1 -0
  156. package/dist/features/game/utils/clampGamePercentage.js +5 -0
  157. package/dist/features/game/utils/clampGamePercentage.js.map +1 -0
  158. package/dist/features/game/utils/resolveGameEntityMotionPlan.d.ts +15 -0
  159. package/dist/features/game/utils/resolveGameEntityMotionPlan.d.ts.map +1 -0
  160. package/dist/features/game/utils/resolveGameEntityMotionPlan.js +31 -0
  161. package/dist/features/game/utils/resolveGameEntityMotionPlan.js.map +1 -0
  162. package/dist/features/game/utils/toGamePercentage.d.ts +3 -0
  163. package/dist/features/game/utils/toGamePercentage.d.ts.map +1 -0
  164. package/dist/features/game/utils/toGamePercentage.js +6 -0
  165. package/dist/features/game/utils/toGamePercentage.js.map +1 -0
  166. package/dist/features/game/utils/useAnimatedGameEntityValue.d.ts +5 -0
  167. package/dist/features/game/utils/useAnimatedGameEntityValue.d.ts.map +1 -0
  168. package/dist/features/game/utils/useAnimatedGameEntityValue.js +33 -0
  169. package/dist/features/game/utils/useAnimatedGameEntityValue.js.map +1 -0
  170. package/dist/features/game/utils/useGameEntityAnimatedStyle.d.ts +16 -0
  171. package/dist/features/game/utils/useGameEntityAnimatedStyle.d.ts.map +1 -0
  172. package/dist/features/game/utils/useGameEntityAnimatedStyle.js +52 -0
  173. package/dist/features/game/utils/useGameEntityAnimatedStyle.js.map +1 -0
  174. package/dist/features/game/utils/useGameEntityMeasurement.d.ts +5 -0
  175. package/dist/features/game/utils/useGameEntityMeasurement.d.ts.map +1 -0
  176. package/dist/features/game/utils/useGameEntityMeasurement.js +14 -0
  177. package/dist/features/game/utils/useGameEntityMeasurement.js.map +1 -0
  178. package/dist/features/game/utils/useGameEntityMotionProgress.d.ts +5 -0
  179. package/dist/features/game/utils/useGameEntityMotionProgress.d.ts.map +1 -0
  180. package/dist/features/game/utils/useGameEntityMotionProgress.js +87 -0
  181. package/dist/features/game/utils/useGameEntityMotionProgress.js.map +1 -0
  182. package/dist/features/game/utils/useGameReducedMotion.d.ts +3 -0
  183. package/dist/features/game/utils/useGameReducedMotion.d.ts.map +1 -0
  184. package/dist/features/game/utils/useGameReducedMotion.js +13 -0
  185. package/dist/features/game/utils/useGameReducedMotion.js.map +1 -0
  186. package/dist/features/layout/gridMeta.d.ts +1 -1
  187. package/dist/features/layout/gridMeta.d.ts.map +1 -1
  188. package/dist/features/layout/gridMeta.js +7 -2
  189. package/dist/features/layout/gridMeta.js.map +1 -1
  190. package/dist/features/layout/screenMeta.d.ts +1 -1
  191. package/dist/features/layout/viewMeta.d.ts +1 -1
  192. package/dist/features/layout/viewMeta.d.ts.map +1 -1
  193. package/dist/features/layout/viewMeta.js +6 -2
  194. package/dist/features/layout/viewMeta.js.map +1 -1
  195. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.d.ts.map +1 -1
  196. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js +16 -0
  197. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js.map +1 -1
  198. package/dist/features/section/screenSectionMeta.d.ts +1 -1
  199. package/dist/features/tabletop/adapters/inbound/CardBack.d.ts +5 -0
  200. package/dist/features/tabletop/adapters/inbound/CardBack.d.ts.map +1 -0
  201. package/dist/features/tabletop/adapters/inbound/CardBack.js +47 -0
  202. package/dist/features/tabletop/adapters/inbound/CardBack.js.map +1 -0
  203. package/dist/features/tabletop/adapters/inbound/CardHand.d.ts +5 -0
  204. package/dist/features/tabletop/adapters/inbound/CardHand.d.ts.map +1 -0
  205. package/dist/features/tabletop/adapters/inbound/CardHand.js +28 -0
  206. package/dist/features/tabletop/adapters/inbound/CardHand.js.map +1 -0
  207. package/dist/features/tabletop/adapters/inbound/PlayingCard.d.ts +5 -0
  208. package/dist/features/tabletop/adapters/inbound/PlayingCard.d.ts.map +1 -0
  209. package/dist/features/tabletop/adapters/inbound/PlayingCard.js +64 -0
  210. package/dist/features/tabletop/adapters/inbound/PlayingCard.js.map +1 -0
  211. package/dist/features/tabletop/adapters/inbound/PokerTrainingTable.d.ts +5 -0
  212. package/dist/features/tabletop/adapters/inbound/PokerTrainingTable.d.ts.map +1 -0
  213. package/dist/features/tabletop/adapters/inbound/PokerTrainingTable.js +12 -0
  214. package/dist/features/tabletop/adapters/inbound/PokerTrainingTable.js.map +1 -0
  215. package/dist/features/tabletop/adapters/inbound/TabletopTable.d.ts +5 -0
  216. package/dist/features/tabletop/adapters/inbound/TabletopTable.d.ts.map +1 -0
  217. package/dist/features/tabletop/adapters/inbound/TabletopTable.js +206 -0
  218. package/dist/features/tabletop/adapters/inbound/TabletopTable.js.map +1 -0
  219. package/dist/features/tabletop/meta.d.ts +353 -0
  220. package/dist/features/tabletop/meta.d.ts.map +1 -0
  221. package/dist/features/tabletop/meta.js +252 -0
  222. package/dist/features/tabletop/meta.js.map +1 -0
  223. package/dist/features/tabletop/public.d.ts +10 -0
  224. package/dist/features/tabletop/public.d.ts.map +1 -0
  225. package/dist/features/tabletop/public.js +9 -0
  226. package/dist/features/tabletop/public.js.map +1 -0
  227. package/dist/features/tabletop/utils/createPokerTrainingTableState.d.ts +13 -0
  228. package/dist/features/tabletop/utils/createPokerTrainingTableState.d.ts.map +1 -0
  229. package/dist/features/tabletop/utils/createPokerTrainingTableState.js +112 -0
  230. package/dist/features/tabletop/utils/createPokerTrainingTableState.js.map +1 -0
  231. package/dist/features/tabletop/utils/createTabletopColorScheme.d.ts +36 -0
  232. package/dist/features/tabletop/utils/createTabletopColorScheme.d.ts.map +1 -0
  233. package/dist/features/tabletop/utils/createTabletopColorScheme.js +144 -0
  234. package/dist/features/tabletop/utils/createTabletopColorScheme.js.map +1 -0
  235. package/dist/features/tabletop/utils/createTabletopGameSeats.d.ts +13 -0
  236. package/dist/features/tabletop/utils/createTabletopGameSeats.d.ts.map +1 -0
  237. package/dist/features/tabletop/utils/createTabletopGameSeats.js +22 -0
  238. package/dist/features/tabletop/utils/createTabletopGameSeats.js.map +1 -0
  239. package/dist/features/tabletop/utils/getPlayingCardLabel.d.ts +4 -0
  240. package/dist/features/tabletop/utils/getPlayingCardLabel.d.ts.map +1 -0
  241. package/dist/features/tabletop/utils/getPlayingCardLabel.js +6 -0
  242. package/dist/features/tabletop/utils/getPlayingCardLabel.js.map +1 -0
  243. package/dist/features/tabletop/utils/getTabletopCardDimensions.d.ts +12 -0
  244. package/dist/features/tabletop/utils/getTabletopCardDimensions.d.ts.map +1 -0
  245. package/dist/features/tabletop/utils/getTabletopCardDimensions.js +35 -0
  246. package/dist/features/tabletop/utils/getTabletopCardDimensions.js.map +1 -0
  247. package/dist/features/tabletop/utils/getTabletopSeatPosition.d.ts +9 -0
  248. package/dist/features/tabletop/utils/getTabletopSeatPosition.d.ts.map +1 -0
  249. package/dist/features/tabletop/utils/getTabletopSeatPosition.js +88 -0
  250. package/dist/features/tabletop/utils/getTabletopSeatPosition.js.map +1 -0
  251. package/dist/index.d.ts +8 -0
  252. package/dist/index.d.ts.map +1 -1
  253. package/dist/index.js +4 -0
  254. package/dist/index.js.map +1 -1
  255. package/dist/types/chess.d.ts +83 -0
  256. package/dist/types/chess.d.ts.map +1 -0
  257. package/dist/types/chess.js +2 -0
  258. package/dist/types/chess.js.map +1 -0
  259. package/dist/types/gamePresentation.d.ts +94 -0
  260. package/dist/types/gamePresentation.d.ts.map +1 -0
  261. package/dist/types/gamePresentation.js +2 -0
  262. package/dist/types/gamePresentation.js.map +1 -0
  263. package/dist/types/gameRuntime.d.ts +29 -0
  264. package/dist/types/gameRuntime.d.ts.map +1 -0
  265. package/dist/types/gameRuntime.js +2 -0
  266. package/dist/types/gameRuntime.js.map +1 -0
  267. package/dist/types/tabletop.d.ts +129 -0
  268. package/dist/types/tabletop.d.ts.map +1 -0
  269. package/dist/types/tabletop.js +2 -0
  270. package/dist/types/tabletop.js.map +1 -0
  271. package/package.json +3 -1
  272. package/src/features/authoring/allowedChildren.ts +15 -2
  273. package/src/features/authoring/componentMeta.test.ts +93 -0
  274. package/src/features/authoring/componentMeta.ts +27 -0
  275. package/src/features/authoring/constants.ts +3 -0
  276. package/src/features/card/cardMeta.ts +12 -2
  277. package/src/features/chess/adapters/inbound/ChessBoard.tsx +169 -0
  278. package/src/features/chess/adapters/inbound/OpeningBook.tsx +131 -0
  279. package/src/features/chess/meta.ts +168 -0
  280. package/src/features/chess/public.test.tsx +165 -0
  281. package/src/features/chess/public.ts +27 -0
  282. package/src/features/chess/utils/chessSquares.ts +6 -0
  283. package/src/features/chess/utils/createBoardSquares.ts +13 -0
  284. package/src/features/chess/utils/createChessBoardColorScheme.ts +55 -0
  285. package/src/features/chess/utils/createOpeningBookColorScheme.ts +26 -0
  286. package/src/features/chess/utils/getSquareFile.ts +6 -0
  287. package/src/features/chess/utils/getSquareRank.ts +6 -0
  288. package/src/features/chess/utils/isLightSquare.ts +8 -0
  289. package/src/features/chessTabletopOwnership.test.ts +71 -0
  290. package/src/features/game/adapters/inbound/Game.tsx +43 -0
  291. package/src/features/game/adapters/inbound/GameEntity.tsx +44 -0
  292. package/src/features/game/adapters/inbound/GameField.tsx +52 -0
  293. package/src/features/game/adapters/inbound/GameInputZone.tsx +99 -0
  294. package/src/features/game/adapters/inbound/GameMeasurementProbe.tsx +83 -0
  295. package/src/features/game/adapters/inbound/GameOverlay.tsx +58 -0
  296. package/src/features/game/adapters/inbound/createGameKeyboardEvent.test.ts +51 -0
  297. package/src/features/game/adapters/inbound/createGameKeyboardEvent.ts +33 -0
  298. package/src/features/game/adapters/inbound/createGameMeasurementEvent.test.ts +56 -0
  299. package/src/features/game/adapters/inbound/createGameMeasurementEvent.ts +38 -0
  300. package/src/features/game/adapters/inbound/createGamePointerEvent.test.ts +56 -0
  301. package/src/features/game/adapters/inbound/createGamePointerEvent.ts +39 -0
  302. package/src/features/game/adapters/inbound/measureGameEntity.ts +28 -0
  303. package/src/features/game/adapters/inbound/useGameInputZoneResponder.ts +85 -0
  304. package/src/features/game/composition/GameRuntimeContext.ts +6 -0
  305. package/src/features/game/composition/createGameBindingContext.test.ts +66 -0
  306. package/src/features/game/composition/createGameBindingContext.ts +11 -0
  307. package/src/features/game/composition/createGameMeasurementRegistry.test.ts +35 -0
  308. package/src/features/game/composition/createGameMeasurementRegistry.ts +16 -0
  309. package/src/features/game/composition/useGameRuntime.test.tsx +173 -0
  310. package/src/features/game/composition/useGameRuntime.ts +200 -0
  311. package/src/features/game/composition/useGameScheduledEffects.ts +85 -0
  312. package/src/features/game/meta/gameEntityMeta.ts +226 -0
  313. package/src/features/game/meta/gameFieldMeta.ts +49 -0
  314. package/src/features/game/meta/gameInputZoneMeta.ts +140 -0
  315. package/src/features/game/meta/gameMeasurementProbeMeta.ts +72 -0
  316. package/src/features/game/meta/gameMeta.ts +115 -0
  317. package/src/features/game/meta/gameOverlayMeta.ts +66 -0
  318. package/src/features/game/public.test.tsx +64 -0
  319. package/src/features/game/public.ts +19 -0
  320. package/src/features/game/utils/clampGamePercentage.ts +4 -0
  321. package/src/features/game/utils/resolveGameEntityMotionPlan.test.ts +63 -0
  322. package/src/features/game/utils/resolveGameEntityMotionPlan.ts +53 -0
  323. package/src/features/game/utils/toGamePercentage.ts +6 -0
  324. package/src/features/game/utils/useAnimatedGameEntityValue.ts +41 -0
  325. package/src/features/game/utils/useGameEntityAnimatedStyle.ts +87 -0
  326. package/src/features/game/utils/useGameEntityMeasurement.ts +19 -0
  327. package/src/features/game/utils/useGameEntityMotionProgress.ts +114 -0
  328. package/src/features/game/utils/useGameReducedMotion.ts +15 -0
  329. package/src/features/layout/gridMeta.ts +12 -2
  330. package/src/features/layout/viewMeta.ts +10 -2
  331. package/src/features/registry/ZORA_COMPONENT_REGISTRY.ts +29 -0
  332. package/src/features/tabletop/adapters/inbound/CardBack.tsx +70 -0
  333. package/src/features/tabletop/adapters/inbound/CardHand.tsx +61 -0
  334. package/src/features/tabletop/adapters/inbound/PlayingCard.tsx +95 -0
  335. package/src/features/tabletop/adapters/inbound/PokerTrainingTable.tsx +34 -0
  336. package/src/features/tabletop/adapters/inbound/TabletopTable.tsx +264 -0
  337. package/src/features/tabletop/meta.ts +254 -0
  338. package/src/features/tabletop/public.test.tsx +127 -0
  339. package/src/features/tabletop/public.ts +32 -0
  340. package/src/features/tabletop/utils/createPokerTrainingTableState.ts +152 -0
  341. package/src/features/tabletop/utils/createTabletopColorScheme.ts +232 -0
  342. package/src/features/tabletop/utils/createTabletopGameSeats.ts +31 -0
  343. package/src/features/tabletop/utils/getPlayingCardLabel.ts +8 -0
  344. package/src/features/tabletop/utils/getTabletopCardDimensions.ts +45 -0
  345. package/src/features/tabletop/utils/getTabletopSeatPosition.ts +100 -0
  346. package/src/index.ts +83 -0
  347. package/src/types/chess.ts +95 -0
  348. package/src/types/gamePresentation.ts +103 -0
  349. package/src/types/gameRuntime.ts +34 -0
  350. package/src/types/tabletop.ts +131 -0
  351. package/web-dist/chunks/{Accordion-cscmtcn8.js → Accordion-0txegc16.js} +1 -1
  352. package/web-dist/chunks/{Accordion-06588rzn.js → Accordion-10xw59gm.js} +1 -1
  353. package/web-dist/chunks/{Accordion-8kgtg62g.js → Accordion-2zh15wt9.js} +6 -6
  354. package/web-dist/chunks/{Accordion-pkqj4g3r.js → Accordion-481bknsd.js} +5 -5
  355. package/web-dist/chunks/{Accordion-grfbz6f2.js → Accordion-4fkjn6r5.js} +1 -1
  356. package/web-dist/chunks/{Accordion-ftjkdjqs.js → Accordion-4gx45mn0.js} +3 -3
  357. package/web-dist/chunks/{Accordion-fjnck2tg.js → Accordion-4s69xvqy.js} +6 -6
  358. package/web-dist/chunks/{Accordion-jh7nxehr.js → Accordion-50jz5nhg.js} +1 -1
  359. package/web-dist/chunks/{Accordion-t6sdgmbz.js → Accordion-52xke54s.js} +1 -1
  360. package/web-dist/chunks/{Accordion-far6szrp.js → Accordion-6npzmbgk.js} +5 -5
  361. package/web-dist/chunks/{Accordion-q7c1ryf2.js → Accordion-6z4npcgf.js} +4 -4
  362. package/web-dist/chunks/{Accordion-gbba10rg.js → Accordion-8gw5tkfw.js} +6 -6
  363. package/web-dist/chunks/{Accordion-fmxygyb6.js → Accordion-8qteyww0.js} +4 -4
  364. package/web-dist/chunks/{Accordion-1pp37dtg.js → Accordion-9h5dx3ck.js} +4 -4
  365. package/web-dist/chunks/{Accordion-paha5aje.js → Accordion-9mmqf3wr.js} +2 -2
  366. package/web-dist/chunks/{Accordion-f5swy5bs.js → Accordion-b21zrnzj.js} +1 -1
  367. package/web-dist/chunks/{Accordion-ars389m1.js → Accordion-b8qd23hr.js} +3 -3
  368. package/web-dist/chunks/{Accordion-hxfa71g9.js → Accordion-c79y8g44.js} +7 -7
  369. package/web-dist/chunks/Accordion-ca2csh5r.js +321 -0
  370. package/web-dist/chunks/{Accordion-49gf1zb8.js → Accordion-cjht9dyv.js} +1 -1
  371. package/web-dist/chunks/{Accordion-sz21xsf4.js → Accordion-cq6hn45r.js} +1 -1
  372. package/web-dist/chunks/{Accordion-33rd76r7.js → Accordion-d90g9wcb.js} +8 -8
  373. package/web-dist/chunks/{Accordion-crx58d5n.js → Accordion-f5jb299b.js} +2 -2
  374. package/web-dist/chunks/{Accordion-h95wvyn5.js → Accordion-fe6vmbpf.js} +2 -2
  375. package/web-dist/chunks/{Accordion-jzbq36ec.js → Accordion-fqm027n3.js} +8 -8
  376. package/web-dist/chunks/{Accordion-0jkm3y3w.js → Accordion-gpccarct.js} +1 -1
  377. package/web-dist/chunks/{Accordion-v6ykq9hv.js → Accordion-h95h3xdb.js} +10 -10
  378. package/web-dist/chunks/{Accordion-t3p4ykg7.js → Accordion-j8ab9k8k.js} +8 -8
  379. package/web-dist/chunks/{Accordion-qpwhmqzd.js → Accordion-k5z591wx.js} +13 -13
  380. package/web-dist/chunks/{Accordion-rrpej6sv.js → Accordion-kdncjvc7.js} +7 -7
  381. package/web-dist/chunks/{Accordion-f05a7r28.js → Accordion-ks4a1c6w.js} +5 -5
  382. package/web-dist/chunks/{Accordion-x0j8b2by.js → Accordion-ma1sfe5z.js} +5 -5
  383. package/web-dist/chunks/{Accordion-2dws3778.js → Accordion-mhtyce1k.js} +4 -4
  384. package/web-dist/chunks/{Accordion-1vewf8aa.js → Accordion-n7gtb5ec.js} +2 -2
  385. package/web-dist/chunks/{Accordion-0psdn97s.js → Accordion-p42mm8rr.js} +1 -1
  386. package/web-dist/chunks/{Accordion-3404tth9.js → Accordion-panw5f0q.js} +7 -7
  387. package/web-dist/chunks/{Accordion-4a6wj3ez.js → Accordion-pxq8gfgg.js} +9 -9
  388. package/web-dist/chunks/{Accordion-xshn7k8f.js → Accordion-qwbshc4s.js} +4 -4
  389. package/web-dist/chunks/{Accordion-395r3wra.js → Accordion-r51wsmvy.js} +2 -2
  390. package/web-dist/chunks/Accordion-rt13cqr7.js +830 -0
  391. package/web-dist/chunks/{Accordion-hz4xaqjf.js → Accordion-s1f9hb5a.js} +9 -9
  392. package/web-dist/chunks/{Accordion-7ja4mtbz.js → Accordion-sv87mbqa.js} +1 -1
  393. package/web-dist/chunks/{Accordion-r4c9k9y7.js → Accordion-t4k9egq6.js} +2 -2
  394. package/web-dist/chunks/{Accordion-96cqeekv.js → Accordion-t64m1kca.js} +5 -5
  395. package/web-dist/chunks/Accordion-wg31jkvp.js +1559 -0
  396. package/web-dist/chunks/{Accordion-ch67q4t0.js → Accordion-y9zr4x2x.js} +4 -4
  397. package/web-dist/chunks/{Accordion-31aeqxak.js → Accordion-ye3k55r7.js} +3 -3
  398. package/web-dist/chunks/{Accordion-s42wwh6m.js → Accordion-z29agann.js} +6 -6
  399. package/web-dist/chunks/{Accordion-f1h2f05v.js → Accordion-ze26effy.js} +5 -5
  400. package/web-dist/chunks/{Accordion-tx78txec.js → Accordion-zqzcagxz.js} +5 -5
  401. package/web-dist/components/accordion/Accordion.js +12 -12
  402. package/web-dist/components/accordion-item/AccordionItem.js +12 -12
  403. package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
  404. package/web-dist/components/app-bar/AppBar.js +19 -19
  405. package/web-dist/components/app-shell/AppShell.js +6 -6
  406. package/web-dist/components/avatar/Avatar.js +12 -12
  407. package/web-dist/components/avatar-group/AvatarGroup.js +12 -12
  408. package/web-dist/components/badge/Badge.js +7 -7
  409. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +20 -20
  410. package/web-dist/components/bottom-sheet/BottomSheet.js +8 -8
  411. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +8 -8
  412. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +8 -8
  413. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +8 -8
  414. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +8 -8
  415. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +8 -8
  416. package/web-dist/components/breadcrumbs/Breadcrumbs.js +15 -15
  417. package/web-dist/components/button/Button.js +12 -12
  418. package/web-dist/components/button-group/ButtonGroup.js +12 -12
  419. package/web-dist/components/camera-permission-view/CameraPermissionView.js +20 -20
  420. package/web-dist/components/card/Card.js +19 -19
  421. package/web-dist/components/card-back/CardBack.d.ts +7 -0
  422. package/web-dist/components/card-back/CardBack.js +19 -0
  423. package/web-dist/components/card-back/index.d.ts +1 -0
  424. package/web-dist/components/card-back/index.js +2 -0
  425. package/web-dist/components/card-hand/CardHand.d.ts +7 -0
  426. package/web-dist/components/card-hand/CardHand.js +19 -0
  427. package/web-dist/components/card-hand/index.d.ts +1 -0
  428. package/web-dist/components/card-hand/index.js +2 -0
  429. package/web-dist/components/chat-list-item/ChatListItem.js +16 -16
  430. package/web-dist/components/checkbox/Checkbox.js +12 -12
  431. package/web-dist/components/checkbox-group/CheckboxGroup.js +12 -12
  432. package/web-dist/components/chess-board/ChessBoard.d.ts +4 -0
  433. package/web-dist/components/chess-board/ChessBoard.js +13 -0
  434. package/web-dist/components/chess-board/index.d.ts +1 -0
  435. package/web-dist/components/chess-board/index.js +2 -0
  436. package/web-dist/components/chip/Chip.js +13 -13
  437. package/web-dist/components/chip-group/ChipGroup.js +13 -13
  438. package/web-dist/components/collection-editor/CollectionEditor.js +19 -19
  439. package/web-dist/components/content-rail/ContentRail.js +13 -13
  440. package/web-dist/components/data-table/DataTable.js +26 -26
  441. package/web-dist/components/date-picker/DatePicker.js +17 -17
  442. package/web-dist/components/dialog/Dialog.js +12 -12
  443. package/web-dist/components/divider/Divider.js +6 -6
  444. package/web-dist/components/empty-state/EmptyState.js +20 -20
  445. package/web-dist/components/field/Field.js +12 -12
  446. package/web-dist/components/flat-list/FlatList.js +13 -13
  447. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +18 -18
  448. package/web-dist/components/form/Form.js +16 -16
  449. package/web-dist/components/form-actions/FormActions.js +16 -16
  450. package/web-dist/components/form-error/FormError.js +16 -16
  451. package/web-dist/components/game/Game.d.ts +8 -0
  452. package/web-dist/components/game/Game.js +25 -0
  453. package/web-dist/components/game/index.d.ts +1 -0
  454. package/web-dist/components/game/index.js +2 -0
  455. package/web-dist/components/game-entity/GameEntity.d.ts +8 -0
  456. package/web-dist/components/game-entity/GameEntity.js +25 -0
  457. package/web-dist/components/game-entity/index.d.ts +1 -0
  458. package/web-dist/components/game-entity/index.js +2 -0
  459. package/web-dist/components/game-field/GameField.d.ts +8 -0
  460. package/web-dist/components/game-field/GameField.js +25 -0
  461. package/web-dist/components/game-field/index.d.ts +1 -0
  462. package/web-dist/components/game-field/index.js +2 -0
  463. package/web-dist/components/game-input-zone/GameInputZone.d.ts +8 -0
  464. package/web-dist/components/game-input-zone/GameInputZone.js +25 -0
  465. package/web-dist/components/game-input-zone/index.d.ts +1 -0
  466. package/web-dist/components/game-input-zone/index.js +2 -0
  467. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.d.ts +8 -0
  468. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +25 -0
  469. package/web-dist/components/game-measurement-probe/index.d.ts +1 -0
  470. package/web-dist/components/game-measurement-probe/index.js +2 -0
  471. package/web-dist/components/game-overlay/GameOverlay.d.ts +8 -0
  472. package/web-dist/components/game-overlay/GameOverlay.js +25 -0
  473. package/web-dist/components/game-overlay/index.d.ts +1 -0
  474. package/web-dist/components/game-overlay/index.js +2 -0
  475. package/web-dist/components/gradient/Gradient.js +7 -7
  476. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +7 -7
  477. package/web-dist/components/grid/Grid.js +6 -6
  478. package/web-dist/components/heading/Heading.js +6 -6
  479. package/web-dist/components/hero/Hero.js +19 -19
  480. package/web-dist/components/icon/Icon.js +4 -4
  481. package/web-dist/components/icon-button/IconButton.js +12 -12
  482. package/web-dist/components/image/Image.js +10 -10
  483. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +2 -2
  484. package/web-dist/components/list/List.js +13 -13
  485. package/web-dist/components/list-item/ListItem.js +13 -13
  486. package/web-dist/components/list-section/ListSection.js +13 -13
  487. package/web-dist/components/media-card/MediaCard.js +19 -19
  488. package/web-dist/components/message-bubble/MessageBubble.js +16 -16
  489. package/web-dist/components/metric-card/MetricCard.js +19 -19
  490. package/web-dist/components/missing-element/MissingElement.js +11 -11
  491. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +18 -18
  492. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +18 -18
  493. package/web-dist/components/opening-book/OpeningBook.d.ts +4 -0
  494. package/web-dist/components/opening-book/OpeningBook.js +13 -0
  495. package/web-dist/components/opening-book/index.d.ts +1 -0
  496. package/web-dist/components/opening-book/index.js +2 -0
  497. package/web-dist/components/otp-form/OtpForm.js +18 -18
  498. package/web-dist/components/pagination/Pagination.js +13 -13
  499. package/web-dist/components/palette-item/PaletteItem.js +19 -19
  500. package/web-dist/components/playing-card/PlayingCard.d.ts +7 -0
  501. package/web-dist/components/playing-card/PlayingCard.js +19 -0
  502. package/web-dist/components/playing-card/index.d.ts +1 -0
  503. package/web-dist/components/playing-card/index.js +2 -0
  504. package/web-dist/components/poker-training-table/PokerTrainingTable.d.ts +7 -0
  505. package/web-dist/components/poker-training-table/PokerTrainingTable.js +19 -0
  506. package/web-dist/components/poker-training-table/index.d.ts +1 -0
  507. package/web-dist/components/poker-training-table/index.js +2 -0
  508. package/web-dist/components/popover-menu/PopoverMenu.js +14 -14
  509. package/web-dist/components/post-card/PostCard.js +19 -19
  510. package/web-dist/components/product-card/ProductCard.js +19 -19
  511. package/web-dist/components/progress/Progress.js +10 -10
  512. package/web-dist/components/progress-ring/ProgressRing.js +10 -10
  513. package/web-dist/components/radio/Radio.js +14 -14
  514. package/web-dist/components/radio-group/RadioGroup.js +14 -14
  515. package/web-dist/components/rating/Rating.js +9 -9
  516. package/web-dist/components/reader-surface/ReaderSurface.js +21 -21
  517. package/web-dist/components/scan-overlay/ScanOverlay.js +20 -20
  518. package/web-dist/components/screen/Screen.js +6 -6
  519. package/web-dist/components/screen-section/ScreenSection.js +10 -10
  520. package/web-dist/components/scroll-view/ScrollView.js +6 -6
  521. package/web-dist/components/search-input/SearchInput.js +13 -13
  522. package/web-dist/components/section-header/SectionHeader.js +10 -10
  523. package/web-dist/components/section-list/SectionList.js +13 -13
  524. package/web-dist/components/select/Select.js +16 -16
  525. package/web-dist/components/selectable-item/SelectableItem.js +5 -5
  526. package/web-dist/components/selection-provider/SelectionProvider.js +5 -5
  527. package/web-dist/components/sign-in-form/SignInForm.js +18 -18
  528. package/web-dist/components/sign-up-form/SignUpForm.js +18 -18
  529. package/web-dist/components/skeleton/Skeleton.js +22 -22
  530. package/web-dist/components/skeleton-card/SkeletonCard.js +22 -22
  531. package/web-dist/components/skeleton-list/SkeletonList.js +22 -22
  532. package/web-dist/components/skeleton-text/SkeletonText.js +22 -22
  533. package/web-dist/components/surface/Surface.js +7 -7
  534. package/web-dist/components/switch/Switch.js +7 -7
  535. package/web-dist/components/tab/Tab.js +7 -7
  536. package/web-dist/components/tab-list/TabList.js +7 -7
  537. package/web-dist/components/tab-panel/TabPanel.js +7 -7
  538. package/web-dist/components/tabletop-table/TabletopTable.d.ts +7 -0
  539. package/web-dist/components/tabletop-table/TabletopTable.js +19 -0
  540. package/web-dist/components/tabletop-table/index.d.ts +1 -0
  541. package/web-dist/components/tabletop-table/index.js +2 -0
  542. package/web-dist/components/tabs/Tabs.js +7 -7
  543. package/web-dist/components/text/Text.js +6 -6
  544. package/web-dist/components/text-input/TextInput.js +13 -13
  545. package/web-dist/components/time-picker/TimePicker.js +17 -17
  546. package/web-dist/components/timeline/Timeline.js +11 -11
  547. package/web-dist/components/toast/Toast.js +9 -9
  548. package/web-dist/components/toast-provider/ToastProvider.js +9 -9
  549. package/web-dist/components/toolbar/Toolbar.js +19 -19
  550. package/web-dist/components/tree-item/TreeItem.js +16 -16
  551. package/web-dist/components/uploader/Uploader.js +22 -22
  552. package/web-dist/components/view/View.js +6 -6
  553. package/web-dist/manifest.json +1650 -1379
  554. package/web-dist/runtime/ZoraProvider.js +8 -8
@@ -0,0 +1,168 @@
1
+ import type { ZoraComponentMeta } from '../../types/authoring';
2
+
3
+ export const chessBoardMeta = {
4
+ name: 'ChessBoard',
5
+ category: 'component',
6
+ description:
7
+ 'Renders caller-owned chess pieces, highlights, and move-attempt interactions without chess rules.',
8
+ directManifestNode: true,
9
+ allowedChildren: [],
10
+ blueprint: {
11
+ label: 'Chess board',
12
+ defaultProps: { pieces: [], orientation: 'white', showCoordinates: true },
13
+ },
14
+ events: {
15
+ squarePress: {
16
+ label: 'Square press',
17
+ eventType: 'chess.squarePress',
18
+ payloadFields: [{ path: 'square', type: 'string', label: 'Square' }],
19
+ },
20
+ moveAttempt: {
21
+ label: 'Move attempt',
22
+ eventType: 'chess.moveAttempt',
23
+ payloadFields: [
24
+ { path: 'from', type: 'string', label: 'From' },
25
+ { path: 'to', type: 'string', label: 'To' },
26
+ ],
27
+ },
28
+ },
29
+ bindings: {
30
+ props: {
31
+ pieces: {
32
+ label: 'Pieces',
33
+ value: { type: 'array', itemType: 'object' },
34
+ acceptsFallback: true,
35
+ acceptsTransforms: true,
36
+ },
37
+ legalTargets: {
38
+ label: 'Legal targets',
39
+ value: { type: 'array', itemType: 'string' },
40
+ acceptsFallback: true,
41
+ acceptsTransforms: true,
42
+ },
43
+ },
44
+ },
45
+ props: {
46
+ pieces: {
47
+ type: 'array',
48
+ category: 'Board',
49
+ label: 'Pieces',
50
+ default: [],
51
+ authoring: { authority: 'instance' },
52
+ },
53
+ orientation: {
54
+ type: 'enum',
55
+ category: 'Board',
56
+ label: 'Orientation',
57
+ enum: ['white', 'black'],
58
+ default: 'white',
59
+ authoring: { authority: 'instance' },
60
+ },
61
+ selectedSquare: {
62
+ type: 'string',
63
+ category: 'Board',
64
+ label: 'Selected square',
65
+ authoring: { authority: 'instance' },
66
+ },
67
+ legalTargets: {
68
+ type: 'array',
69
+ category: 'Board',
70
+ label: 'Legal targets',
71
+ default: [],
72
+ authoring: { authority: 'instance' },
73
+ },
74
+ showCoordinates: {
75
+ type: 'boolean',
76
+ category: 'Style',
77
+ label: 'Show coordinates',
78
+ default: false,
79
+ authoring: { authority: 'instance' },
80
+ },
81
+ disabled: {
82
+ type: 'boolean',
83
+ category: 'State',
84
+ label: 'Disabled',
85
+ default: false,
86
+ authoring: { authority: 'instance' },
87
+ },
88
+ },
89
+ } as const satisfies ZoraComponentMeta;
90
+ export const openingBookMeta = {
91
+ name: 'OpeningBook',
92
+ category: 'component',
93
+ description:
94
+ 'Presents caller-owned opening suggestions and their loading, empty, selected, and press states.',
95
+ directManifestNode: true,
96
+ allowedChildren: [],
97
+ blueprint: {
98
+ label: 'Opening book',
99
+ defaultProps: {
100
+ moves: [],
101
+ title: 'Opening book',
102
+ emptyText: 'No book moves for this position.',
103
+ },
104
+ },
105
+ events: {
106
+ movePress: {
107
+ label: 'Move press',
108
+ eventType: 'chess.openingMovePress',
109
+ payloadFields: [
110
+ { path: 'san', type: 'string', label: 'SAN' },
111
+ { path: 'uci', type: 'string', label: 'UCI' },
112
+ { path: 'fen', type: 'string', label: 'Position' },
113
+ ],
114
+ },
115
+ },
116
+ bindings: {
117
+ props: {
118
+ moves: {
119
+ label: 'Moves',
120
+ value: { type: 'array', itemType: 'object' },
121
+ acceptsFallback: true,
122
+ acceptsTransforms: true,
123
+ },
124
+ },
125
+ },
126
+ props: {
127
+ moves: {
128
+ type: 'array',
129
+ category: 'Content',
130
+ label: 'Moves',
131
+ default: [],
132
+ authoring: { authority: 'instance' },
133
+ },
134
+ title: {
135
+ type: 'string',
136
+ category: 'Content',
137
+ label: 'Title',
138
+ default: 'Opening book',
139
+ authoring: { authority: 'instance' },
140
+ },
141
+ emptyText: {
142
+ type: 'string',
143
+ category: 'Content',
144
+ label: 'Empty text',
145
+ default: 'No book moves for this position.',
146
+ authoring: { authority: 'instance' },
147
+ },
148
+ loading: {
149
+ type: 'boolean',
150
+ category: 'State',
151
+ label: 'Loading',
152
+ default: false,
153
+ authoring: { authority: 'instance' },
154
+ },
155
+ errorText: {
156
+ type: 'string',
157
+ category: 'State',
158
+ label: 'Error text',
159
+ authoring: { authority: 'instance' },
160
+ },
161
+ selectedMove: {
162
+ type: 'string',
163
+ category: 'State',
164
+ label: 'Selected move',
165
+ authoring: { authority: 'instance' },
166
+ },
167
+ },
168
+ } as const satisfies ZoraComponentMeta;
@@ -0,0 +1,165 @@
1
+ import { join } from 'node:path';
2
+ import { pathToFileURL } from 'node:url';
3
+
4
+ import { describe, expect, test } from 'bun:test';
5
+ import { Window } from 'happy-dom';
6
+ import React, { act } from 'react';
7
+ import { createRoot } from 'react-dom/client';
8
+ import { renderToStaticMarkup } from 'react-dom/server';
9
+
10
+ import type {
11
+ ChessBoard as ChessBoardComponent,
12
+ OpeningBook as OpeningBookComponent,
13
+ } from './public';
14
+ import { createBoardSquares } from './utils/createBoardSquares';
15
+ import { createChessBoardColorScheme } from './utils/createChessBoardColorScheme';
16
+ import { getSquareFile } from './utils/getSquareFile';
17
+ import { getSquareRank } from './utils/getSquareRank';
18
+ import { isLightSquare } from './utils/isLightSquare';
19
+
20
+ const webDistRoot = join(import.meta.dir, '../../../web-dist');
21
+ const load = (path: string) => import(pathToFileURL(join(webDistRoot, path)).href);
22
+
23
+ describe('Chess presentation', () => {
24
+ test('keeps square order and theme-derived presentation independent of chess rules', () => {
25
+ expect(createBoardSquares('white').at(0)).toBe('a8');
26
+ expect(createBoardSquares('black').at(0)).toBe('h1');
27
+ expect(getSquareFile('e4')).toBe('e');
28
+ expect(getSquareRank('e4')).toBe('4');
29
+ expect(isLightSquare('a1')).toBe(false);
30
+ expect(typeof createChessBoardColorScheme).toBe('function');
31
+ });
32
+
33
+ test('renders custom React nodes, square IDs, and opening metadata through independent artifacts', async () => {
34
+ const { ChessBoard } = (await load('components/chess-board/index.js')) as {
35
+ ChessBoard: typeof ChessBoardComponent;
36
+ };
37
+ const { OpeningBook } = (await load('components/opening-book/index.js')) as {
38
+ OpeningBook: typeof OpeningBookComponent;
39
+ };
40
+ const markup = renderToStaticMarkup(
41
+ <>
42
+ <ChessBoard
43
+ colorScheme={{ selectedSquare: '#123456', legalTarget: '#234567' }}
44
+ legalTargets={['e4']}
45
+ pieces={[{ color: 'white', piece: 'p', square: 'e2' }]}
46
+ renderPiece={() => <div data-testid="custom-piece" />}
47
+ selectedSquare="e2"
48
+ showCoordinates
49
+ testID="board"
50
+ />
51
+ <OpeningBook
52
+ moves={[
53
+ {
54
+ san: 'Nf3',
55
+ eco: 'A04',
56
+ name: 'Reti Opening',
57
+ games: 42,
58
+ whiteWinRate: 0.52,
59
+ drawRate: 0.2,
60
+ blackWinRate: 0.28,
61
+ },
62
+ ]}
63
+ testID="book"
64
+ />
65
+ </>,
66
+ );
67
+ const browser = new Window();
68
+ browser.document.body.innerHTML = markup;
69
+ expect(browser.document.querySelectorAll('[data-testid^="board-square-"]')).toHaveLength(64);
70
+ expect(
71
+ browser.document.querySelector('[data-testid="board-square-e2"]')?.textContent,
72
+ ).toContain('e2');
73
+ expect(
74
+ browser.document.querySelector('[data-testid="custom-piece"]')?.parentElement?.className,
75
+ ).toContain('css-view');
76
+ expect(
77
+ browser.document.querySelector('[data-testid="board-square-e2"]')?.getAttribute('style'),
78
+ ).toContain('background-color:rgba(18,52,86,1.00)');
79
+ expect(
80
+ browser.document.querySelector('[data-testid="board-square-e4"]')?.getAttribute('style'),
81
+ ).toContain('background-color:rgba(35,69,103,1.00)');
82
+ expect(browser.document.querySelector('[data-testid="book-move-Nf3"]')?.textContent).toContain(
83
+ 'A04 · Reti Opening · 42 games',
84
+ );
85
+ expect(browser.document.querySelector('[data-testid="book-move-Nf3"]')?.textContent).toContain(
86
+ 'W 52% D 20% B 28%',
87
+ );
88
+ browser.close();
89
+ });
90
+
91
+ test('emits only caller-owned intents in active mode and suppresses them in passive mode', async () => {
92
+ const { ChessBoard } = (await load('components/chess-board/index.js')) as {
93
+ ChessBoard: typeof ChessBoardComponent;
94
+ };
95
+ const { OpeningBook } = (await load('components/opening-book/index.js')) as {
96
+ OpeningBook: typeof OpeningBookComponent;
97
+ };
98
+ const browser = new Window();
99
+ const keys = ['window', 'document', 'Node', 'navigator', 'IS_REACT_ACT_ENVIRONMENT'] as const;
100
+ const previous = keys.map(
101
+ (key) => [key, Object.getOwnPropertyDescriptor(globalThis, key)] as const,
102
+ );
103
+ Object.assign(globalThis, {
104
+ window: browser,
105
+ document: browser.document,
106
+ Node: browser.Node,
107
+ navigator: browser.navigator,
108
+ IS_REACT_ACT_ENVIRONMENT: true,
109
+ });
110
+ const host = document.createElement('div');
111
+ document.body.appendChild(host);
112
+ const squares: string[] = [];
113
+ const moves: string[] = [];
114
+ const book: string[] = [];
115
+ const root = createRoot(host);
116
+ const render = (interactionPolicy: 'active' | 'passive') => (
117
+ <>
118
+ <ChessBoard
119
+ interactionPolicy={interactionPolicy}
120
+ selectedSquare="e2"
121
+ testID="board"
122
+ onSquarePress={(square) => squares.push(square)}
123
+ onMoveAttempt={(move) => moves.push(`${move.from}-${move.to}`)}
124
+ />
125
+ <OpeningBook
126
+ interactionPolicy={interactionPolicy}
127
+ moves={[{ san: 'e4' }]}
128
+ onMovePress={(move) => book.push(move.san)}
129
+ testID="book"
130
+ />
131
+ </>
132
+ );
133
+ try {
134
+ act(() => root.render(render('passive')));
135
+ act(() => {
136
+ host
137
+ .querySelector('[data-testid="board-square-e4"]')
138
+ ?.dispatchEvent(new browser.MouseEvent('click', { bubbles: true }));
139
+ host
140
+ .querySelector('[data-testid="book-move-e4"]')
141
+ ?.dispatchEvent(new browser.MouseEvent('click', { bubbles: true }));
142
+ });
143
+ expect([squares, moves, book]).toEqual([[], [], []]);
144
+ act(() => root.render(render('active')));
145
+ act(() => {
146
+ host
147
+ .querySelector('[data-testid="board-square-e4"]')
148
+ ?.dispatchEvent(new browser.MouseEvent('click', { bubbles: true }));
149
+ host
150
+ .querySelector('[data-testid="book-move-e4"]')
151
+ ?.dispatchEvent(new browser.MouseEvent('click', { bubbles: true }));
152
+ });
153
+ expect(squares).toEqual(['e4']);
154
+ expect(moves).toEqual(['e2-e4']);
155
+ expect(book).toEqual(['e4']);
156
+ } finally {
157
+ act(() => root.unmount());
158
+ browser.close();
159
+ for (const [key, descriptor] of previous) {
160
+ if (descriptor) Object.defineProperty(globalThis, key, descriptor);
161
+ else Reflect.deleteProperty(globalThis, key);
162
+ }
163
+ }
164
+ });
165
+ });
@@ -0,0 +1,27 @@
1
+ export type {
2
+ ChessBoardColorOverrides,
3
+ ChessBoardColorScheme,
4
+ ChessBoardOrientation,
5
+ ChessBoardProps,
6
+ ChessMoveAttempt,
7
+ ChessPieceCode,
8
+ ChessPieceRenderContext,
9
+ ChessPieceRenderer,
10
+ ChessPieceState,
11
+ ChessPromotionPiece,
12
+ ChessSquareId,
13
+ OpeningBookColorOverrides,
14
+ OpeningBookColorScheme,
15
+ OpeningBookMove,
16
+ OpeningBookProps,
17
+ } from '../../types/chess';
18
+ export { ChessBoard } from './adapters/inbound/ChessBoard';
19
+ export { OpeningBook } from './adapters/inbound/OpeningBook';
20
+ export { chessSquares } from './utils/chessSquares';
21
+ export { createBoardSquares } from './utils/createBoardSquares';
22
+ export type { ChessColorThemeShape } from './utils/createChessBoardColorScheme';
23
+ export { createChessBoardColorScheme } from './utils/createChessBoardColorScheme';
24
+ export { createOpeningBookColorScheme } from './utils/createOpeningBookColorScheme';
25
+ export { getSquareFile } from './utils/getSquareFile';
26
+ export { getSquareRank } from './utils/getSquareRank';
27
+ export { isLightSquare } from './utils/isLightSquare';
@@ -0,0 +1,6 @@
1
+ import type { ChessSquareId } from '../../../types/chess';
2
+
3
+ /*** Lists every board square in ascending rank and file order. */
4
+ export const chessSquares: readonly ChessSquareId[] = [1, 2, 3, 4, 5, 6, 7, 8].flatMap((rank) =>
5
+ [...'abcdefgh'].map((file) => `${file}${rank}` as ChessSquareId),
6
+ );
@@ -0,0 +1,13 @@
1
+ import type { ChessBoardOrientation, ChessSquareId } from '../../../types/chess';
2
+
3
+ const files = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] as const;
4
+ const ranks = ['1', '2', '3', '4', '5', '6', '7', '8'] as const;
5
+
6
+ /*** Orders the 64 displayed squares for the selected player orientation. */
7
+ export function createBoardSquares(orientation: ChessBoardOrientation): readonly ChessSquareId[] {
8
+ const displayedRanks = orientation === 'white' ? [...ranks].reverse() : [...ranks];
9
+ const displayedFiles = orientation === 'white' ? [...files] : [...files].reverse();
10
+ return displayedRanks.flatMap((rank) =>
11
+ displayedFiles.map((file): ChessSquareId => `${file}${rank}`),
12
+ );
13
+ }
@@ -0,0 +1,55 @@
1
+ import type { ChessBoardColorOverrides, ChessBoardColorScheme } from '../../../types/chess';
2
+
3
+ export interface ChessColorThemeShape {
4
+ semantics: {
5
+ action: {
6
+ primary: {
7
+ softBg: string;
8
+ };
9
+ };
10
+ content: {
11
+ default: string;
12
+ muted: string;
13
+ };
14
+ neutral: {
15
+ divider: string;
16
+ surface: string;
17
+ surfaceHover: string;
18
+ };
19
+ success: {
20
+ softBg: string;
21
+ };
22
+ warning: {
23
+ softBg: string;
24
+ };
25
+ };
26
+ }
27
+
28
+ /***
29
+ * Creates the theme-derived palette used by `ChessBoard`.
30
+ *
31
+ * Use `createChessBoardColorScheme` when custom board overlays, piece renderers,
32
+ * or adjacent chess UI need to share the same square, highlight, coordinate, and
33
+ * piece colors as the built-in board.
34
+ *
35
+ */
36
+ export function createChessBoardColorScheme(
37
+ theme: ChessColorThemeShape,
38
+ overrides?: ChessBoardColorOverrides,
39
+ ): ChessBoardColorScheme {
40
+ return {
41
+ border: theme.semantics.neutral.divider,
42
+ coordinateText: theme.semantics.content.muted,
43
+ darkPiece: theme.semantics.content.default,
44
+ darkSquare: theme.semantics.neutral.surfaceHover,
45
+ darkSquareText: theme.semantics.content.muted,
46
+ lastMoveFrom: theme.semantics.warning.softBg,
47
+ lastMoveTo: theme.semantics.warning.softBg,
48
+ legalTarget: theme.semantics.success.softBg,
49
+ lightPiece: theme.semantics.content.default,
50
+ lightSquare: theme.semantics.neutral.surface,
51
+ lightSquareText: theme.semantics.content.muted,
52
+ selectedSquare: theme.semantics.action.primary.softBg,
53
+ ...overrides,
54
+ };
55
+ }
@@ -0,0 +1,26 @@
1
+ import type { OpeningBookColorOverrides, OpeningBookColorScheme } from '../../../types/chess';
2
+ import type { ChessColorThemeShape } from './createChessBoardColorScheme';
3
+
4
+ /***
5
+ * Creates the theme-derived palette used by `OpeningBook`.
6
+ *
7
+ * Use `createOpeningBookColorScheme` when custom opening-list rows, badges, or
8
+ * trainer panels should match the built-in book surface and selected-move states.
9
+ *
10
+ */
11
+ export function createOpeningBookColorScheme(
12
+ theme: ChessColorThemeShape,
13
+ overrides?: OpeningBookColorOverrides,
14
+ ): OpeningBookColorScheme {
15
+ return {
16
+ border: theme.semantics.neutral.divider,
17
+ metricSurface: theme.semantics.neutral.surface,
18
+ primaryText: theme.semantics.content.default,
19
+ secondaryText: theme.semantics.content.muted,
20
+ selectedSurface: theme.semantics.action.primary.softBg,
21
+ surface: theme.semantics.neutral.surface,
22
+ surfaceHover: theme.semantics.neutral.surfaceHover,
23
+ titleText: theme.semantics.content.default,
24
+ ...overrides,
25
+ };
26
+ }
@@ -0,0 +1,6 @@
1
+ import type { ChessSquareId } from '../../../types/chess';
2
+
3
+ /*** Returns the file letter of a chess square. */
4
+ export function getSquareFile(square: ChessSquareId): string {
5
+ return square[0] ?? '';
6
+ }
@@ -0,0 +1,6 @@
1
+ import type { ChessSquareId } from '../../../types/chess';
2
+
3
+ /*** Returns the rank number of a chess square. */
4
+ export function getSquareRank(square: ChessSquareId): string {
5
+ return square[1] ?? '';
6
+ }
@@ -0,0 +1,8 @@
1
+ import type { ChessSquareId } from '../../../types/chess';
2
+
3
+ const files = 'abcdefgh';
4
+
5
+ /*** Determines whether a chess square uses the light presentation color. */
6
+ export function isLightSquare(square: ChessSquareId): boolean {
7
+ return (files.indexOf(square[0] ?? '') + Number(square[1]) - 1) % 2 === 1;
8
+ }
@@ -0,0 +1,71 @@
1
+ import { readdirSync, readFileSync } from 'node:fs';
2
+ import { extname, join, parse } from 'node:path';
3
+
4
+ import { expect, test } from 'bun:test';
5
+ import * as ts from 'typescript';
6
+
7
+ const featureRoots = ['src/features/chess', 'src/features/tabletop'] as const;
8
+
9
+ test('Chess and Tabletop implementation modules own one matching runtime export each', () => {
10
+ for (const featureRoot of featureRoots) {
11
+ for (const directory of [join(featureRoot, 'adapters/inbound'), join(featureRoot, 'utils')]) {
12
+ for (const name of readdirSync(directory)) {
13
+ if (!['.ts', '.tsx'].includes(extname(name))) continue;
14
+ const source = ts.createSourceFile(
15
+ name,
16
+ readFileSync(join(directory, name), 'utf8'),
17
+ ts.ScriptTarget.Latest,
18
+ true,
19
+ );
20
+ const runtimeExports = source.statements.flatMap((statement) => {
21
+ if (
22
+ !ts.canHaveModifiers(statement) ||
23
+ !ts
24
+ .getModifiers(statement)
25
+ ?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)
26
+ )
27
+ return [];
28
+ if (ts.isFunctionDeclaration(statement) && statement.name) return [statement.name.text];
29
+ if (ts.isVariableStatement(statement))
30
+ return statement.declarationList.declarations.map((declaration) =>
31
+ declaration.name.getText(source),
32
+ );
33
+ return [];
34
+ });
35
+ expect(runtimeExports, join(directory, name)).toEqual([parse(name).name]);
36
+ }
37
+ }
38
+ }
39
+ });
40
+
41
+ test('Chess and Tabletop source graphs contain no standalone package or game-service imports', () => {
42
+ const sourcePaths = featureRoots.flatMap((featureRoot) => {
43
+ const visit = (directory: string): string[] =>
44
+ readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
45
+ const path = join(directory, entry.name);
46
+ if (entry.isDirectory()) return visit(path);
47
+ return /\.(?:ts|tsx)$/.test(entry.name) && !entry.name.includes('.test.') ? [path] : [];
48
+ });
49
+ return visit(featureRoot);
50
+ });
51
+ for (const path of sourcePaths) {
52
+ const source = ts.createSourceFile(
53
+ path,
54
+ readFileSync(path, 'utf8'),
55
+ ts.ScriptTarget.Latest,
56
+ true,
57
+ );
58
+ const imports = source.statements
59
+ .filter(ts.isImportDeclaration)
60
+ .map((statement) => statement.moduleSpecifier)
61
+ .filter(ts.isStringLiteral)
62
+ .map((literal) => literal.text);
63
+ for (const specifier of imports) {
64
+ if (specifier.startsWith('.')) continue;
65
+ expect(
66
+ ['react', 'react-native', '@ankhorage/color-theory'],
67
+ `${path}: ${specifier}`,
68
+ ).toContain(specifier);
69
+ }
70
+ }
71
+ });
@@ -0,0 +1,43 @@
1
+ import { RuntimeRendererConfigProvider } from '@ankhorage/runtime';
2
+ import React from 'react';
3
+
4
+ import type { GameProps } from '../../../../types/gamePresentation';
5
+ import { createGameBindingContext } from '../../composition/createGameBindingContext';
6
+ import { createGameMeasurementRegistry } from '../../composition/createGameMeasurementRegistry';
7
+ import { GameRuntimeContext } from '../../composition/GameRuntimeContext';
8
+ import { useGameRuntime } from '../../composition/useGameRuntime';
9
+ import { GameField } from './GameField';
10
+
11
+ /*** Bind one serializable game definition to a local transient session and presentation field. */
12
+ export function Game(props: GameProps) {
13
+ const runtime = useGameRuntime(props);
14
+ const [measurementRegistry] = React.useState(createGameMeasurementRegistry);
15
+ const runtimeContext = React.useMemo(
16
+ () => ({ ...runtime, ...measurementRegistry, interactionPolicy: props.interactionPolicy }),
17
+ [measurementRegistry, props.interactionPolicy, runtime],
18
+ );
19
+ const runtimeBindingConfig = React.useMemo(
20
+ () => ({ bindingContext: createGameBindingContext(runtime.session) }),
21
+ [runtime.session],
22
+ );
23
+
24
+ return (
25
+ <GameRuntimeContext.Provider value={runtimeContext}>
26
+ <RuntimeRendererConfigProvider value={runtimeBindingConfig}>
27
+ <GameField
28
+ {...(props.aspectRatio === undefined ? {} : { aspectRatio: props.aspectRatio })}
29
+ {...(props.minHeight === undefined ? {} : { minHeight: props.minHeight })}
30
+ {...(props.fill === undefined ? {} : { fill: props.fill })}
31
+ {...(props.clip === undefined ? {} : { clip: props.clip })}
32
+ {...(props.accessibilityLabel === undefined
33
+ ? {}
34
+ : { accessibilityLabel: props.accessibilityLabel })}
35
+ {...(props.testID === undefined ? {} : { testID: props.testID })}
36
+ interactionPolicy={props.interactionPolicy}
37
+ >
38
+ {props.children}
39
+ </GameField>
40
+ </RuntimeRendererConfigProvider>
41
+ </GameRuntimeContext.Provider>
42
+ );
43
+ }
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { Animated, StyleSheet, type View, type ViewStyle } from 'react-native';
3
+
4
+ import type { GameEntityProps } from '../../../../types/gamePresentation';
5
+ import { useGameEntityAnimatedStyle } from '../../utils/useGameEntityAnimatedStyle';
6
+ import { useGameEntityMeasurement } from '../../utils/useGameEntityMeasurement';
7
+
8
+ /*** Render one generic positioned game entity without owning gameplay semantics. */
9
+ export function GameEntity(props: GameEntityProps) {
10
+ const elementRef = React.useRef<View | null>(null);
11
+ const animatedStyle = useGameEntityAnimatedStyle(props);
12
+ useGameEntityMeasurement(elementRef, props.measurementId);
13
+
14
+ return (
15
+ <Animated.View
16
+ ref={elementRef}
17
+ accessibilityLabel={props.accessibilityLabel}
18
+ testID={props.testID}
19
+ pointerEvents={
20
+ props.interactionPolicy === 'passive' ? 'none' : (props.pointerEvents ?? 'auto')
21
+ }
22
+ style={[styles.root, createEntityStaticStyle(props), animatedStyle]}
23
+ >
24
+ {props.children}
25
+ </Animated.View>
26
+ );
27
+ }
28
+
29
+ /*** Convert non-animated GameEntity presentation props into a React Native view style. */
30
+ function createEntityStaticStyle(props: GameEntityProps): ViewStyle {
31
+ return {
32
+ display: props.hidden === true ? 'none' : 'flex',
33
+ position: 'absolute',
34
+ zIndex: props.zIndex ?? 0,
35
+ ...(props.height === undefined ? {} : { height: props.height }),
36
+ ...(props.width === undefined ? {} : { width: props.width }),
37
+ };
38
+ }
39
+
40
+ const styles = StyleSheet.create({
41
+ root: {
42
+ position: 'absolute',
43
+ },
44
+ });