@kvyverse/world-runtime 0.5.0 → 0.6.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.
@@ -17,7 +17,7 @@ var PointerLockCameraControls = class extends Object3DBehaviour {
17
17
  _detach;
18
18
  onEnable() {
19
19
  const env = this.modules.env;
20
- this._canBeLocked = env.prod && !env.isMobile;
20
+ this._canBeLocked = !env.dev && !env.isMobile;
21
21
  this._isMobile = env.isMobile;
22
22
  const dom = this.ctx.renderer.domElement;
23
23
  const lock = () => {
package/dist/index.js CHANGED
@@ -551,15 +551,17 @@ function isMobileDevice() {
551
551
  //#endregion
552
552
  //#region packages/world-runtime/src/modules/EnvModule.ts
553
553
  var EnvModule = class extends ContextModule {
554
- dev = true;
555
- prod = true;
556
554
  mode;
555
+ dev;
556
+ prod;
557
+ selfHosted;
557
558
  isMobile;
558
559
  constructor(mode) {
559
560
  super();
560
561
  this.mode = mode;
561
562
  this.dev = mode === "dev";
562
563
  this.prod = mode === "prod";
564
+ this.selfHosted = mode === "selfhosted";
563
565
  this.isMobile = isMobileDevice();
564
566
  }
565
567
  };
@@ -945,7 +947,7 @@ var entries = [
945
947
  {
946
948
  uuid: "pointerlockcameracontrols",
947
949
  name: "PointerLockCameraController",
948
- load: () => loadDefault(import("./PointerLockCameraControls-DYxxMeSw.js"))
950
+ load: () => loadDefault(import("./PointerLockCameraControls-DIK3cVmo.js"))
949
951
  },
950
952
  {
951
953
  uuid: "simplewasdmovement",
@@ -1575,7 +1577,7 @@ function isAbsoluteUrl(url) {
1575
1577
  }
1576
1578
  //#endregion
1577
1579
  //#region packages/world-runtime/src/version.gen.ts
1578
- var RUNTIME_VERSION = "0.5.0";
1580
+ var RUNTIME_VERSION = "0.6.0";
1579
1581
  //#endregion
1580
1582
  //#region packages/world-runtime/src/version.ts
1581
1583
  /**
@@ -1642,7 +1644,7 @@ async function createWorld(definition, runtime) {
1642
1644
  scene: new THREE.Scene(),
1643
1645
  autoInitRenderer: false
1644
1646
  }, runtime);
1645
- world.addModules(await createWorldModules("prod", {
1647
+ world.addModules(await createWorldModules("selfhosted", {
1646
1648
  addons: runtime.addons,
1647
1649
  modules: runtime.definition.addons?.modules
1648
1650
  }));
@@ -1,11 +1,13 @@
1
1
  import { ContextModule } from "three-start";
2
2
  import type { EnvModuleApi } from "./contracts/env.module-api";
3
- /** Where the world runs: `dev` — testplay from the editor, `prod` — the game. */
3
+ /** Where the world runs: `dev` — editor testplay, `prod` — platform game,
4
+ * `selfhosted` — self-hosted export. */
4
5
  export type EnvMode = EnvModuleApi["mode"];
5
6
  export declare class EnvModule extends ContextModule implements EnvModuleApi {
6
- dev: boolean;
7
- prod: boolean;
8
- mode: EnvMode;
9
- isMobile: boolean;
7
+ readonly mode: EnvMode;
8
+ readonly dev: boolean;
9
+ readonly prod: boolean;
10
+ readonly selfHosted: boolean;
11
+ readonly isMobile: boolean;
10
12
  constructor(mode: EnvMode);
11
13
  }
@@ -1,7 +1,16 @@
1
- /** Public API of the `env` module — environment flags (dev/prod, mobile). */
1
+ /**
2
+ * Public API of the `env` module — where the world runs. Exactly one of
3
+ * `dev`/`prod`/`selfHosted` is true, matching `mode`. For "any real run, not
4
+ * editor testplay" use `!env.dev`.
5
+ */
2
6
  export interface EnvModuleApi {
7
+ /** Editor testplay run. */
3
8
  readonly dev: boolean;
9
+ /** Published game on the Kvyverse platform. */
4
10
  readonly prod: boolean;
5
- readonly mode: "dev" | "prod";
11
+ /** Self-hosted export, running outside the Kvyverse platform. */
12
+ readonly selfHosted: boolean;
13
+ /** Precise runtime context. */
14
+ readonly mode: "dev" | "prod" | "selfhosted";
6
15
  readonly isMobile: boolean;
7
16
  }
@@ -1 +1 @@
1
- export declare const RUNTIME_VERSION = "0.5.0";
1
+ export declare const RUNTIME_VERSION = "0.6.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvyverse/world-runtime",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Runtime for worlds exported from the Kvyverse platform for self-hosting",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Vladislav Kruteniuk",