1681-engine 0.5.8 → 0.5.10
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 +95 -0
- package/README.md +3 -0
- package/dist/1681-engine.js +526 -409
- package/dist/ambient/ColorGrade.js +0 -1
- package/dist/ambient/DayClock.js +0 -1
- package/dist/ambient/WeatherLayer.js +0 -1
- package/dist/ambient/grade.js +0 -1
- package/dist/ambient/life/Birds.js +73 -0
- package/dist/ambient/life/Butterflies.js +43 -0
- package/dist/ambient/life/ChimneySmoke.js +50 -0
- package/dist/ambient/life/Drift.js +75 -0
- package/dist/ambient/life/Fireflies.js +52 -0
- package/dist/ambient/life/lifeMotion.js +49 -0
- package/dist/ambient/weather.js +0 -1
- package/dist/anim/AnimStateMachine.js +0 -1
- package/dist/anim/Animator.js +0 -1
- package/dist/anim/animStateCompile.js +0 -1
- package/dist/anim/animStateSystem.js +0 -1
- package/dist/anim/animationSystem.js +0 -1
- package/dist/anim/asepriteSlices.js +0 -1
- package/dist/anim/asepriteTags.js +0 -1
- package/dist/anim/parseAseprite.js +0 -1
- package/dist/assets/AssetLoader.js +177 -34
- package/dist/assets/Prepainter.js +61 -0
- package/dist/assets/loadAseprite.js +0 -1
- package/dist/assets/takeCleanerWorker-DTcI_Jqr.js +0 -1
- package/dist/assets/textureAtlas.js +58 -0
- package/dist/assets/workerPainter.js +39 -0
- package/dist/audio/Footsteps.js +0 -1
- package/dist/audio/MusicPlayer.js +0 -1
- package/dist/audio/SoundEngine.js +13 -7
- package/dist/audio/cleanTake.js +0 -1
- package/dist/audio/music/ElementVoice.js +0 -1
- package/dist/audio/music/GraphVoice.js +0 -1
- package/dist/audio/music/MusicChannel.js +0 -1
- package/dist/audio/music/musicVoice.js +0 -1
- package/dist/audio/sampleBank.js +0 -1
- package/dist/audio/soundTable.js +0 -1
- package/dist/audio/synth.js +0 -1
- package/dist/cjs/electron/electronLike.d.ts +55 -0
- package/dist/cjs/electron/electronLike.js +7 -0
- package/dist/cjs/electron/index.d.ts +14 -0
- package/dist/cjs/electron/index.js +20 -0
- package/dist/cjs/electron/lockdown.d.ts +33 -0
- package/dist/cjs/electron/lockdown.js +69 -0
- package/dist/cjs/electron/lockdownRules.d.ts +28 -0
- package/dist/cjs/electron/lockdownRules.js +61 -0
- package/dist/cjs/electron/sessionStore.d.ts +40 -0
- package/dist/cjs/electron/sessionStore.js +77 -0
- package/dist/cjs/electron/shellId.d.ts +22 -0
- package/dist/cjs/electron/shellId.js +31 -0
- package/dist/cjs/electron/webFiles.d.ts +13 -0
- package/dist/cjs/electron/webFiles.js +52 -0
- package/dist/cjs/electron/webPatcher.d.ts +80 -0
- package/dist/cjs/electron/webPatcher.js +216 -0
- package/dist/cjs/electron/webPointers.d.ts +19 -0
- package/dist/cjs/electron/webPointers.js +35 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/updates/index.d.ts +8 -0
- package/dist/cjs/updates/index.js +21 -0
- package/dist/cjs/updates/manifest.d.ts +73 -0
- package/dist/cjs/updates/manifest.js +67 -0
- package/dist/cjs/updates/pickUpdate.d.ts +42 -0
- package/dist/cjs/updates/pickUpdate.js +52 -0
- package/dist/cjs/updates/webPlan.d.ts +20 -0
- package/dist/cjs/updates/webPlan.js +34 -0
- package/dist/core/BitmapLabel.js +0 -1
- package/dist/core/Camera.js +1 -2
- package/dist/core/Clock.js +31 -21
- package/dist/core/Graphics.js +0 -1
- package/dist/core/Group.js +0 -1
- package/dist/core/Image.js +0 -1
- package/dist/core/ObjectFactory.js +0 -1
- package/dist/core/Pointer.js +46 -24
- package/dist/core/Rectangle.js +0 -1
- package/dist/core/Stage.js +5 -6
- package/dist/core/Text.js +0 -1
- package/dist/core/TextureRegistry.js +54 -24
- package/dist/core/Timeline.js +0 -1
- package/dist/core/TimelineBuilder.js +0 -1
- package/dist/core/TimelineChild.js +0 -1
- package/dist/core/Tweener.js +0 -1
- package/dist/core/atlas.js +0 -1
- package/dist/core/atlasPlan.js +0 -1
- package/dist/core/blendLayer.js +11 -0
- package/dist/core/eases.js +0 -1
- package/dist/core/gameObject.js +22 -20
- package/dist/core/pixelZoom.js +43 -0
- package/dist/core/pixiPatches.js +0 -1
- package/dist/core/runDue.js +28 -0
- package/dist/core/silhouette.js +49 -0
- package/dist/core/timelinePlace.js +0 -1
- package/dist/core/tweenProps.js +0 -1
- package/dist/debug/DebugOverlay.js +0 -1
- package/dist/debug/DrawCallCounter.js +15 -12
- package/dist/debug/ErrorLog.js +0 -1
- package/dist/debug/FrameStats.js +0 -1
- package/dist/debug/inspectWorld.js +0 -1
- package/dist/diagnostics/ErrorDeduper.js +0 -1
- package/dist/diagnostics/FrameSampler.js +0 -1
- package/dist/diagnostics/bootWatch.js +0 -1
- package/dist/diagnostics/captureErrors.js +0 -1
- package/dist/diagnostics/contextLoss.js +0 -1
- package/dist/diagnostics/frameStats.js +0 -1
- package/dist/diagnostics/gpuInfo.js +0 -1
- package/dist/diagnostics/renderGuard.js +0 -1
- package/dist/ecs/SparseSet.js +0 -1
- package/dist/ecs/World.js +0 -1
- package/dist/ecs/fields.js +0 -1
- package/dist/electron/lockdown.js +31 -0
- package/dist/electron/lockdownRules.js +42 -0
- package/dist/electron/sessionStore.js +48 -0
- package/dist/electron/shellId.js +18 -0
- package/dist/electron/webFiles.js +36 -0
- package/dist/electron/webPatcher.js +147 -0
- package/dist/electron/webPointers.js +25 -0
- package/dist/electron.js +19 -0
- package/dist/engine/Engine.js +42 -18
- package/dist/engine/FixedLoop.js +0 -1
- package/dist/engine/HiddenPause.js +27 -0
- package/dist/engine/Scene.js +0 -1
- package/dist/engine/SceneManager.js +0 -1
- package/dist/events/EventBus.js +0 -1
- package/dist/fx/Afterimages.js +82 -0
- package/dist/fx/FloatingText.js +0 -1
- package/dist/fx/hitStop.js +0 -1
- package/dist/fx/viewCull.js +0 -1
- package/dist/i18n/Translator.js +0 -1
- package/dist/i18n/extractStrings.js +0 -1
- package/dist/i18n/formatMessage.js +0 -1
- package/dist/input/Actions.js +29 -21
- package/dist/input/AimGesture.js +0 -1
- package/dist/input/Keyboard.js +0 -1
- package/dist/input/Keymap.js +0 -1
- package/dist/input/TargetLock.js +0 -1
- package/dist/input/aimAxis.js +0 -1
- package/dist/input/haptics.js +50 -0
- package/dist/input/keyChord.js +0 -1
- package/dist/input/longPress.js +0 -1
- package/dist/input/rumble.js +42 -0
- package/dist/input/stickAxis.js +0 -1
- package/dist/input/touchDetect.js +0 -1
- package/dist/light/LightLayer.js +0 -1
- package/dist/nav/MinHeap.js +0 -1
- package/dist/nav/findPath.js +0 -1
- package/dist/nav/navGrid.js +0 -1
- package/dist/nav/nearestOpen.js +0 -1
- package/dist/nav/straightenPath.js +0 -1
- package/dist/net/ApiClient.js +96 -0
- package/dist/net/Connection.js +39 -16
- package/dist/net/InterpolationBuffer.js +0 -1
- package/dist/net/PredictedMover.js +0 -1
- package/dist/net/Room.js +0 -1
- package/dist/net/RoomHost.js +0 -1
- package/dist/net/cadence.js +0 -1
- package/dist/net/constants.js +0 -1
- package/dist/net/lobby/LobbyClient.js +0 -1
- package/dist/net/lobby/LobbyHost.js +0 -1
- package/dist/net/lobby/LobbyRooms.js +0 -1
- package/dist/net/lobby/Matchmaker.js +0 -1
- package/dist/net/movement.js +40 -39
- package/dist/net/protocol.js +0 -1
- package/dist/net/reconnect.js +10 -0
- package/dist/net/serverClock.js +0 -1
- package/dist/net/snapshotCodec.js +0 -1
- package/dist/parallax/Parallax.js +0 -1
- package/dist/parallax/ParallaxLayer.js +0 -1
- package/dist/parallax/parallaxMath.js +0 -1
- package/dist/particles/Emitter.js +0 -1
- package/dist/particles/ParticleBudget.js +0 -1
- package/dist/particles/ParticleSim.js +0 -1
- package/dist/particles/particleCurves.js +0 -1
- package/dist/particles/particleSampling.js +0 -1
- package/dist/physics/Body.js +0 -1
- package/dist/physics/BroadPhase.js +0 -1
- package/dist/physics/Contact.js +0 -1
- package/dist/physics/ContactSolver.js +0 -1
- package/dist/physics/PhysicsWorld.js +0 -1
- package/dist/physics/SpatialHash.js +0 -1
- package/dist/physics/collide.js +0 -1
- package/dist/physics/collidePolygon.js +0 -1
- package/dist/physics/contactReport.js +0 -1
- package/dist/physics/drawColliders.js +0 -1
- package/dist/physics/physicsSystem.js +0 -1
- package/dist/physics/polygon.js +0 -1
- package/dist/physics/raycast.js +0 -1
- package/dist/physics/syncToBody.js +0 -1
- package/dist/physics/tileBodies.js +0 -1
- package/dist/physics/types.js +0 -1
- package/dist/pixel/Darkness.js +50 -47
- package/dist/pixel/DitherVignette.js +0 -1
- package/dist/pixel/Evaporation.js +0 -1
- package/dist/pixel/NightShade.js +0 -1
- package/dist/pixel/PixelLayer.js +0 -1
- package/dist/pixel/PixelMarks.js +99 -0
- package/dist/pixel/SwayProp.js +0 -1
- package/dist/pixel/aimPixels.js +67 -0
- package/dist/pixel/lifeArt.js +83 -0
- package/dist/pixel/lights.js +0 -1
- package/dist/pixel/nineSlice.js +0 -1
- package/dist/pixel/paintLayer.js +0 -1
- package/dist/pixel/palette.js +0 -1
- package/dist/pixel/pixel.js +0 -1
- package/dist/pixel/pixelPaint.js +27 -24
- package/dist/pixel/pixelParticles.js +35 -0
- package/dist/pixel/pixelTone.js +0 -1
- package/dist/pixel/propKit.js +0 -1
- package/dist/pixel/ramp.js +0 -1
- package/dist/pixel/selout.js +0 -1
- package/dist/pixel/spritePixels.js +0 -1
- package/dist/pixel/swayRig.js +0 -1
- package/dist/pixel/vignetteMask.js +0 -1
- package/dist/pixel/weatherArt.js +0 -1
- package/dist/pixel.js +82 -71
- package/dist/platform/appResume.js +18 -0
- package/dist/platform/fullscreen.js +52 -0
- package/dist/platform/orientation.js +26 -0
- package/dist/platform/pointerLock.js +37 -0
- package/dist/platform/reducedMotion.js +23 -0
- package/dist/platform/timeoutSignal.js +14 -0
- package/dist/platform/touch.js +0 -1
- package/dist/postfx/BloomFilter.js +0 -1
- package/dist/postfx/ChromaticAberrationFilter.js +0 -1
- package/dist/postfx/ColorAdjustFilter.js +0 -1
- package/dist/postfx/CrtFilter.js +0 -1
- package/dist/postfx/PixelateFilter.js +0 -1
- package/dist/postfx/PostFx.js +0 -1
- package/dist/postfx/ShockwaveFilter.js +0 -1
- package/dist/postfx/VignetteFilter.js +0 -1
- package/dist/postfx/fxAnimator.js +0 -1
- package/dist/postfx/fxShader.js +0 -1
- package/dist/postfx.js +0 -1
- package/dist/react/ChoiceDialog.js +0 -1
- package/dist/react/ConfirmButton.js +24 -0
- package/dist/react/ConfirmDialog.js +0 -1
- package/dist/react/Glyph.js +0 -1
- package/dist/react/Modal.js +0 -1
- package/dist/react/Panel.js +0 -1
- package/dist/react/PixelImage.js +0 -1
- package/dist/react/Select.js +0 -1
- package/dist/react/Slider.js +0 -1
- package/dist/react/SplitPane.js +0 -1
- package/dist/react/TabStrip.js +0 -1
- package/dist/react/TitleTips.js +0 -1
- package/dist/react/Tooltip.js +0 -1
- package/dist/react/UiProvider.js +0 -1
- package/dist/react/baseCss.js +1 -1
- package/dist/react/choiceStore.js +0 -1
- package/dist/react/classNames.js +0 -1
- package/dist/react/confirmStore.js +0 -1
- package/dist/react/labels.js +7 -7
- package/dist/react/placement.js +0 -1
- package/dist/react/useFillSheet.js +0 -1
- package/dist/react/useFitToViewport.js +0 -1
- package/dist/react/useJsonSelector.js +13 -0
- package/dist/react/usePicked.js +0 -1
- package/dist/react/useStore.js +0 -1
- package/dist/react/useViewport.js +0 -1
- package/dist/react.js +73 -69
- package/dist/rig/PosePlayer.js +0 -1
- package/dist/rig/RigView.js +0 -1
- package/dist/rig/Skeleton.js +0 -1
- package/dist/rig/humanoid.js +0 -1
- package/dist/rig/humanoid.json.js +0 -1
- package/dist/rig/humanoidPoses.js +0 -1
- package/dist/rig/poseMath.js +0 -1
- package/dist/rig/poses.json.js +0 -1
- package/dist/save/Autosaver.js +0 -1
- package/dist/save/MemoryBackend.js +0 -1
- package/dist/save/SaveStore.js +0 -1
- package/dist/save/WebStorageBackend.js +0 -1
- package/dist/save/checksum.js +0 -1
- package/dist/save/migrateSave.js +0 -1
- package/dist/settings.js +0 -1
- package/dist/tilemap/TilemapView.js +57 -33
- package/dist/tilemap/autotile.js +103 -0
- package/dist/tilemap/collision.js +29 -19
- package/dist/tilemap/ldtk.js +21 -0
- package/dist/tilemap/ldtkParse.js +191 -0
- package/dist/tilemap/tiled.js +0 -1
- package/dist/transitions/CrossfadeTransition.js +0 -1
- package/dist/transitions/DitherWipeTransition.js +0 -1
- package/dist/transitions/FadeTransition.js +0 -1
- package/dist/transitions/Letterbox.js +0 -1
- package/dist/transitions/ditherMask.js +0 -1
- package/dist/transitions/transitionTo.js +0 -1
- package/dist/transitions/tweenDone.js +0 -1
- package/dist/types/ambient/life/Birds.d.ts +50 -0
- package/dist/types/ambient/life/Birds.d.ts.map +1 -0
- package/dist/types/ambient/life/Butterflies.d.ts +32 -0
- package/dist/types/ambient/life/Butterflies.d.ts.map +1 -0
- package/dist/types/ambient/life/ChimneySmoke.d.ts +37 -0
- package/dist/types/ambient/life/ChimneySmoke.d.ts.map +1 -0
- package/dist/types/ambient/life/Drift.d.ts +58 -0
- package/dist/types/ambient/life/Drift.d.ts.map +1 -0
- package/dist/types/ambient/life/Fireflies.d.ts +43 -0
- package/dist/types/ambient/life/Fireflies.d.ts.map +1 -0
- package/dist/types/ambient/life/lifeMotion.d.ts +63 -0
- package/dist/types/ambient/life/lifeMotion.d.ts.map +1 -0
- package/dist/types/assets/AssetLoader.d.ts +83 -8
- package/dist/types/assets/AssetLoader.d.ts.map +1 -1
- package/dist/types/assets/Prepainter.d.ts +64 -0
- package/dist/types/assets/Prepainter.d.ts.map +1 -0
- package/dist/types/assets/textureAtlas.d.ts +35 -0
- package/dist/types/assets/textureAtlas.d.ts.map +1 -0
- package/dist/types/assets/workerPainter.d.ts +21 -0
- package/dist/types/assets/workerPainter.d.ts.map +1 -0
- package/dist/types/audio/SoundEngine.d.ts +5 -0
- package/dist/types/audio/SoundEngine.d.ts.map +1 -1
- package/dist/types/core/Camera.d.ts +1 -1
- package/dist/types/core/Camera.d.ts.map +1 -1
- package/dist/types/core/Clock.d.ts +14 -2
- package/dist/types/core/Clock.d.ts.map +1 -1
- package/dist/types/core/Pointer.d.ts +18 -0
- package/dist/types/core/Pointer.d.ts.map +1 -1
- package/dist/types/core/Stage.d.ts.map +1 -1
- package/dist/types/core/TextureRegistry.d.ts +39 -0
- package/dist/types/core/TextureRegistry.d.ts.map +1 -1
- package/dist/types/core/blendLayer.d.ts +23 -0
- package/dist/types/core/blendLayer.d.ts.map +1 -0
- package/dist/types/core/gameObject.d.ts.map +1 -1
- package/dist/types/core/pixelZoom.d.ts +45 -0
- package/dist/types/core/pixelZoom.d.ts.map +1 -0
- package/dist/types/core/runDue.d.ts +15 -0
- package/dist/types/core/runDue.d.ts.map +1 -0
- package/dist/types/core/silhouette.d.ts +16 -0
- package/dist/types/core/silhouette.d.ts.map +1 -0
- package/dist/types/debug/DrawCallCounter.d.ts.map +1 -1
- package/dist/types/electron/electronLike.d.ts +56 -0
- package/dist/types/electron/electronLike.d.ts.map +1 -0
- package/dist/types/electron/index.d.ts +15 -0
- package/dist/types/electron/index.d.ts.map +1 -0
- package/dist/types/electron/lockdown.d.ts +34 -0
- package/dist/types/electron/lockdown.d.ts.map +1 -0
- package/dist/types/electron/lockdownRules.d.ts +29 -0
- package/dist/types/electron/lockdownRules.d.ts.map +1 -0
- package/dist/types/electron/sessionStore.d.ts +41 -0
- package/dist/types/electron/sessionStore.d.ts.map +1 -0
- package/dist/types/electron/shellId.d.ts +23 -0
- package/dist/types/electron/shellId.d.ts.map +1 -0
- package/dist/types/electron/webFiles.d.ts +14 -0
- package/dist/types/electron/webFiles.d.ts.map +1 -0
- package/dist/types/electron/webPatcher.d.ts +81 -0
- package/dist/types/electron/webPatcher.d.ts.map +1 -0
- package/dist/types/electron/webPointers.d.ts +20 -0
- package/dist/types/electron/webPointers.d.ts.map +1 -0
- package/dist/types/engine/Engine.d.ts +16 -0
- package/dist/types/engine/Engine.d.ts.map +1 -1
- package/dist/types/engine/HiddenPause.d.ts +22 -0
- package/dist/types/engine/HiddenPause.d.ts.map +1 -0
- package/dist/types/fx/Afterimages.d.ts +62 -0
- package/dist/types/fx/Afterimages.d.ts.map +1 -0
- package/dist/types/index.d.ts +32 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/input/Actions.d.ts +7 -1
- package/dist/types/input/Actions.d.ts.map +1 -1
- package/dist/types/input/haptics.d.ts +42 -0
- package/dist/types/input/haptics.d.ts.map +1 -0
- package/dist/types/input/rumble.d.ts +41 -0
- package/dist/types/input/rumble.d.ts.map +1 -0
- package/dist/types/net/ApiClient.d.ts +74 -0
- package/dist/types/net/ApiClient.d.ts.map +1 -0
- package/dist/types/net/Connection.d.ts +22 -0
- package/dist/types/net/Connection.d.ts.map +1 -1
- package/dist/types/net/constants.d.ts +13 -4
- package/dist/types/net/constants.d.ts.map +1 -1
- package/dist/types/net/movement.d.ts.map +1 -1
- package/dist/types/net/reconnect.d.ts +14 -0
- package/dist/types/net/reconnect.d.ts.map +1 -0
- package/dist/types/pixel/Darkness.d.ts +17 -5
- package/dist/types/pixel/Darkness.d.ts.map +1 -1
- package/dist/types/pixel/PixelMarks.d.ts +68 -0
- package/dist/types/pixel/PixelMarks.d.ts.map +1 -0
- package/dist/types/pixel/aimPixels.d.ts +23 -0
- package/dist/types/pixel/aimPixels.d.ts.map +1 -0
- package/dist/types/pixel/index.d.ts +4 -1
- package/dist/types/pixel/index.d.ts.map +1 -1
- package/dist/types/pixel/lifeArt.d.ts +63 -0
- package/dist/types/pixel/lifeArt.d.ts.map +1 -0
- package/dist/types/pixel/pixelPaint.d.ts +1 -0
- package/dist/types/pixel/pixelPaint.d.ts.map +1 -1
- package/dist/types/pixel/pixelParticles.d.ts +21 -0
- package/dist/types/pixel/pixelParticles.d.ts.map +1 -0
- package/dist/types/platform/appResume.d.ts +25 -0
- package/dist/types/platform/appResume.d.ts.map +1 -0
- package/dist/types/platform/fullscreen.d.ts +37 -0
- package/dist/types/platform/fullscreen.d.ts.map +1 -0
- package/dist/types/platform/orientation.d.ts +19 -0
- package/dist/types/platform/orientation.d.ts.map +1 -0
- package/dist/types/platform/pointerLock.d.ts +26 -0
- package/dist/types/platform/pointerLock.d.ts.map +1 -0
- package/dist/types/platform/reducedMotion.d.ts +20 -0
- package/dist/types/platform/reducedMotion.d.ts.map +1 -0
- package/dist/types/platform/timeoutSignal.d.ts +6 -0
- package/dist/types/platform/timeoutSignal.d.ts.map +1 -0
- package/dist/types/react/ConfirmButton.d.ts +26 -0
- package/dist/types/react/ConfirmButton.d.ts.map +1 -0
- package/dist/types/react/baseCss.d.ts +1 -1
- package/dist/types/react/baseCss.d.ts.map +1 -1
- package/dist/types/react/index.d.ts +2 -0
- package/dist/types/react/index.d.ts.map +1 -1
- package/dist/types/react/labels.d.ts +2 -0
- package/dist/types/react/labels.d.ts.map +1 -1
- package/dist/types/react/useJsonSelector.d.ts +13 -0
- package/dist/types/react/useJsonSelector.d.ts.map +1 -0
- package/dist/types/tilemap/TilemapView.d.ts +17 -0
- package/dist/types/tilemap/TilemapView.d.ts.map +1 -1
- package/dist/types/tilemap/autotile.d.ts +95 -0
- package/dist/types/tilemap/autotile.d.ts.map +1 -0
- package/dist/types/tilemap/collision.d.ts +8 -0
- package/dist/types/tilemap/collision.d.ts.map +1 -1
- package/dist/types/tilemap/ldtk.d.ts +97 -0
- package/dist/types/tilemap/ldtk.d.ts.map +1 -0
- package/dist/types/tilemap/ldtkParse.d.ts +26 -0
- package/dist/types/tilemap/ldtkParse.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +4 -0
- package/dist/types/ui/index.d.ts.map +1 -1
- package/dist/types/ui/rich/RichText.d.ts +48 -0
- package/dist/types/ui/rich/RichText.d.ts.map +1 -0
- package/dist/types/ui/rich/richFonts.d.ts +70 -0
- package/dist/types/ui/rich/richFonts.d.ts.map +1 -0
- package/dist/types/ui/rich/richLayout.d.ts +76 -0
- package/dist/types/ui/rich/richLayout.d.ts.map +1 -0
- package/dist/types/ui/rich/richMarkup.d.ts +48 -0
- package/dist/types/ui/rich/richMarkup.d.ts.map +1 -0
- package/dist/types/updates/index.d.ts +9 -0
- package/dist/types/updates/index.d.ts.map +1 -0
- package/dist/types/updates/manifest.d.ts +74 -0
- package/dist/types/updates/manifest.d.ts.map +1 -0
- package/dist/types/updates/pickUpdate.d.ts +43 -0
- package/dist/types/updates/pickUpdate.d.ts.map +1 -0
- package/dist/types/updates/webPlan.d.ts +21 -0
- package/dist/types/updates/webPlan.d.ts.map +1 -0
- package/dist/ui/Bar.js +0 -1
- package/dist/ui/Button.js +0 -1
- package/dist/ui/Dialog.js +0 -1
- package/dist/ui/FocusManager.js +0 -1
- package/dist/ui/Label.js +0 -1
- package/dist/ui/List.js +0 -1
- package/dist/ui/Panel.js +0 -1
- package/dist/ui/ScrollView.js +0 -1
- package/dist/ui/Slider.js +0 -1
- package/dist/ui/Stack.js +0 -1
- package/dist/ui/Toggle.js +0 -1
- package/dist/ui/UiHost.js +0 -1
- package/dist/ui/UiPointerGate.js +0 -1
- package/dist/ui/UiRoot.js +0 -1
- package/dist/ui/Widget.js +0 -1
- package/dist/ui/dom/DomOverlay.js +0 -1
- package/dist/ui/dom/DomWorldAnchors.js +0 -1
- package/dist/ui/dom/InputShield.js +0 -1
- package/dist/ui/dom/createStore.js +0 -1
- package/dist/ui/dom/shieldDecision.js +0 -1
- package/dist/ui/dom/worldToScreen.js +0 -1
- package/dist/ui/layout/anchor.js +0 -1
- package/dist/ui/layout/barDrain.js +0 -1
- package/dist/ui/layout/fitToViewport.js +0 -1
- package/dist/ui/layout/focusNav.js +0 -1
- package/dist/ui/layout/geometry.js +0 -1
- package/dist/ui/layout/listWidth.js +0 -1
- package/dist/ui/layout/placeTooltip.js +0 -1
- package/dist/ui/layout/scroll.js +0 -1
- package/dist/ui/layout/slider.js +0 -1
- package/dist/ui/layout/stack.js +0 -1
- package/dist/ui/layout/wrapRow.js +0 -1
- package/dist/ui/rich/RichText.js +87 -0
- package/dist/ui/rich/richFonts.js +105 -0
- package/dist/ui/rich/richLayout.js +132 -0
- package/dist/ui/rich/richMarkup.js +67 -0
- package/dist/ui.js +75 -65
- package/dist/updates/manifest.js +35 -0
- package/dist/updates/pickUpdate.js +27 -0
- package/dist/updates/webPlan.js +14 -0
- package/dist/updates.js +15 -0
- package/package.json +31 -6
- package/dist/1681-engine.js.map +0 -1
- package/dist/ambient/ColorGrade.js.map +0 -1
- package/dist/ambient/DayClock.js.map +0 -1
- package/dist/ambient/WeatherLayer.js.map +0 -1
- package/dist/ambient/grade.js.map +0 -1
- package/dist/ambient/weather.js.map +0 -1
- package/dist/anim/AnimStateMachine.js.map +0 -1
- package/dist/anim/Animator.js.map +0 -1
- package/dist/anim/animStateCompile.js.map +0 -1
- package/dist/anim/animStateSystem.js.map +0 -1
- package/dist/anim/animationSystem.js.map +0 -1
- package/dist/anim/asepriteSlices.js.map +0 -1
- package/dist/anim/asepriteTags.js.map +0 -1
- package/dist/anim/parseAseprite.js.map +0 -1
- package/dist/assets/AssetLoader.js.map +0 -1
- package/dist/assets/loadAseprite.js.map +0 -1
- package/dist/assets/takeCleanerWorker-DTcI_Jqr.js.map +0 -1
- package/dist/audio/Footsteps.js.map +0 -1
- package/dist/audio/MusicPlayer.js.map +0 -1
- package/dist/audio/SoundEngine.js.map +0 -1
- package/dist/audio/cleanTake.js.map +0 -1
- package/dist/audio/music/ElementVoice.js.map +0 -1
- package/dist/audio/music/GraphVoice.js.map +0 -1
- package/dist/audio/music/MusicChannel.js.map +0 -1
- package/dist/audio/music/musicVoice.js.map +0 -1
- package/dist/audio/sampleBank.js.map +0 -1
- package/dist/audio/soundTable.js.map +0 -1
- package/dist/audio/synth.js.map +0 -1
- package/dist/core/BitmapLabel.js.map +0 -1
- package/dist/core/Camera.js.map +0 -1
- package/dist/core/Clock.js.map +0 -1
- package/dist/core/Graphics.js.map +0 -1
- package/dist/core/Group.js.map +0 -1
- package/dist/core/Image.js.map +0 -1
- package/dist/core/ObjectFactory.js.map +0 -1
- package/dist/core/Pointer.js.map +0 -1
- package/dist/core/Rectangle.js.map +0 -1
- package/dist/core/Stage.js.map +0 -1
- package/dist/core/Text.js.map +0 -1
- package/dist/core/TextureRegistry.js.map +0 -1
- package/dist/core/Timeline.js.map +0 -1
- package/dist/core/TimelineBuilder.js.map +0 -1
- package/dist/core/TimelineChild.js.map +0 -1
- package/dist/core/Tweener.js.map +0 -1
- package/dist/core/atlas.js.map +0 -1
- package/dist/core/atlasPlan.js.map +0 -1
- package/dist/core/eases.js.map +0 -1
- package/dist/core/gameObject.js.map +0 -1
- package/dist/core/pixiPatches.js.map +0 -1
- package/dist/core/timelinePlace.js.map +0 -1
- package/dist/core/tweenProps.js.map +0 -1
- package/dist/debug/DebugOverlay.js.map +0 -1
- package/dist/debug/DrawCallCounter.js.map +0 -1
- package/dist/debug/ErrorLog.js.map +0 -1
- package/dist/debug/FrameStats.js.map +0 -1
- package/dist/debug/inspectWorld.js.map +0 -1
- package/dist/diagnostics/ErrorDeduper.js.map +0 -1
- package/dist/diagnostics/FrameSampler.js.map +0 -1
- package/dist/diagnostics/bootWatch.js.map +0 -1
- package/dist/diagnostics/captureErrors.js.map +0 -1
- package/dist/diagnostics/contextLoss.js.map +0 -1
- package/dist/diagnostics/frameStats.js.map +0 -1
- package/dist/diagnostics/gpuInfo.js.map +0 -1
- package/dist/diagnostics/renderGuard.js.map +0 -1
- package/dist/ecs/SparseSet.js.map +0 -1
- package/dist/ecs/World.js.map +0 -1
- package/dist/ecs/fields.js.map +0 -1
- package/dist/engine/Engine.js.map +0 -1
- package/dist/engine/FixedLoop.js.map +0 -1
- package/dist/engine/Scene.js.map +0 -1
- package/dist/engine/SceneManager.js.map +0 -1
- package/dist/events/EventBus.js.map +0 -1
- package/dist/fx/FloatingText.js.map +0 -1
- package/dist/fx/hitStop.js.map +0 -1
- package/dist/fx/viewCull.js.map +0 -1
- package/dist/i18n/Translator.js.map +0 -1
- package/dist/i18n/extractStrings.js.map +0 -1
- package/dist/i18n/formatMessage.js.map +0 -1
- package/dist/input/Actions.js.map +0 -1
- package/dist/input/AimGesture.js.map +0 -1
- package/dist/input/Keyboard.js.map +0 -1
- package/dist/input/Keymap.js.map +0 -1
- package/dist/input/TargetLock.js.map +0 -1
- package/dist/input/aimAxis.js.map +0 -1
- package/dist/input/keyChord.js.map +0 -1
- package/dist/input/longPress.js.map +0 -1
- package/dist/input/stickAxis.js.map +0 -1
- package/dist/input/touchDetect.js.map +0 -1
- package/dist/light/LightLayer.js.map +0 -1
- package/dist/nav/MinHeap.js.map +0 -1
- package/dist/nav/findPath.js.map +0 -1
- package/dist/nav/navGrid.js.map +0 -1
- package/dist/nav/nearestOpen.js.map +0 -1
- package/dist/nav/straightenPath.js.map +0 -1
- package/dist/net/Connection.js.map +0 -1
- package/dist/net/InterpolationBuffer.js.map +0 -1
- package/dist/net/PredictedMover.js.map +0 -1
- package/dist/net/Room.js.map +0 -1
- package/dist/net/RoomHost.js.map +0 -1
- package/dist/net/cadence.js.map +0 -1
- package/dist/net/constants.js.map +0 -1
- package/dist/net/lobby/LobbyClient.js.map +0 -1
- package/dist/net/lobby/LobbyHost.js.map +0 -1
- package/dist/net/lobby/LobbyRooms.js.map +0 -1
- package/dist/net/lobby/Matchmaker.js.map +0 -1
- package/dist/net/movement.js.map +0 -1
- package/dist/net/protocol.js.map +0 -1
- package/dist/net/serverClock.js.map +0 -1
- package/dist/net/snapshotCodec.js.map +0 -1
- package/dist/parallax/Parallax.js.map +0 -1
- package/dist/parallax/ParallaxLayer.js.map +0 -1
- package/dist/parallax/parallaxMath.js.map +0 -1
- package/dist/particles/Emitter.js.map +0 -1
- package/dist/particles/ParticleBudget.js.map +0 -1
- package/dist/particles/ParticleSim.js.map +0 -1
- package/dist/particles/particleCurves.js.map +0 -1
- package/dist/particles/particleSampling.js.map +0 -1
- package/dist/physics/Body.js.map +0 -1
- package/dist/physics/BroadPhase.js.map +0 -1
- package/dist/physics/Contact.js.map +0 -1
- package/dist/physics/ContactSolver.js.map +0 -1
- package/dist/physics/PhysicsWorld.js.map +0 -1
- package/dist/physics/SpatialHash.js.map +0 -1
- package/dist/physics/collide.js.map +0 -1
- package/dist/physics/collidePolygon.js.map +0 -1
- package/dist/physics/contactReport.js.map +0 -1
- package/dist/physics/drawColliders.js.map +0 -1
- package/dist/physics/physicsSystem.js.map +0 -1
- package/dist/physics/polygon.js.map +0 -1
- package/dist/physics/raycast.js.map +0 -1
- package/dist/physics/syncToBody.js.map +0 -1
- package/dist/physics/tileBodies.js.map +0 -1
- package/dist/physics/types.js.map +0 -1
- package/dist/pixel/Darkness.js.map +0 -1
- package/dist/pixel/DitherVignette.js.map +0 -1
- package/dist/pixel/Evaporation.js.map +0 -1
- package/dist/pixel/NightShade.js.map +0 -1
- package/dist/pixel/PixelLayer.js.map +0 -1
- package/dist/pixel/SwayProp.js.map +0 -1
- package/dist/pixel/lights.js.map +0 -1
- package/dist/pixel/nineSlice.js.map +0 -1
- package/dist/pixel/paintLayer.js.map +0 -1
- package/dist/pixel/palette.js.map +0 -1
- package/dist/pixel/pixel.js.map +0 -1
- package/dist/pixel/pixelPaint.js.map +0 -1
- package/dist/pixel/pixelTone.js.map +0 -1
- package/dist/pixel/propKit.js.map +0 -1
- package/dist/pixel/ramp.js.map +0 -1
- package/dist/pixel/selout.js.map +0 -1
- package/dist/pixel/spritePixels.js.map +0 -1
- package/dist/pixel/swayRig.js.map +0 -1
- package/dist/pixel/vignetteMask.js.map +0 -1
- package/dist/pixel/weatherArt.js.map +0 -1
- package/dist/pixel.js.map +0 -1
- package/dist/platform/touch.js.map +0 -1
- package/dist/postfx/BloomFilter.js.map +0 -1
- package/dist/postfx/ChromaticAberrationFilter.js.map +0 -1
- package/dist/postfx/ColorAdjustFilter.js.map +0 -1
- package/dist/postfx/CrtFilter.js.map +0 -1
- package/dist/postfx/PixelateFilter.js.map +0 -1
- package/dist/postfx/PostFx.js.map +0 -1
- package/dist/postfx/ShockwaveFilter.js.map +0 -1
- package/dist/postfx/VignetteFilter.js.map +0 -1
- package/dist/postfx/fxAnimator.js.map +0 -1
- package/dist/postfx/fxShader.js.map +0 -1
- package/dist/postfx.js.map +0 -1
- package/dist/react/ChoiceDialog.js.map +0 -1
- package/dist/react/ConfirmDialog.js.map +0 -1
- package/dist/react/Glyph.js.map +0 -1
- package/dist/react/Modal.js.map +0 -1
- package/dist/react/Panel.js.map +0 -1
- package/dist/react/PixelImage.js.map +0 -1
- package/dist/react/Select.js.map +0 -1
- package/dist/react/Slider.js.map +0 -1
- package/dist/react/SplitPane.js.map +0 -1
- package/dist/react/TabStrip.js.map +0 -1
- package/dist/react/TitleTips.js.map +0 -1
- package/dist/react/Tooltip.js.map +0 -1
- package/dist/react/UiProvider.js.map +0 -1
- package/dist/react/baseCss.js.map +0 -1
- package/dist/react/choiceStore.js.map +0 -1
- package/dist/react/classNames.js.map +0 -1
- package/dist/react/confirmStore.js.map +0 -1
- package/dist/react/labels.js.map +0 -1
- package/dist/react/placement.js.map +0 -1
- package/dist/react/useFillSheet.js.map +0 -1
- package/dist/react/useFitToViewport.js.map +0 -1
- package/dist/react/usePicked.js.map +0 -1
- package/dist/react/useStore.js.map +0 -1
- package/dist/react/useViewport.js.map +0 -1
- package/dist/react.js.map +0 -1
- package/dist/rig/PosePlayer.js.map +0 -1
- package/dist/rig/RigView.js.map +0 -1
- package/dist/rig/Skeleton.js.map +0 -1
- package/dist/rig/humanoid.js.map +0 -1
- package/dist/rig/humanoid.json.js.map +0 -1
- package/dist/rig/humanoidPoses.js.map +0 -1
- package/dist/rig/poseMath.js.map +0 -1
- package/dist/rig/poses.json.js.map +0 -1
- package/dist/save/Autosaver.js.map +0 -1
- package/dist/save/MemoryBackend.js.map +0 -1
- package/dist/save/SaveStore.js.map +0 -1
- package/dist/save/WebStorageBackend.js.map +0 -1
- package/dist/save/checksum.js.map +0 -1
- package/dist/save/migrateSave.js.map +0 -1
- package/dist/settings.js.map +0 -1
- package/dist/tilemap/TilemapView.js.map +0 -1
- package/dist/tilemap/collision.js.map +0 -1
- package/dist/tilemap/tiled.js.map +0 -1
- package/dist/transitions/CrossfadeTransition.js.map +0 -1
- package/dist/transitions/DitherWipeTransition.js.map +0 -1
- package/dist/transitions/FadeTransition.js.map +0 -1
- package/dist/transitions/Letterbox.js.map +0 -1
- package/dist/transitions/ditherMask.js.map +0 -1
- package/dist/transitions/transitionTo.js.map +0 -1
- package/dist/transitions/tweenDone.js.map +0 -1
- package/dist/ui/Bar.js.map +0 -1
- package/dist/ui/Button.js.map +0 -1
- package/dist/ui/Dialog.js.map +0 -1
- package/dist/ui/FocusManager.js.map +0 -1
- package/dist/ui/Label.js.map +0 -1
- package/dist/ui/List.js.map +0 -1
- package/dist/ui/Panel.js.map +0 -1
- package/dist/ui/ScrollView.js.map +0 -1
- package/dist/ui/Slider.js.map +0 -1
- package/dist/ui/Stack.js.map +0 -1
- package/dist/ui/Toggle.js.map +0 -1
- package/dist/ui/UiHost.js.map +0 -1
- package/dist/ui/UiPointerGate.js.map +0 -1
- package/dist/ui/UiRoot.js.map +0 -1
- package/dist/ui/Widget.js.map +0 -1
- package/dist/ui/dom/DomOverlay.js.map +0 -1
- package/dist/ui/dom/DomWorldAnchors.js.map +0 -1
- package/dist/ui/dom/InputShield.js.map +0 -1
- package/dist/ui/dom/createStore.js.map +0 -1
- package/dist/ui/dom/shieldDecision.js.map +0 -1
- package/dist/ui/dom/worldToScreen.js.map +0 -1
- package/dist/ui/layout/anchor.js.map +0 -1
- package/dist/ui/layout/barDrain.js.map +0 -1
- package/dist/ui/layout/fitToViewport.js.map +0 -1
- package/dist/ui/layout/focusNav.js.map +0 -1
- package/dist/ui/layout/geometry.js.map +0 -1
- package/dist/ui/layout/listWidth.js.map +0 -1
- package/dist/ui/layout/placeTooltip.js.map +0 -1
- package/dist/ui/layout/scroll.js.map +0 -1
- package/dist/ui/layout/slider.js.map +0 -1
- package/dist/ui/layout/stack.js.map +0 -1
- package/dist/ui/layout/wrapRow.js.map +0 -1
- package/dist/ui.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
class
|
|
1
|
+
const u = ["drawElements", "drawArrays", "drawElementsInstanced", "drawArraysInstanced", "drawRangeElements"];
|
|
2
|
+
class f {
|
|
3
3
|
constructor(r) {
|
|
4
4
|
this.renderer = r;
|
|
5
5
|
}
|
|
@@ -9,18 +9,22 @@ class i {
|
|
|
9
9
|
restore = null;
|
|
10
10
|
/** Whether this renderer can be counted (WebGL). */
|
|
11
11
|
get supported() {
|
|
12
|
-
return
|
|
12
|
+
return c(this.renderer) !== null;
|
|
13
13
|
}
|
|
14
14
|
install() {
|
|
15
|
-
const r =
|
|
15
|
+
const r = c(this.renderer);
|
|
16
16
|
if (!r || this.restore) return;
|
|
17
|
-
const n = r,
|
|
18
|
-
|
|
17
|
+
const n = r, o = [];
|
|
18
|
+
let a = !0;
|
|
19
|
+
for (const t of u) {
|
|
19
20
|
const e = n[t];
|
|
20
|
-
typeof e
|
|
21
|
+
if (typeof e != "function") continue;
|
|
22
|
+
const s = (...i) => (a && this.calls++, e.apply(r, i));
|
|
23
|
+
o.push([t, e, s]), n[t] = s;
|
|
21
24
|
}
|
|
22
25
|
this.restore = () => {
|
|
23
|
-
|
|
26
|
+
a = !1;
|
|
27
|
+
for (const [t, e, s] of o) n[t] === s && (n[t] = e);
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
30
|
uninstall() {
|
|
@@ -32,10 +36,9 @@ class i {
|
|
|
32
36
|
return this.calls = 0, r;
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
39
|
+
function c(l) {
|
|
40
|
+
return l.gl ?? null;
|
|
37
41
|
}
|
|
38
42
|
export {
|
|
39
|
-
|
|
43
|
+
f as DrawCallCounter
|
|
40
44
|
};
|
|
41
|
-
//# sourceMappingURL=DrawCallCounter.js.map
|
package/dist/debug/ErrorLog.js
CHANGED
package/dist/debug/FrameStats.js
CHANGED
package/dist/ecs/SparseSet.js
CHANGED
package/dist/ecs/World.js
CHANGED
package/dist/ecs/fields.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isAllowedNavigation as a, isDevToolsKey as d, debuggerRequested as f, isAllowedExternal as u } from "./lockdownRules.js";
|
|
2
|
+
function g(r, n) {
|
|
3
|
+
const i = n.log ?? ((...e) => console.log(...e)), t = r.webContents, s = (e, o) => {
|
|
4
|
+
u(e, n.external) ? n.shell.openExternal(e).catch((c) => i("could not open", e, c)) : i(`refused ${o}:`, e);
|
|
5
|
+
};
|
|
6
|
+
t.setWindowOpenHandler(({ url: e }) => (s(e, "external link"), { action: "deny" })), t.on("will-navigate", (e, o) => {
|
|
7
|
+
a(o, n.devServerUrl) || (e.preventDefault(), s(o, "navigation"));
|
|
8
|
+
}), t.on("will-redirect", (e, o) => {
|
|
9
|
+
a(o, n.devServerUrl) || e.preventDefault();
|
|
10
|
+
});
|
|
11
|
+
const l = n.devToolsKey === void 0 ? "F12" : n.devToolsKey;
|
|
12
|
+
t.on("before-input-event", (e, o) => {
|
|
13
|
+
if (n.packaged) {
|
|
14
|
+
d(o) && e.preventDefault();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
l && o.type === "keyDown" && o.key === l && (t.toggleDevTools(), e.preventDefault());
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function w(r, n = []) {
|
|
21
|
+
const i = new Set(n);
|
|
22
|
+
r.setPermissionRequestHandler((t, s, l) => l(i.has(s))), r.setPermissionCheckHandler((t, s) => i.has(s));
|
|
23
|
+
}
|
|
24
|
+
function p(r, n = process.argv, i = (t) => process.exit(t)) {
|
|
25
|
+
return !r.isPackaged || !f(n, (t) => r.commandLine.hasSwitch(t)) ? !1 : (console.error("[main] refusing to run with a debugger attached"), i(1), !0);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
w as denyPermissions,
|
|
29
|
+
g as lockDownWindow,
|
|
30
|
+
p as refuseDebugLaunch
|
|
31
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function i(e) {
|
|
2
|
+
try {
|
|
3
|
+
return new URL(e);
|
|
4
|
+
} catch {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function g(e, r) {
|
|
9
|
+
const t = i(e);
|
|
10
|
+
if (!t || t.protocol !== "https:" || t.username || t.password) return !1;
|
|
11
|
+
const o = t.hostname.toLowerCase(), s = (r.paths ?? []).filter((n) => n.host.toLowerCase() === o);
|
|
12
|
+
return s.length ? s.some((n) => t.pathname.toLowerCase().startsWith(n.prefix.toLowerCase())) : r.hosts.some((n) => {
|
|
13
|
+
const a = n.toLowerCase();
|
|
14
|
+
return o === a || o.endsWith(`.${a}`);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function f(e, r) {
|
|
18
|
+
const t = i(e);
|
|
19
|
+
if (!t) return !1;
|
|
20
|
+
if (r) {
|
|
21
|
+
const o = i(r);
|
|
22
|
+
return !!o && t.origin === o.origin;
|
|
23
|
+
}
|
|
24
|
+
return t.protocol === "file:";
|
|
25
|
+
}
|
|
26
|
+
function l(e) {
|
|
27
|
+
if (e.type !== "keyDown") return !1;
|
|
28
|
+
if (e.key === "F12") return !0;
|
|
29
|
+
const r = e.key.toLowerCase();
|
|
30
|
+
return (e.control || e.meta) && (e.shift || e.alt) && (r === "i" || r === "j" || r === "c");
|
|
31
|
+
}
|
|
32
|
+
const c = ["--inspect", "--remote-debugging-port", "--remote-debugging-pipe", "--remote-debugging-address"], u = ["remote-debugging-port", "remote-debugging-pipe", "inspect", "inspect-brk"];
|
|
33
|
+
function d(e, r = () => !1) {
|
|
34
|
+
return e.some((o) => c.some((s) => o === s || o.startsWith(`${s}=`) || o.startsWith(`${s}-`))) || u.some((o) => r(o));
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
c as DEBUG_SWITCHES,
|
|
38
|
+
d as debuggerRequested,
|
|
39
|
+
g as isAllowedExternal,
|
|
40
|
+
f as isAllowedNavigation,
|
|
41
|
+
l as isDevToolsKey
|
|
42
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { promises as r } from "node:fs";
|
|
2
|
+
import { join as n } from "node:path";
|
|
3
|
+
class l {
|
|
4
|
+
constructor(t) {
|
|
5
|
+
this.o = t, this.file = n(t.dir, t.fileName ?? "session.bin"), this.maxLength = t.maxLength ?? 4096, this.platform = t.platform ?? process.platform;
|
|
6
|
+
}
|
|
7
|
+
o;
|
|
8
|
+
file;
|
|
9
|
+
maxLength;
|
|
10
|
+
platform;
|
|
11
|
+
/** Whether the OS can encrypt for real here. */
|
|
12
|
+
canEncrypt() {
|
|
13
|
+
const t = this.o.safeStorage;
|
|
14
|
+
return t.isEncryptionAvailable() ? this.platform !== "linux" || t.getSelectedStorageBackend?.() !== "basic_text" : !1;
|
|
15
|
+
}
|
|
16
|
+
/** The saved value, or null when there is none, it cannot be decrypted (another OS user, a reinstall) or nothing may be. */
|
|
17
|
+
async get() {
|
|
18
|
+
if (!this.canEncrypt()) return null;
|
|
19
|
+
try {
|
|
20
|
+
return this.o.safeStorage.decryptString(await r.readFile(this.file));
|
|
21
|
+
} catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Saves `value`; false when it is not a string, too long, or the OS cannot encrypt it. */
|
|
26
|
+
async set(t) {
|
|
27
|
+
if (typeof t != "string" || t.length > this.maxLength || !this.canEncrypt()) return !1;
|
|
28
|
+
const e = `${this.file}.${process.pid}.${Date.now()}.tmp`;
|
|
29
|
+
try {
|
|
30
|
+
await r.mkdir(this.o.dir, { recursive: !0 }), await r.writeFile(e, this.o.safeStorage.encryptString(t)), await r.rename(e, this.file);
|
|
31
|
+
} catch (a) {
|
|
32
|
+
throw await r.rm(e, { force: !0 }), a;
|
|
33
|
+
}
|
|
34
|
+
return !0;
|
|
35
|
+
}
|
|
36
|
+
async clear() {
|
|
37
|
+
await r.rm(this.file, { force: !0 });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function h(s, t, e = "session") {
|
|
41
|
+
return s.handle(`${e}:get`, () => t.get()), s.handle(`${e}:set`, (a, i) => t.set(i)), s.handle(`${e}:clear`, () => t.clear()), () => {
|
|
42
|
+
for (const a of ["get", "set", "clear"]) s.removeHandler?.(`${e}:${a}`);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
l as SessionStore,
|
|
47
|
+
h as registerSessionStore
|
|
48
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createHash as a } from "node:crypto";
|
|
2
|
+
import { readdirSync as f, readFileSync as d } from "node:fs";
|
|
3
|
+
import { join as i } from "node:path";
|
|
4
|
+
function p(n, r) {
|
|
5
|
+
const o = typeof r == "string" ? { dirs: [r] } : r, s = o.match ?? ((t) => t.endsWith(".cjs")), e = a("sha256");
|
|
6
|
+
e.update(`electron ${n}
|
|
7
|
+
`);
|
|
8
|
+
for (const t of o.dirs)
|
|
9
|
+
for (const c of f(t).filter(s).sort())
|
|
10
|
+
e.update(`${c}
|
|
11
|
+
`), e.update(d(i(t, c)));
|
|
12
|
+
for (const t of o.extra ?? []) e.update(`extra ${t}
|
|
13
|
+
`);
|
|
14
|
+
return e.digest("hex").slice(0, o.length ?? 16);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
p as shellId
|
|
18
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createHash as s } from "node:crypto";
|
|
2
|
+
import { readFile as c, mkdir as l, writeFile as u, readdir as f } from "node:fs/promises";
|
|
3
|
+
import { join as r, dirname as h } from "node:path";
|
|
4
|
+
const m = (t) => s("sha256").update(t).digest("hex");
|
|
5
|
+
async function n(t, e = "") {
|
|
6
|
+
const i = [];
|
|
7
|
+
for (const a of await f(r(t, e), { withFileTypes: !0 })) {
|
|
8
|
+
const o = e ? `${e}/${a.name}` : a.name;
|
|
9
|
+
a.isDirectory() ? i.push(...await n(t, o)) : i.push(o);
|
|
10
|
+
}
|
|
11
|
+
return i;
|
|
12
|
+
}
|
|
13
|
+
async function d(t) {
|
|
14
|
+
const e = /* @__PURE__ */ new Map();
|
|
15
|
+
for (const i of await n(t)) e.set(i, m(await c(r(t, ...i.split("/")))));
|
|
16
|
+
return e;
|
|
17
|
+
}
|
|
18
|
+
async function F(t, e, i) {
|
|
19
|
+
const a = r(t, ...e.split("/"));
|
|
20
|
+
await l(h(a), { recursive: !0 }), await u(a, i);
|
|
21
|
+
}
|
|
22
|
+
async function T(t, e, i) {
|
|
23
|
+
const a = new AbortController(), o = setTimeout(() => a.abort(), i);
|
|
24
|
+
try {
|
|
25
|
+
return await t(e, { signal: a.signal, cache: "no-store" });
|
|
26
|
+
} finally {
|
|
27
|
+
clearTimeout(o);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
T as fetchWithTimeout,
|
|
32
|
+
d as hashWeb,
|
|
33
|
+
n as listFiles,
|
|
34
|
+
F as putFile,
|
|
35
|
+
m as sha256
|
|
36
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { existsSync as b } from "node:fs";
|
|
2
|
+
import { rm as d, mkdir as M, readFile as V, rename as T, readdir as x } from "node:fs/promises";
|
|
3
|
+
import { join as s } from "node:path";
|
|
4
|
+
import { isNewer as y, validManifest as $, fileUrl as U } from "../updates/manifest.js";
|
|
5
|
+
import { planWeb as D } from "../updates/webPlan.js";
|
|
6
|
+
import { fetchWithTimeout as u, hashWeb as E, putFile as g, sha256 as P } from "./webFiles.js";
|
|
7
|
+
import { WebPointers as W } from "./webPointers.js";
|
|
8
|
+
class C {
|
|
9
|
+
constructor(e) {
|
|
10
|
+
this.options = e, this.o = {
|
|
11
|
+
root: e.root,
|
|
12
|
+
builtinDir: e.builtinDir,
|
|
13
|
+
appVersion: e.appVersion,
|
|
14
|
+
channelUrl: e.channelUrl,
|
|
15
|
+
packaged: e.packaged ?? !0,
|
|
16
|
+
maxTries: e.maxTries ?? 2,
|
|
17
|
+
keepPrevious: e.keepPrevious ?? !0,
|
|
18
|
+
entry: e.entry ?? "index.html",
|
|
19
|
+
parallel: e.parallel ?? 6,
|
|
20
|
+
fetchTimeoutMs: e.fetchTimeoutMs ?? 15e3,
|
|
21
|
+
fetch: e.fetch ?? ((t, i) => globalThis.fetch(t, i)),
|
|
22
|
+
log: e.log ?? ((...t) => console.error(...t))
|
|
23
|
+
}, this.pointers = new W(e.root);
|
|
24
|
+
}
|
|
25
|
+
options;
|
|
26
|
+
o;
|
|
27
|
+
pointers;
|
|
28
|
+
shellValue = null;
|
|
29
|
+
/** The web this run loads, and its version (the installed build's own when none is patched in). */
|
|
30
|
+
loaded = null;
|
|
31
|
+
/** The tidy a start began: a build waits for it, or it could delete the `.part` folder being filled. */
|
|
32
|
+
tidying = Promise.resolve();
|
|
33
|
+
/** This shell's identity. */
|
|
34
|
+
get shell() {
|
|
35
|
+
const e = this.options.shell;
|
|
36
|
+
return this.shellValue ??= typeof e == "string" ? e : e(), this.shellValue;
|
|
37
|
+
}
|
|
38
|
+
/** Where the window loads the page from: a patched web when there is a good one, else the built-in copy. */
|
|
39
|
+
startEntry() {
|
|
40
|
+
if (!this.o.packaged)
|
|
41
|
+
return this.loaded = { dir: this.o.builtinDir, version: this.o.appVersion }, s(this.o.builtinDir, this.o.entry);
|
|
42
|
+
try {
|
|
43
|
+
const e = this.pointers.read("pending");
|
|
44
|
+
this.usable(e) && this.promote(e, 0), this.pointers.write("pending", null);
|
|
45
|
+
const t = this.pointers.read("active");
|
|
46
|
+
if (this.usable(t) && (t.booted || t.tries < this.o.maxTries))
|
|
47
|
+
t.booted || this.pointers.write("active", { ...t, tries: t.tries + 1 }), this.loaded = { dir: s(this.o.root, t.version), version: t.version };
|
|
48
|
+
else {
|
|
49
|
+
t && this.pointers.write("active", null);
|
|
50
|
+
const i = this.pointers.read("previous");
|
|
51
|
+
this.pointers.write("previous", null), this.o.keepPrevious && i?.booted && this.usable(i) && (this.pointers.write("active", i), this.loaded = { dir: s(this.o.root, i.version), version: i.version });
|
|
52
|
+
}
|
|
53
|
+
} catch (e) {
|
|
54
|
+
this.o.log("[web] could not read the patched web, using the built-in one", e);
|
|
55
|
+
}
|
|
56
|
+
return this.loaded ??= { dir: this.o.builtinDir, version: this.o.appVersion }, this.tidying = this.tidy(), s(this.loaded.dir, this.o.entry);
|
|
57
|
+
}
|
|
58
|
+
/** The version of the web running now. */
|
|
59
|
+
webVersion() {
|
|
60
|
+
return this.loaded?.version ?? this.o.appVersion;
|
|
61
|
+
}
|
|
62
|
+
/** The page came up: the web it was loaded from is kept from now on. Call it from the page's own "booted" message. */
|
|
63
|
+
markBooted() {
|
|
64
|
+
const e = this.pointers.read("active");
|
|
65
|
+
e && this.loaded && e.version === this.loaded.version && !e.booted && this.pointers.write("active", { ...e, booted: !0 });
|
|
66
|
+
}
|
|
67
|
+
/** The channel's newest build, or null when the store cannot be read. */
|
|
68
|
+
async latest() {
|
|
69
|
+
try {
|
|
70
|
+
const e = await u(this.o.fetch, `${this.o.channelUrl}/latest.json`, this.o.fetchTimeoutMs);
|
|
71
|
+
if (!e.ok) return null;
|
|
72
|
+
const t = await e.json();
|
|
73
|
+
return typeof t?.version == "string" ? t : null;
|
|
74
|
+
} catch {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/** Whether `l`'s web can be patched in here rather than installed: newer than the web running, for this shell. */
|
|
79
|
+
patchable(e) {
|
|
80
|
+
return !!e.web && e.web.shell === this.shell && y(e.version, this.webVersion());
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Builds `l`'s web beside the one running: the files held are copied, the rest downloaded and checked, into
|
|
84
|
+
* `<version>.part/`, which becomes `<version>/` and the pending web once whole — a crash mid-way never leaves a
|
|
85
|
+
* folder that looks finished. `onProgress` gets 0–100. Resolves with the version built; throws on any failure.
|
|
86
|
+
*/
|
|
87
|
+
async prepare(e, t = () => {
|
|
88
|
+
}) {
|
|
89
|
+
if (!e.web) throw new Error("no web in this release");
|
|
90
|
+
const i = await u(this.o.fetch, `${this.o.channelUrl}/${e.web.manifest}`, this.o.fetchTimeoutMs);
|
|
91
|
+
if (!i.ok) throw new Error(`web manifest ${i.status}`);
|
|
92
|
+
const o = await i.json();
|
|
93
|
+
if (!$(o) || o.version !== e.version || o.shell !== this.shell) throw new Error("bad web manifest");
|
|
94
|
+
const l = s(this.o.root, o.version), p = { version: o.version, shell: o.shell, booted: !1, tries: 0 };
|
|
95
|
+
if (b(s(l, this.o.entry)) && this.pointers.read("active")?.version !== o.version)
|
|
96
|
+
return this.pointers.write("pending", p), t(100), o.version;
|
|
97
|
+
await this.tidying;
|
|
98
|
+
const f = this.loaded?.dir ?? this.o.builtinDir, h = D(o, await E(f)), n = s(this.o.root, `${o.version}.part`);
|
|
99
|
+
await d(n, { recursive: !0, force: !0 }), await M(n, { recursive: !0 });
|
|
100
|
+
for (const r of h.copy) await g(n, r.path, await V(s(f, ...r.from.split("/"))));
|
|
101
|
+
let v = 0;
|
|
102
|
+
const w = /* @__PURE__ */ new Map(), m = [...h.download];
|
|
103
|
+
t(h.bytes ? 0 : 100);
|
|
104
|
+
const k = async () => {
|
|
105
|
+
for (let r = m.shift(); r; r = m.shift()) {
|
|
106
|
+
let a = w.get(r.sha256);
|
|
107
|
+
if (!a) {
|
|
108
|
+
const c = await u(this.o.fetch, U(this.o.channelUrl, r.sha256), this.o.fetchTimeoutMs);
|
|
109
|
+
if (!c.ok) throw new Error(`${r.path}: ${c.status}`);
|
|
110
|
+
if (a = new Uint8Array(await c.arrayBuffer()), P(a) !== r.sha256) throw new Error(`${r.path}: checksum`);
|
|
111
|
+
w.set(r.sha256, a), v += r.size, t(Math.min(99, Math.round(v / Math.max(1, h.bytes) * 100)));
|
|
112
|
+
}
|
|
113
|
+
await g(n, r.path, a);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
return await Promise.all(Array.from({ length: Math.max(1, this.o.parallel) }, k)), await d(l, { recursive: !0, force: !0 }), await T(n, l), this.pointers.write("pending", p), t(100), o.version;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Puts the pending web in use now and returns the page to load (reload every window from it), or null when there is
|
|
120
|
+
* none this shell may load. The switch counts as its first start, so a web that never boots is still dropped.
|
|
121
|
+
*/
|
|
122
|
+
applyPending() {
|
|
123
|
+
const e = this.pointers.read("pending");
|
|
124
|
+
return this.usable(e) ? (this.promote(e, 1), this.pointers.write("pending", null), this.loaded = { dir: s(this.o.root, e.version), version: e.version }, s(this.loaded.dir, this.o.entry)) : null;
|
|
125
|
+
}
|
|
126
|
+
/** Makes `p` the active web, keeping the one it replaces as the fallback when that one ever booted. */
|
|
127
|
+
promote(e, t) {
|
|
128
|
+
const i = this.pointers.read("active");
|
|
129
|
+
this.o.keepPrevious && i?.booted && i.version !== e.version && this.pointers.write("previous", i), this.pointers.write("active", { ...e, booted: !1, tries: t });
|
|
130
|
+
}
|
|
131
|
+
/** A pointer this shell may load: its own shell, newer than the installed build, its folder whole. */
|
|
132
|
+
usable(e) {
|
|
133
|
+
return !!e && e.shell === this.shell && y(e.version, this.o.appVersion) && b(s(this.o.root, e.version, this.o.entry));
|
|
134
|
+
}
|
|
135
|
+
/** Removes every patched web but the active, pending and previous one, and any half-made folder. */
|
|
136
|
+
async tidy() {
|
|
137
|
+
try {
|
|
138
|
+
const e = ["active", "pending", "previous"], t = new Set([...e.map((i) => this.pointers.read(i)?.version), this.loaded?.version].filter((i) => !!i));
|
|
139
|
+
for (const i of await x(this.o.root))
|
|
140
|
+
i.endsWith(".json") || t.has(i) || await d(s(this.o.root, i), { recursive: !0, force: !0 });
|
|
141
|
+
} catch {
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
C as WebPatcher
|
|
147
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { readFileSync as t, mkdirSync as i, writeFileSync as o, rmSync as s } from "node:fs";
|
|
2
|
+
import { join as n } from "node:path";
|
|
3
|
+
class c {
|
|
4
|
+
constructor(e) {
|
|
5
|
+
this.root = e;
|
|
6
|
+
}
|
|
7
|
+
root;
|
|
8
|
+
read(e) {
|
|
9
|
+
try {
|
|
10
|
+
const r = JSON.parse(t(this.file(e), "utf8"));
|
|
11
|
+
return typeof r?.version != "string" || typeof r.shell != "string" ? null : { version: r.version, shell: r.shell, booted: r.booted === !0, tries: typeof r.tries == "number" ? r.tries : 0 };
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
write(e, r) {
|
|
17
|
+
r ? (i(this.root, { recursive: !0 }), o(this.file(e), JSON.stringify(r))) : s(this.file(e), { force: !0 });
|
|
18
|
+
}
|
|
19
|
+
file(e) {
|
|
20
|
+
return n(this.root, `${e}.json`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
c as WebPointers
|
|
25
|
+
};
|
package/dist/electron.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { shellId as r } from "./electron/shellId.js";
|
|
2
|
+
import { WebPatcher as t } from "./electron/webPatcher.js";
|
|
3
|
+
import { SessionStore as l, registerSessionStore as n } from "./electron/sessionStore.js";
|
|
4
|
+
import { DEBUG_SWITCHES as f, debuggerRequested as m, isAllowedExternal as x, isAllowedNavigation as S, isDevToolsKey as a } from "./electron/lockdownRules.js";
|
|
5
|
+
import { denyPermissions as p, lockDownWindow as u, refuseDebugLaunch as w } from "./electron/lockdown.js";
|
|
6
|
+
export {
|
|
7
|
+
f as DEBUG_SWITCHES,
|
|
8
|
+
l as SessionStore,
|
|
9
|
+
t as WebPatcher,
|
|
10
|
+
m as debuggerRequested,
|
|
11
|
+
p as denyPermissions,
|
|
12
|
+
x as isAllowedExternal,
|
|
13
|
+
S as isAllowedNavigation,
|
|
14
|
+
a as isDevToolsKey,
|
|
15
|
+
u as lockDownWindow,
|
|
16
|
+
w as refuseDebugLaunch,
|
|
17
|
+
n as registerSessionStore,
|
|
18
|
+
r as shellId
|
|
19
|
+
};
|
package/dist/engine/Engine.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { TextureSource as d, Application as
|
|
1
|
+
import { TextureSource as d, Application as p } from "pixi.js";
|
|
2
2
|
import { Stage as o } from "../core/Stage.js";
|
|
3
|
-
import { TextureRegistry as
|
|
3
|
+
import { TextureRegistry as l } from "../core/TextureRegistry.js";
|
|
4
4
|
import { patchPixi as m } from "../core/pixiPatches.js";
|
|
5
5
|
import { EventBus as f } from "../events/EventBus.js";
|
|
6
|
-
import {
|
|
6
|
+
import { followReducedMotion as g } from "../platform/reducedMotion.js";
|
|
7
|
+
import { FixedLoop as w } from "./FixedLoop.js";
|
|
8
|
+
import { HiddenPause as k } from "./HiddenPause.js";
|
|
7
9
|
import { SceneManager as v } from "./SceneManager.js";
|
|
8
10
|
class x extends o {
|
|
9
11
|
constructor(e, t, r) {
|
|
@@ -14,11 +16,11 @@ class x extends o {
|
|
|
14
16
|
this.tick(e, t);
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
class
|
|
19
|
+
class u {
|
|
18
20
|
constructor(e, t, r) {
|
|
19
|
-
this.app = e, this.loop = new
|
|
20
|
-
const
|
|
21
|
-
|
|
21
|
+
this.app = e, this.loop = new w(r.hz === void 0 ? {} : { hz: r.hz }), this.stage = new x(e, t, (i, n) => this.tick(i, n));
|
|
22
|
+
const s = this.stage.cameras.main;
|
|
23
|
+
s.setZoom(r.zoom ?? 1), s.defaultZoom = s.zoom, s.roundPixels = r.pixelPerfect === !0, s.resolution = e.renderer.resolution, this.scenes = new v(this), o.onCaught = (i, n) => this.events.emit("error", { where: i, error: n }), e.ticker.add(this.onTick), r.pauseWhenHidden === !0 && this.unwatch.push(this.hiddenPause.watch()), r.followReducedMotion === !0 && this.unwatch.push(g());
|
|
22
24
|
}
|
|
23
25
|
app;
|
|
24
26
|
stage;
|
|
@@ -27,21 +29,24 @@ class c {
|
|
|
27
29
|
events = new f();
|
|
28
30
|
running = !0;
|
|
29
31
|
destroyed = !1;
|
|
32
|
+
/** Pauses through the loop's own switch, so a hidden tab never counts as the game's own pause (`forget`). */
|
|
33
|
+
hiddenPause = this.makeHiddenPause();
|
|
34
|
+
unwatch = [];
|
|
30
35
|
onTick = (e) => this.stage.frame(e.deltaMS);
|
|
31
36
|
static async create(e) {
|
|
32
37
|
const t = e.pixelPerfect === !0;
|
|
33
38
|
d.defaultOptions.scaleMode = t ? "nearest" : "linear";
|
|
34
39
|
const r = t ? 1 : e.resolution ?? Math.min(2, typeof devicePixelRatio == "number" ? devicePixelRatio : 1);
|
|
35
40
|
m();
|
|
36
|
-
const
|
|
37
|
-
return await
|
|
38
|
-
...
|
|
41
|
+
const s = new p(), i = e.width === void 0 && e.height === void 0;
|
|
42
|
+
return await s.init({
|
|
43
|
+
...i ? { resizeTo: e.parent } : { width: e.width ?? 800, height: e.height ?? 600 },
|
|
39
44
|
background: e.background ?? "#000000",
|
|
40
45
|
antialias: !t,
|
|
41
46
|
resolution: r,
|
|
42
47
|
autoDensity: !0,
|
|
43
48
|
preference: e.preference ?? "webgl"
|
|
44
|
-
}), e.parent.appendChild(
|
|
49
|
+
}), e.parent.appendChild(s.canvas), new u(s, e.textures ?? new l(), e);
|
|
45
50
|
}
|
|
46
51
|
/** The scene that updates now, if any. */
|
|
47
52
|
get scene() {
|
|
@@ -49,9 +54,25 @@ class c {
|
|
|
49
54
|
}
|
|
50
55
|
/** Stops simulating and drawing; the canvas keeps its last frame. */
|
|
51
56
|
pause() {
|
|
52
|
-
this.
|
|
57
|
+
this.hiddenPause.forget(), this.pauseLoop();
|
|
53
58
|
}
|
|
54
59
|
resume() {
|
|
60
|
+
this.hiddenPause.forget(), this.resumeLoop();
|
|
61
|
+
}
|
|
62
|
+
makeHiddenPause() {
|
|
63
|
+
const e = this;
|
|
64
|
+
return new k({
|
|
65
|
+
get paused() {
|
|
66
|
+
return !e.running;
|
|
67
|
+
},
|
|
68
|
+
pause: () => e.pauseLoop(),
|
|
69
|
+
resume: () => e.resumeLoop()
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
pauseLoop() {
|
|
73
|
+
this.running && (this.running = !1, this.app.ticker.stop());
|
|
74
|
+
}
|
|
75
|
+
resumeLoop() {
|
|
55
76
|
this.running || this.destroyed || (this.running = !0, this.loop.reset(), this.app.ticker.start());
|
|
56
77
|
}
|
|
57
78
|
get paused() {
|
|
@@ -63,20 +84,23 @@ class c {
|
|
|
63
84
|
}
|
|
64
85
|
/** Leaves every scene, removes the canvas and frees the renderer. */
|
|
65
86
|
async destroy() {
|
|
66
|
-
|
|
87
|
+
if (!this.destroyed) {
|
|
88
|
+
this.destroyed = !0;
|
|
89
|
+
for (const e of this.unwatch.splice(0)) e();
|
|
90
|
+
await this.scenes.clear(), this.app.ticker.remove(this.onTick), o.onCaught && (o.onCaught = null), this.stage.destroy(), this.events.clear(), this.app.destroy({ removeView: !0 }, { children: !0 });
|
|
91
|
+
}
|
|
67
92
|
}
|
|
68
93
|
tick(e, t) {
|
|
69
94
|
const r = this.scenes.current;
|
|
70
95
|
if (r) {
|
|
71
|
-
const
|
|
72
|
-
r.world.run("fixed", { dt:
|
|
96
|
+
const s = (h, c) => this.reportError(`system ${h.name}`, c), i = this.loop.stepSeconds, n = this.loop.advance(t, () => {
|
|
97
|
+
r.world.run("fixed", { dt: i, now: e, alpha: 0 }, s), r.fixedUpdate(i);
|
|
73
98
|
}), a = t / 1e3;
|
|
74
|
-
r.world.run("frame", { dt: a, now: e, alpha: n },
|
|
99
|
+
r.world.run("frame", { dt: a, now: e, alpha: n }, s), r.update(a, n);
|
|
75
100
|
}
|
|
76
101
|
this.events.emit("frame", { now: e, dt: t / 1e3 });
|
|
77
102
|
}
|
|
78
103
|
}
|
|
79
104
|
export {
|
|
80
|
-
|
|
105
|
+
u as Engine
|
|
81
106
|
};
|
|
82
|
-
//# sourceMappingURL=Engine.js.map
|
package/dist/engine/FixedLoop.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
class s {
|
|
2
|
+
constructor(e) {
|
|
3
|
+
this.target = e;
|
|
4
|
+
}
|
|
5
|
+
target;
|
|
6
|
+
pausedByUs = !1;
|
|
7
|
+
hidden() {
|
|
8
|
+
this.target.paused || (this.target.pause(), this.pausedByUs = !0);
|
|
9
|
+
}
|
|
10
|
+
shown() {
|
|
11
|
+
this.pausedByUs && (this.pausedByUs = !1, this.target.paused && this.target.resume());
|
|
12
|
+
}
|
|
13
|
+
/** The game paused or resumed it itself: whatever happens next is its choice, not ours to undo. */
|
|
14
|
+
forget() {
|
|
15
|
+
this.pausedByUs = !1;
|
|
16
|
+
}
|
|
17
|
+
/** Listens to `visibilitychange` on `doc`; returns the unsubscribe. A no-op without a document. */
|
|
18
|
+
watch(e = typeof document > "u" ? null : document) {
|
|
19
|
+
if (!e) return () => {
|
|
20
|
+
};
|
|
21
|
+
const t = () => e.visibilityState === "hidden" ? this.hidden() : this.shown();
|
|
22
|
+
return e.addEventListener("visibilitychange", t), e.visibilityState === "hidden" && this.hidden(), () => e.removeEventListener("visibilitychange", t);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
s as HiddenPause
|
|
27
|
+
};
|