@stanko/kaplay-inspector 0.0.2 → 0.0.3

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 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
  ![Kaplay inspector in action](./public/screenshot.png)
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: 250,
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
 
71
73
 
72
74
  ## TODO
73
75
 
74
- * [ ] Show/Hide button
75
76
  * [ ] Bounding box - handle a case when anchor is a `Vec2`
76
77
  * [ ] Controllable theme - system/light/dark. At the moment it is always matching the system.
77
78
  * [ ] Filter/search
78
79
  * [ ] Persist search in URL or local storage
79
- * [ ] Build and deploy simple demo
80
80
  * [ ] Figure out why child bounding box are drawn in the wrong position
81
- * [ ] Check if all of CSS is namespaced
81
+ * [ ] Add documentation about positioning the inspector
82
+ * [ ] Collapse/Expand all button
83
+ * [x] Check if all of CSS is namespaced
84
+ * [x] Show/Hide button
85
+ * [x] Build and deploy simple demo
@@ -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("obj", className, {
38
- "obj--no-children": !hasChildren,
39
- }), children: [isInspecting && _jsx(Breadcrumbs, { setRenderRoot: setRenderRoot, obj: obj }), _jsxs("div", { class: "obj__content", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsxs("button", { class: cx("obj__header", {
40
- "obj__header--expandable": showExpandTree,
41
- }), onClick: handleToggleClick, children: [_jsx("span", { class: "obj__expand-icon", children: isExpanded ? _jsx(MinusIcon, {}) : _jsx(PlusIcon, {}) }), _jsxs("div", { class: "obj__id", children: ["ID ", obj.id, ":"] }), tags ? (_jsx("div", { class: "obj__tags", children: isRootObject ? "Root" : tags })) : (_jsx("div", { class: "obj__comp-names", children: compsLabel })), obj.children.length > 0 && _jsxs("div", { children: ["(", obj.children.length, ")"] }), isObjectDestroyed && _jsx("div", { class: "obj__destroyed", children: "DESTROYED" })] }), _jsxs("div", { class: "obj__buttons", children: [!isRenderRoot && (_jsx("button", { class: "btn", onClick: () => setRenderRoot(obj), children: "inspect" })), _jsx("button", { class: "btn ", onClick: () => console.log(obj), children: "log" })] }), isExpanded && (_jsx("div", { class: "obj__comps-wrapper", children: _jsxs("div", { class: "obj__comps", children: [_jsxs("div", { class: "obj__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: "obj__comps-row", children: [_jsx("div", { children: _jsx("b", { children: comp.tag }) }), _jsx("div", { children: comp.value })] }, comp.tag)))] }) }))] }), isExpanded && hasChildren && (_jsx("div", { class: "obj__children", style: { display: isExpanded ? "block" : "none" }, children: obj.children.map((child) => (_jsx(GameObject, { k: k, obj: child, setRenderRoot: setRenderRoot }, child.id))) }))] }, obj.id));
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
  };
@@ -3,4 +3,4 @@ import type { InspectorOptions } from "../init";
3
3
  export interface InspectorProps extends InspectorOptions {
4
4
  k: KAPLAYCtxT;
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
- return (_jsxs(_Fragment, { children: [_jsxs("div", { class: "exp__header", children: [_jsx("button", { class: "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("div", { class: "exp__objects", children: _jsx(GameObject, { k: k, className: "obj--root", obj: root, setRenderRoot: setRoot, isExpanded: true, isRenderRoot: true }) })] }));
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
@@ -1,5 +1,7 @@
1
1
  import type { KAPLAYCtx } from "kaplay";
2
2
  export interface InspectorOptions {
3
3
  updateTimeout?: number;
4
+ isVisibleOnLoad?: boolean;
5
+ className?: string;
4
6
  }
5
7
  export default function init(k: KAPLAYCtx, props?: InspectorOptions): void;
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 = "exp";
9
+ appElement.className = `k-inspector ${className}`;
7
10
  document.body.appendChild(appElement);
8
- render(_jsx(Inspector, { k: k, ...props }), appElement);
11
+ render(_jsx(Inspector, { k: k, updateTimeout: updateTimeout, isVisibleOnLoad: isVisibleOnLoad }), appElement);
9
12
  }
package/dist/styles.css CHANGED
@@ -1,34 +1,34 @@
1
- .exp {
2
- --exp-bg: rgb(250 250 250);
3
- --exp-fg: rgb(25 25 25);
4
- --exp-red: #d9174b;
5
- --exp-gray-light: rgb(238 238 238);
6
- --exp-gray-bg: rgb(244 244 244);
7
- --exp-border: rgb(170 170 170);
8
- --exp-border-light: rgb(210 210 210);
9
-
10
- --exp-l: 0.62;
11
- --exp-c: 0.2;
12
- --exp-h: 250;
13
- --exp-lch: var(--exp-l) var(--exp-c) var(--exp-h);
14
- --exp-h-secondary: 150;
15
- --exp-secondary-lch: var(--exp-l) var(--exp-c) var(--exp-h-secondary);
16
-
17
- --exp-primary: oklch(var(--exp-lch));
18
- --exp-primary-light: oklch(var(--exp-lch) / 0.1);
19
- --exp-secondary: oklch(var(--exp-secondary-lch));
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
- --exp-bg: rgb(30 30 30);
23
- --exp-fg: rgb(230 230 230);
24
- --exp-red: #ff4073;
25
- --exp-gray-light: rgb(50 50 50);
26
- --exp-gray-bg: rgb(40 40 40);
27
- --exp-border: rgb(80 80 80);
28
- --exp-border-light: rgb(60 60 60);
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
- --exp-l: 0.7;
31
- --exp-c: 0.15;
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(--exp-bg);
43
- color: var(--exp-fg);
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(--exp-border) transparent;
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(--exp-primary);
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(--exp-primary);
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(--exp-gray-light);
93
- border: 1px solid var(--exp-border-light);
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(--exp-primary);
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
- .exp__header {
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(--exp-bg);
113
- border-bottom: 1px solid var(--exp-gray-light);
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
- .exp__objects {
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
- .obj {
134
+ .game-object {
123
135
  transition: background 500ms;
124
136
  position: relative;
125
137
  }
126
138
 
127
- .obj .obj {
139
+ .game-object .game-object {
128
140
  padding-left: 1.5rem;
129
141
  }
130
142
 
131
- .obj .obj::before,
132
- .obj .obj__comps-wrapper::before {
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(--exp-border);
150
+ border-left: 1px solid var(--ki-border);
139
151
  }
140
152
 
141
- .obj .obj__comps-wrapper::before {
153
+ .game-object .game-object__comps-wrapper::before {
142
154
  left: -1rem;
143
155
  }
144
156
 
145
- .obj .obj:last-child:before {
157
+ .game-object .game-object:last-child:before {
146
158
  height: 1rem;
147
159
  }
148
160
 
149
- .obj--no-children .obj__comps-wrapper:last-child::before {
161
+ .game-object--no-children .game-object__comps-wrapper:last-child::before {
150
162
  display: none;
151
163
  }
152
164
 
153
- .obj--root > .obj__content .obj__header::before {
165
+ .game-object--root > .game-object__content .game-object__header::before {
154
166
  display: none;
155
167
  }
156
168
 
157
- .obj__content {
169
+ .game-object__content {
158
170
  position: relative;
159
171
  }
160
172
 
161
173
  /* Header */
162
174
 
163
- .obj__header {
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(--exp-bg);
188
+ fill: var(--ki-bg);
177
189
  }
178
190
  }
179
191
 
180
- .obj__header:hover {
181
- background-color: var(--exp-primary-light);
192
+ .game-object__header:hover {
193
+ background-color: var(--ki-primary-light);
182
194
  }
183
195
 
184
- .obj__header::before {
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(--exp-border);
202
+ border-bottom: 1px solid var(--ki-border);
191
203
  }
192
204
 
193
205
  /* Header info and actions */
194
206
 
195
- .obj__tags {
196
- color: var(--exp-primary);
207
+ .game-object__tags {
208
+ color: var(--ki-primary);
197
209
  font-weight: bold;
198
210
  }
199
211
 
200
- .obj__comp-names {
201
- color: var(--exp-secondary);
212
+ .game-object__comp-names {
213
+ color: var(--ki-secondary);
202
214
  font-weight: bold;
203
215
  }
204
216
 
205
- .obj__buttons {
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
- .obj__destroyed {
216
- color: var(--exp-red);
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
- .obj__expand-icon {
234
+ .game-object__expand-icon {
223
235
  margin-right: 0.25rem;
224
236
  }
225
237
 
226
- .obj__header:hover .obj__expand-icon {
227
- color: var(--exp-primary);
238
+ .game-object__header:hover .game-object__expand-icon {
239
+ color: var(--ki-primary);
228
240
  }
229
241
 
230
242
  /* Comps */
231
243
 
232
- .obj__comps-wrapper {
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
- .obj__comps {
239
- border: 1px solid var(--exp-border-light);
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
- .obj__comps-row {
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
- .obj__comps-row:nth-child(even) {
258
- background-color: var(--exp-gray-bg);
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
- .obj__children {
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-controls__.btn,
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(--exp-bg);
302
+ background-color: var(--ki-bg);
291
303
  border: none;
292
304
  padding: 0.25rem 0.375rem;
293
- border: 1px solid var(--exp-border-light);
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(--exp-primary);
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.2",
5
+ "version": "0.0.3",
5
6
  "type": "module",
6
7
  "main": "./dist/init.js",
7
8
  "types": "./dist/init.d.ts",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file