react-code-locator 0.1.17 → 0.1.18
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 +54 -279
- package/dist/index.cjs +7132 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7126 -15
- package/dist/index.js.map +1 -1
- package/dist/unplugin.cjs +5 -2
- package/dist/unplugin.cjs.map +1 -1
- package/dist/unplugin.d.cts +3 -1
- package/dist/unplugin.d.ts +3 -1
- package/dist/unplugin.js +3 -1
- package/dist/unplugin.js.map +1 -1
- package/package.json +3 -38
- package/dist/core/transform-cjs.cjs +0 -7014
- package/dist/core/webpackPitchLoader-cjs.cjs +0 -7032
- package/dist/webpack.cjs +0 -92
- package/dist/webpack.cjs.map +0 -1
- package/dist/webpack.d.cts +0 -56
- package/dist/webpack.d.ts +0 -56
- package/dist/webpack.js +0 -62
- package/dist/webpack.js.map +0 -1
- package/dist/webpackLoader.cjs +0 -7115
- package/dist/webpackLoader.cjs.map +0 -1
- package/dist/webpackLoader.d.cts +0 -15
- package/dist/webpackLoader.d.ts +0 -15
- package/dist/webpackLoader.js +0 -7092
- package/dist/webpackLoader.js.map +0 -1
- package/dist/webpackRuntimeEntry.cjs +0 -375
- package/dist/webpackRuntimeEntry.cjs.map +0 -1
- package/dist/webpackRuntimeEntry.d.cts +0 -2
- package/dist/webpackRuntimeEntry.d.ts +0 -2
- package/dist/webpackRuntimeEntry.js +0 -373
- package/dist/webpackRuntimeEntry.js.map +0 -1
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// src/constants.ts
|
|
4
|
-
var SOURCE_PROP = "__componentSourceLoc";
|
|
5
|
-
var JSX_SOURCE_PROP = "$componentSourceLoc";
|
|
6
|
-
var JSX_SOURCE_REGISTRY_SYMBOL = "react-code-locator.jsxSourceRegistry";
|
|
7
|
-
|
|
8
|
-
// src/sourceMetadata.ts
|
|
9
|
-
function normalizeSlashes(value) {
|
|
10
|
-
return value.replace(/\\/g, "/");
|
|
11
|
-
}
|
|
12
|
-
function trimTrailingSlash(value) {
|
|
13
|
-
return value.replace(/\/+$/, "");
|
|
14
|
-
}
|
|
15
|
-
function splitPathSegments(value) {
|
|
16
|
-
return normalizeSlashes(value).split("/").filter(Boolean);
|
|
17
|
-
}
|
|
18
|
-
function computeRelativePath(fromPath, toPath) {
|
|
19
|
-
const fromSegments = splitPathSegments(fromPath);
|
|
20
|
-
const toSegments = splitPathSegments(toPath);
|
|
21
|
-
let sharedIndex = 0;
|
|
22
|
-
while (sharedIndex < fromSegments.length && sharedIndex < toSegments.length && fromSegments[sharedIndex] === toSegments[sharedIndex]) {
|
|
23
|
-
sharedIndex += 1;
|
|
24
|
-
}
|
|
25
|
-
const upSegments = new Array(Math.max(0, fromSegments.length - sharedIndex)).fill("..");
|
|
26
|
-
const downSegments = toSegments.slice(sharedIndex);
|
|
27
|
-
const relativeSegments = [...upSegments, ...downSegments];
|
|
28
|
-
return relativeSegments.length > 0 ? relativeSegments.join("/") : ".";
|
|
29
|
-
}
|
|
30
|
-
function normalizeProjectRoot(projectRoot) {
|
|
31
|
-
if (projectRoot) {
|
|
32
|
-
return trimTrailingSlash(normalizeSlashes(projectRoot));
|
|
33
|
-
}
|
|
34
|
-
return "";
|
|
35
|
-
}
|
|
36
|
-
function getSourceFile(source) {
|
|
37
|
-
if (!source) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
const match = source.match(/^(.*):\d+:\d+$/);
|
|
41
|
-
return match?.[1] ?? null;
|
|
42
|
-
}
|
|
43
|
-
function isProjectLocalFile(filename, projectRoot) {
|
|
44
|
-
if (!filename) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
const root = normalizeProjectRoot(projectRoot);
|
|
48
|
-
const normalizedFilename = normalizeSlashes(filename);
|
|
49
|
-
if (!root) {
|
|
50
|
-
return !normalizedFilename.startsWith("../") && !normalizedFilename.startsWith("/") && !/^[A-Za-z]:\//.test(normalizedFilename);
|
|
51
|
-
}
|
|
52
|
-
if (normalizedFilename.startsWith(`${root}/`) || normalizedFilename === root) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
const relativePath = computeRelativePath(root, normalizedFilename);
|
|
56
|
-
return !relativePath.startsWith("../");
|
|
57
|
-
}
|
|
58
|
-
function isProjectLocalSource(source, projectRoot) {
|
|
59
|
-
const file = getSourceFile(source);
|
|
60
|
-
return isProjectLocalFile(file ?? void 0, projectRoot);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// src/runtime.ts
|
|
64
|
-
function isTriggerPressed(event, triggerKey) {
|
|
65
|
-
if (triggerKey === "none") {
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
if (triggerKey === "alt") {
|
|
69
|
-
return event.altKey;
|
|
70
|
-
}
|
|
71
|
-
if (triggerKey === "meta") {
|
|
72
|
-
return event.metaKey;
|
|
73
|
-
}
|
|
74
|
-
if (triggerKey === "ctrl") {
|
|
75
|
-
return event.ctrlKey;
|
|
76
|
-
}
|
|
77
|
-
return event.shiftKey;
|
|
78
|
-
}
|
|
79
|
-
function getReactFiberKey(element) {
|
|
80
|
-
return Object.keys(element).find((key) => key.startsWith("__reactFiber$") || key.startsWith("__reactInternalInstance$"));
|
|
81
|
-
}
|
|
82
|
-
function getClosestReactFiber(target) {
|
|
83
|
-
let current = target;
|
|
84
|
-
while (current) {
|
|
85
|
-
const fiberKey = getReactFiberKey(current);
|
|
86
|
-
if (fiberKey) {
|
|
87
|
-
return current[fiberKey];
|
|
88
|
-
}
|
|
89
|
-
current = current.parentElement;
|
|
90
|
-
}
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
function getSourceFromType(type) {
|
|
94
|
-
if (!type) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
if (typeof type === "function") {
|
|
98
|
-
const source2 = type[SOURCE_PROP];
|
|
99
|
-
return typeof source2 === "string" ? source2 : null;
|
|
100
|
-
}
|
|
101
|
-
if (typeof type !== "object") {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
const record = type;
|
|
105
|
-
const source = record[SOURCE_PROP] ?? record.type?.[SOURCE_PROP] ?? record.render?.[SOURCE_PROP];
|
|
106
|
-
return typeof source === "string" ? source : null;
|
|
107
|
-
}
|
|
108
|
-
function getSourceFromProps(props) {
|
|
109
|
-
if (props && typeof props === "object") {
|
|
110
|
-
const registry = globalThis[Symbol.for(JSX_SOURCE_REGISTRY_SYMBOL)];
|
|
111
|
-
if (registry instanceof WeakMap) {
|
|
112
|
-
const intrinsicSource = registry.get(props);
|
|
113
|
-
if (typeof intrinsicSource === "string") {
|
|
114
|
-
return intrinsicSource;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
const source = props?.[JSX_SOURCE_PROP];
|
|
119
|
-
return typeof source === "string" ? source : null;
|
|
120
|
-
}
|
|
121
|
-
function resolveComponentSourceFromFiber(fiber) {
|
|
122
|
-
let current = fiber;
|
|
123
|
-
while (current) {
|
|
124
|
-
const source = getSourceFromType(current.type) ?? getSourceFromType(current.elementType);
|
|
125
|
-
if (source) {
|
|
126
|
-
return source;
|
|
127
|
-
}
|
|
128
|
-
current = current.return ?? null;
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
function getDirectDebugSource(fiber) {
|
|
133
|
-
const debugSource = fiber?._debugSource;
|
|
134
|
-
if (debugSource?.fileName && typeof debugSource.lineNumber === "number") {
|
|
135
|
-
return `${debugSource.fileName.replace(/\\/g, "/")}:${debugSource.lineNumber}:${debugSource.columnNumber ?? 1}`;
|
|
136
|
-
}
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
function resolveSourceCandidates(fiber) {
|
|
140
|
-
let current = fiber;
|
|
141
|
-
const jsxCandidates = [];
|
|
142
|
-
const componentCandidates = [];
|
|
143
|
-
while (current) {
|
|
144
|
-
const jsxSource = getSourceFromProps(current.pendingProps) ?? getSourceFromProps(current.memoizedProps) ?? getDirectDebugSource(current);
|
|
145
|
-
if (jsxSource) {
|
|
146
|
-
const file = getSourceFile(jsxSource);
|
|
147
|
-
if (file && !jsxCandidates.some((candidate) => candidate.source === jsxSource)) {
|
|
148
|
-
jsxCandidates.push({ source: jsxSource, file });
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
const componentSource = getSourceFromType(current.type) ?? getSourceFromType(current.elementType);
|
|
152
|
-
if (componentSource) {
|
|
153
|
-
const file = getSourceFile(componentSource);
|
|
154
|
-
if (file && !componentCandidates.some((candidate) => candidate.source === componentSource)) {
|
|
155
|
-
componentCandidates.push({ source: componentSource, file });
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
current = current.return ?? null;
|
|
159
|
-
}
|
|
160
|
-
const direct = jsxCandidates[0]?.source ?? null;
|
|
161
|
-
const nearestProjectLocalComponentFile = componentCandidates.find((candidate) => isProjectLocalSource(candidate.source))?.file;
|
|
162
|
-
let screen = null;
|
|
163
|
-
if (nearestProjectLocalComponentFile) {
|
|
164
|
-
const matchingJsxCandidate = jsxCandidates.find((candidate) => candidate.file === nearestProjectLocalComponentFile);
|
|
165
|
-
if (matchingJsxCandidate) {
|
|
166
|
-
screen = matchingJsxCandidate.source;
|
|
167
|
-
} else {
|
|
168
|
-
const matchingComponentCandidate = componentCandidates.find(
|
|
169
|
-
(candidate) => candidate.file === nearestProjectLocalComponentFile
|
|
170
|
-
);
|
|
171
|
-
if (matchingComponentCandidate) {
|
|
172
|
-
screen = matchingComponentCandidate.source;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
const implementationComponentCandidate = componentCandidates.find((candidate) => !isProjectLocalSource(candidate.source))?.source ?? null;
|
|
177
|
-
const implementationJsxCandidate = jsxCandidates.find((candidate) => !isProjectLocalSource(candidate.source))?.source ?? null;
|
|
178
|
-
const projectLocalJsxCandidate = jsxCandidates.find((candidate) => isProjectLocalSource(candidate.source))?.source ?? null;
|
|
179
|
-
const screenFallback = screen ?? projectLocalJsxCandidate ?? componentCandidates.find((candidate) => isProjectLocalSource(candidate.source))?.source ?? null;
|
|
180
|
-
return {
|
|
181
|
-
direct: direct ?? screenFallback,
|
|
182
|
-
screen: screenFallback,
|
|
183
|
-
implementation: implementationComponentCandidate ?? implementationJsxCandidate ?? screenFallback
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
function getModeDescription(mode) {
|
|
187
|
-
if (mode === "direct") {
|
|
188
|
-
return "Direct JSX";
|
|
189
|
-
}
|
|
190
|
-
if (mode === "screen") {
|
|
191
|
-
return "Screen source";
|
|
192
|
-
}
|
|
193
|
-
return "Implementation source";
|
|
194
|
-
}
|
|
195
|
-
function createStatusOverlay(triggerKey) {
|
|
196
|
-
if (typeof document === "undefined") {
|
|
197
|
-
return null;
|
|
198
|
-
}
|
|
199
|
-
const element = document.createElement("div");
|
|
200
|
-
let copyValue = null;
|
|
201
|
-
let currentMode = "screen";
|
|
202
|
-
let hideTimer = null;
|
|
203
|
-
element.setAttribute("data-react-code-locator", "true");
|
|
204
|
-
Object.assign(element.style, {
|
|
205
|
-
position: "fixed",
|
|
206
|
-
right: "12px",
|
|
207
|
-
bottom: "12px",
|
|
208
|
-
zIndex: "2147483647",
|
|
209
|
-
padding: "8px 10px",
|
|
210
|
-
borderRadius: "8px",
|
|
211
|
-
background: "rgba(17, 24, 39, 0.92)",
|
|
212
|
-
color: "#fff",
|
|
213
|
-
fontSize: "12px",
|
|
214
|
-
lineHeight: "1.4",
|
|
215
|
-
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
216
|
-
boxShadow: "0 8px 30px rgba(0, 0, 0, 0.25)",
|
|
217
|
-
pointerEvents: "auto",
|
|
218
|
-
cursor: "pointer",
|
|
219
|
-
maxWidth: "min(70vw, 720px)",
|
|
220
|
-
wordBreak: "break-all",
|
|
221
|
-
opacity: "0",
|
|
222
|
-
transition: "opacity 120ms ease"
|
|
223
|
-
});
|
|
224
|
-
const show = (message, tone) => {
|
|
225
|
-
element.textContent = message;
|
|
226
|
-
element.style.background = tone === "success" ? "rgba(6, 95, 70, 0.92)" : tone === "error" ? "rgba(153, 27, 27, 0.94)" : "rgba(17, 24, 39, 0.92)";
|
|
227
|
-
element.style.opacity = "1";
|
|
228
|
-
element.style.pointerEvents = "auto";
|
|
229
|
-
if (hideTimer) {
|
|
230
|
-
clearTimeout(hideTimer);
|
|
231
|
-
}
|
|
232
|
-
hideTimer = setTimeout(() => {
|
|
233
|
-
element.style.opacity = "0";
|
|
234
|
-
element.style.pointerEvents = "none";
|
|
235
|
-
}, 2e3);
|
|
236
|
-
};
|
|
237
|
-
element.addEventListener("click", async () => {
|
|
238
|
-
if (!copyValue) {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
try {
|
|
242
|
-
await navigator.clipboard.writeText(copyValue);
|
|
243
|
-
show(`[react-code-locator] copied`, "success");
|
|
244
|
-
} catch {
|
|
245
|
-
show(`[react-code-locator] copy failed`, "error");
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
show(`[react-code-locator] enabled (${triggerKey}+click, alt+1/2/3 to switch mode)`, "idle");
|
|
249
|
-
const mount = () => {
|
|
250
|
-
if (!element.isConnected && document.body) {
|
|
251
|
-
document.body.appendChild(element);
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
if (document.body) {
|
|
255
|
-
mount();
|
|
256
|
-
} else {
|
|
257
|
-
document.addEventListener("DOMContentLoaded", mount, { once: true });
|
|
258
|
-
}
|
|
259
|
-
return {
|
|
260
|
-
setStatus(message, tone = "idle") {
|
|
261
|
-
show(message, tone);
|
|
262
|
-
},
|
|
263
|
-
setCopyValue(value) {
|
|
264
|
-
copyValue = value;
|
|
265
|
-
},
|
|
266
|
-
setMode(mode) {
|
|
267
|
-
currentMode = mode;
|
|
268
|
-
show(`[react-code-locator] ${getModeDescription(mode)}`, "idle");
|
|
269
|
-
},
|
|
270
|
-
remove() {
|
|
271
|
-
if (hideTimer) {
|
|
272
|
-
clearTimeout(hideTimer);
|
|
273
|
-
}
|
|
274
|
-
element.remove();
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
function locateComponentSource(target, mode = "screen") {
|
|
279
|
-
const elementTarget = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;
|
|
280
|
-
const fiber = getClosestReactFiber(elementTarget);
|
|
281
|
-
if (!fiber) {
|
|
282
|
-
return null;
|
|
283
|
-
}
|
|
284
|
-
const candidates = resolveSourceCandidates(fiber);
|
|
285
|
-
const source = candidates[mode] ?? candidates.screen ?? candidates.direct ?? candidates.implementation;
|
|
286
|
-
if (source) {
|
|
287
|
-
return {
|
|
288
|
-
source,
|
|
289
|
-
mode
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
const componentSource = resolveComponentSourceFromFiber(fiber);
|
|
293
|
-
if (!componentSource) {
|
|
294
|
-
return null;
|
|
295
|
-
}
|
|
296
|
-
return {
|
|
297
|
-
source: componentSource,
|
|
298
|
-
mode
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
function enableReactComponentJump(options = {}) {
|
|
302
|
-
const overlay = createStatusOverlay(options.triggerKey ?? "shift");
|
|
303
|
-
let currentMode = "screen";
|
|
304
|
-
const {
|
|
305
|
-
triggerKey = "shift",
|
|
306
|
-
onLocate = (result) => {
|
|
307
|
-
console.log(`[react-code-locator] ${result.source}`);
|
|
308
|
-
overlay?.setCopyValue(result.source);
|
|
309
|
-
overlay?.setStatus(`[react-code-locator] ${result.source}`, "success");
|
|
310
|
-
},
|
|
311
|
-
onError = (error) => {
|
|
312
|
-
console.error("[react-code-locator]", error);
|
|
313
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
314
|
-
overlay?.setCopyValue(null);
|
|
315
|
-
overlay?.setStatus(`[react-code-locator] ${message}`, "error");
|
|
316
|
-
}
|
|
317
|
-
} = options;
|
|
318
|
-
console.log("[react-code-locator] enabled", { triggerKey });
|
|
319
|
-
const keyHandler = (event) => {
|
|
320
|
-
if (!event.altKey) {
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
if (event.code === "Digit1") {
|
|
324
|
-
currentMode = "direct";
|
|
325
|
-
overlay?.setMode(currentMode);
|
|
326
|
-
event.preventDefault();
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
if (event.code === "Digit2") {
|
|
330
|
-
currentMode = "screen";
|
|
331
|
-
overlay?.setMode(currentMode);
|
|
332
|
-
event.preventDefault();
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
if (event.code === "Digit3") {
|
|
336
|
-
currentMode = "implementation";
|
|
337
|
-
overlay?.setMode(currentMode);
|
|
338
|
-
event.preventDefault();
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
const handler = (event) => {
|
|
342
|
-
console.log("[react-code-locator] click", {
|
|
343
|
-
triggerKey,
|
|
344
|
-
shiftKey: event.shiftKey,
|
|
345
|
-
altKey: event.altKey,
|
|
346
|
-
ctrlKey: event.ctrlKey,
|
|
347
|
-
metaKey: event.metaKey,
|
|
348
|
-
target: event.target
|
|
349
|
-
});
|
|
350
|
-
if (!isTriggerPressed(event, triggerKey)) {
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
const result = locateComponentSource(event.target, currentMode);
|
|
354
|
-
if (!result) {
|
|
355
|
-
onError(new Error("No React component source metadata found for clicked element."));
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
event.preventDefault();
|
|
359
|
-
event.stopPropagation();
|
|
360
|
-
onLocate(result);
|
|
361
|
-
};
|
|
362
|
-
document.addEventListener("click", handler, true);
|
|
363
|
-
document.addEventListener("keydown", keyHandler, true);
|
|
364
|
-
return () => {
|
|
365
|
-
document.removeEventListener("click", handler, true);
|
|
366
|
-
document.removeEventListener("keydown", keyHandler, true);
|
|
367
|
-
overlay?.remove();
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// src/webpackRuntimeEntry.ts
|
|
372
|
-
if (typeof document !== "undefined") {
|
|
373
|
-
enableReactComponentJump();
|
|
374
|
-
}
|
|
375
|
-
//# sourceMappingURL=webpackRuntimeEntry.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts","../src/sourceMetadata.ts","../src/runtime.ts","../src/webpackRuntimeEntry.ts"],"sourcesContent":["export const SOURCE_PROP = \"__componentSourceLoc\";\nexport const JSX_SOURCE_PROP = \"$componentSourceLoc\";\nexport const JSX_SOURCE_REGISTRY_SYMBOL = \"react-code-locator.jsxSourceRegistry\";\n","export type SourceLocation = {\n line: number;\n column: number;\n};\n\nfunction normalizeSlashes(value: string) {\n return value.replace(/\\\\/g, \"/\");\n}\n\nfunction trimTrailingSlash(value: string) {\n return value.replace(/\\/+$/, \"\");\n}\n\nfunction splitPathSegments(value: string) {\n return normalizeSlashes(value).split(\"/\").filter(Boolean);\n}\n\nfunction computeRelativePath(fromPath: string, toPath: string) {\n const fromSegments = splitPathSegments(fromPath);\n const toSegments = splitPathSegments(toPath);\n\n let sharedIndex = 0;\n while (\n sharedIndex < fromSegments.length &&\n sharedIndex < toSegments.length &&\n fromSegments[sharedIndex] === toSegments[sharedIndex]\n ) {\n sharedIndex += 1;\n }\n\n const upSegments = new Array(Math.max(0, fromSegments.length - sharedIndex)).fill(\"..\");\n const downSegments = toSegments.slice(sharedIndex);\n const relativeSegments = [...upSegments, ...downSegments];\n return relativeSegments.length > 0 ? relativeSegments.join(\"/\") : \".\";\n}\n\nexport function normalizeProjectRoot(projectRoot?: string) {\n if (projectRoot) {\n return trimTrailingSlash(normalizeSlashes(projectRoot));\n }\n return \"\";\n}\n\nexport function toRelativeSource(\n filename: string | undefined,\n loc: SourceLocation | null | undefined,\n projectRoot?: string,\n) {\n if (!filename || !loc) {\n return null;\n }\n\n const root = normalizeProjectRoot(projectRoot);\n const normalizedFilename = normalizeSlashes(filename);\n const relPath =\n root && normalizedFilename.startsWith(`${root}/`)\n ? normalizedFilename.slice(root.length + 1)\n : root\n ? computeRelativePath(root, normalizedFilename)\n : normalizedFilename;\n return `${relPath}:${loc.line}:${loc.column + 1}`;\n}\n\nexport function getSourceFile(source: string | null) {\n if (!source) {\n return null;\n }\n\n const match = source.match(/^(.*):\\d+:\\d+$/);\n return match?.[1] ?? null;\n}\n\nexport function isProjectLocalFile(filename: string | undefined, projectRoot?: string) {\n if (!filename) {\n return false;\n }\n\n const root = normalizeProjectRoot(projectRoot);\n const normalizedFilename = normalizeSlashes(filename);\n\n if (!root) {\n return (\n !normalizedFilename.startsWith(\"../\") &&\n !normalizedFilename.startsWith(\"/\") &&\n !/^[A-Za-z]:\\//.test(normalizedFilename)\n );\n }\n\n if (normalizedFilename.startsWith(`${root}/`) || normalizedFilename === root) {\n return true;\n }\n\n const relativePath = computeRelativePath(root, normalizedFilename);\n return !relativePath.startsWith(\"../\");\n}\n\nexport function isExternalToProjectRoot(filename: string | undefined, projectRoot?: string) {\n return !isProjectLocalFile(filename, projectRoot);\n}\n\nexport function isProjectLocalSource(source: string, projectRoot?: string) {\n const file = getSourceFile(source);\n return isProjectLocalFile(file ?? undefined, projectRoot);\n}\n","import {\n JSX_SOURCE_PROP,\n JSX_SOURCE_REGISTRY_SYMBOL,\n SOURCE_PROP,\n} from \"./constants\";\nimport { getSourceFile, isProjectLocalSource } from \"./sourceMetadata\";\n\nexport type TriggerKey = \"alt\" | \"meta\" | \"ctrl\" | \"shift\" | \"none\";\nexport type LocatorMode = \"direct\" | \"screen\" | \"implementation\";\n\ntype ReactFiber = {\n return?: ReactFiber | null;\n type?: unknown;\n elementType?: unknown;\n pendingProps?: Record<string, unknown> | null;\n memoizedProps?: Record<string, unknown> | null;\n _debugOwner?: ReactFiber | null;\n _debugSource?: {\n fileName?: string;\n lineNumber?: number;\n columnNumber?: number;\n } | null;\n};\n\nexport type LocatorResult = {\n source: string;\n mode: LocatorMode;\n};\n\nexport type LocatorOptions = {\n triggerKey?: TriggerKey;\n onLocate?: (result: LocatorResult) => void;\n onError?: (error: unknown) => void;\n};\n\ntype StatusOverlay = {\n setStatus: (message: string, tone?: \"idle\" | \"success\" | \"error\") => void;\n setCopyValue: (value: string | null) => void;\n setMode: (mode: LocatorMode) => void;\n remove: () => void;\n};\n\nfunction isTriggerPressed(event: MouseEvent, triggerKey: TriggerKey) {\n if (triggerKey === \"none\") {\n return true;\n }\n\n if (triggerKey === \"alt\") {\n return event.altKey;\n }\n\n if (triggerKey === \"meta\") {\n return event.metaKey;\n }\n\n if (triggerKey === \"ctrl\") {\n return event.ctrlKey;\n }\n\n return event.shiftKey;\n}\n\nfunction getReactFiberKey(element: Element) {\n return Object.keys(element).find((key) => key.startsWith(\"__reactFiber$\") || key.startsWith(\"__reactInternalInstance$\"));\n}\n\nfunction getClosestReactFiber(target: Element | null) {\n let current = target;\n\n while (current) {\n const fiberKey = getReactFiberKey(current);\n if (fiberKey) {\n return (current as unknown as Record<string, unknown>)[fiberKey] as ReactFiber;\n }\n\n current = current.parentElement;\n }\n\n return null;\n}\n\nfunction getSourceFromType(type: unknown) {\n if (!type) {\n return null;\n }\n\n if (typeof type === \"function\") {\n const source = (type as unknown as Record<string, unknown>)[SOURCE_PROP];\n return typeof source === \"string\" ? source : null;\n }\n\n if (typeof type !== \"object\") {\n return null;\n }\n\n const record = type as {\n type?: Record<string, unknown>;\n render?: Record<string, unknown>;\n [SOURCE_PROP]?: unknown;\n };\n\n const source = record[SOURCE_PROP] ?? record.type?.[SOURCE_PROP] ?? record.render?.[SOURCE_PROP];\n return typeof source === \"string\" ? source : null;\n}\n\nfunction getSourceFromProps(props: Record<string, unknown> | null | undefined) {\n if (props && typeof props === \"object\") {\n const registry = (globalThis as Record<symbol, unknown>)[\n Symbol.for(JSX_SOURCE_REGISTRY_SYMBOL)\n ];\n if (registry instanceof WeakMap) {\n const intrinsicSource = registry.get(props as object);\n if (typeof intrinsicSource === \"string\") {\n return intrinsicSource;\n }\n }\n }\n\n const source = props?.[JSX_SOURCE_PROP];\n return typeof source === \"string\" ? source : null;\n}\n\nfunction resolveComponentSourceFromFiber(fiber: ReactFiber | null) {\n let current = fiber;\n\n while (current) {\n const source = getSourceFromType(current.type) ?? getSourceFromType(current.elementType);\n if (source) {\n return source;\n }\n\n current = current.return ?? null;\n }\n\n return null;\n}\n\nfunction getDirectDebugSource(fiber: ReactFiber | null) {\n const debugSource = fiber?._debugSource;\n if (debugSource?.fileName && typeof debugSource.lineNumber === \"number\") {\n return `${debugSource.fileName.replace(/\\\\/g, \"/\")}:${debugSource.lineNumber}:${debugSource.columnNumber ?? 1}`;\n }\n\n return null;\n}\n\ntype SourceCandidate = {\n source: string;\n file: string;\n};\n\ntype ResolvedCandidates = {\n direct: string | null;\n screen: string | null;\n implementation: string | null;\n};\n\nfunction resolveSourceCandidates(fiber: ReactFiber | null): ResolvedCandidates {\n let current = fiber;\n const jsxCandidates: SourceCandidate[] = [];\n const componentCandidates: SourceCandidate[] = [];\n\n while (current) {\n const jsxSource =\n getSourceFromProps(current.pendingProps) ?? getSourceFromProps(current.memoizedProps) ?? getDirectDebugSource(current);\n if (jsxSource) {\n const file = getSourceFile(jsxSource);\n if (file && !jsxCandidates.some((candidate) => candidate.source === jsxSource)) {\n jsxCandidates.push({ source: jsxSource, file });\n }\n }\n\n const componentSource = getSourceFromType(current.type) ?? getSourceFromType(current.elementType);\n if (componentSource) {\n const file = getSourceFile(componentSource);\n if (file && !componentCandidates.some((candidate) => candidate.source === componentSource)) {\n componentCandidates.push({ source: componentSource, file });\n }\n }\n\n current = current.return ?? null;\n }\n\n const direct = jsxCandidates[0]?.source ?? null;\n const nearestProjectLocalComponentFile = componentCandidates.find((candidate) => isProjectLocalSource(candidate.source))?.file;\n let screen: string | null = null;\n if (nearestProjectLocalComponentFile) {\n const matchingJsxCandidate = jsxCandidates.find((candidate) => candidate.file === nearestProjectLocalComponentFile);\n if (matchingJsxCandidate) {\n screen = matchingJsxCandidate.source;\n } else {\n const matchingComponentCandidate = componentCandidates.find(\n (candidate) => candidate.file === nearestProjectLocalComponentFile,\n );\n if (matchingComponentCandidate) {\n screen = matchingComponentCandidate.source;\n }\n }\n }\n\n const implementationComponentCandidate =\n componentCandidates.find((candidate) => !isProjectLocalSource(candidate.source))?.source ?? null;\n const implementationJsxCandidate =\n jsxCandidates.find((candidate) => !isProjectLocalSource(candidate.source))?.source ?? null;\n\n const projectLocalJsxCandidate = jsxCandidates.find((candidate) => isProjectLocalSource(candidate.source))?.source ?? null;\n const screenFallback = screen ?? projectLocalJsxCandidate ?? componentCandidates.find((candidate) => isProjectLocalSource(candidate.source))?.source ?? null;\n\n return {\n direct: direct ?? screenFallback,\n screen: screenFallback,\n implementation: implementationComponentCandidate ?? implementationJsxCandidate ?? screenFallback,\n };\n}\n\nfunction getModeDescription(mode: LocatorMode) {\n if (mode === \"direct\") {\n return \"Direct JSX\";\n }\n\n if (mode === \"screen\") {\n return \"Screen source\";\n }\n\n return \"Implementation source\";\n}\n\nfunction createStatusOverlay(triggerKey: TriggerKey): StatusOverlay | null {\n if (typeof document === \"undefined\") {\n return null;\n }\n\n const element = document.createElement(\"div\");\n let copyValue: string | null = null;\n let currentMode: LocatorMode = \"screen\";\n let hideTimer: ReturnType<typeof setTimeout> | null = null;\n element.setAttribute(\"data-react-code-locator\", \"true\");\n Object.assign(element.style, {\n position: \"fixed\",\n right: \"12px\",\n bottom: \"12px\",\n zIndex: \"2147483647\",\n padding: \"8px 10px\",\n borderRadius: \"8px\",\n background: \"rgba(17, 24, 39, 0.92)\",\n color: \"#fff\",\n fontSize: \"12px\",\n lineHeight: \"1.4\",\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\",\n boxShadow: \"0 8px 30px rgba(0, 0, 0, 0.25)\",\n pointerEvents: \"auto\",\n cursor: \"pointer\",\n maxWidth: \"min(70vw, 720px)\",\n wordBreak: \"break-all\",\n opacity: \"0\",\n transition: \"opacity 120ms ease\",\n });\n\n const show = (message: string, tone: \"idle\" | \"success\" | \"error\") => {\n element.textContent = message;\n element.style.background =\n tone === \"success\"\n ? \"rgba(6, 95, 70, 0.92)\"\n : tone === \"error\"\n ? \"rgba(153, 27, 27, 0.94)\"\n : \"rgba(17, 24, 39, 0.92)\";\n element.style.opacity = \"1\";\n element.style.pointerEvents = \"auto\";\n\n if (hideTimer) {\n clearTimeout(hideTimer);\n }\n\n hideTimer = setTimeout(() => {\n element.style.opacity = \"0\";\n element.style.pointerEvents = \"none\";\n }, 2000);\n };\n\n element.addEventListener(\"click\", async () => {\n if (!copyValue) {\n return;\n }\n\n try {\n await navigator.clipboard.writeText(copyValue);\n show(`[react-code-locator] copied`, \"success\");\n } catch {\n show(`[react-code-locator] copy failed`, \"error\");\n }\n });\n\n show(`[react-code-locator] enabled (${triggerKey}+click, alt+1/2/3 to switch mode)`, \"idle\");\n\n const mount = () => {\n if (!element.isConnected && document.body) {\n document.body.appendChild(element);\n }\n };\n\n if (document.body) {\n mount();\n } else {\n document.addEventListener(\"DOMContentLoaded\", mount, { once: true });\n }\n\n return {\n setStatus(message, tone = \"idle\") {\n show(message, tone);\n },\n setCopyValue(value) {\n copyValue = value;\n },\n setMode(mode) {\n currentMode = mode;\n show(`[react-code-locator] ${getModeDescription(mode)}`, \"idle\");\n },\n remove() {\n if (hideTimer) {\n clearTimeout(hideTimer);\n }\n element.remove();\n },\n };\n}\n\nexport function locateComponentSource(target: EventTarget | null, mode: LocatorMode = \"screen\"): LocatorResult | null {\n const elementTarget =\n target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n const fiber = getClosestReactFiber(elementTarget);\n if (!fiber) {\n return null;\n }\n\n const candidates = resolveSourceCandidates(fiber);\n const source = candidates[mode] ?? candidates.screen ?? candidates.direct ?? candidates.implementation;\n if (source) {\n return {\n source,\n mode,\n };\n }\n\n const componentSource = resolveComponentSourceFromFiber(fiber);\n if (!componentSource) {\n return null;\n }\n\n return {\n source: componentSource,\n mode,\n };\n}\n\nexport function enableReactComponentJump(options: LocatorOptions = {}) {\n const overlay = createStatusOverlay(options.triggerKey ?? \"shift\");\n let currentMode: LocatorMode = \"screen\";\n const {\n triggerKey = \"shift\",\n onLocate = (result) => {\n console.log(`[react-code-locator] ${result.source}`);\n overlay?.setCopyValue(result.source);\n overlay?.setStatus(`[react-code-locator] ${result.source}`, \"success\");\n },\n onError = (error) => {\n console.error(\"[react-code-locator]\", error);\n const message = error instanceof Error ? error.message : String(error);\n overlay?.setCopyValue(null);\n overlay?.setStatus(`[react-code-locator] ${message}`, \"error\");\n },\n } = options;\n\n console.log(\"[react-code-locator] enabled\", { triggerKey });\n\n const keyHandler = (event: KeyboardEvent) => {\n if (!event.altKey) {\n return;\n }\n\n if (event.code === \"Digit1\") {\n currentMode = \"direct\";\n overlay?.setMode(currentMode);\n event.preventDefault();\n return;\n }\n\n if (event.code === \"Digit2\") {\n currentMode = \"screen\";\n overlay?.setMode(currentMode);\n event.preventDefault();\n return;\n }\n\n if (event.code === \"Digit3\") {\n currentMode = \"implementation\";\n overlay?.setMode(currentMode);\n event.preventDefault();\n }\n };\n\n const handler = (event: MouseEvent) => {\n console.log(\"[react-code-locator] click\", {\n triggerKey,\n shiftKey: event.shiftKey,\n altKey: event.altKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n target: event.target,\n });\n\n if (!isTriggerPressed(event, triggerKey)) {\n return;\n }\n\n const result = locateComponentSource(event.target, currentMode);\n if (!result) {\n onError(new Error(\"No React component source metadata found for clicked element.\"));\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n onLocate(result);\n };\n\n document.addEventListener(\"click\", handler, true);\n document.addEventListener(\"keydown\", keyHandler, true);\n\n return () => {\n document.removeEventListener(\"click\", handler, true);\n document.removeEventListener(\"keydown\", keyHandler, true);\n overlay?.remove();\n };\n}\n","import { enableReactComponentJump } from \"./runtime\";\n\nif (typeof document !== \"undefined\") {\n enableReactCom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