@pretty-chitty/core 1.1.2 → 1.2.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 (351) hide show
  1. package/dist/components/BottomBarButton.d.ts +2 -1
  2. package/dist/components/BottomBarButton.d.ts.map +1 -1
  3. package/dist/components/BottomBarButton.js +2 -1
  4. package/dist/components/BottomBarButton.js.map +1 -1
  5. package/dist/components/ClientTrustMatchViewer.d.ts +4 -1
  6. package/dist/components/ClientTrustMatchViewer.d.ts.map +1 -1
  7. package/dist/components/ClientTrustMatchViewer.js +11 -4
  8. package/dist/components/ClientTrustMatchViewer.js.map +1 -1
  9. package/dist/components/ContextGalleryDisplay.js +1 -1
  10. package/dist/components/ContextGalleryDisplay.js.map +1 -1
  11. package/dist/components/DemoWrapper.d.ts +9 -0
  12. package/dist/components/DemoWrapper.d.ts.map +1 -0
  13. package/dist/components/DemoWrapper.js +76 -0
  14. package/dist/components/DemoWrapper.js.map +1 -0
  15. package/dist/components/FullScreenGalleryDisplay.d.ts +2 -0
  16. package/dist/components/FullScreenGalleryDisplay.d.ts.map +1 -0
  17. package/dist/components/FullScreenGalleryDisplay.js +56 -0
  18. package/dist/components/FullScreenGalleryDisplay.js.map +1 -0
  19. package/dist/components/Gallery/AnimationController.d.ts +19 -0
  20. package/dist/components/Gallery/AnimationController.d.ts.map +1 -0
  21. package/dist/components/Gallery/AnimationController.js +82 -0
  22. package/dist/components/Gallery/AnimationController.js.map +1 -0
  23. package/dist/components/Gallery/BuiltItem.d.ts +58 -0
  24. package/dist/components/Gallery/BuiltItem.d.ts.map +1 -0
  25. package/dist/components/Gallery/BuiltItem.js +313 -0
  26. package/dist/components/Gallery/BuiltItem.js.map +1 -0
  27. package/dist/components/Gallery/CameraManager.d.ts +14 -0
  28. package/dist/components/Gallery/CameraManager.d.ts.map +1 -0
  29. package/dist/components/Gallery/CameraManager.js +43 -0
  30. package/dist/components/Gallery/CameraManager.js.map +1 -0
  31. package/dist/components/Gallery/GalleryController.d.ts +30 -0
  32. package/dist/components/Gallery/GalleryController.d.ts.map +1 -0
  33. package/dist/components/Gallery/GalleryController.js +137 -0
  34. package/dist/components/Gallery/GalleryController.js.map +1 -0
  35. package/dist/components/Gallery/GalleryViewer.d.ts +18 -0
  36. package/dist/components/Gallery/GalleryViewer.d.ts.map +1 -0
  37. package/dist/components/Gallery/GalleryViewer.js +141 -0
  38. package/dist/components/Gallery/GalleryViewer.js.map +1 -0
  39. package/dist/components/Gallery/LayoutManager.d.ts +49 -0
  40. package/dist/components/Gallery/LayoutManager.d.ts.map +1 -0
  41. package/dist/components/Gallery/LayoutManager.js +132 -0
  42. package/dist/components/Gallery/LayoutManager.js.map +1 -0
  43. package/dist/components/Gallery/constants.d.ts +13 -0
  44. package/dist/components/Gallery/constants.d.ts.map +1 -0
  45. package/dist/components/Gallery/constants.js +13 -0
  46. package/dist/components/Gallery/constants.js.map +1 -0
  47. package/dist/components/Gallery/index.d.ts +3 -0
  48. package/dist/components/Gallery/index.d.ts.map +1 -0
  49. package/dist/components/Gallery/index.js +2 -0
  50. package/dist/components/Gallery/index.js.map +1 -0
  51. package/dist/components/Gallery/types.d.ts +45 -0
  52. package/dist/components/Gallery/types.d.ts.map +1 -0
  53. package/dist/components/Gallery/types.js +2 -0
  54. package/dist/components/Gallery/types.js.map +1 -0
  55. package/dist/components/GalleryPlayground.js +1 -1
  56. package/dist/components/GalleryPlayground.js.map +1 -1
  57. package/dist/components/GalleryViewer.d.ts +2 -47
  58. package/dist/components/GalleryViewer.d.ts.map +1 -1
  59. package/dist/components/GalleryViewer.js +3 -569
  60. package/dist/components/GalleryViewer.js.map +1 -1
  61. package/dist/components/GameDesigner.d.ts.map +1 -1
  62. package/dist/components/GameDesigner.js +13 -2
  63. package/dist/components/GameDesigner.js.map +1 -1
  64. package/dist/components/InlineGalleryDisplay.d.ts +2 -0
  65. package/dist/components/InlineGalleryDisplay.d.ts.map +1 -0
  66. package/dist/components/InlineGalleryDisplay.js +69 -0
  67. package/dist/components/InlineGalleryDisplay.js.map +1 -0
  68. package/dist/components/LiveButton.d.ts.map +1 -1
  69. package/dist/components/LiveButton.js +1 -1
  70. package/dist/components/LiveButton.js.map +1 -1
  71. package/dist/components/MatchViewer.d.ts +0 -1
  72. package/dist/components/MatchViewer.d.ts.map +1 -1
  73. package/dist/components/MatchViewer.js +20 -10
  74. package/dist/components/MatchViewer.js.map +1 -1
  75. package/dist/components/Panel/MultiPanel.d.ts.map +1 -1
  76. package/dist/components/Panel/MultiPanel.js +14 -7
  77. package/dist/components/Panel/MultiPanel.js.map +1 -1
  78. package/dist/components/Panel/PanelContents.d.ts +2 -1
  79. package/dist/components/Panel/PanelContents.d.ts.map +1 -1
  80. package/dist/components/Panel/PanelContents.js +16 -11
  81. package/dist/components/Panel/PanelContents.js.map +1 -1
  82. package/dist/components/Panel/SinglePanel.d.ts.map +1 -1
  83. package/dist/components/Panel/SinglePanel.js +4 -3
  84. package/dist/components/Panel/SinglePanel.js.map +1 -1
  85. package/dist/components/Panel/ViewerWrapper.d.ts +1 -3
  86. package/dist/components/Panel/ViewerWrapper.d.ts.map +1 -1
  87. package/dist/components/Panel/ViewerWrapper.js +2 -3
  88. package/dist/components/Panel/ViewerWrapper.js.map +1 -1
  89. package/dist/components/Playground.d.ts.map +1 -1
  90. package/dist/components/Playground.js +353 -50
  91. package/dist/components/Playground.js.map +1 -1
  92. package/dist/components/PromptControls.d.ts.map +1 -1
  93. package/dist/components/PromptControls.js +39 -6
  94. package/dist/components/PromptControls.js.map +1 -1
  95. package/dist/components/ServerTrustMatchViewer.d.ts +11 -0
  96. package/dist/components/ServerTrustMatchViewer.d.ts.map +1 -0
  97. package/dist/components/ServerTrustMatchViewer.js +26 -0
  98. package/dist/components/ServerTrustMatchViewer.js.map +1 -0
  99. package/dist/components/Viewer.d.ts.map +1 -1
  100. package/dist/components/Viewer.js +54 -14
  101. package/dist/components/Viewer.js.map +1 -1
  102. package/dist/game/Chit.d.ts +6 -2
  103. package/dist/game/Chit.d.ts.map +1 -1
  104. package/dist/game/Chit.js +50 -6
  105. package/dist/game/Chit.js.map +1 -1
  106. package/dist/game/ClientTimeState.d.ts +1 -0
  107. package/dist/game/ClientTimeState.d.ts.map +1 -1
  108. package/dist/game/ClientTimeState.js +4 -1
  109. package/dist/game/ClientTimeState.js.map +1 -1
  110. package/dist/game/GalleryItemChitChildrenSource.d.ts +1 -0
  111. package/dist/game/GalleryItemChitChildrenSource.d.ts.map +1 -1
  112. package/dist/game/GalleryItemChitChildrenSource.js +1 -0
  113. package/dist/game/GalleryItemChitChildrenSource.js.map +1 -1
  114. package/dist/game/GalleryItemRawSource.d.ts +1 -0
  115. package/dist/game/GalleryItemRawSource.d.ts.map +1 -1
  116. package/dist/game/GalleryItemRawSource.js +1 -0
  117. package/dist/game/GalleryItemRawSource.js.map +1 -1
  118. package/dist/game/Game.d.ts +2 -1
  119. package/dist/game/Game.d.ts.map +1 -1
  120. package/dist/game/GameButton.d.ts +1 -0
  121. package/dist/game/GameButton.d.ts.map +1 -1
  122. package/dist/game/GameButton.js +2 -0
  123. package/dist/game/GameButton.js.map +1 -1
  124. package/dist/game/GameDeckChit.d.ts +6 -0
  125. package/dist/game/GameDeckChit.d.ts.map +1 -1
  126. package/dist/game/GameDeckChit.js +32 -5
  127. package/dist/game/GameDeckChit.js.map +1 -1
  128. package/dist/game/GameMetaData.d.ts +18 -0
  129. package/dist/game/GameMetaData.d.ts.map +1 -0
  130. package/dist/game/GameMetaData.js +2 -0
  131. package/dist/game/GameMetaData.js.map +1 -0
  132. package/dist/game/GameTheme.d.ts +11 -0
  133. package/dist/game/GameTheme.d.ts.map +1 -1
  134. package/dist/game/GameTheme.js +19 -4
  135. package/dist/game/GameTheme.js.map +1 -1
  136. package/dist/game/Match.d.ts +2 -1
  137. package/dist/game/Match.d.ts.map +1 -1
  138. package/dist/game/Match.js +4 -3
  139. package/dist/game/Match.js.map +1 -1
  140. package/dist/game/MatchStorage.d.ts +10 -0
  141. package/dist/game/MatchStorage.d.ts.map +1 -1
  142. package/dist/game/MatchStorage.js +29 -0
  143. package/dist/game/MatchStorage.js.map +1 -1
  144. package/dist/game/ModalState.d.ts +1 -0
  145. package/dist/game/ModalState.d.ts.map +1 -1
  146. package/dist/game/ModalState.js +1 -0
  147. package/dist/game/ModalState.js.map +1 -1
  148. package/dist/game/OrderedOutlet.d.ts.map +1 -1
  149. package/dist/game/OrderedOutlet.js +6 -6
  150. package/dist/game/OrderedOutlet.js.map +1 -1
  151. package/dist/game/Pick.d.ts +11 -1
  152. package/dist/game/Pick.d.ts.map +1 -1
  153. package/dist/game/Pick.js +83 -1
  154. package/dist/game/Pick.js.map +1 -1
  155. package/dist/game/PlayerChit.d.ts +2 -1
  156. package/dist/game/PlayerChit.d.ts.map +1 -1
  157. package/dist/game/PlayerChit.js +13 -1
  158. package/dist/game/PlayerChit.js.map +1 -1
  159. package/dist/game/PlayerInfo.d.ts +2 -1
  160. package/dist/game/PlayerInfo.d.ts.map +1 -1
  161. package/dist/game/PlayerInfo.js +20 -3
  162. package/dist/game/PlayerInfo.js.map +1 -1
  163. package/dist/game/Prompt.d.ts +1 -11
  164. package/dist/game/Prompt.d.ts.map +1 -1
  165. package/dist/game/Prompt.js +0 -32
  166. package/dist/game/Prompt.js.map +1 -1
  167. package/dist/game/RootChit.d.ts +4 -0
  168. package/dist/game/RootChit.d.ts.map +1 -1
  169. package/dist/game/RootChit.js +36 -1
  170. package/dist/game/RootChit.js.map +1 -1
  171. package/dist/game/Turn.d.ts +9 -8
  172. package/dist/game/Turn.d.ts.map +1 -1
  173. package/dist/game/Turn.js +34 -34
  174. package/dist/game/Turn.js.map +1 -1
  175. package/dist/game/TurnState.d.ts +3 -2
  176. package/dist/game/TurnState.d.ts.map +1 -1
  177. package/dist/game/TurnState.js +22 -2
  178. package/dist/game/TurnState.js.map +1 -1
  179. package/dist/game/badAiTransport/BadAIClientPrompts.d.ts +14 -0
  180. package/dist/game/badAiTransport/BadAIClientPrompts.d.ts.map +1 -0
  181. package/dist/game/badAiTransport/BadAIClientPrompts.js +50 -0
  182. package/dist/game/badAiTransport/BadAIClientPrompts.js.map +1 -0
  183. package/dist/game/clientTransport/ClientTime.js +1 -1
  184. package/dist/game/clientTransport/ClientTime.js.map +1 -1
  185. package/dist/game/serverTransport/ServerTime.d.ts.map +1 -1
  186. package/dist/game/serverTransport/ServerTime.js +1 -1
  187. package/dist/game/serverTransport/ServerTime.js.map +1 -1
  188. package/dist/hooks/useButtonGalleriesOptions.d.ts +4 -0
  189. package/dist/hooks/useButtonGalleriesOptions.d.ts.map +1 -0
  190. package/dist/hooks/useButtonGalleriesOptions.js +7 -0
  191. package/dist/hooks/useButtonGalleriesOptions.js.map +1 -0
  192. package/dist/hooks/useEventChannelState.js +1 -1
  193. package/dist/hooks/useEventChannelState.js.map +1 -1
  194. package/dist/hooks/useLoadingStates.d.ts +17 -0
  195. package/dist/hooks/useLoadingStates.d.ts.map +1 -0
  196. package/dist/hooks/useLoadingStates.js +44 -0
  197. package/dist/hooks/useLoadingStates.js.map +1 -0
  198. package/dist/hooks/useModalState.d.ts +2 -1
  199. package/dist/hooks/useModalState.d.ts.map +1 -1
  200. package/dist/hooks/useModalState.js +2 -2
  201. package/dist/hooks/useModalState.js.map +1 -1
  202. package/dist/hooks/usePanelPositioning.d.ts +0 -1
  203. package/dist/hooks/usePanelPositioning.d.ts.map +1 -1
  204. package/dist/hooks/usePanelPositioning.js.map +1 -1
  205. package/dist/index.d.ts +7 -5
  206. package/dist/index.d.ts.map +1 -1
  207. package/dist/index.js +17 -1
  208. package/dist/index.js.map +1 -1
  209. package/dist/rendering/CameraWrapperPerspective.d.ts.map +1 -1
  210. package/dist/rendering/CameraWrapperPerspective.js +1 -1
  211. package/dist/rendering/CameraWrapperPerspective.js.map +1 -1
  212. package/dist/rendering/ChitGalleryItemInstance.d.ts +2 -0
  213. package/dist/rendering/ChitGalleryItemInstance.d.ts.map +1 -1
  214. package/dist/rendering/ChitGalleryItemInstance.js +2 -0
  215. package/dist/rendering/ChitGalleryItemInstance.js.map +1 -1
  216. package/dist/rendering/ChitRenderInstance.d.ts +13 -2
  217. package/dist/rendering/ChitRenderInstance.d.ts.map +1 -1
  218. package/dist/rendering/ChitRenderInstance.js +95 -47
  219. package/dist/rendering/ChitRenderInstance.js.map +1 -1
  220. package/dist/rendering/ChitRenderSpec.d.ts +3 -0
  221. package/dist/rendering/ChitRenderSpec.d.ts.map +1 -1
  222. package/dist/rendering/ChitRenderSpec.js +3 -0
  223. package/dist/rendering/ChitRenderSpec.js.map +1 -1
  224. package/dist/rendering/RootChitRenderInstance.d.ts +5 -2
  225. package/dist/rendering/RootChitRenderInstance.d.ts.map +1 -1
  226. package/dist/rendering/RootChitRenderInstance.js +76 -13
  227. package/dist/rendering/RootChitRenderInstance.js.map +1 -1
  228. package/dist/rendering/SplayCounter.d.ts.map +1 -1
  229. package/dist/rendering/SplayCounter.js +1 -1
  230. package/dist/rendering/SplayCounter.js.map +1 -1
  231. package/dist/rendering/TextureReferenceCounter.d.ts +1 -1
  232. package/dist/rendering/TextureReferenceCounter.d.ts.map +1 -1
  233. package/dist/rendering/TextureReferenceCounter.js +10 -10
  234. package/dist/rendering/TextureReferenceCounter.js.map +1 -1
  235. package/dist/rendering/outline/passes/DepthOcclusionPass.js +1 -1
  236. package/dist/rendering/outline/passes/DepthOcclusionPass.js.map +1 -1
  237. package/dist/utilities/Annotations.d.ts +59 -0
  238. package/dist/utilities/Annotations.d.ts.map +1 -1
  239. package/dist/utilities/Annotations.js +63 -0
  240. package/dist/utilities/Annotations.js.map +1 -1
  241. package/dist/utilities/CanvasStack/CanvasOperations.d.ts +10 -1
  242. package/dist/utilities/CanvasStack/CanvasOperations.d.ts.map +1 -1
  243. package/dist/utilities/CanvasStack/CanvasOperations.js +8 -0
  244. package/dist/utilities/CanvasStack/CanvasOperations.js.map +1 -1
  245. package/dist/utilities/CanvasStack/ReactCanvas.d.ts +4 -2
  246. package/dist/utilities/CanvasStack/ReactCanvas.d.ts.map +1 -1
  247. package/dist/utilities/CanvasStack/ReactCanvas.js +5 -2
  248. package/dist/utilities/CanvasStack/ReactCanvas.js.map +1 -1
  249. package/dist/utilities/CanvasStack/RichTextRenderer.d.ts.map +1 -1
  250. package/dist/utilities/CanvasStack/RichTextRenderer.js +12 -4
  251. package/dist/utilities/CanvasStack/RichTextRenderer.js.map +1 -1
  252. package/dist/utilities/EventChannel.d.ts.map +1 -1
  253. package/dist/utilities/EventChannel.js +2 -3
  254. package/dist/utilities/EventChannel.js.map +1 -1
  255. package/dist/utilities/GlbLoader.d.ts +15 -0
  256. package/dist/utilities/GlbLoader.d.ts.map +1 -0
  257. package/dist/utilities/GlbLoader.js +212 -0
  258. package/dist/utilities/GlbLoader.js.map +1 -0
  259. package/dist/utilities/LayoutHelper.js +23 -2
  260. package/dist/utilities/LayoutHelper.js.map +1 -1
  261. package/dist/utilities/ObjectWithProps.d.ts.map +1 -1
  262. package/dist/utilities/ObjectWithProps.js +32 -3
  263. package/dist/utilities/ObjectWithProps.js.map +1 -1
  264. package/package.json +6 -5
  265. package/src/library/components/BottomBarButton.tsx +3 -0
  266. package/src/library/components/ClientTrustMatchViewer.tsx +23 -8
  267. package/src/library/components/ContextGalleryDisplay.tsx +2 -2
  268. package/src/library/components/DemoWrapper.tsx +113 -0
  269. package/src/library/components/{GalleryDisplay.tsx → FullScreenGalleryDisplay.tsx} +28 -2
  270. package/src/library/components/Gallery/AnimationController.ts +110 -0
  271. package/src/library/components/Gallery/BuiltItem.ts +385 -0
  272. package/src/library/components/Gallery/CameraManager.ts +54 -0
  273. package/src/library/components/Gallery/GalleryController.ts +193 -0
  274. package/src/library/components/Gallery/GalleryViewer.tsx +211 -0
  275. package/src/library/components/Gallery/LayoutManager.ts +166 -0
  276. package/src/library/components/Gallery/constants.ts +12 -0
  277. package/src/library/components/Gallery/index.ts +2 -0
  278. package/src/library/components/Gallery/types.ts +55 -0
  279. package/src/library/components/GalleryPlayground.tsx +1 -1
  280. package/src/library/components/GalleryViewer.tsx +4 -773
  281. package/src/library/components/GameDesigner.tsx +21 -4
  282. package/src/library/components/InlineGalleryDisplay.tsx +101 -0
  283. package/src/library/components/LiveButton.tsx +2 -1
  284. package/src/library/components/MatchViewer.tsx +32 -14
  285. package/src/library/components/Panel/MultiPanel.tsx +20 -8
  286. package/src/library/components/Panel/PanelContents.tsx +17 -12
  287. package/src/library/components/Panel/SinglePanel.tsx +5 -4
  288. package/src/library/components/Panel/ViewerWrapper.tsx +0 -5
  289. package/src/library/components/Playground.tsx +692 -119
  290. package/src/library/components/PromptControls.tsx +61 -8
  291. package/src/library/components/ServerTrustMatchViewer.tsx +53 -0
  292. package/src/library/components/Viewer.tsx +60 -20
  293. package/src/library/game/Chit.ts +53 -6
  294. package/src/library/game/ClientTimeState.ts +5 -1
  295. package/src/library/game/GalleryItemChitChildrenSource.ts +2 -0
  296. package/src/library/game/GalleryItemRawSource.ts +2 -0
  297. package/src/library/game/Game.ts +3 -1
  298. package/src/library/game/GameButton.ts +3 -0
  299. package/src/library/game/GameDeckChit.ts +36 -5
  300. package/src/library/game/GameMetaData.ts +19 -0
  301. package/src/library/game/GameTheme.ts +23 -5
  302. package/src/library/game/Match.ts +4 -3
  303. package/src/library/game/MatchStorage.ts +37 -0
  304. package/src/library/game/ModalState.ts +1 -0
  305. package/src/library/game/OrderedOutlet.ts +6 -6
  306. package/src/library/game/Pick.ts +98 -2
  307. package/src/library/game/PlayerChit.ts +13 -1
  308. package/src/library/game/PlayerInfo.ts +22 -3
  309. package/src/library/game/Prompt.ts +1 -36
  310. package/src/library/game/RootChit.ts +41 -1
  311. package/src/library/game/Turn.ts +37 -40
  312. package/src/library/game/TurnState.ts +22 -3
  313. package/src/library/game/badAiTransport/BadAIClientPrompts.ts +60 -0
  314. package/src/library/game/clientTransport/ClientTime.ts +1 -1
  315. package/src/library/game/serverTransport/ServerTime.ts +2 -2
  316. package/src/library/hooks/useButtonGalleriesOptions.tsx +9 -0
  317. package/src/library/hooks/useEventChannelState.ts +1 -1
  318. package/src/library/hooks/useLoadingStates.tsx +55 -0
  319. package/src/library/hooks/useModalState.tsx +2 -2
  320. package/src/library/hooks/usePanelPositioning.tsx +0 -1
  321. package/src/library/index.ts +21 -1
  322. package/src/library/rendering/CameraWrapperPerspective.ts +10 -12
  323. package/src/library/rendering/ChitGalleryItemInstance.ts +2 -0
  324. package/src/library/rendering/ChitRenderInstance.ts +119 -61
  325. package/src/library/rendering/ChitRenderSpec.ts +4 -0
  326. package/src/library/rendering/RootChitRenderInstance.ts +87 -13
  327. package/src/library/rendering/SplayCounter.tsx +2 -1
  328. package/src/library/rendering/TextureReferenceCounter.ts +9 -9
  329. package/src/library/rendering/outline/passes/DepthOcclusionPass.ts +1 -1
  330. package/src/library/utilities/Annotations.ts +99 -0
  331. package/src/library/utilities/CanvasStack/CanvasOperations.tsx +19 -1
  332. package/src/library/utilities/CanvasStack/ReactCanvas.tsx +10 -3
  333. package/src/library/utilities/CanvasStack/RichTextRenderer.ts +14 -4
  334. package/src/library/utilities/EventChannel.ts +2 -4
  335. package/src/library/utilities/GlbLoader.ts +292 -0
  336. package/src/library/utilities/LayoutHelper.ts +28 -2
  337. package/src/library/utilities/ObjectWithProps.ts +27 -3
  338. package/dist/components/GalleryDisplay.d.ts +0 -2
  339. package/dist/components/GalleryDisplay.d.ts.map +0 -1
  340. package/dist/components/GalleryDisplay.js +0 -42
  341. package/dist/components/GalleryDisplay.js.map +0 -1
  342. package/dist/utilities/OutlineCanvas.d.ts +0 -12
  343. package/dist/utilities/OutlineCanvas.d.ts.map +0 -1
  344. package/dist/utilities/OutlineCanvas.js +0 -31
  345. package/dist/utilities/OutlineCanvas.js.map +0 -1
  346. package/dist/utilities/OutlineGeometry.d.ts +0 -3
  347. package/dist/utilities/OutlineGeometry.d.ts.map +0 -1
  348. package/dist/utilities/OutlineGeometry.js +0 -57
  349. package/dist/utilities/OutlineGeometry.js.map +0 -1
  350. package/src/library/utilities/OutlineCanvas.tsx +0 -45
  351. package/src/library/utilities/OutlineGeometry.ts +0 -69
@@ -5,13 +5,23 @@ import CanvasLibraryViewer from "./CanvasLibraryViewer";
5
5
  import { Game } from "../game/Game";
6
6
  import ChitLibraryViewer from "./ChitLibraryViewer";
7
7
  import Playground from "./Playground";
8
- import GalleryPlayground from "./GalleryPlayground";
8
+ import { DemoWrapper } from "./DemoWrapper";
9
9
 
10
10
  export function GameDesigner({ game }: { game: Game<any, any> }) {
11
11
  const [tabIndex, setTabIndex] = useLocalStorageState("selectedMainTab", {
12
12
  defaultValue: 2,
13
13
  });
14
14
 
15
+ const isDemo = window.location.pathname.endsWith("/demo");
16
+
17
+ if (isDemo) {
18
+ return (
19
+ <Stack sx={{ height: "100vh", maxHeight: "-webkit-fill-available", width: "100vw" }}>
20
+ <DemoWrapper game={game} />
21
+ </Stack>
22
+ );
23
+ }
24
+
15
25
  return (
16
26
  <Stack sx={{ height: "100vh", maxHeight: "-webkit-fill-available", width: "100vw" }}>
17
27
  <CssBaseline />
@@ -19,7 +29,13 @@ export function GameDesigner({ game }: { game: Game<any, any> }) {
19
29
  <AppBar position="static">
20
30
  <Tabs
21
31
  value={tabIndex}
22
- onChange={(e, newValue) => setTabIndex(newValue)}
32
+ onChange={(e, newValue) => {
33
+ if (newValue === 3) {
34
+ document.location.pathname = "/demo";
35
+ } else {
36
+ setTabIndex(newValue);
37
+ }
38
+ }}
23
39
  indicatorColor="secondary"
24
40
  textColor="inherit"
25
41
  variant="fullWidth"
@@ -27,13 +43,14 @@ export function GameDesigner({ game }: { game: Game<any, any> }) {
27
43
  <Tab label="Canvas" />
28
44
  <Tab label="Chits" />
29
45
  <Tab label="Playground" />
30
- <Tab label="Gallery" />
46
+ <Tab label="Demo" />
47
+ {/* <Tab label="Gallery" /> */}
31
48
  </Tabs>
32
49
  </AppBar>
33
50
  {tabIndex === 0 && <CanvasLibraryViewer library={game.canvasLibrary} />}
34
51
  {tabIndex === 1 && <ChitLibraryViewer library={game.chitLibrary} />}
35
52
  {tabIndex === 2 && <Playground game={game} />}
36
- {tabIndex === 3 && <GalleryPlayground game={game} />}
53
+ {/* {tabIndex === 3 && <GalleryPlayground game={game} />} */}
37
54
  </Stack>
38
55
  );
39
56
  }
@@ -0,0 +1,101 @@
1
+ import React, { useEffect, useState, useRef } from "react";
2
+ import { Box, IconButton } from "@mui/material";
3
+ import { useEventChannelState } from "../hooks/useEventChannelState";
4
+ import { useModalState } from "../hooks/useModalState";
5
+ import { GalleryItem, GalleryViewer } from "./GalleryViewer";
6
+ import useSize from "@react-hook/size";
7
+ import { useAnimationSpeedMultiplier } from "../hooks/useTimeController";
8
+ import { useGameTheme } from "../hooks/useGameTheme";
9
+ import { ScreenshotMonitor } from "@mui/icons-material";
10
+ import { useButtonGalleriesOptions } from "../hooks/useButtonGalleriesOptions";
11
+
12
+ const DELAY = 300;
13
+ const DEFAULT_INLINE_GALLERY_SIZE = 125;
14
+
15
+ export function InlineGalleryDisplay() {
16
+ const theme = useGameTheme();
17
+ const animationSpeedMultiplier = useAnimationSpeedMultiplier();
18
+ const ref = useRef(null);
19
+ const [width, height] = useSize(ref);
20
+ const modalState = useModalState();
21
+ const [items, setItems] = useState<GalleryItem[] | undefined>(undefined);
22
+ const [_source, setSource] = useEventChannelState(modalState.gallerySource);
23
+ const [inlineSource, setInlineSource] = useEventChannelState(modalState.inlineGallerySource);
24
+ const inlineGallerySize = inlineSource?.inlineGallerySize ?? DEFAULT_INLINE_GALLERY_SIZE;
25
+ const [displaySize, setDisplaySize] = useState(0);
26
+ const [_galleryDisplayMode, setGalleryDisplayMode] = useButtonGalleriesOptions();
27
+
28
+ useEffect(() => {
29
+ if (inlineSource) {
30
+ setItems(inlineSource.items);
31
+ const unSub = inlineSource.registerUpdateHandler(() => {
32
+ setItems(inlineSource.items);
33
+ });
34
+ return () => {
35
+ inlineSource.close();
36
+ unSub();
37
+ };
38
+ } else {
39
+ setItems(undefined);
40
+ }
41
+ }, [inlineSource, setItems, inlineGallerySize]);
42
+
43
+ useEffect(() => {
44
+ if (items && items.length > 0) {
45
+ setDisplaySize(inlineGallerySize);
46
+ } else {
47
+ const to = setTimeout(() => {
48
+ setDisplaySize(0);
49
+ }, 250);
50
+ return () => clearTimeout(to);
51
+ }
52
+ }, [inlineGallerySize, items, setDisplaySize]);
53
+
54
+ return (
55
+ <Box
56
+ sx={{
57
+ position: "relative",
58
+ background: theme.inlineGalleryBackgroundColor,
59
+ height: `${displaySize}px`,
60
+ overflow: "hidden",
61
+ }}
62
+ ref={ref}
63
+ >
64
+ {
65
+ <>
66
+ <IconButton
67
+ sx={{
68
+ backgroundColor: theme.inlineGalleryButtonBackgroundColor,
69
+ position: "absolute",
70
+ bottom: 4,
71
+ right: 4,
72
+ zIndex: 2,
73
+ }}
74
+ size="small"
75
+ onClick={() => {
76
+ setSource(inlineSource);
77
+ setInlineSource(undefined);
78
+ setGalleryDisplayMode("modal");
79
+ }}
80
+ >
81
+ <ScreenshotMonitor sx={{ color: theme.inlineGalleryButtonForegroundColor }} />
82
+ </IconButton>
83
+
84
+ <GalleryViewer
85
+ zFactor={0}
86
+ onClose={() => {}}
87
+ fov={5}
88
+ items={items ?? []}
89
+ tweenDuration={DELAY * animationSpeedMultiplier * 0.8}
90
+ galleryItemWidth={theme.galleryItemWidth}
91
+ galleryItemHeight={theme.galleryItemHeight}
92
+ itemSpacing={theme.galleryItemSpacing}
93
+ showSummary={"partial"}
94
+ w={width}
95
+ h={height}
96
+ />
97
+ </>
98
+ }
99
+ </Box>
100
+ );
101
+ }
@@ -19,7 +19,8 @@ export default function LiveButton({ hideIfLive = true }: { hideIfLive?: boolean
19
19
  <BottomBarButton
20
20
  disabled={targetClock >= maxClock.clock && live}
21
21
  icon={SkipNext}
22
- label={"Live"}
22
+ label={live && targetClock < maxClock.clock ? "Skip" : "Live"}
23
+ invisible={live && targetClock >= maxClock.clock}
23
24
  onClick={() => timeState.goLive(maxClock.clock)}
24
25
  />
25
26
  );
@@ -1,29 +1,33 @@
1
- import React, { useEffect, useRef, useState } from "react";
1
+ import React, { useEffect, useMemo, useRef, useState } from "react";
2
2
  import { useGame } from "../hooks/useGame";
3
3
  import { Box, CssBaseline, Stack, ThemeProvider, createTheme } from "@mui/material";
4
4
  import { TimeControllerProvider, useClientStatus, useTimeController } from "../hooks/useTimeController";
5
5
  import BottomBar from "./BottomBar";
6
6
  import { GameThemeProvider, useGameTheme } from "../hooks/useGameTheme";
7
-
8
- import "@fontsource/raleway/400.css";
9
7
  import TopBar from "./TopBar";
10
8
  import { useEventChannelState } from "../hooks/useEventChannelState";
11
9
  import { MatchEndDisplay } from "./MatchEndDisplay";
12
10
  import { PanelScaleProvider } from "../hooks/usePanelScale";
13
11
  import { ModalProvider } from "../hooks/useModalState";
14
- import { GalleryDisplay } from "./GalleryDisplay";
12
+ import { FullScreenGalleryDisplay } from "./FullScreenGalleryDisplay";
15
13
  import { ActionLogDisplay } from "./ActionLogDisplay";
16
14
  import { ActionLogHistoryDisplay } from "./ActionLogHistoryDisplay";
17
15
  import { PanelContents } from "./Panel/PanelContents";
18
16
  import useSize from "@react-hook/size";
19
17
  import { SettingsDisplay } from "./SettingsDisplay";
20
18
  import { ActionLogSidebar } from "./ActionLogSidebar";
19
+ import { InlineGalleryDisplay } from "./InlineGalleryDisplay";
20
+ import { useLoadingState } from "../hooks/useLoadingStates";
21
+ import { GameTheme } from "../game/GameTheme";
22
+ import { ModalState } from "../game/ModalState";
21
23
 
22
- const theme = createTheme({
23
- typography: {
24
- fontFamily: ["Raleway", "sans-serif"].join(","),
25
- },
26
- });
24
+ function createMuiTheme(gameTheme: GameTheme) {
25
+ return createTheme({
26
+ typography: {
27
+ fontFamily: gameTheme.fontFamily,
28
+ },
29
+ });
30
+ }
27
31
 
28
32
  function InnerMatchViewer({ onBack }: { onBack?: () => void }) {
29
33
  const timeController = useTimeController();
@@ -36,6 +40,11 @@ function InnerMatchViewer({ onBack }: { onBack?: () => void }) {
36
40
  const [width, height] = useSize(ref);
37
41
  const [outerWidth] = useSize(outerRef);
38
42
  const [showLog] = useEventChannelState(timeController.clientTimeState.showLog);
43
+ const loadingStates = useLoadingState();
44
+
45
+ if (errorMessage) {
46
+ loadingStates.markError();
47
+ }
39
48
 
40
49
  useEffect(
41
50
  () =>
@@ -75,13 +84,20 @@ function InnerMatchViewer({ onBack }: { onBack?: () => void }) {
75
84
  >
76
85
  <Box flex={1} style={{ display: "flex", position: "relative" }}>
77
86
  <MatchEndDisplay />
78
- <GalleryDisplay />
87
+ <FullScreenGalleryDisplay />
79
88
  <SettingsDisplay />
80
89
  <ActionLogHistoryDisplay />
81
90
 
82
- {!errorMessage && rootChit && <PanelContents rootChit={rootChit} scaleWidth={width} scaleHeight={height} />}
91
+ <Stack direction={"column"} flex={1}>
92
+ {!errorMessage && rootChit && (
93
+ <PanelContents rootChit={rootChit} scaleWidth={width} scaleHeight={height} />
94
+ )}
95
+
96
+ <InlineGalleryDisplay />
97
+ </Stack>
83
98
  {errorMessage}
84
99
  </Box>
100
+
85
101
  <ActionLogDisplay toggleSidebarLog={largeEnoughToShowLogSidebar} />
86
102
  </Stack>
87
103
  <BottomBar />
@@ -94,13 +110,15 @@ function InnerMatchViewer({ onBack }: { onBack?: () => void }) {
94
110
 
95
111
  export function MatchViewer({ onBack }: { onBack?: () => void }) {
96
112
  const game = useGame();
113
+ const [modalState] = useState<ModalState>(new ModalState());
114
+ const muiTheme = useMemo(() => createMuiTheme(game.theme), [game.theme]);
97
115
  return (
98
116
  <TimeControllerProvider>
99
- <CssBaseline />
100
117
  <PanelScaleProvider>
101
- <ModalProvider>
118
+ <ModalProvider modalState={modalState}>
102
119
  <GameThemeProvider theme={game.theme}>
103
- <ThemeProvider theme={theme}>
120
+ <ThemeProvider theme={muiTheme}>
121
+ <CssBaseline />
104
122
  <InnerMatchViewer onBack={onBack} />
105
123
  </ThemeProvider>
106
124
  </GameThemeProvider>
@@ -1,9 +1,13 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from "react";
2
2
  import { Box, Stack } from "@mui/material";
3
- import { useDebounce } from "@react-hook/debounce";
4
3
  import { Chit } from "../../game/Chit";
5
4
  import { useGameTheme } from "../../hooks/useGameTheme";
6
- import { useAnimationSpeedMultiplier, useTimeController, useTimeState } from "../../hooks/useTimeController";
5
+ import {
6
+ useAnimationSpeedMultiplier,
7
+ useClientPrompts,
8
+ useTimeController,
9
+ useTimeState,
10
+ } from "../../hooks/useTimeController";
7
11
  import { usePanelStates } from "../../hooks/usePanelStates";
8
12
  import { RootChitRenderInstance } from "../../rendering/RootChitRenderInstance";
9
13
  import { useEventChannelState } from "../../hooks/useEventChannelState";
@@ -15,7 +19,7 @@ import { ViewerZoomControls } from "./ViewerZoomControls";
15
19
 
16
20
  const ANIMATION_DURATION = 0.125;
17
21
 
18
- const PANEL_ADJUST_IGNORE_DURATION = 5000;
22
+ const PANEL_ADJUST_IGNORE_DURATION = 10000;
19
23
 
20
24
  export function MultiPanel({
21
25
  chits,
@@ -52,6 +56,8 @@ export function MultiPanel({
52
56
  const timeMultiplier = useAnimationSpeedMultiplier();
53
57
 
54
58
  const [ignoreChangesBefore, setIgnoreChangesBefore] = useState(0);
59
+ const clientPrompt = useClientPrompts();
60
+ const [prompt] = useEventChannelState(clientPrompt.currentPrompt);
55
61
 
56
62
  const [isSliding, setIsSliding] = useState(false);
57
63
  const [isLoading] = useEventChannelState(timeState.isLoading);
@@ -71,6 +77,8 @@ export function MultiPanel({
71
77
  );
72
78
  const panelStates = usePanelStates(rootRenders);
73
79
 
80
+ const effectiveTabHeight = rootRenders.length > 1 ? TAB_HEIGHT : 0;
81
+
74
82
  const manuallyChangeSelectedIndex = useCallback(
75
83
  (index: number) => {
76
84
  if (index !== selectedIndex) {
@@ -81,6 +89,7 @@ export function MultiPanel({
81
89
  if (!prompt) {
82
90
  setIgnoreChangesBefore(Date.now() + PANEL_ADJUST_IGNORE_DURATION);
83
91
  }
92
+ timeState.killAnimations();
84
93
  }
85
94
  },
86
95
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -89,10 +98,13 @@ export function MultiPanel({
89
98
 
90
99
  useEffect(() => {
91
100
  if (ignoreChangesBefore) {
92
- const to = setTimeout(() => setIgnoreChangesBefore(0), ignoreChangesBefore - Date.now());
101
+ const to = setTimeout(() => {
102
+ setIgnoreChangesBefore(0);
103
+ rootRenders.forEach((chit) => chit && chit.resetMarks());
104
+ }, ignoreChangesBefore - Date.now());
93
105
  return () => clearTimeout(to);
94
106
  }
95
- }, [ignoreChangesBefore]);
107
+ }, [ignoreChangesBefore, rootRenders]);
96
108
 
97
109
  useEffect(() => {
98
110
  if (isFocusedPanel) {
@@ -197,9 +209,8 @@ export function MultiPanel({
197
209
  x: x + theme.spacing / 4,
198
210
  y: y + theme.spacing / 4,
199
211
  w: w - theme.spacing / 2,
200
- h: h - TAB_HEIGHT - theme.spacing / 2,
212
+ h: h - effectiveTabHeight - theme.spacing / 2,
201
213
  paused: isPaused,
202
- refContainer,
203
214
  panCallback,
204
215
  visible: true,
205
216
  front: index === effectiveSelectedIndex,
@@ -224,6 +235,7 @@ export function MultiPanel({
224
235
  refContainer,
225
236
  panCallback,
226
237
  timeMultiplier,
238
+ effectiveTabHeight,
227
239
  ]);
228
240
 
229
241
  const focusedRoot = focusedPanel?.renderInstance as RootChitRenderInstance;
@@ -264,7 +276,7 @@ export function MultiPanel({
264
276
  )}
265
277
  </Box>
266
278
 
267
- {enabled && (
279
+ {enabled && chits.length > 1 && (
268
280
  <PanelTabStack
269
281
  chits={chits}
270
282
  selectedIndex={effectiveSelectedIndex}
@@ -17,8 +17,9 @@ export interface ViewerGestureHandlers {
17
17
  onSingleTap?: (x: number, y: number, isMouse: boolean) => void;
18
18
  onDoubleTap?: (x: number, y: number) => void;
19
19
  onLongTap?: (x: number, y: number, isMouse: boolean) => void;
20
- onPanStart?: () => void;
20
+ onPanStart?: (x: number, y: number, isMouse: boolean) => void;
21
21
  onPan?: (dx: number, dy: number, ev: HammerInput) => void;
22
+ onPanEnd?: () => void;
22
23
  onPinchStart?: () => void;
23
24
  onPinch?: (scale: number, deltaScale: number, centerX: number, centerY: number) => void;
24
25
  onPinchEnd?: () => void;
@@ -76,12 +77,7 @@ export function PanelContents({
76
77
 
77
78
  // Panel positioning system
78
79
  const positionsRef = useRef<Map<string, ViewerPosition>>(
79
- new Map([
80
- [
81
- "root",
82
- { chitId: "root", x: -40, y: 0, w: 30, h: 30, front: true, visible: true, paused: true, refContainer: null },
83
- ],
84
- ]),
80
+ new Map([["root", { chitId: "root", x: -40, y: 0, w: 30, h: 30, front: true, visible: true, paused: true }]]),
85
81
  );
86
82
  const [, forceUpdate] = useState({});
87
83
 
@@ -173,11 +169,18 @@ export function PanelContents({
173
169
 
174
170
  // Pan handlers
175
171
  hammer.on("panstart", (ev) => {
176
- activeViewer = findViewerAtPoint(ev.center.x, ev.center.y);
172
+ const startX = ev.center.x - ev.deltaX;
173
+ const startY = ev.center.y - ev.deltaY;
174
+ activeViewer = findViewerAtPoint(startX, startY);
177
175
  lastDeltaX = 0;
178
176
  lastDeltaY = 0;
179
177
  panCancelled = false;
180
- activeViewer?.handlers.onPanStart?.();
178
+ const bounds = activeViewer?.getBounds();
179
+ if (bounds) {
180
+ const x = startX - bounds.left;
181
+ const y = startY - bounds.top;
182
+ activeViewer!.handlers.onPanStart?.(x, y, ev.pointerType === "mouse");
183
+ }
181
184
  });
182
185
 
183
186
  hammer.on("pan", (ev) => {
@@ -195,6 +198,9 @@ export function PanelContents({
195
198
  });
196
199
 
197
200
  hammer.on("panend", () => {
201
+ if (activeViewer) {
202
+ activeViewer.handlers.onPanEnd?.();
203
+ }
198
204
  activeViewer = null;
199
205
  });
200
206
 
@@ -265,7 +271,7 @@ export function PanelContents({
265
271
  }}
266
272
  >
267
273
  {layout.map((cell) => {
268
- if (Array.isArray(cell.chit)) {
274
+ if (Array.isArray(cell.chit) && cell.chit.length > 1) {
269
275
  return (
270
276
  <MultiPanel
271
277
  enabled={focusedPanel === undefined}
@@ -287,7 +293,7 @@ export function PanelContents({
287
293
  focusedPanel={focusedPanel}
288
294
  setFocusedPanel={setFocusedPanel}
289
295
  key={cell.id}
290
- chit={cell.chit}
296
+ chit={Array.isArray(cell.chit) ? cell.chit[0] : cell.chit}
291
297
  w={cell.w}
292
298
  h={cell.h}
293
299
  x={cell.x}
@@ -345,7 +351,6 @@ export function PanelContents({
345
351
  x={position.x}
346
352
  y={position.y}
347
353
  paused={position.paused}
348
- refContainer={position.refContainer}
349
354
  panCallback={position.panCallback}
350
355
  transition={position.transition}
351
356
  />
@@ -4,7 +4,6 @@ import { Chit } from "../../game/Chit";
4
4
  import { useGameTheme } from "../../hooks/useGameTheme";
5
5
  import { panelTransition } from "./util";
6
6
  import { useAnimationSpeedMultiplier } from "../../hooks/useTimeController";
7
- import { ZINDEX_PINCH_OUT_FOCUSED } from "../../utilities/zIndex";
8
7
  import { usePanelPositioning } from "../../hooks/usePanelPositioning";
9
8
 
10
9
  export function SinglePanel({
@@ -34,6 +33,8 @@ export function SinglePanel({
34
33
 
35
34
  const effectivePaused = !enabled ? true : paused;
36
35
 
36
+ const transition = panelTransition(theme, animationSpeedMultiplier);
37
+
37
38
  // Register position for ViewerWrapper (only when NOT in full-screen focus mode)
38
39
  useEffect(() => {
39
40
  // If focusedPanel is set, don't register - the full-screen MultiPanel in PanelContents handles it
@@ -49,11 +50,11 @@ export function SinglePanel({
49
50
  w: w - theme.spacing / 2,
50
51
  h: h - theme.spacing / 2,
51
52
  paused: effectivePaused,
52
- refContainer: null,
53
53
  front: true,
54
54
  visible: true,
55
+ transition,
55
56
  });
56
- }, [chit, x, y, w, h, effectivePaused, enabled, focusedPanel, registerPosition, theme.spacing]);
57
+ }, [chit, x, y, w, h, transition, effectivePaused, enabled, focusedPanel, registerPosition, theme.spacing]);
57
58
 
58
59
  return (
59
60
  <Box
@@ -65,7 +66,7 @@ export function SinglePanel({
65
66
  top: `${y}px`,
66
67
  position: "absolute",
67
68
  p: `${theme.spacing / 4}px`,
68
- transition: panelTransition(theme, animationSpeedMultiplier),
69
+ transition,
69
70
  zIndex: enabled ? "auto" : -1,
70
71
  }}
71
72
  >
@@ -18,7 +18,6 @@ export function ViewerWrapper({
18
18
  paused,
19
19
  front,
20
20
  panCallback,
21
- refContainer,
22
21
  focusedPanel,
23
22
  setFocusedPanel,
24
23
  transition,
@@ -31,7 +30,6 @@ export function ViewerWrapper({
31
30
  paused: boolean;
32
31
  front: boolean;
33
32
  panCallback?: (direction: "left" | "right") => void;
34
- refContainer: React.RefObject<HTMLElement> | null;
35
33
  focusedPanel?: Chit | undefined;
36
34
  setFocusedPanel: (chit: Chit | undefined) => void;
37
35
  transition?: string | null;
@@ -92,8 +90,6 @@ export function ViewerWrapper({
92
90
  }
93
91
  }, [focusedPanel, chit]);
94
92
 
95
- const rootRenderInstance = chit.renderInstance as RootChitRenderInstance;
96
-
97
93
  return (
98
94
  <Box
99
95
  sx={{
@@ -116,7 +112,6 @@ export function ViewerWrapper({
116
112
  </Stack>
117
113
 
118
114
  <Viewer
119
- refContainer={refContainer}
120
115
  paused={override ? false : paused}
121
116
  hardPaused={override ? false : !front}
122
117
  chit={chit}