@zenbu-labs/pixel 0.0.0 → 0.0.12
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/dist/bin.d.ts +2 -0
- package/dist/bin.js +166 -0
- package/dist/bootstrap.d.ts +1 -0
- package/dist/bootstrap.js +75 -0
- package/dist/context-menu.d.ts +20 -0
- package/dist/context-menu.js +57 -0
- package/dist/debug.d.ts +1 -0
- package/dist/debug.js +9 -0
- package/dist/devtools-layout.d.ts +21 -0
- package/dist/devtools-layout.js +45 -0
- package/dist/devtools.d.ts +33 -0
- package/dist/devtools.js +125 -0
- package/dist/electron/index.d.ts +3 -0
- package/dist/electron/index.js +4 -0
- package/dist/host/guest.d.ts +5 -0
- package/dist/host/guest.js +178 -0
- package/dist/host/server.d.ts +91 -0
- package/dist/host/server.js +296 -0
- package/dist/host/shell.d.ts +35 -0
- package/dist/host/shell.js +113 -0
- package/dist/host/strip.d.ts +6 -0
- package/dist/host/strip.js +63 -0
- package/dist/icons.d.ts +30 -0
- package/dist/icons.js +58 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +39 -0
- package/dist/instances.d.ts +30 -0
- package/dist/instances.js +177 -0
- package/dist/layout.d.ts +5 -0
- package/dist/layout.js +34 -0
- package/dist/popup.d.ts +21 -0
- package/dist/popup.js +47 -0
- package/dist/preload/index.d.ts +15 -0
- package/dist/preload/index.js +3 -0
- package/dist/react/colors.d.ts +3 -0
- package/dist/react/colors.js +25 -0
- package/dist/react/components.d.ts +21 -0
- package/dist/react/components.js +45 -0
- package/dist/react/devtools/app.d.ts +3 -0
- package/dist/react/devtools/app.js +89 -0
- package/dist/react/devtools/console-capture.d.ts +1 -0
- package/dist/react/devtools/console-capture.js +41 -0
- package/dist/react/devtools/controller.d.ts +45 -0
- package/dist/react/devtools/controller.js +252 -0
- package/dist/react/devtools/elements.d.ts +4 -0
- package/dist/react/devtools/elements.js +152 -0
- package/dist/react/devtools/export-profile.d.ts +2 -0
- package/dist/react/devtools/export-profile.js +225 -0
- package/dist/react/devtools/fiber-hook.d.ts +1 -0
- package/dist/react/devtools/fiber-hook.js +89 -0
- package/dist/react/devtools/log-panel.d.ts +4 -0
- package/dist/react/devtools/log-panel.js +113 -0
- package/dist/react/devtools/profiler.d.ts +11 -0
- package/dist/react/devtools/profiler.js +374 -0
- package/dist/react/devtools/store.d.ts +27 -0
- package/dist/react/devtools/store.js +61 -0
- package/dist/react/devtools/stores.d.ts +92 -0
- package/dist/react/devtools/stores.js +41 -0
- package/dist/react/devtools/theme.d.ts +35 -0
- package/dist/react/devtools/theme.js +77 -0
- package/dist/react/devtools/ui.d.ts +24 -0
- package/dist/react/devtools/ui.js +59 -0
- package/dist/react/index.d.ts +110 -0
- package/dist/react/index.js +538 -0
- package/dist/react/markdown.d.ts +25 -0
- package/dist/react/markdown.js +270 -0
- package/dist/react/native.d.ts +116 -0
- package/dist/react/native.js +56 -0
- package/dist/react/reconciler-config.d.ts +241 -0
- package/dist/react/reconciler-config.js +412 -0
- package/dist/react/styles.d.ts +88 -0
- package/dist/react/styles.js +85 -0
- package/dist/react/surface.d.ts +55 -0
- package/dist/react/surface.js +74 -0
- package/dist/registry.d.ts +53 -0
- package/dist/registry.js +193 -0
- package/dist/root.d.ts +19 -0
- package/dist/root.js +342 -0
- package/dist/sandbox.d.ts +4 -0
- package/dist/sandbox.js +84 -0
- package/dist/scale.d.ts +7 -0
- package/dist/scale.js +31 -0
- package/dist/ssh/index.d.ts +58 -0
- package/dist/ssh/index.js +445 -0
- package/dist/terminal/applescript.d.ts +2 -0
- package/dist/terminal/applescript.js +20 -0
- package/dist/terminal/detect.d.ts +10 -0
- package/dist/terminal/detect.js +34 -0
- package/dist/terminal/graphics.d.ts +9 -0
- package/dist/terminal/graphics.js +142 -0
- package/dist/terminal/index.d.ts +12 -0
- package/dist/terminal/index.js +23 -0
- package/dist/terminal/run.d.ts +2 -0
- package/dist/terminal/run.js +15 -0
- package/dist/terminal/shared.d.ts +20 -0
- package/dist/terminal/shared.js +88 -0
- package/dist/terminal/terminal.d.ts +66 -0
- package/dist/terminal/terminal.js +6 -0
- package/dist/terminal/terminals/cmux.d.ts +2 -0
- package/dist/terminal/terminals/cmux.js +98 -0
- package/dist/terminal/terminals/ghostty-script.d.ts +1 -0
- package/dist/terminal/terminals/ghostty-script.js +179 -0
- package/dist/terminal/terminals/ghostty.d.ts +2 -0
- package/dist/terminal/terminals/ghostty.js +336 -0
- package/dist/terminal/terminals/herdr.d.ts +2 -0
- package/dist/terminal/terminals/herdr.js +141 -0
- package/dist/terminal/terminals/index.d.ts +5 -0
- package/dist/terminal/terminals/index.js +26 -0
- package/dist/terminal/terminals/kitty.d.ts +2 -0
- package/dist/terminal/terminals/kitty.js +209 -0
- package/dist/terminal/terminals/supacode.d.ts +2 -0
- package/dist/terminal/terminals/supacode.js +79 -0
- package/dist/terminal/terminals/tmux.d.ts +2 -0
- package/dist/terminal/terminals/tmux.js +132 -0
- package/dist/terminal/terminals/tty7.d.ts +2 -0
- package/dist/terminal/terminals/tty7.js +58 -0
- package/dist/terminal/terminals/vscode.d.ts +2 -0
- package/dist/terminal/terminals/vscode.js +13 -0
- package/dist/terminal/terminals/wezterm.d.ts +2 -0
- package/dist/terminal/terminals/wezterm.js +59 -0
- package/dist/theme.d.ts +22 -0
- package/dist/theme.js +40 -0
- package/dist/web/browser-session.d.ts +13 -0
- package/dist/web/browser-session.js +186 -0
- package/dist/web/cursor.d.ts +1 -0
- package/dist/web/cursor.js +24 -0
- package/dist/web/devtools.d.ts +39 -0
- package/dist/web/devtools.js +300 -0
- package/dist/web/favicon.d.ts +7 -0
- package/dist/web/favicon.js +73 -0
- package/dist/web/frame-rate.d.ts +1 -0
- package/dist/web/frame-rate.js +12 -0
- package/dist/web/host.d.ts +123 -0
- package/dist/web/host.js +573 -0
- package/dist/web/input.d.ts +49 -0
- package/dist/web/input.js +468 -0
- package/dist/web/offscreen.d.ts +2 -0
- package/dist/web/offscreen.js +23 -0
- package/dist/web/paint.d.ts +11 -0
- package/dist/web/paint.js +128 -0
- package/dist/web/popup.d.ts +40 -0
- package/dist/web/popup.js +144 -0
- package/dist/web/session.d.ts +20 -0
- package/dist/web/session.js +110 -0
- package/dist/web/types.d.ts +38 -0
- package/dist/web/types.js +39 -0
- package/dist/web/zoom.d.ts +5 -0
- package/dist/web/zoom.js +36 -0
- package/dist/webview.d.ts +55 -0
- package/dist/webview.js +481 -0
- package/package.json +69 -3
- package/scripts/apparmor.sh +71 -0
- package/scripts/postinstall.mjs +150 -0
|
@@ -0,0 +1,374 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.viewportStore = void 0;
|
|
37
|
+
exports.profilerHandleKey = profilerHandleKey;
|
|
38
|
+
exports.ProfilerPanel = ProfilerPanel;
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const components_1 = require("../components");
|
|
42
|
+
const controller_1 = require("./controller");
|
|
43
|
+
const export_profile_1 = require("./export-profile");
|
|
44
|
+
const store_1 = require("./store");
|
|
45
|
+
const stores_1 = require("./stores");
|
|
46
|
+
const theme_1 = require("./theme");
|
|
47
|
+
const ui_1 = require("./ui");
|
|
48
|
+
exports.viewportStore = (0, store_1.createStore)(null);
|
|
49
|
+
const selectedSpanStore = (0, store_1.createStore)(null);
|
|
50
|
+
function profilerHandleKey(key) {
|
|
51
|
+
const session = stores_1.profilerStore.get().session;
|
|
52
|
+
const viewport = exports.viewportStore.get();
|
|
53
|
+
if (!session || !viewport)
|
|
54
|
+
return false;
|
|
55
|
+
const span = viewport.t1 - viewport.t0;
|
|
56
|
+
const center = (viewport.t0 + viewport.t1) / 2;
|
|
57
|
+
switch (key) {
|
|
58
|
+
case "w": {
|
|
59
|
+
const next = Math.max(span / 1.4, 0.05);
|
|
60
|
+
exports.viewportStore.set({ t0: center - next / 2, t1: center + next / 2 });
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
case "s": {
|
|
64
|
+
const next = Math.min(span * 1.4, session.end - session.start || 1);
|
|
65
|
+
exports.viewportStore.set(clampViewport({ t0: center - next / 2, t1: center + next / 2 }, session));
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
case "a":
|
|
69
|
+
exports.viewportStore.set(clampViewport({ t0: viewport.t0 - span * 0.2, t1: viewport.t1 - span * 0.2 }, session));
|
|
70
|
+
return true;
|
|
71
|
+
case "d":
|
|
72
|
+
exports.viewportStore.set(clampViewport({ t0: viewport.t0 + span * 0.2, t1: viewport.t1 + span * 0.2 }, session));
|
|
73
|
+
return true;
|
|
74
|
+
case "f":
|
|
75
|
+
exports.viewportStore.set({ t0: session.start, t1: session.end });
|
|
76
|
+
return true;
|
|
77
|
+
default:
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function clampViewport(viewport, session) {
|
|
82
|
+
const span = viewport.t1 - viewport.t0;
|
|
83
|
+
let t0 = Math.max(viewport.t0, session.start - span * 0.1);
|
|
84
|
+
const t1 = Math.min(t0 + span, session.end + span * 0.1);
|
|
85
|
+
t0 = t1 - span;
|
|
86
|
+
return { t0, t1 };
|
|
87
|
+
}
|
|
88
|
+
function laneColor(span) {
|
|
89
|
+
const palettes = {
|
|
90
|
+
react: theme_1.theme.flame.react,
|
|
91
|
+
bridge: theme_1.theme.flame.bridge,
|
|
92
|
+
engine: theme_1.theme.flame.engine,
|
|
93
|
+
"devtools-engine": theme_1.theme.flame.devtools,
|
|
94
|
+
images: theme_1.theme.flame.images,
|
|
95
|
+
interaction: [theme_1.theme.warn, "#d19a66"],
|
|
96
|
+
};
|
|
97
|
+
const palette = palettes[span.lane];
|
|
98
|
+
let hash = 0;
|
|
99
|
+
for (let i = 0; i < span.name.length; i++)
|
|
100
|
+
hash = (hash * 31 + span.name.charCodeAt(i)) | 0;
|
|
101
|
+
return palette[Math.abs(hash) % palette.length];
|
|
102
|
+
}
|
|
103
|
+
function frameColor(dur) {
|
|
104
|
+
if (dur < 8)
|
|
105
|
+
return theme_1.theme.ok;
|
|
106
|
+
if (dur < 17)
|
|
107
|
+
return theme_1.theme.warn;
|
|
108
|
+
return theme_1.theme.danger;
|
|
109
|
+
}
|
|
110
|
+
function Overview(props) {
|
|
111
|
+
const { session, width, viewport, rem } = props;
|
|
112
|
+
const height = rem * 2.4;
|
|
113
|
+
const range = Math.max(session.end - session.start, 0.001);
|
|
114
|
+
const scale = width / range;
|
|
115
|
+
const frames = session.frames.slice(0, 2000);
|
|
116
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Box, { style: { height, background: theme_1.theme.bg, flexShrink: 0, overflow: "hidden" }, children: [frames.map((frame, i) => {
|
|
117
|
+
const x = (frame.start - session.start) * scale;
|
|
118
|
+
const w = Math.max(frame.dur * scale, 1.5);
|
|
119
|
+
const h = Math.max(3, Math.min(frame.dur / 33, 1) * (height - 4));
|
|
120
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Box, { style: {
|
|
121
|
+
position: "absolute",
|
|
122
|
+
inset: { left: x, bottom: 2 },
|
|
123
|
+
width: w,
|
|
124
|
+
height: h,
|
|
125
|
+
background: frameColor(frame.dur),
|
|
126
|
+
cornerRadius: 1,
|
|
127
|
+
}, onClick: () => {
|
|
128
|
+
const pad = Math.max(frame.dur, 4);
|
|
129
|
+
exports.viewportStore.set({ t0: frame.start - pad, t1: frame.start + frame.dur + pad });
|
|
130
|
+
} }, i));
|
|
131
|
+
}), session.marks.slice(0, 400).map((mark, i) => ((0, jsx_runtime_1.jsx)(components_1.Box, { style: {
|
|
132
|
+
position: "absolute",
|
|
133
|
+
inset: { left: (mark.start - session.start) * scale, top: 0 },
|
|
134
|
+
width: 1.5,
|
|
135
|
+
height: height * 0.45,
|
|
136
|
+
background: theme_1.theme.warn,
|
|
137
|
+
} }, `m${i}`))), (0, jsx_runtime_1.jsx)(components_1.Box, { style: {
|
|
138
|
+
position: "absolute",
|
|
139
|
+
inset: { left: (viewport.t0 - session.start) * scale, top: 0 },
|
|
140
|
+
width: Math.max((viewport.t1 - viewport.t0) * scale, 2),
|
|
141
|
+
height,
|
|
142
|
+
background: "#4d9fff22",
|
|
143
|
+
border: { width: 1, color: theme_1.theme.accent },
|
|
144
|
+
} })] }));
|
|
145
|
+
}
|
|
146
|
+
const LANES = [
|
|
147
|
+
{ label: "React", match: (s) => s.lane === "react" || s.lane === "bridge" },
|
|
148
|
+
{ label: "Engine", match: (s) => s.lane === "engine" },
|
|
149
|
+
{ label: "Images", match: (s) => s.lane === "images" },
|
|
150
|
+
{ label: "Engine (devtools)", match: (s) => s.lane === "devtools-engine" },
|
|
151
|
+
];
|
|
152
|
+
function laneRows(session) {
|
|
153
|
+
const rows = [];
|
|
154
|
+
for (const lane of LANES) {
|
|
155
|
+
const spans = session.spans.filter(lane.match);
|
|
156
|
+
if (spans.length > 0)
|
|
157
|
+
rows.push({ label: lane.label, spans });
|
|
158
|
+
}
|
|
159
|
+
return rows;
|
|
160
|
+
}
|
|
161
|
+
function InteractionsLane(props) {
|
|
162
|
+
const { marks, viewport, width, rem, selected } = props;
|
|
163
|
+
if (marks.length === 0)
|
|
164
|
+
return null;
|
|
165
|
+
const rowH = rem * 1.2;
|
|
166
|
+
const scale = width / (viewport.t1 - viewport.t0);
|
|
167
|
+
const minW = rem * 0.6;
|
|
168
|
+
const placed = [];
|
|
169
|
+
const rowEnds = [-Infinity, -Infinity];
|
|
170
|
+
for (const mark of marks) {
|
|
171
|
+
const rawX = (mark.start - viewport.t0) * scale;
|
|
172
|
+
const w = Math.max(mark.dur * scale, minW);
|
|
173
|
+
if (rawX + w < 0 || rawX > width)
|
|
174
|
+
continue;
|
|
175
|
+
const x = Math.max(rawX, 0);
|
|
176
|
+
const row = x >= rowEnds[0] + 2 ? 0 : x >= rowEnds[1] + 2 ? 1 : 0;
|
|
177
|
+
rowEnds[row] = x + w;
|
|
178
|
+
placed.push({ mark, x, w, row, labelW: 0 });
|
|
179
|
+
if (placed.length >= 300)
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
const estCharW = rem * 0.42;
|
|
183
|
+
for (let i = 0; i < placed.length; i++) {
|
|
184
|
+
const entry = placed[i];
|
|
185
|
+
let next = Infinity;
|
|
186
|
+
for (let j = i + 1; j < placed.length; j++) {
|
|
187
|
+
if (placed[j].row === entry.row) {
|
|
188
|
+
next = placed[j].x;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const room = Math.min(next, width) - (entry.x + entry.w) - rem * 0.4;
|
|
193
|
+
const need = entry.mark.name.length * estCharW;
|
|
194
|
+
entry.labelW = room > need ? need + rem * 0.3 : 0;
|
|
195
|
+
}
|
|
196
|
+
const rows = placed.reduce((max, p) => Math.max(max, p.row + 1), 1);
|
|
197
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Box, { style: { flexDirection: "column", flexShrink: 0 }, children: [(0, jsx_runtime_1.jsx)(components_1.Box, { style: { padding: { left: rem * 0.5, top: rem * 0.25, bottom: rem * 0.1 } }, children: (0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.faint, fontSize: rem * 0.62, wrap: false }, children: "Interactions" }) }), (0, jsx_runtime_1.jsx)(components_1.Box, { style: { height: rows * rowH + 2, overflow: "hidden" }, children: placed.map((entry, i) => {
|
|
198
|
+
const fromDevtools = entry.mark.name.startsWith("[devtools]");
|
|
199
|
+
const isSelected = selected === entry.mark;
|
|
200
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Box, { style: {
|
|
201
|
+
position: "absolute",
|
|
202
|
+
inset: { left: entry.x, top: entry.row * rowH + 1 },
|
|
203
|
+
width: entry.w,
|
|
204
|
+
height: rowH - 3,
|
|
205
|
+
background: fromDevtools ? theme_1.theme.faint : theme_1.theme.warn,
|
|
206
|
+
cornerRadius: 3,
|
|
207
|
+
border: isSelected ? { width: 1, color: "#ffffff" } : undefined,
|
|
208
|
+
hoverBackground: fromDevtools ? theme_1.theme.dim : "#f0d090",
|
|
209
|
+
}, onClick: () => selectedSpanStore.set(entry.mark) }), entry.labelW > 0 && ((0, jsx_runtime_1.jsx)(components_1.Box, { style: {
|
|
210
|
+
position: "absolute",
|
|
211
|
+
inset: { left: entry.x + entry.w + rem * 0.25, top: entry.row * rowH + 1 },
|
|
212
|
+
width: entry.labelW,
|
|
213
|
+
height: rowH - 3,
|
|
214
|
+
overflow: "hidden",
|
|
215
|
+
}, children: (0, jsx_runtime_1.jsx)(components_1.Text, { style: {
|
|
216
|
+
color: fromDevtools ? theme_1.theme.faint : theme_1.theme.warn,
|
|
217
|
+
fontSize: rem * 0.64,
|
|
218
|
+
font: theme_1.MONO,
|
|
219
|
+
wrap: false,
|
|
220
|
+
}, children: entry.mark.name }) }))] }, i));
|
|
221
|
+
}) })] }));
|
|
222
|
+
}
|
|
223
|
+
function Lane(props) {
|
|
224
|
+
const { label, spans, viewport, width, rem, selected } = props;
|
|
225
|
+
const rowH = rem * 1.05;
|
|
226
|
+
const scale = width / (viewport.t1 - viewport.t0);
|
|
227
|
+
const visible = [];
|
|
228
|
+
let maxDepth = 0;
|
|
229
|
+
let lastEnd = -Infinity;
|
|
230
|
+
for (const span of spans) {
|
|
231
|
+
if (span.start + span.dur < viewport.t0 || span.start > viewport.t1)
|
|
232
|
+
continue;
|
|
233
|
+
if (span.lane !== "interaction") {
|
|
234
|
+
if (span.dur * scale < 0.4 && span.depth === 0) {
|
|
235
|
+
if ((span.start - lastEnd) * scale < 1.2)
|
|
236
|
+
continue;
|
|
237
|
+
lastEnd = span.start + span.dur;
|
|
238
|
+
}
|
|
239
|
+
else if (span.dur * scale < 0.4) {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
visible.push(span);
|
|
244
|
+
if (span.depth > maxDepth)
|
|
245
|
+
maxDepth = span.depth;
|
|
246
|
+
if (visible.length >= 600)
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Box, { style: { flexDirection: "column", flexShrink: 0 }, children: [(0, jsx_runtime_1.jsx)(components_1.Box, { style: { padding: { left: rem * 0.5, top: rem * 0.25, bottom: rem * 0.1 } }, children: (0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.faint, fontSize: rem * 0.62, wrap: false }, children: label }) }), (0, jsx_runtime_1.jsx)(components_1.Box, { style: { height: (maxDepth + 1) * rowH + 2, overflow: "hidden" }, children: visible.map((span, i) => {
|
|
250
|
+
const rawX = (span.start - viewport.t0) * scale;
|
|
251
|
+
const minW = span.lane === "interaction" ? 3 : 1.5;
|
|
252
|
+
const right = rawX + Math.max(span.dur * scale - 0.5, minW);
|
|
253
|
+
const x = Math.max(rawX, 0);
|
|
254
|
+
const w = Math.max(right - x, 1.5);
|
|
255
|
+
const isSelected = selected === span;
|
|
256
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Box, { style: {
|
|
257
|
+
position: "absolute",
|
|
258
|
+
inset: { left: x, top: span.depth * rowH },
|
|
259
|
+
width: w,
|
|
260
|
+
height: rowH - 1,
|
|
261
|
+
background: laneColor(span),
|
|
262
|
+
border: isSelected ? { width: 1, color: "#ffffff" } : undefined,
|
|
263
|
+
cornerRadius: 1,
|
|
264
|
+
overflow: "hidden",
|
|
265
|
+
}, onClick: () => {
|
|
266
|
+
if (selectedSpanStore.get() === span) {
|
|
267
|
+
exports.viewportStore.set({ t0: span.start, t1: span.start + Math.max(span.dur, 0.05) });
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
selectedSpanStore.set(span);
|
|
271
|
+
}
|
|
272
|
+
}, children: w > rem * 2.2 && ((0, jsx_runtime_1.jsx)(components_1.Text, { style: {
|
|
273
|
+
color: "#101318",
|
|
274
|
+
fontSize: rem * 0.62,
|
|
275
|
+
font: theme_1.MONO,
|
|
276
|
+
wrap: false,
|
|
277
|
+
}, children: span.label ?? span.name })) }, i));
|
|
278
|
+
}) })] }));
|
|
279
|
+
}
|
|
280
|
+
function Ruler(props) {
|
|
281
|
+
const { session, viewport, width, rem } = props;
|
|
282
|
+
const ticks = 5;
|
|
283
|
+
const step = (viewport.t1 - viewport.t0) / ticks;
|
|
284
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Box, { style: { height: rem, flexShrink: 0, background: theme_1.theme.panel, overflow: "hidden" }, children: Array.from({ length: ticks + 1 }, (_, i) => {
|
|
285
|
+
const t = viewport.t0 + step * i;
|
|
286
|
+
const x = ((t - viewport.t0) / (viewport.t1 - viewport.t0)) * width;
|
|
287
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Box, { style: { position: "absolute", inset: { left: x, top: 0 } }, children: (0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.faint, fontSize: rem * 0.58, font: theme_1.MONO, wrap: false }, children: `${(t - session.start).toFixed(1)}ms` }) }, i));
|
|
288
|
+
}) }));
|
|
289
|
+
}
|
|
290
|
+
function SpanDetail(props) {
|
|
291
|
+
const { span, session, rem } = props;
|
|
292
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Box, { style: {
|
|
293
|
+
flexDirection: "row",
|
|
294
|
+
gap: rem * 0.8,
|
|
295
|
+
padding: rem * 0.35,
|
|
296
|
+
background: theme_1.theme.panel,
|
|
297
|
+
flexShrink: 0,
|
|
298
|
+
alignItems: "center",
|
|
299
|
+
}, children: span ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.text, fontSize: rem * 0.72, font: theme_1.MONO, wrap: false }, children: span.name }), span.label != null && ((0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.dim, fontSize: rem * 0.66, font: theme_1.MONO, wrap: false }, children: span.label })), (0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.dim, fontSize: rem * 0.66, font: theme_1.MONO, wrap: false }, children: `at ${(span.start - session.start).toFixed(2)}ms` }), (0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.accent, fontSize: rem * 0.66, font: theme_1.MONO, wrap: false }, children: `total ${span.dur.toFixed(2)}ms` }), span.self != null && ((0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.warn, fontSize: rem * 0.66, font: theme_1.MONO, wrap: false }, children: `self ${span.self.toFixed(2)}ms` })), span.arg != null && ((0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.faint, fontSize: rem * 0.66, font: theme_1.MONO, wrap: false }, children: span.name.startsWith("paint.")
|
|
300
|
+
? `n = ${span.arg}`
|
|
301
|
+
: span.name.startsWith("image.")
|
|
302
|
+
? `img #${span.arg}`
|
|
303
|
+
: `batch #${span.arg}` }))] })) : ((0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.faint, fontSize: rem * 0.66, wrap: false }, children: "Click a span to see details, click again to zoom into it." })) }));
|
|
304
|
+
}
|
|
305
|
+
function Summary(props) {
|
|
306
|
+
const { session, rem } = props;
|
|
307
|
+
const frames = session.frames;
|
|
308
|
+
const total = session.end - session.start;
|
|
309
|
+
const avg = frames.length
|
|
310
|
+
? frames.reduce((sum, f) => sum + f.dur, 0) / frames.length
|
|
311
|
+
: 0;
|
|
312
|
+
const worst = frames.reduce((max, f) => Math.max(max, f.dur), 0);
|
|
313
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.dim, fontSize: rem * 0.66, wrap: false }, children: `${(total / 1000).toFixed(1)}s · ${frames.length} frames · avg ${avg.toFixed(1)}ms · worst ${worst.toFixed(1)}ms` }));
|
|
314
|
+
}
|
|
315
|
+
function ProfilerPanel(props) {
|
|
316
|
+
const { rem } = props;
|
|
317
|
+
const state = (0, store_1.useStore)(stores_1.profilerStore);
|
|
318
|
+
const devtools = (0, store_1.useStore)(stores_1.devtoolsStore);
|
|
319
|
+
const viewport = (0, store_1.useStore)(exports.viewportStore);
|
|
320
|
+
const selected = (0, store_1.useStore)(selectedSpanStore);
|
|
321
|
+
const [, setTick] = (0, react_1.useState)(0);
|
|
322
|
+
const [exportedTo, setExportedTo] = (0, react_1.useState)(null);
|
|
323
|
+
const session = state.session;
|
|
324
|
+
(0, react_1.useEffect)(() => {
|
|
325
|
+
if (session && !exports.viewportStore.get()) {
|
|
326
|
+
exports.viewportStore.set({ t0: session.start, t1: session.end });
|
|
327
|
+
}
|
|
328
|
+
}, [session]);
|
|
329
|
+
const chartWidth = Math.max(devtools.width - rem, 40);
|
|
330
|
+
const onChartWheel = (e) => {
|
|
331
|
+
const current = exports.viewportStore.get();
|
|
332
|
+
if (!session || !current)
|
|
333
|
+
return;
|
|
334
|
+
const span = current.t1 - current.t0;
|
|
335
|
+
const scale = chartWidth / span;
|
|
336
|
+
if (Math.abs(e.deltaX) > Math.abs(e.deltaY)) {
|
|
337
|
+
const shift = e.deltaX / scale;
|
|
338
|
+
exports.viewportStore.set(clampViewport({ t0: current.t0 + shift, t1: current.t1 + shift }, session));
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const dy = e.precise ? e.deltaY : e.deltaY * 3;
|
|
342
|
+
const factor = Math.exp(dy * 0.0035);
|
|
343
|
+
const total = session.end - session.start || 1;
|
|
344
|
+
const next = Math.min(Math.max(span * factor, 0.02), total * 1.2);
|
|
345
|
+
const fraction = Math.min(Math.max((e.x - rem * 0.5) / chartWidth, 0), 1);
|
|
346
|
+
const at = current.t0 + fraction * span;
|
|
347
|
+
exports.viewportStore.set(clampViewport({ t0: at - fraction * next, t1: at + (1 - fraction) * next }, session));
|
|
348
|
+
};
|
|
349
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Box, { style: { flexDirection: "column", flexGrow: 1, flexBasis: 0, overflow: "hidden" }, children: [(0, jsx_runtime_1.jsxs)(ui_1.Toolbar, { rem: rem, children: [(0, jsx_runtime_1.jsx)(ui_1.Button, { rem: rem, label: state.recording ? "Stop" : "Record", danger: state.recording, active: state.recording, onClick: () => {
|
|
350
|
+
if (state.recording)
|
|
351
|
+
(0, controller_1.stopRecording)();
|
|
352
|
+
else {
|
|
353
|
+
exports.viewportStore.set(null);
|
|
354
|
+
selectedSpanStore.set(null);
|
|
355
|
+
(0, controller_1.startRecording)();
|
|
356
|
+
}
|
|
357
|
+
setTick((t) => t + 1);
|
|
358
|
+
} }), session && ((0, jsx_runtime_1.jsx)(ui_1.Button, { rem: rem, label: "Clear", onClick: () => {
|
|
359
|
+
(0, controller_1.clearRecording)();
|
|
360
|
+
exports.viewportStore.set(null);
|
|
361
|
+
selectedSpanStore.set(null);
|
|
362
|
+
setExportedTo(null);
|
|
363
|
+
} })), session && ((0, jsx_runtime_1.jsx)(ui_1.Button, { rem: rem, label: "Export", onClick: () => setExportedTo((0, export_profile_1.exportProfile)()) })), (0, jsx_runtime_1.jsx)(ui_1.Button, { rem: rem, label: `cpu ${devtools.cpuRate}x`, active: devtools.cpuRate > 1, danger: devtools.cpuRate > 1, onClick: () => {
|
|
364
|
+
const rates = [1, 2, 4, 10];
|
|
365
|
+
const next = rates[(rates.indexOf(devtools.cpuRate) + 1) % rates.length];
|
|
366
|
+
(0, controller_1.setCpuThrottle)(next);
|
|
367
|
+
} }), session && !exportedTo && (0, jsx_runtime_1.jsx)(Summary, { session: session, rem: rem }), exportedTo && ((0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.ok, fontSize: rem * 0.66, font: theme_1.MONO, wrap: false }, children: exportedTo })), (0, jsx_runtime_1.jsx)(components_1.Box, { style: { flexGrow: 1 } }), (0, jsx_runtime_1.jsx)(components_1.Text, { style: { color: theme_1.theme.faint, fontSize: rem * 0.62, wrap: false }, children: "f=fit" })] }), (0, jsx_runtime_1.jsx)(ui_1.Divider, {}), state.recording ? ((0, jsx_runtime_1.jsx)(ui_1.Empty, { rem: rem, text: "Recording\u2026" })) : state.pendingStop ? ((0, jsx_runtime_1.jsx)(ui_1.Empty, { rem: rem, text: "Waiting for profile\u2026" })) : !session || !viewport ? ((0, jsx_runtime_1.jsx)(ui_1.Empty, { rem: rem, text: "" })) : ((0, jsx_runtime_1.jsxs)(components_1.Box, { style: {
|
|
368
|
+
flexDirection: "column",
|
|
369
|
+
flexGrow: 1,
|
|
370
|
+
flexBasis: 0,
|
|
371
|
+
overflow: "hidden",
|
|
372
|
+
padding: { left: rem * 0.5, right: rem * 0.5 },
|
|
373
|
+
}, onWheel: onChartWheel, children: [(0, jsx_runtime_1.jsx)(Overview, { session: session, width: chartWidth, viewport: viewport, rem: rem }), (0, jsx_runtime_1.jsx)(ui_1.Divider, {}), (0, jsx_runtime_1.jsx)(Ruler, { session: session, viewport: viewport, width: chartWidth, rem: rem }), (0, jsx_runtime_1.jsxs)(components_1.Box, { style: { flexDirection: "column", flexGrow: 1, flexBasis: 0, overflow: "hidden" }, children: [(0, jsx_runtime_1.jsx)(InteractionsLane, { marks: session.marks, viewport: viewport, width: chartWidth, rem: rem, selected: selected }), laneRows(session).map((lane) => ((0, jsx_runtime_1.jsx)(Lane, { label: lane.label, spans: lane.spans, viewport: viewport, width: chartWidth, rem: rem, selected: selected }, lane.label)))] }), (0, jsx_runtime_1.jsx)(SpanDetail, { span: selected, session: session, rem: rem })] }))] }));
|
|
374
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface Store<T> {
|
|
2
|
+
get(): T;
|
|
3
|
+
set(next: T): void;
|
|
4
|
+
update(fn: (current: T) => T): void;
|
|
5
|
+
subscribe(listener: () => void): () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createStore<T>(initial: T): Store<T>;
|
|
8
|
+
export declare function useStore<T>(store: Store<T>): T;
|
|
9
|
+
export type LogLevel = "debug" | "info" | "warn" | "error";
|
|
10
|
+
export interface LogRow {
|
|
11
|
+
id: number;
|
|
12
|
+
level: LogLevel;
|
|
13
|
+
target: string;
|
|
14
|
+
text: string;
|
|
15
|
+
epochMs: number;
|
|
16
|
+
count: number;
|
|
17
|
+
}
|
|
18
|
+
export interface LogBuffer {
|
|
19
|
+
rows: LogRow[];
|
|
20
|
+
version: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function createLogStore(): {
|
|
23
|
+
store: Store<LogBuffer>;
|
|
24
|
+
push(level: LogLevel, target: string, text: string, epochMs?: number): void;
|
|
25
|
+
clear(): void;
|
|
26
|
+
};
|
|
27
|
+
export type LogStore = ReturnType<typeof createLogStore>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createStore = createStore;
|
|
4
|
+
exports.useStore = useStore;
|
|
5
|
+
exports.createLogStore = createLogStore;
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
function createStore(initial) {
|
|
8
|
+
let value = initial;
|
|
9
|
+
const listeners = new Set();
|
|
10
|
+
return {
|
|
11
|
+
get: () => value,
|
|
12
|
+
set(next) {
|
|
13
|
+
if (next === value)
|
|
14
|
+
return;
|
|
15
|
+
value = next;
|
|
16
|
+
for (const listener of listeners)
|
|
17
|
+
listener();
|
|
18
|
+
},
|
|
19
|
+
update(fn) {
|
|
20
|
+
this.set(fn(value));
|
|
21
|
+
},
|
|
22
|
+
subscribe(listener) {
|
|
23
|
+
listeners.add(listener);
|
|
24
|
+
return () => listeners.delete(listener);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function useStore(store) {
|
|
29
|
+
return (0, react_1.useSyncExternalStore)(store.subscribe, store.get, store.get);
|
|
30
|
+
}
|
|
31
|
+
const LOG_CAP = 2000;
|
|
32
|
+
function createLogStore() {
|
|
33
|
+
const store = createStore({ rows: [], version: 0 });
|
|
34
|
+
let nextId = 1;
|
|
35
|
+
return {
|
|
36
|
+
store,
|
|
37
|
+
push(level, target, text, epochMs) {
|
|
38
|
+
store.update((buffer) => {
|
|
39
|
+
const rows = buffer.rows.slice(-LOG_CAP);
|
|
40
|
+
const last = rows[rows.length - 1];
|
|
41
|
+
if (last && last.text === text && last.level === level && last.target === target) {
|
|
42
|
+
rows[rows.length - 1] = { ...last, count: last.count + 1 };
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
rows.push({
|
|
46
|
+
id: nextId++,
|
|
47
|
+
level,
|
|
48
|
+
target,
|
|
49
|
+
text,
|
|
50
|
+
epochMs: epochMs ?? Date.now(),
|
|
51
|
+
count: 1,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return { rows, version: buffer.version + 1 };
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
clear() {
|
|
58
|
+
store.update((buffer) => ({ rows: [], version: buffer.version + 1 }));
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Rgba } from "../native";
|
|
2
|
+
export declare const consoleLogs: {
|
|
3
|
+
store: import("./store").Store<import("./store").LogBuffer>;
|
|
4
|
+
push(level: import("./store").LogLevel, target: string, text: string, epochMs?: number): void;
|
|
5
|
+
clear(): void;
|
|
6
|
+
};
|
|
7
|
+
export declare const engineLogs: {
|
|
8
|
+
store: import("./store").Store<import("./store").LogBuffer>;
|
|
9
|
+
push(level: import("./store").LogLevel, target: string, text: string, epochMs?: number): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
};
|
|
12
|
+
export interface BoxEdges {
|
|
13
|
+
l: number;
|
|
14
|
+
t: number;
|
|
15
|
+
r: number;
|
|
16
|
+
b: number;
|
|
17
|
+
}
|
|
18
|
+
export interface LayoutRect {
|
|
19
|
+
id: number;
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
w: number;
|
|
23
|
+
h: number;
|
|
24
|
+
vw: number;
|
|
25
|
+
vh: number;
|
|
26
|
+
scroll?: number;
|
|
27
|
+
scrollMax?: number;
|
|
28
|
+
text?: string;
|
|
29
|
+
padding?: BoxEdges;
|
|
30
|
+
border?: BoxEdges;
|
|
31
|
+
margin?: BoxEdges;
|
|
32
|
+
}
|
|
33
|
+
export interface LayoutSnapshot {
|
|
34
|
+
rects: Map<number, LayoutRect>;
|
|
35
|
+
stats: {
|
|
36
|
+
frameMs: number;
|
|
37
|
+
fps: number;
|
|
38
|
+
};
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
at: number;
|
|
42
|
+
}
|
|
43
|
+
export declare const layoutStore: import("./store").Store<LayoutSnapshot>;
|
|
44
|
+
export interface InspectorState {
|
|
45
|
+
selectedId: number | null;
|
|
46
|
+
expanded: ReadonlySet<number>;
|
|
47
|
+
picking: boolean;
|
|
48
|
+
treeVersion: number;
|
|
49
|
+
}
|
|
50
|
+
export declare const inspectorStore: import("./store").Store<InspectorState>;
|
|
51
|
+
export interface TimeSpan {
|
|
52
|
+
name: string;
|
|
53
|
+
start: number;
|
|
54
|
+
dur: number;
|
|
55
|
+
depth: number;
|
|
56
|
+
lane: "react" | "bridge" | "engine" | "devtools-engine" | "images" | "interaction";
|
|
57
|
+
self?: number;
|
|
58
|
+
arg?: number;
|
|
59
|
+
label?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface CounterSample {
|
|
62
|
+
name: string;
|
|
63
|
+
at: number;
|
|
64
|
+
value: number;
|
|
65
|
+
}
|
|
66
|
+
export interface ProfileSession {
|
|
67
|
+
spans: TimeSpan[];
|
|
68
|
+
start: number;
|
|
69
|
+
end: number;
|
|
70
|
+
frames: TimeSpan[];
|
|
71
|
+
counters: CounterSample[];
|
|
72
|
+
marks: TimeSpan[];
|
|
73
|
+
}
|
|
74
|
+
export interface ProfilerState {
|
|
75
|
+
recording: boolean;
|
|
76
|
+
pendingStop: boolean;
|
|
77
|
+
session: ProfileSession | null;
|
|
78
|
+
startedAt: number;
|
|
79
|
+
}
|
|
80
|
+
export declare const profilerStore: import("./store").Store<ProfilerState>;
|
|
81
|
+
export declare const pendingSpans: TimeSpan[];
|
|
82
|
+
export declare function recordSpan(span: TimeSpan): void;
|
|
83
|
+
export interface DevtoolsState {
|
|
84
|
+
open: boolean;
|
|
85
|
+
tab: "elements" | "console" | "profiler";
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
basePx: number;
|
|
89
|
+
cpuRate: number;
|
|
90
|
+
background: Rgba | null;
|
|
91
|
+
}
|
|
92
|
+
export declare const devtoolsStore: import("./store").Store<DevtoolsState>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.devtoolsStore = exports.pendingSpans = exports.profilerStore = exports.inspectorStore = exports.layoutStore = exports.engineLogs = exports.consoleLogs = void 0;
|
|
4
|
+
exports.recordSpan = recordSpan;
|
|
5
|
+
const store_1 = require("./store");
|
|
6
|
+
exports.consoleLogs = (0, store_1.createLogStore)();
|
|
7
|
+
exports.engineLogs = (0, store_1.createLogStore)();
|
|
8
|
+
exports.layoutStore = (0, store_1.createStore)({
|
|
9
|
+
rects: new Map(),
|
|
10
|
+
stats: { frameMs: 0, fps: 0 },
|
|
11
|
+
width: 0,
|
|
12
|
+
height: 0,
|
|
13
|
+
at: 0,
|
|
14
|
+
});
|
|
15
|
+
exports.inspectorStore = (0, store_1.createStore)({
|
|
16
|
+
selectedId: null,
|
|
17
|
+
expanded: new Set(),
|
|
18
|
+
picking: false,
|
|
19
|
+
treeVersion: 0,
|
|
20
|
+
});
|
|
21
|
+
exports.profilerStore = (0, store_1.createStore)({
|
|
22
|
+
recording: false,
|
|
23
|
+
pendingStop: false,
|
|
24
|
+
session: null,
|
|
25
|
+
startedAt: 0,
|
|
26
|
+
});
|
|
27
|
+
exports.pendingSpans = [];
|
|
28
|
+
function recordSpan(span) {
|
|
29
|
+
if (!exports.profilerStore.get().recording)
|
|
30
|
+
return;
|
|
31
|
+
exports.pendingSpans.push(span);
|
|
32
|
+
}
|
|
33
|
+
exports.devtoolsStore = (0, store_1.createStore)({
|
|
34
|
+
open: false,
|
|
35
|
+
tab: "elements",
|
|
36
|
+
width: 0,
|
|
37
|
+
height: 0,
|
|
38
|
+
basePx: 16,
|
|
39
|
+
cpuRate: 1,
|
|
40
|
+
background: null,
|
|
41
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { TerminalColors } from "../native";
|
|
2
|
+
declare function build(colors: TerminalColors): {
|
|
3
|
+
bg: string;
|
|
4
|
+
panel: string;
|
|
5
|
+
chrome: string;
|
|
6
|
+
chromeActive: string;
|
|
7
|
+
border: string;
|
|
8
|
+
text: string;
|
|
9
|
+
dim: string;
|
|
10
|
+
faint: string;
|
|
11
|
+
accent: string;
|
|
12
|
+
accentDim: string;
|
|
13
|
+
selectionBg: string;
|
|
14
|
+
hover: string;
|
|
15
|
+
tag: string;
|
|
16
|
+
attrName: string;
|
|
17
|
+
attrValue: string;
|
|
18
|
+
danger: string;
|
|
19
|
+
warn: string;
|
|
20
|
+
ok: string;
|
|
21
|
+
levels: Record<string, string>;
|
|
22
|
+
flame: {
|
|
23
|
+
react: string[];
|
|
24
|
+
bridge: string[];
|
|
25
|
+
engine: string[];
|
|
26
|
+
devtools: string[];
|
|
27
|
+
images: string[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type DevtoolsTheme = ReturnType<typeof build>;
|
|
31
|
+
export declare let theme: DevtoolsTheme;
|
|
32
|
+
export declare function refreshTheme(colors: TerminalColors): void;
|
|
33
|
+
export declare const MONO = 0;
|
|
34
|
+
export declare const UI = 0;
|
|
35
|
+
export {};
|