@caperjs/core 0.1.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/LICENSE +22 -0
- package/README.md +62 -0
- package/cli/add.mjs +197 -0
- package/cli/audio/cc.mjs +128 -0
- package/cli/audio/index.mjs +42 -0
- package/cli/audio/utils.mjs +56 -0
- package/cli/create-caper.mjs +8 -0
- package/cli/create.mjs +351 -0
- package/cli/install-peerdeps.mjs +57 -0
- package/cli/update.mjs +9 -0
- package/cli/utils.mjs +81 -0
- package/cli/vite.mjs +55 -0
- package/cli/voiceover/generateVoiceoverCSV.mjs +158 -0
- package/cli/voiceover/index.mjs +1 -0
- package/cli.mjs +157 -0
- package/client.d.ts +7 -0
- package/config/assetpack.mjs +212 -0
- package/config/tsconfig.base.json +28 -0
- package/config/vite.mjs +2464 -0
- package/extras/css/accessibility.css +9 -0
- package/extras/css/fullscreen.css +28 -0
- package/extras/css/loader.css +67 -0
- package/extras/llms.txt +1602 -0
- package/lib/CaptionsPlugin-Dc8fIrjy.js +277 -0
- package/lib/CaptionsPlugin-Dc8fIrjy.js.map +1 -0
- package/lib/DataAdapter-BY2114sp.js +84 -0
- package/lib/DataAdapter-BY2114sp.js.map +1 -0
- package/lib/DebugRenderer-BJMLILqI.js +1385 -0
- package/lib/DebugRenderer-BJMLILqI.js.map +1 -0
- package/lib/DevToolsPlugin-wQ5rOkn0.js +31 -0
- package/lib/DevToolsPlugin-wQ5rOkn0.js.map +1 -0
- package/lib/GSAPPlugin-DHhSZKv8.js +350 -0
- package/lib/GSAPPlugin-DHhSZKv8.js.map +1 -0
- package/lib/LayoutPlugin-B-DF9SYM.js +1271 -0
- package/lib/LayoutPlugin-B-DF9SYM.js.map +1 -0
- package/lib/SpinePlugin-Dz_3dljz.js +6077 -0
- package/lib/SpinePlugin-Dz_3dljz.js.map +1 -0
- package/lib/StatsPlugin-Cg82JMBD.js +70 -0
- package/lib/StatsPlugin-Cg82JMBD.js.map +1 -0
- package/lib/VoiceOverPlugin-BR3ImT8C.js +114 -0
- package/lib/VoiceOverPlugin-BR3ImT8C.js.map +1 -0
- package/lib/caper.mjs +1233 -0
- package/lib/caper.mjs.map +1 -0
- package/lib/core/Application.d.ts +268 -0
- package/lib/core/Application.d.ts.map +1 -0
- package/lib/core/config.d.ts +39 -0
- package/lib/core/config.d.ts.map +1 -0
- package/lib/core/create.d.ts +41 -0
- package/lib/core/create.d.ts.map +1 -0
- package/lib/core/globals.d.ts +51 -0
- package/lib/core/globals.d.ts.map +1 -0
- package/lib/core/index.d.ts +7 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/interfaces/IApplication.d.ts +566 -0
- package/lib/core/interfaces/IApplication.d.ts.map +1 -0
- package/lib/core/interfaces/IApplicationOptions.d.ts +65 -0
- package/lib/core/interfaces/IApplicationOptions.d.ts.map +1 -0
- package/lib/core/interfaces/ICoreFunctions.d.ts +49 -0
- package/lib/core/interfaces/ICoreFunctions.d.ts.map +1 -0
- package/lib/core/interfaces/ICoreSignals.d.ts +57 -0
- package/lib/core/interfaces/ICoreSignals.d.ts.map +1 -0
- package/lib/core/interfaces/IStorageCapability.d.ts +20 -0
- package/lib/core/interfaces/IStorageCapability.d.ts.map +1 -0
- package/lib/core/interfaces/IStorageCapability.test.d.ts +2 -0
- package/lib/core/interfaces/IStorageCapability.test.d.ts.map +1 -0
- package/lib/core/interfaces/index.d.ts +7 -0
- package/lib/core/interfaces/index.d.ts.map +1 -0
- package/lib/core/registries.d.ts +8 -0
- package/lib/core/registries.d.ts.map +1 -0
- package/lib/core/types.d.ts +12 -0
- package/lib/core/types.d.ts.map +1 -0
- package/lib/display/AnimatedSprite.d.ts +40 -0
- package/lib/display/AnimatedSprite.d.ts.map +1 -0
- package/lib/display/Camera.d.ts +102 -0
- package/lib/display/Camera.d.ts.map +1 -0
- package/lib/display/Container.d.ts +115 -0
- package/lib/display/Container.d.ts.map +1 -0
- package/lib/display/Entity.d.ts +46 -0
- package/lib/display/Entity.d.ts.map +1 -0
- package/lib/display/ParticleContainer.d.ts +58 -0
- package/lib/display/ParticleContainer.d.ts.map +1 -0
- package/lib/display/Scene.d.ts +250 -0
- package/lib/display/Scene.d.ts.map +1 -0
- package/lib/display/SceneTransition.d.ts +41 -0
- package/lib/display/SceneTransition.d.ts.map +1 -0
- package/lib/display/SpineAnimation.d.ts +76 -0
- package/lib/display/SpineAnimation.d.ts.map +1 -0
- package/lib/display/Svg.d.ts +5 -0
- package/lib/display/Svg.d.ts.map +1 -0
- package/lib/display/index.d.ts +10 -0
- package/lib/display/index.d.ts.map +1 -0
- package/lib/env.d.ts +6 -0
- package/lib/hello.d.ts +2 -0
- package/lib/hello.d.ts.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/mixins/animated.d.ts +53 -0
- package/lib/mixins/animated.d.ts.map +1 -0
- package/lib/mixins/factory/Factory.d.ts +8 -0
- package/lib/mixins/factory/Factory.d.ts.map +1 -0
- package/lib/mixins/factory/const.d.ts +67 -0
- package/lib/mixins/factory/const.d.ts.map +1 -0
- package/lib/mixins/factory/index.d.ts +8 -0
- package/lib/mixins/factory/index.d.ts.map +1 -0
- package/lib/mixins/factory/methods.d.ts +3 -0
- package/lib/mixins/factory/methods.d.ts.map +1 -0
- package/lib/mixins/factory/props.d.ts +160 -0
- package/lib/mixins/factory/props.d.ts.map +1 -0
- package/lib/mixins/factory/registry.d.ts +27 -0
- package/lib/mixins/factory/registry.d.ts.map +1 -0
- package/lib/mixins/factory/registry.test.d.ts +2 -0
- package/lib/mixins/factory/registry.test.d.ts.map +1 -0
- package/lib/mixins/factory/schema.d.ts +71 -0
- package/lib/mixins/factory/schema.d.ts.map +1 -0
- package/lib/mixins/factory/ui-registry.d.ts +20 -0
- package/lib/mixins/factory/ui-registry.d.ts.map +1 -0
- package/lib/mixins/factory/utils.d.ts +11 -0
- package/lib/mixins/factory/utils.d.ts.map +1 -0
- package/lib/mixins/focus.d.ts +15 -0
- package/lib/mixins/focus.d.ts.map +1 -0
- package/lib/mixins/index.d.ts +6 -0
- package/lib/mixins/index.d.ts.map +1 -0
- package/lib/mixins/interaction.d.ts +20 -0
- package/lib/mixins/interaction.d.ts.map +1 -0
- package/lib/mixins/signals.d.ts +15 -0
- package/lib/mixins/signals.d.ts.map +1 -0
- package/lib/plugins/AssetsPlugin.d.ts +79 -0
- package/lib/plugins/AssetsPlugin.d.ts.map +1 -0
- package/lib/plugins/DataAdapter.d.ts +95 -0
- package/lib/plugins/DataAdapter.d.ts.map +1 -0
- package/lib/plugins/DevToolsPlugin.d.ts +97 -0
- package/lib/plugins/DevToolsPlugin.d.ts.map +1 -0
- package/lib/plugins/FullScreenPlugin.d.ts +240 -0
- package/lib/plugins/FullScreenPlugin.d.ts.map +1 -0
- package/lib/plugins/GSAPPlugin.d.ts +634 -0
- package/lib/plugins/GSAPPlugin.d.ts.map +1 -0
- package/lib/plugins/KeyboardPlugin.d.ts +53 -0
- package/lib/plugins/KeyboardPlugin.d.ts.map +1 -0
- package/lib/plugins/LayoutPlugin.d.ts +100 -0
- package/lib/plugins/LayoutPlugin.d.ts.map +1 -0
- package/lib/plugins/LookupPlugin.d.ts +223 -0
- package/lib/plugins/LookupPlugin.d.ts.map +1 -0
- package/lib/plugins/Plugin.d.ts +132 -0
- package/lib/plugins/Plugin.d.ts.map +1 -0
- package/lib/plugins/Plugin.test.d.ts +2 -0
- package/lib/plugins/Plugin.test.d.ts.map +1 -0
- package/lib/plugins/PopupManagerPlugin.d.ts +108 -0
- package/lib/plugins/PopupManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/ResizerPlugin.d.ts +62 -0
- package/lib/plugins/ResizerPlugin.d.ts.map +1 -0
- package/lib/plugins/SceneManagerPlugin.d.ts +122 -0
- package/lib/plugins/SceneManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/StatsPlugin.d.ts +8 -0
- package/lib/plugins/StatsPlugin.d.ts.map +1 -0
- package/lib/plugins/TimerPlugin.d.ts +401 -0
- package/lib/plugins/TimerPlugin.d.ts.map +1 -0
- package/lib/plugins/WebEventsPlugin.d.ts +60 -0
- package/lib/plugins/WebEventsPlugin.d.ts.map +1 -0
- package/lib/plugins/actions/ActionsPlugin.d.ts +39 -0
- package/lib/plugins/actions/ActionsPlugin.d.ts.map +1 -0
- package/lib/plugins/actions/constants.d.ts +52 -0
- package/lib/plugins/actions/constants.d.ts.map +1 -0
- package/lib/plugins/actions/index.d.ts +5 -0
- package/lib/plugins/actions/index.d.ts.map +1 -0
- package/lib/plugins/actions/methods.d.ts +11 -0
- package/lib/plugins/actions/methods.d.ts.map +1 -0
- package/lib/plugins/actions/types.d.ts +25 -0
- package/lib/plugins/actions/types.d.ts.map +1 -0
- package/lib/plugins/audio/AudioChannel.d.ts +46 -0
- package/lib/plugins/audio/AudioChannel.d.ts.map +1 -0
- package/lib/plugins/audio/AudioChannel.test.d.ts +2 -0
- package/lib/plugins/audio/AudioChannel.test.d.ts.map +1 -0
- package/lib/plugins/audio/AudioInstance.d.ts +79 -0
- package/lib/plugins/audio/AudioInstance.d.ts.map +1 -0
- package/lib/plugins/audio/AudioManagerPlugin.d.ts +323 -0
- package/lib/plugins/audio/AudioManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/audio/VoiceOverPlugin.d.ts +69 -0
- package/lib/plugins/audio/VoiceOverPlugin.d.ts.map +1 -0
- package/lib/plugins/audio/index.d.ts +4 -0
- package/lib/plugins/audio/index.d.ts.map +1 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.d.ts +109 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.d.ts.map +1 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.test.d.ts +2 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.test.d.ts.map +1 -0
- package/lib/plugins/breakpoints/evaluate.d.ts +53 -0
- package/lib/plugins/breakpoints/evaluate.d.ts.map +1 -0
- package/lib/plugins/breakpoints/evaluate.test.d.ts +2 -0
- package/lib/plugins/breakpoints/evaluate.test.d.ts.map +1 -0
- package/lib/plugins/breakpoints/index.d.ts +4 -0
- package/lib/plugins/breakpoints/index.d.ts.map +1 -0
- package/lib/plugins/breakpoints/methods.d.ts +23 -0
- package/lib/plugins/breakpoints/methods.d.ts.map +1 -0
- package/lib/plugins/breakpoints/types.d.ts +70 -0
- package/lib/plugins/breakpoints/types.d.ts.map +1 -0
- package/lib/plugins/captions/CaptionsPlugin.d.ts +150 -0
- package/lib/plugins/captions/CaptionsPlugin.d.ts.map +1 -0
- package/lib/plugins/captions/CaptionsRenderer.d.ts +37 -0
- package/lib/plugins/captions/CaptionsRenderer.d.ts.map +1 -0
- package/lib/plugins/captions/index.d.ts +3 -0
- package/lib/plugins/captions/index.d.ts.map +1 -0
- package/lib/plugins/defaults.d.ts +4 -0
- package/lib/plugins/defaults.d.ts.map +1 -0
- package/lib/plugins/focus/FocusManagerPlugin.d.ts +148 -0
- package/lib/plugins/focus/FocusManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/focus/FocusOutliner.d.ts +32 -0
- package/lib/plugins/focus/FocusOutliner.d.ts.map +1 -0
- package/lib/plugins/focus/index.d.ts +3 -0
- package/lib/plugins/focus/index.d.ts.map +1 -0
- package/lib/plugins/i18nPlugin.d.ts +128 -0
- package/lib/plugins/i18nPlugin.d.ts.map +1 -0
- package/lib/plugins/index.d.ts +18 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/input/AbstractControls.d.ts +8 -0
- package/lib/plugins/input/AbstractControls.d.ts.map +1 -0
- package/lib/plugins/input/Controls.d.ts +16 -0
- package/lib/plugins/input/Controls.d.ts.map +1 -0
- package/lib/plugins/input/InputPlugin.d.ts +52 -0
- package/lib/plugins/input/InputPlugin.d.ts.map +1 -0
- package/lib/plugins/input/constants.d.ts +8 -0
- package/lib/plugins/input/constants.d.ts.map +1 -0
- package/lib/plugins/input/index.d.ts +10 -0
- package/lib/plugins/input/index.d.ts.map +1 -0
- package/lib/plugins/input/interfaces.d.ts +30 -0
- package/lib/plugins/input/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts +28 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/index.d.ts +3 -0
- package/lib/plugins/input/keyboard/index.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/interfaces.d.ts +18 -0
- package/lib/plugins/input/keyboard/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/methods.d.ts +4 -0
- package/lib/plugins/input/methods.d.ts.map +1 -0
- package/lib/plugins/input/touch/TouchControls.d.ts +35 -0
- package/lib/plugins/input/touch/TouchControls.d.ts.map +1 -0
- package/lib/plugins/input/touch/constants.d.ts +14 -0
- package/lib/plugins/input/touch/constants.d.ts.map +1 -0
- package/lib/plugins/input/touch/index.d.ts +4 -0
- package/lib/plugins/input/touch/index.d.ts.map +1 -0
- package/lib/plugins/input/touch/interfaces.d.ts +15 -0
- package/lib/plugins/input/touch/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/types.d.ts +32 -0
- package/lib/plugins/input/types.d.ts.map +1 -0
- package/lib/plugins/input/utils.d.ts +23 -0
- package/lib/plugins/input/utils.d.ts.map +1 -0
- package/lib/plugins/spine/SpinePlugin.d.ts +6 -0
- package/lib/plugins/spine/SpinePlugin.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/BatchableSpineSlot.d.ts +31 -0
- package/lib/plugins/spine/pixi-spine/BatchableSpineSlot.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/Spine.d.ts +211 -0
- package/lib/plugins/spine/pixi-spine/Spine.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpineDebugRenderer.d.ts +81 -0
- package/lib/plugins/spine/pixi-spine/SpineDebugRenderer.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpinePipe.d.ts +21 -0
- package/lib/plugins/spine/pixi-spine/SpinePipe.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpineTexture.d.ts +16 -0
- package/lib/plugins/spine/pixi-spine/SpineTexture.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/assets/atlasLoader.d.ts +10 -0
- package/lib/plugins/spine/pixi-spine/assets/atlasLoader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/assets/skeletonLoader.d.ts +6 -0
- package/lib/plugins/spine/pixi-spine/assets/skeletonLoader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.d.ts +5 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatcher.d.ts +22 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatcher.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintShader.d.ts +5 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintShader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/darkTintBit.d.ts +51 -0
- package/lib/plugins/spine/pixi-spine/darktint/darkTintBit.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/index.d.ts +9 -0
- package/lib/plugins/spine/pixi-spine/index.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/require-shim.d.ts +34 -0
- package/lib/plugins/spine/pixi-spine/require-shim.d.ts.map +1 -0
- package/lib/registries-CYCaYKZI.js +6885 -0
- package/lib/registries-CYCaYKZI.js.map +1 -0
- package/lib/signals/Signal.d.ts +16 -0
- package/lib/signals/Signal.d.ts.map +1 -0
- package/lib/signals/Signal.test.d.ts +2 -0
- package/lib/signals/Signal.test.d.ts.map +1 -0
- package/lib/signals/index.d.ts +3 -0
- package/lib/signals/index.d.ts.map +1 -0
- package/lib/store/Store.d.ts +56 -0
- package/lib/store/Store.d.ts.map +1 -0
- package/lib/store/Store.test.d.ts +2 -0
- package/lib/store/Store.test.d.ts.map +1 -0
- package/lib/store/index.d.ts +2 -0
- package/lib/store/index.d.ts.map +1 -0
- package/lib/types/framework.d.ts +46 -0
- package/lib/types/gsap.d.ts +23 -0
- package/lib/ui/Button.d.ts +162 -0
- package/lib/ui/Button.d.ts.map +1 -0
- package/lib/ui/FlexContainer.d.ts +109 -0
- package/lib/ui/FlexContainer.d.ts.map +1 -0
- package/lib/ui/Input.d.ts +384 -0
- package/lib/ui/Input.d.ts.map +1 -0
- package/lib/ui/Joystick.d.ts +61 -0
- package/lib/ui/Joystick.d.ts.map +1 -0
- package/lib/ui/Popup.d.ts +109 -0
- package/lib/ui/Popup.d.ts.map +1 -0
- package/lib/ui/Toast.d.ts +131 -0
- package/lib/ui/Toast.d.ts.map +1 -0
- package/lib/ui/Toaster.d.ts +188 -0
- package/lib/ui/Toaster.d.ts.map +1 -0
- package/lib/ui/UICanvas.d.ts +155 -0
- package/lib/ui/UICanvas.d.ts.map +1 -0
- package/lib/ui/index.d.ts +9 -0
- package/lib/ui/index.d.ts.map +1 -0
- package/lib/utils/array.d.ts +11 -0
- package/lib/utils/array.d.ts.map +1 -0
- package/lib/utils/bind.d.ts +21 -0
- package/lib/utils/bind.d.ts.map +1 -0
- package/lib/utils/canvas.d.ts +2 -0
- package/lib/utils/canvas.d.ts.map +1 -0
- package/lib/utils/color.d.ts +66 -0
- package/lib/utils/color.d.ts.map +1 -0
- package/lib/utils/console/Logger.d.ts +15 -0
- package/lib/utils/console/Logger.d.ts.map +1 -0
- package/lib/utils/console/index.d.ts +2 -0
- package/lib/utils/console/index.d.ts.map +1 -0
- package/lib/utils/debug.d.ts +34 -0
- package/lib/utils/debug.d.ts.map +1 -0
- package/lib/utils/define.d.ts +100 -0
- package/lib/utils/define.d.ts.map +1 -0
- package/lib/utils/env.d.ts +4 -0
- package/lib/utils/env.d.ts.map +1 -0
- package/lib/utils/events.d.ts +12 -0
- package/lib/utils/events.d.ts.map +1 -0
- package/lib/utils/framework.d.ts +12 -0
- package/lib/utils/framework.d.ts.map +1 -0
- package/lib/utils/index.d.ts +28 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/map.d.ts +31 -0
- package/lib/utils/map.d.ts.map +1 -0
- package/lib/utils/math.d.ts +15 -0
- package/lib/utils/math.d.ts.map +1 -0
- package/lib/utils/misc.d.ts +13 -0
- package/lib/utils/misc.d.ts.map +1 -0
- package/lib/utils/number.d.ts +2 -0
- package/lib/utils/number.d.ts.map +1 -0
- package/lib/utils/object.d.ts +21 -0
- package/lib/utils/object.d.ts.map +1 -0
- package/lib/utils/padding.d.ts +4 -0
- package/lib/utils/padding.d.ts.map +1 -0
- package/lib/utils/pixi.d.ts +42 -0
- package/lib/utils/pixi.d.ts.map +1 -0
- package/lib/utils/platform.d.ts +20 -0
- package/lib/utils/platform.d.ts.map +1 -0
- package/lib/utils/point.d.ts +66 -0
- package/lib/utils/point.d.ts.map +1 -0
- package/lib/utils/promise/Queue.d.ts +60 -0
- package/lib/utils/promise/Queue.d.ts.map +1 -0
- package/lib/utils/promise/functions.d.ts +14 -0
- package/lib/utils/promise/functions.d.ts.map +1 -0
- package/lib/utils/promise/index.d.ts +3 -0
- package/lib/utils/promise/index.d.ts.map +1 -0
- package/lib/utils/random.d.ts +42 -0
- package/lib/utils/random.d.ts.map +1 -0
- package/lib/utils/rect.d.ts +26 -0
- package/lib/utils/rect.d.ts.map +1 -0
- package/lib/utils/set.d.ts +15 -0
- package/lib/utils/set.d.ts.map +1 -0
- package/lib/utils/string.d.ts +3 -0
- package/lib/utils/string.d.ts.map +1 -0
- package/lib/utils/text.d.ts +3 -0
- package/lib/utils/text.d.ts.map +1 -0
- package/lib/utils/typefilters.d.ts +4 -0
- package/lib/utils/typefilters.d.ts.map +1 -0
- package/lib/utils/types.d.ts +209 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/vite.d.ts +25 -0
- package/lib/utils/vite.d.ts.map +1 -0
- package/lib/utils/web.d.ts +3 -0
- package/lib/utils/web.d.ts.map +1 -0
- package/lib/version.d.ts +3 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/webgl-check.d.ts +2 -0
- package/lib/webgl-check.d.ts.map +1 -0
- package/package.json +138 -0
- package/src/core/Application.ts +1091 -0
- package/src/core/config.ts +168 -0
- package/src/core/create.ts +186 -0
- package/src/core/globals.ts +299 -0
- package/src/core/index.ts +6 -0
- package/src/core/interfaces/IApplication.ts +628 -0
- package/src/core/interfaces/IApplicationOptions.ts +81 -0
- package/src/core/interfaces/ICoreFunctions.ts +86 -0
- package/src/core/interfaces/ICoreSignals.ts +77 -0
- package/src/core/interfaces/IStorageCapability.test.ts +27 -0
- package/src/core/interfaces/IStorageCapability.ts +26 -0
- package/src/core/interfaces/index.ts +6 -0
- package/src/core/registries.ts +7 -0
- package/src/core/types.ts +13 -0
- package/src/display/AnimatedSprite.ts +227 -0
- package/src/display/Camera.ts +371 -0
- package/src/display/Container.ts +240 -0
- package/src/display/Entity.ts +50 -0
- package/src/display/ParticleContainer.ts +107 -0
- package/src/display/Scene.ts +305 -0
- package/src/display/SceneTransition.ts +108 -0
- package/src/display/SpineAnimation.ts +170 -0
- package/src/display/Svg.ts +9 -0
- package/src/display/index.ts +11 -0
- package/src/env.d.ts +6 -0
- package/src/hello.ts +20 -0
- package/src/index.ts +17 -0
- package/src/mixins/animated.ts +340 -0
- package/src/mixins/factory/Factory.ts +24 -0
- package/src/mixins/factory/const.ts +363 -0
- package/src/mixins/factory/index.ts +7 -0
- package/src/mixins/factory/methods.ts +21 -0
- package/src/mixins/factory/props.ts +207 -0
- package/src/mixins/factory/registry.test.ts +83 -0
- package/src/mixins/factory/registry.ts +61 -0
- package/src/mixins/factory/schema.ts +153 -0
- package/src/mixins/factory/ui-registry.ts +54 -0
- package/src/mixins/factory/utils.ts +130 -0
- package/src/mixins/focus.ts +124 -0
- package/src/mixins/index.ts +5 -0
- package/src/mixins/interaction.ts +74 -0
- package/src/mixins/signals.ts +49 -0
- package/src/plugins/AssetsPlugin.ts +407 -0
- package/src/plugins/DataAdapter.ts +259 -0
- package/src/plugins/DevToolsPlugin.ts +103 -0
- package/src/plugins/FullScreenPlugin.ts +359 -0
- package/src/plugins/GSAPPlugin.ts +811 -0
- package/src/plugins/KeyboardPlugin.ts +160 -0
- package/src/plugins/LayoutPlugin.ts +127 -0
- package/src/plugins/LookupPlugin.ts +308 -0
- package/src/plugins/Plugin.test.ts +73 -0
- package/src/plugins/Plugin.ts +200 -0
- package/src/plugins/PopupManagerPlugin.ts +263 -0
- package/src/plugins/ResizerPlugin.ts +220 -0
- package/src/plugins/SceneManagerPlugin.ts +669 -0
- package/src/plugins/StatsPlugin.ts +24 -0
- package/src/plugins/TimerPlugin.ts +841 -0
- package/src/plugins/WebEventsPlugin.ts +132 -0
- package/src/plugins/actions/ActionsPlugin.ts +113 -0
- package/src/plugins/actions/constants.ts +45 -0
- package/src/plugins/actions/index.ts +4 -0
- package/src/plugins/actions/methods.ts +28 -0
- package/src/plugins/actions/types.ts +47 -0
- package/src/plugins/audio/AudioChannel.test.ts +101 -0
- package/src/plugins/audio/AudioChannel.ts +164 -0
- package/src/plugins/audio/AudioInstance.ts +228 -0
- package/src/plugins/audio/AudioManagerPlugin.ts +903 -0
- package/src/plugins/audio/VoiceOverPlugin.ts +354 -0
- package/src/plugins/audio/index.ts +3 -0
- package/src/plugins/breakpoints/BreakpointPlugin.test.ts +228 -0
- package/src/plugins/breakpoints/BreakpointPlugin.ts +293 -0
- package/src/plugins/breakpoints/evaluate.test.ts +239 -0
- package/src/plugins/breakpoints/evaluate.ts +201 -0
- package/src/plugins/breakpoints/index.ts +3 -0
- package/src/plugins/breakpoints/methods.ts +22 -0
- package/src/plugins/breakpoints/types.ts +86 -0
- package/src/plugins/captions/CaptionsPlugin.ts +468 -0
- package/src/plugins/captions/CaptionsRenderer.ts +184 -0
- package/src/plugins/captions/font/Sans.fnt +116 -0
- package/src/plugins/captions/font/Sans.png +0 -0
- package/src/plugins/captions/index.ts +2 -0
- package/src/plugins/defaults.ts +95 -0
- package/src/plugins/focus/FocusManagerPlugin.ts +773 -0
- package/src/plugins/focus/FocusOutliner.ts +111 -0
- package/src/plugins/focus/index.ts +2 -0
- package/src/plugins/i18nPlugin.ts +284 -0
- package/src/plugins/index.ts +17 -0
- package/src/plugins/input/AbstractControls.ts +15 -0
- package/src/plugins/input/Controls.ts +55 -0
- package/src/plugins/input/InputPlugin.ts +168 -0
- package/src/plugins/input/constants.ts +12 -0
- package/src/plugins/input/index.ts +9 -0
- package/src/plugins/input/interfaces.ts +37 -0
- package/src/plugins/input/keyboard/KeyboardContols.ts +182 -0
- package/src/plugins/input/keyboard/index.ts +2 -0
- package/src/plugins/input/keyboard/interfaces.ts +21 -0
- package/src/plugins/input/methods.ts +9 -0
- package/src/plugins/input/touch/TouchControls.ts +237 -0
- package/src/plugins/input/touch/constants.ts +34 -0
- package/src/plugins/input/touch/index.ts +3 -0
- package/src/plugins/input/touch/interfaces.ts +15 -0
- package/src/plugins/input/types.ts +41 -0
- package/src/plugins/input/utils.ts +10 -0
- package/src/plugins/spine/SpinePlugin.ts +14 -0
- package/src/plugins/spine/pixi-spine/BatchableSpineSlot.ts +138 -0
- package/src/plugins/spine/pixi-spine/Spine.ts +897 -0
- package/src/plugins/spine/pixi-spine/SpineDebugRenderer.ts +615 -0
- package/src/plugins/spine/pixi-spine/SpinePipe.ts +197 -0
- package/src/plugins/spine/pixi-spine/SpineTexture.ts +143 -0
- package/src/plugins/spine/pixi-spine/assets/atlasLoader.ts +156 -0
- package/src/plugins/spine/pixi-spine/assets/skeletonLoader.ts +80 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.ts +92 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintBatcher.ts +186 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintShader.ts +74 -0
- package/src/plugins/spine/pixi-spine/darktint/darkTintBit.ts +77 -0
- package/src/plugins/spine/pixi-spine/index.ts +43 -0
- package/src/plugins/spine/pixi-spine/require-shim.ts +43 -0
- package/src/signals/Signal.test.ts +54 -0
- package/src/signals/Signal.ts +68 -0
- package/src/signals/index.ts +10 -0
- package/src/store/Store.test.ts +146 -0
- package/src/store/Store.ts +192 -0
- package/src/store/index.ts +1 -0
- package/src/types/framework.d.ts +47 -0
- package/src/types/gsap.d.ts +26 -0
- package/src/ui/Button.ts +454 -0
- package/src/ui/FlexContainer.ts +526 -0
- package/src/ui/Input.ts +1274 -0
- package/src/ui/Joystick.ts +288 -0
- package/src/ui/Popup.ts +242 -0
- package/src/ui/Toast.ts +399 -0
- package/src/ui/Toaster.ts +409 -0
- package/src/ui/UICanvas.ts +812 -0
- package/src/ui/index.ts +8 -0
- package/src/utils/array.ts +24 -0
- package/src/utils/bind.ts +79 -0
- package/src/utils/canvas.ts +26 -0
- package/src/utils/color.ts +126 -0
- package/src/utils/console/Logger.ts +86 -0
- package/src/utils/console/index.ts +1 -0
- package/src/utils/debug.ts +69 -0
- package/src/utils/define.ts +120 -0
- package/src/utils/env.ts +3 -0
- package/src/utils/events.ts +10 -0
- package/src/utils/framework.ts +45 -0
- package/src/utils/index.ts +27 -0
- package/src/utils/map.ts +59 -0
- package/src/utils/math.ts +19 -0
- package/src/utils/misc.ts +45 -0
- package/src/utils/number.ts +3 -0
- package/src/utils/object.ts +43 -0
- package/src/utils/padding.ts +43 -0
- package/src/utils/pixi.ts +116 -0
- package/src/utils/platform.ts +33 -0
- package/src/utils/point.ts +123 -0
- package/src/utils/promise/Queue.ts +125 -0
- package/src/utils/promise/functions.ts +16 -0
- package/src/utils/promise/index.ts +2 -0
- package/src/utils/random.ts +69 -0
- package/src/utils/rect.ts +50 -0
- package/src/utils/set.ts +32 -0
- package/src/utils/string.ts +9 -0
- package/src/utils/text.ts +30 -0
- package/src/utils/typefilters.ts +29 -0
- package/src/utils/types.ts +426 -0
- package/src/utils/vite.ts +41 -0
- package/src/utils/web.ts +7 -0
- package/src/version.ts +3 -0
- package/src/webgl-check.ts +12 -0
- package/templates/app/default/.eslintrc.json +21 -0
- package/templates/app/default/.meta.json +4 -0
- package/templates/app/default/.nvmrc +1 -0
- package/templates/app/default/.prettierrc.json +7 -0
- package/templates/app/default/README.md +8 -0
- package/templates/app/default/assets/audio{m}/music/Cheerful Annoyance.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Drumming Sticks.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Game Over.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Mishief Stroll.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Night at the Beach.ogg +0 -0
- package/templates/app/default/assets/audio{m}/sfx/click.ogg +0 -0
- package/templates/app/default/assets/audio{m}/sfx/hover.ogg +0 -0
- package/templates/app/default/assets/required{m}/caper.png +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Bold{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Medium{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Regular{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/Syncopate-Bold{family=Syncopate}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/blue.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/green.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/grey.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/orange.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/purple.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/red.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/yellow.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/down.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/over.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/up.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/down.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/over.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/up.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/joystick/base.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/joystick/handle.png +0 -0
- package/templates/app/default/assets/required{m}/wordmark.svg +1 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro.png +0 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro.skel +0 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro{fix}.atlas +94 -0
- package/templates/app/default/caper.config.ts +60 -0
- package/templates/app/default/index.html +23 -0
- package/templates/app/default/package.template.json +17 -0
- package/templates/app/default/public/favicon.ico +0 -0
- package/templates/app/default/src/__APPLICATION_NAME__.ts +3 -0
- package/templates/app/default/src/main.ts +9 -0
- package/templates/app/default/src/scenes/Base.ts +39 -0
- package/templates/app/default/src/scenes/Game.ts +34 -0
- package/templates/app/default/src/scenes/Splash.ts +70 -0
- package/templates/app/default/src/scenes/Start.ts +90 -0
- package/templates/app/default/src/utils/Constants.ts +3 -0
- package/templates/app/default/tsconfig.json +1 -0
- package/templates/plugin/package.template.json +33 -0
- package/templates/plugin/src/Plugin.template.ts +24 -0
- package/templates/plugin/src/index.template.ts +3 -0
- package/templates/plugin/tsconfig.template.json +43 -0
- package/templates/plugin/vite-env.template.d.ts +16 -0
- package/templates/plugin/vite.config.template.ts +19 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { Bounds, Container, Point, PointerEvents } from 'pixi.js';
|
|
2
|
+
import { IApplication } from '../../core';
|
|
3
|
+
import { Signal } from '../../signals';
|
|
4
|
+
import { PointLike as CaperPointLike } from '../../utils';
|
|
5
|
+
import { IPlugin, Plugin } from '../Plugin';
|
|
6
|
+
import { IFocusOutliner, FocusOutliner, FocusOutlinerConfig } from './FocusOutliner';
|
|
7
|
+
export type FocusManagerPluginOptions = {
|
|
8
|
+
outliner: IFocusOutliner | Partial<FocusOutlinerConfig> | typeof FocusOutliner;
|
|
9
|
+
usePixiAccessibility: boolean;
|
|
10
|
+
};
|
|
11
|
+
export interface IFocusable extends Container {
|
|
12
|
+
isFocused: boolean;
|
|
13
|
+
isKeyDown: boolean;
|
|
14
|
+
focusEnabled: boolean;
|
|
15
|
+
tabIndex: number;
|
|
16
|
+
_accessibleDiv?: HTMLElement;
|
|
17
|
+
accessible: boolean;
|
|
18
|
+
accessibleType: keyof HTMLElementTagNameMap | undefined;
|
|
19
|
+
accessibleTitle: string;
|
|
20
|
+
accessibleHint: string;
|
|
21
|
+
accessiblePointerEvents?: PointerEvents;
|
|
22
|
+
accessibleChildren: boolean;
|
|
23
|
+
onFocusIn: Signal<(focusable: IFocusable) => void>;
|
|
24
|
+
onFocusOut: Signal<(focusable: IFocusable) => void>;
|
|
25
|
+
onFocus: Signal<(focusable: IFocusable) => void>;
|
|
26
|
+
onBlur: Signal<(focusable: IFocusable) => void>;
|
|
27
|
+
focusIn(): void;
|
|
28
|
+
focusOut(): void;
|
|
29
|
+
click(): void;
|
|
30
|
+
blur(): void;
|
|
31
|
+
getGlobalPosition(): Point;
|
|
32
|
+
getFocusArea(): Bounds;
|
|
33
|
+
getFocusPosition(): CaperPointLike | null;
|
|
34
|
+
getFocusSize(): CaperPointLike | null;
|
|
35
|
+
}
|
|
36
|
+
export interface IFocusLayer {
|
|
37
|
+
currentFocusable: IFocusable | null;
|
|
38
|
+
defaultFocusable: IFocusable | null;
|
|
39
|
+
lastFocusable: IFocusable | null;
|
|
40
|
+
current: boolean;
|
|
41
|
+
availableFocusables: IFocusable[];
|
|
42
|
+
setCurrentFocusable(focusable: IFocusable | null): IFocusable | null;
|
|
43
|
+
hasFocusable(focusable: IFocusable | null): boolean;
|
|
44
|
+
setCurrent(): void;
|
|
45
|
+
addFocusable(focusable: IFocusable, isDefault?: boolean): void;
|
|
46
|
+
removeFocusable(focusable: IFocusable): void;
|
|
47
|
+
sortFocusables(): void;
|
|
48
|
+
sortFocusablesByPosition(): void;
|
|
49
|
+
next(): IFocusable | null;
|
|
50
|
+
prev(): IFocusable | null;
|
|
51
|
+
}
|
|
52
|
+
export type FocusChangeDetail = {
|
|
53
|
+
layer: string | number | null;
|
|
54
|
+
focusable: IFocusable | null;
|
|
55
|
+
};
|
|
56
|
+
export interface IFocusManagerPlugin extends IPlugin {
|
|
57
|
+
readonly view: Container;
|
|
58
|
+
readonly layerCount: number;
|
|
59
|
+
readonly currentLayer: IFocusLayer | undefined;
|
|
60
|
+
readonly currentLayerId: string | number | null;
|
|
61
|
+
readonly active: boolean;
|
|
62
|
+
readonly layers: Map<string | number, IFocusLayer>;
|
|
63
|
+
onFocusManagerActivated: Signal<() => void>;
|
|
64
|
+
onFocusManagerDeactivated: Signal<() => void>;
|
|
65
|
+
onFocusLayerChange: Signal<(currentLayerId: string | number) => void>;
|
|
66
|
+
onFocusChange: Signal<(detail: FocusChangeDetail) => void>;
|
|
67
|
+
enabled: boolean;
|
|
68
|
+
restart(): void;
|
|
69
|
+
focus(focusable: IFocusable): void;
|
|
70
|
+
forceFocus(focusable: IFocusable): void;
|
|
71
|
+
setFocus(focusable: IFocusable): void;
|
|
72
|
+
addFocusLayer(layerId?: string | number, setAsCurrent?: boolean, focusables?: IFocusable | IFocusable[]): IFocusLayer;
|
|
73
|
+
removeFocusLayer(layerId?: string | number): void;
|
|
74
|
+
setFocusLayer(layerId: string | number): void;
|
|
75
|
+
setLayerOrder(layerIds: (string | number)[]): void;
|
|
76
|
+
add(focusable: IFocusable | IFocusable[], layerId?: string | number, isDefault?: boolean): void;
|
|
77
|
+
addFocusable(focusable: IFocusable | IFocusable[], layerId?: string | number, isDefault?: boolean): void;
|
|
78
|
+
remove(focusable: IFocusable | IFocusable[]): void;
|
|
79
|
+
removeFocusable(focusable: IFocusable | IFocusable[]): void;
|
|
80
|
+
deactivate(): void;
|
|
81
|
+
clearFocus(): void;
|
|
82
|
+
removeAllFocusLayers(): void;
|
|
83
|
+
sortFocusablesByPosition(): void;
|
|
84
|
+
}
|
|
85
|
+
export declare class FocusManagerPlugin extends Plugin<FocusManagerPluginOptions> implements IFocusManagerPlugin {
|
|
86
|
+
readonly id: string;
|
|
87
|
+
readonly view: Container<import('pixi.js').ContainerChild>;
|
|
88
|
+
onFocusManagerActivated: Signal<() => void>;
|
|
89
|
+
onFocusManagerDeactivated: Signal<() => void>;
|
|
90
|
+
onFocusLayerChange: Signal<(currentLayerId: string | number) => void>;
|
|
91
|
+
onFocusChange: Signal<(detail: FocusChangeDetail) => void>;
|
|
92
|
+
private _focusOutliner;
|
|
93
|
+
private _focusTarget;
|
|
94
|
+
private _keyboardActive;
|
|
95
|
+
private _layers;
|
|
96
|
+
get layers(): Map<string | number, IFocusLayer>;
|
|
97
|
+
private _currentLayerId;
|
|
98
|
+
get currentLayerId(): string | number | null;
|
|
99
|
+
get currentLayer(): IFocusLayer | undefined;
|
|
100
|
+
private _active;
|
|
101
|
+
get active(): boolean;
|
|
102
|
+
private _enabled;
|
|
103
|
+
get enabled(): boolean;
|
|
104
|
+
set enabled(value: boolean);
|
|
105
|
+
get layerCount(): number;
|
|
106
|
+
sortFocusablesByPosition(): void;
|
|
107
|
+
initialize(_options: Partial<FocusManagerPluginOptions>, app: IApplication): void;
|
|
108
|
+
destroy(): void;
|
|
109
|
+
deactivate(): void;
|
|
110
|
+
add(focusable: IFocusable | IFocusable[], layerId?: string | number, isDefault?: boolean): void;
|
|
111
|
+
addFocusable(focusable: IFocusable | IFocusable[], layerId?: string | number | null | undefined, isDefault?: boolean): void;
|
|
112
|
+
remove(focusable: IFocusable | IFocusable[]): void;
|
|
113
|
+
removeFocusable(focusable: IFocusable | IFocusable[]): void;
|
|
114
|
+
setLayerOrder(layerIds: (string | number)[]): void;
|
|
115
|
+
addFocusLayer(layerId?: string | number, setAsCurrent?: boolean, focusables?: IFocusable | IFocusable[]): IFocusLayer;
|
|
116
|
+
removeFocusLayer(layerId?: string | number, removeTopLayerIfUndefined?: boolean): void;
|
|
117
|
+
restart(reverse?: boolean): void;
|
|
118
|
+
forceFocus(focusable: IFocusable): void;
|
|
119
|
+
setFocus(focusable: IFocusable): void;
|
|
120
|
+
focus(focusable: IFocusable): void;
|
|
121
|
+
setFocusLayer(layerId: string | number): void;
|
|
122
|
+
postInitialize(_app: IApplication): Promise<void> | void;
|
|
123
|
+
clearFocus(): void;
|
|
124
|
+
removeAllFocusLayers(): void;
|
|
125
|
+
_onKeyDown(e: KeyboardEvent): void;
|
|
126
|
+
_onKeyUp(e: any): void;
|
|
127
|
+
_onMouseMove(e: MouseEvent): void;
|
|
128
|
+
protected getCoreFunctions(): string[];
|
|
129
|
+
protected getCoreSignals(): string[];
|
|
130
|
+
private _next;
|
|
131
|
+
private _prev;
|
|
132
|
+
private _deactivate;
|
|
133
|
+
private _activate;
|
|
134
|
+
private _updatePixiAccessibility;
|
|
135
|
+
private _getCurrentLayer;
|
|
136
|
+
private _removeTopLayer;
|
|
137
|
+
private _postDelete;
|
|
138
|
+
private _setTarget;
|
|
139
|
+
private _clearFocusTarget;
|
|
140
|
+
private _setupKeyboardListeners;
|
|
141
|
+
private _addGlobalListeners;
|
|
142
|
+
private _removeGlobalListeners;
|
|
143
|
+
private _handleGlobalMouseMove;
|
|
144
|
+
private _handleGlobalPointerDown;
|
|
145
|
+
private _setupAppListeners;
|
|
146
|
+
private _updateOutliner;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=FocusManagerPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusManagerPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/focus/FocusManagerPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,IAA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,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAkB7C,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAExD,UAAU;IAIV,oBAAoB,IAAI,IAAI;IAKnC,UAAU,CAAC,CAAC,EAAE,aAAa;IAiC3B,QAAQ,CAAC,CAAC,EAAE,GAAG;IAef,YAAY,CAAC,CAAC,EAAE,UAAU;IAO1B,SAAS,CAAC,gBAAgB,IAAI,MAAM,EAAE;IAetC,SAAS,CAAC,cAAc,IAAI,MAAM,EAAE;IAIpC,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,wBAAwB;IAkBhC,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,UAAU;IAwDlB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,uBAAuB;IAK/B,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,sBAAsB;IAS9B,OAAO,CAAC,wBAAwB;IAchC,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,eAAe;CAOxB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Bounds, Container, DestroyOptions, Graphics, PointLike } from 'pixi.js';
|
|
2
|
+
import { IFocusable } from './FocusManagerPlugin';
|
|
3
|
+
export type FocusOutlinerConfig = {
|
|
4
|
+
color: number;
|
|
5
|
+
shape: 'rectangle' | 'rounded rectangle';
|
|
6
|
+
lineWidth?: number;
|
|
7
|
+
radius?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface IFocusOutliner {
|
|
10
|
+
position: PointLike;
|
|
11
|
+
focusBounds: Bounds;
|
|
12
|
+
draw(focusTarget: IFocusable): void;
|
|
13
|
+
clear(): void;
|
|
14
|
+
destroy(args?: DestroyOptions): void;
|
|
15
|
+
setFocusTarget(focusTarget: IFocusable): void;
|
|
16
|
+
clearFocusTarget(): void;
|
|
17
|
+
updatePosition(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class FocusOutliner extends Container implements IFocusOutliner {
|
|
20
|
+
focusBounds: Bounds;
|
|
21
|
+
focusTarget: IFocusable | null;
|
|
22
|
+
protected _config: FocusOutlinerConfig;
|
|
23
|
+
protected _graphics: Graphics;
|
|
24
|
+
constructor(config?: Partial<FocusOutlinerConfig>);
|
|
25
|
+
draw(focusTarget: IFocusable): void;
|
|
26
|
+
clear(): void;
|
|
27
|
+
destroy(options?: DestroyOptions): void;
|
|
28
|
+
setFocusTarget(focusTarget: IFocusable): void;
|
|
29
|
+
clearFocusTarget(): void;
|
|
30
|
+
updatePosition(): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=FocusOutliner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusOutliner.d.ts","sourceRoot":"","sources":["../../../src/plugins/focus/FocusOutliner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAS,SAAS,EAAE,MAAM,SAAS,CAAC;AAGxF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,IAAI,CAAC;IAEpC,KAAK,IAAI,IAAI,CAAC;IAEd,OAAO,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAErC,cAAc,CAAC,WAAW,EAAE,UAAU,GAAG,IAAI,CAAC;IAE9C,gBAAgB,IAAI,IAAI,CAAC;IAEzB,cAAc,IAAI,IAAI,CAAC;CACxB;AAED,qBAAa,aAAc,SAAQ,SAAU,YAAW,cAAc;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACvC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC;gBAElB,MAAM,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAc1C,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,IAAI;IAgBnC,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,OAAO,CAAC,EAAE,cAAc;IAMhC,cAAc,CAAC,WAAW,EAAE,UAAU;IAQtC,gBAAgB;IAKhB,cAAc;CAmBtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/focus/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Signal } from '../signals';
|
|
2
|
+
import { AppTypeOverrides, ImportListItemModule } from '../utils';
|
|
3
|
+
import { IPlugin, Plugin } from './Plugin';
|
|
4
|
+
/**
|
|
5
|
+
* Flattened dot-path keys for the project's reference locale (e.g. 'foo',
|
|
6
|
+
* 'obj.nested'). Generated from `src/locales/<reference>.ts` by the Vite
|
|
7
|
+
* plugin. Falls back to `string` when no locales are discovered.
|
|
8
|
+
*
|
|
9
|
+
* `(string & {})` preserves autocomplete for known keys while still
|
|
10
|
+
* accepting dynamic strings like `t(\`errors.\${code}\`)`.
|
|
11
|
+
*/
|
|
12
|
+
export type LocaleKey = AppTypeOverrides extends {
|
|
13
|
+
LocaleKeys: infer K extends string;
|
|
14
|
+
} ? K | (string & {}) : string;
|
|
15
|
+
/**
|
|
16
|
+
* Type definition for i18n dictionary.
|
|
17
|
+
*/
|
|
18
|
+
export type i18nDict = Record<string, any>;
|
|
19
|
+
/**
|
|
20
|
+
* Type definition for i18n translation parameters.
|
|
21
|
+
*/
|
|
22
|
+
export type i18nTParams = {
|
|
23
|
+
variant?: number | 'random';
|
|
24
|
+
} & Record<string, any>;
|
|
25
|
+
/**
|
|
26
|
+
* Type definition for i18n import list item.
|
|
27
|
+
*/
|
|
28
|
+
type i18nImportListItem<T> = {
|
|
29
|
+
id: string;
|
|
30
|
+
namedExport?: string;
|
|
31
|
+
options?: any;
|
|
32
|
+
module?: ImportListItemModule<T>;
|
|
33
|
+
} & {
|
|
34
|
+
json?: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Type definition for i18n options.
|
|
38
|
+
*/
|
|
39
|
+
export type i18nOptions = {
|
|
40
|
+
defaultLocale: string;
|
|
41
|
+
locales: string[];
|
|
42
|
+
loadAll: boolean;
|
|
43
|
+
files: i18nImportListItem<i18nDict>[];
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Interface for i18n module.
|
|
47
|
+
*/
|
|
48
|
+
export interface Ii18nPlugin extends IPlugin {
|
|
49
|
+
readonly locale: string;
|
|
50
|
+
readonly locales: string[];
|
|
51
|
+
onLocaleChanged: Signal<(locale: string) => void>;
|
|
52
|
+
setLocale(localeId: string): Promise<string>;
|
|
53
|
+
loadLocale(localeId: string): Promise<void>;
|
|
54
|
+
t(key: LocaleKey, params?: i18nTParams, locale?: string): string;
|
|
55
|
+
parse(input: string, locale?: string): string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* i18n module class.
|
|
59
|
+
*/
|
|
60
|
+
export declare class i18nPlugin extends Plugin<i18nOptions> implements Ii18nPlugin {
|
|
61
|
+
readonly id = "i18n";
|
|
62
|
+
onLocaleChanged: Signal<(locale: string) => void>;
|
|
63
|
+
private _dicts;
|
|
64
|
+
private _locale;
|
|
65
|
+
/**
|
|
66
|
+
* Getter for locale.
|
|
67
|
+
*/
|
|
68
|
+
get locale(): string;
|
|
69
|
+
get locales(): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Initializes the i18n module.
|
|
72
|
+
* sets the default locale and loads the locale files.
|
|
73
|
+
* @param app The application instance.
|
|
74
|
+
* @param options The i18n options.
|
|
75
|
+
* @returns Promise<void>
|
|
76
|
+
*/
|
|
77
|
+
initialize(options: Partial<i18nOptions>): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the locale.
|
|
80
|
+
* If the locale is not loaded, it will load it first.
|
|
81
|
+
* @param localeId The locale id to set.
|
|
82
|
+
* @returns Promise<string>
|
|
83
|
+
*/
|
|
84
|
+
setLocale(localeId: string): Promise<string>;
|
|
85
|
+
/**
|
|
86
|
+
* Translates a key into a string.
|
|
87
|
+
* If the key is not found, it will return an empty string.
|
|
88
|
+
* If the key is found, it will replace any placeholders in the string with the values from the params object.
|
|
89
|
+
* If the key contains a variant, it will select a random variant if the variant param is set to 'random'.
|
|
90
|
+
* If the key contains a number variant, it will select the variant based on the variant param.
|
|
91
|
+
* @param key The key to translate.
|
|
92
|
+
* @param params The parameters to replace in the string.
|
|
93
|
+
* @param locale The locale to use for translation.
|
|
94
|
+
* @returns The translated string.
|
|
95
|
+
*/
|
|
96
|
+
t(key: LocaleKey, params?: i18nTParams, locale?: string): string;
|
|
97
|
+
/**
|
|
98
|
+
* Translates a key into a string (alias for t)
|
|
99
|
+
* @param key The key to translate.
|
|
100
|
+
* @param params The parameters to replace in the string.
|
|
101
|
+
* @param locale The locale to use for translation.
|
|
102
|
+
* @returns The translated string.
|
|
103
|
+
*/
|
|
104
|
+
translate(key: LocaleKey, params?: i18nTParams, locale?: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Parses the input string and replaces anything in between {} braces, assuming it is a key in the dictionary.
|
|
107
|
+
* @param {string} input
|
|
108
|
+
* @param locale
|
|
109
|
+
* @returns {string}
|
|
110
|
+
*/
|
|
111
|
+
parse(input: string, locale?: string): string;
|
|
112
|
+
/**
|
|
113
|
+
* Loads a locale.
|
|
114
|
+
* @param localeId The locale id to load.
|
|
115
|
+
* @returns Promise<void>
|
|
116
|
+
*/
|
|
117
|
+
loadLocale(localeId: string): Promise<void>;
|
|
118
|
+
protected getCoreFunctions(): string[];
|
|
119
|
+
protected getCoreSignals(): string[];
|
|
120
|
+
/**
|
|
121
|
+
* Loads and sets a locale.
|
|
122
|
+
* If the locale is not loaded, it will load it first.
|
|
123
|
+
* @param localeId The locale id to load and set.
|
|
124
|
+
*/
|
|
125
|
+
private _loadAndSetLocale;
|
|
126
|
+
}
|
|
127
|
+
export {};
|
|
128
|
+
//# sourceMappingURL=i18nPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18nPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/i18nPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAkB,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,SAAS;IAAE,UAAU,EAAE,MAAM,CAAC,SAAS,MAAM,CAAA;CAAE,GACnF,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GACjB,MAAM,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GAAG,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,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC,CAA0C;IAElG,OAAO,CAAC,MAAM,CAAgC;IAE9C,OAAO,CAAC,OAAO,CAAS;IAExB;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,CAEtB;IAED;;;;;;OAMG;IACU,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAarE;;;;;OAKG;IAEG,SAAS,CAAC,QAAQ,EAAE,MAAM;IAMhC;;;;;;;;;;OAUG;IAEH,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,GAAE,MAAqB,GAAG,MAAM;IAgD9E;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,GAAE,MAAqB,GAAG,MAAM;IAItF;;;;;OAKG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,MAAqB,GAAG,MAAM;IAmB3D;;;;OAIG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM;IAWjC,SAAS,CAAC,gBAAgB,IAAI,MAAM,EAAE;IAItC,SAAS,CAAC,cAAc,IAAI,MAAM,EAAE;IAIpC;;;;OAIG;YACW,iBAAiB;CAMhC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * from './AssetsPlugin';
|
|
3
|
+
export * from './breakpoints';
|
|
4
|
+
export * from './DataAdapter';
|
|
5
|
+
export * from './audio';
|
|
6
|
+
export * from './focus';
|
|
7
|
+
export * from './FullScreenPlugin';
|
|
8
|
+
export * from './i18nPlugin';
|
|
9
|
+
export * from './input';
|
|
10
|
+
export * from './KeyboardPlugin';
|
|
11
|
+
export * from './LookupPlugin';
|
|
12
|
+
export * from './Plugin';
|
|
13
|
+
export * from './PopupManagerPlugin';
|
|
14
|
+
export * from './ResizerPlugin';
|
|
15
|
+
export * from './SceneManagerPlugin';
|
|
16
|
+
export * from './TimerPlugin';
|
|
17
|
+
export * from './WebEventsPlugin';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ControlsActionMap } from '../..';
|
|
2
|
+
import { IApplication } from '../../core';
|
|
3
|
+
export declare class AbstractControls {
|
|
4
|
+
protected scheme: any;
|
|
5
|
+
get app(): IApplication;
|
|
6
|
+
initialize(scheme: Partial<ControlsActionMap>): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=AbstractControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/input/AbstractControls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,qBAAa,gBAAgB;IAC3B,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC;IAEtB,IAAI,GAAG,IAAI,YAAY,CAEtB;IAED,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC;CAG9C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IApplication } from '../../core';
|
|
2
|
+
import { Action } from '../actions';
|
|
3
|
+
import { IControls, UserControls } from './interfaces';
|
|
4
|
+
import { KeyboardControls } from './keyboard';
|
|
5
|
+
import { TouchControls } from './touch';
|
|
6
|
+
export declare class Controls implements IControls {
|
|
7
|
+
keyboard: KeyboardControls;
|
|
8
|
+
touch: TouchControls;
|
|
9
|
+
constructor();
|
|
10
|
+
get app(): IApplication;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
isActionActive(action: Action): boolean;
|
|
13
|
+
initialize(scheme: UserControls): void;
|
|
14
|
+
connect(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=Controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../../src/plugins/input/Controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,qBAAa,QAAS,YAAW,SAAS;IACxC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;;IAMrB,IAAI,GAAG,IAAI,YAAY,CAEtB;IAED,OAAO;IASP,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAKvC,UAAU,CAAC,MAAM,EAAE,YAAY;IAYxB,OAAO;CAQf"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ActionsList, IActionsPlugin, Action } from '../actions';
|
|
2
|
+
import { Controls } from './Controls';
|
|
3
|
+
import { IApplication } from '../../core';
|
|
4
|
+
import { Signal } from '../../signals';
|
|
5
|
+
import { IPlugin, Plugin } from '../Plugin';
|
|
6
|
+
import { InputController } from './constants';
|
|
7
|
+
import { UserControls } from './interfaces';
|
|
8
|
+
export type InputManagerOptions = {
|
|
9
|
+
actions?: ActionsList;
|
|
10
|
+
controls?: UserControls;
|
|
11
|
+
};
|
|
12
|
+
export interface IInputPlugin extends IPlugin<InputManagerOptions> {
|
|
13
|
+
readonly controls: Controls;
|
|
14
|
+
activeGamepads: Map<string, Gamepad>;
|
|
15
|
+
activeControllers: Set<string>;
|
|
16
|
+
options: InputManagerOptions;
|
|
17
|
+
onGamepadConnected: Signal<(gamepad: Gamepad) => void>;
|
|
18
|
+
onGamepadDisconnected: Signal<(gamepad: Gamepad) => void>;
|
|
19
|
+
onControllerActivated: Signal<(controller: string) => void>;
|
|
20
|
+
onControllerDeactivated: Signal<(controller: string) => void>;
|
|
21
|
+
isControllerActive(controller: InputController): boolean;
|
|
22
|
+
isGamepadActive(gamepad: Gamepad): boolean;
|
|
23
|
+
isActionActive(action: Action): boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare class InputPlugin extends Plugin<InputManagerOptions> implements IInputPlugin {
|
|
26
|
+
readonly id = "input";
|
|
27
|
+
readonly controls: Controls;
|
|
28
|
+
activeGamepads: Map<string, Gamepad>;
|
|
29
|
+
activeControllers: Set<string>;
|
|
30
|
+
onGamepadConnected: Signal<(gamepad: Gamepad) => void>;
|
|
31
|
+
onGamepadDisconnected: Signal<(gamepad: Gamepad) => void>;
|
|
32
|
+
onControllerActivated: Signal<(controller: string) => void>;
|
|
33
|
+
onControllerDeactivated: Signal<(controller: string) => void>;
|
|
34
|
+
isActionActive(action: Action): boolean;
|
|
35
|
+
initialize(options: Partial<InputManagerOptions> | undefined, app: IApplication): Promise<void>;
|
|
36
|
+
postInitialize(): void;
|
|
37
|
+
destroy(): void;
|
|
38
|
+
isControllerActive(controller: InputController): boolean;
|
|
39
|
+
isGamepadActive(gamepad: Gamepad): boolean;
|
|
40
|
+
protected getCoreSignals(): string[];
|
|
41
|
+
private _activateController;
|
|
42
|
+
private _deactivateController;
|
|
43
|
+
private _activateGamepad;
|
|
44
|
+
private _deactivateGamepad;
|
|
45
|
+
private _onTouchStart;
|
|
46
|
+
private _onMouseMove;
|
|
47
|
+
private _onKeyDown;
|
|
48
|
+
private _onGamepadConnected;
|
|
49
|
+
private _onGamepadDisconnected;
|
|
50
|
+
get actionsPlugin(): IActionsPlugin;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=InputPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/input/InputPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAkB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,eAAe,EAAwB,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,OAAO,CAAC,mBAAmB,CAAC;IAChE,QAAQ,CAAC,QA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O,EAAE,OAAO,CAAC,mBAAmB,CAAC,YAAiB,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAenG,cAAc,IAAI,IAAI;IAM7B,OAAO,IAAI,IAAI;IAWf,kBAAkB,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO;IAIxD,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;IAI1C,SAAS,CAAC,cAAc,IAAI,MAAM,EAAE;IAIpC,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,sBAAsB;IAgB9B,IAAI,aAAa,IAAI,cAAc,CAElC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare enum InputControllerTypes {
|
|
2
|
+
Keyboard = "keyboard",
|
|
3
|
+
GamePad = "gamepad",
|
|
4
|
+
Mouse = "mouse",
|
|
5
|
+
Touch = "touch"
|
|
6
|
+
}
|
|
7
|
+
export type InputController = InputControllerTypes.Keyboard | InputControllerTypes.GamePad | InputControllerTypes.Mouse | InputControllerTypes.Touch;
|
|
8
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/plugins/input/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,eAAe,GACvB,oBAAoB,CAAC,QAAQ,GAC7B,oBAAoB,CAAC,OAAO,GAC5B,oBAAoB,CAAC,KAAK,GAC1B,oBAAoB,CAAC,KAAK,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './Controls';
|
|
3
|
+
export * from './InputPlugin';
|
|
4
|
+
export * from './interfaces';
|
|
5
|
+
export * from './keyboard';
|
|
6
|
+
export * from './methods';
|
|
7
|
+
export * from './touch';
|
|
8
|
+
export * from './types';
|
|
9
|
+
export * from './utils';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/input/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ActionContext, ActionMap, UserActions, UserButtons } from '../actions';
|
|
2
|
+
import { IKeyboardControlScheme, KeyboardControls } from './keyboard';
|
|
3
|
+
import { ITouchControlScheme, TouchControls } from './touch';
|
|
4
|
+
import { AbstractControlScheme, ControlsActionMap, KeyboardControlsMap, TouchControlsMap } from './types';
|
|
5
|
+
export interface ControlsAction {
|
|
6
|
+
context: ActionContext[] | '*' | (string & {});
|
|
7
|
+
input: string | string[];
|
|
8
|
+
}
|
|
9
|
+
export interface IGamepadControlScheme extends AbstractControlScheme<'buttonDown' | 'buttonUp' | 'axis'> {
|
|
10
|
+
buttonDown?: ControlsActionMap;
|
|
11
|
+
buttonUp?: ControlsActionMap;
|
|
12
|
+
axis?: ControlsActionMap;
|
|
13
|
+
}
|
|
14
|
+
export interface ControlScheme {
|
|
15
|
+
keyboard?: IKeyboardControlScheme;
|
|
16
|
+
touch?: ITouchControlScheme;
|
|
17
|
+
gamepad?: IGamepadControlScheme;
|
|
18
|
+
}
|
|
19
|
+
export interface IControls {
|
|
20
|
+
readonly keyboard: KeyboardControls;
|
|
21
|
+
readonly touch: TouchControls;
|
|
22
|
+
isActionActive(action: string): boolean;
|
|
23
|
+
initialize(scheme: UserControls, actions: ActionMap): void;
|
|
24
|
+
destroy(): void;
|
|
25
|
+
}
|
|
26
|
+
export interface UserControls<U extends UserActions = UserActions, B extends UserButtons = UserButtons> {
|
|
27
|
+
keyboard: Partial<KeyboardControlsMap<U>>;
|
|
28
|
+
touch: Partial<TouchControlsMap<U, B>>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/plugins/input/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE1G,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,aAAa,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC/C,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB,CAAC,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;IACtG,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,OAAO,CAAC,EAAE,qBAAqB,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAE9B,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAExC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;IAE3D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,CAAC,SAAS,WAAW,GAAG,WAAW;IACpG,QAAQ,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACxC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Application } from '../../../core/Application';
|
|
2
|
+
import { Action } from '../../actions';
|
|
3
|
+
import { AbstractControls } from '../AbstractControls';
|
|
4
|
+
import { KeyboardControlsMap } from '../types';
|
|
5
|
+
declare const KeyboardControls_base: typeof AbstractControls & import('../../..').Constructor<import('../../..').ISignalContainer>;
|
|
6
|
+
export declare class KeyboardControls extends KeyboardControls_base {
|
|
7
|
+
protected scheme: Partial<KeyboardControlsMap>;
|
|
8
|
+
private _keyDownMap;
|
|
9
|
+
private _keyUpMap;
|
|
10
|
+
private _keyCombinations;
|
|
11
|
+
private _singleDownKeys;
|
|
12
|
+
private _keyCombinationsMap;
|
|
13
|
+
private _activeDownKeys;
|
|
14
|
+
private _activeUpKeys;
|
|
15
|
+
constructor();
|
|
16
|
+
get app(): Application;
|
|
17
|
+
isActionActive(action: Action): boolean;
|
|
18
|
+
initialize(scheme: Partial<KeyboardControlsMap>): void;
|
|
19
|
+
connect(): void;
|
|
20
|
+
private _sortActions;
|
|
21
|
+
private _handleContextChanged;
|
|
22
|
+
private _getPossibleActions;
|
|
23
|
+
private _handleKeyDown;
|
|
24
|
+
private _handleKeyUp;
|
|
25
|
+
private _update;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=KeyboardContols.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyboardContols.d.ts","sourceRoot":"","sources":["../../../../src/plugins/input/keyboard/KeyboardContols.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAqB,mBAAmB,EAA0B,MAAM,UAAU,CAAC;;AAE/F,qBAAa,gBAAiB,SAAQ,qBAA6B;IACjE,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC/C,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,eAAe,CAA0B;IACjD,OAAO,CAAC,mBAAmB,CAAoC;IAC/D,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,aAAa,CAAkC;;IAOvD,IAAI,GAAG,gBAEN;IAED,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAchC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,IAAI;IAOtD,OAAO;IAWd,OAAO,CAAC,YAAY;IAwDpB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,OAAO;CA2ChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/input/keyboard/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { KeyboardKey } from '../../../utils';
|
|
2
|
+
import { Action, ActionContext } from '../../actions';
|
|
3
|
+
import { AbstractControlScheme, ControlsActionMap } from '../types';
|
|
4
|
+
type KeyboardInput = (string & {}) | KeyboardKey | `${KeyboardKey}+${KeyboardKey}` | `${KeyboardKey}*`;
|
|
5
|
+
export interface KeyboardControlsAction {
|
|
6
|
+
context: ActionContext[] | '*';
|
|
7
|
+
input: KeyboardInput | KeyboardInput[];
|
|
8
|
+
}
|
|
9
|
+
export type KeyboardControlsActionMap = {
|
|
10
|
+
[actionName: Action | string]: KeyboardControlsAction;
|
|
11
|
+
};
|
|
12
|
+
export interface IKeyboardControlScheme extends AbstractControlScheme<'down' | 'up'> {
|
|
13
|
+
down?: KeyboardControlsActionMap;
|
|
14
|
+
up?: KeyboardControlsActionMap;
|
|
15
|
+
[key: string]: ControlsActionMap | undefined;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/plugins/input/keyboard/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGpE,KAAK,aAAa,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,WAAW,GAAG,GAAG,WAAW,IAAI,WAAW,EAAE,GAAG,GAAG,WAAW,GAAG,CAAC;AAEvG,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC;IAC/B,KAAK,EAAE,aAAa,GAAG,aAAa,EAAE,CAAC;CACxC;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,sBAAsB,CAAC;CACvD,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB,CAAC,MAAM,GAAG,IAAI,CAAC;IAClF,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,EAAE,CAAC,EAAE,yBAAyB,CAAC;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAAC;CAC9C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UserActions, UserButtons } from '../actions';
|
|
2
|
+
import { UserControls } from './interfaces';
|
|
3
|
+
export declare function defineControls<U extends UserActions = UserActions, B extends UserButtons = UserButtons>(actions: U, buttons: B, controls?: UserControls<U, B>): UserControls<U, B>;
|
|
4
|
+
//# sourceMappingURL=methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../../src/plugins/input/methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,wBAAgB,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,CAAC,SAAS,WAAW,GAAG,WAAW,EACrG,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,CAAC,EACV,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GAC5B,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAEpB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TouchControlsMap } from '../types';
|
|
2
|
+
import { Application } from '../../../core/Application';
|
|
3
|
+
import { IButton, IJoystick } from '../../../ui';
|
|
4
|
+
import { Action } from '../../actions';
|
|
5
|
+
import { AbstractControls } from '../AbstractControls';
|
|
6
|
+
declare const TouchControls_base: typeof AbstractControls & import('../../..').Constructor<import('../../..').ISignalContainer>;
|
|
7
|
+
export declare class TouchControls extends TouchControls_base {
|
|
8
|
+
protected scheme: Partial<TouchControlsMap>;
|
|
9
|
+
private _buttons;
|
|
10
|
+
private _joystickMap;
|
|
11
|
+
private _buttonDownMap;
|
|
12
|
+
private _buttonUpMap;
|
|
13
|
+
private _combinations;
|
|
14
|
+
private _singleDownButtons;
|
|
15
|
+
private _activeJoystickDirections;
|
|
16
|
+
private _activeButtonDownIds;
|
|
17
|
+
private _activeButtonUpIds;
|
|
18
|
+
private _combinationsMap;
|
|
19
|
+
constructor();
|
|
20
|
+
private _joystick;
|
|
21
|
+
get joystick(): IJoystick;
|
|
22
|
+
set joystick(value: IJoystick);
|
|
23
|
+
get app(): Application;
|
|
24
|
+
addButton(button: IButton): void;
|
|
25
|
+
removeButton(button: IButton): void;
|
|
26
|
+
initialize(scheme: Partial<TouchControlsMap>): void;
|
|
27
|
+
connect(): void;
|
|
28
|
+
isActionActive(action: Action): boolean;
|
|
29
|
+
private _sortActions;
|
|
30
|
+
private _handleButtonDown;
|
|
31
|
+
private _handleButtonUp;
|
|
32
|
+
private _update;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=TouchControls.d.ts.map
|