react-reinspect 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -338
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.js +2 -2
- package/dist/lib/internal/auto-wrap.cjs +1 -1
- package/dist/lib/internal/auto-wrap.js +1 -1
- package/dist/lib/propsInspector.d.ts +1 -0
- package/dist/lib/propsInspector.d.ts.map +1 -1
- package/dist/lib/react/wrap.d.ts.map +1 -1
- package/dist/lib/style.css +1 -1
- package/dist/lib/{wrap-DkOzTshV.js → wrap-DQM25n-h.js} +430 -415
- package/dist/lib/wrap-TqMeJ7Q-.cjs +2 -0
- package/docs/assets/reinpect-showcase-talenside.webm +0 -0
- package/docs/assets/reinspect-showcase-demo-app.webm +0 -0
- package/package.json +1 -1
- package/dist/lib/wrap-Cc3mMcCA.cjs +0 -2
- package/docs/assets/screenshot-example.png +0 -0
|
@@ -81,15 +81,15 @@ var T = [
|
|
|
81
81
|
"width",
|
|
82
82
|
"height",
|
|
83
83
|
"gap"
|
|
84
|
-
]), O = 2147483e3, k = "reinspect.inspectMode",
|
|
84
|
+
]), O = 2147483e3, k = "reinspect.inspectMode", A = "reinspect.inspectWhitelist", j = "reinspect.inspectBlacklist", M = "reinspect.propsSerializationMode", N = "reinspect.menuTheme", ie = "reinspect.menuOpenGesture", P = {
|
|
85
85
|
ctrl: !1,
|
|
86
86
|
alt: !1,
|
|
87
87
|
shift: !0,
|
|
88
88
|
meta: !1
|
|
89
|
-
},
|
|
89
|
+
}, ae = {
|
|
90
90
|
mode: "right-click",
|
|
91
|
-
modifiers:
|
|
92
|
-
},
|
|
91
|
+
modifiers: P
|
|
92
|
+
}, oe = [
|
|
93
93
|
"wrapped",
|
|
94
94
|
"first-party",
|
|
95
95
|
"all"
|
|
@@ -98,44 +98,44 @@ var T = [
|
|
|
98
98
|
"attempts",
|
|
99
99
|
"commits",
|
|
100
100
|
"both"
|
|
101
|
-
],
|
|
102
|
-
function
|
|
101
|
+
], ce = ["distilled", "complete"], le = ["light", "dark"], ue = ["right-click", "modifier-right-click"], de = !1;
|
|
102
|
+
function F(e) {
|
|
103
103
|
return typeof e == "object" && !!e;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
105
|
+
function I() {
|
|
106
|
+
de || typeof console > "u" || (de = !0, console.warn("[react-reinspect] `shouldCountRenders` and `renderCaptureMode` are deprecated. Use `renderCounters` instead."));
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
return typeof e == "string" &&
|
|
108
|
+
function L(e) {
|
|
109
|
+
return typeof e == "string" && oe.includes(e);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function fe(e) {
|
|
112
112
|
return typeof e == "string" && se.includes(e);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return typeof e == "string" && F.includes(e);
|
|
116
|
-
}
|
|
117
|
-
function fe(e) {
|
|
114
|
+
function R(e) {
|
|
118
115
|
return typeof e == "string" && ce.includes(e);
|
|
119
116
|
}
|
|
120
|
-
function
|
|
117
|
+
function pe(e) {
|
|
121
118
|
return typeof e == "string" && le.includes(e);
|
|
122
119
|
}
|
|
123
|
-
function
|
|
120
|
+
function z(e) {
|
|
121
|
+
return typeof e == "string" && ue.includes(e);
|
|
122
|
+
}
|
|
123
|
+
function B(e) {
|
|
124
124
|
let t = {
|
|
125
125
|
ctrl: e?.ctrl === !0,
|
|
126
126
|
alt: e?.alt === !0,
|
|
127
127
|
shift: e?.shift === !0,
|
|
128
128
|
meta: e?.meta === !0
|
|
129
129
|
};
|
|
130
|
-
return t.ctrl || t.alt || t.shift || t.meta ? t : { ...
|
|
130
|
+
return t.ctrl || t.alt || t.shift || t.meta ? t : { ...P };
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function V(e) {
|
|
133
133
|
return {
|
|
134
|
-
mode:
|
|
135
|
-
modifiers:
|
|
134
|
+
mode: z(e?.mode) ? e.mode : ae.mode,
|
|
135
|
+
modifiers: B(e?.modifiers)
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function H(e) {
|
|
139
139
|
let t = [];
|
|
140
140
|
if (Array.isArray(e?.patterns)) for (let n of e.patterns) {
|
|
141
141
|
if (typeof n != "string") continue;
|
|
@@ -149,114 +149,114 @@ function U(e) {
|
|
|
149
149
|
matchCase: e?.matchCase === !0
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function me() {
|
|
153
153
|
if (!(typeof window > "u")) try {
|
|
154
154
|
let e = window.sessionStorage.getItem(k);
|
|
155
|
-
return
|
|
155
|
+
return L(e) ? e : void 0;
|
|
156
156
|
} catch {
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
return
|
|
160
|
+
function U(e) {
|
|
161
|
+
return me() || (L(e) ? e : "wrapped");
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function he(e) {
|
|
164
164
|
if (!(typeof window > "u")) try {
|
|
165
165
|
window.sessionStorage.setItem(k, e);
|
|
166
166
|
} catch {}
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function W(e) {
|
|
169
169
|
if (!(typeof window > "u")) try {
|
|
170
170
|
let t = window.sessionStorage.getItem(e);
|
|
171
171
|
if (!t) return;
|
|
172
172
|
let n = JSON.parse(t);
|
|
173
|
-
return
|
|
173
|
+
return F(n) ? H(n) : void 0;
|
|
174
174
|
} catch {
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
return
|
|
180
|
-
}
|
|
181
|
-
function ge(e) {
|
|
182
|
-
return he(e, ie);
|
|
178
|
+
function ge(e, t) {
|
|
179
|
+
return W(t) || H(e);
|
|
183
180
|
}
|
|
184
181
|
function _e(e) {
|
|
185
|
-
return
|
|
182
|
+
return ge(e, A);
|
|
186
183
|
}
|
|
187
|
-
function ve(e
|
|
184
|
+
function ve(e) {
|
|
185
|
+
return ge(e, j);
|
|
186
|
+
}
|
|
187
|
+
function ye(e, t) {
|
|
188
188
|
if (!(typeof window > "u")) try {
|
|
189
|
-
let n =
|
|
189
|
+
let n = H(t);
|
|
190
190
|
window.sessionStorage.setItem(e, JSON.stringify(n));
|
|
191
191
|
} catch {}
|
|
192
192
|
}
|
|
193
|
-
function ye(e) {
|
|
194
|
-
ve(ie, e);
|
|
195
|
-
}
|
|
196
193
|
function be(e) {
|
|
197
|
-
|
|
194
|
+
ye(A, e);
|
|
195
|
+
}
|
|
196
|
+
function xe(e) {
|
|
197
|
+
ye(j, e);
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function G() {
|
|
200
200
|
if (!(typeof window > "u")) try {
|
|
201
|
-
let e = window.sessionStorage.getItem(
|
|
202
|
-
return
|
|
201
|
+
let e = window.sessionStorage.getItem(M);
|
|
202
|
+
return R(e) ? e : void 0;
|
|
203
203
|
} catch {
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
return
|
|
207
|
+
function Se(e) {
|
|
208
|
+
return G() || (R(e) ? e : "distilled");
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function K(e) {
|
|
211
211
|
if (!(typeof window > "u")) try {
|
|
212
|
-
window.sessionStorage.setItem(
|
|
212
|
+
window.sessionStorage.setItem(M, e);
|
|
213
213
|
} catch {}
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function Ce() {
|
|
216
216
|
if (!(typeof window > "u")) try {
|
|
217
|
-
let e = window.sessionStorage.getItem(
|
|
218
|
-
return
|
|
217
|
+
let e = window.sessionStorage.getItem(N);
|
|
218
|
+
return pe(e) ? e : void 0;
|
|
219
219
|
} catch {
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
function Ce(e) {
|
|
224
|
-
return Se() || (fe(e) ? e : "light");
|
|
225
|
-
}
|
|
226
223
|
function we(e) {
|
|
224
|
+
return Ce() || (pe(e) ? e : "light");
|
|
225
|
+
}
|
|
226
|
+
function Te(e) {
|
|
227
227
|
if (!(typeof window > "u")) try {
|
|
228
|
-
window.sessionStorage.setItem(
|
|
228
|
+
window.sessionStorage.setItem(N, e);
|
|
229
229
|
} catch {}
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function Ee() {
|
|
232
232
|
if (!(typeof window > "u")) try {
|
|
233
|
-
let e = window.sessionStorage.getItem(
|
|
233
|
+
let e = window.sessionStorage.getItem(ie);
|
|
234
234
|
if (!e) return;
|
|
235
235
|
let t = JSON.parse(e);
|
|
236
|
-
return
|
|
236
|
+
return F(t) ? V(t) : void 0;
|
|
237
237
|
} catch {
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function Ee(e) {
|
|
242
|
-
return Te() || H(e);
|
|
243
|
-
}
|
|
244
241
|
function De(e) {
|
|
242
|
+
return Ee() || V(e);
|
|
243
|
+
}
|
|
244
|
+
function Oe(e) {
|
|
245
245
|
if (!(typeof window > "u")) try {
|
|
246
|
-
let t =
|
|
247
|
-
window.sessionStorage.setItem(
|
|
246
|
+
let t = V(e);
|
|
247
|
+
window.sessionStorage.setItem(ie, JSON.stringify(t));
|
|
248
248
|
} catch {}
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
250
|
+
function q(e) {
|
|
251
|
+
return fe(e.renderCounters) ? e.renderCounters : ((e.shouldCountRenders !== void 0 || e.renderCaptureMode !== void 0) && I(), e.shouldCountRenders === !1 ? "off" : e.shouldCountRenders === !0 ? e.renderCaptureMode ?? "attempts" : e.renderCaptureMode ? e.renderCaptureMode : "off");
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function ke(e) {
|
|
254
254
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
let t =
|
|
256
|
+
function Ae(e) {
|
|
257
|
+
let t = H(e), n = [], r = [], i = t.matchCase ? "" : "i";
|
|
258
258
|
for (let e of t.patterns) {
|
|
259
|
-
let a = t.regex ? e :
|
|
259
|
+
let a = t.regex ? e : ke(e), o = t.wholeWord ? `\\b(?:${a})\\b` : a;
|
|
260
260
|
try {
|
|
261
261
|
n.push(new RegExp(o, i));
|
|
262
262
|
} catch {
|
|
@@ -269,28 +269,28 @@ function ke(e) {
|
|
|
269
269
|
matches: (e) => n.some((t) => t.test(e))
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function je(e, t, n) {
|
|
273
273
|
return !(!(!t.hasPatterns || t.matches(e)) || n.hasPatterns && n.matches(e));
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function J(e = {}) {
|
|
276
276
|
let t = e.enabled ?? !1, n = e.editableProps && e.editableProps.length > 0 ? e.editableProps : T;
|
|
277
277
|
return {
|
|
278
278
|
enabled: t,
|
|
279
279
|
startActive: e.startActive ?? !0,
|
|
280
280
|
showFloatingToggle: e.showFloatingToggle ?? t,
|
|
281
|
-
inspectMode:
|
|
282
|
-
inspectWhitelist:
|
|
283
|
-
inspectBlacklist:
|
|
281
|
+
inspectMode: U(e.inspectMode),
|
|
282
|
+
inspectWhitelist: _e(e.inspectWhitelist),
|
|
283
|
+
inspectBlacklist: ve(e.inspectBlacklist),
|
|
284
284
|
editableProps: n,
|
|
285
285
|
zIndexBase: e.zIndexBase ?? O,
|
|
286
|
-
renderCounters:
|
|
286
|
+
renderCounters: q(e),
|
|
287
287
|
countRendersForComponents: e.countRendersForComponents ?? [],
|
|
288
|
-
propsSerializationMode:
|
|
289
|
-
menuTheme:
|
|
290
|
-
menuOpenGesture:
|
|
288
|
+
propsSerializationMode: Se(e.propsSerializationMode),
|
|
289
|
+
menuTheme: we(e.menuTheme),
|
|
290
|
+
menuOpenGesture: De(e.menuOpenGesture)
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function Me(e, t) {
|
|
294
294
|
if (!e) return {};
|
|
295
295
|
let n = {};
|
|
296
296
|
for (let r of t) {
|
|
@@ -299,7 +299,7 @@ function je(e, t) {
|
|
|
299
299
|
}
|
|
300
300
|
return n;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function Y(e) {
|
|
303
303
|
let t = e.trim();
|
|
304
304
|
if (t.length === 0) return;
|
|
305
305
|
if (t.endsWith("%")) {
|
|
@@ -312,7 +312,7 @@ function Me(e) {
|
|
|
312
312
|
function Ne(e) {
|
|
313
313
|
return e.toString(16).padStart(2, "0");
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function Pe(e) {
|
|
316
316
|
if (!e) return;
|
|
317
317
|
let t = e.trim();
|
|
318
318
|
if (/^#[0-9a-fA-F]{6}$/.test(t)) return t.toLowerCase();
|
|
@@ -322,73 +322,73 @@ function X(e) {
|
|
|
322
322
|
}
|
|
323
323
|
let n = t.match(/^rgba?\((.+)\)$/i);
|
|
324
324
|
if (n) {
|
|
325
|
-
let e = (n[1] ?? "").replace(/\//g, " ").split(/[,\s]+/).filter((e) => e.length > 0), t =
|
|
325
|
+
let e = (n[1] ?? "").replace(/\//g, " ").split(/[,\s]+/).filter((e) => e.length > 0), t = Y(e[0] ?? ""), r = Y(e[1] ?? ""), i = Y(e[2] ?? "");
|
|
326
326
|
if (t !== void 0 && r !== void 0 && i !== void 0) return `#${Ne(t)}${Ne(r)}${Ne(i)}`;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Fe(e) {
|
|
330
330
|
if (typeof document > "u" || typeof window > "u") return;
|
|
331
331
|
let t = document.createElement("span");
|
|
332
332
|
if (t.style.position = "fixed", t.style.left = "-9999px", t.style.top = "-9999px", t.style.color = "", t.style.color = e, t.style.color) {
|
|
333
333
|
document.body.appendChild(t);
|
|
334
334
|
try {
|
|
335
335
|
let e = window.getComputedStyle(t).color;
|
|
336
|
-
return
|
|
336
|
+
return Pe(e);
|
|
337
337
|
} finally {
|
|
338
338
|
t.remove();
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
let t =
|
|
342
|
+
function Ie(e) {
|
|
343
|
+
let t = Pe(e);
|
|
344
344
|
if (t) return t;
|
|
345
345
|
if (e) {
|
|
346
|
-
let t =
|
|
346
|
+
let t = Fe(e);
|
|
347
347
|
if (t) return t;
|
|
348
348
|
}
|
|
349
|
-
return
|
|
349
|
+
return Fe("var(--reinspect-menu-text)") || Fe("CanvasText") || E;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Le(e) {
|
|
352
352
|
let t = Number(e);
|
|
353
353
|
if (Number.isFinite(t)) return t;
|
|
354
354
|
}
|
|
355
355
|
//#endregion
|
|
356
356
|
//#region src/reinspect/propsInspector.ts
|
|
357
|
-
var
|
|
357
|
+
var Re = 4, ze = 40, Be = 40, Ve = "__reinspect_placeholder__", He = "__reinspect__displayName__", X = "display", Z = Symbol("reinspect.omitSerialization"), Ue = new Set([
|
|
358
358
|
"$$typeof",
|
|
359
359
|
"_owner",
|
|
360
360
|
"_store",
|
|
361
361
|
"_self",
|
|
362
362
|
"_source"
|
|
363
363
|
]);
|
|
364
|
-
function
|
|
365
|
-
return { [
|
|
364
|
+
function We(e, t) {
|
|
365
|
+
return { [He]: t };
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function Ge(e) {
|
|
368
368
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
if (!
|
|
370
|
+
function Ke(e) {
|
|
371
|
+
if (!Ge(e)) return !1;
|
|
372
372
|
let t = Object.getPrototypeOf(e);
|
|
373
373
|
return t === Object.prototype || t === null;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
if (!
|
|
377
|
-
let t = e[
|
|
375
|
+
function qe(e) {
|
|
376
|
+
if (!Ge(e)) return !1;
|
|
377
|
+
let t = e[Ve];
|
|
378
378
|
if (t !== void 0 && typeof t != "string") return !1;
|
|
379
|
-
let n = e[
|
|
379
|
+
let n = e[He];
|
|
380
380
|
if (n !== void 0 && typeof n != "string") return !1;
|
|
381
|
-
let r = e[
|
|
381
|
+
let r = e[X];
|
|
382
382
|
return r !== void 0 && typeof r != "string" ? !1 : typeof t == "string" || typeof n == "string";
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function Je(e) {
|
|
385
385
|
try {
|
|
386
386
|
return JSON.stringify(e, null, 2);
|
|
387
387
|
} catch {
|
|
388
388
|
return null;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function Ye(e) {
|
|
392
392
|
try {
|
|
393
393
|
let t = Function.prototype.toString.call(e);
|
|
394
394
|
return typeof t != "string" || t.trim().length === 0 ? "[Function source unavailable]" : t;
|
|
@@ -396,23 +396,23 @@ function Je(e) {
|
|
|
396
396
|
return "[Function source unavailable]";
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function Xe(e) {
|
|
400
400
|
let t = e.replace(/\s+/g, " ").trim();
|
|
401
401
|
return t.length <= 120 ? t : `${t.slice(0, 117)}...`;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Ze(e) {
|
|
404
404
|
return e?.mode === "complete" ? "complete" : "distilled";
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Qe(e) {
|
|
407
407
|
return "$$typeof" in e && "props" in e;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function $e(e, t) {
|
|
410
410
|
let n = Object.entries(e);
|
|
411
|
-
return t !== "distilled" || !
|
|
411
|
+
return t !== "distilled" || !Qe(e) ? n : n.filter(([e]) => !Ue.has(e));
|
|
412
412
|
}
|
|
413
|
-
function
|
|
414
|
-
let i = (e, t) => r === "complete" ?
|
|
415
|
-
if (n >
|
|
413
|
+
function et(e, t, n, r) {
|
|
414
|
+
let i = (e, t) => r === "complete" ? We(e, t) : Z;
|
|
415
|
+
if (n > Re) return i("truncated", "[Max depth reached]");
|
|
416
416
|
if (e === null) return null;
|
|
417
417
|
let a = typeof e;
|
|
418
418
|
if (a === "string" || a === "boolean") return e;
|
|
@@ -427,33 +427,33 @@ function $e(e, t, n, r) {
|
|
|
427
427
|
let a = e;
|
|
428
428
|
if (t.has(a)) return i("circular", "[Circular]");
|
|
429
429
|
if (t.add(a), Array.isArray(e)) {
|
|
430
|
-
let o = [], s = Math.min(e.length,
|
|
430
|
+
let o = [], s = Math.min(e.length, Be);
|
|
431
431
|
for (let i = 0; i < s; i += 1) {
|
|
432
|
-
let a =
|
|
433
|
-
a !==
|
|
432
|
+
let a = et(e[i], t, n + 1, r);
|
|
433
|
+
a !== Z && o.push(a);
|
|
434
434
|
}
|
|
435
|
-
if (e.length >
|
|
436
|
-
let t = i("truncated", `${e.length -
|
|
437
|
-
t !==
|
|
435
|
+
if (e.length > Be) {
|
|
436
|
+
let t = i("truncated", `${e.length - Be} more items`);
|
|
437
|
+
t !== Z && o.push(t);
|
|
438
438
|
}
|
|
439
439
|
return t.delete(a), o;
|
|
440
440
|
}
|
|
441
|
-
let o = {}, s =
|
|
441
|
+
let o = {}, s = $e(e, r), c = Math.min(s.length, ze);
|
|
442
442
|
for (let e = 0; e < c; e += 1) {
|
|
443
443
|
let i = s[e];
|
|
444
444
|
if (!i) continue;
|
|
445
|
-
let [a, c] = i, l =
|
|
446
|
-
l !==
|
|
445
|
+
let [a, c] = i, l = et(c, t, n + 1, r);
|
|
446
|
+
l !== Z && (o[a] = l);
|
|
447
447
|
}
|
|
448
|
-
if (s.length >
|
|
449
|
-
let e = i("truncated", `${s.length -
|
|
450
|
-
e !==
|
|
448
|
+
if (s.length > ze) {
|
|
449
|
+
let e = i("truncated", `${s.length - ze} more keys`);
|
|
450
|
+
e !== Z && (o.__reinspect_truncated__ = e);
|
|
451
451
|
}
|
|
452
452
|
return t.delete(a), o;
|
|
453
453
|
}
|
|
454
454
|
return i("unsupported", "[Unsupported value]");
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function tt(e) {
|
|
457
457
|
if (e === null) return {
|
|
458
458
|
kind: "null",
|
|
459
459
|
summary: "null",
|
|
@@ -494,7 +494,7 @@ function et(e) {
|
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
if (t === "function") {
|
|
497
|
-
let t = e, n =
|
|
497
|
+
let t = e, n = Ye(t), r = t.name || "anonymous";
|
|
498
498
|
return {
|
|
499
499
|
kind: "function",
|
|
500
500
|
summary: `Function ${r}(${t.length})`,
|
|
@@ -502,7 +502,7 @@ function et(e) {
|
|
|
502
502
|
functionMeta: {
|
|
503
503
|
name: r,
|
|
504
504
|
arity: t.length,
|
|
505
|
-
preview:
|
|
505
|
+
preview: Xe(n),
|
|
506
506
|
source: n
|
|
507
507
|
}
|
|
508
508
|
};
|
|
@@ -526,7 +526,7 @@ function et(e) {
|
|
|
526
526
|
return Array.isArray(e) ? {
|
|
527
527
|
kind: "array",
|
|
528
528
|
summary: `Array(${e.length})`
|
|
529
|
-
} :
|
|
529
|
+
} : Ge(e) ? {
|
|
530
530
|
kind: "object",
|
|
531
531
|
summary: `Object(${Object.keys(e).length})`
|
|
532
532
|
} : {
|
|
@@ -534,21 +534,21 @@ function et(e) {
|
|
|
534
534
|
summary: String(e)
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
|
-
function
|
|
538
|
-
if (!
|
|
537
|
+
function nt(e) {
|
|
538
|
+
if (!qe(e)) {
|
|
539
539
|
if (Array.isArray(e)) {
|
|
540
540
|
let t = [];
|
|
541
541
|
for (let n of e) {
|
|
542
|
-
let e =
|
|
542
|
+
let e = nt(n);
|
|
543
543
|
if (e === void 0) return;
|
|
544
544
|
t.push(e);
|
|
545
545
|
}
|
|
546
546
|
return t;
|
|
547
547
|
}
|
|
548
|
-
if (
|
|
548
|
+
if (Ge(e)) {
|
|
549
549
|
let t = {};
|
|
550
550
|
for (let [n, r] of Object.entries(e)) {
|
|
551
|
-
let e =
|
|
551
|
+
let e = nt(r);
|
|
552
552
|
e !== void 0 && (t[n] = e);
|
|
553
553
|
}
|
|
554
554
|
return t;
|
|
@@ -556,34 +556,39 @@ function tt(e) {
|
|
|
556
556
|
return e;
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function rt(e) {
|
|
560
560
|
return Object.keys(e).map((t) => ({
|
|
561
561
|
key: t,
|
|
562
|
-
value:
|
|
562
|
+
value: tt(e[t])
|
|
563
563
|
}));
|
|
564
564
|
}
|
|
565
|
-
function rt(e, t) {
|
|
566
|
-
let n = $e(e, /* @__PURE__ */ new WeakSet(), 0, Xe(t));
|
|
567
|
-
return n === Q ? "{}" : qe(n) ?? "{}";
|
|
568
|
-
}
|
|
569
565
|
function it(e, t) {
|
|
570
|
-
let n =
|
|
571
|
-
return n ===
|
|
566
|
+
let n = et(e, /* @__PURE__ */ new WeakSet(), 0, Ze(t));
|
|
567
|
+
return n === Z ? "{}" : Je(n) ?? "{}";
|
|
572
568
|
}
|
|
573
|
-
function at(e) {
|
|
569
|
+
function at(e, t) {
|
|
570
|
+
let n = et(e, /* @__PURE__ */ new WeakSet(), 0, Ze(t));
|
|
571
|
+
return n === Z ? null : Je(n);
|
|
572
|
+
}
|
|
573
|
+
function ot(e) {
|
|
574
574
|
if (e === null) return !0;
|
|
575
575
|
let t = typeof e;
|
|
576
|
-
return t === "string" || t === "number" || t === "boolean" || Array.isArray(e) ? !0 :
|
|
576
|
+
return t === "string" || t === "number" || t === "boolean" || Array.isArray(e) ? !0 : Ke(e);
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function st(e) {
|
|
579
|
+
if (e === null) return !0;
|
|
580
|
+
let t = typeof e;
|
|
581
|
+
return t === "string" || t === "number" || t === "boolean" ? !0 : Array.isArray(e) ? e.every((e) => st(e)) : !1;
|
|
582
|
+
}
|
|
583
|
+
function ct(e) {
|
|
579
584
|
let t = e.trim();
|
|
580
585
|
if (t.length === 0) return {
|
|
581
586
|
parsed: null,
|
|
582
587
|
error: "Value JSON cannot be empty."
|
|
583
588
|
};
|
|
584
589
|
try {
|
|
585
|
-
let e =
|
|
586
|
-
return e === void 0 || !
|
|
590
|
+
let e = nt(JSON.parse(t));
|
|
591
|
+
return e === void 0 || !ot(e) ? {
|
|
587
592
|
parsed: null,
|
|
588
593
|
error: "Only objects, arrays, and primitive JSON values are editable."
|
|
589
594
|
} : {
|
|
@@ -597,7 +602,7 @@ function ot(e) {
|
|
|
597
602
|
};
|
|
598
603
|
}
|
|
599
604
|
}
|
|
600
|
-
function
|
|
605
|
+
function lt(e) {
|
|
601
606
|
let t = e.trim();
|
|
602
607
|
if (t.length === 0) return {
|
|
603
608
|
parsed: {},
|
|
@@ -611,7 +616,7 @@ function st(e) {
|
|
|
611
616
|
};
|
|
612
617
|
let n = {};
|
|
613
618
|
for (let [t, r] of Object.entries(e)) {
|
|
614
|
-
let e =
|
|
619
|
+
let e = nt(r);
|
|
615
620
|
e !== void 0 && (n[t] = e);
|
|
616
621
|
}
|
|
617
622
|
return {
|
|
@@ -627,61 +632,61 @@ function st(e) {
|
|
|
627
632
|
}
|
|
628
633
|
//#endregion
|
|
629
634
|
//#region src/reinspect/wrapMarker.ts
|
|
630
|
-
var
|
|
631
|
-
function
|
|
632
|
-
return e[
|
|
635
|
+
var ut = Symbol.for("reinspect.wrapped");
|
|
636
|
+
function dt(e) {
|
|
637
|
+
return e[ut];
|
|
633
638
|
}
|
|
634
|
-
function
|
|
635
|
-
e[
|
|
639
|
+
function ft(e, t) {
|
|
640
|
+
e[ut] = t;
|
|
636
641
|
}
|
|
637
642
|
//#endregion
|
|
638
643
|
//#region src/reinspect/core/renderCounter.ts
|
|
639
|
-
var
|
|
644
|
+
var pt = {
|
|
640
645
|
attempts: 0,
|
|
641
646
|
commits: 0
|
|
642
|
-
},
|
|
643
|
-
function
|
|
644
|
-
let t =
|
|
647
|
+
}, Q = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map();
|
|
648
|
+
function mt(e) {
|
|
649
|
+
let t = Q.get(e);
|
|
645
650
|
if (t) return t;
|
|
646
651
|
let n = {
|
|
647
652
|
attempts: 0,
|
|
648
653
|
commits: 0
|
|
649
654
|
};
|
|
650
|
-
return
|
|
655
|
+
return Q.set(e, n), n;
|
|
651
656
|
}
|
|
652
|
-
function
|
|
657
|
+
function ht(e) {
|
|
653
658
|
let t = $.get(e);
|
|
654
659
|
if (t) for (let e of t) e();
|
|
655
660
|
}
|
|
656
|
-
function
|
|
657
|
-
let t =
|
|
658
|
-
|
|
661
|
+
function gt(e) {
|
|
662
|
+
let t = mt(e);
|
|
663
|
+
Q.set(e, {
|
|
659
664
|
attempts: t.attempts + 1,
|
|
660
665
|
commits: t.commits + 1
|
|
661
|
-
}),
|
|
662
|
-
}
|
|
663
|
-
function gt(e) {
|
|
664
|
-
return ft.get(e) || dt;
|
|
666
|
+
}), ht(e);
|
|
665
667
|
}
|
|
666
668
|
function _t(e) {
|
|
667
|
-
|
|
669
|
+
return Q.get(e) || pt;
|
|
670
|
+
}
|
|
671
|
+
function vt(e) {
|
|
672
|
+
Q.delete(e), ht(e);
|
|
668
673
|
}
|
|
669
|
-
function
|
|
674
|
+
function yt(e, t) {
|
|
670
675
|
let n = $.get(e);
|
|
671
676
|
return n ? n.add(t) : $.set(e, new Set([t])), () => {
|
|
672
677
|
let n = $.get(e);
|
|
673
678
|
n && (n.delete(t), n.size === 0 && $.delete(e));
|
|
674
679
|
};
|
|
675
680
|
}
|
|
676
|
-
function
|
|
677
|
-
return c(n((t) =>
|
|
681
|
+
function bt(e) {
|
|
682
|
+
return c(n((t) => yt(e, t), [e]), n(() => _t(e), [e]), () => pt);
|
|
678
683
|
}
|
|
679
|
-
function
|
|
684
|
+
function xt(e, t) {
|
|
680
685
|
return t === "commits" ? `${e.commits} commits` : t === "both" ? `${e.attempts} attempts | ${e.commits} commits` : `${e.attempts} attempts`;
|
|
681
686
|
}
|
|
682
687
|
//#endregion
|
|
683
688
|
//#region node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-javascript.js
|
|
684
|
-
var
|
|
689
|
+
var St = /* @__PURE__ */ y((/* @__PURE__ */ ee(((e, t) => {
|
|
685
690
|
var n = function(e) {
|
|
686
691
|
var t = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, n = 0, r = {}, i = {
|
|
687
692
|
manual: e.Prism && e.Prism.manual,
|
|
@@ -912,17 +917,17 @@ var xt = /* @__PURE__ */ y((/* @__PURE__ */ ee(((e, t) => {
|
|
|
912
917
|
for (var D = b; D !== t.tail && (E < T || typeof D.value == "string"); D = D.next) C++, E += D.value.length;
|
|
913
918
|
C--, S = e.slice(x, E), w.index -= x;
|
|
914
919
|
} else if (w = o(y, 0, S, _), !w) continue;
|
|
915
|
-
var ne = w.index, re = w[0], O = S.slice(0, ne), k = S.slice(ne + re.length),
|
|
916
|
-
d &&
|
|
917
|
-
var
|
|
918
|
-
O && (
|
|
919
|
-
var
|
|
920
|
-
if (b = l(t,
|
|
921
|
-
var
|
|
920
|
+
var ne = w.index, re = w[0], O = S.slice(0, ne), k = S.slice(ne + re.length), A = x + S.length;
|
|
921
|
+
d && A > d.reach && (d.reach = A);
|
|
922
|
+
var j = b.prev;
|
|
923
|
+
O && (j = l(t, j, O), x += O.length), u(t, j, C);
|
|
924
|
+
var M = new a(f, g ? i.tokenize(re, g) : re, ee, re);
|
|
925
|
+
if (b = l(t, j, M), k && l(t, b, k), C > 1) {
|
|
926
|
+
var N = {
|
|
922
927
|
cause: f + "," + m,
|
|
923
|
-
reach:
|
|
928
|
+
reach: A
|
|
924
929
|
};
|
|
925
|
-
s(e, t, n, b.prev, x,
|
|
930
|
+
s(e, t, n, b.prev, x, N), d && N.reach > d.reach && (d.reach = N.reach);
|
|
926
931
|
}
|
|
927
932
|
}
|
|
928
933
|
}
|
|
@@ -1452,31 +1457,31 @@ Prism.languages.javascript = Prism.languages.extend("clike", {
|
|
|
1452
1457
|
}, Prism.languages.webmanifest = Prism.languages.json;
|
|
1453
1458
|
//#endregion
|
|
1454
1459
|
//#region src/reinspect/syntaxHighlight.ts
|
|
1455
|
-
function
|
|
1460
|
+
function Ct(e) {
|
|
1456
1461
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
1457
1462
|
}
|
|
1458
|
-
function
|
|
1459
|
-
return
|
|
1463
|
+
function wt(e) {
|
|
1464
|
+
return St.languages[e] ?? null;
|
|
1460
1465
|
}
|
|
1461
|
-
function
|
|
1462
|
-
let n =
|
|
1463
|
-
if (!n) return
|
|
1466
|
+
function Tt(e, t) {
|
|
1467
|
+
let n = wt(t);
|
|
1468
|
+
if (!n) return Ct(e);
|
|
1464
1469
|
try {
|
|
1465
|
-
return
|
|
1470
|
+
return St.highlight(e, n, t);
|
|
1466
1471
|
} catch {
|
|
1467
|
-
return
|
|
1472
|
+
return Ct(e);
|
|
1468
1473
|
}
|
|
1469
1474
|
}
|
|
1470
1475
|
//#endregion
|
|
1471
1476
|
//#region src/reinspect/react/overlay.tsx
|
|
1472
|
-
function
|
|
1477
|
+
function Et({ value: e }) {
|
|
1473
1478
|
if (e.kind === "function" && e.functionMeta) {
|
|
1474
1479
|
let t = e.functionMeta;
|
|
1475
1480
|
return /* @__PURE__ */ d("div", {
|
|
1476
1481
|
className: "reinspect-prop-function",
|
|
1477
1482
|
children: [/* @__PURE__ */ u("code", { children: e.summary }), /* @__PURE__ */ u("pre", { children: /* @__PURE__ */ u("code", {
|
|
1478
1483
|
className: "language-javascript reinspect-code-block",
|
|
1479
|
-
dangerouslySetInnerHTML: { __html:
|
|
1484
|
+
dangerouslySetInnerHTML: { __html: Tt(t.preview, "javascript") }
|
|
1480
1485
|
}) })]
|
|
1481
1486
|
});
|
|
1482
1487
|
}
|
|
@@ -1485,12 +1490,12 @@ function Tt({ value: e }) {
|
|
|
1485
1490
|
children: /* @__PURE__ */ u("code", { children: e.summary })
|
|
1486
1491
|
});
|
|
1487
1492
|
}
|
|
1488
|
-
function
|
|
1489
|
-
return /* @__PURE__ */ u(l, { children: bt(
|
|
1493
|
+
function Dt({ instanceId: e, counterMode: t }) {
|
|
1494
|
+
return /* @__PURE__ */ u(l, { children: xt(bt(e), t) });
|
|
1490
1495
|
}
|
|
1491
1496
|
//#endregion
|
|
1492
1497
|
//#region src/reinspect/react/wrap.tsx
|
|
1493
|
-
var
|
|
1498
|
+
var Ot = {
|
|
1494
1499
|
enabled: !1,
|
|
1495
1500
|
startActive: !1,
|
|
1496
1501
|
showFloatingToggle: !1,
|
|
@@ -1522,27 +1527,27 @@ var Dt = {
|
|
|
1522
1527
|
meta: !1
|
|
1523
1528
|
}
|
|
1524
1529
|
}
|
|
1525
|
-
},
|
|
1526
|
-
function
|
|
1527
|
-
return
|
|
1530
|
+
}, kt = 0, At = 12, jt = 560, Mt = 620, Nt = "children can only be null, primitive values, or arrays of primitive values.";
|
|
1531
|
+
function Pt(e) {
|
|
1532
|
+
return kt += 1, `${e}-${kt.toString(36)}`;
|
|
1528
1533
|
}
|
|
1529
|
-
function
|
|
1534
|
+
function Ft(e) {
|
|
1530
1535
|
let t = e.replace(/([A-Z])/g, " $1").trim(), n = t.slice(0, 1);
|
|
1531
1536
|
return t.length > 0 ? n.toUpperCase() + t.slice(1) : e;
|
|
1532
1537
|
}
|
|
1533
|
-
function
|
|
1538
|
+
function It(e) {
|
|
1534
1539
|
return e.trim().toLowerCase().replace(/[\s_-]+/g, "");
|
|
1535
1540
|
}
|
|
1536
|
-
function
|
|
1541
|
+
function Lt(e) {
|
|
1537
1542
|
return e != null && e !== "";
|
|
1538
1543
|
}
|
|
1539
|
-
function
|
|
1544
|
+
function Rt(e) {
|
|
1540
1545
|
return e.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
1541
1546
|
}
|
|
1542
|
-
function
|
|
1547
|
+
function zt(e) {
|
|
1543
1548
|
return e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
1544
1549
|
}
|
|
1545
|
-
function
|
|
1550
|
+
function Bt(e) {
|
|
1546
1551
|
if (!e) return !0;
|
|
1547
1552
|
let t = e.trim().toLowerCase();
|
|
1548
1553
|
if (t === "transparent") return !0;
|
|
@@ -1555,26 +1560,31 @@ function Rt(e) {
|
|
|
1555
1560
|
let o = a.endsWith("%") ? Number(a.slice(0, -1)) / 100 : Number(a);
|
|
1556
1561
|
return Number.isFinite(o) && o <= 0;
|
|
1557
1562
|
}
|
|
1558
|
-
function
|
|
1563
|
+
function Vt(e, t, n) {
|
|
1559
1564
|
if (typeof window > "u") return e;
|
|
1560
|
-
let r =
|
|
1565
|
+
let r = At, i = At, a = Math.max(r, window.innerWidth - t - At), o = Math.max(i, window.innerHeight - n - At);
|
|
1561
1566
|
return {
|
|
1562
1567
|
x: Math.min(Math.max(e.x, r), a),
|
|
1563
1568
|
y: Math.min(Math.max(e.y, i), o)
|
|
1564
1569
|
};
|
|
1565
1570
|
}
|
|
1566
|
-
function
|
|
1571
|
+
function Ht(e, t) {
|
|
1567
1572
|
return e.includes(t) ? [...e] : [...e, t];
|
|
1568
1573
|
}
|
|
1569
|
-
function
|
|
1570
|
-
return e.includes(t) ? e.filter((e) => e !== t) :
|
|
1574
|
+
function Ut(e, t) {
|
|
1575
|
+
return e.includes(t) ? e.filter((e) => e !== t) : Ht(e, t);
|
|
1571
1576
|
}
|
|
1572
|
-
function
|
|
1577
|
+
function Wt(e, t) {
|
|
1573
1578
|
if (t.mode === "right-click") return !0;
|
|
1574
1579
|
let n = t.modifiers;
|
|
1575
1580
|
return !(n.ctrl && !e.ctrlKey || n.alt && !e.altKey || n.shift && !e.shiftKey || n.meta && !e.metaKey);
|
|
1576
1581
|
}
|
|
1577
|
-
function
|
|
1582
|
+
function Gt(e) {
|
|
1583
|
+
if (!Object.prototype.hasOwnProperty.call(e, "children") || st(e.children)) return e;
|
|
1584
|
+
let t = { ...e };
|
|
1585
|
+
return delete t.children, t;
|
|
1586
|
+
}
|
|
1587
|
+
function Kt() {
|
|
1578
1588
|
return /* @__PURE__ */ u("svg", {
|
|
1579
1589
|
viewBox: "0 0 16 16",
|
|
1580
1590
|
"aria-hidden": "true",
|
|
@@ -1585,7 +1595,7 @@ function Ut() {
|
|
|
1585
1595
|
})
|
|
1586
1596
|
});
|
|
1587
1597
|
}
|
|
1588
|
-
function
|
|
1598
|
+
function qt() {
|
|
1589
1599
|
return /* @__PURE__ */ u("svg", {
|
|
1590
1600
|
viewBox: "0 0 16 16",
|
|
1591
1601
|
"aria-hidden": "true",
|
|
@@ -1596,10 +1606,10 @@ function Wt() {
|
|
|
1596
1606
|
})
|
|
1597
1607
|
});
|
|
1598
1608
|
}
|
|
1599
|
-
function
|
|
1609
|
+
function Jt(e) {
|
|
1600
1610
|
return Array.isArray(e) || typeof e == "object" && !!e;
|
|
1601
1611
|
}
|
|
1602
|
-
async function
|
|
1612
|
+
async function Yt(e) {
|
|
1603
1613
|
if (typeof navigator > "u" || !navigator.clipboard?.writeText) return !1;
|
|
1604
1614
|
try {
|
|
1605
1615
|
return await navigator.clipboard.writeText(e), !0;
|
|
@@ -1607,40 +1617,40 @@ async function Kt(e) {
|
|
|
1607
1617
|
return !1;
|
|
1608
1618
|
}
|
|
1609
1619
|
}
|
|
1610
|
-
function
|
|
1620
|
+
function Xt(e, t) {
|
|
1611
1621
|
return t?.componentName?.trim() || e.displayName?.trim() || e.name?.trim() || t?.fallbackName?.trim() || "Component";
|
|
1612
1622
|
}
|
|
1613
|
-
function
|
|
1623
|
+
function Zt(e, t, n) {
|
|
1614
1624
|
return e === "manual" || n === "all" || n === "first-party" && t === "first-party";
|
|
1615
1625
|
}
|
|
1616
|
-
function
|
|
1617
|
-
let c = n?.source ?? "manual", p = n?.scope ?? "first-party", m =
|
|
1626
|
+
function Qt(t, n) {
|
|
1627
|
+
let c = n?.source ?? "manual", p = n?.scope ?? "first-party", m = dt(t);
|
|
1618
1628
|
if (m && c === "auto") return t;
|
|
1619
|
-
let h = m && c === "manual" ? m.original : t, g =
|
|
1629
|
+
let h = m && c === "manual" ? m.original : t, g = Xt(h, n);
|
|
1620
1630
|
function _(t) {
|
|
1621
|
-
let n = o(null), m = o(null), _ = o(null), v = o(null), ee = o(null), te = o(!1), [y, x] = s(null), [S, C] = s("css"), [T, E] = s("detected"), [O, k] = s(""), [
|
|
1622
|
-
n.current ||=
|
|
1623
|
-
let
|
|
1631
|
+
let n = o(null), m = o(null), _ = o(null), v = o(null), ee = o(null), te = o(!1), [y, x] = s(null), [S, C] = s("css"), [T, E] = s("detected"), [O, k] = s(""), [A, j] = s({}), [M, N] = s("{}"), [ie, P] = s(null), [ae, oe] = s(null), [se, ce] = s({}), [le, ue] = s({}), [de, F] = s({}), [I, L] = s(null), [fe, R] = s(""), [pe, z] = s(null), [B, V] = s(null), [H, me] = s({}), U = r(b), he = !!U, W = U?.config ?? Ot, ge = U?.getColor ?? (() => "var(--reinspect-brand-500)"), _e = U?.menuTheme ?? "light", ve = U?.menuOpenGesture ?? Ot.menuOpenGesture, ye = U?.isActive ?? !1, be = U?.inspectMode ?? "wrapped", xe = U?.renderCounterMode ?? Ot.renderCounters, G = U?.propsSerializationMode ?? Ot.propsSerializationMode, Se = U?.overrides ?? {}, K = U?.updateOverride ?? (() => void 0), Ce = U?.renderCountComponents ?? {}, we = U?.setRenderCountingForComponent ?? (() => void 0), Te = U?.setInspectWhitelist ?? (() => void 0), Ee = U?.inspectWhitelist ?? Ot.inspectWhitelist, De = U?.setInspectBlacklist ?? (() => void 0), Oe = U?.isRenderCountingEnabledFor ?? (() => !1);
|
|
1632
|
+
n.current ||= Pt(g);
|
|
1633
|
+
let q = n.current, ke = ge(g), Ae = Zt(c, p, be), je = U?.isComponentInspectableByFilters(g) ?? !0, J = W.enabled && ye && Ae && je, Y = J && Oe(g), Ne = !!Ce[g], Pe = xe !== "off", Fe = xe === "off" ? "attempts" : xe, Re = Y, ze = Se[q], Be = J ? Me(ze, W.editableProps) : {}, Ve = {
|
|
1624
1634
|
...t,
|
|
1625
|
-
...
|
|
1626
|
-
},
|
|
1635
|
+
...A
|
|
1636
|
+
}, He = Ve, X = y !== null, Z = It(O), Ue = Z.length === 0 ? W.editableProps : W.editableProps.filter((e) => It(e).includes(Z)), We = X && S === "props" && T === "detected" ? rt(He) : [], Ge = o(Re);
|
|
1627
1637
|
i(() => {
|
|
1628
|
-
|
|
1629
|
-
}, [
|
|
1630
|
-
let
|
|
1631
|
-
t === "mount" || !
|
|
1632
|
-
}, [
|
|
1638
|
+
Ge.current = Re;
|
|
1639
|
+
}, [Re]);
|
|
1640
|
+
let Ke = a(() => (e, t) => {
|
|
1641
|
+
t === "mount" || !Ge.current || gt(q);
|
|
1642
|
+
}, [q]);
|
|
1633
1643
|
i(() => () => {
|
|
1634
|
-
|
|
1635
|
-
}, [
|
|
1636
|
-
if (!
|
|
1644
|
+
vt(q);
|
|
1645
|
+
}, [q]), i(() => {
|
|
1646
|
+
if (!X) return;
|
|
1637
1647
|
let e = (e) => {
|
|
1638
1648
|
let t = e.target;
|
|
1639
|
-
_.current?.contains(t) || v.current?.contains(t) || (x(null),
|
|
1649
|
+
_.current?.contains(t) || v.current?.contains(t) || (x(null), L(null), R(""), z(null));
|
|
1640
1650
|
}, t = (e) => {
|
|
1641
1651
|
if (e.key === "Escape") {
|
|
1642
|
-
if (
|
|
1643
|
-
|
|
1652
|
+
if (I) {
|
|
1653
|
+
L(null), R(""), z(null);
|
|
1644
1654
|
return;
|
|
1645
1655
|
}
|
|
1646
1656
|
x(null);
|
|
@@ -1649,35 +1659,35 @@ function Yt(t, n) {
|
|
|
1649
1659
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
1650
1660
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
1651
1661
|
};
|
|
1652
|
-
}, [
|
|
1653
|
-
|
|
1662
|
+
}, [I, X]), i(() => {
|
|
1663
|
+
X && (W.enabled && ye && Ae || (x(null), L(null), R(""), z(null)));
|
|
1654
1664
|
}, [
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1665
|
+
W.enabled,
|
|
1666
|
+
Ae,
|
|
1667
|
+
ye,
|
|
1668
|
+
X
|
|
1659
1669
|
]), i(() => {
|
|
1660
|
-
if (!
|
|
1670
|
+
if (!ae) return;
|
|
1661
1671
|
let e = globalThis.setTimeout(() => {
|
|
1662
|
-
|
|
1672
|
+
oe(null);
|
|
1663
1673
|
}, 1400);
|
|
1664
1674
|
return () => {
|
|
1665
1675
|
globalThis.clearTimeout(e);
|
|
1666
1676
|
};
|
|
1667
|
-
}, [
|
|
1668
|
-
if (!
|
|
1677
|
+
}, [ae]), i(() => {
|
|
1678
|
+
if (!B) return;
|
|
1669
1679
|
let e = globalThis.setTimeout(() => {
|
|
1670
|
-
|
|
1680
|
+
V(null);
|
|
1671
1681
|
}, 5e3);
|
|
1672
1682
|
return () => {
|
|
1673
1683
|
globalThis.clearTimeout(e);
|
|
1674
1684
|
};
|
|
1675
|
-
}, [
|
|
1676
|
-
if (!
|
|
1677
|
-
let e = _.current.getBoundingClientRect(), t =
|
|
1685
|
+
}, [B]), i(() => {
|
|
1686
|
+
if (!X || !y || !_.current) return;
|
|
1687
|
+
let e = _.current.getBoundingClientRect(), t = Vt(y, e.width, e.height);
|
|
1678
1688
|
(t.x !== y.x || t.y !== y.y) && x(t);
|
|
1679
|
-
}, [
|
|
1680
|
-
if (!
|
|
1689
|
+
}, [X, y]), i(() => {
|
|
1690
|
+
if (!X || I || !_.current) return;
|
|
1681
1691
|
let e = _.current;
|
|
1682
1692
|
w(e);
|
|
1683
1693
|
let t = (t) => {
|
|
@@ -1686,8 +1696,8 @@ function Yt(t, n) {
|
|
|
1686
1696
|
return document.addEventListener("keydown", t), () => {
|
|
1687
1697
|
document.removeEventListener("keydown", t);
|
|
1688
1698
|
};
|
|
1689
|
-
}, [
|
|
1690
|
-
if (!
|
|
1699
|
+
}, [X, I]), i(() => {
|
|
1700
|
+
if (!I || !v.current) return;
|
|
1691
1701
|
let e = v.current;
|
|
1692
1702
|
w(e);
|
|
1693
1703
|
let t = (t) => {
|
|
@@ -1696,13 +1706,13 @@ function Yt(t, n) {
|
|
|
1696
1706
|
return document.addEventListener("keydown", t), () => {
|
|
1697
1707
|
document.removeEventListener("keydown", t), _.current?.focus();
|
|
1698
1708
|
};
|
|
1699
|
-
}, [
|
|
1700
|
-
te.current && !
|
|
1701
|
-
}, [
|
|
1702
|
-
let
|
|
1703
|
-
"--reinspect-color":
|
|
1704
|
-
"--reinspect-z-base":
|
|
1705
|
-
},
|
|
1709
|
+
}, [I]), i(() => {
|
|
1710
|
+
te.current && !X && m.current?.focus(), te.current = X;
|
|
1711
|
+
}, [X]);
|
|
1712
|
+
let qe = {
|
|
1713
|
+
"--reinspect-color": ke,
|
|
1714
|
+
"--reinspect-z-base": W.zIndexBase
|
|
1715
|
+
}, Je = (e) => {
|
|
1706
1716
|
if (typeof window > "u") return {};
|
|
1707
1717
|
let t = e.currentTarget.querySelector("[data-reinspect-content=\"true\"]"), n = e.target, r = null;
|
|
1708
1718
|
if (n instanceof HTMLElement && t?.contains(n) && (r = n), !r && t?.firstElementChild instanceof HTMLElement && (r = t.firstElementChild), !r && t instanceof HTMLElement && (r = t), !r) return {};
|
|
@@ -1710,91 +1720,96 @@ function Yt(t, n) {
|
|
|
1710
1720
|
let e = r;
|
|
1711
1721
|
for (; e;) {
|
|
1712
1722
|
let t = window.getComputedStyle(e).backgroundColor.trim();
|
|
1713
|
-
if (!
|
|
1723
|
+
if (!Bt(t)) return t;
|
|
1714
1724
|
e = e.parentElement;
|
|
1715
1725
|
}
|
|
1716
1726
|
let t = window.getComputedStyle(document.documentElement).backgroundColor.trim();
|
|
1717
|
-
return
|
|
1727
|
+
return Bt(t) ? "rgb(255 255 255)" : t;
|
|
1718
1728
|
};
|
|
1719
|
-
for (let e of
|
|
1720
|
-
let t =
|
|
1729
|
+
for (let e of W.editableProps) {
|
|
1730
|
+
let t = zt(e), n = e === "backgroundColor" ? o() : i.getPropertyValue(t).trim();
|
|
1721
1731
|
n.length > 0 && (a[e] = n);
|
|
1722
1732
|
}
|
|
1723
1733
|
return a;
|
|
1724
|
-
},
|
|
1734
|
+
}, Ye = (e) => {
|
|
1725
1735
|
if (!e) return;
|
|
1726
1736
|
let t = e.trim().match(/-?\d*\.?\d+/);
|
|
1727
|
-
if (t?.[0]) return
|
|
1728
|
-
},
|
|
1729
|
-
|
|
1737
|
+
if (t?.[0]) return Le(t[0]);
|
|
1738
|
+
}, Xe = (e) => {
|
|
1739
|
+
J && Wt(e, ve) && (e.preventDefault(), C("general"), E("detected"), k(""), P(null), oe(null), ce({}), ue({}), F({}), L(null), R(""), z(null), N("{}"), me(Je(e)), x(Vt({
|
|
1730
1740
|
x: e.clientX,
|
|
1731
1741
|
y: e.clientY
|
|
1732
|
-
},
|
|
1733
|
-
},
|
|
1734
|
-
let { parsed: e, error: t } =
|
|
1742
|
+
}, jt, Mt)));
|
|
1743
|
+
}, Ze = () => {
|
|
1744
|
+
let { parsed: e, error: t } = lt(M);
|
|
1735
1745
|
if (t || !e) {
|
|
1736
|
-
|
|
1746
|
+
P(t);
|
|
1737
1747
|
return;
|
|
1738
1748
|
}
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
Kt(e).then((e) => {
|
|
1744
|
-
P(e ? `${t} copied.` : "Clipboard access is unavailable.");
|
|
1745
|
-
});
|
|
1749
|
+
let n = { ...e };
|
|
1750
|
+
Object.prototype.hasOwnProperty.call(n, "children") && !st(n.children) && delete n.children, j(n), ce({}), ue({}), F({}), P(null);
|
|
1751
|
+
}, Qe = () => {
|
|
1752
|
+
j({}), T === "raw" && N(it(Gt(t), { mode: G })), P(null);
|
|
1746
1753
|
}, $e = (e, t) => {
|
|
1747
|
-
|
|
1754
|
+
Yt(e).then((e) => {
|
|
1755
|
+
oe(e ? `${t} copied.` : "Clipboard access is unavailable.");
|
|
1756
|
+
});
|
|
1757
|
+
}, et = (e, t) => {
|
|
1758
|
+
let n = se[e], r = n ?? at(t, { mode: G });
|
|
1748
1759
|
if (!r) {
|
|
1749
|
-
|
|
1760
|
+
oe("JSON preview is unavailable for this value.");
|
|
1750
1761
|
return;
|
|
1751
1762
|
}
|
|
1752
|
-
n ||
|
|
1763
|
+
n || ce((t) => ({
|
|
1753
1764
|
...t,
|
|
1754
1765
|
[e]: r
|
|
1755
|
-
})),
|
|
1756
|
-
},
|
|
1757
|
-
if (
|
|
1758
|
-
|
|
1766
|
+
})), $e(r, "JSON value");
|
|
1767
|
+
}, tt = (e, t) => {
|
|
1768
|
+
if (de[e]) {
|
|
1769
|
+
F((t) => ({
|
|
1759
1770
|
...t,
|
|
1760
1771
|
[e]: !1
|
|
1761
1772
|
}));
|
|
1762
1773
|
return;
|
|
1763
1774
|
}
|
|
1764
|
-
if (!(e in se) && !(e in
|
|
1765
|
-
let n =
|
|
1766
|
-
n === null ?
|
|
1775
|
+
if (!(e in se) && !(e in le)) {
|
|
1776
|
+
let n = at(t, { mode: G });
|
|
1777
|
+
n === null ? ue((t) => ({
|
|
1767
1778
|
...t,
|
|
1768
1779
|
[e]: "JSON preview is unavailable for this value."
|
|
1769
|
-
})) :
|
|
1780
|
+
})) : ce((t) => ({
|
|
1770
1781
|
...t,
|
|
1771
1782
|
[e]: n
|
|
1772
1783
|
}));
|
|
1773
1784
|
}
|
|
1774
|
-
|
|
1785
|
+
F((t) => ({
|
|
1775
1786
|
...t,
|
|
1776
1787
|
[e]: !0
|
|
1777
1788
|
}));
|
|
1778
|
-
},
|
|
1779
|
-
if (!
|
|
1780
|
-
let n =
|
|
1789
|
+
}, nt = (e, t) => {
|
|
1790
|
+
if (!ot(t)) return;
|
|
1791
|
+
let n = at(t, { mode: G });
|
|
1781
1792
|
if (n === null) {
|
|
1782
|
-
|
|
1793
|
+
oe("Unable to open editor for this value.");
|
|
1783
1794
|
return;
|
|
1784
1795
|
}
|
|
1785
|
-
|
|
1786
|
-
},
|
|
1787
|
-
if (!
|
|
1788
|
-
let e =
|
|
1796
|
+
L(e), R(n), z(null);
|
|
1797
|
+
}, ut = () => {
|
|
1798
|
+
if (!I) return;
|
|
1799
|
+
let e = I, { parsed: t, error: n } = ct(fe);
|
|
1789
1800
|
if (n || t === null) {
|
|
1790
|
-
|
|
1801
|
+
z(n);
|
|
1802
|
+
return;
|
|
1803
|
+
}
|
|
1804
|
+
if (e === "children" && !st(t)) {
|
|
1805
|
+
z(Nt);
|
|
1791
1806
|
return;
|
|
1792
1807
|
}
|
|
1793
|
-
let r =
|
|
1794
|
-
|
|
1808
|
+
let r = Jt(t), i = r ? at(t, { mode: G }) : null;
|
|
1809
|
+
j((n) => ({
|
|
1795
1810
|
...n,
|
|
1796
1811
|
[e]: t
|
|
1797
|
-
})),
|
|
1812
|
+
})), ce((t) => {
|
|
1798
1813
|
if (i === null) {
|
|
1799
1814
|
if (!(e in t)) return t;
|
|
1800
1815
|
let n = { ...t };
|
|
@@ -1804,7 +1819,7 @@ function Yt(t, n) {
|
|
|
1804
1819
|
...t,
|
|
1805
1820
|
[e]: i
|
|
1806
1821
|
};
|
|
1807
|
-
}),
|
|
1822
|
+
}), ue((t) => {
|
|
1808
1823
|
let n = "JSON preview is unavailable for this value.";
|
|
1809
1824
|
if (r && i === null) return t[e] === n ? t : {
|
|
1810
1825
|
...t,
|
|
@@ -1813,29 +1828,29 @@ function Yt(t, n) {
|
|
|
1813
1828
|
if (!(e in t)) return t;
|
|
1814
1829
|
let a = { ...t };
|
|
1815
1830
|
return delete a[e], a;
|
|
1816
|
-
}),
|
|
1831
|
+
}), F((t) => r || !t[e] ? t : {
|
|
1817
1832
|
...t,
|
|
1818
1833
|
[e]: !1
|
|
1819
|
-
}),
|
|
1820
|
-
},
|
|
1821
|
-
|
|
1834
|
+
}), L(null), R(""), z(null);
|
|
1835
|
+
}, dt = () => {
|
|
1836
|
+
Te((e) => ({
|
|
1822
1837
|
...e,
|
|
1823
|
-
patterns:
|
|
1838
|
+
patterns: Ut(e.patterns, g)
|
|
1824
1839
|
}));
|
|
1825
|
-
},
|
|
1826
|
-
|
|
1840
|
+
}, ft = Ee.patterns.includes(g), pt = () => {
|
|
1841
|
+
De((e) => ({
|
|
1827
1842
|
...e,
|
|
1828
|
-
patterns:
|
|
1829
|
-
})), x(null),
|
|
1830
|
-
},
|
|
1831
|
-
|
|
1843
|
+
patterns: Ht(e.patterns, g)
|
|
1844
|
+
})), x(null), V({ componentName: g });
|
|
1845
|
+
}, Q = () => {
|
|
1846
|
+
B && (De((e) => ({
|
|
1832
1847
|
...e,
|
|
1833
|
-
patterns: e.patterns.filter((e) => e !==
|
|
1834
|
-
})),
|
|
1835
|
-
}, $ =
|
|
1848
|
+
patterns: e.patterns.filter((e) => e !== B.componentName)
|
|
1849
|
+
})), V(null));
|
|
1850
|
+
}, $ = X ? /* @__PURE__ */ d("div", {
|
|
1836
1851
|
ref: _,
|
|
1837
1852
|
className: "reinspect-menu",
|
|
1838
|
-
"data-reinspect-theme":
|
|
1853
|
+
"data-reinspect-theme": _e,
|
|
1839
1854
|
role: "dialog",
|
|
1840
1855
|
"aria-modal": "true",
|
|
1841
1856
|
"aria-label": `${g} controls`,
|
|
@@ -1852,7 +1867,7 @@ function Yt(t, n) {
|
|
|
1852
1867
|
style: {
|
|
1853
1868
|
top: `${y.y}px`,
|
|
1854
1869
|
left: `${y.x}px`,
|
|
1855
|
-
"--reinspect-color":
|
|
1870
|
+
"--reinspect-color": ke
|
|
1856
1871
|
},
|
|
1857
1872
|
children: [
|
|
1858
1873
|
/* @__PURE__ */ d("div", {
|
|
@@ -1930,9 +1945,9 @@ function Yt(t, n) {
|
|
|
1930
1945
|
children: [/* @__PURE__ */ d("button", {
|
|
1931
1946
|
type: "button",
|
|
1932
1947
|
className: "reinspect-menu-action-card",
|
|
1933
|
-
onClick:
|
|
1948
|
+
onClick: dt,
|
|
1934
1949
|
"data-testid": `reinspect-include-component-${g}`,
|
|
1935
|
-
"data-state":
|
|
1950
|
+
"data-state": ft ? "active" : "idle",
|
|
1936
1951
|
"aria-label": `Only inspect ${g} components`,
|
|
1937
1952
|
children: [
|
|
1938
1953
|
/* @__PURE__ */ u("span", {
|
|
@@ -1951,7 +1966,7 @@ function Yt(t, n) {
|
|
|
1951
1966
|
}), /* @__PURE__ */ d("button", {
|
|
1952
1967
|
type: "button",
|
|
1953
1968
|
className: "reinspect-menu-action-card",
|
|
1954
|
-
onClick:
|
|
1969
|
+
onClick: pt,
|
|
1955
1970
|
"data-testid": `reinspect-exclude-component-${g}`,
|
|
1956
1971
|
"aria-label": `Hide ${g} components from inspection`,
|
|
1957
1972
|
children: [
|
|
@@ -1985,16 +2000,16 @@ function Yt(t, n) {
|
|
|
1985
2000
|
}), /* @__PURE__ */ u("button", {
|
|
1986
2001
|
type: "button",
|
|
1987
2002
|
role: "switch",
|
|
1988
|
-
"aria-checked":
|
|
1989
|
-
onClick: () =>
|
|
1990
|
-
disabled:
|
|
2003
|
+
"aria-checked": Pe ? !0 : Ne,
|
|
2004
|
+
onClick: () => we(g, !Ne),
|
|
2005
|
+
disabled: Pe,
|
|
1991
2006
|
"aria-label": `Capture renders for ${g}`,
|
|
1992
2007
|
"data-testid": `reinspect-component-render-toggle-${g}`,
|
|
1993
2008
|
className: "reinspect-switch-button reinspect-menu-switch",
|
|
1994
|
-
"data-state":
|
|
2009
|
+
"data-state": Pe || Ne ? "on" : "off"
|
|
1995
2010
|
})]
|
|
1996
2011
|
}),
|
|
1997
|
-
|
|
2012
|
+
Pe ? /* @__PURE__ */ u("p", {
|
|
1998
2013
|
className: "reinspect-setting-note",
|
|
1999
2014
|
children: "Global render capture is enabled in settings."
|
|
2000
2015
|
}) : null
|
|
@@ -2012,9 +2027,9 @@ function Yt(t, n) {
|
|
|
2012
2027
|
}), /* @__PURE__ */ d("p", {
|
|
2013
2028
|
className: "reinspect-menu-section-caption",
|
|
2014
2029
|
children: [
|
|
2015
|
-
|
|
2030
|
+
Ue.length,
|
|
2016
2031
|
"/",
|
|
2017
|
-
|
|
2032
|
+
W.editableProps.length
|
|
2018
2033
|
]
|
|
2019
2034
|
})]
|
|
2020
2035
|
}),
|
|
@@ -2034,7 +2049,7 @@ function Yt(t, n) {
|
|
|
2034
2049
|
})
|
|
2035
2050
|
}),
|
|
2036
2051
|
/* @__PURE__ */ u("input", {
|
|
2037
|
-
id: `${
|
|
2052
|
+
id: `${q}-css-filter`,
|
|
2038
2053
|
"data-testid": "reinspect-css-filter-input",
|
|
2039
2054
|
type: "search",
|
|
2040
2055
|
value: O,
|
|
@@ -2053,33 +2068,33 @@ function Yt(t, n) {
|
|
|
2053
2068
|
}),
|
|
2054
2069
|
/* @__PURE__ */ u("div", {
|
|
2055
2070
|
className: "reinspect-menu-grid",
|
|
2056
|
-
children:
|
|
2057
|
-
let t =
|
|
2071
|
+
children: Ue.map((e) => {
|
|
2072
|
+
let t = ze?.[e], n = `${q}-${e}`;
|
|
2058
2073
|
if (D.has(e)) {
|
|
2059
|
-
let r =
|
|
2074
|
+
let r = Ie(typeof t == "string" ? t : H[e]);
|
|
2060
2075
|
return /* @__PURE__ */ d("div", {
|
|
2061
2076
|
className: "reinspect-field",
|
|
2062
2077
|
children: [/* @__PURE__ */ u("label", {
|
|
2063
2078
|
htmlFor: n,
|
|
2064
|
-
children:
|
|
2079
|
+
children: Ft(e)
|
|
2065
2080
|
}), /* @__PURE__ */ d("div", {
|
|
2066
2081
|
className: "reinspect-inline-controls",
|
|
2067
2082
|
children: [/* @__PURE__ */ u("input", {
|
|
2068
2083
|
id: n,
|
|
2069
2084
|
type: "color",
|
|
2070
2085
|
value: r,
|
|
2071
|
-
onChange: (t) => q
|
|
2086
|
+
onChange: (t) => K(q, e, t.currentTarget.value)
|
|
2072
2087
|
}), /* @__PURE__ */ u("button", {
|
|
2073
2088
|
type: "button",
|
|
2074
|
-
onClick: () => q
|
|
2075
|
-
disabled: !
|
|
2089
|
+
onClick: () => K(q, e, void 0),
|
|
2090
|
+
disabled: !Lt(t),
|
|
2076
2091
|
children: "reset"
|
|
2077
2092
|
})]
|
|
2078
2093
|
})]
|
|
2079
2094
|
}, e);
|
|
2080
2095
|
}
|
|
2081
2096
|
if (e === "opacity") {
|
|
2082
|
-
let r = typeof t == "number" ? t :
|
|
2097
|
+
let r = typeof t == "number" ? t : Ye(H[e]) ?? 1;
|
|
2083
2098
|
return /* @__PURE__ */ d("div", {
|
|
2084
2099
|
className: "reinspect-field",
|
|
2085
2100
|
children: [/* @__PURE__ */ u("label", {
|
|
@@ -2096,15 +2111,15 @@ function Yt(t, n) {
|
|
|
2096
2111
|
step: "0.05",
|
|
2097
2112
|
value: r,
|
|
2098
2113
|
onChange: (t) => {
|
|
2099
|
-
let n =
|
|
2100
|
-
n !== void 0 && q
|
|
2114
|
+
let n = Le(t.currentTarget.value);
|
|
2115
|
+
n !== void 0 && K(q, e, n);
|
|
2101
2116
|
}
|
|
2102
2117
|
}),
|
|
2103
2118
|
/* @__PURE__ */ u("output", { children: r.toFixed(2) }),
|
|
2104
2119
|
/* @__PURE__ */ u("button", {
|
|
2105
2120
|
type: "button",
|
|
2106
|
-
onClick: () => q
|
|
2107
|
-
disabled: !
|
|
2121
|
+
onClick: () => K(q, e, void 0),
|
|
2122
|
+
disabled: !Lt(t),
|
|
2108
2123
|
children: "reset"
|
|
2109
2124
|
})
|
|
2110
2125
|
]
|
|
@@ -2112,12 +2127,12 @@ function Yt(t, n) {
|
|
|
2112
2127
|
}, e);
|
|
2113
2128
|
}
|
|
2114
2129
|
if (re.has(e)) {
|
|
2115
|
-
let r = typeof t == "number" ? t :
|
|
2130
|
+
let r = typeof t == "number" ? t : Ye(H[e]) ?? "";
|
|
2116
2131
|
return /* @__PURE__ */ d("div", {
|
|
2117
2132
|
className: "reinspect-field",
|
|
2118
2133
|
children: [/* @__PURE__ */ d("label", {
|
|
2119
2134
|
htmlFor: n,
|
|
2120
|
-
children: [
|
|
2135
|
+
children: [Ft(e), " (px)"]
|
|
2121
2136
|
}), /* @__PURE__ */ d("div", {
|
|
2122
2137
|
className: "reinspect-inline-controls",
|
|
2123
2138
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -2127,16 +2142,16 @@ function Yt(t, n) {
|
|
|
2127
2142
|
value: r,
|
|
2128
2143
|
onChange: (t) => {
|
|
2129
2144
|
if (t.currentTarget.value === "") {
|
|
2130
|
-
q
|
|
2145
|
+
K(q, e, void 0);
|
|
2131
2146
|
return;
|
|
2132
2147
|
}
|
|
2133
|
-
let n =
|
|
2134
|
-
n !== void 0 && q
|
|
2148
|
+
let n = Le(t.currentTarget.value);
|
|
2149
|
+
n !== void 0 && K(q, e, n);
|
|
2135
2150
|
}
|
|
2136
2151
|
}), /* @__PURE__ */ u("button", {
|
|
2137
2152
|
type: "button",
|
|
2138
|
-
onClick: () => q
|
|
2139
|
-
disabled: !
|
|
2153
|
+
onClick: () => K(q, e, void 0),
|
|
2154
|
+
disabled: !Lt(t),
|
|
2140
2155
|
children: "reset"
|
|
2141
2156
|
})]
|
|
2142
2157
|
})]
|
|
@@ -2146,25 +2161,25 @@ function Yt(t, n) {
|
|
|
2146
2161
|
className: "reinspect-field",
|
|
2147
2162
|
children: [/* @__PURE__ */ u("label", {
|
|
2148
2163
|
htmlFor: n,
|
|
2149
|
-
children:
|
|
2164
|
+
children: Ft(e)
|
|
2150
2165
|
}), /* @__PURE__ */ d("div", {
|
|
2151
2166
|
className: "reinspect-inline-controls",
|
|
2152
2167
|
children: [/* @__PURE__ */ u("input", {
|
|
2153
2168
|
id: n,
|
|
2154
2169
|
type: "text",
|
|
2155
|
-
value: typeof t == "string" ? t :
|
|
2156
|
-
onChange: (t) => q
|
|
2170
|
+
value: typeof t == "string" ? t : H[e] ?? "",
|
|
2171
|
+
onChange: (t) => K(q, e, t.currentTarget.value || void 0)
|
|
2157
2172
|
}), /* @__PURE__ */ u("button", {
|
|
2158
2173
|
type: "button",
|
|
2159
|
-
onClick: () => q
|
|
2160
|
-
disabled: !
|
|
2174
|
+
onClick: () => K(q, e, void 0),
|
|
2175
|
+
disabled: !Lt(t),
|
|
2161
2176
|
children: "reset"
|
|
2162
2177
|
})]
|
|
2163
2178
|
})]
|
|
2164
2179
|
}, e);
|
|
2165
2180
|
})
|
|
2166
2181
|
}),
|
|
2167
|
-
|
|
2182
|
+
Ue.length === 0 ? /* @__PURE__ */ d("p", {
|
|
2168
2183
|
className: "reinspect-menu-empty-state",
|
|
2169
2184
|
children: [
|
|
2170
2185
|
"No CSS properties match \"",
|
|
@@ -2188,15 +2203,15 @@ function Yt(t, n) {
|
|
|
2188
2203
|
type: "button",
|
|
2189
2204
|
"data-state": T === "raw" ? "active" : "idle",
|
|
2190
2205
|
onClick: () => {
|
|
2191
|
-
E("raw"),
|
|
2206
|
+
E("raw"), P(null), N(it(Gt(He), { mode: G }));
|
|
2192
2207
|
},
|
|
2193
2208
|
children: "Raw"
|
|
2194
2209
|
})]
|
|
2195
2210
|
}),
|
|
2196
|
-
T === "detected" ?
|
|
2211
|
+
T === "detected" ? We.length > 0 ? /* @__PURE__ */ u("div", {
|
|
2197
2212
|
className: "reinspect-props-table",
|
|
2198
|
-
children:
|
|
2199
|
-
let t =
|
|
2213
|
+
children: We.map((e) => {
|
|
2214
|
+
let t = Rt(e.key), n = He[e.key], r = e.value.kind === "object" || e.value.kind === "array", i = !!de[e.key], a = se[e.key], o = le[e.key], s = e.key === "children" ? st(n) : ot(n);
|
|
2200
2215
|
return /* @__PURE__ */ d("div", {
|
|
2201
2216
|
className: "reinspect-props-row",
|
|
2202
2217
|
"data-testid": `reinspect-prop-row-${t}`,
|
|
@@ -2210,14 +2225,14 @@ function Yt(t, n) {
|
|
|
2210
2225
|
className: "reinspect-prop-main",
|
|
2211
2226
|
children: [/* @__PURE__ */ u("div", {
|
|
2212
2227
|
className: "reinspect-prop-value-render",
|
|
2213
|
-
children:
|
|
2228
|
+
children: Et({ value: e.value })
|
|
2214
2229
|
}), r || s || e.value.copyText ? /* @__PURE__ */ d("div", {
|
|
2215
2230
|
className: "reinspect-prop-actions",
|
|
2216
2231
|
children: [
|
|
2217
2232
|
r ? /* @__PURE__ */ u("button", {
|
|
2218
2233
|
type: "button",
|
|
2219
2234
|
"data-testid": `reinspect-prop-show-json-${t}`,
|
|
2220
|
-
onClick: () =>
|
|
2235
|
+
onClick: () => tt(e.key, n),
|
|
2221
2236
|
className: "reinspect-prop-action-text-button",
|
|
2222
2237
|
title: i ? "Collapse JSON preview" : "Expand JSON preview",
|
|
2223
2238
|
"aria-label": i ? `Collapse JSON preview for ${e.key}` : `Expand JSON preview for ${e.key}`,
|
|
@@ -2226,11 +2241,11 @@ function Yt(t, n) {
|
|
|
2226
2241
|
s ? /* @__PURE__ */ u("button", {
|
|
2227
2242
|
type: "button",
|
|
2228
2243
|
"data-testid": `reinspect-prop-edit-${t}`,
|
|
2229
|
-
onClick: () =>
|
|
2244
|
+
onClick: () => nt(e.key, n),
|
|
2230
2245
|
className: "reinspect-icon-button",
|
|
2231
2246
|
title: "Edit value",
|
|
2232
2247
|
"aria-label": `Edit ${e.key}`,
|
|
2233
|
-
children:
|
|
2248
|
+
children: qt()
|
|
2234
2249
|
}) : null,
|
|
2235
2250
|
r || e.value.copyText ? /* @__PURE__ */ u("button", {
|
|
2236
2251
|
type: "button",
|
|
@@ -2239,12 +2254,12 @@ function Yt(t, n) {
|
|
|
2239
2254
|
"aria-label": e.value.kind === "function" ? "Copy function source" : r ? `Copy JSON for ${e.key}` : `Copy value for ${e.key}`,
|
|
2240
2255
|
onClick: () => {
|
|
2241
2256
|
if (r) {
|
|
2242
|
-
|
|
2257
|
+
et(e.key, n);
|
|
2243
2258
|
return;
|
|
2244
2259
|
}
|
|
2245
|
-
e.value.copyText &&
|
|
2260
|
+
e.value.copyText && $e(e.value.copyText, e.value.kind === "function" ? "Function source" : "Value");
|
|
2246
2261
|
},
|
|
2247
|
-
children:
|
|
2262
|
+
children: Kt()
|
|
2248
2263
|
}) : null
|
|
2249
2264
|
]
|
|
2250
2265
|
}) : null]
|
|
@@ -2256,7 +2271,7 @@ function Yt(t, n) {
|
|
|
2256
2271
|
children: o
|
|
2257
2272
|
}) : /* @__PURE__ */ u("pre", { children: /* @__PURE__ */ u("code", {
|
|
2258
2273
|
className: "language-json reinspect-code-block",
|
|
2259
|
-
dangerouslySetInnerHTML: { __html:
|
|
2274
|
+
dangerouslySetInnerHTML: { __html: Tt(a ?? "", "json") }
|
|
2260
2275
|
}) })
|
|
2261
2276
|
}) : null]
|
|
2262
2277
|
})]
|
|
@@ -2267,7 +2282,7 @@ function Yt(t, n) {
|
|
|
2267
2282
|
children: "No props detected."
|
|
2268
2283
|
}) : /* @__PURE__ */ d(l, { children: [
|
|
2269
2284
|
/* @__PURE__ */ u("label", {
|
|
2270
|
-
htmlFor: `${
|
|
2285
|
+
htmlFor: `${q}-props-json`,
|
|
2271
2286
|
children: "Props JSON"
|
|
2272
2287
|
}),
|
|
2273
2288
|
/* @__PURE__ */ d("div", {
|
|
@@ -2277,13 +2292,13 @@ function Yt(t, n) {
|
|
|
2277
2292
|
ref: ee,
|
|
2278
2293
|
children: /* @__PURE__ */ u("code", {
|
|
2279
2294
|
className: "language-json reinspect-code-block",
|
|
2280
|
-
dangerouslySetInnerHTML: { __html:
|
|
2295
|
+
dangerouslySetInnerHTML: { __html: Tt(M, "json") }
|
|
2281
2296
|
})
|
|
2282
2297
|
}), /* @__PURE__ */ u("textarea", {
|
|
2283
|
-
id: `${
|
|
2284
|
-
value:
|
|
2298
|
+
id: `${q}-props-json`,
|
|
2299
|
+
value: M,
|
|
2285
2300
|
onChange: (e) => {
|
|
2286
|
-
|
|
2301
|
+
N(e.currentTarget.value), P(null);
|
|
2287
2302
|
},
|
|
2288
2303
|
onScroll: (e) => {
|
|
2289
2304
|
let t = ee.current;
|
|
@@ -2295,85 +2310,85 @@ function Yt(t, n) {
|
|
|
2295
2310
|
"data-testid": "reinspect-raw-props-textarea"
|
|
2296
2311
|
})]
|
|
2297
2312
|
}),
|
|
2298
|
-
|
|
2313
|
+
ie ? /* @__PURE__ */ u("p", {
|
|
2299
2314
|
className: "reinspect-error",
|
|
2300
|
-
children:
|
|
2315
|
+
children: ie
|
|
2301
2316
|
}) : null,
|
|
2302
2317
|
/* @__PURE__ */ d("div", {
|
|
2303
2318
|
className: "reinspect-inline-controls",
|
|
2304
2319
|
children: [/* @__PURE__ */ u("button", {
|
|
2305
2320
|
type: "button",
|
|
2306
|
-
onClick:
|
|
2321
|
+
onClick: Ze,
|
|
2307
2322
|
children: "apply"
|
|
2308
2323
|
}), /* @__PURE__ */ u("button", {
|
|
2309
2324
|
type: "button",
|
|
2310
|
-
onClick:
|
|
2325
|
+
onClick: Qe,
|
|
2311
2326
|
children: "reset"
|
|
2312
2327
|
})]
|
|
2313
2328
|
})
|
|
2314
2329
|
] }),
|
|
2315
|
-
|
|
2330
|
+
ae ? /* @__PURE__ */ u("p", {
|
|
2316
2331
|
className: "reinspect-setting-note",
|
|
2317
2332
|
"data-testid": "reinspect-props-copy-status",
|
|
2318
|
-
children:
|
|
2333
|
+
children: ae
|
|
2319
2334
|
}) : null
|
|
2320
2335
|
]
|
|
2321
2336
|
}) : null
|
|
2322
2337
|
]
|
|
2323
|
-
}) : null,
|
|
2338
|
+
}) : null, mt = I ? f(/* @__PURE__ */ u("div", {
|
|
2324
2339
|
className: "reinspect-modal-backdrop",
|
|
2325
|
-
"data-reinspect-theme":
|
|
2340
|
+
"data-reinspect-theme": _e,
|
|
2326
2341
|
role: "dialog",
|
|
2327
2342
|
"aria-modal": "true",
|
|
2328
|
-
"aria-label": `Edit ${
|
|
2343
|
+
"aria-label": `Edit ${I} prop`,
|
|
2329
2344
|
"data-testid": "reinspect-prop-edit-modal",
|
|
2330
2345
|
children: /* @__PURE__ */ d("div", {
|
|
2331
2346
|
className: "reinspect-modal",
|
|
2332
|
-
"data-reinspect-theme":
|
|
2347
|
+
"data-reinspect-theme": _e,
|
|
2333
2348
|
ref: v,
|
|
2334
2349
|
tabIndex: -1,
|
|
2335
2350
|
children: [
|
|
2336
2351
|
/* @__PURE__ */ d("p", {
|
|
2337
2352
|
className: "reinspect-menu-title",
|
|
2338
|
-
children: ["Edit prop: ",
|
|
2353
|
+
children: ["Edit prop: ", I]
|
|
2339
2354
|
}),
|
|
2340
2355
|
/* @__PURE__ */ u("label", {
|
|
2341
|
-
htmlFor: `${
|
|
2356
|
+
htmlFor: `${q}-prop-edit-json`,
|
|
2342
2357
|
children: "JSON value"
|
|
2343
2358
|
}),
|
|
2344
2359
|
/* @__PURE__ */ u("textarea", {
|
|
2345
|
-
id: `${
|
|
2360
|
+
id: `${q}-prop-edit-json`,
|
|
2346
2361
|
"data-testid": "reinspect-prop-edit-textarea",
|
|
2347
|
-
value:
|
|
2362
|
+
value: fe,
|
|
2348
2363
|
onChange: (e) => {
|
|
2349
|
-
|
|
2364
|
+
R(e.currentTarget.value), z(null);
|
|
2350
2365
|
},
|
|
2351
2366
|
rows: 10
|
|
2352
2367
|
}),
|
|
2353
|
-
|
|
2368
|
+
pe ? /* @__PURE__ */ u("p", {
|
|
2354
2369
|
className: "reinspect-error",
|
|
2355
2370
|
"data-testid": "reinspect-prop-edit-error",
|
|
2356
|
-
children:
|
|
2371
|
+
children: pe
|
|
2357
2372
|
}) : null,
|
|
2358
2373
|
/* @__PURE__ */ d("div", {
|
|
2359
2374
|
className: "reinspect-inline-controls",
|
|
2360
2375
|
children: [/* @__PURE__ */ u("button", {
|
|
2361
2376
|
type: "button",
|
|
2362
|
-
onClick:
|
|
2377
|
+
onClick: ut,
|
|
2363
2378
|
children: "apply"
|
|
2364
2379
|
}), /* @__PURE__ */ u("button", {
|
|
2365
2380
|
type: "button",
|
|
2366
2381
|
onClick: () => {
|
|
2367
|
-
|
|
2382
|
+
L(null), R(""), z(null);
|
|
2368
2383
|
},
|
|
2369
2384
|
children: "cancel"
|
|
2370
2385
|
})]
|
|
2371
2386
|
})
|
|
2372
2387
|
]
|
|
2373
2388
|
})
|
|
2374
|
-
}), document.body) : null,
|
|
2389
|
+
}), document.body) : null, ht = B ? f(/* @__PURE__ */ d("div", {
|
|
2375
2390
|
className: "reinspect-toast",
|
|
2376
|
-
"data-reinspect-theme":
|
|
2391
|
+
"data-reinspect-theme": _e,
|
|
2377
2392
|
role: "status",
|
|
2378
2393
|
"aria-live": "polite",
|
|
2379
2394
|
"data-testid": "reinspect-hide-component-toast",
|
|
@@ -2382,7 +2397,7 @@ function Yt(t, n) {
|
|
|
2382
2397
|
className: "reinspect-toast-copy",
|
|
2383
2398
|
children: [/* @__PURE__ */ d("p", {
|
|
2384
2399
|
className: "reinspect-toast-title",
|
|
2385
|
-
children: ["Hidden ",
|
|
2400
|
+
children: ["Hidden ", B.componentName]
|
|
2386
2401
|
}), /* @__PURE__ */ u("p", {
|
|
2387
2402
|
className: "reinspect-toast-description",
|
|
2388
2403
|
children: "This component type was excluded from inspection."
|
|
@@ -2392,65 +2407,65 @@ function Yt(t, n) {
|
|
|
2392
2407
|
type: "button",
|
|
2393
2408
|
className: "reinspect-toast-undo",
|
|
2394
2409
|
"data-testid": "reinspect-hide-component-undo",
|
|
2395
|
-
onClick:
|
|
2410
|
+
onClick: Q,
|
|
2396
2411
|
children: "Undo"
|
|
2397
2412
|
}),
|
|
2398
2413
|
/* @__PURE__ */ u("button", {
|
|
2399
2414
|
type: "button",
|
|
2400
2415
|
className: "reinspect-toast-dismiss",
|
|
2401
2416
|
"aria-label": "Dismiss notification",
|
|
2402
|
-
onClick: () =>
|
|
2417
|
+
onClick: () => V(null),
|
|
2403
2418
|
children: "×"
|
|
2404
2419
|
})
|
|
2405
2420
|
]
|
|
2406
2421
|
}), document.body) : null;
|
|
2407
|
-
if (!
|
|
2422
|
+
if (!he) {
|
|
2408
2423
|
if (c === "manual") throw Error("useReinspect must be used within ReinspectProvider");
|
|
2409
|
-
return /* @__PURE__ */ u(h, { ...
|
|
2424
|
+
return /* @__PURE__ */ u(h, { ...Ve });
|
|
2410
2425
|
}
|
|
2411
|
-
let
|
|
2412
|
-
id:
|
|
2413
|
-
onRender:
|
|
2414
|
-
children: /* @__PURE__ */ u(h, { ...
|
|
2415
|
-
}) : /* @__PURE__ */ u(h, { ...
|
|
2416
|
-
return !
|
|
2426
|
+
let _t = Re ? /* @__PURE__ */ u(e, {
|
|
2427
|
+
id: q,
|
|
2428
|
+
onRender: Ke,
|
|
2429
|
+
children: /* @__PURE__ */ u(h, { ...Ve })
|
|
2430
|
+
}) : /* @__PURE__ */ u(h, { ...Ve });
|
|
2431
|
+
return !J && !X ? /* @__PURE__ */ d(l, { children: [_t, ht] }) : /* @__PURE__ */ d("div", {
|
|
2417
2432
|
ref: m,
|
|
2418
2433
|
className: "reinspect-shell",
|
|
2419
2434
|
"data-reinspect-component": g,
|
|
2420
|
-
"data-reinspect-active":
|
|
2435
|
+
"data-reinspect-active": J,
|
|
2421
2436
|
"data-testid": `reinspect-shell-${g}`,
|
|
2422
|
-
style:
|
|
2437
|
+
style: qe,
|
|
2423
2438
|
tabIndex: -1,
|
|
2424
|
-
onContextMenu:
|
|
2439
|
+
onContextMenu: Xe,
|
|
2425
2440
|
children: [
|
|
2426
|
-
|
|
2441
|
+
J ? /* @__PURE__ */ d("span", {
|
|
2427
2442
|
className: "reinspect-name-badge",
|
|
2428
2443
|
children: [
|
|
2429
2444
|
g,
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
instanceId:
|
|
2433
|
-
counterMode:
|
|
2445
|
+
Y ? " | " : "",
|
|
2446
|
+
Y ? /* @__PURE__ */ u(Dt, {
|
|
2447
|
+
instanceId: q,
|
|
2448
|
+
counterMode: Fe
|
|
2434
2449
|
}) : null
|
|
2435
2450
|
]
|
|
2436
2451
|
}) : null,
|
|
2437
2452
|
$ ? f($, document.body) : null,
|
|
2438
|
-
pt,
|
|
2439
2453
|
mt,
|
|
2454
|
+
ht,
|
|
2440
2455
|
/* @__PURE__ */ u("div", {
|
|
2441
2456
|
className: "reinspect-content",
|
|
2442
2457
|
"data-reinspect-content": "true",
|
|
2443
|
-
style:
|
|
2444
|
-
children:
|
|
2458
|
+
style: Be,
|
|
2459
|
+
children: _t
|
|
2445
2460
|
})
|
|
2446
2461
|
]
|
|
2447
2462
|
});
|
|
2448
2463
|
}
|
|
2449
|
-
return _.displayName = `withReinspect(${g})`,
|
|
2464
|
+
return _.displayName = `withReinspect(${g})`, ft(_, {
|
|
2450
2465
|
source: c,
|
|
2451
2466
|
scope: p,
|
|
2452
2467
|
original: h
|
|
2453
2468
|
}), _;
|
|
2454
2469
|
}
|
|
2455
2470
|
//#endregion
|
|
2456
|
-
export {
|
|
2471
|
+
export { K as _, je as a, ne as b, pe as c, H as d, xe as f, Te as g, Oe as h, Ae as i, R as l, be as m, dt as n, L as o, he as p, P as r, z as s, Qt as t, fe as u, J as v, b as x, w as y };
|