@nice2dev/game-engine 1.3.15 → 1.3.16

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 (434) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/accessibility/Accessibility.js +152 -165
  3. package/dist/cjs/ai/AI.js +292 -294
  4. package/dist/cjs/ai/BehaviorTree.js +1029 -1113
  5. package/dist/cjs/ai/StateMachine.js +694 -756
  6. package/dist/cjs/animation/Animation.js +232 -241
  7. package/dist/cjs/audio/AudioAdvanced.js +221 -236
  8. package/dist/cjs/audio/AudioBridge.js +441 -435
  9. package/dist/cjs/audio/AudioManager.js +242 -259
  10. package/dist/cjs/build-cloud/BuildOrchestration.js +1059 -1098
  11. package/dist/cjs/build-cloud/GodotBuildCloud.js +641 -670
  12. package/dist/cjs/build-cloud/UnityBuildCloud.js +563 -610
  13. package/dist/cjs/build-cloud/UnrealBuildCloud.js +610 -635
  14. package/dist/cjs/core/EventBus.js +51 -56
  15. package/dist/cjs/core/GameClock.js +62 -66
  16. package/dist/cjs/core/GameConfig.js +72 -79
  17. package/dist/cjs/core/GameLoop.js +80 -89
  18. package/dist/cjs/core/ServiceLocator.js +61 -65
  19. package/dist/cjs/core/Validation.js +72 -82
  20. package/dist/cjs/core/math.js +108 -112
  21. package/dist/cjs/devtools/DevTools.js +542 -563
  22. package/dist/cjs/devtools/DeveloperExperience.js +521 -559
  23. package/dist/cjs/devtools/GameplayAnalytics.js +636 -646
  24. package/dist/cjs/dialogue/DialogueSystem.js +984 -986
  25. package/dist/cjs/docs/DocGenerator.js +339 -364
  26. package/dist/cjs/ecs/World.js +355 -371
  27. package/dist/cjs/editor/AchievementEditor.js +580 -636
  28. package/dist/cjs/editor/AdvancedEditor.js +184 -191
  29. package/dist/cjs/editor/AnimationRetargeting.js +696 -741
  30. package/dist/cjs/editor/AssetBrowser.js +1072 -1160
  31. package/dist/cjs/editor/AssetManager.js +187 -192
  32. package/dist/cjs/editor/ConsolePro.js +971 -1061
  33. package/dist/cjs/editor/CraftingEditor.js +680 -730
  34. package/dist/cjs/editor/DebugTools.js +187 -185
  35. package/dist/cjs/editor/DialogueSystem.js +844 -901
  36. package/dist/cjs/editor/LeaderboardSystem.js +429 -483
  37. package/dist/cjs/editor/NiceGameEditor.js +1903 -1201
  38. package/dist/cjs/editor/PrefabSystem.js +772 -838
  39. package/dist/cjs/editor/ProfilerPanel.js +649 -700
  40. package/dist/cjs/editor/QuestEditor.js +792 -839
  41. package/dist/cjs/editor/ReplaySystem.js +585 -634
  42. package/dist/cjs/editor/SceneEditor.js +176 -200
  43. package/dist/cjs/editor/ScreenshotMode.js +621 -688
  44. package/dist/cjs/editor/ShaderGraph.js +1556 -1582
  45. package/dist/cjs/editor/TimelineEditor.js +715 -778
  46. package/dist/cjs/editor/UndoRedoPro.js +830 -904
  47. package/dist/cjs/editor/VRARMode.js +582 -645
  48. package/dist/cjs/engine/NiceGameEngine.js +141 -164
  49. package/dist/cjs/engine/SaveSystem.js +441 -495
  50. package/dist/cjs/enterprise/Enterprise.js +254 -261
  51. package/dist/cjs/export/BevyExporter.js +927 -967
  52. package/dist/cjs/export/CocosExporter.js +644 -673
  53. package/dist/cjs/export/Construct3Exporter.js +783 -794
  54. package/dist/cjs/export/DefoldExporter.js +1028 -1069
  55. package/dist/cjs/export/GDevelopExporter.js +674 -708
  56. package/dist/cjs/export/GameMakerExporter.js +791 -805
  57. package/dist/cjs/export/GodotExporter.js +1003 -1045
  58. package/dist/cjs/export/MinecraftBedrockExporter.js +573 -578
  59. package/dist/cjs/export/MonoGameExporter.js +1265 -1293
  60. package/dist/cjs/export/Pico8Exporter.js +766 -812
  61. package/dist/cjs/export/PlatformExporter.js +188 -206
  62. package/dist/cjs/export/RPGMakerExporter.js +860 -879
  63. package/dist/cjs/export/RobloxExporter.js +883 -919
  64. package/dist/cjs/export/Solar2DExporter.js +1218 -1256
  65. package/dist/cjs/export/ThreeJSExporter.js +1006 -1073
  66. package/dist/cjs/export/Tic80Exporter.js +1210 -1267
  67. package/dist/cjs/export/UnityExporter.js +1116 -1131
  68. package/dist/cjs/export/UnrealExporter.js +889 -919
  69. package/dist/cjs/export/WebExporter.js +931 -970
  70. package/dist/cjs/export/index.js +42 -65
  71. package/dist/cjs/godot-integration/GodotAssetLibrary.js +659 -692
  72. package/dist/cjs/godot-integration/GodotImport.js +929 -1027
  73. package/dist/cjs/godot-integration/GodotLiveLink.js +915 -945
  74. package/dist/cjs/godot-integration/components/GodotProjectBrowser.js +911 -611
  75. package/dist/cjs/i18n/I18n.js +860 -900
  76. package/dist/cjs/i18n/useTranslation.js +84 -89
  77. package/dist/cjs/import/AsepriteImporter.js +658 -716
  78. package/dist/cjs/import/DragonBonesImporter.js +437 -461
  79. package/dist/cjs/import/GameMakerImporter.js +511 -521
  80. package/dist/cjs/import/GodotSceneImporter.js +788 -822
  81. package/dist/cjs/import/LDtkImporter.js +436 -454
  82. package/dist/cjs/import/Live2DImporter.js +497 -518
  83. package/dist/cjs/import/NdgFormat.js +424 -457
  84. package/dist/cjs/import/OgmoImporter.js +466 -493
  85. package/dist/cjs/import/RPGMakerImporter.js +451 -477
  86. package/dist/cjs/import/SceneImporter.js +378 -423
  87. package/dist/cjs/import/SpineImporter.js +511 -546
  88. package/dist/cjs/import/SpriterImporter.js +590 -613
  89. package/dist/cjs/import/TiledMapImporter.js +811 -846
  90. package/dist/cjs/import/UnitySceneImporter.js +687 -703
  91. package/dist/cjs/import/index.js +206 -251
  92. package/dist/cjs/index.js +275 -278
  93. package/dist/cjs/input/GamepadNavigation.js +185 -205
  94. package/dist/cjs/input/InputManager.js +397 -421
  95. package/dist/cjs/input/useGamepads.js +70 -81
  96. package/dist/cjs/integration/IconSprite.js +129 -256
  97. package/dist/cjs/inventory/InventorySystem.js +920 -995
  98. package/dist/cjs/kids/KidMode.js +997 -1022
  99. package/dist/cjs/kids/KidTools.js +570 -594
  100. package/dist/cjs/monetization/Monetization.js +170 -177
  101. package/dist/cjs/multiplayer/LocalMultiplayer.js +287 -287
  102. package/dist/cjs/multiplayer/MiniGameTypes.js +49 -59
  103. package/dist/cjs/native-engine/AnimationSystem.js +731 -806
  104. package/dist/cjs/native-engine/AssetPipeline.js +454 -515
  105. package/dist/cjs/native-engine/AudioEngine.js +763 -804
  106. package/dist/cjs/native-engine/InputSystem.js +1075 -1145
  107. package/dist/cjs/native-engine/NetworkingSystem.js +733 -793
  108. package/dist/cjs/native-engine/PhysicsEngine.js +583 -607
  109. package/dist/cjs/native-engine/RenderingEngine.js +302 -350
  110. package/dist/cjs/native-engine/SceneGraph.js +769 -808
  111. package/dist/cjs/network/MultiplayerTransport.js +97 -132
  112. package/dist/cjs/network/Networking.js +549 -564
  113. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AbortController.js +21 -29
  114. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +40 -48
  115. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +35 -43
  116. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +10 -15
  117. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Errors.js +103 -135
  118. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +131 -158
  119. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +39 -53
  120. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +5 -8
  121. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +40 -48
  122. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +494 -572
  123. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +826 -953
  124. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +125 -146
  125. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +13 -23
  126. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ILogger.js +11 -25
  127. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ITransport.js +13 -24
  128. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +108 -121
  129. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Loggers.js +10 -14
  130. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +150 -185
  131. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +158 -196
  132. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +90 -105
  133. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Subject.js +30 -35
  134. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +16 -21
  135. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Utils.js +215 -248
  136. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +135 -157
  137. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +76 -85
  138. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/index.js +24 -27
  139. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +3 -4
  140. package/dist/cjs/pathfinding/Pathfinding.js +245 -263
  141. package/dist/cjs/performance/AssetStreaming.js +561 -635
  142. package/dist/cjs/performance/BenchmarkSuite.js +283 -311
  143. package/dist/cjs/performance/DeltaCompression.js +467 -526
  144. package/dist/cjs/performance/DeterministicPhysics.js +450 -498
  145. package/dist/cjs/performance/ECSOptimization.js +644 -695
  146. package/dist/cjs/performance/GameSaveSystem.js +509 -556
  147. package/dist/cjs/performance/HotReload.js +447 -500
  148. package/dist/cjs/performance/InputRecording.js +511 -561
  149. package/dist/cjs/performance/InterestManagement.js +453 -500
  150. package/dist/cjs/performance/LocalizationRuntime.js +376 -423
  151. package/dist/cjs/performance/MemoryManagement.js +410 -470
  152. package/dist/cjs/performance/ModSupport.js +445 -496
  153. package/dist/cjs/performance/MultiThreadedPhysics.js +400 -443
  154. package/dist/cjs/performance/NetworkPrediction.js +424 -482
  155. package/dist/cjs/performance/ObjectPooling.js +569 -617
  156. package/dist/cjs/performance/Performance.js +174 -190
  157. package/dist/cjs/performance/PerformanceAdvanced.js +614 -637
  158. package/dist/cjs/performance/WebGPURenderer.js +656 -683
  159. package/dist/cjs/physics/PhysicsAdvanced.js +345 -379
  160. package/dist/cjs/physics/PhysicsEngine2D.js +391 -427
  161. package/dist/cjs/plugins/PluginSDK.js +432 -466
  162. package/dist/cjs/plugins/PluginTestKit.js +307 -330
  163. package/dist/cjs/procedural/Procedural.js +243 -254
  164. package/dist/cjs/procedural/WorldBuilding.js +297 -314
  165. package/dist/cjs/quest/QuestSystem.js +975 -932
  166. package/dist/cjs/release/MobileExport.js +157 -163
  167. package/dist/cjs/release/Release.js +225 -238
  168. package/dist/cjs/rendering/Camera2D.js +121 -124
  169. package/dist/cjs/rendering/Renderer2D.js +321 -335
  170. package/dist/cjs/rendering/WebGPURenderPipeline.js +632 -651
  171. package/dist/cjs/runtime3d/Runtime3D.js +359 -378
  172. package/dist/cjs/runtime3d/SceneEditor3D.js +252 -263
  173. package/dist/cjs/scene/SceneManager.js +177 -193
  174. package/dist/cjs/scripting/GraphToAST.js +574 -547
  175. package/dist/cjs/scripting/LanguageExporter.js +254 -279
  176. package/dist/cjs/scripting/NodeGraph.js +546 -570
  177. package/dist/cjs/scripting/ScriptAST.js +31 -39
  178. package/dist/cjs/scripting/VisualScripting2.js +1016 -1065
  179. package/dist/cjs/scripting/exporters/CSharpExporter.js +464 -496
  180. package/dist/cjs/scripting/exporters/GDScriptExporter.js +390 -442
  181. package/dist/cjs/scripting/exporters/LuaExporter.js +406 -447
  182. package/dist/cjs/scripting/exporters/PythonExporter.js +484 -549
  183. package/dist/cjs/scripting/exporters/RustExporter.js +459 -512
  184. package/dist/cjs/scripting/exporters/TypeScriptExporter.js +505 -556
  185. package/dist/cjs/social/Social.js +72 -80
  186. package/dist/cjs/systems/LightingSystem.js +844 -931
  187. package/dist/cjs/systems/ParticleSystem2.js +1447 -1451
  188. package/dist/cjs/systems/PhysicsDebugSystem.js +1070 -1141
  189. package/dist/cjs/systems/TerrainSystem.js +985 -1098
  190. package/dist/cjs/templates/ActionTemplates.js +296 -309
  191. package/dist/cjs/templates/FightingTemplate.js +417 -463
  192. package/dist/cjs/templates/MetroidvaniaTemplate.js +353 -405
  193. package/dist/cjs/templates/PartyTemplates.js +190 -202
  194. package/dist/cjs/templates/PuzzleTemplates.js +245 -261
  195. package/dist/cjs/templates/RPGTemplates.js +160 -178
  196. package/dist/cjs/templates/SportsTemplates.js +237 -250
  197. package/dist/cjs/templates/StrategyTemplates.js +143 -153
  198. package/dist/cjs/templates/SurvivalTemplate.js +336 -380
  199. package/dist/cjs/templates/WaveDefense.js +499 -526
  200. package/dist/cjs/tilemap/Tilemap.js +207 -214
  201. package/dist/cjs/tutorials/TutorialBranching.js +396 -417
  202. package/dist/cjs/tutorials/TutorialEngine.js +888 -931
  203. package/dist/cjs/tutorials/TutorialOverlay.js +602 -640
  204. package/dist/cjs/tutorials/content/Tutorials_T05_T08.js +787 -809
  205. package/dist/cjs/tutorials/content/Tutorials_T09_T11.js +736 -756
  206. package/dist/cjs/tutorials/content/Tutorials_T12_T15.js +754 -778
  207. package/dist/cjs/ui/GameUI.js +295 -312
  208. package/dist/cjs/unity-integration/UnityAssetStore.js +700 -741
  209. package/dist/cjs/unity-integration/UnityImport.js +1066 -1176
  210. package/dist/cjs/unity-integration/UnityLiveLink.js +934 -981
  211. package/dist/cjs/unity-integration/components/UnityAssetStoreBrowser.js +1233 -757
  212. package/dist/cjs/unity-integration/components/UnityProjectBrowser.js +1240 -768
  213. package/dist/cjs/unreal-integration/UnrealImport.js +391 -412
  214. package/dist/cjs/unreal-integration/UnrealLiveLink.js +1102 -1137
  215. package/dist/cjs/unreal-integration/UnrealMarketplace.js +436 -473
  216. package/dist/cjs/unreal-integration/components/UnrealProjectBrowser.js +1150 -767
  217. package/dist/cjs/xr/ARVR.js +167 -175
  218. package/dist/esm/accessibility/Accessibility.js +160 -164
  219. package/dist/esm/ai/AI.js +310 -293
  220. package/dist/esm/ai/BehaviorTree.js +1057 -1112
  221. package/dist/esm/ai/StateMachine.js +709 -755
  222. package/dist/esm/animation/Animation.js +237 -240
  223. package/dist/esm/audio/AudioAdvanced.js +239 -235
  224. package/dist/esm/audio/AudioBridge.js +448 -434
  225. package/dist/esm/audio/AudioManager.js +243 -258
  226. package/dist/esm/build-cloud/BuildOrchestration.js +1071 -1097
  227. package/dist/esm/build-cloud/GodotBuildCloud.js +647 -669
  228. package/dist/esm/build-cloud/UnityBuildCloud.js +571 -609
  229. package/dist/esm/build-cloud/UnrealBuildCloud.js +615 -634
  230. package/dist/esm/core/EventBus.js +52 -55
  231. package/dist/esm/core/GameClock.js +63 -65
  232. package/dist/esm/core/GameConfig.js +77 -78
  233. package/dist/esm/core/GameLoop.js +81 -88
  234. package/dist/esm/core/ServiceLocator.js +63 -64
  235. package/dist/esm/core/Validation.js +82 -81
  236. package/dist/esm/core/math.js +109 -111
  237. package/dist/esm/devtools/DevTools.js +546 -562
  238. package/dist/esm/devtools/DeveloperExperience.js +535 -558
  239. package/dist/esm/devtools/GameplayAnalytics.js +647 -645
  240. package/dist/esm/dialogue/DialogueSystem.js +998 -985
  241. package/dist/esm/docs/DocGenerator.js +342 -363
  242. package/dist/esm/ecs/World.js +358 -370
  243. package/dist/esm/editor/AchievementEditor.js +584 -635
  244. package/dist/esm/editor/AdvancedEditor.js +191 -190
  245. package/dist/esm/editor/AnimationRetargeting.js +700 -740
  246. package/dist/esm/editor/AssetBrowser.js +1078 -1159
  247. package/dist/esm/editor/AssetManager.js +188 -191
  248. package/dist/esm/editor/ConsolePro.js +977 -1060
  249. package/dist/esm/editor/CraftingEditor.js +684 -729
  250. package/dist/esm/editor/DebugTools.js +194 -184
  251. package/dist/esm/editor/DialogueSystem.js +849 -900
  252. package/dist/esm/editor/LeaderboardSystem.js +433 -482
  253. package/dist/esm/editor/NiceGameEditor.js +1908 -1200
  254. package/dist/esm/editor/PrefabSystem.js +777 -837
  255. package/dist/esm/editor/ProfilerPanel.js +654 -699
  256. package/dist/esm/editor/QuestEditor.js +795 -838
  257. package/dist/esm/editor/ReplaySystem.js +591 -633
  258. package/dist/esm/editor/SceneEditor.js +189 -199
  259. package/dist/esm/editor/ScreenshotMode.js +628 -687
  260. package/dist/esm/editor/ShaderGraph.js +1565 -1581
  261. package/dist/esm/editor/TimelineEditor.js +733 -777
  262. package/dist/esm/editor/UndoRedoPro.js +835 -903
  263. package/dist/esm/editor/VRARMode.js +586 -644
  264. package/dist/esm/engine/NiceGameEngine.js +142 -163
  265. package/dist/esm/engine/SaveSystem.js +447 -494
  266. package/dist/esm/enterprise/Enterprise.js +265 -260
  267. package/dist/esm/export/BevyExporter.js +929 -966
  268. package/dist/esm/export/CocosExporter.js +646 -672
  269. package/dist/esm/export/Construct3Exporter.js +785 -793
  270. package/dist/esm/export/DefoldExporter.js +1030 -1068
  271. package/dist/esm/export/GDevelopExporter.js +676 -707
  272. package/dist/esm/export/GameMakerExporter.js +793 -804
  273. package/dist/esm/export/GodotExporter.js +1004 -1044
  274. package/dist/esm/export/MinecraftBedrockExporter.js +575 -577
  275. package/dist/esm/export/MonoGameExporter.js +1267 -1292
  276. package/dist/esm/export/Pico8Exporter.js +768 -811
  277. package/dist/esm/export/PlatformExporter.js +193 -205
  278. package/dist/esm/export/RPGMakerExporter.js +862 -878
  279. package/dist/esm/export/RobloxExporter.js +885 -918
  280. package/dist/esm/export/Solar2DExporter.js +1220 -1255
  281. package/dist/esm/export/ThreeJSExporter.js +1007 -1072
  282. package/dist/esm/export/Tic80Exporter.js +1212 -1266
  283. package/dist/esm/export/UnityExporter.js +1117 -1130
  284. package/dist/esm/export/UnrealExporter.js +891 -918
  285. package/dist/esm/export/WebExporter.js +933 -969
  286. package/dist/esm/export/index.js +86 -71
  287. package/dist/esm/godot-integration/GodotAssetLibrary.js +663 -691
  288. package/dist/esm/godot-integration/GodotImport.js +935 -1026
  289. package/dist/esm/godot-integration/GodotLiveLink.js +918 -944
  290. package/dist/esm/godot-integration/components/GodotProjectBrowser.js +912 -610
  291. package/dist/esm/i18n/I18n.js +871 -899
  292. package/dist/esm/i18n/useTranslation.js +88 -88
  293. package/dist/esm/import/AsepriteImporter.js +637 -715
  294. package/dist/esm/import/DragonBonesImporter.js +417 -460
  295. package/dist/esm/import/GameMakerImporter.js +491 -520
  296. package/dist/esm/import/GodotSceneImporter.js +767 -821
  297. package/dist/esm/import/LDtkImporter.js +415 -453
  298. package/dist/esm/import/Live2DImporter.js +477 -517
  299. package/dist/esm/import/NdgFormat.js +410 -456
  300. package/dist/esm/import/OgmoImporter.js +446 -492
  301. package/dist/esm/import/RPGMakerImporter.js +431 -476
  302. package/dist/esm/import/SceneImporter.js +385 -422
  303. package/dist/esm/import/SpineImporter.js +491 -545
  304. package/dist/esm/import/SpriterImporter.js +570 -612
  305. package/dist/esm/import/TiledMapImporter.js +790 -845
  306. package/dist/esm/import/UnitySceneImporter.js +666 -702
  307. package/dist/esm/import/index.js +247 -258
  308. package/dist/esm/index.js +1332 -188
  309. package/dist/esm/input/GamepadNavigation.js +187 -204
  310. package/dist/esm/input/InputManager.js +401 -420
  311. package/dist/esm/input/useGamepads.js +72 -80
  312. package/dist/esm/integration/IconSprite.js +143 -255
  313. package/dist/esm/inventory/InventorySystem.js +925 -994
  314. package/dist/esm/kids/KidMode.js +1003 -1021
  315. package/dist/esm/kids/KidTools.js +573 -593
  316. package/dist/esm/monetization/Monetization.js +180 -176
  317. package/dist/esm/multiplayer/LocalMultiplayer.js +290 -286
  318. package/dist/esm/multiplayer/MiniGameTypes.js +58 -58
  319. package/dist/esm/native-engine/AnimationSystem.js +735 -805
  320. package/dist/esm/native-engine/AssetPipeline.js +456 -514
  321. package/dist/esm/native-engine/AudioEngine.js +765 -803
  322. package/dist/esm/native-engine/InputSystem.js +1079 -1144
  323. package/dist/esm/native-engine/NetworkingSystem.js +740 -792
  324. package/dist/esm/native-engine/PhysicsEngine.js +585 -606
  325. package/dist/esm/native-engine/RenderingEngine.js +304 -349
  326. package/dist/esm/native-engine/SceneGraph.js +773 -807
  327. package/dist/esm/network/MultiplayerTransport.js +99 -131
  328. package/dist/esm/network/Networking.js +556 -563
  329. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AbortController.js +22 -28
  330. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +41 -47
  331. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +36 -42
  332. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +11 -14
  333. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Errors.js +111 -134
  334. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +132 -157
  335. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +40 -52
  336. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +6 -7
  337. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +42 -47
  338. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +496 -571
  339. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +828 -952
  340. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +126 -145
  341. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +14 -23
  342. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ILogger.js +12 -25
  343. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ITransport.js +15 -24
  344. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +109 -120
  345. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Loggers.js +11 -13
  346. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +151 -184
  347. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +159 -195
  348. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +91 -104
  349. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Subject.js +31 -34
  350. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +17 -20
  351. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Utils.js +230 -248
  352. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +136 -156
  353. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +77 -84
  354. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/index.js +31 -12
  355. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +4 -3
  356. package/dist/esm/pathfinding/Pathfinding.js +249 -262
  357. package/dist/esm/performance/AssetStreaming.js +567 -634
  358. package/dist/esm/performance/BenchmarkSuite.js +285 -310
  359. package/dist/esm/performance/DeltaCompression.js +478 -525
  360. package/dist/esm/performance/DeterministicPhysics.js +479 -497
  361. package/dist/esm/performance/ECSOptimization.js +653 -694
  362. package/dist/esm/performance/GameSaveSystem.js +515 -555
  363. package/dist/esm/performance/HotReload.js +454 -499
  364. package/dist/esm/performance/InputRecording.js +520 -560
  365. package/dist/esm/performance/InterestManagement.js +460 -499
  366. package/dist/esm/performance/LocalizationRuntime.js +382 -422
  367. package/dist/esm/performance/MemoryManagement.js +415 -469
  368. package/dist/esm/performance/ModSupport.js +455 -495
  369. package/dist/esm/performance/MultiThreadedPhysics.js +408 -442
  370. package/dist/esm/performance/NetworkPrediction.js +436 -481
  371. package/dist/esm/performance/ObjectPooling.js +582 -616
  372. package/dist/esm/performance/Performance.js +182 -189
  373. package/dist/esm/performance/PerformanceAdvanced.js +621 -636
  374. package/dist/esm/performance/WebGPURenderer.js +660 -682
  375. package/dist/esm/physics/PhysicsAdvanced.js +359 -378
  376. package/dist/esm/physics/PhysicsEngine2D.js +393 -426
  377. package/dist/esm/plugins/PluginSDK.js +435 -465
  378. package/dist/esm/plugins/PluginTestKit.js +315 -329
  379. package/dist/esm/procedural/Procedural.js +248 -253
  380. package/dist/esm/procedural/WorldBuilding.js +316 -313
  381. package/dist/esm/quest/QuestSystem.js +982 -931
  382. package/dist/esm/release/MobileExport.js +163 -162
  383. package/dist/esm/release/Release.js +234 -237
  384. package/dist/esm/rendering/Camera2D.js +122 -123
  385. package/dist/esm/rendering/Renderer2D.js +323 -334
  386. package/dist/esm/rendering/WebGPURenderPipeline.js +647 -650
  387. package/dist/esm/runtime3d/Runtime3D.js +368 -377
  388. package/dist/esm/runtime3d/SceneEditor3D.js +268 -262
  389. package/dist/esm/scene/SceneManager.js +178 -192
  390. package/dist/esm/scripting/GraphToAST.js +576 -546
  391. package/dist/esm/scripting/LanguageExporter.js +263 -278
  392. package/dist/esm/scripting/NodeGraph.js +550 -569
  393. package/dist/esm/scripting/ScriptAST.js +45 -38
  394. package/dist/esm/scripting/VisualScripting2.js +1025 -1064
  395. package/dist/esm/scripting/exporters/CSharpExporter.js +465 -495
  396. package/dist/esm/scripting/exporters/GDScriptExporter.js +391 -441
  397. package/dist/esm/scripting/exporters/LuaExporter.js +407 -446
  398. package/dist/esm/scripting/exporters/PythonExporter.js +485 -548
  399. package/dist/esm/scripting/exporters/RustExporter.js +460 -511
  400. package/dist/esm/scripting/exporters/TypeScriptExporter.js +506 -555
  401. package/dist/esm/social/Social.js +77 -79
  402. package/dist/esm/systems/LightingSystem.js +855 -930
  403. package/dist/esm/systems/ParticleSystem2.js +1453 -1450
  404. package/dist/esm/systems/PhysicsDebugSystem.js +1078 -1140
  405. package/dist/esm/systems/TerrainSystem.js +996 -1097
  406. package/dist/esm/templates/ActionTemplates.js +307 -308
  407. package/dist/esm/templates/FightingTemplate.js +439 -462
  408. package/dist/esm/templates/MetroidvaniaTemplate.js +391 -404
  409. package/dist/esm/templates/PartyTemplates.js +206 -201
  410. package/dist/esm/templates/PuzzleTemplates.js +260 -260
  411. package/dist/esm/templates/RPGTemplates.js +172 -177
  412. package/dist/esm/templates/SportsTemplates.js +251 -249
  413. package/dist/esm/templates/StrategyTemplates.js +158 -152
  414. package/dist/esm/templates/SurvivalTemplate.js +367 -379
  415. package/dist/esm/templates/WaveDefense.js +501 -525
  416. package/dist/esm/tilemap/Tilemap.js +209 -213
  417. package/dist/esm/tutorials/TutorialBranching.js +399 -416
  418. package/dist/esm/tutorials/TutorialEngine.js +893 -930
  419. package/dist/esm/tutorials/TutorialOverlay.js +603 -639
  420. package/dist/esm/tutorials/content/Tutorials_T05_T08.js +792 -808
  421. package/dist/esm/tutorials/content/Tutorials_T09_T11.js +740 -755
  422. package/dist/esm/tutorials/content/Tutorials_T12_T15.js +759 -777
  423. package/dist/esm/ui/GameUI.js +296 -311
  424. package/dist/esm/unity-integration/UnityAssetStore.js +704 -740
  425. package/dist/esm/unity-integration/UnityImport.js +1071 -1175
  426. package/dist/esm/unity-integration/UnityLiveLink.js +938 -980
  427. package/dist/esm/unity-integration/components/UnityAssetStoreBrowser.js +1234 -756
  428. package/dist/esm/unity-integration/components/UnityProjectBrowser.js +1241 -767
  429. package/dist/esm/unreal-integration/UnrealImport.js +395 -411
  430. package/dist/esm/unreal-integration/UnrealLiveLink.js +1105 -1136
  431. package/dist/esm/unreal-integration/UnrealMarketplace.js +442 -472
  432. package/dist/esm/unreal-integration/components/UnrealProjectBrowser.js +1151 -766
  433. package/dist/esm/xr/ARVR.js +181 -174
  434. package/package.json +7 -12
@@ -1,797 +1,1275 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { NiceIcon, clickOnActivationKey } from '@nice2dev/ui';
3
- import { forwardRef, useReducer, useMemo, useCallback, useImperativeHandle, createContext, useState, useContext } from 'react';
4
-
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { NiceIcon, clickOnActivationKey } from "@nice2dev/ui";
3
+ import { forwardRef, useReducer, useMemo, useCallback, useImperativeHandle, createContext, useState, useContext } from "react";
5
4
  const DEFAULT_THEME = {
6
- background: '#0f0f17',
7
- surfaceBackground: '#1a1a28',
8
- cardBackground: '#252538',
9
- headerBackground: '#15151f',
10
- textPrimary: '#e2e8f0',
11
- textSecondary: '#94a3b8',
12
- accent: '#6366f1',
13
- success: '#22c55e',
14
- warning: '#f59e0b',
15
- danger: '#ef4444',
16
- star: '#fbbf24',
17
- border: 'rgba(255,255,255,0.08)',
18
- freeBadge: '#22c55e',
19
- ownedBadge: '#3b82f6',
20
- saleBadge: '#ef4444',
5
+ background: "#0f0f17",
6
+ surfaceBackground: "#1a1a28",
7
+ cardBackground: "#252538",
8
+ headerBackground: "#15151f",
9
+ textPrimary: "#e2e8f0",
10
+ textSecondary: "#94a3b8",
11
+ accent: "#6366f1",
12
+ success: "#22c55e",
13
+ warning: "#f59e0b",
14
+ danger: "#ef4444",
15
+ star: "#fbbf24",
16
+ border: "rgba(255,255,255,0.08)",
17
+ freeBadge: "#22c55e",
18
+ ownedBadge: "#3b82f6",
19
+ saleBadge: "#ef4444"
21
20
  };
22
21
  function storeReducer(state, action) {
23
- switch (action.type) {
24
- case 'SET_QUERY':
25
- return { ...state, query: { ...state.query, ...action.query } };
26
- case 'SET_RESULTS':
27
- return { ...state, results: action.results, totalResults: action.total };
28
- case 'SET_LOADING':
29
- return { ...state, loading: action.loading };
30
- case 'SET_ERROR':
31
- return { ...state, error: action.error };
32
- case 'SELECT_ASSET':
33
- return { ...state, selectedAsset: action.asset };
34
- case 'ADD_TO_CART':
35
- return { ...state, cart: new Set([...state.cart, action.id]) };
36
- case 'REMOVE_FROM_CART': {
37
- const newCart = new Set(state.cart);
38
- newCart.delete(action.id);
39
- return { ...state, cart: newCart };
40
- }
41
- case 'CLEAR_CART':
42
- return { ...state, cart: new Set() };
43
- case 'SET_DOWNLOAD_PROGRESS': {
44
- const newDownloads = new Map(state.downloading);
45
- newDownloads.set(action.id, action.progress);
46
- return { ...state, downloading: newDownloads };
47
- }
48
- case 'CLEAR_DOWNLOAD': {
49
- const cleared = new Map(state.downloading);
50
- cleared.delete(action.id);
51
- return { ...state, downloading: cleared };
52
- }
53
- case 'SET_VIEW':
54
- return { ...state, view: action.view };
55
- case 'TOGGLE_MY_ASSETS':
56
- return { ...state, myAssets: !state.myAssets };
57
- default:
58
- return state;
22
+ switch (action.type) {
23
+ case "SET_QUERY":
24
+ return { ...state, query: { ...state.query, ...action.query } };
25
+ case "SET_RESULTS":
26
+ return { ...state, results: action.results, totalResults: action.total };
27
+ case "SET_LOADING":
28
+ return { ...state, loading: action.loading };
29
+ case "SET_ERROR":
30
+ return { ...state, error: action.error };
31
+ case "SELECT_ASSET":
32
+ return { ...state, selectedAsset: action.asset };
33
+ case "ADD_TO_CART":
34
+ return { ...state, cart: /* @__PURE__ */ new Set([...state.cart, action.id]) };
35
+ case "REMOVE_FROM_CART": {
36
+ const newCart = new Set(state.cart);
37
+ newCart.delete(action.id);
38
+ return { ...state, cart: newCart };
39
+ }
40
+ case "CLEAR_CART":
41
+ return { ...state, cart: /* @__PURE__ */ new Set() };
42
+ case "SET_DOWNLOAD_PROGRESS": {
43
+ const newDownloads = new Map(state.downloading);
44
+ newDownloads.set(action.id, action.progress);
45
+ return { ...state, downloading: newDownloads };
46
+ }
47
+ case "CLEAR_DOWNLOAD": {
48
+ const cleared = new Map(state.downloading);
49
+ cleared.delete(action.id);
50
+ return { ...state, downloading: cleared };
59
51
  }
52
+ case "SET_VIEW":
53
+ return { ...state, view: action.view };
54
+ case "TOGGLE_MY_ASSETS":
55
+ return { ...state, myAssets: !state.myAssets };
56
+ default:
57
+ return state;
58
+ }
60
59
  }
61
60
  const INITIAL_STATE = {
62
- query: {
63
- query: '',
64
- category: 'all',
65
- pricing: 'all',
66
- minRating: 0,
67
- sortBy: 'relevance',
68
- page: 1,
69
- pageSize: 24,
70
- },
71
- results: [],
72
- totalResults: 0,
73
- loading: false,
74
- error: null,
75
- selectedAsset: null,
76
- cart: new Set(),
77
- downloading: new Map(),
78
- view: 'grid',
79
- myAssets: false,
61
+ query: {
62
+ query: "",
63
+ category: "all",
64
+ pricing: "all",
65
+ minRating: 0,
66
+ sortBy: "relevance",
67
+ page: 1,
68
+ pageSize: 24
69
+ },
70
+ results: [],
71
+ totalResults: 0,
72
+ loading: false,
73
+ error: null,
74
+ selectedAsset: null,
75
+ cart: /* @__PURE__ */ new Set(),
76
+ downloading: /* @__PURE__ */ new Map(),
77
+ view: "grid",
78
+ myAssets: false
80
79
  };
81
80
  const StoreContext = /* @__PURE__ */ createContext(null);
82
81
  function useStore() {
83
- const ctx = useContext(StoreContext);
84
- if (!ctx) {
85
- throw new Error('useStore must be used within UnityAssetStoreBrowser');
86
- }
87
- return ctx;
82
+ const ctx = useContext(StoreContext);
83
+ if (!ctx) {
84
+ throw new Error("useStore must be used within UnityAssetStoreBrowser");
85
+ }
86
+ return ctx;
88
87
  }
89
- /* ── Helper Functions ─────────────────────────────────────────── */
90
88
  function formatPrice(price, currency) {
91
- if (price === 0) {
92
- return 'Free';
93
- }
94
- return new Intl.NumberFormat('en-US', { style: 'currency', currency }).format(price);
89
+ if (price === 0) {
90
+ return "Free";
91
+ }
92
+ return new Intl.NumberFormat("en-US", { style: "currency", currency }).format(price);
95
93
  }
96
94
  function formatFileSize(bytes) {
97
- if (bytes < 1024 * 1024) {
98
- return `${(bytes / 1024).toFixed(1)} KB`;
99
- }
100
- if (bytes < 1024 * 1024 * 1024) {
101
- return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
102
- }
103
- return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
95
+ if (bytes < 1024 * 1024) {
96
+ return `${(bytes / 1024).toFixed(1)} KB`;
97
+ }
98
+ if (bytes < 1024 * 1024 * 1024) {
99
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
100
+ }
101
+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
104
102
  }
105
103
  function getCategoryIcon(category) {
106
- switch (category) {
107
- case '3d':
108
- return 'box';
109
- case '2d':
110
- return 'image';
111
- case 'tools':
112
- return 'settings';
113
- case 'vfx':
114
- return 'star';
115
- case 'audio':
116
- return 'volume';
117
- case 'templates':
118
- return 'clipboard';
119
- case 'add-ons':
120
- return 'puzzle';
121
- default:
122
- return 'box';
123
- }
104
+ switch (category) {
105
+ case "3d":
106
+ return "box";
107
+ case "2d":
108
+ return "image";
109
+ case "tools":
110
+ return "settings";
111
+ case "vfx":
112
+ return "star";
113
+ case "audio":
114
+ return "volume";
115
+ case "templates":
116
+ return "clipboard";
117
+ case "add-ons":
118
+ return "puzzle";
119
+ default:
120
+ return "box";
121
+ }
124
122
  }
125
- /* ── Search Header ────────────────────────────────────────────── */
126
123
  const SearchHeader = () => {
127
- const { state, dispatch, theme, search } = useStore();
128
- const [localQuery, setLocalQuery] = useState(state.query.query);
129
- const handleSearch = () => {
130
- dispatch({ type: 'SET_QUERY', query: { query: localQuery, page: 1 } });
131
- search();
132
- };
133
- const categories = [
134
- { value: 'all', label: 'All Categories' },
135
- { value: '3d', label: '3D' },
136
- { value: '2d', label: '2D' },
137
- { value: 'tools', label: 'Tools' },
138
- { value: 'vfx', label: 'VFX' },
139
- { value: 'audio', label: 'Audio' },
140
- { value: 'templates', label: 'Templates' },
141
- { value: 'add-ons', label: 'Add-ons' },
142
- ];
143
- return (jsxs("div", { style: {
144
- padding: '16px 24px',
145
- backgroundColor: theme.headerBackground,
146
- borderBottom: `1px solid ${theme.border}`,
147
- }, children: [jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 12, marginBottom: 12 }, children: [jsx(NiceIcon, { name: "building", size: 24 }), jsx("h1", { style: { margin: 0, fontSize: 18, fontWeight: 600, color: theme.textPrimary }, children: "Unity Asset Store" }), jsx("div", { style: { flex: 1 } }), jsxs("button", { style: {
148
- display: 'flex',
149
- alignItems: 'center',
150
- gap: 6,
151
- padding: '8px 12px',
152
- backgroundColor: state.cart.size > 0 ? theme.accent : 'rgba(0,0,0,0.2)',
153
- border: 'none',
154
- borderRadius: 6,
155
- color: '#fff',
156
- cursor: 'pointer',
157
- }, children: [jsx(NiceIcon, { name: "box", size: 14 }), " Cart (", state.cart.size, ")"] }), jsxs("button", { onClick: () => dispatch({ type: 'TOGGLE_MY_ASSETS' }), style: {
158
- padding: '8px 12px',
159
- backgroundColor: state.myAssets ? theme.accent : 'rgba(0,0,0,0.2)',
160
- border: 'none',
161
- borderRadius: 6,
162
- color: '#fff',
163
- cursor: 'pointer',
164
- }, children: [jsx(NiceIcon, { name: "book", size: 14 }), " My Assets"] })] }), jsxs("div", { style: { display: 'flex', gap: 8 }, children: [jsxs("div", { style: { flex: 1, position: 'relative' }, children: [jsx("input", { type: "text", placeholder: "Search assets...", value: localQuery, onChange: (e) => setLocalQuery(e.target.value), onKeyDown: (e) => e.key === 'Enter' && handleSearch(), style: {
165
- width: '100%',
166
- padding: '10px 16px',
167
- paddingRight: 50,
168
- fontSize: 14,
169
- backgroundColor: 'rgba(0,0,0,0.3)',
170
- border: `1px solid ${theme.border}`,
171
- borderRadius: 8,
172
- color: theme.textPrimary,
173
- outline: 'none',
174
- } }), jsx("button", { onClick: handleSearch, style: {
175
- position: 'absolute',
176
- right: 4,
177
- top: 4,
178
- bottom: 4,
179
- padding: '0 12px',
180
- backgroundColor: theme.accent,
181
- border: 'none',
182
- borderRadius: 6,
183
- color: '#fff',
184
- cursor: 'pointer',
185
- }, children: jsx(NiceIcon, { name: "search", size: 14 }) })] }), jsx("select", { value: state.query.category, onChange: (e) => {
186
- dispatch({
187
- type: 'SET_QUERY',
188
- query: { category: e.target.value, page: 1 },
189
- });
190
- search();
191
- }, style: {
192
- padding: '10px 16px',
193
- fontSize: 14,
194
- backgroundColor: 'rgba(0,0,0,0.3)',
195
- border: `1px solid ${theme.border}`,
196
- borderRadius: 8,
197
- color: theme.textPrimary,
198
- }, children: categories.map((c) => (jsx("option", { value: c.value, children: c.label }, c.value))) }), jsxs("select", { value: state.query.pricing, onChange: (e) => {
199
- dispatch({
200
- type: 'SET_QUERY',
201
- query: { pricing: e.target.value, page: 1 },
202
- });
203
- search();
204
- }, style: {
205
- padding: '10px 16px',
206
- fontSize: 14,
207
- backgroundColor: 'rgba(0,0,0,0.3)',
208
- border: `1px solid ${theme.border}`,
209
- borderRadius: 8,
210
- color: theme.textPrimary,
211
- }, children: [jsx("option", { value: "all", children: "All Prices" }), jsx("option", { value: "free", children: "Free" }), jsx("option", { value: "paid", children: "Paid" }), jsx("option", { value: "sale", children: "On Sale" })] }), jsxs("select", { value: state.query.sortBy, onChange: (e) => {
212
- dispatch({
213
- type: 'SET_QUERY',
214
- query: { sortBy: e.target.value, page: 1 },
215
- });
216
- search();
217
- }, style: {
218
- padding: '10px 16px',
219
- fontSize: 14,
220
- backgroundColor: 'rgba(0,0,0,0.3)',
221
- border: `1px solid ${theme.border}`,
222
- borderRadius: 8,
223
- color: theme.textPrimary,
224
- }, children: [jsx("option", { value: "relevance", children: "Relevance" }), jsx("option", { value: "popularity", children: "Popularity" }), jsx("option", { value: "rating", children: "Rating" }), jsx("option", { value: "price_asc", children: "Price: Low to High" }), jsx("option", { value: "price_desc", children: "Price: High to Low" }), jsx("option", { value: "newest", children: "Newest" })] })] })] }));
124
+ const { state, dispatch, theme, search } = useStore();
125
+ const [localQuery, setLocalQuery] = useState(state.query.query);
126
+ const handleSearch = () => {
127
+ dispatch({ type: "SET_QUERY", query: { query: localQuery, page: 1 } });
128
+ search();
129
+ };
130
+ const categories = [
131
+ { value: "all", label: "All Categories" },
132
+ { value: "3d", label: "3D" },
133
+ { value: "2d", label: "2D" },
134
+ { value: "tools", label: "Tools" },
135
+ { value: "vfx", label: "VFX" },
136
+ { value: "audio", label: "Audio" },
137
+ { value: "templates", label: "Templates" },
138
+ { value: "add-ons", label: "Add-ons" }
139
+ ];
140
+ return /* @__PURE__ */ jsxs(
141
+ "div",
142
+ {
143
+ style: {
144
+ padding: "16px 24px",
145
+ backgroundColor: theme.headerBackground,
146
+ borderBottom: `1px solid ${theme.border}`
147
+ },
148
+ children: [
149
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, marginBottom: 12 }, children: [
150
+ /* @__PURE__ */ jsx(NiceIcon, { name: "building", size: 24 }),
151
+ /* @__PURE__ */ jsx("h1", { style: { margin: 0, fontSize: 18, fontWeight: 600, color: theme.textPrimary }, children: "Unity Asset Store" }),
152
+ /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
153
+ /* @__PURE__ */ jsxs(
154
+ "button",
155
+ {
156
+ style: {
157
+ display: "flex",
158
+ alignItems: "center",
159
+ gap: 6,
160
+ padding: "8px 12px",
161
+ backgroundColor: state.cart.size > 0 ? theme.accent : "rgba(0,0,0,0.2)",
162
+ border: "none",
163
+ borderRadius: 6,
164
+ color: "#fff",
165
+ cursor: "pointer"
166
+ },
167
+ children: [
168
+ /* @__PURE__ */ jsx(NiceIcon, { name: "box", size: 14 }),
169
+ " Cart (",
170
+ state.cart.size,
171
+ ")"
172
+ ]
173
+ }
174
+ ),
175
+ /* @__PURE__ */ jsxs(
176
+ "button",
177
+ {
178
+ onClick: () => dispatch({ type: "TOGGLE_MY_ASSETS" }),
179
+ style: {
180
+ padding: "8px 12px",
181
+ backgroundColor: state.myAssets ? theme.accent : "rgba(0,0,0,0.2)",
182
+ border: "none",
183
+ borderRadius: 6,
184
+ color: "#fff",
185
+ cursor: "pointer"
186
+ },
187
+ children: [
188
+ /* @__PURE__ */ jsx(NiceIcon, { name: "book", size: 14 }),
189
+ " My Assets"
190
+ ]
191
+ }
192
+ )
193
+ ] }),
194
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8 }, children: [
195
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, position: "relative" }, children: [
196
+ /* @__PURE__ */ jsx(
197
+ "input",
198
+ {
199
+ type: "text",
200
+ placeholder: "Search assets...",
201
+ value: localQuery,
202
+ onChange: (e) => setLocalQuery(e.target.value),
203
+ onKeyDown: (e) => e.key === "Enter" && handleSearch(),
204
+ style: {
205
+ width: "100%",
206
+ padding: "10px 16px",
207
+ paddingRight: 50,
208
+ fontSize: 14,
209
+ backgroundColor: "rgba(0,0,0,0.3)",
210
+ border: `1px solid ${theme.border}`,
211
+ borderRadius: 8,
212
+ color: theme.textPrimary,
213
+ outline: "none"
214
+ }
215
+ }
216
+ ),
217
+ /* @__PURE__ */ jsx(
218
+ "button",
219
+ {
220
+ onClick: handleSearch,
221
+ style: {
222
+ position: "absolute",
223
+ right: 4,
224
+ top: 4,
225
+ bottom: 4,
226
+ padding: "0 12px",
227
+ backgroundColor: theme.accent,
228
+ border: "none",
229
+ borderRadius: 6,
230
+ color: "#fff",
231
+ cursor: "pointer"
232
+ },
233
+ children: /* @__PURE__ */ jsx(NiceIcon, { name: "search", size: 14 })
234
+ }
235
+ )
236
+ ] }),
237
+ /* @__PURE__ */ jsx(
238
+ "select",
239
+ {
240
+ value: state.query.category,
241
+ onChange: (e) => {
242
+ dispatch({
243
+ type: "SET_QUERY",
244
+ query: { category: e.target.value, page: 1 }
245
+ });
246
+ search();
247
+ },
248
+ style: {
249
+ padding: "10px 16px",
250
+ fontSize: 14,
251
+ backgroundColor: "rgba(0,0,0,0.3)",
252
+ border: `1px solid ${theme.border}`,
253
+ borderRadius: 8,
254
+ color: theme.textPrimary
255
+ },
256
+ children: categories.map((c) => /* @__PURE__ */ jsx("option", { value: c.value, children: c.label }, c.value))
257
+ }
258
+ ),
259
+ /* @__PURE__ */ jsxs(
260
+ "select",
261
+ {
262
+ value: state.query.pricing,
263
+ onChange: (e) => {
264
+ dispatch({
265
+ type: "SET_QUERY",
266
+ query: { pricing: e.target.value, page: 1 }
267
+ });
268
+ search();
269
+ },
270
+ style: {
271
+ padding: "10px 16px",
272
+ fontSize: 14,
273
+ backgroundColor: "rgba(0,0,0,0.3)",
274
+ border: `1px solid ${theme.border}`,
275
+ borderRadius: 8,
276
+ color: theme.textPrimary
277
+ },
278
+ children: [
279
+ /* @__PURE__ */ jsx("option", { value: "all", children: "All Prices" }),
280
+ /* @__PURE__ */ jsx("option", { value: "free", children: "Free" }),
281
+ /* @__PURE__ */ jsx("option", { value: "paid", children: "Paid" }),
282
+ /* @__PURE__ */ jsx("option", { value: "sale", children: "On Sale" })
283
+ ]
284
+ }
285
+ ),
286
+ /* @__PURE__ */ jsxs(
287
+ "select",
288
+ {
289
+ value: state.query.sortBy,
290
+ onChange: (e) => {
291
+ dispatch({
292
+ type: "SET_QUERY",
293
+ query: { sortBy: e.target.value, page: 1 }
294
+ });
295
+ search();
296
+ },
297
+ style: {
298
+ padding: "10px 16px",
299
+ fontSize: 14,
300
+ backgroundColor: "rgba(0,0,0,0.3)",
301
+ border: `1px solid ${theme.border}`,
302
+ borderRadius: 8,
303
+ color: theme.textPrimary
304
+ },
305
+ children: [
306
+ /* @__PURE__ */ jsx("option", { value: "relevance", children: "Relevance" }),
307
+ /* @__PURE__ */ jsx("option", { value: "popularity", children: "Popularity" }),
308
+ /* @__PURE__ */ jsx("option", { value: "rating", children: "Rating" }),
309
+ /* @__PURE__ */ jsx("option", { value: "price_asc", children: "Price: Low to High" }),
310
+ /* @__PURE__ */ jsx("option", { value: "price_desc", children: "Price: High to Low" }),
311
+ /* @__PURE__ */ jsx("option", { value: "newest", children: "Newest" })
312
+ ]
313
+ }
314
+ )
315
+ ] })
316
+ ]
317
+ }
318
+ );
225
319
  };
226
- /* ── Rating Stars ─────────────────────────────────────────────── */
227
320
  const RatingStars = ({ rating, count }) => {
228
- const { theme } = useStore();
229
- return (jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [[1, 2, 3, 4, 5].map((star) => (jsx("span", { style: {
230
- fontSize: 12,
231
- color: star <= Math.round(rating) ? theme.star : theme.textSecondary,
232
- }, children: jsx(NiceIcon, { name: "star", size: 12 }) }, star))), count !== undefined && (jsxs("span", { style: { fontSize: 11, color: theme.textSecondary, marginLeft: 4 }, children: ["(", count, ")"] }))] }));
321
+ const { theme } = useStore();
322
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
323
+ [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ jsx(
324
+ "span",
325
+ {
326
+ style: {
327
+ fontSize: 12,
328
+ color: star <= Math.round(rating) ? theme.star : theme.textSecondary
329
+ },
330
+ children: /* @__PURE__ */ jsx(NiceIcon, { name: "star", size: 12 })
331
+ },
332
+ star
333
+ )),
334
+ count !== void 0 && /* @__PURE__ */ jsxs("span", { style: { fontSize: 11, color: theme.textSecondary, marginLeft: 4 }, children: [
335
+ "(",
336
+ count,
337
+ ")"
338
+ ] })
339
+ ] });
233
340
  };
234
- /* ── Asset Card ───────────────────────────────────────────────── */
235
341
  const AssetCard = ({ asset }) => {
236
- const { state, dispatch, theme, downloadAsset, openInBrowser } = useStore();
237
- const isDownloading = state.downloading.has(asset.id);
238
- const downloadProgress = state.downloading.get(asset.id) ?? 0;
239
- const isInCart = state.cart.has(asset.id);
240
- return (jsxs("div", { role: "button", tabIndex: 0, onKeyDown: clickOnActivationKey, style: {
241
- backgroundColor: theme.cardBackground,
242
- borderRadius: 12,
243
- overflow: 'hidden',
244
- cursor: 'pointer',
245
- transition: 'transform 0.2s, box-shadow 0.2s',
246
- border: `1px solid ${theme.border}`,
247
- }, onClick: () => dispatch({ type: 'SELECT_ASSET', asset }), children: [jsxs("div", { style: {
248
- position: 'relative',
249
- width: '100%',
250
- paddingTop: '56.25%',
251
- backgroundColor: 'rgba(0,0,0,0.3)',
252
- }, children: [asset.thumbnailUrl && (jsx("div", { style: {
253
- position: 'absolute',
254
- top: 0,
255
- left: 0,
256
- right: 0,
257
- bottom: 0,
258
- backgroundImage: `url(${asset.thumbnailUrl})`,
259
- backgroundSize: 'cover',
260
- backgroundPosition: 'center',
261
- } })), jsxs("div", { style: { position: 'absolute', top: 8, left: 8, display: 'flex', gap: 4 }, children: [asset.isFree && (jsx("span", { style: {
262
- padding: '2px 8px',
263
- fontSize: 10,
264
- fontWeight: 600,
265
- backgroundColor: theme.freeBadge,
266
- borderRadius: 4,
267
- color: '#fff',
268
- }, children: "FREE" })), asset.isOwned && (jsx("span", { style: {
269
- padding: '2px 8px',
270
- fontSize: 10,
271
- fontWeight: 600,
272
- backgroundColor: theme.ownedBadge,
273
- borderRadius: 4,
274
- color: '#fff',
275
- }, children: "OWNED" })), asset.originalPrice && (jsxs("span", { style: {
276
- padding: '2px 8px',
277
- fontSize: 10,
278
- fontWeight: 600,
279
- backgroundColor: theme.saleBadge,
280
- borderRadius: 4,
281
- color: '#fff',
282
- }, children: ["-", Math.round((1 - asset.price / asset.originalPrice) * 100), "%"] }))] }), jsx("div", { style: {
283
- position: 'absolute',
284
- bottom: 8,
285
- right: 8,
286
- width: 28,
287
- height: 28,
288
- backgroundColor: 'rgba(0,0,0,0.6)',
289
- borderRadius: 6,
290
- display: 'flex',
291
- alignItems: 'center',
292
- justifyContent: 'center',
293
- fontSize: 14,
294
- }, children: jsx(NiceIcon, { name: getCategoryIcon(asset.category), size: 32 }) })] }), jsxs("div", { style: { padding: 12 }, children: [jsx("h3", { style: {
295
- margin: 0,
296
- fontSize: 13,
297
- fontWeight: 600,
298
- color: theme.textPrimary,
299
- overflow: 'hidden',
300
- textOverflow: 'ellipsis',
301
- whiteSpace: 'nowrap',
302
- }, children: asset.name }), jsx("div", { style: {
303
- fontSize: 11,
304
- color: theme.textSecondary,
305
- marginTop: 4,
306
- overflow: 'hidden',
307
- textOverflow: 'ellipsis',
308
- whiteSpace: 'nowrap',
309
- }, children: asset.publisher }), jsxs("div", { style: {
310
- display: 'flex',
311
- alignItems: 'center',
312
- justifyContent: 'space-between',
313
- marginTop: 8,
314
- }, children: [jsx(RatingStars, { rating: asset.rating, count: asset.ratingCount }), jsxs("div", { style: { textAlign: 'right' }, children: [asset.originalPrice && (jsx("div", { style: {
315
- fontSize: 10,
316
- color: theme.textSecondary,
317
- textDecoration: 'line-through',
318
- }, children: formatPrice(asset.originalPrice, asset.currency) })), jsx("div", { style: {
319
- fontSize: 14,
320
- fontWeight: 600,
321
- color: asset.isFree ? theme.freeBadge : theme.textPrimary,
322
- }, children: formatPrice(asset.price, asset.currency) })] })] }), jsxs("div", { style: { display: 'flex', gap: 8, marginTop: 12 }, children: [asset.isOwned ? (jsx("button", { onClick: (e) => {
323
- e.stopPropagation();
324
- downloadAsset(asset.id);
325
- }, disabled: isDownloading, style: {
326
- flex: 1,
327
- padding: '8px 12px',
328
- fontSize: 11,
329
- fontWeight: 500,
330
- backgroundColor: isDownloading ? theme.textSecondary : theme.success,
331
- border: 'none',
332
- borderRadius: 6,
333
- color: '#fff',
334
- cursor: isDownloading ? 'not-allowed' : 'pointer',
335
- }, children: isDownloading ? `${downloadProgress}%` : 'Download' })) : (jsx("button", { onClick: (e) => {
336
- e.stopPropagation();
337
- if (isInCart) {
338
- dispatch({ type: 'REMOVE_FROM_CART', id: asset.id });
339
- }
340
- else {
341
- dispatch({ type: 'ADD_TO_CART', id: asset.id });
342
- }
343
- }, style: {
344
- flex: 1,
345
- padding: '8px 12px',
346
- fontSize: 11,
347
- fontWeight: 500,
348
- backgroundColor: isInCart ? theme.warning : theme.accent,
349
- border: 'none',
350
- borderRadius: 6,
351
- color: '#fff',
352
- cursor: 'pointer',
353
- }, children: isInCart ? 'In Cart' : 'Add to Cart' })), jsx("button", { onClick: (e) => {
354
- e.stopPropagation();
355
- openInBrowser(asset);
356
- }, style: {
357
- padding: '8px 12px',
358
- fontSize: 11,
359
- backgroundColor: 'rgba(0,0,0,0.2)',
360
- border: `1px solid ${theme.border}`,
361
- borderRadius: 6,
362
- color: theme.textSecondary,
363
- cursor: 'pointer',
364
- }, children: jsx(NiceIcon, { name: "link", size: 14 }) })] })] })] }));
365
- };
366
- /* ── Asset Grid ───────────────────────────────────────────────── */
367
- const AssetGrid = () => {
368
- const { state, theme } = useStore();
369
- if (state.loading) {
370
- return (jsx("div", { style: {
371
- flex: 1,
372
- display: 'flex',
373
- alignItems: 'center',
374
- justifyContent: 'center',
342
+ const { state, dispatch, theme, downloadAsset, openInBrowser } = useStore();
343
+ const isDownloading = state.downloading.has(asset.id);
344
+ const downloadProgress = state.downloading.get(asset.id) ?? 0;
345
+ const isInCart = state.cart.has(asset.id);
346
+ return /* @__PURE__ */ jsxs(
347
+ "div",
348
+ {
349
+ role: "button",
350
+ tabIndex: 0,
351
+ onKeyDown: clickOnActivationKey,
352
+ style: {
353
+ backgroundColor: theme.cardBackground,
354
+ borderRadius: 12,
355
+ overflow: "hidden",
356
+ cursor: "pointer",
357
+ transition: "transform 0.2s, box-shadow 0.2s",
358
+ border: `1px solid ${theme.border}`
359
+ },
360
+ onClick: () => dispatch({ type: "SELECT_ASSET", asset }),
361
+ children: [
362
+ /* @__PURE__ */ jsxs(
363
+ "div",
364
+ {
365
+ style: {
366
+ position: "relative",
367
+ width: "100%",
368
+ paddingTop: "56.25%",
369
+ backgroundColor: "rgba(0,0,0,0.3)"
370
+ },
371
+ children: [
372
+ asset.thumbnailUrl && /* @__PURE__ */ jsx(
373
+ "div",
374
+ {
375
+ style: {
376
+ position: "absolute",
377
+ top: 0,
378
+ left: 0,
379
+ right: 0,
380
+ bottom: 0,
381
+ backgroundImage: `url(${asset.thumbnailUrl})`,
382
+ backgroundSize: "cover",
383
+ backgroundPosition: "center"
384
+ }
385
+ }
386
+ ),
387
+ /* @__PURE__ */ jsxs("div", { style: { position: "absolute", top: 8, left: 8, display: "flex", gap: 4 }, children: [
388
+ asset.isFree && /* @__PURE__ */ jsx(
389
+ "span",
390
+ {
391
+ style: {
392
+ padding: "2px 8px",
393
+ fontSize: 10,
394
+ fontWeight: 600,
395
+ backgroundColor: theme.freeBadge,
396
+ borderRadius: 4,
397
+ color: "#fff"
398
+ },
399
+ children: "FREE"
400
+ }
401
+ ),
402
+ asset.isOwned && /* @__PURE__ */ jsx(
403
+ "span",
404
+ {
405
+ style: {
406
+ padding: "2px 8px",
407
+ fontSize: 10,
408
+ fontWeight: 600,
409
+ backgroundColor: theme.ownedBadge,
410
+ borderRadius: 4,
411
+ color: "#fff"
412
+ },
413
+ children: "OWNED"
414
+ }
415
+ ),
416
+ asset.originalPrice && /* @__PURE__ */ jsxs(
417
+ "span",
418
+ {
419
+ style: {
420
+ padding: "2px 8px",
421
+ fontSize: 10,
422
+ fontWeight: 600,
423
+ backgroundColor: theme.saleBadge,
424
+ borderRadius: 4,
425
+ color: "#fff"
426
+ },
427
+ children: [
428
+ "-",
429
+ Math.round((1 - asset.price / asset.originalPrice) * 100),
430
+ "%"
431
+ ]
432
+ }
433
+ )
434
+ ] }),
435
+ /* @__PURE__ */ jsx(
436
+ "div",
437
+ {
438
+ style: {
439
+ position: "absolute",
440
+ bottom: 8,
441
+ right: 8,
442
+ width: 28,
443
+ height: 28,
444
+ backgroundColor: "rgba(0,0,0,0.6)",
445
+ borderRadius: 6,
446
+ display: "flex",
447
+ alignItems: "center",
448
+ justifyContent: "center",
449
+ fontSize: 14
450
+ },
451
+ children: /* @__PURE__ */ jsx(NiceIcon, { name: getCategoryIcon(asset.category), size: 32 })
452
+ }
453
+ )
454
+ ]
455
+ }
456
+ ),
457
+ /* @__PURE__ */ jsxs("div", { style: { padding: 12 }, children: [
458
+ /* @__PURE__ */ jsx(
459
+ "h3",
460
+ {
461
+ style: {
462
+ margin: 0,
463
+ fontSize: 13,
464
+ fontWeight: 600,
465
+ color: theme.textPrimary,
466
+ overflow: "hidden",
467
+ textOverflow: "ellipsis",
468
+ whiteSpace: "nowrap"
469
+ },
470
+ children: asset.name
471
+ }
472
+ ),
473
+ /* @__PURE__ */ jsx(
474
+ "div",
475
+ {
476
+ style: {
477
+ fontSize: 11,
375
478
  color: theme.textSecondary,
376
- }, children: "Loading assets..." }));
377
- }
378
- if (state.error) {
379
- return (jsxs("div", { style: {
380
- flex: 1,
381
- display: 'flex',
382
- alignItems: 'center',
383
- justifyContent: 'center',
384
- color: theme.danger,
385
- }, children: [jsx(NiceIcon, { name: "error", size: 14 }), " ", state.error] }));
479
+ marginTop: 4,
480
+ overflow: "hidden",
481
+ textOverflow: "ellipsis",
482
+ whiteSpace: "nowrap"
483
+ },
484
+ children: asset.publisher
485
+ }
486
+ ),
487
+ /* @__PURE__ */ jsxs(
488
+ "div",
489
+ {
490
+ style: {
491
+ display: "flex",
492
+ alignItems: "center",
493
+ justifyContent: "space-between",
494
+ marginTop: 8
495
+ },
496
+ children: [
497
+ /* @__PURE__ */ jsx(RatingStars, { rating: asset.rating, count: asset.ratingCount }),
498
+ /* @__PURE__ */ jsxs("div", { style: { textAlign: "right" }, children: [
499
+ asset.originalPrice && /* @__PURE__ */ jsx(
500
+ "div",
501
+ {
502
+ style: {
503
+ fontSize: 10,
504
+ color: theme.textSecondary,
505
+ textDecoration: "line-through"
506
+ },
507
+ children: formatPrice(asset.originalPrice, asset.currency)
508
+ }
509
+ ),
510
+ /* @__PURE__ */ jsx(
511
+ "div",
512
+ {
513
+ style: {
514
+ fontSize: 14,
515
+ fontWeight: 600,
516
+ color: asset.isFree ? theme.freeBadge : theme.textPrimary
517
+ },
518
+ children: formatPrice(asset.price, asset.currency)
519
+ }
520
+ )
521
+ ] })
522
+ ]
523
+ }
524
+ ),
525
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8, marginTop: 12 }, children: [
526
+ asset.isOwned ? /* @__PURE__ */ jsx(
527
+ "button",
528
+ {
529
+ onClick: (e) => {
530
+ e.stopPropagation();
531
+ downloadAsset(asset.id);
532
+ },
533
+ disabled: isDownloading,
534
+ style: {
535
+ flex: 1,
536
+ padding: "8px 12px",
537
+ fontSize: 11,
538
+ fontWeight: 500,
539
+ backgroundColor: isDownloading ? theme.textSecondary : theme.success,
540
+ border: "none",
541
+ borderRadius: 6,
542
+ color: "#fff",
543
+ cursor: isDownloading ? "not-allowed" : "pointer"
544
+ },
545
+ children: isDownloading ? `${downloadProgress}%` : "Download"
546
+ }
547
+ ) : /* @__PURE__ */ jsx(
548
+ "button",
549
+ {
550
+ onClick: (e) => {
551
+ e.stopPropagation();
552
+ if (isInCart) {
553
+ dispatch({ type: "REMOVE_FROM_CART", id: asset.id });
554
+ } else {
555
+ dispatch({ type: "ADD_TO_CART", id: asset.id });
556
+ }
557
+ },
558
+ style: {
559
+ flex: 1,
560
+ padding: "8px 12px",
561
+ fontSize: 11,
562
+ fontWeight: 500,
563
+ backgroundColor: isInCart ? theme.warning : theme.accent,
564
+ border: "none",
565
+ borderRadius: 6,
566
+ color: "#fff",
567
+ cursor: "pointer"
568
+ },
569
+ children: isInCart ? "In Cart" : "Add to Cart"
570
+ }
571
+ ),
572
+ /* @__PURE__ */ jsx(
573
+ "button",
574
+ {
575
+ onClick: (e) => {
576
+ e.stopPropagation();
577
+ openInBrowser(asset);
578
+ },
579
+ style: {
580
+ padding: "8px 12px",
581
+ fontSize: 11,
582
+ backgroundColor: "rgba(0,0,0,0.2)",
583
+ border: `1px solid ${theme.border}`,
584
+ borderRadius: 6,
585
+ color: theme.textSecondary,
586
+ cursor: "pointer"
587
+ },
588
+ children: /* @__PURE__ */ jsx(NiceIcon, { name: "link", size: 14 })
589
+ }
590
+ )
591
+ ] })
592
+ ] })
593
+ ]
386
594
  }
387
- if (state.results.length === 0) {
388
- return (jsxs("div", { style: {
389
- flex: 1,
390
- display: 'flex',
391
- flexDirection: 'column',
392
- alignItems: 'center',
393
- justifyContent: 'center',
394
- color: theme.textSecondary,
395
- }, children: [jsx("div", { style: { marginBottom: 16 }, children: jsx(NiceIcon, { name: "archive", size: 48 }) }), jsx("div", { children: "No assets found" })] }));
595
+ );
596
+ };
597
+ const AssetGrid = () => {
598
+ const { state, theme } = useStore();
599
+ if (state.loading) {
600
+ return /* @__PURE__ */ jsx(
601
+ "div",
602
+ {
603
+ style: {
604
+ flex: 1,
605
+ display: "flex",
606
+ alignItems: "center",
607
+ justifyContent: "center",
608
+ color: theme.textSecondary
609
+ },
610
+ children: "Loading assets..."
611
+ }
612
+ );
613
+ }
614
+ if (state.error) {
615
+ return /* @__PURE__ */ jsxs(
616
+ "div",
617
+ {
618
+ style: {
619
+ flex: 1,
620
+ display: "flex",
621
+ alignItems: "center",
622
+ justifyContent: "center",
623
+ color: theme.danger
624
+ },
625
+ children: [
626
+ /* @__PURE__ */ jsx(NiceIcon, { name: "error", size: 14 }),
627
+ " ",
628
+ state.error
629
+ ]
630
+ }
631
+ );
632
+ }
633
+ if (state.results.length === 0) {
634
+ return /* @__PURE__ */ jsxs(
635
+ "div",
636
+ {
637
+ style: {
638
+ flex: 1,
639
+ display: "flex",
640
+ flexDirection: "column",
641
+ alignItems: "center",
642
+ justifyContent: "center",
643
+ color: theme.textSecondary
644
+ },
645
+ children: [
646
+ /* @__PURE__ */ jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsx(NiceIcon, { name: "archive", size: 48 }) }),
647
+ /* @__PURE__ */ jsx("div", { children: "No assets found" })
648
+ ]
649
+ }
650
+ );
651
+ }
652
+ return /* @__PURE__ */ jsx(
653
+ "div",
654
+ {
655
+ style: {
656
+ display: "grid",
657
+ gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))",
658
+ gap: 16,
659
+ padding: 16
660
+ },
661
+ children: state.results.map((asset) => /* @__PURE__ */ jsx(AssetCard, { asset }, asset.id))
396
662
  }
397
- return (jsx("div", { style: {
398
- display: 'grid',
399
- gridTemplateColumns: 'repeat(auto-fill, minmax(220px, 1fr))',
400
- gap: 16,
401
- padding: 16,
402
- }, children: state.results.map((asset) => (jsx(AssetCard, { asset: asset }, asset.id))) }));
663
+ );
403
664
  };
404
- /* ── Asset Detail Modal ───────────────────────────────────────── */
405
665
  const AssetDetailModal = () => {
406
- const { state, dispatch, theme, downloadAsset, openInBrowser } = useStore();
407
- const [activeTab, setActiveTab] = useState('overview');
408
- if (!state.selectedAsset) {
409
- return null;
666
+ const { state, dispatch, theme, downloadAsset, openInBrowser } = useStore();
667
+ const [activeTab, setActiveTab] = useState("overview");
668
+ if (!state.selectedAsset) {
669
+ return null;
670
+ }
671
+ const asset = state.selectedAsset;
672
+ const isInCart = state.cart.has(asset.id);
673
+ const isDownloading = state.downloading.has(asset.id);
674
+ const downloadProgress = state.downloading.get(asset.id) ?? 0;
675
+ return /* @__PURE__ */ jsx(
676
+ "div",
677
+ {
678
+ role: "presentation",
679
+ style: {
680
+ position: "fixed",
681
+ top: 0,
682
+ left: 0,
683
+ right: 0,
684
+ bottom: 0,
685
+ backgroundColor: "rgba(0,0,0,0.8)",
686
+ display: "flex",
687
+ alignItems: "center",
688
+ justifyContent: "center",
689
+ zIndex: 1e3,
690
+ padding: 24
691
+ },
692
+ onClick: () => dispatch({ type: "SELECT_ASSET", asset: null }),
693
+ children: /* @__PURE__ */ jsxs(
694
+ "div",
695
+ {
696
+ role: "presentation",
697
+ onClick: (e) => e.stopPropagation(),
698
+ style: {
699
+ width: "100%",
700
+ maxWidth: 900,
701
+ maxHeight: "90vh",
702
+ backgroundColor: theme.surfaceBackground,
703
+ borderRadius: 16,
704
+ overflow: "hidden",
705
+ display: "flex",
706
+ flexDirection: "column"
707
+ },
708
+ children: [
709
+ /* @__PURE__ */ jsxs(
710
+ "div",
711
+ {
712
+ style: {
713
+ display: "flex",
714
+ padding: 20,
715
+ backgroundColor: theme.headerBackground,
716
+ borderBottom: `1px solid ${theme.border}`
717
+ },
718
+ children: [
719
+ /* @__PURE__ */ jsx(
720
+ "div",
721
+ {
722
+ style: {
723
+ width: 200,
724
+ height: 112,
725
+ backgroundColor: "rgba(0,0,0,0.3)",
726
+ borderRadius: 8,
727
+ backgroundImage: `url(${asset.thumbnailUrl})`,
728
+ backgroundSize: "cover",
729
+ backgroundPosition: "center",
730
+ marginRight: 20,
731
+ flexShrink: 0
732
+ }
733
+ }
734
+ ),
735
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
736
+ /* @__PURE__ */ jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600, color: theme.textPrimary }, children: asset.name }),
737
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: 14, color: theme.textSecondary, marginTop: 4 }, children: [
738
+ "by ",
739
+ asset.publisher
740
+ ] }),
741
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 16, marginTop: 12 }, children: [
742
+ /* @__PURE__ */ jsx(RatingStars, { rating: asset.rating, count: asset.ratingCount }),
743
+ /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: theme.textSecondary }, children: formatFileSize(asset.fileSize) }),
744
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: 12, color: theme.textSecondary }, children: [
745
+ "Unity ",
746
+ asset.minUnityVersion,
747
+ "+"
748
+ ] })
749
+ ] }),
750
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginTop: 12 }, children: [
751
+ asset.renderPipelines.map((rp) => /* @__PURE__ */ jsx(
752
+ "span",
753
+ {
754
+ style: {
755
+ padding: "2px 8px",
756
+ fontSize: 10,
757
+ backgroundColor: theme.accent,
758
+ borderRadius: 4,
759
+ color: "#fff",
760
+ textTransform: "uppercase"
761
+ },
762
+ children: rp
763
+ },
764
+ rp
765
+ )),
766
+ asset.tags.slice(0, 5).map((tag) => /* @__PURE__ */ jsx(
767
+ "span",
768
+ {
769
+ style: {
770
+ padding: "2px 8px",
771
+ fontSize: 10,
772
+ backgroundColor: "rgba(255,255,255,0.1)",
773
+ borderRadius: 4,
774
+ color: theme.textSecondary
775
+ },
776
+ children: tag
777
+ },
778
+ tag
779
+ ))
780
+ ] })
781
+ ] }),
782
+ /* @__PURE__ */ jsxs("div", { style: { textAlign: "right", marginLeft: 20 }, children: [
783
+ asset.originalPrice && /* @__PURE__ */ jsx(
784
+ "div",
785
+ {
786
+ style: { fontSize: 14, color: theme.textSecondary, textDecoration: "line-through" },
787
+ children: formatPrice(asset.originalPrice, asset.currency)
788
+ }
789
+ ),
790
+ /* @__PURE__ */ jsx(
791
+ "div",
792
+ {
793
+ style: {
794
+ fontSize: 28,
795
+ fontWeight: 700,
796
+ color: asset.isFree ? theme.freeBadge : theme.textPrimary
797
+ },
798
+ children: formatPrice(asset.price, asset.currency)
799
+ }
800
+ ),
801
+ /* @__PURE__ */ jsxs("div", { style: { marginTop: 12 }, children: [
802
+ asset.isOwned ? /* @__PURE__ */ jsx(
803
+ "button",
804
+ {
805
+ onClick: () => downloadAsset(asset.id),
806
+ disabled: isDownloading,
807
+ style: {
808
+ width: "100%",
809
+ padding: "12px 24px",
810
+ fontSize: 14,
811
+ fontWeight: 600,
812
+ backgroundColor: isDownloading ? theme.textSecondary : theme.success,
813
+ border: "none",
814
+ borderRadius: 8,
815
+ color: "#fff",
816
+ cursor: isDownloading ? "not-allowed" : "pointer"
817
+ },
818
+ children: isDownloading ? `Downloading ${downloadProgress}%` : "Download & Import"
819
+ }
820
+ ) : /* @__PURE__ */ jsx(
821
+ "button",
822
+ {
823
+ onClick: () => isInCart ? dispatch({ type: "REMOVE_FROM_CART", id: asset.id }) : dispatch({ type: "ADD_TO_CART", id: asset.id }),
824
+ style: {
825
+ width: "100%",
826
+ padding: "12px 24px",
827
+ fontSize: 14,
828
+ fontWeight: 600,
829
+ backgroundColor: isInCart ? theme.warning : theme.accent,
830
+ border: "none",
831
+ borderRadius: 8,
832
+ color: "#fff",
833
+ cursor: "pointer"
834
+ },
835
+ children: isInCart ? "Remove from Cart" : "Add to Cart"
836
+ }
837
+ ),
838
+ /* @__PURE__ */ jsxs(
839
+ "button",
840
+ {
841
+ onClick: () => openInBrowser(asset),
842
+ style: {
843
+ width: "100%",
844
+ marginTop: 8,
845
+ padding: "10px 24px",
846
+ fontSize: 12,
847
+ backgroundColor: "transparent",
848
+ border: `1px solid ${theme.border}`,
849
+ borderRadius: 8,
850
+ color: theme.textSecondary,
851
+ cursor: "pointer"
852
+ },
853
+ children: [
854
+ /* @__PURE__ */ jsx(NiceIcon, { name: "external-link", size: 14 }),
855
+ " View on Asset Store"
856
+ ]
857
+ }
858
+ )
859
+ ] })
860
+ ] }),
861
+ /* @__PURE__ */ jsx(
862
+ "button",
863
+ {
864
+ onClick: () => dispatch({ type: "SELECT_ASSET", asset: null }),
865
+ style: {
866
+ position: "absolute",
867
+ top: 16,
868
+ right: 16,
869
+ padding: 8,
870
+ fontSize: 18,
871
+ backgroundColor: "transparent",
872
+ border: "none",
873
+ color: theme.textSecondary,
874
+ cursor: "pointer"
875
+ },
876
+ children: /* @__PURE__ */ jsx(NiceIcon, { name: "close", size: 14 })
877
+ }
878
+ )
879
+ ]
880
+ }
881
+ ),
882
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", borderBottom: `1px solid ${theme.border}` }, children: ["overview", "images", "reviews"].map((tab) => /* @__PURE__ */ jsx(
883
+ "button",
884
+ {
885
+ onClick: () => setActiveTab(tab),
886
+ style: {
887
+ flex: 1,
888
+ padding: "12px 16px",
889
+ fontSize: 13,
890
+ fontWeight: 500,
891
+ backgroundColor: "transparent",
892
+ border: "none",
893
+ borderBottom: activeTab === tab ? `2px solid ${theme.accent}` : "2px solid transparent",
894
+ color: activeTab === tab ? theme.textPrimary : theme.textSecondary,
895
+ cursor: "pointer",
896
+ textTransform: "capitalize"
897
+ },
898
+ children: tab
899
+ },
900
+ tab
901
+ )) }),
902
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflow: "auto", padding: 20 }, children: [
903
+ activeTab === "overview" && /* @__PURE__ */ jsxs("div", { children: [
904
+ /* @__PURE__ */ jsx(
905
+ "h3",
906
+ {
907
+ style: {
908
+ margin: "0 0 12px",
909
+ fontSize: 16,
910
+ fontWeight: 600,
911
+ color: theme.textPrimary
912
+ },
913
+ children: "Description"
914
+ }
915
+ ),
916
+ /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: 14, lineHeight: 1.6, color: theme.textSecondary }, children: asset.description }),
917
+ /* @__PURE__ */ jsxs("div", { style: { marginTop: 24 }, children: [
918
+ /* @__PURE__ */ jsx(
919
+ "h3",
920
+ {
921
+ style: {
922
+ margin: "0 0 12px",
923
+ fontSize: 16,
924
+ fontWeight: 600,
925
+ color: theme.textPrimary
926
+ },
927
+ children: "Details"
928
+ }
929
+ ),
930
+ /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 12 }, children: [
931
+ /* @__PURE__ */ jsxs(
932
+ "div",
933
+ {
934
+ style: { padding: 12, backgroundColor: theme.cardBackground, borderRadius: 8 },
935
+ children: [
936
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.textSecondary }, children: "Version" }),
937
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 14, color: theme.textPrimary, fontWeight: 500 }, children: asset.version })
938
+ ]
939
+ }
940
+ ),
941
+ /* @__PURE__ */ jsxs(
942
+ "div",
943
+ {
944
+ style: { padding: 12, backgroundColor: theme.cardBackground, borderRadius: 8 },
945
+ children: [
946
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.textSecondary }, children: "Last Updated" }),
947
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 14, color: theme.textPrimary, fontWeight: 500 }, children: asset.lastUpdated })
948
+ ]
949
+ }
950
+ ),
951
+ /* @__PURE__ */ jsxs(
952
+ "div",
953
+ {
954
+ style: { padding: 12, backgroundColor: theme.cardBackground, borderRadius: 8 },
955
+ children: [
956
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.textSecondary }, children: "Min Unity Version" }),
957
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 14, color: theme.textPrimary, fontWeight: 500 }, children: asset.minUnityVersion })
958
+ ]
959
+ }
960
+ ),
961
+ /* @__PURE__ */ jsxs(
962
+ "div",
963
+ {
964
+ style: { padding: 12, backgroundColor: theme.cardBackground, borderRadius: 8 },
965
+ children: [
966
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.textSecondary }, children: "File Size" }),
967
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 14, color: theme.textPrimary, fontWeight: 500 }, children: formatFileSize(asset.fileSize) })
968
+ ]
969
+ }
970
+ )
971
+ ] })
972
+ ] })
973
+ ] }),
974
+ activeTab === "images" && /* @__PURE__ */ jsxs(
975
+ "div",
976
+ {
977
+ style: {
978
+ display: "grid",
979
+ gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
980
+ gap: 12
981
+ },
982
+ children: [
983
+ asset.previewImages.map((url, i) => /* @__PURE__ */ jsx(
984
+ "div",
985
+ {
986
+ style: {
987
+ paddingTop: "56.25%",
988
+ backgroundColor: "rgba(0,0,0,0.3)",
989
+ borderRadius: 8,
990
+ backgroundImage: `url(${url})`,
991
+ backgroundSize: "cover",
992
+ backgroundPosition: "center"
993
+ }
994
+ },
995
+ i
996
+ )),
997
+ asset.previewImages.length === 0 && /* @__PURE__ */ jsx("div", { style: { color: theme.textSecondary }, children: "No preview images available" })
998
+ ]
999
+ }
1000
+ ),
1001
+ activeTab === "reviews" && /* @__PURE__ */ jsx("div", { style: { color: theme.textSecondary }, children: "Reviews would be loaded from the Asset Store API" })
1002
+ ] })
1003
+ ]
1004
+ }
1005
+ )
410
1006
  }
411
- const asset = state.selectedAsset;
412
- const isInCart = state.cart.has(asset.id);
413
- const isDownloading = state.downloading.has(asset.id);
414
- const downloadProgress = state.downloading.get(asset.id) ?? 0;
415
- return (jsx("div", { role: "presentation", style: {
416
- position: 'fixed',
417
- top: 0,
418
- left: 0,
419
- right: 0,
420
- bottom: 0,
421
- backgroundColor: 'rgba(0,0,0,0.8)',
422
- display: 'flex',
423
- alignItems: 'center',
424
- justifyContent: 'center',
425
- zIndex: 1000,
426
- padding: 24,
427
- }, onClick: () => dispatch({ type: 'SELECT_ASSET', asset: null }), children: jsxs("div", { role: "presentation", onClick: (e) => e.stopPropagation(), style: {
428
- width: '100%',
429
- maxWidth: 900,
430
- maxHeight: '90vh',
431
- backgroundColor: theme.surfaceBackground,
432
- borderRadius: 16,
433
- overflow: 'hidden',
434
- display: 'flex',
435
- flexDirection: 'column',
436
- }, children: [jsxs("div", { style: {
437
- display: 'flex',
438
- padding: 20,
439
- backgroundColor: theme.headerBackground,
440
- borderBottom: `1px solid ${theme.border}`,
441
- }, children: [jsx("div", { style: {
442
- width: 200,
443
- height: 112,
444
- backgroundColor: 'rgba(0,0,0,0.3)',
445
- borderRadius: 8,
446
- backgroundImage: `url(${asset.thumbnailUrl})`,
447
- backgroundSize: 'cover',
448
- backgroundPosition: 'center',
449
- marginRight: 20,
450
- flexShrink: 0,
451
- } }), jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600, color: theme.textPrimary }, children: asset.name }), jsxs("div", { style: { fontSize: 14, color: theme.textSecondary, marginTop: 4 }, children: ["by ", asset.publisher] }), jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 16, marginTop: 12 }, children: [jsx(RatingStars, { rating: asset.rating, count: asset.ratingCount }), jsx("span", { style: { fontSize: 12, color: theme.textSecondary }, children: formatFileSize(asset.fileSize) }), jsxs("span", { style: { fontSize: 12, color: theme.textSecondary }, children: ["Unity ", asset.minUnityVersion, "+"] })] }), jsxs("div", { style: { display: 'flex', flexWrap: 'wrap', gap: 6, marginTop: 12 }, children: [asset.renderPipelines.map((rp) => (jsx("span", { style: {
452
- padding: '2px 8px',
453
- fontSize: 10,
454
- backgroundColor: theme.accent,
455
- borderRadius: 4,
456
- color: '#fff',
457
- textTransform: 'uppercase',
458
- }, children: rp }, rp))), asset.tags.slice(0, 5).map((tag) => (jsx("span", { style: {
459
- padding: '2px 8px',
460
- fontSize: 10,
461
- backgroundColor: 'rgba(255,255,255,0.1)',
462
- borderRadius: 4,
463
- color: theme.textSecondary,
464
- }, children: tag }, tag)))] })] }), jsxs("div", { style: { textAlign: 'right', marginLeft: 20 }, children: [asset.originalPrice && (jsx("div", { style: { fontSize: 14, color: theme.textSecondary, textDecoration: 'line-through' }, children: formatPrice(asset.originalPrice, asset.currency) })), jsx("div", { style: {
465
- fontSize: 28,
466
- fontWeight: 700,
467
- color: asset.isFree ? theme.freeBadge : theme.textPrimary,
468
- }, children: formatPrice(asset.price, asset.currency) }), jsxs("div", { style: { marginTop: 12 }, children: [asset.isOwned ? (jsx("button", { onClick: () => downloadAsset(asset.id), disabled: isDownloading, style: {
469
- width: '100%',
470
- padding: '12px 24px',
471
- fontSize: 14,
472
- fontWeight: 600,
473
- backgroundColor: isDownloading ? theme.textSecondary : theme.success,
474
- border: 'none',
475
- borderRadius: 8,
476
- color: '#fff',
477
- cursor: isDownloading ? 'not-allowed' : 'pointer',
478
- }, children: isDownloading ? `Downloading ${downloadProgress}%` : 'Download & Import' })) : (jsx("button", { onClick: () => isInCart
479
- ? dispatch({ type: 'REMOVE_FROM_CART', id: asset.id })
480
- : dispatch({ type: 'ADD_TO_CART', id: asset.id }), style: {
481
- width: '100%',
482
- padding: '12px 24px',
483
- fontSize: 14,
484
- fontWeight: 600,
485
- backgroundColor: isInCart ? theme.warning : theme.accent,
486
- border: 'none',
487
- borderRadius: 8,
488
- color: '#fff',
489
- cursor: 'pointer',
490
- }, children: isInCart ? 'Remove from Cart' : 'Add to Cart' })), jsxs("button", { onClick: () => openInBrowser(asset), style: {
491
- width: '100%',
492
- marginTop: 8,
493
- padding: '10px 24px',
494
- fontSize: 12,
495
- backgroundColor: 'transparent',
496
- border: `1px solid ${theme.border}`,
497
- borderRadius: 8,
498
- color: theme.textSecondary,
499
- cursor: 'pointer',
500
- }, children: [jsx(NiceIcon, { name: "external-link", size: 14 }), " View on Asset Store"] })] })] }), jsx("button", { onClick: () => dispatch({ type: 'SELECT_ASSET', asset: null }), style: {
501
- position: 'absolute',
502
- top: 16,
503
- right: 16,
504
- padding: 8,
505
- fontSize: 18,
506
- backgroundColor: 'transparent',
507
- border: 'none',
508
- color: theme.textSecondary,
509
- cursor: 'pointer',
510
- }, children: jsx(NiceIcon, { name: "close", size: 14 }) })] }), jsx("div", { style: { display: 'flex', borderBottom: `1px solid ${theme.border}` }, children: ['overview', 'images', 'reviews'].map((tab) => (jsx("button", { onClick: () => setActiveTab(tab), style: {
511
- flex: 1,
512
- padding: '12px 16px',
513
- fontSize: 13,
514
- fontWeight: 500,
515
- backgroundColor: 'transparent',
516
- border: 'none',
517
- borderBottom: activeTab === tab ? `2px solid ${theme.accent}` : '2px solid transparent',
518
- color: activeTab === tab ? theme.textPrimary : theme.textSecondary,
519
- cursor: 'pointer',
520
- textTransform: 'capitalize',
521
- }, children: tab }, tab))) }), jsxs("div", { style: { flex: 1, overflow: 'auto', padding: 20 }, children: [activeTab === 'overview' && (jsxs("div", { children: [jsx("h3", { style: {
522
- margin: '0 0 12px',
523
- fontSize: 16,
524
- fontWeight: 600,
525
- color: theme.textPrimary,
526
- }, children: "Description" }), jsx("p", { style: { margin: 0, fontSize: 14, lineHeight: 1.6, color: theme.textSecondary }, children: asset.description }), jsxs("div", { style: { marginTop: 24 }, children: [jsx("h3", { style: {
527
- margin: '0 0 12px',
528
- fontSize: 16,
529
- fontWeight: 600,
530
- color: theme.textPrimary,
531
- }, children: "Details" }), jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12 }, children: [jsxs("div", { style: { padding: 12, backgroundColor: theme.cardBackground, borderRadius: 8 }, children: [jsx("div", { style: { fontSize: 11, color: theme.textSecondary }, children: "Version" }), jsx("div", { style: { fontSize: 14, color: theme.textPrimary, fontWeight: 500 }, children: asset.version })] }), jsxs("div", { style: { padding: 12, backgroundColor: theme.cardBackground, borderRadius: 8 }, children: [jsx("div", { style: { fontSize: 11, color: theme.textSecondary }, children: "Last Updated" }), jsx("div", { style: { fontSize: 14, color: theme.textPrimary, fontWeight: 500 }, children: asset.lastUpdated })] }), jsxs("div", { style: { padding: 12, backgroundColor: theme.cardBackground, borderRadius: 8 }, children: [jsx("div", { style: { fontSize: 11, color: theme.textSecondary }, children: "Min Unity Version" }), jsx("div", { style: { fontSize: 14, color: theme.textPrimary, fontWeight: 500 }, children: asset.minUnityVersion })] }), jsxs("div", { style: { padding: 12, backgroundColor: theme.cardBackground, borderRadius: 8 }, children: [jsx("div", { style: { fontSize: 11, color: theme.textSecondary }, children: "File Size" }), jsx("div", { style: { fontSize: 14, color: theme.textPrimary, fontWeight: 500 }, children: formatFileSize(asset.fileSize) })] })] })] })] })), activeTab === 'images' && (jsxs("div", { style: {
532
- display: 'grid',
533
- gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',
534
- gap: 12,
535
- }, children: [asset.previewImages.map((url, i) => (jsx("div", { style: {
536
- paddingTop: '56.25%',
537
- backgroundColor: 'rgba(0,0,0,0.3)',
538
- borderRadius: 8,
539
- backgroundImage: `url(${url})`,
540
- backgroundSize: 'cover',
541
- backgroundPosition: 'center',
542
- } }, i))), asset.previewImages.length === 0 && (jsx("div", { style: { color: theme.textSecondary }, children: "No preview images available" }))] })), activeTab === 'reviews' && (jsx("div", { style: { color: theme.textSecondary }, children: "Reviews would be loaded from the Asset Store API" }))] })] }) }));
1007
+ );
543
1008
  };
544
- // Demo assets
545
1009
  const DEMO_ASSETS = [
546
- {
547
- id: '1',
548
- name: 'Polygon Fantasy Kingdom',
549
- publisher: 'Synty Studios',
550
- publisherId: 'synty',
551
- category: '3d',
552
- shortDescription: 'Low poly fantasy modular asset pack',
553
- description: 'A massive library of low-poly 3D assets perfect for creating fantasy worlds. Includes buildings, characters, props, weapons, and more.',
554
- price: 99.99,
555
- currency: 'USD',
556
- isFree: false,
557
- rating: 4.8,
558
- ratingCount: 2840,
559
- thumbnailUrl: '',
560
- previewImages: [],
561
- unityVersions: ['2020.3', '2021.3', '2022.3'],
562
- minUnityVersion: '2020.3',
563
- fileSize: 456000000,
564
- lastUpdated: '2024-01-10',
565
- version: '2.5.0',
566
- tags: ['lowpoly', 'fantasy', 'medieval', 'modular'],
567
- isOwned: false,
568
- renderPipelines: ['builtin', 'urp', 'hdrp'],
569
- url: 'https://assetstore.unity.com/',
570
- },
571
- {
572
- id: '2',
573
- name: 'DOTween Pro',
574
- publisher: 'Demigiant',
575
- publisherId: 'demigiant',
576
- category: 'tools',
577
- shortDescription: 'High-performance animation engine',
578
- description: 'DOTween is a fast, efficient, fully type-safe object-oriented animation engine for Unity, optimized for C# users.',
579
- price: 15.0,
580
- originalPrice: 20.0,
581
- currency: 'USD',
582
- isFree: false,
583
- rating: 5.0,
584
- ratingCount: 5621,
585
- thumbnailUrl: '',
586
- previewImages: [],
587
- unityVersions: ['2019.4', '2020.3', '2021.3', '2022.3'],
588
- minUnityVersion: '2019.4',
589
- fileSize: 1200000,
590
- lastUpdated: '2023-12-15',
591
- version: '1.0.375',
592
- tags: ['animation', 'tween', 'performance'],
593
- isOwned: true,
594
- renderPipelines: ['builtin', 'urp', 'hdrp'],
595
- url: 'https://assetstore.unity.com/',
596
- },
597
- {
598
- id: '3',
599
- name: 'Ultimate Character Controller',
600
- publisher: 'Opsive',
601
- publisherId: 'opsive',
602
- category: 'tools',
603
- shortDescription: 'Professional character controller',
604
- description: 'The Ultimate Character Controller is a professional, kinematic character controller designed to include the smoothest first and third person controls.',
605
- price: 75.0,
606
- currency: 'USD',
607
- isFree: false,
608
- rating: 4.7,
609
- ratingCount: 892,
610
- thumbnailUrl: '',
611
- previewImages: [],
612
- unityVersions: ['2020.3', '2021.3', '2022.3'],
613
- minUnityVersion: '2020.3',
614
- fileSize: 89000000,
615
- lastUpdated: '2024-01-05',
616
- version: '3.1.2',
617
- tags: ['character', 'controller', 'fps', 'tps'],
618
- isOwned: false,
619
- renderPipelines: ['builtin', 'urp'],
620
- url: 'https://assetstore.unity.com/',
621
- },
622
- {
623
- id: '4',
624
- name: 'AllSky - Free',
625
- publisher: 'rpgwhitelock',
626
- publisherId: 'rpgwhitelock',
627
- category: '2d',
628
- shortDescription: 'Free skybox pack',
629
- description: '10 free skyboxes in various styles. Perfect for prototyping or small projects.',
630
- price: 0,
631
- currency: 'USD',
632
- isFree: true,
633
- rating: 4.9,
634
- ratingCount: 3200,
635
- thumbnailUrl: '',
636
- previewImages: [],
637
- unityVersions: ['2019.4', '2020.3', '2021.3', '2022.3'],
638
- minUnityVersion: '2019.4',
639
- fileSize: 45000000,
640
- lastUpdated: '2023-06-20',
641
- version: '1.2.0',
642
- tags: ['skybox', 'environment', 'free'],
643
- isOwned: true,
644
- renderPipelines: ['builtin', 'urp', 'hdrp'],
645
- url: 'https://assetstore.unity.com/',
646
- },
647
- {
648
- id: '5',
649
- name: 'Magic Effects FREE',
650
- publisher: 'Hovl Studio',
651
- publisherId: 'hovl',
652
- category: 'vfx',
653
- shortDescription: 'Free VFX magic effects',
654
- description: 'A free pack of 20 magic spell effects with particles, trails, and meshes.',
655
- price: 0,
656
- currency: 'USD',
657
- isFree: true,
658
- rating: 4.8,
659
- ratingCount: 1560,
660
- thumbnailUrl: '',
661
- previewImages: [],
662
- unityVersions: ['2019.4', '2020.3', '2021.3', '2022.3'],
663
- minUnityVersion: '2019.4',
664
- fileSize: 78000000,
665
- lastUpdated: '2023-09-12',
666
- version: '1.5.0',
667
- tags: ['vfx', 'particles', 'magic', 'free'],
668
- isOwned: false,
669
- renderPipelines: ['builtin', 'urp'],
670
- url: 'https://assetstore.unity.com/',
671
- },
672
- {
673
- id: '6',
674
- name: 'Odin Inspector',
675
- publisher: 'Sirenix',
676
- publisherId: 'sirenix',
677
- category: 'tools',
678
- shortDescription: 'Powerful Unity inspector',
679
- description: 'Odin puts a complete inspector replacement, custom attribute system, and serialization suite at your fingertips.',
680
- price: 55.0,
681
- currency: 'USD',
682
- isFree: false,
683
- rating: 5.0,
684
- ratingCount: 4100,
685
- thumbnailUrl: '',
686
- previewImages: [],
687
- unityVersions: ['2019.4', '2020.3', '2021.3', '2022.3'],
688
- minUnityVersion: '2019.4',
689
- fileSize: 35000000,
690
- lastUpdated: '2024-01-12',
691
- version: '3.2.1',
692
- tags: ['inspector', 'serialization', 'editor', 'attributes'],
693
- isOwned: false,
694
- renderPipelines: ['builtin', 'urp', 'hdrp'],
695
- url: 'https://assetstore.unity.com/',
696
- },
1010
+ {
1011
+ id: "1",
1012
+ name: "Polygon Fantasy Kingdom",
1013
+ publisher: "Synty Studios",
1014
+ publisherId: "synty",
1015
+ category: "3d",
1016
+ shortDescription: "Low poly fantasy modular asset pack",
1017
+ description: "A massive library of low-poly 3D assets perfect for creating fantasy worlds. Includes buildings, characters, props, weapons, and more.",
1018
+ price: 99.99,
1019
+ currency: "USD",
1020
+ isFree: false,
1021
+ rating: 4.8,
1022
+ ratingCount: 2840,
1023
+ thumbnailUrl: "",
1024
+ previewImages: [],
1025
+ unityVersions: ["2020.3", "2021.3", "2022.3"],
1026
+ minUnityVersion: "2020.3",
1027
+ fileSize: 456e6,
1028
+ lastUpdated: "2024-01-10",
1029
+ version: "2.5.0",
1030
+ tags: ["lowpoly", "fantasy", "medieval", "modular"],
1031
+ isOwned: false,
1032
+ renderPipelines: ["builtin", "urp", "hdrp"],
1033
+ url: "https://assetstore.unity.com/"
1034
+ },
1035
+ {
1036
+ id: "2",
1037
+ name: "DOTween Pro",
1038
+ publisher: "Demigiant",
1039
+ publisherId: "demigiant",
1040
+ category: "tools",
1041
+ shortDescription: "High-performance animation engine",
1042
+ description: "DOTween is a fast, efficient, fully type-safe object-oriented animation engine for Unity, optimized for C# users.",
1043
+ price: 15,
1044
+ originalPrice: 20,
1045
+ currency: "USD",
1046
+ isFree: false,
1047
+ rating: 5,
1048
+ ratingCount: 5621,
1049
+ thumbnailUrl: "",
1050
+ previewImages: [],
1051
+ unityVersions: ["2019.4", "2020.3", "2021.3", "2022.3"],
1052
+ minUnityVersion: "2019.4",
1053
+ fileSize: 12e5,
1054
+ lastUpdated: "2023-12-15",
1055
+ version: "1.0.375",
1056
+ tags: ["animation", "tween", "performance"],
1057
+ isOwned: true,
1058
+ renderPipelines: ["builtin", "urp", "hdrp"],
1059
+ url: "https://assetstore.unity.com/"
1060
+ },
1061
+ {
1062
+ id: "3",
1063
+ name: "Ultimate Character Controller",
1064
+ publisher: "Opsive",
1065
+ publisherId: "opsive",
1066
+ category: "tools",
1067
+ shortDescription: "Professional character controller",
1068
+ description: "The Ultimate Character Controller is a professional, kinematic character controller designed to include the smoothest first and third person controls.",
1069
+ price: 75,
1070
+ currency: "USD",
1071
+ isFree: false,
1072
+ rating: 4.7,
1073
+ ratingCount: 892,
1074
+ thumbnailUrl: "",
1075
+ previewImages: [],
1076
+ unityVersions: ["2020.3", "2021.3", "2022.3"],
1077
+ minUnityVersion: "2020.3",
1078
+ fileSize: 89e6,
1079
+ lastUpdated: "2024-01-05",
1080
+ version: "3.1.2",
1081
+ tags: ["character", "controller", "fps", "tps"],
1082
+ isOwned: false,
1083
+ renderPipelines: ["builtin", "urp"],
1084
+ url: "https://assetstore.unity.com/"
1085
+ },
1086
+ {
1087
+ id: "4",
1088
+ name: "AllSky - Free",
1089
+ publisher: "rpgwhitelock",
1090
+ publisherId: "rpgwhitelock",
1091
+ category: "2d",
1092
+ shortDescription: "Free skybox pack",
1093
+ description: "10 free skyboxes in various styles. Perfect for prototyping or small projects.",
1094
+ price: 0,
1095
+ currency: "USD",
1096
+ isFree: true,
1097
+ rating: 4.9,
1098
+ ratingCount: 3200,
1099
+ thumbnailUrl: "",
1100
+ previewImages: [],
1101
+ unityVersions: ["2019.4", "2020.3", "2021.3", "2022.3"],
1102
+ minUnityVersion: "2019.4",
1103
+ fileSize: 45e6,
1104
+ lastUpdated: "2023-06-20",
1105
+ version: "1.2.0",
1106
+ tags: ["skybox", "environment", "free"],
1107
+ isOwned: true,
1108
+ renderPipelines: ["builtin", "urp", "hdrp"],
1109
+ url: "https://assetstore.unity.com/"
1110
+ },
1111
+ {
1112
+ id: "5",
1113
+ name: "Magic Effects FREE",
1114
+ publisher: "Hovl Studio",
1115
+ publisherId: "hovl",
1116
+ category: "vfx",
1117
+ shortDescription: "Free VFX magic effects",
1118
+ description: "A free pack of 20 magic spell effects with particles, trails, and meshes.",
1119
+ price: 0,
1120
+ currency: "USD",
1121
+ isFree: true,
1122
+ rating: 4.8,
1123
+ ratingCount: 1560,
1124
+ thumbnailUrl: "",
1125
+ previewImages: [],
1126
+ unityVersions: ["2019.4", "2020.3", "2021.3", "2022.3"],
1127
+ minUnityVersion: "2019.4",
1128
+ fileSize: 78e6,
1129
+ lastUpdated: "2023-09-12",
1130
+ version: "1.5.0",
1131
+ tags: ["vfx", "particles", "magic", "free"],
1132
+ isOwned: false,
1133
+ renderPipelines: ["builtin", "urp"],
1134
+ url: "https://assetstore.unity.com/"
1135
+ },
1136
+ {
1137
+ id: "6",
1138
+ name: "Odin Inspector",
1139
+ publisher: "Sirenix",
1140
+ publisherId: "sirenix",
1141
+ category: "tools",
1142
+ shortDescription: "Powerful Unity inspector",
1143
+ description: "Odin puts a complete inspector replacement, custom attribute system, and serialization suite at your fingertips.",
1144
+ price: 55,
1145
+ currency: "USD",
1146
+ isFree: false,
1147
+ rating: 5,
1148
+ ratingCount: 4100,
1149
+ thumbnailUrl: "",
1150
+ previewImages: [],
1151
+ unityVersions: ["2019.4", "2020.3", "2021.3", "2022.3"],
1152
+ minUnityVersion: "2019.4",
1153
+ fileSize: 35e6,
1154
+ lastUpdated: "2024-01-12",
1155
+ version: "3.2.1",
1156
+ tags: ["inspector", "serialization", "editor", "attributes"],
1157
+ isOwned: false,
1158
+ renderPipelines: ["builtin", "urp", "hdrp"],
1159
+ url: "https://assetstore.unity.com/"
1160
+ }
697
1161
  ];
698
1162
  const UnityAssetStoreBrowser = /* @__PURE__ */ Object.assign(
699
- /* @__PURE__ */ forwardRef(({ theme: themeOverride, onDownload, onPurchase: _onPurchase, className, style }, ref) => {
700
- const [state, dispatch] = useReducer(storeReducer, {
1163
+ /* @__PURE__ */ forwardRef(
1164
+ ({ theme: themeOverride, onDownload, onPurchase: _onPurchase, className, style }, ref) => {
1165
+ const [state, dispatch] = useReducer(storeReducer, {
701
1166
  ...INITIAL_STATE,
702
1167
  results: DEMO_ASSETS,
703
- totalResults: DEMO_ASSETS.length,
704
- });
705
- const theme = useMemo(() => ({ ...DEFAULT_THEME, ...themeOverride }), [themeOverride]);
706
- // Search
707
- const search = useCallback(async () => {
708
- dispatch({ type: 'SET_LOADING', loading: true });
709
- dispatch({ type: 'SET_ERROR', error: null });
1168
+ totalResults: DEMO_ASSETS.length
1169
+ });
1170
+ const theme = useMemo(() => ({ ...DEFAULT_THEME, ...themeOverride }), [themeOverride]);
1171
+ const search = useCallback(async () => {
1172
+ dispatch({ type: "SET_LOADING", loading: true });
1173
+ dispatch({ type: "SET_ERROR", error: null });
710
1174
  try {
711
- // Simulate API call
712
- await new Promise((resolve) => setTimeout(resolve, 500));
713
- // Filter demo assets
714
- let filtered = [...DEMO_ASSETS];
715
- if (state.query.query) {
716
- const q = state.query.query.toLowerCase();
717
- filtered = filtered.filter((a) => a.name.toLowerCase().includes(q) ||
718
- a.publisher.toLowerCase().includes(q) ||
719
- a.tags.some((t) => t.toLowerCase().includes(q)));
720
- }
721
- if (state.query.category !== 'all') {
722
- filtered = filtered.filter((a) => a.category === state.query.category);
723
- }
724
- if (state.query.pricing === 'free') {
725
- filtered = filtered.filter((a) => a.isFree);
726
- }
727
- else if (state.query.pricing === 'paid') {
728
- filtered = filtered.filter((a) => !a.isFree);
729
- }
730
- else if (state.query.pricing === 'sale') {
731
- filtered = filtered.filter((a) => a.originalPrice !== undefined);
732
- }
733
- if (state.myAssets) {
734
- filtered = filtered.filter((a) => a.isOwned);
735
- }
736
- dispatch({ type: 'SET_RESULTS', results: filtered, total: filtered.length });
737
- }
738
- catch (error) {
739
- dispatch({ type: 'SET_ERROR', error: String(error) });
1175
+ await new Promise((resolve) => setTimeout(resolve, 500));
1176
+ let filtered = [...DEMO_ASSETS];
1177
+ if (state.query.query) {
1178
+ const q = state.query.query.toLowerCase();
1179
+ filtered = filtered.filter(
1180
+ (a) => a.name.toLowerCase().includes(q) || a.publisher.toLowerCase().includes(q) || a.tags.some((t) => t.toLowerCase().includes(q))
1181
+ );
1182
+ }
1183
+ if (state.query.category !== "all") {
1184
+ filtered = filtered.filter((a) => a.category === state.query.category);
1185
+ }
1186
+ if (state.query.pricing === "free") {
1187
+ filtered = filtered.filter((a) => a.isFree);
1188
+ } else if (state.query.pricing === "paid") {
1189
+ filtered = filtered.filter((a) => !a.isFree);
1190
+ } else if (state.query.pricing === "sale") {
1191
+ filtered = filtered.filter((a) => a.originalPrice !== void 0);
1192
+ }
1193
+ if (state.myAssets) {
1194
+ filtered = filtered.filter((a) => a.isOwned);
1195
+ }
1196
+ dispatch({ type: "SET_RESULTS", results: filtered, total: filtered.length });
1197
+ } catch (error) {
1198
+ dispatch({ type: "SET_ERROR", error: String(error) });
1199
+ } finally {
1200
+ dispatch({ type: "SET_LOADING", loading: false });
740
1201
  }
741
- finally {
742
- dispatch({ type: 'SET_LOADING', loading: false });
743
- }
744
- }, [state.query, state.myAssets]);
745
- // Download asset
746
- const downloadAsset = useCallback(async (id) => {
747
- dispatch({ type: 'SET_DOWNLOAD_PROGRESS', id, progress: 0 });
748
- try {
749
- // Simulate download
1202
+ }, [state.query, state.myAssets]);
1203
+ const downloadAsset = useCallback(
1204
+ async (id) => {
1205
+ dispatch({ type: "SET_DOWNLOAD_PROGRESS", id, progress: 0 });
1206
+ try {
750
1207
  for (let i = 1; i <= 10; i++) {
751
- await new Promise((resolve) => setTimeout(resolve, 200));
752
- dispatch({ type: 'SET_DOWNLOAD_PROGRESS', id, progress: i * 10 });
1208
+ await new Promise((resolve) => setTimeout(resolve, 200));
1209
+ dispatch({ type: "SET_DOWNLOAD_PROGRESS", id, progress: i * 10 });
753
1210
  }
754
1211
  if (onDownload) {
755
- await onDownload(id);
1212
+ await onDownload(id);
756
1213
  }
757
- }
758
- finally {
759
- dispatch({ type: 'CLEAR_DOWNLOAD', id });
760
- }
761
- }, [onDownload]);
762
- // Open in browser
763
- const openInBrowser = useCallback((asset) => {
764
- window.open(asset.url, '_blank');
765
- }, []);
766
- // Imperative handle
767
- useImperativeHandle(ref, () => ({
768
- search: async (query) => {
769
- if (query !== undefined) {
770
- dispatch({ type: 'SET_QUERY', query: { query } });
1214
+ } finally {
1215
+ dispatch({ type: "CLEAR_DOWNLOAD", id });
1216
+ }
1217
+ },
1218
+ [onDownload]
1219
+ );
1220
+ const openInBrowser = useCallback((asset) => {
1221
+ window.open(asset.url, "_blank");
1222
+ }, []);
1223
+ useImperativeHandle(
1224
+ ref,
1225
+ () => ({
1226
+ search: async (query) => {
1227
+ if (query !== void 0) {
1228
+ dispatch({ type: "SET_QUERY", query: { query } });
771
1229
  }
772
1230
  await search();
773
- },
774
- getCart: () => [...state.cart],
775
- clearCart: () => dispatch({ type: 'CLEAR_CART' }),
776
- }), [search, state.cart]);
777
- const ctxValue = useMemo(() => ({
778
- state,
779
- dispatch,
780
- theme,
781
- search,
782
- downloadAsset,
783
- openInBrowser,
784
- }), [state, theme, search, downloadAsset, openInBrowser]);
785
- return (jsx(StoreContext.Provider, { value: ctxValue, children: jsxs("div", { className: `unity-asset-store-browser ${className ?? ''}`, style: {
786
- display: 'flex',
787
- flexDirection: 'column',
788
- width: '100%',
789
- height: '100%',
790
- backgroundColor: theme.background,
791
- fontFamily: 'system-ui, sans-serif',
792
- overflow: 'hidden',
793
- ...style,
794
- }, children: [jsx(SearchHeader, {}), jsx("div", { style: { flex: 1, overflow: 'auto' }, children: jsx(AssetGrid, {}) }), jsx(AssetDetailModal, {})] }) }));
795
- }), { displayName: 'UnityAssetStoreBrowser' });
796
-
797
- export { UnityAssetStoreBrowser };
1231
+ },
1232
+ getCart: () => [...state.cart],
1233
+ clearCart: () => dispatch({ type: "CLEAR_CART" })
1234
+ }),
1235
+ [search, state.cart]
1236
+ );
1237
+ const ctxValue = useMemo(
1238
+ () => ({
1239
+ state,
1240
+ dispatch,
1241
+ theme,
1242
+ search,
1243
+ downloadAsset,
1244
+ openInBrowser
1245
+ }),
1246
+ [state, theme, search, downloadAsset, openInBrowser]
1247
+ );
1248
+ return /* @__PURE__ */ jsx(StoreContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs(
1249
+ "div",
1250
+ {
1251
+ className: `unity-asset-store-browser ${className ?? ""}`,
1252
+ style: {
1253
+ display: "flex",
1254
+ flexDirection: "column",
1255
+ width: "100%",
1256
+ height: "100%",
1257
+ backgroundColor: theme.background,
1258
+ fontFamily: "system-ui, sans-serif",
1259
+ overflow: "hidden",
1260
+ ...style
1261
+ },
1262
+ children: [
1263
+ /* @__PURE__ */ jsx(SearchHeader, {}),
1264
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ jsx(AssetGrid, {}) }),
1265
+ /* @__PURE__ */ jsx(AssetDetailModal, {})
1266
+ ]
1267
+ }
1268
+ ) });
1269
+ }
1270
+ ),
1271
+ { displayName: "UnityAssetStoreBrowser" }
1272
+ );
1273
+ export {
1274
+ UnityAssetStoreBrowser
1275
+ };