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