@verticopolis/components 0.0.0-stage → 0.2.0
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/ASSETS-LICENSE.md +49 -0
- package/LICENSE +21 -0
- package/README.md +121 -2
- package/lib/audio/Audio.d.ts +110 -0
- package/lib/audio/Audio.js +199 -0
- package/lib/audio/Audio.js.map +1 -0
- package/lib/audio/ToneAudioEngine.d.ts +125 -0
- package/lib/audio/ToneAudioEngine.js +452 -0
- package/lib/audio/ToneAudioEngine.js.map +1 -0
- package/lib/audio/audioAssets.d.ts +25 -0
- package/lib/audio/audioAssets.js +28 -0
- package/lib/audio/audioAssets.js.map +1 -0
- package/lib/audio/awayWatch.d.ts +17 -0
- package/lib/audio/awayWatch.js +33 -0
- package/lib/audio/awayWatch.js.map +1 -0
- package/lib/audio/firstCueLatch.d.ts +18 -0
- package/lib/audio/firstCueLatch.js +34 -0
- package/lib/audio/firstCueLatch.js.map +1 -0
- package/lib/audio/lightEnvelope.d.ts +64 -0
- package/lib/audio/lightEnvelope.js +124 -0
- package/lib/audio/lightEnvelope.js.map +1 -0
- package/lib/audio/lightSynth.d.ts +125 -0
- package/lib/audio/lightSynth.js +203 -0
- package/lib/audio/lightSynth.js.map +1 -0
- package/lib/audio/toneContext.d.ts +30 -0
- package/lib/audio/toneContext.js +79 -0
- package/lib/audio/toneContext.js.map +1 -0
- package/lib/audio/toneCrowd.d.ts +62 -0
- package/lib/audio/toneCrowd.js +429 -0
- package/lib/audio/toneCrowd.js.map +1 -0
- package/lib/audio/toneCrowdData.d.ts +144 -0
- package/lib/audio/toneCrowdData.js +317 -0
- package/lib/audio/toneCrowdData.js.map +1 -0
- package/lib/audio/toneCrowdPrograms.d.ts +71 -0
- package/lib/audio/toneCrowdPrograms.js +273 -0
- package/lib/audio/toneCrowdPrograms.js.map +1 -0
- package/lib/audio/toneCrowdVoices.d.ts +49 -0
- package/lib/audio/toneCrowdVoices.js +212 -0
- package/lib/audio/toneCrowdVoices.js.map +1 -0
- package/lib/audio/toneMusicVoices.d.ts +11 -0
- package/lib/audio/toneMusicVoices.js +31 -0
- package/lib/audio/toneMusicVoices.js.map +1 -0
- package/lib/audio/tonePercussion.d.ts +45 -0
- package/lib/audio/tonePercussion.js +97 -0
- package/lib/audio/tonePercussion.js.map +1 -0
- package/lib/audio/toneRain.d.ts +23 -0
- package/lib/audio/toneRain.js +39 -0
- package/lib/audio/toneRain.js.map +1 -0
- package/lib/audio/toneRecordingMock.d.ts +89 -0
- package/lib/audio/toneRecordingMock.js +145 -0
- package/lib/audio/toneRecordingMock.js.map +1 -0
- package/lib/audio/toneRoomTone.d.ts +11 -0
- package/lib/audio/toneRoomTone.js +27 -0
- package/lib/audio/toneRoomTone.js.map +1 -0
- package/lib/audio/toneScenes.d.ts +57 -0
- package/lib/audio/toneScenes.js +208 -0
- package/lib/audio/toneScenes.js.map +1 -0
- package/lib/audio/toneTracks.d.ts +50 -0
- package/lib/audio/toneTracks.js +356 -0
- package/lib/audio/toneTracks.js.map +1 -0
- package/lib/audio/toneVoices.d.ts +57 -0
- package/lib/audio/toneVoices.js +208 -0
- package/lib/audio/toneVoices.js.map +1 -0
- package/lib/catalog/catalogTypes.d.ts +428 -0
- package/lib/catalog/catalogTypes.js +102 -0
- package/lib/catalog/catalogTypes.js.map +1 -0
- package/lib/catalog/skyBridgeTypes.d.ts +25 -0
- package/lib/catalog/skyBridgeTypes.js +7 -0
- package/lib/catalog/skyBridgeTypes.js.map +1 -0
- package/lib/catalog/starDutyTypes.d.ts +22 -0
- package/lib/catalog/starDutyTypes.js +7 -0
- package/lib/catalog/starDutyTypes.js.map +1 -0
- package/lib/catalog/towerCatalog.d.ts +32 -0
- package/lib/catalog/towerCatalog.js +44 -0
- package/lib/catalog/towerCatalog.js.map +1 -0
- package/lib/engineBinding/binding.d.ts +36 -0
- package/lib/engineBinding/binding.js +90 -0
- package/lib/engineBinding/binding.js.map +1 -0
- package/lib/engineBinding/catalog.d.ts +24 -0
- package/lib/engineBinding/catalog.js +267 -0
- package/lib/engineBinding/catalog.js.map +1 -0
- package/lib/engineBinding/engine.d.ts +866 -0
- package/lib/engineBinding/exportTiers.d.ts +289 -0
- package/lib/engineBinding/exportTiers.js +283 -0
- package/lib/engineBinding/exportTiers.js.map +1 -0
- package/lib/engineBinding/toolingMethods.d.ts +12 -0
- package/lib/engineBinding/toolingMethods.js +20 -0
- package/lib/engineBinding/toolingMethods.js.map +1 -0
- package/lib/events/gameplayCatalog.d.ts +57 -0
- package/lib/events/gameplayCatalog.js +214 -0
- package/lib/events/gameplayCatalog.js.map +1 -0
- package/lib/events/gameplayEventRules.d.ts +4 -0
- package/lib/events/gameplayEventRules.js +32 -0
- package/lib/events/gameplayEventRules.js.map +1 -0
- package/lib/events/gameplayEvents.d.ts +284 -0
- package/lib/presentation/clockText.d.ts +28 -0
- package/lib/presentation/clockText.js +38 -0
- package/lib/presentation/clockText.js.map +1 -0
- package/lib/presentation/facilityPresentation.d.ts +20 -0
- package/lib/presentation/facilityPresentation.js +164 -0
- package/lib/presentation/facilityPresentation.js.map +1 -0
- package/lib/presentation/statsCopy.d.ts +20 -0
- package/lib/presentation/statsCopy.js +37 -0
- package/lib/presentation/statsCopy.js.map +1 -0
- package/lib/presentation/traffic.d.ts +75 -0
- package/lib/presentation/traffic.js +79 -0
- package/lib/presentation/traffic.js.map +1 -0
- package/lib/presentation/viewKinds.d.ts +33 -0
- package/lib/presentation/viewKinds.js +88 -0
- package/lib/presentation/viewKinds.js.map +1 -0
- package/lib/presentation/viewWorld.d.ts +29 -0
- package/lib/presentation/viewWorld.js +31 -0
- package/lib/presentation/viewWorld.js.map +1 -0
- package/lib/render/atlas/archive.d.ts +78 -0
- package/lib/render/atlas/archive.js +427 -0
- package/lib/render/atlas/archive.js.map +1 -0
- package/lib/render/atlas/bake.d.ts +132 -0
- package/lib/render/atlas/bake.js +331 -0
- package/lib/render/atlas/bake.js.map +1 -0
- package/lib/render/atlas/bakeAdditions.d.ts +24 -0
- package/lib/render/atlas/bakeAdditions.js +46 -0
- package/lib/render/atlas/bakeAdditions.js.map +1 -0
- package/lib/render/atlas/browserEntry.d.ts +12 -0
- package/lib/render/atlas/browserEntry.js +222 -0
- package/lib/render/atlas/browserEntry.js.map +1 -0
- package/lib/render/atlas/catalog.d.ts +118 -0
- package/lib/render/atlas/catalog.js +253 -0
- package/lib/render/atlas/catalog.js.map +1 -0
- package/lib/render/atlas/catalogExtras.d.ts +45 -0
- package/lib/render/atlas/catalogExtras.js +217 -0
- package/lib/render/atlas/catalogExtras.js.map +1 -0
- package/lib/render/atlas/compose.d.ts +30 -0
- package/lib/render/atlas/compose.js +125 -0
- package/lib/render/atlas/compose.js.map +1 -0
- package/lib/render/atlas/cycles.d.ts +25 -0
- package/lib/render/atlas/cycles.js +41 -0
- package/lib/render/atlas/cycles.js.map +1 -0
- package/lib/render/atlas/lookup.d.ts +65 -0
- package/lib/render/atlas/lookup.js +83 -0
- package/lib/render/atlas/lookup.js.map +1 -0
- package/lib/render/atlas/pack.d.ts +23 -0
- package/lib/render/atlas/pack.js +50 -0
- package/lib/render/atlas/pack.js.map +1 -0
- package/lib/render/atlas/paint.d.ts +120 -0
- package/lib/render/atlas/paint.js +154 -0
- package/lib/render/atlas/paint.js.map +1 -0
- package/lib/render/atlas/pixels.d.ts +46 -0
- package/lib/render/atlas/pixels.js +158 -0
- package/lib/render/atlas/pixels.js.map +1 -0
- package/lib/render/atlas/png.d.ts +3 -0
- package/lib/render/atlas/png.js +102 -0
- package/lib/render/atlas/png.js.map +1 -0
- package/lib/render/atlas/raster.d.ts +34 -0
- package/lib/render/atlas/raster.js +114 -0
- package/lib/render/atlas/raster.js.map +1 -0
- package/lib/render/atlas/recyclingFill.d.ts +5 -0
- package/lib/render/atlas/recyclingFill.js +65 -0
- package/lib/render/atlas/recyclingFill.js.map +1 -0
- package/lib/render/atlas/samples.d.ts +24 -0
- package/lib/render/atlas/samples.js +75 -0
- package/lib/render/atlas/samples.js.map +1 -0
- package/lib/render/atlas/scenery.d.ts +230 -0
- package/lib/render/atlas/scenery.js +242 -0
- package/lib/render/atlas/scenery.js.map +1 -0
- package/lib/render/atlas/schema.d.ts +189 -0
- package/lib/render/atlas/schema.js +31 -0
- package/lib/render/atlas/schema.js.map +1 -0
- package/lib/render/atlas/shellMarks.d.ts +16 -0
- package/lib/render/atlas/shellMarks.js +72 -0
- package/lib/render/atlas/shellMarks.js.map +1 -0
- package/lib/render/atlas/store.d.ts +75 -0
- package/lib/render/atlas/store.js +127 -0
- package/lib/render/atlas/store.js.map +1 -0
- package/lib/render/atlas/verify.d.ts +43 -0
- package/lib/render/atlas/verify.js +87 -0
- package/lib/render/atlas/verify.js.map +1 -0
- package/lib/render/atlas/verifyExtras.d.ts +19 -0
- package/lib/render/atlas/verifyExtras.js +310 -0
- package/lib/render/atlas/verifyExtras.js.map +1 -0
- package/lib/render/cameraBounds.d.ts +71 -0
- package/lib/render/cameraBounds.js +107 -0
- package/lib/render/cameraBounds.js.map +1 -0
- package/lib/render/carIndicator.d.ts +41 -0
- package/lib/render/carIndicator.js +45 -0
- package/lib/render/carIndicator.js.map +1 -0
- package/lib/render/carMotion.d.ts +33 -0
- package/lib/render/carMotion.js +42 -0
- package/lib/render/carMotion.js.map +1 -0
- package/lib/render/catalogScale.d.ts +40 -0
- package/lib/render/catalogScale.js +33 -0
- package/lib/render/catalogScale.js.map +1 -0
- package/lib/render/climbPath.d.ts +59 -0
- package/lib/render/climbPath.js +115 -0
- package/lib/render/climbPath.js.map +1 -0
- package/lib/render/depthPlanes.d.ts +55 -0
- package/lib/render/depthPlanes.js +58 -0
- package/lib/render/depthPlanes.js.map +1 -0
- package/lib/render/excalibur/TowerEngine.d.ts +348 -0
- package/lib/render/excalibur/TowerEngine.js +415 -0
- package/lib/render/excalibur/TowerEngine.js.map +1 -0
- package/lib/render/excalibur/cabGraphics.d.ts +75 -0
- package/lib/render/excalibur/cabGraphics.js +108 -0
- package/lib/render/excalibur/cabGraphics.js.map +1 -0
- package/lib/render/excalibur/cabParts.d.ts +32 -0
- package/lib/render/excalibur/cabParts.js +79 -0
- package/lib/render/excalibur/cabParts.js.map +1 -0
- package/lib/render/excalibur/cabRiders.d.ts +72 -0
- package/lib/render/excalibur/cabRiders.js +176 -0
- package/lib/render/excalibur/cabRiders.js.map +1 -0
- package/lib/render/excalibur/crowdCull.d.ts +34 -0
- package/lib/render/excalibur/crowdCull.js +72 -0
- package/lib/render/excalibur/crowdCull.js.map +1 -0
- package/lib/render/excalibur/crowdFigure.d.ts +42 -0
- package/lib/render/excalibur/crowdFigure.js +99 -0
- package/lib/render/excalibur/crowdFigure.js.map +1 -0
- package/lib/render/excalibur/crowdLook.d.ts +137 -0
- package/lib/render/excalibur/crowdLook.js +186 -0
- package/lib/render/excalibur/crowdLook.js.map +1 -0
- package/lib/render/excalibur/frameHold.d.ts +23 -0
- package/lib/render/excalibur/frameHold.js +30 -0
- package/lib/render/excalibur/frameHold.js.map +1 -0
- package/lib/render/excalibur/guardPosition.d.ts +17 -0
- package/lib/render/excalibur/guardPosition.js +37 -0
- package/lib/render/excalibur/guardPosition.js.map +1 -0
- package/lib/render/excalibur/keyboardHost.d.ts +15 -0
- package/lib/render/excalibur/keyboardHost.js +22 -0
- package/lib/render/excalibur/keyboardHost.js.map +1 -0
- package/lib/render/excalibur/longPress.d.ts +16 -0
- package/lib/render/excalibur/longPress.js +71 -0
- package/lib/render/excalibur/longPress.js.map +1 -0
- package/lib/render/excalibur/peopleGfx.d.ts +16 -0
- package/lib/render/excalibur/peopleGfx.js +46 -0
- package/lib/render/excalibur/peopleGfx.js.map +1 -0
- package/lib/render/excalibur/peopleWindow.d.ts +35 -0
- package/lib/render/excalibur/peopleWindow.js +38 -0
- package/lib/render/excalibur/peopleWindow.js.map +1 -0
- package/lib/render/excalibur/personFocus.d.ts +36 -0
- package/lib/render/excalibur/personFocus.js +169 -0
- package/lib/render/excalibur/personFocus.js.map +1 -0
- package/lib/render/excalibur/pointerButtonGuard.d.ts +35 -0
- package/lib/render/excalibur/pointerButtonGuard.js +86 -0
- package/lib/render/excalibur/pointerButtonGuard.js.map +1 -0
- package/lib/render/excalibur/pressLifecycle.d.ts +26 -0
- package/lib/render/excalibur/pressLifecycle.js +66 -0
- package/lib/render/excalibur/pressLifecycle.js.map +1 -0
- package/lib/render/excalibur/rainShelter.d.ts +16 -0
- package/lib/render/excalibur/rainShelter.js +94 -0
- package/lib/render/excalibur/rainShelter.js.map +1 -0
- package/lib/render/excalibur/roomSignature.d.ts +30 -0
- package/lib/render/excalibur/roomSignature.js +49 -0
- package/lib/render/excalibur/roomSignature.js.map +1 -0
- package/lib/render/excalibur/sceneBake.d.ts +9 -0
- package/lib/render/excalibur/sceneBake.js +12 -0
- package/lib/render/excalibur/sceneBake.js.map +1 -0
- package/lib/render/excalibur/thiefSpan.d.ts +18 -0
- package/lib/render/excalibur/thiefSpan.js +51 -0
- package/lib/render/excalibur/thiefSpan.js.map +1 -0
- package/lib/render/excalibur/towerBridgeTiles.d.ts +30 -0
- package/lib/render/excalibur/towerBridgeTiles.js +43 -0
- package/lib/render/excalibur/towerBridgeTiles.js.map +1 -0
- package/lib/render/excalibur/towerCrowd.d.ts +73 -0
- package/lib/render/excalibur/towerCrowd.js +464 -0
- package/lib/render/excalibur/towerCrowd.js.map +1 -0
- package/lib/render/excalibur/towerCrowdLayout.d.ts +40 -0
- package/lib/render/excalibur/towerCrowdLayout.js +77 -0
- package/lib/render/excalibur/towerCrowdLayout.js.map +1 -0
- package/lib/render/excalibur/towerFireResponse.d.ts +25 -0
- package/lib/render/excalibur/towerFireResponse.js +89 -0
- package/lib/render/excalibur/towerFireResponse.js.map +1 -0
- package/lib/render/excalibur/towerFrame.d.ts +8 -0
- package/lib/render/excalibur/towerFrame.js +57 -0
- package/lib/render/excalibur/towerFrame.js.map +1 -0
- package/lib/render/excalibur/towerGhostLabel.d.ts +9 -0
- package/lib/render/excalibur/towerGhostLabel.js +37 -0
- package/lib/render/excalibur/towerGhostLabel.js.map +1 -0
- package/lib/render/excalibur/towerHallDoors.d.ts +42 -0
- package/lib/render/excalibur/towerHallDoors.js +129 -0
- package/lib/render/excalibur/towerHallDoors.js.map +1 -0
- package/lib/render/excalibur/towerHaloRings.d.ts +34 -0
- package/lib/render/excalibur/towerHaloRings.js +45 -0
- package/lib/render/excalibur/towerHaloRings.js.map +1 -0
- package/lib/render/excalibur/towerInputCamera.d.ts +90 -0
- package/lib/render/excalibur/towerInputCamera.js +480 -0
- package/lib/render/excalibur/towerInputCamera.js.map +1 -0
- package/lib/render/excalibur/towerMetro.d.ts +31 -0
- package/lib/render/excalibur/towerMetro.js +115 -0
- package/lib/render/excalibur/towerMetro.js.map +1 -0
- package/lib/render/excalibur/towerNoiseReach.d.ts +32 -0
- package/lib/render/excalibur/towerNoiseReach.js +75 -0
- package/lib/render/excalibur/towerNoiseReach.js.map +1 -0
- package/lib/render/excalibur/towerOverlay.d.ts +59 -0
- package/lib/render/excalibur/towerOverlay.js +453 -0
- package/lib/render/excalibur/towerOverlay.js.map +1 -0
- package/lib/render/excalibur/towerReconcile.d.ts +17 -0
- package/lib/render/excalibur/towerReconcile.js +404 -0
- package/lib/render/excalibur/towerReconcile.js.map +1 -0
- package/lib/render/excalibur/towerRegions.d.ts +61 -0
- package/lib/render/excalibur/towerRegions.js +193 -0
- package/lib/render/excalibur/towerRegions.js.map +1 -0
- package/lib/render/excalibur/towerScene.d.ts +66 -0
- package/lib/render/excalibur/towerScene.js +443 -0
- package/lib/render/excalibur/towerScene.js.map +1 -0
- package/lib/render/excalibur/towerScenery.d.ts +12 -0
- package/lib/render/excalibur/towerScenery.js +299 -0
- package/lib/render/excalibur/towerScenery.js.map +1 -0
- package/lib/render/excalibur/towerSceneryDraw.d.ts +86 -0
- package/lib/render/excalibur/towerSceneryDraw.js +288 -0
- package/lib/render/excalibur/towerSceneryDraw.js.map +1 -0
- package/lib/render/excalibur/towerShaftNumbers.d.ts +23 -0
- package/lib/render/excalibur/towerShaftNumbers.js +90 -0
- package/lib/render/excalibur/towerShaftNumbers.js.map +1 -0
- package/lib/render/excalibur/towerStructTiles.d.ts +56 -0
- package/lib/render/excalibur/towerStructTiles.js +238 -0
- package/lib/render/excalibur/towerStructTiles.js.map +1 -0
- package/lib/render/excalibur/towerSyncSchedule.d.ts +84 -0
- package/lib/render/excalibur/towerSyncSchedule.js +137 -0
- package/lib/render/excalibur/towerSyncSchedule.js.map +1 -0
- package/lib/render/excalibur/towerWalkerBuild.d.ts +30 -0
- package/lib/render/excalibur/towerWalkerBuild.js +126 -0
- package/lib/render/excalibur/towerWalkerBuild.js.map +1 -0
- package/lib/render/excalibur/trafficSpotlight.d.ts +29 -0
- package/lib/render/excalibur/trafficSpotlight.js +64 -0
- package/lib/render/excalibur/trafficSpotlight.js.map +1 -0
- package/lib/render/facadeGeometry.d.ts +50 -0
- package/lib/render/facadeGeometry.js +79 -0
- package/lib/render/facadeGeometry.js.map +1 -0
- package/lib/render/groundEntrances.d.ts +44 -0
- package/lib/render/groundEntrances.js +118 -0
- package/lib/render/groundEntrances.js.map +1 -0
- package/lib/render/lateNight.d.ts +14 -0
- package/lib/render/lateNight.js +18 -0
- package/lib/render/lateNight.js.map +1 -0
- package/lib/render/lobbyHalls.d.ts +44 -0
- package/lib/render/lobbyHalls.js +63 -0
- package/lib/render/lobbyHalls.js.map +1 -0
- package/lib/render/metroTrainSchedule.d.ts +20 -0
- package/lib/render/metroTrainSchedule.js +65 -0
- package/lib/render/metroTrainSchedule.js.map +1 -0
- package/lib/render/overviewMap/drawList.d.ts +67 -0
- package/lib/render/overviewMap/drawList.js +103 -0
- package/lib/render/overviewMap/drawList.js.map +1 -0
- package/lib/render/overviewMap/extent.d.ts +70 -0
- package/lib/render/overviewMap/extent.js +155 -0
- package/lib/render/overviewMap/extent.js.map +1 -0
- package/lib/render/overviewMap/floorSpans.d.ts +27 -0
- package/lib/render/overviewMap/floorSpans.js +32 -0
- package/lib/render/overviewMap/floorSpans.js.map +1 -0
- package/lib/render/overviewMap/gaps.d.ts +48 -0
- package/lib/render/overviewMap/gaps.js +148 -0
- package/lib/render/overviewMap/gaps.js.map +1 -0
- package/lib/render/overviewMap/geometry.d.ts +139 -0
- package/lib/render/overviewMap/geometry.js +245 -0
- package/lib/render/overviewMap/geometry.js.map +1 -0
- package/lib/render/overviewMap/heatView.d.ts +91 -0
- package/lib/render/overviewMap/heatView.js +143 -0
- package/lib/render/overviewMap/heatView.js.map +1 -0
- package/lib/render/overviewMap/hotelView.d.ts +82 -0
- package/lib/render/overviewMap/hotelView.js +136 -0
- package/lib/render/overviewMap/hotelView.js.map +1 -0
- package/lib/render/overviewMap/model.d.ts +97 -0
- package/lib/render/overviewMap/model.js +116 -0
- package/lib/render/overviewMap/model.js.map +1 -0
- package/lib/render/overviewMap/paint.d.ts +63 -0
- package/lib/render/overviewMap/paint.js +168 -0
- package/lib/render/overviewMap/paint.js.map +1 -0
- package/lib/render/overviewMap/style.d.ts +46 -0
- package/lib/render/overviewMap/style.js +117 -0
- package/lib/render/overviewMap/style.js.map +1 -0
- package/lib/render/overviewMap/tierView.d.ts +103 -0
- package/lib/render/overviewMap/tierView.js +209 -0
- package/lib/render/overviewMap/tierView.js.map +1 -0
- package/lib/render/overviewMap/viewMark.d.ts +69 -0
- package/lib/render/overviewMap/viewMark.js +103 -0
- package/lib/render/overviewMap/viewMark.js.map +1 -0
- package/lib/render/overviewMap/views.d.ts +24 -0
- package/lib/render/overviewMap/views.js +29 -0
- package/lib/render/overviewMap/views.js.map +1 -0
- package/lib/render/pinchTracker.d.ts +91 -0
- package/lib/render/pinchTracker.js +145 -0
- package/lib/render/pinchTracker.js.map +1 -0
- package/lib/render/pixelSprites/amusements.d.ts +32 -0
- package/lib/render/pixelSprites/amusements.js +243 -0
- package/lib/render/pixelSprites/amusements.js.map +1 -0
- package/lib/render/pixelSprites/artScale.d.ts +97 -0
- package/lib/render/pixelSprites/artScale.js +151 -0
- package/lib/render/pixelSprites/artScale.js.map +1 -0
- package/lib/render/pixelSprites/boutique.d.ts +30 -0
- package/lib/render/pixelSprites/boutique.js +244 -0
- package/lib/render/pixelSprites/boutique.js.map +1 -0
- package/lib/render/pixelSprites/clinic.d.ts +30 -0
- package/lib/render/pixelSprites/clinic.js +184 -0
- package/lib/render/pixelSprites/clinic.js.map +1 -0
- package/lib/render/pixelSprites/common.d.ts +185 -0
- package/lib/render/pixelSprites/common.js +449 -0
- package/lib/render/pixelSprites/common.js.map +1 -0
- package/lib/render/pixelSprites/daycare.d.ts +3 -0
- package/lib/render/pixelSprites/daycare.js +99 -0
- package/lib/render/pixelSprites/daycare.js.map +1 -0
- package/lib/render/pixelSprites/dollhouse.d.ts +45 -0
- package/lib/render/pixelSprites/dollhouse.js +110 -0
- package/lib/render/pixelSprites/dollhouse.js.map +1 -0
- package/lib/render/pixelSprites/fitness.d.ts +30 -0
- package/lib/render/pixelSprites/fitness.js +176 -0
- package/lib/render/pixelSprites/fitness.js.map +1 -0
- package/lib/render/pixelSprites/food.d.ts +27 -0
- package/lib/render/pixelSprites/food.interiors.d.ts +38 -0
- package/lib/render/pixelSprites/food.interiors.js +516 -0
- package/lib/render/pixelSprites/food.interiors.js.map +1 -0
- package/lib/render/pixelSprites/food.js +36 -0
- package/lib/render/pixelSprites/food.js.map +1 -0
- package/lib/render/pixelSprites/food.kit.d.ts +50 -0
- package/lib/render/pixelSprites/food.kit.js +140 -0
- package/lib/render/pixelSprites/food.kit.js.map +1 -0
- package/lib/render/pixelSprites/food.looks.d.ts +45 -0
- package/lib/render/pixelSprites/food.looks.js +56 -0
- package/lib/render/pixelSprites/food.looks.js.map +1 -0
- package/lib/render/pixelSprites/layers.d.ts +49 -0
- package/lib/render/pixelSprites/layers.js +61 -0
- package/lib/render/pixelSprites/layers.js.map +1 -0
- package/lib/render/pixelSprites/nightclub.d.ts +3 -0
- package/lib/render/pixelSprites/nightclub.js +108 -0
- package/lib/render/pixelSprites/nightclub.js.map +1 -0
- package/lib/render/pixelSprites/people.d.ts +168 -0
- package/lib/render/pixelSprites/people.js +431 -0
- package/lib/render/pixelSprites/people.js.map +1 -0
- package/lib/render/pixelSprites/residential.d.ts +5 -0
- package/lib/render/pixelSprites/residential.js +506 -0
- package/lib/render/pixelSprites/residential.js.map +1 -0
- package/lib/render/pixelSprites/residential.looks.d.ts +40 -0
- package/lib/render/pixelSprites/residential.looks.js +43 -0
- package/lib/render/pixelSprites/residential.looks.js.map +1 -0
- package/lib/render/pixelSprites/residential.roaches.d.ts +38 -0
- package/lib/render/pixelSprites/residential.roaches.js +88 -0
- package/lib/render/pixelSprites/residential.roaches.js.map +1 -0
- package/lib/render/pixelSprites/residentialRentalSprites.d.ts +11 -0
- package/lib/render/pixelSprites/residentialRentalSprites.js +19 -0
- package/lib/render/pixelSprites/residentialRentalSprites.js.map +1 -0
- package/lib/render/pixelSprites/shop.d.ts +14 -0
- package/lib/render/pixelSprites/shop.interiors.d.ts +50 -0
- package/lib/render/pixelSprites/shop.interiors.js +382 -0
- package/lib/render/pixelSprites/shop.interiors.js.map +1 -0
- package/lib/render/pixelSprites/shop.js +72 -0
- package/lib/render/pixelSprites/shop.js.map +1 -0
- package/lib/render/pixelSprites/shop.looks.d.ts +17 -0
- package/lib/render/pixelSprites/shop.looks.js +24 -0
- package/lib/render/pixelSprites/shop.looks.js.map +1 -0
- package/lib/render/pixelSprites/skyBar.d.ts +11 -0
- package/lib/render/pixelSprites/skyBar.js +125 -0
- package/lib/render/pixelSprites/skyBar.js.map +1 -0
- package/lib/render/pixelSprites/spa.d.ts +3 -0
- package/lib/render/pixelSprites/spa.js +88 -0
- package/lib/render/pixelSprites/spa.js.map +1 -0
- package/lib/render/pixelSprites.d.ts +33 -0
- package/lib/render/pixelSprites.js +167 -0
- package/lib/render/pixelSprites.js.map +1 -0
- package/lib/render/regionGrid.d.ts +49 -0
- package/lib/render/regionGrid.js +82 -0
- package/lib/render/regionGrid.js.map +1 -0
- package/lib/render/regionPaint.d.ts +15 -0
- package/lib/render/regionPaint.js +33 -0
- package/lib/render/regionPaint.js.map +1 -0
- package/lib/render/renderSim.d.ts +104 -0
- package/lib/render/renderSim.js +2 -0
- package/lib/render/renderSim.js.map +1 -0
- package/lib/render/roomPortrait.d.ts +35 -0
- package/lib/render/roomPortrait.js +142 -0
- package/lib/render/roomPortrait.js.map +1 -0
- package/lib/render/roomShading.d.ts +29 -0
- package/lib/render/roomShading.js +43 -0
- package/lib/render/roomShading.js.map +1 -0
- package/lib/render/scale.d.ts +31 -0
- package/lib/render/scale.js +34 -0
- package/lib/render/scale.js.map +1 -0
- package/lib/render/sceneryLayout.d.ts +234 -0
- package/lib/render/sceneryLayout.js +199 -0
- package/lib/render/sceneryLayout.js.map +1 -0
- package/lib/render/sprites/common.d.ts +41 -0
- package/lib/render/sprites/common.js +46 -0
- package/lib/render/sprites/common.js.map +1 -0
- package/lib/render/sprites/escalator.d.ts +27 -0
- package/lib/render/sprites/escalator.js +156 -0
- package/lib/render/sprites/escalator.js.map +1 -0
- package/lib/render/sprites/events.d.ts +56 -0
- package/lib/render/sprites/events.js +280 -0
- package/lib/render/sprites/events.js.map +1 -0
- package/lib/render/sprites/facilities/garage.d.ts +23 -0
- package/lib/render/sprites/facilities/garage.js +230 -0
- package/lib/render/sprites/facilities/garage.js.map +1 -0
- package/lib/render/sprites/facilities/recycling.d.ts +3 -0
- package/lib/render/sprites/facilities/recycling.js +210 -0
- package/lib/render/sprites/facilities/recycling.js.map +1 -0
- package/lib/render/sprites/facilities/recyclingLook.d.ts +49 -0
- package/lib/render/sprites/facilities/recyclingLook.js +52 -0
- package/lib/render/sprites/facilities/recyclingLook.js.map +1 -0
- package/lib/render/sprites/facilities/service.d.ts +14 -0
- package/lib/render/sprites/facilities/service.js +437 -0
- package/lib/render/sprites/facilities/service.js.map +1 -0
- package/lib/render/sprites/facilities/serviceKit.d.ts +61 -0
- package/lib/render/sprites/facilities/serviceKit.js +113 -0
- package/lib/render/sprites/facilities/serviceKit.js.map +1 -0
- package/lib/render/sprites/facilities/vehicles.d.ts +38 -0
- package/lib/render/sprites/facilities/vehicles.js +276 -0
- package/lib/render/sprites/facilities/vehicles.js.map +1 -0
- package/lib/render/sprites/facilities/venue.d.ts +28 -0
- package/lib/render/sprites/facilities/venue.js +211 -0
- package/lib/render/sprites/facilities/venue.js.map +1 -0
- package/lib/render/sprites/facilities/weddingHall.d.ts +9 -0
- package/lib/render/sprites/facilities/weddingHall.js +410 -0
- package/lib/render/sprites/facilities/weddingHall.js.map +1 -0
- package/lib/render/sprites/facilities.d.ts +22 -0
- package/lib/render/sprites/facilities.js +24 -0
- package/lib/render/sprites/facilities.js.map +1 -0
- package/lib/render/sprites/helicopter.d.ts +11 -0
- package/lib/render/sprites/helicopter.js +60 -0
- package/lib/render/sprites/helicopter.js.map +1 -0
- package/lib/render/sprites/sky.d.ts +67 -0
- package/lib/render/sprites/sky.js +85 -0
- package/lib/render/sprites/sky.js.map +1 -0
- package/lib/render/sprites/spiralStair.d.ts +19 -0
- package/lib/render/sprites/spiralStair.js +111 -0
- package/lib/render/sprites/spiralStair.js.map +1 -0
- package/lib/render/sprites/structure/entrance.d.ts +35 -0
- package/lib/render/sprites/structure/entrance.js +347 -0
- package/lib/render/sprites/structure/entrance.js.map +1 -0
- package/lib/render/sprites/structure/lobby.d.ts +88 -0
- package/lib/render/sprites/structure/lobby.js +350 -0
- package/lib/render/sprites/structure/lobby.js.map +1 -0
- package/lib/render/sprites/structure/revolvingDoor.d.ts +53 -0
- package/lib/render/sprites/structure/revolvingDoor.js +184 -0
- package/lib/render/sprites/structure/revolvingDoor.js.map +1 -0
- package/lib/render/sprites/structure/rooftop.d.ts +93 -0
- package/lib/render/sprites/structure/rooftop.js +302 -0
- package/lib/render/sprites/structure/rooftop.js.map +1 -0
- package/lib/render/sprites/structure/shell.d.ts +19 -0
- package/lib/render/sprites/structure/shell.js +142 -0
- package/lib/render/sprites/structure/shell.js.map +1 -0
- package/lib/render/sprites/structure/skyBridge.d.ts +28 -0
- package/lib/render/sprites/structure/skyBridge.js +259 -0
- package/lib/render/sprites/structure/skyBridge.js.map +1 -0
- package/lib/render/sprites/structure/tallLobby.d.ts +8 -0
- package/lib/render/sprites/structure/tallLobby.js +166 -0
- package/lib/render/sprites/structure/tallLobby.js.map +1 -0
- package/lib/render/sprites/structure/tallLobbyPieces.d.ts +18 -0
- package/lib/render/sprites/structure/tallLobbyPieces.js +82 -0
- package/lib/render/sprites/structure/tallLobbyPieces.js.map +1 -0
- package/lib/render/sprites/structure.d.ts +15 -0
- package/lib/render/sprites/structure.js +16 -0
- package/lib/render/sprites/structure.js.map +1 -0
- package/lib/render/sprites/transport.d.ts +30 -0
- package/lib/render/sprites/transport.js +376 -0
- package/lib/render/sprites/transport.js.map +1 -0
- package/lib/render/sprites.d.ts +16 -0
- package/lib/render/sprites.js +108 -0
- package/lib/render/sprites.js.map +1 -0
- package/lib/render/venueFlights.d.ts +61 -0
- package/lib/render/venueFlights.js +50 -0
- package/lib/render/venueFlights.js.map +1 -0
- package/lib/shared/engineTypes.d.ts +256 -0
- package/lib/shared/engineTypes.js +8 -0
- package/lib/shared/engineTypes.js.map +1 -0
- package/lib/shared/floorRuns.d.ts +22 -0
- package/lib/shared/floorRuns.js +39 -0
- package/lib/shared/floorRuns.js.map +1 -0
- package/lib/shared/inputEvents.d.ts +18 -0
- package/lib/shared/inputEvents.js +23 -0
- package/lib/shared/inputEvents.js.map +1 -0
- package/lib/shared/serializedGame.d.ts +142 -0
- package/lib/shared/serializedGame.js +2 -0
- package/lib/shared/serializedGame.js.map +1 -0
- package/lib/shared/types.d.ts +298 -0
- package/lib/shared/types.js +47 -0
- package/lib/shared/types.js.map +1 -0
- package/lib/shared/unitState.d.ts +36 -0
- package/lib/shared/unitState.js +42 -0
- package/lib/shared/unitState.js.map +1 -0
- package/lib/shared/vacateReasonText.d.ts +20 -0
- package/lib/shared/vacateReasonText.js +23 -0
- package/lib/shared/vacateReasonText.js.map +1 -0
- package/lib/shared/viewZoom.d.ts +14 -0
- package/lib/shared/viewZoom.js +17 -0
- package/lib/shared/viewZoom.js.map +1 -0
- package/lib/shared/wellFormed.d.ts +14 -0
- package/lib/shared/wellFormed.js +19 -0
- package/lib/shared/wellFormed.js.map +1 -0
- package/lib/simport/cards.d.ts +26 -0
- package/lib/simport/cards.js +138 -0
- package/lib/simport/cards.js.map +1 -0
- package/lib/simport/clockView.d.ts +24 -0
- package/lib/simport/clockView.js +43 -0
- package/lib/simport/clockView.js.map +1 -0
- package/lib/simport/commands.d.ts +215 -0
- package/lib/simport/commands.js +2 -0
- package/lib/simport/commands.js.map +1 -0
- package/lib/simport/emergencyReads.d.ts +19 -0
- package/lib/simport/emergencyReads.js +47 -0
- package/lib/simport/emergencyReads.js.map +1 -0
- package/lib/simport/enginePort.d.ts +433 -0
- package/lib/simport/enginePort.js +11 -0
- package/lib/simport/enginePort.js.map +1 -0
- package/lib/simport/fixtures/catalog.classic.json +2137 -0
- package/lib/simport/fixtures/catalog.modern.json +2515 -0
- package/lib/simport/fixtures/viewLayout.json +927 -0
- package/lib/simport/headerClock.d.ts +31 -0
- package/lib/simport/headerClock.js +29 -0
- package/lib/simport/headerClock.js.map +1 -0
- package/lib/simport/panels.d.ts +243 -0
- package/lib/simport/panels.js +2 -0
- package/lib/simport/panels.js.map +1 -0
- package/lib/simport/personCards.d.ts +63 -0
- package/lib/simport/personCards.js +55 -0
- package/lib/simport/personCards.js.map +1 -0
- package/lib/simport/portCodes.d.ts +41 -0
- package/lib/simport/portCodes.js +49 -0
- package/lib/simport/portCodes.js.map +1 -0
- package/lib/simport/portEvents.d.ts +39 -0
- package/lib/simport/portEvents.js +43 -0
- package/lib/simport/portEvents.js.map +1 -0
- package/lib/simport/portRenderSim.d.ts +70 -0
- package/lib/simport/portRenderSim.js +129 -0
- package/lib/simport/portRenderSim.js.map +1 -0
- package/lib/simport/queries.d.ts +64 -0
- package/lib/simport/queries.js +30 -0
- package/lib/simport/queries.js.map +1 -0
- package/lib/simport/recyclingPort.d.ts +13 -0
- package/lib/simport/recyclingPort.js +2 -0
- package/lib/simport/recyclingPort.js.map +1 -0
- package/lib/simport/request.d.ts +44 -0
- package/lib/simport/request.js +214 -0
- package/lib/simport/request.js.map +1 -0
- package/lib/simport/roomTiers.d.ts +102 -0
- package/lib/simport/roomTiers.js +122 -0
- package/lib/simport/roomTiers.js.map +1 -0
- package/lib/simport/scheduleSlots.d.ts +19 -0
- package/lib/simport/scheduleSlots.js +87 -0
- package/lib/simport/scheduleSlots.js.map +1 -0
- package/lib/simport/skyBridgePort.d.ts +20 -0
- package/lib/simport/skyBridgePort.js +2 -0
- package/lib/simport/skyBridgePort.js.map +1 -0
- package/lib/simport/skyBridgeView.d.ts +15 -0
- package/lib/simport/skyBridgeView.js +42 -0
- package/lib/simport/skyBridgeView.js.map +1 -0
- package/lib/simport/statsSheet.d.ts +15 -0
- package/lib/simport/statsSheet.js +101 -0
- package/lib/simport/statsSheet.js.map +1 -0
- package/lib/simport/tdtRecords.d.ts +9 -0
- package/lib/simport/tdtRecords.js +112 -0
- package/lib/simport/tdtRecords.js.map +1 -0
- package/lib/simport/tdtReportFacts.d.ts +110 -0
- package/lib/simport/tdtReportFacts.js +8 -0
- package/lib/simport/tdtReportFacts.js.map +1 -0
- package/lib/simport/trafficPort.d.ts +22 -0
- package/lib/simport/trafficPort.js +2 -0
- package/lib/simport/trafficPort.js.map +1 -0
- package/lib/simport/view.d.ts +275 -0
- package/lib/simport/view.js +2 -0
- package/lib/simport/view.js.map +1 -0
- package/lib/simport/viewReader.d.ts +89 -0
- package/lib/simport/viewReader.js +426 -0
- package/lib/simport/viewReader.js.map +1 -0
- package/lib/styles/game/appearance.css +108 -0
- package/lib/styles/game/base.css +68 -0
- package/lib/styles/game/components.css +69 -0
- package/lib/styles/game/desk-title.css +183 -0
- package/lib/styles/game/desk.css +487 -0
- package/lib/styles/game/dialogs.css +360 -0
- package/lib/styles/game/editor-sidebar.css +116 -0
- package/lib/styles/game/elevator-schedule.css +217 -0
- package/lib/styles/game/file-dialog.css +470 -0
- package/lib/styles/game/help.css +141 -0
- package/lib/styles/game/launch-fireworks.css +17 -0
- package/lib/styles/game/media-landscape.css +333 -0
- package/lib/styles/game/media-phone.css +303 -0
- package/lib/styles/game/media-tablet-touch.css +177 -0
- package/lib/styles/game/menubar.css +158 -0
- package/lib/styles/game/new-tower.css +219 -0
- package/lib/styles/game/onboarding.css +32 -0
- package/lib/styles/game/screen-saver.css +85 -0
- package/lib/styles/game/splash.css +413 -0
- package/lib/styles/game/stats-saves.css +106 -0
- package/lib/styles/game/tools-stage.css +340 -0
- package/lib/styles/game/topbar.css +191 -0
- package/lib/styles/menu-bar.css +108 -0
- package/lib/styles/not-found.css +335 -0
- package/lib/styles/overview-map-views.css +88 -0
- package/lib/styles/overview-map.css +195 -0
- package/lib/styles/retro-components.css +179 -0
- package/lib/styles/retro-page.css +254 -0
- package/lib/styles/retro-tokens.css +122 -0
- package/lib/styles/schemes/high-contrast.css +173 -0
- package/lib/styles/schemes/skyline.css +134 -0
- package/lib/styles.css +66 -0
- package/lib/ui/desk/deskGeometry.d.ts +59 -0
- package/lib/ui/desk/deskGeometry.js +106 -0
- package/lib/ui/desk/deskGeometry.js.map +1 -0
- package/lib/ui/desk/deskWindow.d.ts +90 -0
- package/lib/ui/desk/deskWindow.js +253 -0
- package/lib/ui/desk/deskWindow.js.map +1 -0
- package/lib/ui/desk/deskWindowMenu.d.ts +55 -0
- package/lib/ui/desk/deskWindowMenu.js +143 -0
- package/lib/ui/desk/deskWindowMenu.js.map +1 -0
- package/lib/ui/escape.d.ts +1 -0
- package/lib/ui/escape.js +14 -0
- package/lib/ui/escape.js.map +1 -0
- package/lib/ui/format.d.ts +14 -0
- package/lib/ui/format.js +36 -0
- package/lib/ui/format.js.map +1 -0
- package/lib/ui/iconPaths.generated.d.ts +4 -0
- package/lib/ui/iconPaths.generated.js +68 -0
- package/lib/ui/iconPaths.generated.js.map +1 -0
- package/lib/ui/icons.d.ts +83 -0
- package/lib/ui/icons.js +156 -0
- package/lib/ui/icons.js.map +1 -0
- package/lib/ui/menuBar.d.ts +94 -0
- package/lib/ui/menuBar.js +361 -0
- package/lib/ui/menuBar.js.map +1 -0
- package/lib/ui/modalPrecedence.d.ts +108 -0
- package/lib/ui/modalPrecedence.js +165 -0
- package/lib/ui/modalPrecedence.js.map +1 -0
- package/lib/ui/movableWindow.d.ts +124 -0
- package/lib/ui/movableWindow.js +247 -0
- package/lib/ui/movableWindow.js.map +1 -0
- package/lib/ui/overviewMapInput.d.ts +109 -0
- package/lib/ui/overviewMapInput.js +135 -0
- package/lib/ui/overviewMapInput.js.map +1 -0
- package/lib/ui/uiModal.d.ts +38 -0
- package/lib/ui/uiModal.js +70 -0
- package/lib/ui/uiModal.js.map +1 -0
- package/lib/wasmhost/buildSection.d.ts +54 -0
- package/lib/wasmhost/buildSection.js +143 -0
- package/lib/wasmhost/buildSection.js.map +1 -0
- package/lib/wasmhost/catalogCheck.d.ts +11 -0
- package/lib/wasmhost/catalogCheck.js +43 -0
- package/lib/wasmhost/catalogCheck.js.map +1 -0
- package/lib/wasmhost/engineAssets.d.ts +57 -0
- package/lib/wasmhost/engineAssets.js +63 -0
- package/lib/wasmhost/engineAssets.js.map +1 -0
- package/lib/wasmhost/engineBoot.d.ts +165 -0
- package/lib/wasmhost/engineBoot.js +254 -0
- package/lib/wasmhost/engineBoot.js.map +1 -0
- package/lib/wasmhost/engineChoice.d.ts +6 -0
- package/lib/wasmhost/engineChoice.js +2 -0
- package/lib/wasmhost/engineChoice.js.map +1 -0
- package/lib/wasmhost/engineDiagnostics.d.ts +66 -0
- package/lib/wasmhost/engineDiagnostics.js +189 -0
- package/lib/wasmhost/engineDiagnostics.js.map +1 -0
- package/lib/wasmhost/engineDiagnosticsLive.d.ts +15 -0
- package/lib/wasmhost/engineDiagnosticsLive.js +31 -0
- package/lib/wasmhost/engineDiagnosticsLive.js.map +1 -0
- package/lib/wasmhost/engineIdentity.d.ts +30 -0
- package/lib/wasmhost/engineIdentity.js +59 -0
- package/lib/wasmhost/engineIdentity.js.map +1 -0
- package/lib/wasmhost/engineLabel.d.ts +40 -0
- package/lib/wasmhost/engineLabel.js +50 -0
- package/lib/wasmhost/engineLabel.js.map +1 -0
- package/lib/wasmhost/engineLoad.d.ts +48 -0
- package/lib/wasmhost/engineLoad.js +53 -0
- package/lib/wasmhost/engineLoad.js.map +1 -0
- package/lib/wasmhost/enginePackageCheck.d.ts +77 -0
- package/lib/wasmhost/enginePackageCheck.js +274 -0
- package/lib/wasmhost/enginePackageCheck.js.map +1 -0
- package/lib/wasmhost/enginePackageNames.d.ts +25 -0
- package/lib/wasmhost/enginePackageNames.js +28 -0
- package/lib/wasmhost/enginePackageNames.js.map +1 -0
- package/lib/wasmhost/enginePackageRecord.d.ts +78 -0
- package/lib/wasmhost/enginePackageRecord.js +108 -0
- package/lib/wasmhost/enginePackageRecord.js.map +1 -0
- package/lib/wasmhost/engineRepair.d.ts +55 -0
- package/lib/wasmhost/engineRepair.js +183 -0
- package/lib/wasmhost/engineRepair.js.map +1 -0
- package/lib/wasmhost/frameView.d.ts +87 -0
- package/lib/wasmhost/frameView.js +133 -0
- package/lib/wasmhost/frameView.js.map +1 -0
- package/lib/wasmhost/hostFault.d.ts +40 -0
- package/lib/wasmhost/hostFault.js +94 -0
- package/lib/wasmhost/hostFault.js.map +1 -0
- package/lib/wasmhost/loadEngineModule.d.ts +79 -0
- package/lib/wasmhost/loadEngineModule.js +66 -0
- package/lib/wasmhost/loadEngineModule.js.map +1 -0
- package/lib/wasmhost/packageHash.d.ts +48 -0
- package/lib/wasmhost/packageHash.js +436 -0
- package/lib/wasmhost/packageHash.js.map +1 -0
- package/lib/wasmhost/rustEngine.d.ts +49 -0
- package/lib/wasmhost/rustEngine.js +63 -0
- package/lib/wasmhost/rustEngine.js.map +1 -0
- package/lib/wasmhost/slotPopulation.d.ts +19 -0
- package/lib/wasmhost/slotPopulation.js +69 -0
- package/lib/wasmhost/slotPopulation.js.map +1 -0
- package/lib/wasmhost/telemetry.d.ts +31 -0
- package/lib/wasmhost/telemetry.js +13 -0
- package/lib/wasmhost/telemetry.js.map +1 -0
- package/package.json +80 -4
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { moverOf, MovableWindow, WITHIN_PARENT } from '../movableWindow.js';
|
|
2
|
+
import { resizedTo } from './deskGeometry.js';
|
|
3
|
+
|
|
4
|
+
/** The class a minimized window wears: hidden but still laid out, so the
|
|
5
|
+
* tower's canvas keeps its size while the window sits on the taskbar. */
|
|
6
|
+
const DESK_MINIMIZED_CLASS = "desk-minimized";
|
|
7
|
+
/** The class a maximized window wears. */
|
|
8
|
+
const DESK_MAXIMIZED_CLASS = "desk-maximized";
|
|
9
|
+
/** The class the window that has the focus wears. */
|
|
10
|
+
const DESK_ACTIVE_CLASS = "desk-active";
|
|
11
|
+
/** The glyphs of the title bar's buttons, drawn in pixels like the 1995 ones. */
|
|
12
|
+
const GLYPH = {
|
|
13
|
+
min: '<svg width="10" height="9" viewBox="0 0 10 9" shape-rendering="crispEdges" aria-hidden="true"><rect x="2" y="7" width="6" height="2"/></svg>',
|
|
14
|
+
max: '<svg width="9" height="9" viewBox="0 0 9 9" shape-rendering="crispEdges" aria-hidden="true"><path d="M0 0h9v9H0zM1 2v6h7V2z" fill-rule="evenodd"/></svg>',
|
|
15
|
+
restore: '<svg width="9" height="9" viewBox="0 0 9 9" shape-rendering="crispEdges" aria-hidden="true"><path d="M2 0h7v6H7V2H2zM0 3h7v6H0zM1 5v3h5V5z" fill-rule="evenodd"/></svg>',
|
|
16
|
+
close: '<svg width="8" height="7" viewBox="0 0 8 7" shape-rendering="crispEdges" aria-hidden="true"><path d="M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1H5v1h1v1h1v1h1v1H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0z"/></svg>',
|
|
17
|
+
};
|
|
18
|
+
/** A title-bar button with a pixel glyph. */
|
|
19
|
+
function titleButton(doc, kind, label) {
|
|
20
|
+
const b = doc.createElement("button");
|
|
21
|
+
b.type = "button";
|
|
22
|
+
b.className = `btn xs desk-btn desk-btn-${kind}`;
|
|
23
|
+
b.setAttribute("aria-label", label);
|
|
24
|
+
b.title = label;
|
|
25
|
+
b.innerHTML = GLYPH[kind];
|
|
26
|
+
return b;
|
|
27
|
+
}
|
|
28
|
+
/** The Verticopolis icon at the left of a desk window's title bar. */
|
|
29
|
+
function titleIcon(doc) {
|
|
30
|
+
const icon = doc.createElement("img");
|
|
31
|
+
icon.className = "desk-title-icon";
|
|
32
|
+
icon.src = "./favicon.png";
|
|
33
|
+
icon.alt = "";
|
|
34
|
+
icon.width = 16;
|
|
35
|
+
icon.height = 16;
|
|
36
|
+
return icon;
|
|
37
|
+
}
|
|
38
|
+
/** Build a frame for content that has no window of its own (the tower, Info):
|
|
39
|
+
* a `.win` with the game's title bar and an empty body. */
|
|
40
|
+
function buildFrame(doc, id, title) {
|
|
41
|
+
const root = doc.createElement("section");
|
|
42
|
+
root.id = id;
|
|
43
|
+
root.className = "win win-closable desk-win desk-frame";
|
|
44
|
+
const bar = doc.createElement("div");
|
|
45
|
+
bar.className = "win-title";
|
|
46
|
+
const icon = titleIcon(doc);
|
|
47
|
+
const titleText = doc.createElement("span");
|
|
48
|
+
titleText.className = "desk-title-text";
|
|
49
|
+
titleText.id = `${id}-title`;
|
|
50
|
+
titleText.textContent = title;
|
|
51
|
+
bar.append(icon, titleText);
|
|
52
|
+
const body = doc.createElement("div");
|
|
53
|
+
body.className = "desk-body";
|
|
54
|
+
root.setAttribute("aria-labelledby", titleText.id);
|
|
55
|
+
root.append(bar, body);
|
|
56
|
+
return { root, body, titleText };
|
|
57
|
+
}
|
|
58
|
+
class DeskWindow {
|
|
59
|
+
constructor(spec) {
|
|
60
|
+
this.spec = spec;
|
|
61
|
+
this.minimized = false;
|
|
62
|
+
this.maximized = false;
|
|
63
|
+
this.before = null;
|
|
64
|
+
this.added = [];
|
|
65
|
+
this.ownMover = null;
|
|
66
|
+
/** Stops hearing the moves of a window the game moves itself. */
|
|
67
|
+
this.unhear = null;
|
|
68
|
+
this.maxButton = null;
|
|
69
|
+
this.onPress = () => this.spec.pressed();
|
|
70
|
+
const { el } = spec;
|
|
71
|
+
const doc = el.ownerDocument;
|
|
72
|
+
el.classList.add("desk-win");
|
|
73
|
+
const bar = el.querySelector(":scope > .win-title");
|
|
74
|
+
if (bar) {
|
|
75
|
+
// The game's own windows wear the desk's icon too, while on the desk.
|
|
76
|
+
if (!bar.querySelector(":scope > .desk-title-icon")) {
|
|
77
|
+
const icon = titleIcon(doc);
|
|
78
|
+
this.added.push(icon);
|
|
79
|
+
bar.prepend(icon);
|
|
80
|
+
}
|
|
81
|
+
// Minimize and maximize go before the window's own ✕, as in 1995.
|
|
82
|
+
const close = bar.querySelector(":scope > .btn.xs:not(.desk-btn), :scope > .desk-btn-close");
|
|
83
|
+
const min = titleButton(doc, "min", `Minimize ${spec.label()}`);
|
|
84
|
+
min.addEventListener("click", () => this.minimize());
|
|
85
|
+
this.added.push(min);
|
|
86
|
+
bar.insertBefore(min, close);
|
|
87
|
+
if (spec.canMax) {
|
|
88
|
+
const max = titleButton(doc, "max", `Maximize ${spec.label()}`);
|
|
89
|
+
max.addEventListener("click", () => this.toggleMax());
|
|
90
|
+
this.maxButton = max;
|
|
91
|
+
this.added.push(max);
|
|
92
|
+
bar.insertBefore(max, close);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (spec.limits) {
|
|
96
|
+
const grip = doc.createElement("div");
|
|
97
|
+
grip.className = "desk-grip";
|
|
98
|
+
grip.setAttribute("aria-hidden", "true");
|
|
99
|
+
el.appendChild(grip);
|
|
100
|
+
this.added.push(grip);
|
|
101
|
+
this.wireGrip(grip);
|
|
102
|
+
}
|
|
103
|
+
// The small windows already move by their title bars; the desk's own
|
|
104
|
+
// frames and Tools get a mover here. Either way it moves inside the desk.
|
|
105
|
+
const gameMover = moverOf(el);
|
|
106
|
+
if (gameMover)
|
|
107
|
+
this.unhear = gameMover.hear(() => spec.changed("move"));
|
|
108
|
+
else {
|
|
109
|
+
this.ownMover = new MovableWindow({
|
|
110
|
+
win: el,
|
|
111
|
+
title: `#${el.id} > .win-title`,
|
|
112
|
+
within: WITHIN_PARENT,
|
|
113
|
+
placed: () => spec.changed("move"),
|
|
114
|
+
doubleClick: () => (spec.canMax ? this.toggleMax() : undefined),
|
|
115
|
+
canMove: () => !this.maximized,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
el.addEventListener("pointerdown", this.onPress, true);
|
|
119
|
+
}
|
|
120
|
+
/** The window's place and size now, in desk pixels. */
|
|
121
|
+
rect() {
|
|
122
|
+
const el = this.spec.el;
|
|
123
|
+
if (this.maximized && this.before)
|
|
124
|
+
return this.before;
|
|
125
|
+
return { x: el.offsetLeft, y: el.offsetTop, w: el.offsetWidth, h: el.offsetHeight };
|
|
126
|
+
}
|
|
127
|
+
/** Put the window at `rect`; a fixed-size window takes the corner only. */
|
|
128
|
+
place(rect) {
|
|
129
|
+
const el = this.spec.el;
|
|
130
|
+
if (this.spec.limits) {
|
|
131
|
+
if (!this.spec.heightOnly)
|
|
132
|
+
el.style.width = `${rect.w}px`;
|
|
133
|
+
el.style.height = `${rect.h}px`;
|
|
134
|
+
}
|
|
135
|
+
const mover = moverOf(el);
|
|
136
|
+
if (mover)
|
|
137
|
+
mover.moveTo({ x: rect.x, y: rect.y });
|
|
138
|
+
else {
|
|
139
|
+
el.style.left = `${rect.x}px`;
|
|
140
|
+
el.style.top = `${rect.y}px`;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
minimize() {
|
|
144
|
+
if (this.minimized)
|
|
145
|
+
return;
|
|
146
|
+
this.minimized = true;
|
|
147
|
+
this.spec.el.classList.add(DESK_MINIMIZED_CLASS);
|
|
148
|
+
this.spec.changed("min");
|
|
149
|
+
}
|
|
150
|
+
restore() {
|
|
151
|
+
if (!this.minimized)
|
|
152
|
+
return;
|
|
153
|
+
this.minimized = false;
|
|
154
|
+
this.spec.el.classList.remove(DESK_MINIMIZED_CLASS);
|
|
155
|
+
this.spec.changed("restore");
|
|
156
|
+
}
|
|
157
|
+
toggleMax() {
|
|
158
|
+
if (!this.spec.canMax)
|
|
159
|
+
return;
|
|
160
|
+
const el = this.spec.el;
|
|
161
|
+
if (!this.maximized) {
|
|
162
|
+
this.before = this.rect();
|
|
163
|
+
this.maximized = true;
|
|
164
|
+
moverOf(el)?.reset();
|
|
165
|
+
el.classList.add(DESK_MAXIMIZED_CLASS);
|
|
166
|
+
Object.assign(el.style, { left: "0px", top: "0px", width: "100%", height: "100%" });
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
const back = this.before;
|
|
170
|
+
this.maximized = false;
|
|
171
|
+
this.before = null;
|
|
172
|
+
el.classList.remove(DESK_MAXIMIZED_CLASS);
|
|
173
|
+
if (back)
|
|
174
|
+
this.place(back);
|
|
175
|
+
}
|
|
176
|
+
if (this.maxButton) {
|
|
177
|
+
const label = `${this.maximized ? "Restore" : "Maximize"} ${this.spec.label()}`;
|
|
178
|
+
this.maxButton.innerHTML = GLYPH[this.maximized ? "restore" : "max"];
|
|
179
|
+
this.maxButton.setAttribute("aria-label", label);
|
|
180
|
+
this.maxButton.title = label;
|
|
181
|
+
}
|
|
182
|
+
this.spec.changed(this.maximized ? "max" : "unmax");
|
|
183
|
+
}
|
|
184
|
+
/** Take the desk's additions off and give the window back to the game's
|
|
185
|
+
* own layout (the phone, the title screen, or the desk turned off). */
|
|
186
|
+
dispose() {
|
|
187
|
+
const el = this.spec.el;
|
|
188
|
+
el.removeEventListener("pointerdown", this.onPress, true);
|
|
189
|
+
for (const a of this.added)
|
|
190
|
+
a.remove();
|
|
191
|
+
this.ownMover?.dispose();
|
|
192
|
+
this.unhear?.();
|
|
193
|
+
moverOf(el)?.reset();
|
|
194
|
+
el.classList.remove("desk-win", DESK_MINIMIZED_CLASS, DESK_MAXIMIZED_CLASS, DESK_ACTIVE_CLASS);
|
|
195
|
+
el.style.removeProperty("width");
|
|
196
|
+
el.style.removeProperty("height");
|
|
197
|
+
el.style.removeProperty("z-index");
|
|
198
|
+
el.style.removeProperty("left");
|
|
199
|
+
el.style.removeProperty("top");
|
|
200
|
+
}
|
|
201
|
+
/** The size grip: a dotted outline follows the pointer and the window takes
|
|
202
|
+
* the size on release. */
|
|
203
|
+
wireGrip(grip) {
|
|
204
|
+
const limits = this.spec.limits;
|
|
205
|
+
if (!limits)
|
|
206
|
+
return;
|
|
207
|
+
grip.addEventListener("pointerdown", (e) => {
|
|
208
|
+
if (e.button !== 0 || this.maximized)
|
|
209
|
+
return;
|
|
210
|
+
e.preventDefault();
|
|
211
|
+
e.stopPropagation();
|
|
212
|
+
const el = this.spec.el;
|
|
213
|
+
const desk = el.parentElement;
|
|
214
|
+
if (!desk)
|
|
215
|
+
return;
|
|
216
|
+
try {
|
|
217
|
+
grip.setPointerCapture(e.pointerId);
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
/* the outline still follows while the pointer stays over the grip */
|
|
221
|
+
}
|
|
222
|
+
const start = this.rect();
|
|
223
|
+
const sx = e.clientX;
|
|
224
|
+
const sy = e.clientY;
|
|
225
|
+
const outline = el.ownerDocument.createElement("div");
|
|
226
|
+
outline.className = "desk-outline";
|
|
227
|
+
desk.appendChild(outline);
|
|
228
|
+
let next = start;
|
|
229
|
+
const draw = (r) => Object.assign(outline.style, { left: `${r.x}px`, top: `${r.y}px`, width: `${r.w}px`, height: `${r.h}px` });
|
|
230
|
+
draw(start);
|
|
231
|
+
const move = (ev) => {
|
|
232
|
+
next = resizedTo(start, ev.clientX - sx, ev.clientY - sy, limits, desk.clientWidth, desk.clientHeight, !!this.spec.heightOnly);
|
|
233
|
+
draw(next);
|
|
234
|
+
};
|
|
235
|
+
const end = () => {
|
|
236
|
+
grip.removeEventListener("pointermove", move);
|
|
237
|
+
grip.removeEventListener("pointerup", end);
|
|
238
|
+
grip.removeEventListener("pointercancel", end);
|
|
239
|
+
outline.remove();
|
|
240
|
+
if (next.w === start.w && next.h === start.h)
|
|
241
|
+
return;
|
|
242
|
+
this.place(next);
|
|
243
|
+
this.spec.changed("resize");
|
|
244
|
+
};
|
|
245
|
+
grip.addEventListener("pointermove", move);
|
|
246
|
+
grip.addEventListener("pointerup", end);
|
|
247
|
+
grip.addEventListener("pointercancel", end);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export { DESK_ACTIVE_CLASS, DESK_MAXIMIZED_CLASS, DESK_MINIMIZED_CLASS, DeskWindow, buildFrame, titleButton };
|
|
253
|
+
//# sourceMappingURL=deskWindow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deskWindow.js","sources":["../../../src/ui/desk/deskWindow.ts"],"sourcesContent":["import { MovableWindow, WITHIN_PARENT, moverOf } from \"../movableWindow\";\nimport { resizedTo, type DeskRect, type DeskWindowId, type SizeLimits } from \"./deskGeometry\";\n\n/**\n * One window on the 1994 desk (option C, owner 2026-11-15): the tower, Info,\n * Tools, the Map, the Bulletin or Tower Info. The desk either builds the\n * window's frame (the tower and Info have none of their own) or takes over a\n * window the game already draws with its own title bar (Tools and the small\n * windows), and then adds what a 1995 window has: minimize, maximize where it\n * is allowed, a size grip where it may resize, and the focus that turns its\n * title bar navy.\n *\n * Cost: nothing runs per frame. A move writes two styles per pointer move (the\n * game's MovableWindow); a resize draws a dotted outline and sets the size\n * once on release, so the tower's canvas resizes once per resize.\n */\n\n/** What the desk tells a window it needs. */\nexport interface DeskWindowSpec {\n readonly id: DeskWindowId;\n /** The window element: a frame the desk built, or the game's own window. */\n readonly el: HTMLElement;\n /** The name on its taskbar button and in its buttons' labels. */\n readonly label: () => string;\n /** The tower sits below the small windows, so they stay on top of it even\n * when it is maximized; the small windows stack among themselves. */\n readonly layer: \"app\" | \"tool\";\n /** The resize limits, or null for a window of one size. */\n readonly limits: SizeLimits | null;\n /** Tools grows in height only. */\n readonly heightOnly?: boolean;\n readonly canMax: boolean;\n /** Whether the game has the window open (a closed window has no taskbar\n * button). The game decides: the Map's ✕, Tower > Bulletin and the rest. */\n readonly isOpen: () => boolean;\n /** Open it the game's own way (Options > Map and the rest); absent for a\n * window that is always open on the desk (the tower, Info, Tools). */\n readonly open?: () => void;\n /** Close it the game's own way (its ✕, File > Close); absent for a window\n * the desk never closes (Info, Tools). */\n readonly close?: () => void;\n /** Heard after a move, a resize, a minimize or a maximize. */\n readonly changed: (what: DeskChange) => void;\n /** Heard on a press anywhere in the window. */\n readonly pressed: () => void;\n}\n\n/** What a window just did, for the taskbar, the saved layout and analytics. */\nexport type DeskChange = \"move\" | \"resize\" | \"min\" | \"restore\" | \"max\" | \"unmax\";\n\n/** The class a minimized window wears: hidden but still laid out, so the\n * tower's canvas keeps its size while the window sits on the taskbar. */\nexport const DESK_MINIMIZED_CLASS = \"desk-minimized\";\n/** The class a maximized window wears. */\nexport const DESK_MAXIMIZED_CLASS = \"desk-maximized\";\n/** The class the window that has the focus wears. */\nexport const DESK_ACTIVE_CLASS = \"desk-active\";\n\n/** The glyphs of the title bar's buttons, drawn in pixels like the 1995 ones. */\nconst GLYPH: Record<\"min\" | \"max\" | \"restore\" | \"close\", string> = {\n min: '<svg width=\"10\" height=\"9\" viewBox=\"0 0 10 9\" shape-rendering=\"crispEdges\" aria-hidden=\"true\"><rect x=\"2\" y=\"7\" width=\"6\" height=\"2\"/></svg>',\n max: '<svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" shape-rendering=\"crispEdges\" aria-hidden=\"true\"><path d=\"M0 0h9v9H0zM1 2v6h7V2z\" fill-rule=\"evenodd\"/></svg>',\n restore: '<svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" shape-rendering=\"crispEdges\" aria-hidden=\"true\"><path d=\"M2 0h7v6H7V2H2zM0 3h7v6H0zM1 5v3h5V5z\" fill-rule=\"evenodd\"/></svg>',\n close: '<svg width=\"8\" height=\"7\" viewBox=\"0 0 8 7\" shape-rendering=\"crispEdges\" aria-hidden=\"true\"><path d=\"M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1H5v1h1v1h1v1h1v1H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0z\"/></svg>',\n};\n\n/** A title-bar button with a pixel glyph. */\nexport function titleButton(doc: Document, kind: keyof typeof GLYPH, label: string): HTMLButtonElement {\n const b = doc.createElement(\"button\");\n b.type = \"button\";\n b.className = `btn xs desk-btn desk-btn-${kind}`;\n b.setAttribute(\"aria-label\", label);\n b.title = label;\n b.innerHTML = GLYPH[kind];\n return b;\n}\n\n/** The Verticopolis icon at the left of a desk window's title bar. */\nfunction titleIcon(doc: Document): HTMLImageElement {\n const icon = doc.createElement(\"img\");\n icon.className = \"desk-title-icon\";\n icon.src = \"./favicon.png\";\n icon.alt = \"\";\n icon.width = 16;\n icon.height = 16;\n return icon;\n}\n\n/** Build a frame for content that has no window of its own (the tower, Info):\n * a `.win` with the game's title bar and an empty body. */\nexport function buildFrame(doc: Document, id: string, title: string): { root: HTMLElement; body: HTMLElement; titleText: HTMLElement } {\n const root = doc.createElement(\"section\");\n root.id = id;\n root.className = \"win win-closable desk-win desk-frame\";\n const bar = doc.createElement(\"div\");\n bar.className = \"win-title\";\n const icon = titleIcon(doc);\n const titleText = doc.createElement(\"span\");\n titleText.className = \"desk-title-text\";\n titleText.id = `${id}-title`;\n titleText.textContent = title;\n bar.append(icon, titleText);\n const body = doc.createElement(\"div\");\n body.className = \"desk-body\";\n root.setAttribute(\"aria-labelledby\", titleText.id);\n root.append(bar, body);\n return { root, body, titleText };\n}\n\nexport class DeskWindow {\n minimized = false;\n maximized = false;\n private before: DeskRect | null = null;\n private readonly added: HTMLElement[] = [];\n private readonly ownMover: MovableWindow | null = null;\n /** Stops hearing the moves of a window the game moves itself. */\n private readonly unhear: (() => void) | null = null;\n private readonly maxButton: HTMLButtonElement | null = null;\n\n constructor(readonly spec: DeskWindowSpec) {\n const { el } = spec;\n const doc = el.ownerDocument;\n el.classList.add(\"desk-win\");\n const bar = el.querySelector<HTMLElement>(\":scope > .win-title\");\n if (bar) {\n // The game's own windows wear the desk's icon too, while on the desk.\n if (!bar.querySelector(\":scope > .desk-title-icon\")) {\n const icon = titleIcon(doc);\n this.added.push(icon);\n bar.prepend(icon);\n }\n // Minimize and maximize go before the window's own ✕, as in 1995.\n const close = bar.querySelector<HTMLElement>(\":scope > .btn.xs:not(.desk-btn), :scope > .desk-btn-close\");\n const min = titleButton(doc, \"min\", `Minimize ${spec.label()}`);\n min.addEventListener(\"click\", () => this.minimize());\n this.added.push(min);\n bar.insertBefore(min, close);\n if (spec.canMax) {\n const max = titleButton(doc, \"max\", `Maximize ${spec.label()}`);\n max.addEventListener(\"click\", () => this.toggleMax());\n this.maxButton = max;\n this.added.push(max);\n bar.insertBefore(max, close);\n }\n }\n if (spec.limits) {\n const grip = doc.createElement(\"div\");\n grip.className = \"desk-grip\";\n grip.setAttribute(\"aria-hidden\", \"true\");\n el.appendChild(grip);\n this.added.push(grip);\n this.wireGrip(grip);\n }\n // The small windows already move by their title bars; the desk's own\n // frames and Tools get a mover here. Either way it moves inside the desk.\n const gameMover = moverOf(el);\n if (gameMover) this.unhear = gameMover.hear(() => spec.changed(\"move\"));\n else {\n this.ownMover = new MovableWindow({\n win: el,\n title: `#${el.id} > .win-title`,\n within: WITHIN_PARENT,\n placed: () => spec.changed(\"move\"),\n doubleClick: () => (spec.canMax ? this.toggleMax() : undefined),\n canMove: () => !this.maximized,\n });\n }\n el.addEventListener(\"pointerdown\", this.onPress, true);\n }\n\n private readonly onPress = () => this.spec.pressed();\n\n /** The window's place and size now, in desk pixels. */\n rect(): DeskRect {\n const el = this.spec.el;\n if (this.maximized && this.before) return this.before;\n return { x: el.offsetLeft, y: el.offsetTop, w: el.offsetWidth, h: el.offsetHeight };\n }\n\n /** Put the window at `rect`; a fixed-size window takes the corner only. */\n place(rect: DeskRect): void {\n const el = this.spec.el;\n if (this.spec.limits) {\n if (!this.spec.heightOnly) el.style.width = `${rect.w}px`;\n el.style.height = `${rect.h}px`;\n }\n const mover = moverOf(el);\n if (mover) mover.moveTo({ x: rect.x, y: rect.y });\n else {\n el.style.left = `${rect.x}px`;\n el.style.top = `${rect.y}px`;\n }\n }\n\n minimize(): void {\n if (this.minimized) return;\n this.minimized = true;\n this.spec.el.classList.add(DESK_MINIMIZED_CLASS);\n this.spec.changed(\"min\");\n }\n\n restore(): void {\n if (!this.minimized) return;\n this.minimized = false;\n this.spec.el.classList.remove(DESK_MINIMIZED_CLASS);\n this.spec.changed(\"restore\");\n }\n\n toggleMax(): void {\n if (!this.spec.canMax) return;\n const el = this.spec.el;\n if (!this.maximized) {\n this.before = this.rect();\n this.maximized = true;\n moverOf(el)?.reset();\n el.classList.add(DESK_MAXIMIZED_CLASS);\n Object.assign(el.style, { left: \"0px\", top: \"0px\", width: \"100%\", height: \"100%\" });\n } else {\n const back = this.before;\n this.maximized = false;\n this.before = null;\n el.classList.remove(DESK_MAXIMIZED_CLASS);\n if (back) this.place(back);\n }\n if (this.maxButton) {\n const label = `${this.maximized ? \"Restore\" : \"Maximize\"} ${this.spec.label()}`;\n this.maxButton.innerHTML = GLYPH[this.maximized ? \"restore\" : \"max\"];\n this.maxButton.setAttribute(\"aria-label\", label);\n this.maxButton.title = label;\n }\n this.spec.changed(this.maximized ? \"max\" : \"unmax\");\n }\n\n /** Take the desk's additions off and give the window back to the game's\n * own layout (the phone, the title screen, or the desk turned off). */\n dispose(): void {\n const el = this.spec.el;\n el.removeEventListener(\"pointerdown\", this.onPress, true);\n for (const a of this.added) a.remove();\n this.ownMover?.dispose();\n this.unhear?.();\n moverOf(el)?.reset();\n el.classList.remove(\"desk-win\", DESK_MINIMIZED_CLASS, DESK_MAXIMIZED_CLASS, DESK_ACTIVE_CLASS);\n el.style.removeProperty(\"width\");\n el.style.removeProperty(\"height\");\n el.style.removeProperty(\"z-index\");\n el.style.removeProperty(\"left\");\n el.style.removeProperty(\"top\");\n }\n\n /** The size grip: a dotted outline follows the pointer and the window takes\n * the size on release. */\n private wireGrip(grip: HTMLElement): void {\n const limits = this.spec.limits;\n if (!limits) return;\n grip.addEventListener(\"pointerdown\", (e) => {\n if (e.button !== 0 || this.maximized) return;\n e.preventDefault();\n e.stopPropagation();\n const el = this.spec.el;\n const desk = el.parentElement;\n if (!desk) return;\n try {\n grip.setPointerCapture(e.pointerId);\n } catch {\n /* the outline still follows while the pointer stays over the grip */\n }\n const start = this.rect();\n const sx = e.clientX;\n const sy = e.clientY;\n const outline = el.ownerDocument.createElement(\"div\");\n outline.className = \"desk-outline\";\n desk.appendChild(outline);\n let next = start;\n const draw = (r: DeskRect) => Object.assign(outline.style, { left: `${r.x}px`, top: `${r.y}px`, width: `${r.w}px`, height: `${r.h}px` });\n draw(start);\n const move = (ev: PointerEvent) => {\n next = resizedTo(start, ev.clientX - sx, ev.clientY - sy, limits, desk.clientWidth, desk.clientHeight, !!this.spec.heightOnly);\n draw(next);\n };\n const end = () => {\n grip.removeEventListener(\"pointermove\", move);\n grip.removeEventListener(\"pointerup\", end);\n grip.removeEventListener(\"pointercancel\", end);\n outline.remove();\n if (next.w === start.w && next.h === start.h) return;\n this.place(next);\n this.spec.changed(\"resize\");\n };\n grip.addEventListener(\"pointermove\", move);\n grip.addEventListener(\"pointerup\", end);\n grip.addEventListener(\"pointercancel\", end);\n });\n }\n}\n"],"names":[],"mappings":";;;AAkDA;AAC0E;AACnE,MAAM,oBAAoB,GAAG;AACpC;AACO,MAAM,oBAAoB,GAAG;AACpC;AACO,MAAM,iBAAiB,GAAG;AAEjC;AACA,MAAM,KAAK,GAAwD;AACjE,IAAA,GAAG,EAAE,8IAA8I;AACnJ,IAAA,GAAG,EAAE,0JAA0J;AAC/J,IAAA,OAAO,EAAE,yKAAyK;AAClL,IAAA,KAAK,EAAE,2MAA2M;CACnN;AAED;SACgB,WAAW,CAAC,GAAa,EAAE,IAAwB,EAAE,KAAa,EAAA;IAChF,MAAM,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC;AACrC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AAG,GAAG,MAAK;AACf,gBAAA,IAAI,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC;AAC7C,gBAAA,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,GAAG,CAAC;AAC1C,gBAAA,IAAI,CAAC,mBAAmB,CAAC,eAAe,EAAE,GAAG,CAAC;gBAC9C,OAAO,CAAC,MAAM,EAAE;AAChB,gBAAA,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;oBAAE;AAC9C,gBAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AAChB,gBAAA,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC7B,YAAA,CAAC;AACD,YAAA,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC;AAC1C,YAAA,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG,CAAC;AACvC,YAAA,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,GAAG,CAAC;AAC7C,QAAA,CAAC,CAAC;IACJ;AACD;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 1994 desk's window menu: a right-click on a window's taskbar button or
|
|
3
|
+
* its title bar opens Restore, Minimize, Maximize and Close, each grayed when
|
|
4
|
+
* it does not apply, as the 1995 window menu did. Shift+F10 or the context
|
|
5
|
+
* menu key opens it from a focused taskbar button; the arrow keys move through
|
|
6
|
+
* it and Esc or a press outside closes it.
|
|
7
|
+
*
|
|
8
|
+
* Cost: one menu built once with the taskbar; each opening sets four items.
|
|
9
|
+
*/
|
|
10
|
+
import type { DeskWindow } from "./deskWindow";
|
|
11
|
+
/** Where a window menu was opened: a right-click (or Shift+F10) on a taskbar
|
|
12
|
+
* button, or a right-click on a window's title bar. */
|
|
13
|
+
export type WindowMenuFrom = "taskbar" | "title_bar";
|
|
14
|
+
/** A window menu command. */
|
|
15
|
+
export type WindowCommand = "restore" | "minimize" | "maximize" | "close";
|
|
16
|
+
/** Which commands apply to a window now. */
|
|
17
|
+
export type WindowMenuState = Readonly<Record<WindowCommand, boolean>>;
|
|
18
|
+
/** The menu's items in order: a label and its command, a null a separator. */
|
|
19
|
+
export declare const WINDOW_MENU_ITEMS: ReadonlyArray<readonly [label: string, command: WindowCommand] | null>;
|
|
20
|
+
/** What the window menu offers for `w` now, `active` being the window with
|
|
21
|
+
* the focus: Restore unless it is in front at its own size, Minimize unless
|
|
22
|
+
* minimized, Maximize for the tower when not maximized, Close when the game
|
|
23
|
+
* can close it (Info and Tools never close on the desk). */
|
|
24
|
+
export declare function windowMenuState(w: DeskWindow | undefined, active: DeskWindow | null): WindowMenuState | null;
|
|
25
|
+
/** Run `command` on `w`; `bringUp` puts it in front, back from the taskbar
|
|
26
|
+
* when minimized. Restore and Maximize bring it up first, as 1995 did. */
|
|
27
|
+
export declare function runWindowCommand(w: DeskWindow | undefined, command: WindowCommand, bringUp: (w: DeskWindow) => void): void;
|
|
28
|
+
export interface WindowMenuHandlers {
|
|
29
|
+
/** What applies to window `id` now; null leaves the menu shut. */
|
|
30
|
+
readonly state: (id: string) => WindowMenuState | null;
|
|
31
|
+
/** Run `command` on window `id`. */
|
|
32
|
+
readonly run: (id: string, command: WindowCommand) => void;
|
|
33
|
+
/** The menu opened for window `id` (for the analytics): from a taskbar
|
|
34
|
+
* button (`above`) or a window's title bar. */
|
|
35
|
+
readonly opened?: (id: string, from: WindowMenuFrom) => void;
|
|
36
|
+
}
|
|
37
|
+
export declare class WindowMenu {
|
|
38
|
+
private readonly doc;
|
|
39
|
+
private readonly handlers;
|
|
40
|
+
readonly root: HTMLElement;
|
|
41
|
+
private readonly items;
|
|
42
|
+
private target;
|
|
43
|
+
/** Where focus goes back to when the menu closes from the keyboard. */
|
|
44
|
+
private opener;
|
|
45
|
+
constructor(doc: Document, handlers: WindowMenuHandlers);
|
|
46
|
+
get open(): boolean;
|
|
47
|
+
/** Open the menu for window `id` with its corner at (x, y) in the page;
|
|
48
|
+
* `above` opens it upward from y (from the taskbar). Kept on the screen. */
|
|
49
|
+
show(id: string, x: number, y: number, above: boolean, opener: HTMLElement | null): boolean;
|
|
50
|
+
/** Close the menu; `refocus` gives the focus back to what opened it. */
|
|
51
|
+
close(refocus?: boolean): void;
|
|
52
|
+
private enabled;
|
|
53
|
+
private first;
|
|
54
|
+
private key;
|
|
55
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 1994 desk's window menu: a right-click on a window's taskbar button or
|
|
3
|
+
* its title bar opens Restore, Minimize, Maximize and Close, each grayed when
|
|
4
|
+
* it does not apply, as the 1995 window menu did. Shift+F10 or the context
|
|
5
|
+
* menu key opens it from a focused taskbar button; the arrow keys move through
|
|
6
|
+
* it and Esc or a press outside closes it.
|
|
7
|
+
*
|
|
8
|
+
* Cost: one menu built once with the taskbar; each opening sets four items.
|
|
9
|
+
*/
|
|
10
|
+
/** The menu's items in order: a label and its command, a null a separator. */
|
|
11
|
+
const WINDOW_MENU_ITEMS = [
|
|
12
|
+
["Restore", "restore"],
|
|
13
|
+
["Minimize", "minimize"],
|
|
14
|
+
["Maximize", "maximize"],
|
|
15
|
+
null,
|
|
16
|
+
["Close", "close"],
|
|
17
|
+
];
|
|
18
|
+
/** What the window menu offers for `w` now, `active` being the window with
|
|
19
|
+
* the focus: Restore unless it is in front at its own size, Minimize unless
|
|
20
|
+
* minimized, Maximize for the tower when not maximized, Close when the game
|
|
21
|
+
* can close it (Info and Tools never close on the desk). */
|
|
22
|
+
function windowMenuState(w, active) {
|
|
23
|
+
if (!w)
|
|
24
|
+
return null;
|
|
25
|
+
const inFront = w === active && !w.minimized && !w.maximized;
|
|
26
|
+
return { restore: !inFront, minimize: !w.minimized, maximize: w.spec.canMax && !w.maximized, close: !!w.spec.close };
|
|
27
|
+
}
|
|
28
|
+
/** Run `command` on `w`; `bringUp` puts it in front, back from the taskbar
|
|
29
|
+
* when minimized. Restore and Maximize bring it up first, as 1995 did. */
|
|
30
|
+
function runWindowCommand(w, command, bringUp) {
|
|
31
|
+
if (!w)
|
|
32
|
+
return;
|
|
33
|
+
if (command === "minimize")
|
|
34
|
+
w.minimize();
|
|
35
|
+
else if (command === "close")
|
|
36
|
+
w.spec.close?.();
|
|
37
|
+
else {
|
|
38
|
+
bringUp(w);
|
|
39
|
+
if (w.maximized === (command === "restore"))
|
|
40
|
+
w.toggleMax();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
class WindowMenu {
|
|
44
|
+
constructor(doc, handlers) {
|
|
45
|
+
this.doc = doc;
|
|
46
|
+
this.handlers = handlers;
|
|
47
|
+
this.items = new Map();
|
|
48
|
+
this.target = null;
|
|
49
|
+
/** Where focus goes back to when the menu closes from the keyboard. */
|
|
50
|
+
this.opener = null;
|
|
51
|
+
const root = doc.createElement("div");
|
|
52
|
+
root.className = "desk-win-menu";
|
|
53
|
+
root.setAttribute("role", "menu");
|
|
54
|
+
root.setAttribute("aria-label", "Window");
|
|
55
|
+
root.hidden = true;
|
|
56
|
+
for (const item of WINDOW_MENU_ITEMS) {
|
|
57
|
+
if (!item) {
|
|
58
|
+
const sep = doc.createElement("hr");
|
|
59
|
+
sep.className = "mb-sep";
|
|
60
|
+
root.appendChild(sep);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const [label, command] = item;
|
|
64
|
+
const b = doc.createElement("button");
|
|
65
|
+
b.type = "button";
|
|
66
|
+
b.className = "mb-item";
|
|
67
|
+
b.setAttribute("role", "menuitem");
|
|
68
|
+
b.dataset.command = command;
|
|
69
|
+
b.textContent = label;
|
|
70
|
+
b.addEventListener("click", () => {
|
|
71
|
+
const id = this.target;
|
|
72
|
+
this.close(true);
|
|
73
|
+
if (id && !b.disabled)
|
|
74
|
+
handlers.run(id, command);
|
|
75
|
+
});
|
|
76
|
+
this.items.set(command, b);
|
|
77
|
+
root.appendChild(b);
|
|
78
|
+
}
|
|
79
|
+
root.addEventListener("keydown", (e) => this.key(e));
|
|
80
|
+
this.root = root;
|
|
81
|
+
}
|
|
82
|
+
get open() {
|
|
83
|
+
return !this.root.hidden;
|
|
84
|
+
}
|
|
85
|
+
/** Open the menu for window `id` with its corner at (x, y) in the page;
|
|
86
|
+
* `above` opens it upward from y (from the taskbar). Kept on the screen. */
|
|
87
|
+
show(id, x, y, above, opener) {
|
|
88
|
+
const state = this.handlers.state(id);
|
|
89
|
+
if (!state)
|
|
90
|
+
return false;
|
|
91
|
+
for (const [command, b] of this.items)
|
|
92
|
+
b.disabled = !state[command];
|
|
93
|
+
this.target = id;
|
|
94
|
+
this.opener = opener;
|
|
95
|
+
const root = this.root;
|
|
96
|
+
root.hidden = false;
|
|
97
|
+
const view = this.doc.defaultView;
|
|
98
|
+
const w = root.offsetWidth;
|
|
99
|
+
const h = root.offsetHeight;
|
|
100
|
+
const maxX = (view?.innerWidth ?? x + w) - w;
|
|
101
|
+
const top = above ? y - h : y;
|
|
102
|
+
const maxY = (view?.innerHeight ?? top + h) - h;
|
|
103
|
+
root.style.left = `${Math.max(0, Math.min(x, maxX))}px`;
|
|
104
|
+
root.style.top = `${Math.max(0, Math.min(top, maxY))}px`;
|
|
105
|
+
this.first()?.focus();
|
|
106
|
+
this.handlers.opened?.(id, above ? "taskbar" : "title_bar");
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
/** Close the menu; `refocus` gives the focus back to what opened it. */
|
|
110
|
+
close(refocus = false) {
|
|
111
|
+
if (this.root.hidden)
|
|
112
|
+
return;
|
|
113
|
+
this.root.hidden = true;
|
|
114
|
+
this.target = null;
|
|
115
|
+
if (refocus)
|
|
116
|
+
this.opener?.focus();
|
|
117
|
+
this.opener = null;
|
|
118
|
+
}
|
|
119
|
+
enabled() {
|
|
120
|
+
return [...this.items.values()].filter((b) => !b.disabled);
|
|
121
|
+
}
|
|
122
|
+
first() {
|
|
123
|
+
return this.enabled()[0];
|
|
124
|
+
}
|
|
125
|
+
key(e) {
|
|
126
|
+
if (e.key === "Escape") {
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
this.close(true);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp")
|
|
133
|
+
return;
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
const items = this.enabled();
|
|
136
|
+
const at = items.indexOf(this.doc.activeElement);
|
|
137
|
+
const step = e.key === "ArrowDown" ? 1 : -1;
|
|
138
|
+
items[(at + step + items.length) % items.length]?.focus();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export { WINDOW_MENU_ITEMS, WindowMenu, runWindowCommand, windowMenuState };
|
|
143
|
+
//# sourceMappingURL=deskWindowMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deskWindowMenu.js","sources":["../../../src/ui/desk/deskWindowMenu.ts"],"sourcesContent":["/**\n * The 1994 desk's window menu: a right-click on a window's taskbar button or\n * its title bar opens Restore, Minimize, Maximize and Close, each grayed when\n * it does not apply, as the 1995 window menu did. Shift+F10 or the context\n * menu key opens it from a focused taskbar button; the arrow keys move through\n * it and Esc or a press outside closes it.\n *\n * Cost: one menu built once with the taskbar; each opening sets four items.\n */\n\nimport type { DeskWindow } from \"./deskWindow\";\n\n/** Where a window menu was opened: a right-click (or Shift+F10) on a taskbar\n * button, or a right-click on a window's title bar. */\nexport type WindowMenuFrom = \"taskbar\" | \"title_bar\";\n\n/** A window menu command. */\nexport type WindowCommand = \"restore\" | \"minimize\" | \"maximize\" | \"close\";\n\n/** Which commands apply to a window now. */\nexport type WindowMenuState = Readonly<Record<WindowCommand, boolean>>;\n\n/** The menu's items in order: a label and its command, a null a separator. */\nexport const WINDOW_MENU_ITEMS: ReadonlyArray<readonly [label: string, command: WindowCommand] | null> = [\n [\"Restore\", \"restore\"],\n [\"Minimize\", \"minimize\"],\n [\"Maximize\", \"maximize\"],\n null,\n [\"Close\", \"close\"],\n];\n\n/** What the window menu offers for `w` now, `active` being the window with\n * the focus: Restore unless it is in front at its own size, Minimize unless\n * minimized, Maximize for the tower when not maximized, Close when the game\n * can close it (Info and Tools never close on the desk). */\nexport function windowMenuState(w: DeskWindow | undefined, active: DeskWindow | null): WindowMenuState | null {\n if (!w) return null;\n const inFront = w === active && !w.minimized && !w.maximized;\n return { restore: !inFront, minimize: !w.minimized, maximize: w.spec.canMax && !w.maximized, close: !!w.spec.close };\n}\n\n/** Run `command` on `w`; `bringUp` puts it in front, back from the taskbar\n * when minimized. Restore and Maximize bring it up first, as 1995 did. */\nexport function runWindowCommand(w: DeskWindow | undefined, command: WindowCommand, bringUp: (w: DeskWindow) => void): void {\n if (!w) return;\n if (command === \"minimize\") w.minimize();\n else if (command === \"close\") w.spec.close?.();\n else {\n bringUp(w);\n if (w.maximized === (command === \"restore\")) w.toggleMax();\n }\n}\n\nexport interface WindowMenuHandlers {\n /** What applies to window `id` now; null leaves the menu shut. */\n readonly state: (id: string) => WindowMenuState | null;\n /** Run `command` on window `id`. */\n readonly run: (id: string, command: WindowCommand) => void;\n /** The menu opened for window `id` (for the analytics): from a taskbar\n * button (`above`) or a window's title bar. */\n readonly opened?: (id: string, from: WindowMenuFrom) => void;\n}\n\nexport class WindowMenu {\n readonly root: HTMLElement;\n private readonly items = new Map<WindowCommand, HTMLButtonElement>();\n private target: string | null = null;\n /** Where focus goes back to when the menu closes from the keyboard. */\n private opener: HTMLElement | null = null;\n\n constructor(\n private readonly doc: Document,\n private readonly handlers: WindowMenuHandlers,\n ) {\n const root = doc.createElement(\"div\");\n root.className = \"desk-win-menu\";\n root.setAttribute(\"role\", \"menu\");\n root.setAttribute(\"aria-label\", \"Window\");\n root.hidden = true;\n for (const item of WINDOW_MENU_ITEMS) {\n if (!item) {\n const sep = doc.createElement(\"hr\");\n sep.className = \"mb-sep\";\n root.appendChild(sep);\n continue;\n }\n const [label, command] = item;\n const b = doc.createElement(\"button\");\n b.type = \"button\";\n b.className = \"mb-item\";\n b.setAttribute(\"role\", \"menuitem\");\n b.dataset.command = command;\n b.textContent = label;\n b.addEventListener(\"click\", () => {\n const id = this.target;\n this.close(true);\n if (id && !b.disabled) handlers.run(id, command);\n });\n this.items.set(command, b);\n root.appendChild(b);\n }\n root.addEventListener(\"keydown\", (e) => this.key(e));\n this.root = root;\n }\n\n get open(): boolean {\n return !this.root.hidden;\n }\n\n /** Open the menu for window `id` with its corner at (x, y) in the page;\n * `above` opens it upward from y (from the taskbar). Kept on the screen. */\n show(id: string, x: number, y: number, above: boolean, opener: HTMLElement | null): boolean {\n const state = this.handlers.state(id);\n if (!state) return false;\n for (const [command, b] of this.items) b.disabled = !state[command];\n this.target = id;\n this.opener = opener;\n const root = this.root;\n root.hidden = false;\n const view = this.doc.defaultView;\n const w = root.offsetWidth;\n const h = root.offsetHeight;\n const maxX = (view?.innerWidth ?? x + w) - w;\n const top = above ? y - h : y;\n const maxY = (view?.innerHeight ?? top + h) - h;\n root.style.left = `${Math.max(0, Math.min(x, maxX))}px`;\n root.style.top = `${Math.max(0, Math.min(top, maxY))}px`;\n this.first()?.focus();\n this.handlers.opened?.(id, above ? \"taskbar\" : \"title_bar\");\n return true;\n }\n\n /** Close the menu; `refocus` gives the focus back to what opened it. */\n close(refocus = false): void {\n if (this.root.hidden) return;\n this.root.hidden = true;\n this.target = null;\n if (refocus) this.opener?.focus();\n this.opener = null;\n }\n\n private enabled(): HTMLButtonElement[] {\n return [...this.items.values()].filter((b) => !b.disabled);\n }\n\n private first(): HTMLButtonElement | undefined {\n return this.enabled()[0];\n }\n\n private key(e: KeyboardEvent): void {\n if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n this.close(true);\n return;\n }\n if (e.key !== \"ArrowDown\" && e.key !== \"ArrowUp\") return;\n e.preventDefault();\n const items = this.enabled();\n const at = items.indexOf(this.doc.activeElement as HTMLButtonElement);\n const step = e.key === \"ArrowDown\" ? 1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,CAAC,CAAC,CAAC;IAC1B;AAEQ,IAAA,GAAG,CAAC,CAAgB,EAAA;AAC1B,QAAA,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,EAAE;YACtB,CAAC,CAAC,cAAc,EAAE;YAClB,CAAC,CAAC,eAAe,EAAE;AACnB,YAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YAChB;QACF;QACA,IAAI,CAAC,CAAC,GAAG,KAAK,WAAW,IAAI,CAAC,CAAC,GAAG,KAAK,SAAS;YAAE;QAClD,CAAC,CAAC,cAAc,EAAE;AAClB,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE;AAC5B,QAAA,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,aAAkC,CAAC;AACrE,QAAA,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC;AAC3C,QAAA,KAAK,CAAC,CAAC,EAAE,GAAG,IAAI,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE;IAC3D;AACD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function escapeHtml(s: string): string;
|
package/lib/ui/escape.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape a string for interpolation into an HTML template — safe for both
|
|
3
|
+
* text content and (quoted) attribute values, since it escapes the quote
|
|
4
|
+
* characters too. The single shared helper for every innerHTML builder;
|
|
5
|
+
* anything user-influenced (tower name, facility labels, imported saves)
|
|
6
|
+
* must pass through it.
|
|
7
|
+
*/
|
|
8
|
+
const ESCAPES = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
9
|
+
function escapeHtml(s) {
|
|
10
|
+
return s.replace(/[&<>"']/g, (c) => ESCAPES[c]);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { escapeHtml };
|
|
14
|
+
//# sourceMappingURL=escape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape.js","sources":["../../src/ui/escape.ts"],"sourcesContent":["/**\n * Escape a string for interpolation into an HTML template — safe for both\n * text content and (quoted) attribute values, since it escapes the quote\n * characters too. The single shared helper for every innerHTML builder;\n * anything user-influenced (tower name, facility labels, imported saves)\n * must pass through it.\n */\nconst ESCAPES: Record<string, string> = { \"&\": \"&\", \"<\": \"<\", \">\": \">\", '\"': \""\", \"'\": \"'\" };\n\nexport function escapeHtml(s: string): string {\n return s.replace(/[&<>\"']/g, (c) => ESCAPES[c]!);\n}\n"],"names":[],"mappings":"AAAA;;;;;;AAMG;AACH,MAAM,OAAO,GAA2B,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE;AAEzG,SAAU,UAAU,CAAC,CAAS,EAAA;AAClC,IAAA,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAE,CAAC;AAClD;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Tiny display formatters shared by the HTML builders and the app shell. */
|
|
2
|
+
/** Short floor tag: "5" above ground, "B1"/"B2"… below (floor 0 = B1). */
|
|
3
|
+
export declare function floorTag(floor: number): string;
|
|
4
|
+
/** An English ordinal for a whole number: 1st, 2nd, 3rd, 11th, 100th, 121st. */
|
|
5
|
+
export declare function ordinal(n: number): string;
|
|
6
|
+
/** Compact money for the palette cost chips (e.g. 12k, 1.5M). */
|
|
7
|
+
export declare function shortMoney(n: number): string;
|
|
8
|
+
/**
|
|
9
|
+
* A whole number with its digits grouped the US way (12,345); a fraction
|
|
10
|
+
* keeps at most three decimals. The UI is English, so it groups as
|
|
11
|
+
* English does in any browser locale; the top bar's fixed chips are sized
|
|
12
|
+
* for this grouping too.
|
|
13
|
+
*/
|
|
14
|
+
export declare function groupDigits(n: number): string;
|
package/lib/ui/format.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Tiny display formatters shared by the HTML builders and the app shell. */
|
|
2
|
+
/** Short floor tag: "5" above ground, "B1"/"B2"… below (floor 0 = B1). */
|
|
3
|
+
function floorTag(floor) {
|
|
4
|
+
return floor >= 1 ? `${floor}` : `B${1 - floor}`;
|
|
5
|
+
}
|
|
6
|
+
/** The ordinal suffix by last digit, where it is not "th". */
|
|
7
|
+
const ORDINAL_SUFFIX = { 1: "st", 2: "nd", 3: "rd" };
|
|
8
|
+
/** An English ordinal for a whole number: 1st, 2nd, 3rd, 11th, 100th, 121st. */
|
|
9
|
+
function ordinal(n) {
|
|
10
|
+
const lastTwo = Math.abs(n) % 100;
|
|
11
|
+
const teen = lastTwo >= 11 && lastTwo <= 13;
|
|
12
|
+
const suffix = teen ? "th" : (ORDINAL_SUFFIX[Math.abs(n) % 10] ?? "th");
|
|
13
|
+
return `${n}${suffix}`;
|
|
14
|
+
}
|
|
15
|
+
/** Compact money for the palette cost chips (e.g. 12k, 1.5M). */
|
|
16
|
+
function shortMoney(n) {
|
|
17
|
+
if (n >= 1000000)
|
|
18
|
+
return `${(n / 1000000).toFixed(n % 1000000 ? 1 : 0)}M`;
|
|
19
|
+
if (n >= 1000)
|
|
20
|
+
return `${Math.round(n / 1000)}k`;
|
|
21
|
+
return `${n}`;
|
|
22
|
+
}
|
|
23
|
+
/** One shared formatter, so no call builds its own. */
|
|
24
|
+
const US_DIGITS = new Intl.NumberFormat("en-US");
|
|
25
|
+
/**
|
|
26
|
+
* A whole number with its digits grouped the US way (12,345); a fraction
|
|
27
|
+
* keeps at most three decimals. The UI is English, so it groups as
|
|
28
|
+
* English does in any browser locale; the top bar's fixed chips are sized
|
|
29
|
+
* for this grouping too.
|
|
30
|
+
*/
|
|
31
|
+
function groupDigits(n) {
|
|
32
|
+
return US_DIGITS.format(n);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { floorTag, groupDigits, ordinal, shortMoney };
|
|
36
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sources":["../../src/ui/format.ts"],"sourcesContent":["/** Tiny display formatters shared by the HTML builders and the app shell. */\n\n/** Short floor tag: \"5\" above ground, \"B1\"/\"B2\"… below (floor 0 = B1). */\nexport function floorTag(floor: number): string {\n return floor >= 1 ? `${floor}` : `B${1 - floor}`;\n}\n\n/** The ordinal suffix by last digit, where it is not \"th\". */\nconst ORDINAL_SUFFIX: Readonly<Record<number, string>> = { 1: \"st\", 2: \"nd\", 3: \"rd\" };\n\n/** An English ordinal for a whole number: 1st, 2nd, 3rd, 11th, 100th, 121st. */\nexport function ordinal(n: number): string {\n const lastTwo = Math.abs(n) % 100;\n const teen = lastTwo >= 11 && lastTwo <= 13;\n const suffix = teen ? \"th\" : (ORDINAL_SUFFIX[Math.abs(n) % 10] ?? \"th\");\n return `${n}${suffix}`;\n}\n\n/** Compact money for the palette cost chips (e.g. 12k, 1.5M). */\nexport function shortMoney(n: number): string {\n if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(n % 1_000_000 ? 1 : 0)}M`;\n if (n >= 1000) return `${Math.round(n / 1000)}k`;\n return `${n}`;\n}\n\n/** One shared formatter, so no call builds its own. */\nconst US_DIGITS = new Intl.NumberFormat(\"en-US\");\n\n/**\n * A whole number with its digits grouped the US way (12,345); a fraction\n * keeps at most three decimals. The UI is English, so it groups as\n * English does in any browser locale; the top bar's fixed chips are sized\n * for this grouping too.\n */\nexport function groupDigits(n: number): string {\n return US_DIGITS.format(n);\n}\n"],"names":[],"mappings":"AAAA;AAEA;AACM,SAAU,QAAQ,CAAC,KAAa,EAAA;AACpC,IAAA,OAAO,KAAK,IAAI,CAAC,GAAG,CAAA,EAAG,KAAK,CAAA,CAAE,GAAG,CAAA,CAAA,EAAI,CAAC,GAAG,KAAK,EAAE;AAClD;AAEA;AACA,MAAM,cAAc,GAAqC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE;AAEtF;AACM,SAAU,OAAO,CAAC,CAAS,EAAA;IAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG;IACjC,MAAM,IAAI,GAAG,OAAO,IAAI,EAAE,IAAI,OAAO,IAAI,EAAE;IAC3C,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC;AACvE,IAAA,OAAO,CAAA,EAAG,CAAC,CAAA,EAAG,MAAM,EAAE;AACxB;AAEA;AACM,SAAU,UAAU,CAAC,CAAS,EAAA;IAClC,IAAI,CAAC,IAAI,OAAS;QAAE,OAAO,CAAA,EAAG,CAAC,CAAC,GAAG,OAAS,EAAE,OAAO,CAAC,CAAC,GAAG,OAAS,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA,CAAA,CAAG;IAC/E,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,CAAA,EAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA,CAAA,CAAG;IAChD,OAAO,CAAA,EAAG,CAAC,CAAA,CAAE;AACf;AAEA;AACA,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;AAEhD;;;;;AAKG;AACG,SAAU,WAAW,CAAC,CAAS,EAAA;AACnC,IAAA,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5B;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Project icon name -> the pixelarticons file its path data came from. */
|
|
2
|
+
export declare const VENDORED_ICON_SOURCES: Record<string, string>;
|
|
3
|
+
/** Each icon's SVG path "d" data (currentColor fill lives on the <svg>). */
|
|
4
|
+
export declare const VENDORED_ICON_PATHS: Record<string, readonly string[]>;
|