@nice2dev/game-engine 1.3.15 → 1.3.17
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,495 +1,465 @@
|
|
|
1
|
-
import { EventBus } from
|
|
2
|
-
|
|
3
|
-
/* ────────────────────────────────────────────────────────────────
|
|
4
|
-
Plugin SDK — Architecture for 3rd party plugins
|
|
5
|
-
|
|
6
|
-
Sprint L9: Plugin lifecycle, sandboxing, dependencies,
|
|
7
|
-
extension points, templates, and marketplace API.
|
|
8
|
-
──────────────────────────────────────────────────────────────── */
|
|
9
|
-
/* ══════════════════════════════════════════════════════════════
|
|
10
|
-
Plugin Storage (in-memory with optional persistence)
|
|
11
|
-
══════════════════════════════════════════════════════════════ */
|
|
1
|
+
import { EventBus } from "../core/EventBus.js";
|
|
12
2
|
class InMemoryPluginStorage {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
constructor(pluginId) {
|
|
4
|
+
this.data = /* @__PURE__ */ new Map();
|
|
5
|
+
this.prefix = `nice2dev.plugin.${pluginId}.`;
|
|
6
|
+
}
|
|
7
|
+
get(key) {
|
|
8
|
+
if (this.data.has(key)) {
|
|
9
|
+
return this.data.get(key);
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const raw = localStorage.getItem(this.prefix + key);
|
|
24
|
-
if (raw !== null) {
|
|
25
|
-
try {
|
|
26
|
-
return JSON.parse(raw);
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
/* ignore */
|
|
30
|
-
}
|
|
31
|
-
}
|
|
11
|
+
if (typeof localStorage !== "undefined") {
|
|
12
|
+
const raw = localStorage.getItem(this.prefix + key);
|
|
13
|
+
if (raw !== null) {
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(raw);
|
|
16
|
+
} catch {
|
|
32
17
|
}
|
|
33
|
-
|
|
18
|
+
}
|
|
34
19
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
return void 0;
|
|
21
|
+
}
|
|
22
|
+
set(key, value) {
|
|
23
|
+
this.data.set(key, value);
|
|
24
|
+
if (typeof localStorage !== "undefined") {
|
|
25
|
+
localStorage.setItem(this.prefix + key, JSON.stringify(value));
|
|
40
26
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
}
|
|
28
|
+
remove(key) {
|
|
29
|
+
this.data.delete(key);
|
|
30
|
+
if (typeof localStorage !== "undefined") {
|
|
31
|
+
localStorage.removeItem(this.prefix + key);
|
|
46
32
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
for (const k of toRemove) {
|
|
58
|
-
localStorage.removeItem(k);
|
|
59
|
-
}
|
|
33
|
+
}
|
|
34
|
+
clear() {
|
|
35
|
+
this.data.clear();
|
|
36
|
+
if (typeof localStorage !== "undefined") {
|
|
37
|
+
const toRemove = [];
|
|
38
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
39
|
+
const k = localStorage.key(i);
|
|
40
|
+
if (k?.startsWith(this.prefix)) {
|
|
41
|
+
toRemove.push(k);
|
|
60
42
|
}
|
|
43
|
+
}
|
|
44
|
+
for (const k of toRemove) {
|
|
45
|
+
localStorage.removeItem(k);
|
|
46
|
+
}
|
|
61
47
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
48
|
+
}
|
|
49
|
+
keys() {
|
|
50
|
+
return Array.from(this.data.keys());
|
|
51
|
+
}
|
|
65
52
|
}
|
|
66
|
-
/* ══════════════════════════════════════════════════════════════
|
|
67
|
-
Plugin Manager
|
|
68
|
-
══════════════════════════════════════════════════════════════ */
|
|
69
53
|
class PluginManager {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
54
|
+
constructor() {
|
|
55
|
+
this.events = new EventBus();
|
|
56
|
+
this.plugins = /* @__PURE__ */ new Map();
|
|
57
|
+
this.extensions = /* @__PURE__ */ new Map();
|
|
58
|
+
}
|
|
59
|
+
/* ── Install ────────────────────────────────────────────────── */
|
|
60
|
+
install(definition) {
|
|
61
|
+
const id = definition.manifest.id;
|
|
62
|
+
if (this.plugins.has(id)) {
|
|
63
|
+
throw new Error(`[PluginManager] Plugin "${id}" is already installed.`);
|
|
74
64
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
65
|
+
if (definition.manifest.dependencies) {
|
|
66
|
+
for (const depId of Object.keys(definition.manifest.dependencies)) {
|
|
67
|
+
if (!this.plugins.has(depId)) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`[PluginManager] Plugin "${id}" requires "${depId}" which is not installed.`
|
|
70
|
+
);
|
|
80
71
|
}
|
|
81
|
-
|
|
82
|
-
if (definition.manifest.dependencies) {
|
|
83
|
-
for (const depId of Object.keys(definition.manifest.dependencies)) {
|
|
84
|
-
if (!this.plugins.has(depId)) {
|
|
85
|
-
throw new Error(`[PluginManager] Plugin "${id}" requires "${depId}" which is not installed.`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
const instance = {
|
|
90
|
-
definition,
|
|
91
|
-
state: 'installed',
|
|
92
|
-
activatedAt: null,
|
|
93
|
-
error: null,
|
|
94
|
-
extensions: new Map(),
|
|
95
|
-
};
|
|
96
|
-
this.plugins.set(id, instance);
|
|
97
|
-
this.events.emit('plugin:installed', { id, manifest: definition.manifest });
|
|
72
|
+
}
|
|
98
73
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.events.emit('plugin:activated', { id });
|
|
115
|
-
}
|
|
116
|
-
catch (err) {
|
|
117
|
-
instance.state = 'error';
|
|
118
|
-
instance.error = err instanceof Error ? err.message : String(err);
|
|
119
|
-
this.events.emit('plugin:error', { id, error: instance.error });
|
|
120
|
-
throw err;
|
|
121
|
-
}
|
|
74
|
+
const instance = {
|
|
75
|
+
definition,
|
|
76
|
+
state: "installed",
|
|
77
|
+
activatedAt: null,
|
|
78
|
+
error: null,
|
|
79
|
+
extensions: /* @__PURE__ */ new Map()
|
|
80
|
+
};
|
|
81
|
+
this.plugins.set(id, instance);
|
|
82
|
+
this.events.emit("plugin:installed", { id, manifest: definition.manifest });
|
|
83
|
+
}
|
|
84
|
+
/* ── Activate ───────────────────────────────────────────────── */
|
|
85
|
+
async activate(id) {
|
|
86
|
+
const instance = this.plugins.get(id);
|
|
87
|
+
if (!instance) {
|
|
88
|
+
throw new Error(`[PluginManager] Plugin "${id}" is not installed.`);
|
|
122
89
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const instance = this.plugins.get(id);
|
|
126
|
-
if (!instance || instance.state !== 'active') {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
const ctx = this.createContext(instance);
|
|
130
|
-
try {
|
|
131
|
-
await instance.definition.deactivate?.(ctx);
|
|
132
|
-
}
|
|
133
|
-
catch (err) {
|
|
134
|
-
if (typeof console !== 'undefined') {
|
|
135
|
-
console.warn(`[PluginManager] Error deactivating "${id}":`, err);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
// Remove all extensions registered by this plugin
|
|
139
|
-
for (const [point, entries] of instance.extensions) {
|
|
140
|
-
const global = this.extensions.get(point);
|
|
141
|
-
if (global) {
|
|
142
|
-
for (const entry of entries) {
|
|
143
|
-
const idx = global.indexOf(entry);
|
|
144
|
-
if (idx >= 0) {
|
|
145
|
-
global.splice(idx, 1);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
instance.extensions.clear();
|
|
151
|
-
instance.state = 'inactive';
|
|
152
|
-
instance.activatedAt = null;
|
|
153
|
-
this.events.emit('plugin:deactivated', { id });
|
|
90
|
+
if (instance.state === "active") {
|
|
91
|
+
return;
|
|
154
92
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
try {
|
|
175
|
-
await instance.definition.uninstall?.(ctx);
|
|
176
|
-
}
|
|
177
|
-
catch (e) {
|
|
178
|
-
console.warn(`Plugin '${id}' uninstall error:`, e);
|
|
179
|
-
}
|
|
180
|
-
this.plugins.delete(id);
|
|
181
|
-
this.events.emit('plugin:uninstalled', { id });
|
|
93
|
+
const ctx = this.createContext(instance);
|
|
94
|
+
try {
|
|
95
|
+
await instance.definition.activate(ctx);
|
|
96
|
+
instance.state = "active";
|
|
97
|
+
instance.activatedAt = Date.now();
|
|
98
|
+
instance.error = null;
|
|
99
|
+
this.events.emit("plugin:activated", { id });
|
|
100
|
+
} catch (err) {
|
|
101
|
+
instance.state = "error";
|
|
102
|
+
instance.error = err instanceof Error ? err.message : String(err);
|
|
103
|
+
this.events.emit("plugin:error", { id, error: instance.error });
|
|
104
|
+
throw err;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/* ── Deactivate ─────────────────────────────────────────────── */
|
|
108
|
+
async deactivate(id) {
|
|
109
|
+
const instance = this.plugins.get(id);
|
|
110
|
+
if (!instance || instance.state !== "active") {
|
|
111
|
+
return;
|
|
182
112
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
113
|
+
const ctx = this.createContext(instance);
|
|
114
|
+
try {
|
|
115
|
+
await instance.definition.deactivate?.(ctx);
|
|
116
|
+
} catch (err) {
|
|
117
|
+
if (typeof console !== "undefined") {
|
|
118
|
+
console.warn(`[PluginManager] Error deactivating "${id}":`, err);
|
|
119
|
+
}
|
|
186
120
|
}
|
|
187
|
-
|
|
188
|
-
|
|
121
|
+
for (const [point, entries] of instance.extensions) {
|
|
122
|
+
const global = this.extensions.get(point);
|
|
123
|
+
if (global) {
|
|
124
|
+
for (const entry of entries) {
|
|
125
|
+
const idx = global.indexOf(entry);
|
|
126
|
+
if (idx >= 0) {
|
|
127
|
+
global.splice(idx, 1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
189
131
|
}
|
|
190
|
-
|
|
191
|
-
|
|
132
|
+
instance.extensions.clear();
|
|
133
|
+
instance.state = "inactive";
|
|
134
|
+
instance.activatedAt = null;
|
|
135
|
+
this.events.emit("plugin:deactivated", { id });
|
|
136
|
+
}
|
|
137
|
+
/* ── Uninstall ──────────────────────────────────────────────── */
|
|
138
|
+
async uninstall(id) {
|
|
139
|
+
const instance = this.plugins.get(id);
|
|
140
|
+
if (!instance) {
|
|
141
|
+
return;
|
|
192
142
|
}
|
|
193
|
-
|
|
194
|
-
|
|
143
|
+
for (const [otherId, other] of this.plugins) {
|
|
144
|
+
if (otherId === id) {
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (other.definition.manifest.dependencies?.[id]) {
|
|
148
|
+
throw new Error(
|
|
149
|
+
`[PluginManager] Cannot uninstall "${id}": plugin "${otherId}" depends on it.`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
195
152
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const q = query.toLowerCase();
|
|
199
|
-
return this.allPlugins.filter((p) => {
|
|
200
|
-
const m = p.definition.manifest;
|
|
201
|
-
return (m.name.toLowerCase().includes(q) ||
|
|
202
|
-
m.description.toLowerCase().includes(q) ||
|
|
203
|
-
m.keywords?.some((k) => k.toLowerCase().includes(q)) ||
|
|
204
|
-
m.id.toLowerCase().includes(q));
|
|
205
|
-
});
|
|
153
|
+
if (instance.state === "active") {
|
|
154
|
+
await this.deactivate(id);
|
|
206
155
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return {
|
|
213
|
-
manifest,
|
|
214
|
-
events: this.events,
|
|
215
|
-
storage,
|
|
216
|
-
log: (msg) => {
|
|
217
|
-
if (typeof console !== 'undefined') {
|
|
218
|
-
console.log(`[Plugin:${pluginId}] ${msg}`);
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
warn: (msg) => {
|
|
222
|
-
if (typeof console !== 'undefined') {
|
|
223
|
-
console.warn(`[Plugin:${pluginId}] ${msg}`);
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
registerExtension: (point, entry) => {
|
|
227
|
-
// Global
|
|
228
|
-
let global = this.extensions.get(point);
|
|
229
|
-
if (!global) {
|
|
230
|
-
global = [];
|
|
231
|
-
this.extensions.set(point, global);
|
|
232
|
-
}
|
|
233
|
-
global.push(entry);
|
|
234
|
-
// Per-plugin tracking
|
|
235
|
-
let pluginExts = instance.extensions.get(point);
|
|
236
|
-
if (!pluginExts) {
|
|
237
|
-
pluginExts = [];
|
|
238
|
-
instance.extensions.set(point, pluginExts);
|
|
239
|
-
}
|
|
240
|
-
pluginExts.push(entry);
|
|
241
|
-
this.events.emit('extension:registered', { pluginId, point });
|
|
242
|
-
},
|
|
243
|
-
unregisterExtension: (point, entry) => {
|
|
244
|
-
const global = this.extensions.get(point);
|
|
245
|
-
if (global) {
|
|
246
|
-
const idx = global.indexOf(entry);
|
|
247
|
-
if (idx >= 0) {
|
|
248
|
-
global.splice(idx, 1);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
const pluginExts = instance.extensions.get(point);
|
|
252
|
-
if (pluginExts) {
|
|
253
|
-
const idx = pluginExts.indexOf(entry);
|
|
254
|
-
if (idx >= 0) {
|
|
255
|
-
pluginExts.splice(idx, 1);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
};
|
|
156
|
+
const ctx = this.createContext(instance);
|
|
157
|
+
try {
|
|
158
|
+
await instance.definition.uninstall?.(ctx);
|
|
159
|
+
} catch (e) {
|
|
160
|
+
console.warn(`Plugin '${id}' uninstall error:`, e);
|
|
260
161
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
162
|
+
this.plugins.delete(id);
|
|
163
|
+
this.events.emit("plugin:uninstalled", { id });
|
|
164
|
+
}
|
|
165
|
+
/* ── Queries ────────────────────────────────────────────────── */
|
|
166
|
+
getPlugin(id) {
|
|
167
|
+
return this.plugins.get(id);
|
|
168
|
+
}
|
|
169
|
+
get allPlugins() {
|
|
170
|
+
return Array.from(this.plugins.values());
|
|
171
|
+
}
|
|
172
|
+
get activePlugins() {
|
|
173
|
+
return this.allPlugins.filter((p) => p.state === "active");
|
|
174
|
+
}
|
|
175
|
+
getExtensions(point) {
|
|
176
|
+
return this.extensions.get(point) ?? [];
|
|
177
|
+
}
|
|
178
|
+
/** Search plugins by keyword. */
|
|
179
|
+
search(query) {
|
|
180
|
+
const q = query.toLowerCase();
|
|
181
|
+
return this.allPlugins.filter((p) => {
|
|
182
|
+
const m = p.definition.manifest;
|
|
183
|
+
return m.name.toLowerCase().includes(q) || m.description.toLowerCase().includes(q) || m.keywords?.some((k) => k.toLowerCase().includes(q)) || m.id.toLowerCase().includes(q);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/* ── Context factory ────────────────────────────────────────── */
|
|
187
|
+
createContext(instance) {
|
|
188
|
+
const manifest = instance.definition.manifest;
|
|
189
|
+
const pluginId = manifest.id;
|
|
190
|
+
const storage = new InMemoryPluginStorage(pluginId);
|
|
191
|
+
return {
|
|
192
|
+
manifest,
|
|
193
|
+
events: this.events,
|
|
194
|
+
storage,
|
|
195
|
+
log: (msg) => {
|
|
196
|
+
if (typeof console !== "undefined") {
|
|
197
|
+
console.log(`[Plugin:${pluginId}] ${msg}`);
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
warn: (msg) => {
|
|
201
|
+
if (typeof console !== "undefined") {
|
|
202
|
+
console.warn(`[Plugin:${pluginId}] ${msg}`);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
registerExtension: (point, entry) => {
|
|
206
|
+
let global = this.extensions.get(point);
|
|
207
|
+
if (!global) {
|
|
208
|
+
global = [];
|
|
209
|
+
this.extensions.set(point, global);
|
|
210
|
+
}
|
|
211
|
+
global.push(entry);
|
|
212
|
+
let pluginExts = instance.extensions.get(point);
|
|
213
|
+
if (!pluginExts) {
|
|
214
|
+
pluginExts = [];
|
|
215
|
+
instance.extensions.set(point, pluginExts);
|
|
216
|
+
}
|
|
217
|
+
pluginExts.push(entry);
|
|
218
|
+
this.events.emit("extension:registered", { pluginId, point });
|
|
219
|
+
},
|
|
220
|
+
unregisterExtension: (point, entry) => {
|
|
221
|
+
const global = this.extensions.get(point);
|
|
222
|
+
if (global) {
|
|
223
|
+
const idx = global.indexOf(entry);
|
|
224
|
+
if (idx >= 0) {
|
|
225
|
+
global.splice(idx, 1);
|
|
226
|
+
}
|
|
272
227
|
}
|
|
273
|
-
|
|
228
|
+
const pluginExts = instance.extensions.get(point);
|
|
229
|
+
if (pluginExts) {
|
|
230
|
+
const idx = pluginExts.indexOf(entry);
|
|
231
|
+
if (idx >= 0) {
|
|
232
|
+
pluginExts.splice(idx, 1);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/* ── Lifecycle ──────────────────────────────────────────────── */
|
|
239
|
+
/** Deactivate and remove all plugins. */
|
|
240
|
+
async dispose() {
|
|
241
|
+
const ids = Array.from(this.plugins.keys());
|
|
242
|
+
for (const id of ids) {
|
|
243
|
+
try {
|
|
244
|
+
await this.uninstall(id);
|
|
245
|
+
} catch (e) {
|
|
246
|
+
console.warn(`Plugin '${id}' dispose error:`, e);
|
|
247
|
+
}
|
|
274
248
|
}
|
|
249
|
+
this.extensions.clear();
|
|
250
|
+
}
|
|
275
251
|
}
|
|
276
252
|
const PLUGIN_TEMPLATES = [
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
const plugin: PluginDefinition = {
|
|
284
|
-
manifest: {
|
|
285
|
-
id: 'com.example.health-component',
|
|
286
|
-
name: 'Health Component',
|
|
287
|
-
version: '1.0.0',
|
|
288
|
-
description: 'Adds a Health component to the ECS.',
|
|
289
|
-
author: 'Your Name',
|
|
290
|
-
types: ['component'],
|
|
291
|
-
engineVersion: '>=0.1.0',
|
|
292
|
-
},
|
|
293
|
-
activate(ctx: PluginContext) {
|
|
294
|
-
ctx.registerExtension('component-type', {
|
|
295
|
-
type: 'Health',
|
|
296
|
-
defaults: { current: 100, max: 100, regeneration: 0 },
|
|
297
|
-
});
|
|
298
|
-
ctx.log('Health component registered');
|
|
299
|
-
},
|
|
300
|
-
deactivate(ctx: PluginContext) {
|
|
301
|
-
ctx.log('Health component unregistered');
|
|
302
|
-
},
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
export default plugin
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
const plugin: PluginDefinition = {
|
|
314
|
-
manifest: {
|
|
315
|
-
id: 'com.example.damage-system',
|
|
316
|
-
name: 'Damage System',
|
|
317
|
-
version: '1.0.0',
|
|
318
|
-
description: 'Processes damage events and updates health.',
|
|
319
|
-
author: 'Your Name',
|
|
320
|
-
types: ['system'],
|
|
321
|
-
engineVersion: '>=0.1.0',
|
|
322
|
-
},
|
|
323
|
-
activate(ctx: PluginContext) {
|
|
324
|
-
ctx.registerExtension('system-type', {
|
|
325
|
-
name: 'DamageSystem',
|
|
326
|
-
priority: 50,
|
|
327
|
-
update: (world: unknown, dt: number) => {
|
|
328
|
-
// Process damage events
|
|
329
|
-
},
|
|
330
|
-
});
|
|
331
|
-
ctx.log('DamageSystem registered');
|
|
332
|
-
},
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
export default plugin
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
const plugin: PluginDefinition = {
|
|
344
|
-
manifest: {
|
|
345
|
-
id: 'com.example.timer-nodes',
|
|
346
|
-
name: 'Timer Nodes',
|
|
347
|
-
version: '1.0.0',
|
|
348
|
-
description: 'Adds timer and delay nodes to visual scripting.',
|
|
349
|
-
author: 'Your Name',
|
|
350
|
-
types: ['node'],
|
|
351
|
-
engineVersion: '>=0.1.0',
|
|
352
|
-
},
|
|
353
|
-
activate(ctx: PluginContext) {
|
|
354
|
-
ctx.registerExtension('node-type', {
|
|
355
|
-
type: 'wait-seconds',
|
|
356
|
-
name: 'Wait Seconds',
|
|
357
|
-
category: 'flow',
|
|
358
|
-
description: 'Waits for a specified number of seconds.',
|
|
359
|
-
ports: [
|
|
360
|
-
{ id: 'flow-in', name: 'In', direction: 'input', dataType: 'flow' },
|
|
361
|
-
{ id: 'seconds', name: 'Seconds', direction: 'input', dataType: 'number', defaultValue: 1 },
|
|
362
|
-
{ id: 'flow-out', name: 'Out', direction: 'output', dataType: 'flow' },
|
|
363
|
-
],
|
|
364
|
-
execute: (inputs: Record<string, unknown>) => {
|
|
365
|
-
// Timer logic here
|
|
366
|
-
return {};
|
|
367
|
-
},
|
|
368
|
-
});
|
|
369
|
-
ctx.log('Timer nodes registered');
|
|
370
|
-
},
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
export default plugin
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
const plugin: PluginDefinition = {
|
|
382
|
-
manifest: {
|
|
383
|
-
id: 'com.example.performance-panel',
|
|
384
|
-
name: 'Performance Panel',
|
|
385
|
-
version: '1.0.0',
|
|
386
|
-
description: 'Adds a performance monitoring panel to the editor.',
|
|
387
|
-
author: 'Your Name',
|
|
388
|
-
types: ['editor-panel'],
|
|
389
|
-
engineVersion: '>=0.1.0',
|
|
390
|
-
},
|
|
391
|
-
activate(ctx: PluginContext) {
|
|
392
|
-
ctx.registerExtension('editor-panel', {
|
|
393
|
-
id: 'perf-panel',
|
|
394
|
-
title: 'Performance',
|
|
395
|
-
icon: 'bar-chart',
|
|
396
|
-
position: 'right',
|
|
397
|
-
render: () => null, // React component
|
|
398
|
-
});
|
|
399
|
-
ctx.log('Performance panel registered');
|
|
400
|
-
},
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
export default plugin
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
const plugin: PluginDefinition = {
|
|
412
|
-
manifest: {
|
|
413
|
-
id: 'com.example.infinite-runner',
|
|
414
|
-
name: 'Infinite Runner Template',
|
|
415
|
-
version: '1.0.0',
|
|
416
|
-
description: 'Adds an infinite runner game template.',
|
|
417
|
-
author: 'Your Name',
|
|
418
|
-
types: ['template'],
|
|
419
|
-
engineVersion: '>=0.1.0',
|
|
420
|
-
},
|
|
421
|
-
activate(ctx: PluginContext) {
|
|
422
|
-
ctx.registerExtension('game-template', {
|
|
423
|
-
id: 'infinite-runner',
|
|
424
|
-
name: 'Infinite Runner',
|
|
425
|
-
description: 'An auto-scrolling endless runner game.',
|
|
426
|
-
category: 'action',
|
|
427
|
-
difficulty: 'beginner',
|
|
428
|
-
setup: (engine: unknown) => {
|
|
429
|
-
// Initialize template
|
|
430
|
-
},
|
|
431
|
-
});
|
|
432
|
-
ctx.log('Infinite Runner template registered');
|
|
433
|
-
},
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
export default plugin
|
|
437
|
-
|
|
253
|
+
{
|
|
254
|
+
type: "component",
|
|
255
|
+
name: "Custom Component Plugin",
|
|
256
|
+
description: "Template for a plugin that adds a new ECS component type.",
|
|
257
|
+
code: `import type { PluginDefinition, PluginContext } from '@nice2dev/game-engine';
|
|
258
|
+
|
|
259
|
+
const plugin: PluginDefinition = {
|
|
260
|
+
manifest: {
|
|
261
|
+
id: 'com.example.health-component',
|
|
262
|
+
name: 'Health Component',
|
|
263
|
+
version: '1.0.0',
|
|
264
|
+
description: 'Adds a Health component to the ECS.',
|
|
265
|
+
author: 'Your Name',
|
|
266
|
+
types: ['component'],
|
|
267
|
+
engineVersion: '>=0.1.0',
|
|
268
|
+
},
|
|
269
|
+
activate(ctx: PluginContext) {
|
|
270
|
+
ctx.registerExtension('component-type', {
|
|
271
|
+
type: 'Health',
|
|
272
|
+
defaults: { current: 100, max: 100, regeneration: 0 },
|
|
273
|
+
});
|
|
274
|
+
ctx.log('Health component registered');
|
|
275
|
+
},
|
|
276
|
+
deactivate(ctx: PluginContext) {
|
|
277
|
+
ctx.log('Health component unregistered');
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export default plugin;`
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
type: "system",
|
|
285
|
+
name: "Custom System Plugin",
|
|
286
|
+
description: "Template for a plugin that adds a new ECS system.",
|
|
287
|
+
code: `import type { PluginDefinition, PluginContext } from '@nice2dev/game-engine';
|
|
288
|
+
|
|
289
|
+
const plugin: PluginDefinition = {
|
|
290
|
+
manifest: {
|
|
291
|
+
id: 'com.example.damage-system',
|
|
292
|
+
name: 'Damage System',
|
|
293
|
+
version: '1.0.0',
|
|
294
|
+
description: 'Processes damage events and updates health.',
|
|
295
|
+
author: 'Your Name',
|
|
296
|
+
types: ['system'],
|
|
297
|
+
engineVersion: '>=0.1.0',
|
|
298
|
+
},
|
|
299
|
+
activate(ctx: PluginContext) {
|
|
300
|
+
ctx.registerExtension('system-type', {
|
|
301
|
+
name: 'DamageSystem',
|
|
302
|
+
priority: 50,
|
|
303
|
+
update: (world: unknown, dt: number) => {
|
|
304
|
+
// Process damage events
|
|
305
|
+
},
|
|
306
|
+
});
|
|
307
|
+
ctx.log('DamageSystem registered');
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export default plugin;`
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
type: "node",
|
|
315
|
+
name: "Custom Node Plugin",
|
|
316
|
+
description: "Template for a plugin that adds visual scripting nodes.",
|
|
317
|
+
code: `import type { PluginDefinition, PluginContext } from '@nice2dev/game-engine';
|
|
318
|
+
|
|
319
|
+
const plugin: PluginDefinition = {
|
|
320
|
+
manifest: {
|
|
321
|
+
id: 'com.example.timer-nodes',
|
|
322
|
+
name: 'Timer Nodes',
|
|
323
|
+
version: '1.0.0',
|
|
324
|
+
description: 'Adds timer and delay nodes to visual scripting.',
|
|
325
|
+
author: 'Your Name',
|
|
326
|
+
types: ['node'],
|
|
327
|
+
engineVersion: '>=0.1.0',
|
|
328
|
+
},
|
|
329
|
+
activate(ctx: PluginContext) {
|
|
330
|
+
ctx.registerExtension('node-type', {
|
|
331
|
+
type: 'wait-seconds',
|
|
332
|
+
name: 'Wait Seconds',
|
|
333
|
+
category: 'flow',
|
|
334
|
+
description: 'Waits for a specified number of seconds.',
|
|
335
|
+
ports: [
|
|
336
|
+
{ id: 'flow-in', name: 'In', direction: 'input', dataType: 'flow' },
|
|
337
|
+
{ id: 'seconds', name: 'Seconds', direction: 'input', dataType: 'number', defaultValue: 1 },
|
|
338
|
+
{ id: 'flow-out', name: 'Out', direction: 'output', dataType: 'flow' },
|
|
339
|
+
],
|
|
340
|
+
execute: (inputs: Record<string, unknown>) => {
|
|
341
|
+
// Timer logic here
|
|
342
|
+
return {};
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
ctx.log('Timer nodes registered');
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
export default plugin;`
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
type: "editor-panel",
|
|
353
|
+
name: "Custom Editor Panel Plugin",
|
|
354
|
+
description: "Template for a plugin that adds a new panel to the editor.",
|
|
355
|
+
code: `import type { PluginDefinition, PluginContext } from '@nice2dev/game-engine';
|
|
356
|
+
|
|
357
|
+
const plugin: PluginDefinition = {
|
|
358
|
+
manifest: {
|
|
359
|
+
id: 'com.example.performance-panel',
|
|
360
|
+
name: 'Performance Panel',
|
|
361
|
+
version: '1.0.0',
|
|
362
|
+
description: 'Adds a performance monitoring panel to the editor.',
|
|
363
|
+
author: 'Your Name',
|
|
364
|
+
types: ['editor-panel'],
|
|
365
|
+
engineVersion: '>=0.1.0',
|
|
366
|
+
},
|
|
367
|
+
activate(ctx: PluginContext) {
|
|
368
|
+
ctx.registerExtension('editor-panel', {
|
|
369
|
+
id: 'perf-panel',
|
|
370
|
+
title: 'Performance',
|
|
371
|
+
icon: 'bar-chart',
|
|
372
|
+
position: 'right',
|
|
373
|
+
render: () => null, // React component
|
|
374
|
+
});
|
|
375
|
+
ctx.log('Performance panel registered');
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
export default plugin;`
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
type: "template",
|
|
383
|
+
name: "Game Template Plugin",
|
|
384
|
+
description: "Template for a plugin that adds a new game template.",
|
|
385
|
+
code: `import type { PluginDefinition, PluginContext } from '@nice2dev/game-engine';
|
|
386
|
+
|
|
387
|
+
const plugin: PluginDefinition = {
|
|
388
|
+
manifest: {
|
|
389
|
+
id: 'com.example.infinite-runner',
|
|
390
|
+
name: 'Infinite Runner Template',
|
|
391
|
+
version: '1.0.0',
|
|
392
|
+
description: 'Adds an infinite runner game template.',
|
|
393
|
+
author: 'Your Name',
|
|
394
|
+
types: ['template'],
|
|
395
|
+
engineVersion: '>=0.1.0',
|
|
396
|
+
},
|
|
397
|
+
activate(ctx: PluginContext) {
|
|
398
|
+
ctx.registerExtension('game-template', {
|
|
399
|
+
id: 'infinite-runner',
|
|
400
|
+
name: 'Infinite Runner',
|
|
401
|
+
description: 'An auto-scrolling endless runner game.',
|
|
402
|
+
category: 'action',
|
|
403
|
+
difficulty: 'beginner',
|
|
404
|
+
setup: (engine: unknown) => {
|
|
405
|
+
// Initialize template
|
|
406
|
+
},
|
|
407
|
+
});
|
|
408
|
+
ctx.log('Infinite Runner template registered');
|
|
409
|
+
},
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
export default plugin;`
|
|
413
|
+
}
|
|
438
414
|
];
|
|
439
|
-
/** Offline-capable marketplace API (can be backed by REST later). */
|
|
440
415
|
class PluginMarketplace {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
/** Search the marketplace. */
|
|
457
|
-
search(query, options = {}) {
|
|
458
|
-
const { type, free, page = 0, pageSize = 20 } = options;
|
|
459
|
-
const q = query.toLowerCase();
|
|
460
|
-
let results = this.catalog.filter((e) => {
|
|
461
|
-
if (type && !e.types.includes(type)) {
|
|
462
|
-
return false;
|
|
463
|
-
}
|
|
464
|
-
if (free !== undefined && e.free !== free) {
|
|
465
|
-
return false;
|
|
466
|
-
}
|
|
467
|
-
if (q.length > 0) {
|
|
468
|
-
return (e.name.toLowerCase().includes(q) ||
|
|
469
|
-
e.description.toLowerCase().includes(q) ||
|
|
470
|
-
e.keywords.some((k) => k.toLowerCase().includes(q)) ||
|
|
471
|
-
e.author.toLowerCase().includes(q));
|
|
472
|
-
}
|
|
473
|
-
return true;
|
|
474
|
-
});
|
|
475
|
-
// Sort by rating then downloads
|
|
476
|
-
results.sort((a, b) => b.rating - a.rating || b.downloads - a.downloads);
|
|
477
|
-
const total = results.length;
|
|
478
|
-
const start = page * pageSize;
|
|
479
|
-
results = results.slice(start, start + pageSize);
|
|
480
|
-
return { entries: results, total, page, pageSize };
|
|
481
|
-
}
|
|
482
|
-
/** Get a single entry by ID. */
|
|
483
|
-
getEntry(id) {
|
|
484
|
-
return this.catalog.find((e) => e.id === id);
|
|
485
|
-
}
|
|
486
|
-
/** Featured / top-rated plugins. */
|
|
487
|
-
getFeatured(count = 5) {
|
|
488
|
-
return this.catalog
|
|
489
|
-
.slice()
|
|
490
|
-
.sort((a, b) => b.rating - a.rating || b.downloads - a.downloads)
|
|
491
|
-
.slice(0, count);
|
|
416
|
+
constructor() {
|
|
417
|
+
this.catalog = [];
|
|
418
|
+
}
|
|
419
|
+
/** Register entries in the catalog (for offline/bundled). */
|
|
420
|
+
addEntries(entries) {
|
|
421
|
+
for (const entry of entries) {
|
|
422
|
+
const idx = this.catalog.findIndex((e) => e.id === entry.id);
|
|
423
|
+
if (idx >= 0) {
|
|
424
|
+
this.catalog[idx] = entry;
|
|
425
|
+
} else {
|
|
426
|
+
this.catalog.push(entry);
|
|
427
|
+
}
|
|
492
428
|
}
|
|
429
|
+
}
|
|
430
|
+
/** Search the marketplace. */
|
|
431
|
+
search(query, options = {}) {
|
|
432
|
+
const { type, free, page = 0, pageSize = 20 } = options;
|
|
433
|
+
const q = query.toLowerCase();
|
|
434
|
+
let results = this.catalog.filter((e) => {
|
|
435
|
+
if (type && !e.types.includes(type)) {
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
if (free !== void 0 && e.free !== free) {
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
if (q.length > 0) {
|
|
442
|
+
return e.name.toLowerCase().includes(q) || e.description.toLowerCase().includes(q) || e.keywords.some((k) => k.toLowerCase().includes(q)) || e.author.toLowerCase().includes(q);
|
|
443
|
+
}
|
|
444
|
+
return true;
|
|
445
|
+
});
|
|
446
|
+
results.sort((a, b) => b.rating - a.rating || b.downloads - a.downloads);
|
|
447
|
+
const total = results.length;
|
|
448
|
+
const start = page * pageSize;
|
|
449
|
+
results = results.slice(start, start + pageSize);
|
|
450
|
+
return { entries: results, total, page, pageSize };
|
|
451
|
+
}
|
|
452
|
+
/** Get a single entry by ID. */
|
|
453
|
+
getEntry(id) {
|
|
454
|
+
return this.catalog.find((e) => e.id === id);
|
|
455
|
+
}
|
|
456
|
+
/** Featured / top-rated plugins. */
|
|
457
|
+
getFeatured(count = 5) {
|
|
458
|
+
return this.catalog.slice().sort((a, b) => b.rating - a.rating || b.downloads - a.downloads).slice(0, count);
|
|
459
|
+
}
|
|
493
460
|
}
|
|
494
|
-
|
|
495
|
-
|
|
461
|
+
export {
|
|
462
|
+
PLUGIN_TEMPLATES,
|
|
463
|
+
PluginManager,
|
|
464
|
+
PluginMarketplace
|
|
465
|
+
};
|