@stanko/kaplay-inspector 0.0.2 → 0.0.4
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/README.md +10 -6
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/game-object.js +5 -5
- package/dist/components/inspector.d.ts +3 -3
- package/dist/components/inspector.js +9 -2
- package/dist/components/position-controls.js +1 -1
- package/dist/init.d.ts +2 -0
- package/dist/init.js +5 -2
- package/dist/styles.css +92 -80
- package/package.json +6 -5
- package/public/favicon/apple-touch-icon.png +0 -0
- package/public/favicon/favicon.ico +0 -0
- package/public/favicon/favicon.png +0 -0
- package/public/fonts/Match7.ttf +0 -0
- package/public/fonts/Match7.woff +0 -0
- package/public/fonts/Nope8.png +0 -0
- package/public/fonts/Nope8.ttf +0 -0
- package/public/fonts/Nope8.woff +0 -0
- package/public/fonts/Tiny5-Regular.ttf +0 -0
- package/public/fonts/Tiny5-Regular.woff +0 -0
- package/public/sprites/bullets.png +0 -0
- package/public/sprites/moon.png +0 -0
- package/public/sprites/ship-trail.png +0 -0
- package/public/sprites/ship.png +0 -0
- package/public/sprites/stars.png +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Kaplay Inspector
|
|
2
2
|
|
|
3
|
-
A dev tool for [Kaplay](https://kaplayjs.com/) which allows you to explore and inspect the game object tree.
|
|
3
|
+
A dev tool for [Kaplay](https://kaplayjs.com/) which allows you to explore and inspect the game object tree real time.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -56,7 +56,7 @@ You can pass options object to the init method as a second parameter:
|
|
|
56
56
|
|
|
57
57
|
```ts
|
|
58
58
|
init(k, {
|
|
59
|
-
updateTimeout:
|
|
59
|
+
updateTimeout: 100,
|
|
60
60
|
})
|
|
61
61
|
```
|
|
62
62
|
|
|
@@ -64,18 +64,22 @@ available options are:
|
|
|
64
64
|
|
|
65
65
|
```ts
|
|
66
66
|
interface InspectorOptions {
|
|
67
|
-
updateTimeout?: number; // in milliseconds
|
|
67
|
+
updateTimeout?: number; // in milliseconds, default: 100
|
|
68
|
+
isVisible?: boolean; // is inspector visible on load, default: true
|
|
69
|
+
className?: string; // optional CSS class to add to the root element
|
|
68
70
|
}
|
|
69
71
|
```
|
|
70
72
|
|
|
73
|
+
### Positioning
|
|
74
|
+
|
|
75
|
+
By default, the inspector has `position: fixed` and it sits at the bottom of the screen. If you want to move it around, the easiest way it to pass a custom class name through the options and position it yourself.
|
|
76
|
+
|
|
71
77
|
|
|
72
78
|
## TODO
|
|
73
79
|
|
|
74
|
-
* [ ] Show/Hide button
|
|
75
80
|
* [ ] Bounding box - handle a case when anchor is a `Vec2`
|
|
76
81
|
* [ ] Controllable theme - system/light/dark. At the moment it is always matching the system.
|
|
77
82
|
* [ ] Filter/search
|
|
78
83
|
* [ ] Persist search in URL or local storage
|
|
79
|
-
* [ ] Build and deploy simple demo
|
|
80
84
|
* [ ] Figure out why child bounding box are drawn in the wrong position
|
|
81
|
-
* [ ]
|
|
85
|
+
* [ ] Collapse/Expand all button
|
|
@@ -13,5 +13,5 @@ export const Breadcrumbs = ({ obj, setRenderRoot }) => {
|
|
|
13
13
|
});
|
|
14
14
|
parent = parent.parent;
|
|
15
15
|
}
|
|
16
|
-
return (_jsxs("div", { class: "breadcrumbs", children: ["Back to", breadcrumbs.map((breadcrumb) => (_jsxs("button", { class: "btn", onClick: () => setRenderRoot(breadcrumb.object), children: ["ID ", breadcrumb.id, ": ", breadcrumb.tags || breadcrumb.compsLabel] })))] }));
|
|
16
|
+
return (_jsxs("div", { class: "breadcrumbs", children: ["Back to", breadcrumbs.map((breadcrumb) => (_jsxs("button", { class: "ki-btn", onClick: () => setRenderRoot(breadcrumb.object), children: ["ID ", breadcrumb.id, ": ", breadcrumb.tags || breadcrumb.compsLabel] })))] }));
|
|
17
17
|
};
|
|
@@ -34,9 +34,9 @@ export const GameObject = ({ obj, className = "", isExpanded: isExpandedExternal
|
|
|
34
34
|
const handleMouseLeave = () => {
|
|
35
35
|
mouseHoverController.current?.cancel();
|
|
36
36
|
};
|
|
37
|
-
return (_jsxs("div", { class: cx("
|
|
38
|
-
"
|
|
39
|
-
}), children: [isInspecting && _jsx(Breadcrumbs, { setRenderRoot: setRenderRoot, obj: obj }), _jsxs("div", { class: "
|
|
40
|
-
"
|
|
41
|
-
}), onClick: handleToggleClick, children: [_jsx("span", { class: "
|
|
37
|
+
return (_jsxs("div", { class: cx("game-object", className, {
|
|
38
|
+
"game-object--no-children": !hasChildren,
|
|
39
|
+
}), children: [isInspecting && _jsx(Breadcrumbs, { setRenderRoot: setRenderRoot, obj: obj }), _jsxs("div", { class: "game-object__content", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsxs("button", { class: cx("game-object__header", {
|
|
40
|
+
"game-object__header--expandable": showExpandTree,
|
|
41
|
+
}), onClick: handleToggleClick, children: [_jsx("span", { class: "game-object__expand-icon", children: isExpanded ? _jsx(MinusIcon, {}) : _jsx(PlusIcon, {}) }), _jsxs("div", { class: "game-object__id", children: ["ID ", obj.id, ":"] }), tags ? (_jsx("div", { class: "game-object__tags", children: isRootObject ? "Root" : tags })) : (_jsx("div", { class: "game-object__comp-names", children: compsLabel })), obj.children.length > 0 && _jsxs("div", { children: ["(", obj.children.length, ")"] }), isObjectDestroyed && (_jsx("div", { class: "game-object__destroyed", children: "DESTROYED" }))] }), _jsxs("div", { class: "game-object__buttons", children: [!isRenderRoot && (_jsx("button", { class: "ki-btn", onClick: () => setRenderRoot(obj), children: "inspect" })), _jsx("button", { class: "ki-btn ", onClick: () => console.log(obj), children: "log" })] }), isExpanded && (_jsx("div", { class: "game-object__comps-wrapper", children: _jsxs("div", { class: "game-object__comps", children: [_jsxs("div", { class: "game-object__comps-row", children: [_jsx("label", { for: `paused-${obj.id}`, children: _jsx("b", { children: "paused" }) }), _jsx("div", { children: _jsx("input", { id: `paused-${obj.id}`, type: "checkbox", defaultChecked: obj.paused, onChange: () => (obj.paused = !obj.paused) }) })] }), compsData.map((comp) => (_jsxs("div", { class: "game-object__comps-row", children: [_jsx("div", { children: _jsx("b", { children: comp.tag }) }), _jsx("div", { children: comp.value })] }, comp.tag)))] }) }))] }), isExpanded && hasChildren && (_jsx("div", { class: "game-object__children", style: { display: isExpanded ? "block" : "none" }, children: obj.children.map((child) => (_jsx(GameObject, { k: k, obj: child, setRenderRoot: setRenderRoot }, child.id))) }))] }, obj.id));
|
|
42
42
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { KAPLAYCtx } from "kaplay";
|
|
2
2
|
import type { InspectorOptions } from "../init";
|
|
3
3
|
export interface InspectorProps extends InspectorOptions {
|
|
4
|
-
k:
|
|
4
|
+
k: KAPLAYCtx;
|
|
5
5
|
}
|
|
6
|
-
export declare const Inspector: ({ updateTimeout, k }: InspectorProps) => import("preact").JSX.Element;
|
|
6
|
+
export declare const Inspector: ({ updateTimeout, isVisibleOnLoad, k, }: InspectorProps) => import("preact").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "preact/hooks";
|
|
3
3
|
import { GameObject } from "./game-object";
|
|
4
|
-
export const Inspector = ({ updateTimeout = 250, k }) => {
|
|
4
|
+
export const Inspector = ({ updateTimeout = 250, isVisibleOnLoad = true, k, }) => {
|
|
5
5
|
const [root, setRoot] = useState(k.getTreeRoot());
|
|
6
6
|
const [renderIndex, setRenderIndex] = useState(0);
|
|
7
|
+
const [isVisible, setIsVisible] = useState(isVisibleOnLoad);
|
|
7
8
|
// Force re-render every updateTimeout milliseconds
|
|
8
9
|
useEffect(() => {
|
|
9
10
|
const interval = setInterval(() => {
|
|
@@ -15,5 +16,11 @@ export const Inspector = ({ updateTimeout = 250, k }) => {
|
|
|
15
16
|
const root = k.getTreeRoot();
|
|
16
17
|
root.paused = !root.paused;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
const toggleVisibility = () => {
|
|
20
|
+
setIsVisible(!isVisible);
|
|
21
|
+
};
|
|
22
|
+
if (!isVisible) {
|
|
23
|
+
return (_jsx("button", { class: "ki-btn k-inspector__show", onClick: toggleVisibility, children: "Show Inspector" }));
|
|
24
|
+
}
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { class: "k-inspector__header", children: [_jsx("button", { class: "ki-btn", onClick: handlePauseClick, children: "Pause/Resume" }), "\u2022", _jsxs("div", { children: [k.get("*", { recursive: true }).length, " objects"] }), "\u2022", _jsxs("div", { children: [Math.round(k.debug.fps()), " fps"] }), _jsx("button", { class: "ki-btn k-inspector__hide", onClick: toggleVisibility, children: "Hide" })] }), _jsx("div", { class: "k-inspector__objects", children: _jsx(GameObject, { k: k, className: "game-object--root", obj: root, setRenderRoot: setRoot, isExpanded: true, isRenderRoot: true }) })] }));
|
|
19
26
|
};
|
|
@@ -5,5 +5,5 @@ export const PositionControls = ({ obj }) => {
|
|
|
5
5
|
if (!obj.pos) {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
-
return (_jsxs("div", { class: "pos-controls", children: [_jsx("button", { class: "btn", onClick: () => (obj.pos.x -= 1), children: _jsx(ArrowLeftIcon, {}) }), _jsx("button", { class: "btn", onClick: () => (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("button", { class: "btn", onClick: () => (obj.pos.y -= 1), children: _jsx(ArrowUpIcon, {}) }), _jsx("button", { class: "btn", onClick: () => (obj.pos.y += 1), children: _jsx(ArrowDownIcon, {}) })] }));
|
|
8
|
+
return (_jsxs("div", { class: "pos-controls", children: [_jsx("button", { class: "ki-btn", onClick: () => (obj.pos.x -= 1), children: _jsx(ArrowLeftIcon, {}) }), _jsx("button", { class: "ki-btn", onClick: () => (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("button", { class: "ki-btn", onClick: () => (obj.pos.y -= 1), children: _jsx(ArrowUpIcon, {}) }), _jsx("button", { class: "ki-btn", onClick: () => (obj.pos.y += 1), children: _jsx(ArrowDownIcon, {}) })] }));
|
|
9
9
|
};
|
package/dist/init.d.ts
CHANGED
package/dist/init.js
CHANGED
|
@@ -2,8 +2,11 @@ import { jsx as _jsx } from "preact/jsx-runtime";
|
|
|
2
2
|
import { render } from "preact";
|
|
3
3
|
import { Inspector } from "./components/inspector";
|
|
4
4
|
export default function init(k, props = {}) {
|
|
5
|
+
const {
|
|
6
|
+
//
|
|
7
|
+
className = "", updateTimeout = 100, isVisibleOnLoad = true, } = props;
|
|
5
8
|
const appElement = document.createElement("div");
|
|
6
|
-
appElement.className =
|
|
9
|
+
appElement.className = `k-inspector ${className}`;
|
|
7
10
|
document.body.appendChild(appElement);
|
|
8
|
-
render(_jsx(Inspector, { k: k,
|
|
11
|
+
render(_jsx(Inspector, { k: k, updateTimeout: updateTimeout, isVisibleOnLoad: isVisibleOnLoad }), appElement);
|
|
9
12
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
.
|
|
2
|
-
--
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
15
|
-
--
|
|
16
|
-
|
|
17
|
-
--
|
|
18
|
-
--
|
|
19
|
-
--
|
|
1
|
+
.k-inspector {
|
|
2
|
+
--ki-bg: rgb(250 250 250);
|
|
3
|
+
--ki-fg: rgb(25 25 25);
|
|
4
|
+
--ki-red: #d9174b;
|
|
5
|
+
--ki-gray-light: rgb(238 238 238);
|
|
6
|
+
--ki-gray-bg: rgb(244 244 244);
|
|
7
|
+
--ki-border: rgb(170 170 170);
|
|
8
|
+
--ki-border-light: rgb(210 210 210);
|
|
9
|
+
|
|
10
|
+
--ki-l: 0.62;
|
|
11
|
+
--ki-c: 0.2;
|
|
12
|
+
--ki-h: 250;
|
|
13
|
+
--ki-lch: var(--ki-l) var(--ki-c) var(--ki-h);
|
|
14
|
+
--ki-h-secondary: 150;
|
|
15
|
+
--ki-secondary-lch: var(--ki-l) var(--ki-c) var(--ki-h-secondary);
|
|
16
|
+
|
|
17
|
+
--ki-primary: oklch(var(--ki-lch));
|
|
18
|
+
--ki-primary-light: oklch(var(--ki-lch) / 0.1);
|
|
19
|
+
--ki-secondary: oklch(var(--ki-secondary-lch));
|
|
20
20
|
|
|
21
21
|
@media (prefers-color-scheme: dark) {
|
|
22
|
-
--
|
|
23
|
-
--
|
|
24
|
-
--
|
|
25
|
-
--
|
|
26
|
-
--
|
|
27
|
-
--
|
|
28
|
-
--
|
|
22
|
+
--ki-bg: rgb(30 30 30);
|
|
23
|
+
--ki-fg: rgb(230 230 230);
|
|
24
|
+
--ki-red: #ff4073;
|
|
25
|
+
--ki-gray-light: rgb(50 50 50);
|
|
26
|
+
--ki-gray-bg: rgb(40 40 40);
|
|
27
|
+
--ki-border: rgb(80 80 80);
|
|
28
|
+
--ki-border-light: rgb(60 60 60);
|
|
29
29
|
|
|
30
|
-
--
|
|
31
|
-
--
|
|
30
|
+
--ki-l: 0.7;
|
|
31
|
+
--ki-c: 0.15;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
font-synthesis: none;
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
bottom: 0;
|
|
40
40
|
left: 0;
|
|
41
41
|
width: 100%;
|
|
42
|
-
background-color: var(--
|
|
43
|
-
color: var(--
|
|
42
|
+
background-color: var(--ki-bg);
|
|
43
|
+
color: var(--ki-fg);
|
|
44
44
|
max-height: 45vh;
|
|
45
45
|
overflow: auto;
|
|
46
46
|
font-family:
|
|
@@ -48,12 +48,11 @@
|
|
|
48
48
|
"DejaVu Sans Mono", monospace;
|
|
49
49
|
font-size: 0.875rem;
|
|
50
50
|
scrollbar-width: thin;
|
|
51
|
-
scrollbar-color: var(--
|
|
51
|
+
scrollbar-color: var(--ki-border) transparent;
|
|
52
52
|
box-sizing: border-box;
|
|
53
53
|
padding: 0;
|
|
54
54
|
margin: 0;
|
|
55
55
|
line-height: 1.2;
|
|
56
|
-
border-top: 1px solid var(--exp-gray-light);
|
|
57
56
|
|
|
58
57
|
* {
|
|
59
58
|
box-sizing: border-box;
|
|
@@ -65,7 +64,7 @@
|
|
|
65
64
|
input,
|
|
66
65
|
select,
|
|
67
66
|
textarea {
|
|
68
|
-
accent-color: var(--
|
|
67
|
+
accent-color: var(--ki-primary);
|
|
69
68
|
font: inherit;
|
|
70
69
|
color: inherit;
|
|
71
70
|
}
|
|
@@ -78,30 +77,32 @@
|
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
button:focus-visible {
|
|
81
|
-
outline: 2px solid var(--
|
|
80
|
+
outline: 2px solid var(--ki-primary);
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
button:active {
|
|
85
84
|
transform: translateY(1px);
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
.btn {
|
|
87
|
+
.ki-btn {
|
|
89
88
|
padding: 0.25rem 0.375rem;
|
|
90
89
|
font-size: 0.75rem;
|
|
91
90
|
border-radius: 4px;
|
|
92
|
-
background-color: var(--
|
|
93
|
-
border: 1px solid var(--
|
|
91
|
+
background-color: var(--ki-gray-light);
|
|
92
|
+
border: 1px solid var(--ki-border-light);
|
|
94
93
|
}
|
|
95
94
|
|
|
96
|
-
.btn:hover {
|
|
97
|
-
border: 1px solid var(--
|
|
95
|
+
.ki-btn:hover {
|
|
96
|
+
border: 1px solid var(--ki-primary);
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
svg {
|
|
101
100
|
display: block;
|
|
102
101
|
}
|
|
103
102
|
|
|
104
|
-
|
|
103
|
+
/* Main layout */
|
|
104
|
+
|
|
105
|
+
.k-inspector__header {
|
|
105
106
|
position: sticky;
|
|
106
107
|
top: 0;
|
|
107
108
|
display: flex;
|
|
@@ -109,58 +110,69 @@
|
|
|
109
110
|
padding: 0.5rem;
|
|
110
111
|
align-items: center;
|
|
111
112
|
z-index: 2;
|
|
112
|
-
background-color: var(--
|
|
113
|
-
border-bottom: 1px solid var(--
|
|
113
|
+
background-color: var(--ki-bg);
|
|
114
|
+
border-bottom: 1px solid var(--ki-gray-light);
|
|
115
|
+
border-top: 1px solid var(--ki-gray-light);
|
|
114
116
|
}
|
|
115
117
|
|
|
116
|
-
.
|
|
118
|
+
.k-inspector__objects {
|
|
117
119
|
padding: 0.5rem;
|
|
118
120
|
}
|
|
119
121
|
|
|
122
|
+
.k-inspector__hide {
|
|
123
|
+
margin-left: auto;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.k-inspector__show {
|
|
127
|
+
position: fixed;
|
|
128
|
+
bottom: 0.5rem;
|
|
129
|
+
right: 0.5rem;
|
|
130
|
+
}
|
|
131
|
+
|
|
120
132
|
/* Game object */
|
|
121
133
|
|
|
122
|
-
.
|
|
134
|
+
.game-object {
|
|
123
135
|
transition: background 500ms;
|
|
124
136
|
position: relative;
|
|
125
137
|
}
|
|
126
138
|
|
|
127
|
-
.
|
|
139
|
+
.game-object .game-object {
|
|
128
140
|
padding-left: 1.5rem;
|
|
129
141
|
}
|
|
130
142
|
|
|
131
|
-
.
|
|
132
|
-
.
|
|
143
|
+
.game-object .game-object::before,
|
|
144
|
+
.game-object .game-object__comps-wrapper::before {
|
|
133
145
|
content: "";
|
|
134
146
|
height: 100%;
|
|
135
147
|
position: absolute;
|
|
136
148
|
left: 0.75rem;
|
|
137
149
|
top: 0;
|
|
138
|
-
border-left: 1px solid var(--
|
|
150
|
+
border-left: 1px solid var(--ki-border);
|
|
139
151
|
}
|
|
140
152
|
|
|
141
|
-
.
|
|
153
|
+
.game-object .game-object__comps-wrapper::before {
|
|
142
154
|
left: -1rem;
|
|
143
155
|
}
|
|
144
156
|
|
|
145
|
-
.
|
|
157
|
+
.game-object .game-object:last-child:before {
|
|
146
158
|
height: 1rem;
|
|
147
159
|
}
|
|
148
160
|
|
|
149
|
-
.
|
|
161
|
+
.game-object--no-children .game-object__comps-wrapper:last-child::before {
|
|
150
162
|
display: none;
|
|
151
163
|
}
|
|
152
164
|
|
|
153
|
-
.
|
|
165
|
+
.game-object--root > .game-object__content .game-object__header::before {
|
|
154
166
|
display: none;
|
|
155
167
|
}
|
|
156
168
|
|
|
157
|
-
.
|
|
169
|
+
.game-object__content {
|
|
158
170
|
position: relative;
|
|
159
171
|
}
|
|
160
172
|
|
|
161
173
|
/* Header */
|
|
162
174
|
|
|
163
|
-
.
|
|
175
|
+
.game-object__header {
|
|
164
176
|
position: relative;
|
|
165
177
|
display: flex;
|
|
166
178
|
padding: 0.25rem 0.25rem;
|
|
@@ -173,36 +185,36 @@
|
|
|
173
185
|
outline-offset: 0;
|
|
174
186
|
|
|
175
187
|
svg rect {
|
|
176
|
-
fill: var(--
|
|
188
|
+
fill: var(--ki-bg);
|
|
177
189
|
}
|
|
178
190
|
}
|
|
179
191
|
|
|
180
|
-
.
|
|
181
|
-
background-color: var(--
|
|
192
|
+
.game-object__header:hover {
|
|
193
|
+
background-color: var(--ki-primary-light);
|
|
182
194
|
}
|
|
183
195
|
|
|
184
|
-
.
|
|
196
|
+
.game-object__header::before {
|
|
185
197
|
content: "";
|
|
186
198
|
position: absolute;
|
|
187
199
|
left: calc(-0.75rem);
|
|
188
200
|
width: 0.75rem;
|
|
189
201
|
top: 50%;
|
|
190
|
-
border-bottom: 1px solid var(--
|
|
202
|
+
border-bottom: 1px solid var(--ki-border);
|
|
191
203
|
}
|
|
192
204
|
|
|
193
205
|
/* Header info and actions */
|
|
194
206
|
|
|
195
|
-
.
|
|
196
|
-
color: var(--
|
|
207
|
+
.game-object__tags {
|
|
208
|
+
color: var(--ki-primary);
|
|
197
209
|
font-weight: bold;
|
|
198
210
|
}
|
|
199
211
|
|
|
200
|
-
.
|
|
201
|
-
color: var(--
|
|
212
|
+
.game-object__comp-names {
|
|
213
|
+
color: var(--ki-secondary);
|
|
202
214
|
font-weight: bold;
|
|
203
215
|
}
|
|
204
216
|
|
|
205
|
-
.
|
|
217
|
+
.game-object__buttons {
|
|
206
218
|
position: absolute;
|
|
207
219
|
top: 0;
|
|
208
220
|
right: 0;
|
|
@@ -212,37 +224,37 @@
|
|
|
212
224
|
height: 2rem;
|
|
213
225
|
}
|
|
214
226
|
|
|
215
|
-
.
|
|
216
|
-
color: var(--
|
|
227
|
+
.game-object__destroyed {
|
|
228
|
+
color: var(--ki-red);
|
|
217
229
|
font-weight: bold;
|
|
218
230
|
}
|
|
219
231
|
|
|
220
232
|
/* Expand tree button */
|
|
221
233
|
|
|
222
|
-
.
|
|
234
|
+
.game-object__expand-icon {
|
|
223
235
|
margin-right: 0.25rem;
|
|
224
236
|
}
|
|
225
237
|
|
|
226
|
-
.
|
|
227
|
-
color: var(--
|
|
238
|
+
.game-object__header:hover .game-object__expand-icon {
|
|
239
|
+
color: var(--ki-primary);
|
|
228
240
|
}
|
|
229
241
|
|
|
230
242
|
/* Comps */
|
|
231
243
|
|
|
232
|
-
.
|
|
244
|
+
.game-object__comps-wrapper {
|
|
233
245
|
position: relative;
|
|
234
246
|
padding: 0.5rem 0;
|
|
235
247
|
margin-left: 1.75rem;
|
|
236
248
|
}
|
|
237
249
|
|
|
238
|
-
.
|
|
239
|
-
border: 1px solid var(--
|
|
250
|
+
.game-object__comps {
|
|
251
|
+
border: 1px solid var(--ki-border-light);
|
|
240
252
|
border-radius: 4px;
|
|
241
253
|
overflow: hidden;
|
|
242
254
|
font-size: 0.75rem;
|
|
243
255
|
}
|
|
244
256
|
|
|
245
|
-
.
|
|
257
|
+
.game-object__comps-row {
|
|
246
258
|
display: grid;
|
|
247
259
|
align-items: center;
|
|
248
260
|
padding: 0.375rem 0.5rem;
|
|
@@ -254,13 +266,13 @@
|
|
|
254
266
|
}
|
|
255
267
|
}
|
|
256
268
|
|
|
257
|
-
.
|
|
258
|
-
background-color: var(--
|
|
269
|
+
.game-object__comps-row:nth-child(even) {
|
|
270
|
+
background-color: var(--ki-gray-bg);
|
|
259
271
|
}
|
|
260
272
|
|
|
261
273
|
/* Children */
|
|
262
274
|
|
|
263
|
-
.
|
|
275
|
+
.game-object__children {
|
|
264
276
|
padding-bottom: 1rem;
|
|
265
277
|
}
|
|
266
278
|
|
|
@@ -274,7 +286,7 @@
|
|
|
274
286
|
min-width: 12rem;
|
|
275
287
|
}
|
|
276
288
|
|
|
277
|
-
.pos-
|
|
289
|
+
.pos-controls .ki-btn,
|
|
278
290
|
.pos-controls__value {
|
|
279
291
|
flex-shrink: 0;
|
|
280
292
|
text-align: center;
|
|
@@ -287,10 +299,10 @@
|
|
|
287
299
|
/* Text Controls */
|
|
288
300
|
|
|
289
301
|
.text-controls__input {
|
|
290
|
-
background-color: var(--
|
|
302
|
+
background-color: var(--ki-bg);
|
|
291
303
|
border: none;
|
|
292
304
|
padding: 0.25rem 0.375rem;
|
|
293
|
-
border: 1px solid var(--
|
|
305
|
+
border: 1px solid var(--ki-border-light);
|
|
294
306
|
font-size: 0.75rem;
|
|
295
307
|
border-radius: 4px;
|
|
296
308
|
width: 100%;
|
|
@@ -298,7 +310,7 @@
|
|
|
298
310
|
|
|
299
311
|
.text-controls__input:focus-visible {
|
|
300
312
|
outline: none;
|
|
301
|
-
border-color: var(--
|
|
313
|
+
border-color: var(--ki-primary);
|
|
302
314
|
}
|
|
303
315
|
}
|
|
304
316
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stanko/kaplay-inspector",
|
|
3
|
+
"description": "A dev tool for Kaplay which allows you to explore and inspect the game object tree real time.",
|
|
3
4
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.4",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "./dist/init.js",
|
|
7
8
|
"types": "./dist/init.d.ts",
|
|
@@ -23,13 +24,13 @@
|
|
|
23
24
|
"kaplay": "^4000.0.0-alpha.20"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
|
-
"preact": "^10.
|
|
27
|
+
"preact": "^10.28.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@preact/preset-vite": "^2.10.2",
|
|
30
|
-
"@types/node": "^
|
|
31
|
+
"@types/node": "^25.0.2",
|
|
31
32
|
"typescript": "~5.9.3",
|
|
32
|
-
"vite": "^7.
|
|
33
|
+
"vite": "^7.3.0"
|
|
33
34
|
},
|
|
34
35
|
"repository": {
|
|
35
36
|
"type": "git",
|
|
@@ -44,5 +45,5 @@
|
|
|
44
45
|
"bugs": {
|
|
45
46
|
"url": "https://github.com/Stanko/kaplay-inspector/issues"
|
|
46
47
|
},
|
|
47
|
-
"homepage": "https://
|
|
48
|
+
"homepage": "https://muffinman.io/kaplay-inspector/"
|
|
48
49
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|