@stanko/kaplay-inspector 0.1.4 → 0.1.5

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.
@@ -6,5 +6,5 @@ export const PositionControls = ({ obj }) => {
6
6
  if (!obj.pos) {
7
7
  return null;
8
8
  }
9
- return (_jsxs("div", { class: "pos-controls", children: [_jsx(HoldButton, { className: "ki-btn", onClickAndHold: () => (obj.pos.x -= 1), children: _jsx(ArrowLeftIcon, {}) }), _jsx(HoldButton, { className: "ki-btn", onClickAndHold: () => (obj.pos.x += 1), children: _jsx(ArrowRightIcon, {}) }), _jsxs("div", { class: "pos-controls__value", children: ["x: ", roundToDecimal(obj.pos.x, 2)] }), _jsxs("div", { class: "pos-controls__value", children: ["y: ", roundToDecimal(obj.pos.y, 2)] }), _jsx(HoldButton, { className: "ki-btn", onClickAndHold: () => (obj.pos.y -= 1), children: _jsx(ArrowUpIcon, {}) }), _jsx(HoldButton, { className: "ki-btn", onClickAndHold: () => (obj.pos.y += 1), children: _jsx(ArrowDownIcon, {}) })] }));
9
+ return (_jsxs("div", { class: "pos-controls", children: [_jsx(HoldButton, { className: "ki-btn", onClickAndHold: () => obj.moveTo(obj.pos.x - 1, obj.pos.y), children: _jsx(ArrowLeftIcon, {}) }), _jsx(HoldButton, { className: "ki-btn", onClickAndHold: () => obj.moveTo(obj.pos.x + 1, obj.pos.y), children: _jsx(ArrowRightIcon, {}) }), _jsxs("div", { class: "pos-controls__value", children: ["x: ", roundToDecimal(obj.pos.x, 2)] }), _jsxs("div", { class: "pos-controls__value", children: ["y: ", roundToDecimal(obj.pos.y, 2)] }), _jsx(HoldButton, { className: "ki-btn", onClickAndHold: () => obj.moveTo(obj.pos.x, obj.pos.y - 1), children: _jsx(ArrowUpIcon, {}) }), _jsx(HoldButton, { className: "ki-btn", onClickAndHold: () => obj.moveTo(obj.pos.x, obj.pos.y + 1), children: _jsx(ArrowDownIcon, {}) })] }));
10
10
  };
@@ -68,7 +68,7 @@ export const inspectComps = (obj) => {
68
68
  else if (typeof value === "object") {
69
69
  data.push({
70
70
  tag: key,
71
- value: stringify(value),
71
+ value: value === null ? "null" : stringify(value),
72
72
  });
73
73
  }
74
74
  else {
@@ -4,7 +4,10 @@ export const stringify = (obj, maxDepth = 1, currentDepth = 0) => {
4
4
  return JSON.stringify(obj);
5
5
  }
6
6
  const lines = Object.entries(obj).map(([key, value]) => {
7
- if (typeof value === "function") {
7
+ if (value === null) {
8
+ return `${key}: null`;
9
+ }
10
+ else if (typeof value === "function") {
8
11
  return `${key}: function`;
9
12
  }
10
13
  else if (typeof value === "object") {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stanko/kaplay-inspector",
3
3
  "description": "A dev tool for Kaplay which allows you to explore and inspect the game object tree real time.",
4
4
  "private": false,
5
- "version": "0.1.4",
5
+ "version": "0.1.5",
6
6
  "type": "module",
7
7
  "main": "./dist/init.js",
8
8
  "types": "./dist/init.d.ts",