@stanko/kaplay-inspector 0.2.0 → 0.2.1

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.
@@ -12,7 +12,7 @@ export const AnchorControl = ({ className = "", obj }) => {
12
12
  const isString = typeof obj.anchor === "string";
13
13
  return (_jsx("div", { class: cx(className, "anchor-control"), children: isString ? (_jsxs(_Fragment, { children: [_jsxs("div", { class: "anchor-radios", children: [strings.map((row, i) => {
14
14
  return (_jsx("div", { class: "anchor-row", children: row.map((anchor) => {
15
- return (_jsx("label", { children: _jsx("input", { type: "radio", name: "anchor", value: anchor, checked: anchor === object.anchor, onChange: () => (object.anchor = anchor) }) }, anchor));
15
+ return (_jsx("label", { children: _jsx("input", { type: "radio", name: `anchor-${obj.id}`, value: anchor, checked: anchor === object.anchor, onChange: () => (object.anchor = anchor) }) }, anchor));
16
16
  }) }, i));
17
17
  }), _jsx("div", { children: isString && object.anchor })] }), _jsx("button", { class: "ki-btn", onClick: () => (object.anchor = k.vec2(0, 0)), children: "Use a vector" })] })) : (_jsxs(_Fragment, { children: [_jsx(VectorControl, { obj: obj, property: "anchor", step: 0.1 }), _jsx("button", { class: "ki-btn", onClick: () => (object.anchor = "center"), children: "Use a named location" })] })) }));
18
18
  };
@@ -54,7 +54,7 @@ export const inspectComps = (obj) => {
54
54
  // Commented out on purpose
55
55
  // For now, only the name of the component is shown,
56
56
  // until I try it out and figure if it would be useful to display the full component state
57
- // value: stringify(comp),
57
+ // value: <pre>{stringify(comp)}</pre>,
58
58
  });
59
59
  }
60
60
  }
@@ -86,10 +86,18 @@ export const inspectComps = (obj) => {
86
86
  });
87
87
  }
88
88
  else {
89
- data.push({
90
- tag: key,
91
- value,
92
- });
89
+ if (typeof value === "number") {
90
+ data.push({
91
+ tag: key,
92
+ value: _jsx(NumberControl, { obj: obj, property: key }),
93
+ });
94
+ }
95
+ else {
96
+ data.push({
97
+ tag: key,
98
+ value,
99
+ });
100
+ }
93
101
  }
94
102
  }
95
103
  }
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.2.0",
5
+ "version": "0.2.1",
6
6
  "type": "module",
7
7
  "main": "./dist/init.js",
8
8
  "types": "./dist/init.d.ts",
@@ -24,13 +24,13 @@
24
24
  "kaplay": "^4000.0.0-alpha.26"
25
25
  },
26
26
  "dependencies": {
27
- "preact": "^10.28.2"
27
+ "preact": "^10.29.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@preact/preset-vite": "^2.10.2",
31
- "@types/node": "^25.0.6",
32
- "typescript": "~5.9.3",
33
- "vite": "^7.3.1",
30
+ "@preact/preset-vite": "^2.10.5",
31
+ "@types/node": "^25.8.0",
32
+ "typescript": "~6.0.3",
33
+ "vite": "^8.0.13",
34
34
  "kaplay": "^4000.0.0-alpha.26"
35
35
  },
36
36
  "repository": {