@remvst/game-navigation-react 1.4.1 → 2.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # @remvst/game-navigation-react
2
+
3
+ ## 2.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [404cc59]
8
+ - @remvst/game-navigation-core@2.0.0
9
+ - @remvst/game-navigation-html@2.0.0
package/lib/index.js CHANGED
@@ -1,18 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./react-game-plugin"), exports);
18
- __exportStar(require("./react-screen"), exports);
1
+ export * from "./react-game-plugin";
2
+ export * from "./react-screen";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReactGamePlugin = void 0;
4
- const game_navigation_core_1 = require("@remvst/game-navigation-core");
5
- class ReactGamePlugin extends game_navigation_core_1.GamePlugin {
1
+ import { GamePlugin } from "@remvst/game-navigation-core";
2
+ export class ReactGamePlugin extends GamePlugin {
6
3
  constructor() {
7
4
  super(...arguments);
8
5
  this.key = ReactGamePlugin.key;
9
6
  }
10
7
  }
11
- exports.ReactGamePlugin = ReactGamePlugin;
12
8
  ReactGamePlugin.key = "react";
9
+ //# sourceMappingURL=react-game-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-game-plugin.js","sourceRoot":"","sources":["../src/react-game-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAA/C;;QAEa,QAAG,GAAG,eAAe,CAAC,GAAG,CAAC;IACvC,CAAC;CAAA;AAFmB,mBAAG,GAAG,OAAO,AAAV,CAAW"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { HTMLScreen } from "@remvst/game-navigation-html";
3
2
  export declare abstract class ReactScreen extends HTMLScreen {
4
3
  private root;
@@ -1,37 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReactScreen = void 0;
4
- const game_navigation_html_1 = require("@remvst/game-navigation-html");
5
- const client_1 = require("react-dom/client");
6
- class ReactScreen extends game_navigation_html_1.HTMLScreen {
1
+ import { HTMLScreen } from "@remvst/game-navigation-html";
2
+ import { createRoot } from "react-dom/client";
3
+ export class ReactScreen extends HTMLScreen {
7
4
  constructor() {
8
5
  super(...arguments);
9
6
  this.rootContainer = document.createElement("div");
10
7
  }
11
8
  setup() {
12
9
  super.setup();
13
- this.root = (0, client_1.createRoot)(this.rootContainer);
10
+ this.root = createRoot(this.rootContainer);
14
11
  this.rootComponent().then((component) => {
15
- this.root?.render(component);
12
+ var _a;
13
+ (_a = this.root) === null || _a === void 0 ? void 0 : _a.render(component);
16
14
  });
17
15
  this.rootContainer.style.width = "100%";
18
16
  this.rootContainer.style.height = "100%";
19
17
  this.view.appendChild(this.rootContainer);
20
18
  }
21
19
  destroy() {
20
+ var _a;
22
21
  super.destroy();
23
- this.root?.unmount();
22
+ (_a = this.root) === null || _a === void 0 ? void 0 : _a.unmount();
24
23
  this.root = null;
25
24
  }
26
25
  rebuild() {
27
- this.root?.unmount();
28
- const root = (0, client_1.createRoot)(this.rootContainer);
26
+ var _a;
27
+ (_a = this.root) === null || _a === void 0 ? void 0 : _a.unmount();
28
+ const root = createRoot(this.rootContainer);
29
29
  this.root = root;
30
30
  this.rootComponent().then((component) => {
31
+ var _a;
31
32
  if (this.root !== root)
32
33
  return;
33
- this.root?.render(component);
34
+ (_a = this.root) === null || _a === void 0 ? void 0 : _a.render(component);
34
35
  });
35
36
  }
36
37
  }
37
- exports.ReactScreen = ReactScreen;
38
+ //# sourceMappingURL=react-screen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-screen.js","sourceRoot":"","sources":["../src/react-screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAQ,MAAM,kBAAkB,CAAC;AAEpD,MAAM,OAAgB,WAAY,SAAQ,UAAU;IAApD;;QAEY,kBAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAmC1D,CAAC;IA/BG,KAAK;QACD,KAAK,CAAC,KAAK,EAAE,CAAC;QAEd,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;;YACpC,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC;QACxC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QAEzC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO;;QACH,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,MAAA,IAAI,CAAC,IAAI,0CAAE,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,OAAO;;QACH,MAAA,IAAI,CAAC,IAAI,0CAAE,OAAO,EAAE,CAAC;QAErB,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;;YACpC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;gBAAE,OAAO;YAC/B,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,22 +1,26 @@
1
1
  {
2
- "name": "@remvst/game-navigation-react",
3
- "version": "1.4.1",
4
- "description": "",
5
- "main": "lib/index.js",
6
- "scripts": {
7
- "build": "rm -rf lib && tsc",
8
- "prepublishOnly": "npm i && npm run build"
9
- },
10
- "author": "Rémi Vansteelandt",
11
- "license": "UNLICENSED",
12
- "peerDependencies": {
13
- "@remvst/game-navigation-core": "^1.4.x",
14
- "@remvst/game-navigation-html": "^1.4.x",
15
- "@types/react-dom": "^18.2.0",
16
- "react": "^18.2.0",
17
- "react-dom": "^18.2.0"
18
- },
19
- "devDependencies": {
20
- "typescript": "^5.2.2"
21
- }
22
- }
2
+ "name": "@remvst/game-navigation-react",
3
+ "version": "2.0.0",
4
+ "description": "Plugin for displaying screens as React containers",
5
+ "main": "lib/index.js",
6
+ "author": "Rémi Vansteelandt",
7
+ "license": "UNLICENSED",
8
+ "peerDependencies": {
9
+ "@types/react-dom": "^18.2.0",
10
+ "react": "^18.2.0",
11
+ "react-dom": "^18.2.0",
12
+ "@remvst/game-navigation-core": "^2.0.0",
13
+ "@remvst/game-navigation-html": "^2.0.0"
14
+ },
15
+ "devDependencies": {
16
+ "@types/react-dom": "^18.2.0",
17
+ "react": "^18.2.0",
18
+ "react-dom": "^18.2.0",
19
+ "typescript": "^7.0.2",
20
+ "@remvst/game-navigation-core": "2.0.0",
21
+ "@remvst/game-navigation-html": "2.0.0"
22
+ },
23
+ "scripts": {
24
+ "build": "rm -rf lib && tsc"
25
+ }
26
+ }
package/tsconfig.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
+ "extends": "../../../tsconfig.base.json",
2
3
  "compilerOptions": {
3
- "target": "es2020",
4
- "module": "commonjs",
5
- "declaration": true,
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
6
  "strict": false,
7
- "esModuleInterop": true,
8
- "allowJs": false,
9
7
  "outDir": "./lib",
10
- "skipLibCheck": true
8
+ "sourceMap": true,
9
+ "rootDir": "./src"
11
10
  },
12
- "include": ["./src/**/*"],
13
- "exclude": ["node_modules"]
11
+ "include": ["./src/**/*"]
14
12
  }