react-reinspect 0.1.7 → 0.1.9
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 +35 -41
- package/dist/lib/autoWrap.d.ts +1 -8
- package/dist/lib/autoWrap.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +3 -2
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/context.d.ts +1 -3
- package/dist/lib/context.d.ts.map +1 -1
- package/dist/lib/core/renderCounter.d.ts +11 -0
- package/dist/lib/core/renderCounter.d.ts.map +1 -0
- package/dist/lib/core/state.d.ts +67 -0
- package/dist/lib/core/state.d.ts.map +1 -0
- package/dist/lib/dom/styleInjection.d.ts +2 -0
- package/dist/lib/dom/styleInjection.d.ts.map +1 -0
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.d.ts +2 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +781 -1199
- package/dist/lib/injectStyles.d.ts +1 -1
- package/dist/lib/injectStyles.d.ts.map +1 -1
- package/dist/lib/internal/auto-wrap.cjs +1 -0
- package/dist/lib/internal/auto-wrap.d.ts +9 -0
- package/dist/lib/internal/auto-wrap.d.ts.map +1 -0
- package/dist/lib/internal/auto-wrap.js +12 -0
- package/dist/lib/propsInspector.d.ts +8 -2
- package/dist/lib/propsInspector.d.ts.map +1 -1
- package/dist/lib/react/context.d.ts +3 -0
- package/dist/lib/react/context.d.ts.map +1 -0
- package/dist/lib/react/focusTrap.d.ts +3 -0
- package/dist/lib/react/focusTrap.d.ts.map +1 -0
- package/dist/lib/react/overlay.d.ts +14 -0
- package/dist/lib/react/overlay.d.ts.map +1 -0
- package/dist/lib/react/provider.d.ts +4 -0
- package/dist/lib/react/provider.d.ts.map +1 -0
- package/dist/lib/react/wrap.d.ts +11 -0
- package/dist/lib/react/wrap.d.ts.map +1 -0
- package/dist/lib/store.d.ts +1 -2
- package/dist/lib/store.d.ts.map +1 -1
- package/dist/lib/style.css +1 -1
- package/dist/lib/syntaxHighlight.d.ts +6 -0
- package/dist/lib/syntaxHighlight.d.ts.map +1 -0
- package/dist/lib/types.d.ts +70 -18
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +33 -4
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/withReinspect.d.ts +1 -6
- package/dist/lib/withReinspect.d.ts.map +1 -1
- package/dist/lib/wrap-Cc3mMcCA.cjs +2 -0
- package/dist/lib/wrap-DkOzTshV.js +2456 -0
- package/dist/lib/wrapInspectableMap.d.ts +1 -1
- package/dist/lib/wrapInspectableMap.d.ts.map +1 -1
- package/dist/lib/wrapMarker.d.ts +6 -3
- package/dist/lib/wrapMarker.d.ts.map +1 -1
- package/dist/plugin/internal/autoDiscoverTransform.d.ts +26 -0
- package/dist/plugin/internal/autoDiscoverTransform.d.ts.map +1 -0
- package/dist/plugin/internal/autoDiscoverTransform.js +397 -0
- package/dist/plugin/reinspectAutoDiscoverPlugin.d.ts +5 -8
- package/dist/plugin/reinspectAutoDiscoverPlugin.d.ts.map +1 -1
- package/dist/plugin/reinspectAutoDiscoverPlugin.js +11 -358
- package/dist/plugin/reinspectNextAutoDiscoverLoader.d.ts +1 -0
- package/dist/plugin/reinspectNextAutoDiscoverLoader.d.ts.map +1 -1
- package/dist/plugin/reinspectNextAutoDiscoverLoader.js +5 -27
- package/dist/plugin/reinspectNextPlugin.d.ts +2 -0
- package/dist/plugin/reinspectNextPlugin.d.ts.map +1 -1
- package/dist/plugin/reinspectNextPlugin.js +19 -15
- package/docs/assets/screenshot-example.png +0 -0
- package/package.json +32 -3
package/dist/lib/index.js
CHANGED
|
@@ -1,1280 +1,862 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _, x as v, y } from "./wrap-DkOzTshV.js";
|
|
3
|
+
import { useCallback as b, useContext as x, useEffect as S, useMemo as C, useReducer as w, useRef as T, useState as E } from "react";
|
|
4
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
5
5
|
//#region src/reinspect/reinspect.css?inline
|
|
6
|
-
var f = ".reinspect-shell{border-radius:14px;transition:outline-color .12s;position:relative}.reinspect-shell[data-reinspect-active=true]{outline:2px dashed var(--reinspect-color);outline-offset:2px}.reinspect-content{border-radius:inherit}.reinspect-name-badge{z-index:calc(var(--reinspect-z-base) + 5);letter-spacing:.04em;color:#0f172a;background:color-mix(in srgb, var(--reinspect-color) 25%, white);border:1px solid color-mix(in srgb, var(--reinspect-color) 45%, white);pointer-events:none;white-space:nowrap;border-radius:999px;padding:5px 8px;font-size:11px;line-height:1;position:absolute;top:-14px;left:10px}.reinspect-menu{z-index:2147483647;background:#fff;border:1px solid #cbd5e1;border-radius:12px;width:min(300px,100vw - 24px);max-height:min(420px,70vh);padding:12px;position:fixed;overflow:auto;box-shadow:0 20px 25px -5px #0f172a33,0 8px 10px -6px #0f172a33}.reinspect-menu-title{color:#0f172a;margin:0 0 10px;font-size:13px;font-weight:600}.reinspect-menu-component-setting{color:#1e293b;grid-template-columns:1fr auto;align-items:center;gap:8px;margin-bottom:8px;font-size:12px;display:grid}.reinspect-menu-component-setting input[type=checkbox]{width:15px;height:15px}.reinspect-setting-note{color:#64748b;margin:0 0 10px;font-size:11px}.reinspect-submenu{grid-template-columns:1fr 1fr;gap:6px;margin-bottom:10px;display:grid}.reinspect-submenu button{color:#1e293b;cursor:pointer;background:#f8fafc;border:1px solid #cbd5e1;border-radius:8px;padding:6px 8px;font-size:12px}.reinspect-submenu button[data-state=active]{background:#e0f2fe;border-color:#0284c7}.reinspect-menu-grid{gap:9px;display:grid}.reinspect-menu-filter{margin-bottom:10px;position:relative}.reinspect-menu-filter-icon{color:#64748b;pointer-events:none;width:14px;height:14px;position:absolute;top:50%;left:9px;transform:translateY(-50%)}.reinspect-menu-filter-icon svg{width:100%;height:100%;display:block}.reinspect-menu-filter input{border:1px solid #cbd5e1;border-radius:8px;width:100%;padding:5px 7px 5px 30px;font-size:12px}.reinspect-menu-empty-state{color:#64748b;margin:8px 0 0;font-size:12px}.reinspect-field{gap:4px;display:grid}.reinspect-field label{color:#334155;font-size:12px}.reinspect-inline-controls{grid-template-columns:1fr auto;gap:6px;display:grid}.reinspect-inline-controls input,.reinspect-inline-controls button,.reinspect-inline-controls output{font-size:12px}.reinspect-inline-controls input[type=number],.reinspect-inline-controls input[type=text]{border:1px solid #cbd5e1;border-radius:8px;width:100%;padding:5px 7px}.reinspect-inline-controls button{color:#1e293b;cursor:pointer;background:#f8fafc;border:1px solid #cbd5e1;border-radius:8px;padding:5px 7px}.reinspect-inline-controls button:disabled{opacity:.45;cursor:default}.reinspect-opacity-controls{grid-template-columns:1fr auto auto;align-items:center}.reinspect-opacity-controls output{color:#475569;text-align:right;min-width:36px}.reinspect-props-panel{gap:8px;display:grid}.reinspect-props-submenu{grid-template-columns:1fr 1fr;gap:6px;display:grid}.reinspect-props-submenu button{color:#1e293b;cursor:pointer;background:#f8fafc;border:1px solid #cbd5e1;border-radius:8px;padding:6px 8px;font-size:12px}.reinspect-props-submenu button[data-state=active]{background:#e0f2fe;border-color:#0284c7}.reinspect-props-panel label{color:#334155;font-size:12px}.reinspect-props-table{gap:6px;display:grid}.reinspect-props-header{color:#475569;text-transform:uppercase;letter-spacing:.04em;grid-template-columns:.85fr 1.15fr;gap:8px;font-size:11px;display:grid}.reinspect-props-row{border:1px solid #e2e8f0;border-radius:8px;grid-template-columns:.85fr 1.15fr;align-items:start;gap:8px;padding:6px;display:grid}.reinspect-prop-key{color:#0f172a;word-break:break-word;font-size:12px}.reinspect-prop-cell{min-width:0}.reinspect-prop-cell code{color:#0f172a;word-break:break-word;font-size:11px}.reinspect-prop-missing{color:#94a3b8;font-size:11px}.reinspect-prop-scalar{gap:4px;display:grid}.reinspect-prop-actions{flex-wrap:wrap;gap:6px;margin-top:6px;display:flex}.reinspect-prop-scalar button,.reinspect-prop-function button,.reinspect-prop-tree summary button{color:#1e293b;cursor:pointer;background:#f8fafc;border:1px solid #cbd5e1;border-radius:7px;justify-self:start;padding:3px 6px;font-size:11px}.reinspect-prop-actions button,.reinspect-prop-json-preview button{color:#1e293b;cursor:pointer;background:#f8fafc;border:1px solid #cbd5e1;border-radius:7px;padding:3px 6px;font-size:11px}.reinspect-prop-tree{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:5px}.reinspect-prop-tree summary{cursor:pointer;color:#1e293b;justify-content:space-between;align-items:center;gap:8px;font-size:11px;display:flex}.reinspect-prop-tree-children{gap:6px;margin-top:6px;display:grid}.reinspect-prop-tree-row{grid-template-columns:.8fr 1.2fr;align-items:start;gap:6px;display:grid}.reinspect-prop-tree-row>code{color:#334155;word-break:break-word;font-size:10px}.reinspect-prop-function{gap:4px;display:grid}.reinspect-prop-function pre{white-space:pre-wrap;word-break:break-word;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;margin:0;padding:6px;font-size:11px;line-height:1.3}.reinspect-prop-json-preview{gap:6px;margin-top:6px;display:grid}.reinspect-prop-json-preview pre{white-space:pre-wrap;word-break:break-word;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;max-height:180px;margin:0;padding:6px;font-size:11px;line-height:1.3;overflow:auto}.reinspect-modal-backdrop{z-index:2147483647;background:#0f172a73;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.reinspect-modal{background:#fff;border:1px solid #cbd5e1;border-radius:12px;gap:8px;width:min(560px,100%);padding:12px;display:grid;box-shadow:0 24px 28px -12px #0f172a40,0 10px 16px -10px #0f172a38}.reinspect-modal textarea,.reinspect-props-panel textarea{resize:vertical;border:1px solid #cbd5e1;border-radius:8px;width:100%;padding:8px;font-family:IBM Plex Mono,SFMono-Regular,monospace;font-size:12px}.reinspect-error{color:#b91c1c;margin:0;font-size:12px}.reinspect-floating-toggle{z-index:2147483647;color:#f8fafc;letter-spacing:.03em;cursor:pointer;background:linear-gradient(120deg,#0f172a,#334155);border:none;border-radius:999px;padding:10px 15px;font-size:13px;font-weight:600;position:fixed;bottom:18px;right:18px;box-shadow:0 10px 18px #0f172a47}.reinspect-floating-root{z-index:2147483645;position:fixed;bottom:18px;right:18px}.reinspect-floating-root .reinspect-floating-toggle{position:static}.reinspect-settings-menu{background:#fff;border:1px solid #cbd5e1;border-radius:12px;gap:10px;width:min(360px,100vw - 24px);max-height:min(540px,75vh);padding:12px;display:grid;position:absolute;bottom:calc(100% + 10px);right:0;overflow:auto;box-shadow:0 24px 28px -12px #0f172a40,0 10px 16px -10px #0f172a38}.reinspect-settings-title{color:#0f172a;margin:0;font-size:13px;font-weight:700}.reinspect-settings-toggle-row{color:#1e293b;grid-template-columns:1fr auto;align-items:center;gap:8px;font-size:12px;display:grid}.reinspect-settings-select-row{gap:6px;font-size:12px;display:grid}.reinspect-settings-select-row select{color:#0f172a;background:#fff;border:1px solid #cbd5e1;border-radius:8px;width:100%;padding:6px 8px;font-size:12px}.reinspect-settings-toggle-label{line-height:1.35}.reinspect-settings-toggle-row input[type=checkbox]{width:16px;height:16px}.reinspect-settings-divider{background:#e2e8f0;height:1px}.reinspect-setting-block{gap:8px;display:grid}.reinspect-apply-button{color:#f8fafc;cursor:pointer;background:#0f172a;border:1px solid #0f172a;border-radius:8px;padding:6px 8px;font-size:12px;font-weight:600}.reinspect-apply-button:disabled{opacity:.4;cursor:default}.reinspect-setting-header{grid-template-columns:1fr auto;align-items:start;gap:8px;display:grid}.reinspect-setting-name{color:#0f172a;letter-spacing:.02em;margin:0;font-size:12px;font-weight:700}.reinspect-setting-short-description{color:#475569;margin:3px 0 0;font-size:12px;line-height:1.35}.reinspect-tooltip-host{display:inline-flex;position:relative}.reinspect-tooltip-trigger{color:#334155;cursor:help;background:#f8fafc;border:1px solid #cbd5e1;border-radius:999px;justify-content:center;align-items:center;width:20px;height:20px;padding:0;font-size:12px;font-weight:700;display:inline-flex}.reinspect-tooltip-content{color:#f8fafc;opacity:0;pointer-events:none;background:#0f172a;border:1px solid #cbd5e1;border-radius:8px;width:240px;padding:8px;font-size:11px;line-height:1.4;transition:opacity .12s;position:absolute;top:calc(100% + 6px);right:0}.reinspect-tooltip-host:hover .reinspect-tooltip-content,.reinspect-tooltip-host:focus-within .reinspect-tooltip-content{opacity:1;pointer-events:auto}.reinspect-setting-subheading{color:#334155;margin:2px 0 0;font-size:12px;font-weight:600}.reinspect-setting-empty-state{color:#64748b;margin:0;font-size:12px}.reinspect-component-settings-list{gap:6px;display:grid}.reinspect-component-setting-row{color:#1e293b;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;grid-template-columns:1fr auto;align-items:center;gap:8px;padding:6px 8px;font-size:12px;display:grid}.reinspect-component-setting-row input[type=checkbox]{width:15px;height:15px}", p = "reinspect-runtime-styles";
|
|
7
|
-
function
|
|
6
|
+
var k = ":root{--reinspect-font-sans:\"Geist Sans\", \"Geist\", \"Segoe UI\", \"SF Pro Text\", system-ui, -apple-system, sans-serif;--reinspect-font-mono:\"Geist Mono\", \"IBM Plex Mono\", \"SFMono-Regular\", Menlo, Consolas, monospace;--reinspect-menu-bg:oklch(98.2% .014 252);--reinspect-menu-surface:oklch(96.5% .018 252);--reinspect-menu-surface-strong:oklch(93.6% .024 252);--reinspect-menu-surface-stronger:oklch(90.2% .03 252);--reinspect-menu-text:oklch(20.5% .028 252);--reinspect-menu-text-muted:oklch(36.5% .024 252);--reinspect-menu-text-soft:oklch(49% .02 252);--reinspect-menu-border:oklch(66% .024 252/.52);--reinspect-menu-border-strong:oklch(57% .03 252/.65);--reinspect-menu-border-subtle:oklch(73% .02 252/.5);--reinspect-brand-400:oklch(73% .145 254);--reinspect-brand-500:oklch(66% .165 254);--reinspect-brand-600:oklch(58% .165 254);--reinspect-brand-700:oklch(51% .153 254);--reinspect-brand-soft:color-mix(in oklch, var(--reinspect-brand-500) 18%, var(--reinspect-menu-surface));--reinspect-brand-soft-strong:color-mix(in oklch, var(--reinspect-brand-500) 28%, var(--reinspect-menu-surface));--reinspect-brand-soft-hover:color-mix(in oklch, var(--reinspect-brand-500) 36%, var(--reinspect-menu-surface));--reinspect-on-brand:oklch(98.5% .008 252);--reinspect-interactive-bg:var(--reinspect-menu-surface);--reinspect-interactive-bg-hover:var(--reinspect-menu-surface-strong);--reinspect-interactive-bg-active:var(--reinspect-brand-soft-hover);--reinspect-interactive-border:var(--reinspect-menu-border);--reinspect-interactive-border-hover:var(--reinspect-brand-400);--reinspect-interactive-border-active:var(--reinspect-brand-500);--reinspect-interactive-text:var(--reinspect-menu-text);--reinspect-interactive-text-active:var(--reinspect-brand-700);--reinspect-prism-bg:color-mix(in oklch, var(--reinspect-menu-surface-strong) 74%, white);--reinspect-prism-text:var(--reinspect-menu-text);--reinspect-prism-comment:var(--reinspect-menu-text-soft);--reinspect-prism-keyword:var(--reinspect-brand-700);--reinspect-prism-string:color-mix(in oklch, var(--reinspect-semantic-error) 70%, var(--reinspect-menu-text));--reinspect-prism-number:color-mix(in oklch, var(--reinspect-semantic-success) 76%, var(--reinspect-menu-text));--reinspect-prism-boolean:var(--reinspect-prism-keyword);--reinspect-prism-function:color-mix(in oklch, var(--reinspect-semantic-warning) 72%, var(--reinspect-menu-text));--reinspect-prism-property:color-mix(in oklch, var(--reinspect-brand-600) 74%, var(--reinspect-menu-text));--reinspect-prism-operator:var(--reinspect-menu-text);--reinspect-prism-punctuation:var(--reinspect-menu-text);--reinspect-prism-constant:color-mix(in oklch, var(--reinspect-brand-500) 78%, var(--reinspect-menu-text));--reinspect-semantic-error:oklch(62% .165 20);--reinspect-semantic-success:oklch(67% .115 158);--reinspect-semantic-warning:oklch(76% .12 78);--reinspect-focus-ring:color-mix(in oklch, var(--reinspect-brand-500) 70%, white);--reinspect-runtime-soft-mix:22%;--reinspect-runtime-border-mix:54%;--reinspect-runtime-strong-mix:78%;--reinspect-runtime-border-base:var(--reinspect-menu-border-strong);--reinspect-runtime-strong-base:var(--reinspect-menu-text);--reinspect-overlay-backdrop:oklch(24.5% .02 248/.44);--reinspect-shadow-popover:0 28px 44px -18px oklch(25.5% .02 248/.38), 0 10px 20px -12px oklch(25.5% .02 248/.3);--reinspect-shadow-modal:0 24px 28px -12px oklch(25.5% .02 248/.25), 0 10px 16px -10px oklch(25.5% .02 248/.22)}.reinspect-menu[data-reinspect-theme=dark],.reinspect-settings-menu[data-reinspect-theme=dark],.reinspect-modal-backdrop[data-reinspect-theme=dark],.reinspect-modal[data-reinspect-theme=dark],.reinspect-toast[data-reinspect-theme=dark],.reinspect-floating-root[data-reinspect-theme=dark],.reinspect-floating-toggle[data-reinspect-theme=dark]{--reinspect-menu-bg:oklch(19% .018 252);--reinspect-menu-surface:oklch(22.8% .022 252);--reinspect-menu-surface-strong:oklch(27.2% .025 252);--reinspect-menu-surface-stronger:oklch(32.2% .028 252);--reinspect-menu-text:oklch(96.5% .012 252);--reinspect-menu-text-muted:oklch(84% .018 252);--reinspect-menu-text-soft:oklch(73% .017 252);--reinspect-menu-border:oklch(54% .022 252/.55);--reinspect-menu-border-strong:oklch(63% .022 252/.72);--reinspect-menu-border-subtle:oklch(48% .018 252/.52);--reinspect-focus-ring:color-mix(in oklch, var(--reinspect-brand-400) 82%, black);--reinspect-runtime-soft-mix:28%;--reinspect-runtime-border-mix:48%;--reinspect-runtime-strong-mix:74%;--reinspect-runtime-border-base:var(--reinspect-menu-border);--reinspect-runtime-strong-base:var(--reinspect-menu-text);--reinspect-overlay-backdrop:oklch(14.5% .01 248/.58);--reinspect-shadow-popover:0 28px 44px -18px oklch(11% .01 248/.68), 0 10px 20px -12px oklch(11% .01 248/.58);--reinspect-shadow-modal:0 24px 28px -12px oklch(11% .01 248/.62), 0 10px 16px -10px oklch(11% .01 248/.54);--reinspect-interactive-bg:oklch(25.8% .023 252);--reinspect-interactive-bg-hover:oklch(31% .03 252);--reinspect-interactive-bg-active:color-mix(in oklch, var(--reinspect-brand-500) 42%, var(--reinspect-menu-surface-stronger));--reinspect-interactive-border:var(--reinspect-menu-border-strong);--reinspect-interactive-border-hover:var(--reinspect-brand-400);--reinspect-interactive-border-active:var(--reinspect-brand-400);--reinspect-interactive-text:var(--reinspect-menu-text);--reinspect-interactive-text-active:oklch(96.6% .014 252);--reinspect-prism-bg:color-mix(in oklch, var(--reinspect-menu-surface) 88%, black);--reinspect-prism-text:var(--reinspect-menu-text);--reinspect-prism-comment:color-mix(in oklch, var(--reinspect-menu-text-soft) 82%, white);--reinspect-prism-keyword:var(--reinspect-brand-400);--reinspect-prism-string:color-mix(in oklch, var(--reinspect-semantic-warning) 56%, var(--reinspect-menu-text));--reinspect-prism-number:color-mix(in oklch, var(--reinspect-semantic-success) 62%, var(--reinspect-menu-text));--reinspect-prism-boolean:var(--reinspect-prism-keyword);--reinspect-prism-function:color-mix(in oklch, var(--reinspect-semantic-warning) 64%, var(--reinspect-menu-text));--reinspect-prism-property:color-mix(in oklch, var(--reinspect-brand-400) 70%, var(--reinspect-menu-text));--reinspect-prism-operator:var(--reinspect-menu-text);--reinspect-prism-punctuation:var(--reinspect-menu-text);--reinspect-prism-constant:color-mix(in oklch, var(--reinspect-brand-400) 84%, var(--reinspect-menu-text))}.reinspect-shell,.reinspect-menu{--reinspect-runtime-color:var(--reinspect-color,var(--reinspect-brand-500));--reinspect-runtime-soft:color-mix(in oklch, var(--reinspect-runtime-color) var(--reinspect-runtime-soft-mix), var(--reinspect-menu-surface));--reinspect-runtime-border:color-mix(in oklch, var(--reinspect-runtime-color) var(--reinspect-runtime-border-mix), var(--reinspect-runtime-border-base));--reinspect-runtime-strong:color-mix(in oklch, var(--reinspect-runtime-color) var(--reinspect-runtime-strong-mix), var(--reinspect-runtime-strong-base))}.reinspect-menu,.reinspect-settings-menu,.reinspect-modal,.reinspect-floating-toggle{font-family:var(--reinspect-font-sans)}.reinspect-menu,.reinspect-settings-menu,.reinspect-modal{color:var(--reinspect-menu-text)}.reinspect-menu[data-reinspect-theme=light],.reinspect-settings-menu[data-reinspect-theme=light],.reinspect-modal-backdrop[data-reinspect-theme=light],.reinspect-modal[data-reinspect-theme=light],.reinspect-toast[data-reinspect-theme=light],.reinspect-floating-root[data-reinspect-theme=light],.reinspect-floating-toggle[data-reinspect-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}.reinspect-menu[data-reinspect-theme=dark],.reinspect-settings-menu[data-reinspect-theme=dark],.reinspect-modal-backdrop[data-reinspect-theme=dark],.reinspect-modal[data-reinspect-theme=dark],.reinspect-toast[data-reinspect-theme=dark],.reinspect-floating-root[data-reinspect-theme=dark],.reinspect-floating-toggle[data-reinspect-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}.reinspect-shell{will-change:box-shadow;border-radius:14px;transition:box-shadow .18s ease-out,filter .18s ease-out;position:relative}.reinspect-shell[data-reinspect-active=true]{box-shadow:0 0 0 1px color-mix(in oklch, var(--reinspect-runtime-color) 62%, var(--reinspect-menu-bg)), 0 0 0 4px color-mix(in oklch, var(--reinspect-runtime-color) 16%, transparent), 0 10px 18px -16px color-mix(in oklch, var(--reinspect-runtime-color) 48%, var(--reinspect-menu-text));filter:saturate(1.03)}.reinspect-shell[data-reinspect-active=true]:hover{box-shadow:0 0 0 1px color-mix(in oklch, var(--reinspect-runtime-color) 74%, var(--reinspect-menu-bg)), 0 0 0 5px color-mix(in oklch, var(--reinspect-runtime-color) 22%, transparent), 0 14px 24px -18px color-mix(in oklch, var(--reinspect-runtime-color) 52%, var(--reinspect-menu-text))}.reinspect-shell[data-reinspect-active=true]:focus-within{box-shadow:0 0 0 1px color-mix(in oklch, var(--reinspect-runtime-color) 78%, var(--reinspect-menu-bg)), 0 0 0 2px color-mix(in oklch, var(--reinspect-runtime-color) 34%, transparent), 0 0 0 6px color-mix(in oklch, var(--reinspect-runtime-color) 20%, transparent), 0 16px 28px -20px color-mix(in oklch, var(--reinspect-runtime-color) 52%, var(--reinspect-menu-text))}.reinspect-content{border-radius:inherit}.reinspect-name-badge{z-index:calc(var(--reinspect-z-base) + 5);letter-spacing:.04em;color:var(--reinspect-runtime-strong);background:var(--reinspect-runtime-soft);border:1px solid var(--reinspect-runtime-border);opacity:.9;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);pointer-events:none;white-space:nowrap;border-radius:999px;padding:4px 8px;font-size:11px;line-height:1;position:absolute;top:-13px;left:10px;box-shadow:0 8px 16px -14px oklch(25.5% .02 248/.45)}.reinspect-menu{z-index:2147483647;border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);width:min(560px,100vw - 24px);max-height:min(620px,82vh);box-shadow:var(--reinspect-shadow-popover);overscroll-behavior:contain;border-radius:16px;gap:10px;padding:12px;display:grid;position:fixed;overflow:auto}.reinspect-menu-title{color:var(--reinspect-menu-text);letter-spacing:-.014em;margin:0;font-size:19px;font-weight:760;line-height:1.1}.reinspect-menu-title-row{align-items:center;gap:8px;min-width:0;display:inline-flex}.reinspect-menu-title-color-chip{border:1px solid color-mix(in oklab, var(--reinspect-color) 65%, black 35%);background:var(--reinspect-color);border-radius:3px;flex:none;width:10px;height:10px}.reinspect-menu-title-wrap{gap:3px;min-width:0;display:grid}.reinspect-menu-subtitle{color:var(--reinspect-menu-text-soft);margin:0;font-size:12px;font-weight:560;line-height:1.2}.reinspect-menu-header{grid-template-columns:1fr auto;align-items:start;gap:10px;display:grid}.reinspect-menu-close{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-surface);width:32px;height:32px;color:var(--reinspect-menu-text);cursor:pointer;border-radius:10px;place-items:center;padding:0;font-size:20px;line-height:1;display:grid}.reinspect-menu-close:hover{background:var(--reinspect-menu-surface-strong);border-color:var(--reinspect-menu-border-strong)}.reinspect-menu-close:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-setting-note{color:var(--reinspect-menu-text-muted);margin:0 0 10px;font-size:12px}.reinspect-setting-helper-text{color:var(--reinspect-menu-text-muted);margin:0;font-size:12px;line-height:1.4}.reinspect-submenu{border:1px solid var(--reinspect-menu-border-subtle);background:var(--reinspect-menu-surface);isolation:isolate;border-radius:11px;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:4px;display:grid;overflow:hidden}.reinspect-submenu button{border:1px solid var(--reinspect-interactive-border);background:var(--reinspect-interactive-bg);color:var(--reinspect-interactive-text);cursor:pointer;white-space:nowrap;opacity:1;border-radius:8px;padding:7px 8px;font-size:12px;font-weight:640;transition:opacity .14s ease-out,transform .14s ease-out,box-shadow .14s ease-out,border-color .14s ease-out,background-color .14s ease-out}.reinspect-submenu button:hover{border-color:var(--reinspect-interactive-border-hover);background:var(--reinspect-interactive-bg-hover)}.reinspect-submenu button[data-state=active]{border-color:var(--reinspect-interactive-border-active);background:var(--reinspect-interactive-bg-active);color:var(--reinspect-interactive-text-active);box-shadow:0 0 0 1px color-mix(in oklch, var(--reinspect-brand-500) 35%, transparent), 0 8px 14px -14px oklch(25.5% .02 248/.38);z-index:1;transform:translateY(-1px)}.reinspect-submenu button:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:0}@media (prefers-reduced-motion:reduce){.reinspect-shell,.reinspect-submenu button,.reinspect-menu-action-card{transition:none}.reinspect-menu-action-card[data-state=active]:after{animation:none}}.reinspect-menu-shortcuts{gap:8px;margin-bottom:0;display:grid}.reinspect-menu-action-card{border:1px solid var(--reinspect-interactive-border);background:var(--reinspect-interactive-bg);color:var(--reinspect-interactive-text);text-align:left;cursor:pointer;border-radius:12px;gap:4px;padding:9px 10px;font-size:12px;transition:border-color .12s,box-shadow .12s,background-color .12s,transform .12s;display:grid;position:relative}.reinspect-menu-action-card:hover{border-color:var(--reinspect-interactive-border-hover);background:var(--reinspect-interactive-bg-hover);box-shadow:0 1px oklch(25.5% .02 248/.08)}.reinspect-menu-action-card:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-menu-action-card[data-state=active]{border-color:var(--reinspect-interactive-border-active);background:var(--reinspect-interactive-bg-active);color:var(--reinspect-interactive-text-active);box-shadow:0 0 0 1px color-mix(in oklch, var(--reinspect-brand-500) 40%, transparent), 0 8px 18px -14px oklch(25.5% .02 248/.35);transform:translateY(-1px)}.reinspect-menu-action-card[data-state=active]:after{content:\"Selected\";border:1px solid var(--reinspect-interactive-border-active);background:color-mix(in oklch, var(--reinspect-brand-500) 20%, var(--reinspect-menu-surface));color:var(--reinspect-interactive-text-active);letter-spacing:.01em;border-radius:999px;padding:2px 6px;font-size:9px;font-weight:700;line-height:1;animation:.56s cubic-bezier(.22,1,.36,1) reinspect-selected-pulse;position:absolute;top:8px;right:10px}@keyframes reinspect-selected-pulse{0%{opacity:.72;transform:scale(.92)}to{opacity:1;transform:scale(1)}}.reinspect-menu-action-title{font-weight:700}.reinspect-menu-action-description{color:var(--reinspect-menu-text-muted);font-size:11px;line-height:1.35}.reinspect-menu-action-target{font-family:var(--reinspect-font-mono);color:var(--reinspect-menu-text-muted);white-space:normal;word-break:break-word;font-size:11px}.reinspect-general-panel{gap:10px;display:grid}.reinspect-general-panel .reinspect-setting-note{margin:0}.reinspect-menu-section{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);border-radius:12px;gap:7px;padding:10px;display:grid}.reinspect-menu-section-header,.reinspect-menu-panel-header{grid-template-columns:1fr auto;align-items:center;gap:8px;display:grid}.reinspect-menu-section-title{color:var(--reinspect-menu-text);letter-spacing:.01em;margin:0;font-size:13px;font-weight:700}.reinspect-menu-section-description{color:var(--reinspect-menu-text-muted);margin:0;font-size:12px;line-height:1.4}.reinspect-menu-section-caption{color:var(--reinspect-menu-text-muted);font-family:var(--reinspect-font-mono);margin:0;font-size:10px}.reinspect-menu-switch{justify-self:end}.reinspect-menu-switch:disabled{opacity:.7;cursor:default}.reinspect-menu-divider{background:var(--reinspect-menu-border);height:1px}.reinspect-menu-inline-setting{grid-template-columns:1fr auto;align-items:center;gap:8px;display:grid}.reinspect-menu-inline-copy{gap:2px;display:grid}.reinspect-menu-inline-title{color:var(--reinspect-menu-text);margin:0;font-size:12px;font-weight:700}.reinspect-menu-inline-description{color:var(--reinspect-menu-text-muted);margin:0;font-size:12px;line-height:1.35}.reinspect-css-panel{gap:9px;display:grid}.reinspect-menu-grid{gap:8px;display:grid}.reinspect-menu-filter{align-items:center;display:grid;position:relative}.reinspect-menu-filter-icon{color:var(--reinspect-menu-text-soft);pointer-events:none;width:14px;height:14px;position:absolute;top:50%;left:9px;transform:translateY(-50%)}.reinspect-menu-filter-icon svg{width:100%;height:100%;display:block}.reinspect-menu-filter input{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);width:100%;color:var(--reinspect-menu-text);border-radius:10px;padding:7px 52px 7px 30px;font-size:12px}.reinspect-menu-filter input::placeholder,.reinspect-filter-search-input::placeholder{color:var(--reinspect-menu-text-soft);opacity:1}.reinspect-menu-filter input:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:0}.reinspect-menu-filter-clear{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-surface);color:var(--reinspect-menu-text);cursor:pointer;border-radius:7px;padding:4px 6px;font-size:10px;font-weight:600;line-height:1;position:absolute;right:6px}.reinspect-menu-filter-clear:hover{border-color:var(--reinspect-brand-400);background:var(--reinspect-brand-soft)}.reinspect-menu-filter-clear:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-menu-empty-state{border:1px dashed var(--reinspect-menu-border);background:var(--reinspect-brand-soft);color:var(--reinspect-menu-text-muted);border-radius:10px;margin:0;padding:8px 10px;font-size:11px}.reinspect-field{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);border-radius:10px;gap:5px;padding:8px;display:grid}.reinspect-field label{color:var(--reinspect-menu-text);font-size:11px;font-weight:640}.reinspect-inline-controls{grid-template-columns:1fr auto;gap:6px;display:grid}.reinspect-inline-controls input,.reinspect-inline-controls button,.reinspect-inline-controls output{font-size:12px}.reinspect-inline-controls input[type=number],.reinspect-inline-controls input[type=text]{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);width:100%;color:var(--reinspect-menu-text);border-radius:8px;padding:6px 8px}.reinspect-inline-controls input[type=color]{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);border-radius:8px;width:100%;min-height:32px;padding:2px}.reinspect-inline-controls input[type=range]{width:100%}.reinspect-inline-controls input:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:0}.reinspect-inline-controls button{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-surface);color:var(--reinspect-menu-text);cursor:pointer;border-radius:8px;padding:6px 8px;font-weight:600}.reinspect-inline-controls button:hover{border-color:var(--reinspect-brand-400);background:var(--reinspect-brand-soft-strong)}.reinspect-inline-controls button:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-inline-controls button:disabled{opacity:.45;cursor:default}.reinspect-opacity-controls{grid-template-columns:1fr auto auto;align-items:center}.reinspect-opacity-controls output{color:var(--reinspect-menu-text);text-align:right;min-width:36px}.reinspect-props-panel{gap:6px;display:grid}.reinspect-props-submenu{border:1px solid var(--reinspect-menu-border-subtle);background:var(--reinspect-menu-surface);border-radius:10px;grid-template-columns:1fr 1fr;gap:4px;padding:3px;display:grid}.reinspect-props-submenu button{border:1px solid var(--reinspect-interactive-border);background:var(--reinspect-interactive-bg);color:var(--reinspect-interactive-text);cursor:pointer;opacity:1;border-radius:7px;padding:5px 8px;font-size:12px;font-weight:600;transition:opacity .12s ease-out,background-color .12s ease-out,border-color .12s ease-out}.reinspect-props-submenu button:hover{border-color:var(--reinspect-interactive-border-hover);background:var(--reinspect-interactive-bg-hover)}.reinspect-props-submenu button[data-state=active]{border-color:var(--reinspect-interactive-border-active);background:var(--reinspect-interactive-bg-active);color:var(--reinspect-interactive-text-active)}.reinspect-props-submenu button:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:0}.reinspect-props-panel label{color:var(--reinspect-menu-text-muted);font-size:12px}.reinspect-props-table{border:1px solid var(--reinspect-menu-border-subtle);background:var(--reinspect-menu-bg);border-radius:10px;display:grid;overflow:hidden}.reinspect-props-row{grid-template-columns:minmax(90px,.55fr) minmax(0,1.45fr);align-items:start;gap:10px;padding:8px 9px;display:grid}.reinspect-props-row+.reinspect-props-row{border-top:1px solid var(--reinspect-menu-border-subtle)}.reinspect-prop-key{color:var(--reinspect-menu-text);word-break:break-word;font-size:12px;font-weight:600}.reinspect-prop-cell{gap:4px;min-width:0;display:grid}.reinspect-prop-main{grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:8px;display:grid}.reinspect-prop-value-render{min-width:0}.reinspect-prop-cell code{font-size:11px;font-family:var(--reinspect-font-mono);color:var(--reinspect-menu-text);word-break:normal;overflow-wrap:break-word}.reinspect-prop-missing{color:var(--reinspect-menu-text-soft);font-size:11px}.reinspect-prop-scalar{gap:3px;display:grid}.reinspect-prop-actions{flex-wrap:nowrap;justify-content:flex-end;align-items:center;gap:4px;margin-top:0;display:flex}.reinspect-prop-scalar button,.reinspect-prop-function button,.reinspect-prop-tree summary button{color:var(--reinspect-menu-text-muted);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-self:start;padding:2px 4px;font-size:11px;font-weight:600}.reinspect-prop-action-text-button{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-brand-soft);color:var(--reinspect-brand-700);letter-spacing:.01em;cursor:pointer;white-space:nowrap;border-radius:6px;padding:2px 6px;font-size:10px;font-weight:700;line-height:1.4}.reinspect-prop-action-text-button:hover{border-color:var(--reinspect-brand-400);background:var(--reinspect-brand-soft-strong);color:var(--reinspect-brand-700)}.reinspect-prop-action-text-button:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-prop-actions button,.reinspect-prop-json-preview button{color:var(--reinspect-menu-text-muted);cursor:pointer;background:0 0;border:none;border-radius:6px;padding:2px 4px;font-size:11px;font-weight:600}.reinspect-icon-button{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-brand-soft);width:24px;height:24px;color:var(--reinspect-brand-700);cursor:pointer;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.reinspect-icon-button svg{width:14px;height:14px;display:block}.reinspect-prop-scalar button:hover,.reinspect-prop-function button:hover,.reinspect-prop-tree summary button:hover,.reinspect-prop-actions button:hover,.reinspect-prop-json-preview button:hover{background:var(--reinspect-brand-soft);color:var(--reinspect-brand-700)}.reinspect-icon-button:hover{border-color:var(--reinspect-brand-400);background:var(--reinspect-brand-soft-strong)}.reinspect-prop-scalar button:focus-visible,.reinspect-prop-function button:focus-visible,.reinspect-prop-tree summary button:focus-visible,.reinspect-prop-actions button:focus-visible,.reinspect-prop-json-preview button:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-icon-button:disabled{opacity:.45;cursor:default}.reinspect-prop-tree{border:1px solid var(--reinspect-menu-border-subtle);background:var(--reinspect-brand-soft);border-radius:8px;padding:5px}.reinspect-prop-tree summary{cursor:pointer;color:var(--reinspect-menu-text);justify-content:space-between;align-items:center;gap:8px;font-size:11px;display:flex}.reinspect-prop-tree-children{gap:6px;margin-top:6px;display:grid}.reinspect-prop-tree-row{grid-template-columns:.8fr 1.2fr;align-items:start;gap:6px;display:grid}.reinspect-prop-tree-row>code{font-size:10px;font-family:var(--reinspect-font-mono);color:var(--reinspect-menu-text-muted);word-break:break-word}.reinspect-prop-function{gap:4px;display:grid}.reinspect-prop-function pre{border:1px solid var(--reinspect-menu-border-subtle);background:var(--reinspect-prism-bg);white-space:pre-wrap;word-break:break-word;border-radius:8px;margin:0;padding:6px;font-size:11px;line-height:1.3}.reinspect-prop-json-preview{gap:6px;margin-top:6px;display:grid}.reinspect-json-editor{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-prism-bg);border-radius:8px;display:grid;overflow:hidden}.reinspect-json-editor pre,.reinspect-json-editor textarea{font-size:12px;line-height:1.4;font-family:var(--reinspect-font-mono);white-space:pre;word-break:normal;grid-area:1/1;margin:0;padding:8px}.reinspect-json-editor pre{pointer-events:none;overflow:auto}.reinspect-props-panel .reinspect-json-editor .reinspect-json-editor-textarea{color:#0000;width:100%;caret-color:var(--reinspect-prism-text);resize:vertical;tab-size:2;background:0 0;border:none;border-radius:0;overflow:auto}.reinspect-props-panel .reinspect-json-editor .reinspect-json-editor-textarea:focus-visible{outline:none}.reinspect-json-editor:focus-within{box-shadow:0 0 0 2px var(--reinspect-focus-ring)}.reinspect-prop-json-preview pre{border:1px solid var(--reinspect-menu-border-subtle);background:var(--reinspect-prism-bg);white-space:pre-wrap;word-break:break-word;border-radius:8px;max-height:180px;margin:0;padding:6px;font-size:11px;line-height:1.3;overflow:auto}.reinspect-prop-function pre code.reinspect-code-block,.reinspect-prop-json-preview pre code.reinspect-code-block,.reinspect-json-editor pre code.reinspect-code-block{color:var(--reinspect-prism-text);font-family:var(--reinspect-font-mono);white-space:inherit;word-break:inherit;display:block}.reinspect-prop-function pre code.reinspect-code-block .token.comment,.reinspect-prop-function pre code.reinspect-code-block .token.prolog,.reinspect-prop-function pre code.reinspect-code-block .token.doctype,.reinspect-prop-function pre code.reinspect-code-block .token.cdata,.reinspect-prop-json-preview pre code.reinspect-code-block .token.comment,.reinspect-prop-json-preview pre code.reinspect-code-block .token.prolog,.reinspect-prop-json-preview pre code.reinspect-code-block .token.doctype,.reinspect-prop-json-preview pre code.reinspect-code-block .token.cdata,.reinspect-json-editor pre code.reinspect-code-block .token.comment,.reinspect-json-editor pre code.reinspect-code-block .token.prolog,.reinspect-json-editor pre code.reinspect-code-block .token.doctype,.reinspect-json-editor pre code.reinspect-code-block .token.cdata{color:var(--reinspect-prism-comment);font-style:italic}.reinspect-prop-function pre code.reinspect-code-block .token.punctuation,.reinspect-prop-json-preview pre code.reinspect-code-block .token.punctuation,.reinspect-json-editor pre code.reinspect-code-block .token.punctuation{color:var(--reinspect-prism-punctuation)}.reinspect-prop-function pre code.reinspect-code-block .token.property,.reinspect-prop-json-preview pre code.reinspect-code-block .token.property,.reinspect-json-editor pre code.reinspect-code-block .token.property{color:var(--reinspect-prism-property)}.reinspect-prop-function pre code.reinspect-code-block .token.string,.reinspect-prop-json-preview pre code.reinspect-code-block .token.string,.reinspect-prop-function pre code.reinspect-code-block .token.char,.reinspect-prop-json-preview pre code.reinspect-code-block .token.char,.reinspect-prop-function pre code.reinspect-code-block .token.regex,.reinspect-prop-json-preview pre code.reinspect-code-block .token.regex,.reinspect-json-editor pre code.reinspect-code-block .token.string,.reinspect-json-editor pre code.reinspect-code-block .token.char,.reinspect-json-editor pre code.reinspect-code-block .token.regex{color:var(--reinspect-prism-string)}.reinspect-prop-function pre code.reinspect-code-block .token.number,.reinspect-prop-json-preview pre code.reinspect-code-block .token.number,.reinspect-json-editor pre code.reinspect-code-block .token.number{color:var(--reinspect-prism-number)}.reinspect-prop-function pre code.reinspect-code-block .token.boolean,.reinspect-prop-json-preview pre code.reinspect-code-block .token.boolean,.reinspect-json-editor pre code.reinspect-code-block .token.boolean{color:var(--reinspect-prism-boolean)}.reinspect-prop-function pre code.reinspect-code-block .token.keyword,.reinspect-prop-json-preview pre code.reinspect-code-block .token.keyword,.reinspect-json-editor pre code.reinspect-code-block .token.keyword{color:var(--reinspect-prism-keyword)}.reinspect-prop-function pre code.reinspect-code-block .token.function,.reinspect-prop-json-preview pre code.reinspect-code-block .token.function,.reinspect-prop-function pre code.reinspect-code-block .token.function-variable,.reinspect-prop-json-preview pre code.reinspect-code-block .token.function-variable,.reinspect-json-editor pre code.reinspect-code-block .token.function,.reinspect-json-editor pre code.reinspect-code-block .token.function-variable{color:var(--reinspect-prism-function)}.reinspect-prop-function pre code.reinspect-code-block .token.operator,.reinspect-prop-json-preview pre code.reinspect-code-block .token.operator,.reinspect-json-editor pre code.reinspect-code-block .token.operator{color:var(--reinspect-prism-operator)}.reinspect-prop-function pre code.reinspect-code-block .token.constant,.reinspect-prop-json-preview pre code.reinspect-code-block .token.constant,.reinspect-json-editor pre code.reinspect-code-block .token.constant{color:var(--reinspect-prism-constant)}@media (width<=520px){.reinspect-props-row{grid-template-columns:1fr;gap:4px}.reinspect-prop-main{grid-template-columns:1fr;gap:6px}.reinspect-prop-actions{flex-wrap:wrap;justify-content:flex-start}}.reinspect-modal-backdrop{z-index:2147483647;background:var(--reinspect-overlay-backdrop);place-items:center;padding:20px;display:grid;position:fixed;inset:0}.reinspect-modal{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);width:min(560px,100%);box-shadow:var(--reinspect-shadow-modal);border-radius:12px;gap:8px;padding:12px;display:grid}.reinspect-modal textarea,.reinspect-props-panel textarea{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);width:100%;color:var(--reinspect-menu-text);font-size:12px;font-family:var(--reinspect-font-mono);resize:vertical;border-radius:8px;padding:8px}.reinspect-modal textarea::placeholder,.reinspect-props-panel textarea::placeholder{color:var(--reinspect-menu-text-soft);opacity:1}.reinspect-toast{z-index:2147483647;border:1px solid var(--reinspect-menu-border-strong);background:color-mix(in oklch, var(--reinspect-menu-bg) 88%, var(--reinspect-brand-500));width:min(460px,100vw - 20px);box-shadow:var(--reinspect-shadow-modal);border-radius:12px;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:10px 12px;display:grid;position:fixed;bottom:20px;left:50%;transform:translate(-50%)}.reinspect-toast-copy{gap:3px;display:grid}.reinspect-toast-title{color:var(--reinspect-menu-text);margin:0;font-size:12px;font-weight:700}.reinspect-toast-description{color:var(--reinspect-menu-text-muted);margin:0;font-size:11px}.reinspect-toast-undo,.reinspect-toast-dismiss{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);color:var(--reinspect-menu-text);cursor:pointer;border-radius:8px}.reinspect-toast-undo{padding:6px 10px;font-size:11px;font-weight:700}.reinspect-toast-dismiss{place-items:center;width:28px;height:28px;padding:0;font-size:16px;line-height:1;display:grid}.reinspect-toast-undo:hover,.reinspect-toast-dismiss:hover{border-color:var(--reinspect-brand-400);background:var(--reinspect-brand-soft)}.reinspect-toast-undo:focus-visible,.reinspect-toast-dismiss:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-error{color:var(--reinspect-semantic-error);margin:0;font-size:12px}.reinspect-floating-toggle{z-index:2147483647;border:1px solid color-mix(in oklch, var(--reinspect-brand-500) 56%, var(--reinspect-menu-border-strong));background:var(--reinspect-brand-soft);color:var(--reinspect-interactive-text-active);letter-spacing:.03em;cursor:pointer;border-radius:999px;padding:10px 15px;font-size:13px;font-weight:650;transition:background-color .14s,border-color .14s,box-shadow .14s;position:fixed;bottom:18px;right:18px;box-shadow:0 10px 18px -12px oklch(25.5% .02 248/.4),0 2px 8px -6px oklch(25.5% .02 248/.34)}.reinspect-floating-toggle:hover{background:var(--reinspect-brand-soft-hover);border-color:var(--reinspect-brand-500)}.reinspect-floating-toggle:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:2px}.reinspect-floating-root{z-index:2147483645;position:fixed;bottom:18px;right:18px}.reinspect-floating-root .reinspect-floating-toggle{position:static}.reinspect-settings-menu{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);width:min(420px,100vw - 22px);max-height:min(560px,78vh);box-shadow:var(--reinspect-shadow-modal);border-radius:12px;gap:8px;padding:10px;display:grid;position:absolute;bottom:calc(100% + 10px);right:0;overflow:auto}.reinspect-settings-header-row{grid-template-columns:1fr auto;align-items:center;gap:8px;display:grid}.reinspect-settings-title{color:var(--reinspect-menu-text);margin:0;font-size:14px;font-weight:760}.reinspect-settings-tabs{grid-template-columns:1fr 1fr;gap:6px;display:grid}.reinspect-settings-tabs button{border:1px solid var(--reinspect-interactive-border);background:var(--reinspect-interactive-bg);color:var(--reinspect-interactive-text);cursor:pointer;border-radius:8px;padding:6px 8px;font-size:12px;font-weight:600;transition:border-color .12s ease-out,background-color .12s ease-out,color .12s ease-out}.reinspect-settings-tabs button:hover{border-color:var(--reinspect-interactive-border-hover);background:var(--reinspect-interactive-bg-hover)}.reinspect-settings-tabs button[data-state=active]{border-color:var(--reinspect-interactive-border-active);background:var(--reinspect-interactive-bg-active);color:var(--reinspect-interactive-text-active)}.reinspect-settings-tab-panel{gap:9px;display:grid}.reinspect-settings-toggle-row{color:var(--reinspect-menu-text);grid-template-columns:1fr auto;align-items:center;gap:8px;font-size:12px;display:grid}.reinspect-settings-select-row{gap:5px;font-size:12px;display:grid}.reinspect-settings-select-row select{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);width:100%;color:var(--reinspect-menu-text);border-radius:8px;padding:6px 8px;font-size:12px}.reinspect-settings-toggle-label{font-weight:600;line-height:1.35}.reinspect-settings-inline-switch{grid-template-columns:1fr auto;align-items:center;gap:8px;margin:0;display:grid}.reinspect-settings-toggle-row input[type=checkbox]{width:16px;height:16px}.reinspect-inline-hint{border:1px solid var(--reinspect-menu-border);width:14px;height:14px;color:var(--reinspect-menu-text-soft);vertical-align:text-top;cursor:help;border-radius:999px;justify-content:center;align-items:center;font-size:10px;font-weight:700;display:inline-flex}.reinspect-settings-divider{background:var(--reinspect-menu-border-subtle);height:1px}.reinspect-setting-block{gap:6px;display:grid}.reinspect-macro-setting{border:1px solid var(--reinspect-menu-border-subtle);background:var(--reinspect-menu-surface);border-radius:8px;padding:8px}.reinspect-macro-setting .reinspect-setting-note{margin:0}.reinspect-macro-setting .reinspect-setting-note code{font-family:var(--reinspect-font-mono);font-size:11px}.reinspect-macro-setting .reinspect-inline-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.reinspect-macro-setting .reinspect-inline-controls button[data-state=active]{border-color:var(--reinspect-brand-600);background:var(--reinspect-brand-soft-strong);color:var(--reinspect-brand-700)}.reinspect-apply-button{border:1px solid var(--reinspect-brand-500);background:var(--reinspect-brand-500);color:var(--reinspect-on-brand);cursor:pointer;border-radius:8px;padding:6px 8px;font-size:12px;font-weight:600}.reinspect-apply-button:hover:not(:disabled){border-color:var(--reinspect-brand-600);background:var(--reinspect-brand-600)}.reinspect-apply-button:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-apply-button:disabled{opacity:.4;cursor:default}.reinspect-filter-title{color:var(--reinspect-menu-text);margin:0;font-size:12px;font-weight:600}.reinspect-setting-empty-state{color:var(--reinspect-menu-text-muted);margin:0;font-size:12px}.reinspect-inspect-mode-actions{grid-template-columns:auto 1fr;align-items:center;gap:8px;display:grid}.reinspect-filter-section{border-top:1px solid var(--reinspect-menu-border-subtle);gap:6px;padding-top:8px;display:grid}.reinspect-filter-row-header{grid-template-columns:1fr auto;align-items:center;gap:6px;display:grid}.reinspect-filter-toolbar{grid-template-columns:1fr auto auto auto auto;align-items:center;gap:6px;display:grid;position:relative}.reinspect-filter-search-icon{width:14px;height:14px;color:var(--reinspect-menu-text-soft);pointer-events:none;position:absolute;top:50%;left:10px;transform:translateY(-50%)}.reinspect-filter-search-icon svg{width:100%;height:100%;display:block}.reinspect-filter-search-input{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);width:100%;color:var(--reinspect-menu-text);font-size:12px;font-family:var(--reinspect-font-mono);border-radius:8px;padding:5px 8px 5px 31px}.reinspect-filter-search-input:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:0}.reinspect-filter-add-button{border:1px solid var(--reinspect-brand-500);background:var(--reinspect-brand-500);color:var(--reinspect-on-brand);cursor:pointer;border-radius:8px;padding:5px 10px;font-size:11px}.reinspect-filter-add-button:hover:not(:disabled){border-color:var(--reinspect-brand-600);background:var(--reinspect-brand-600)}.reinspect-filter-add-button:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-filter-add-button:disabled{opacity:.4;cursor:default}.reinspect-filter-modifier{border:1px solid var(--reinspect-interactive-border);background:var(--reinspect-interactive-bg);color:var(--reinspect-interactive-text);cursor:pointer;border-radius:8px;justify-content:center;align-items:center;gap:3px;padding:5px 7px;font-size:11px;font-weight:600;display:inline-flex}.reinspect-filter-modifier:hover{border-color:var(--reinspect-interactive-border-hover);background:var(--reinspect-interactive-bg-hover)}.reinspect-filter-modifier[data-state=active]{border-color:var(--reinspect-interactive-border-active);background:var(--reinspect-interactive-bg-active);color:var(--reinspect-interactive-text-active)}.reinspect-filter-chip-list{flex-wrap:wrap;gap:6px;display:flex}.reinspect-filter-chip{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);color:var(--reinspect-menu-text);border-radius:999px;align-items:center;gap:4px;padding:2px 7px;font-size:11px;display:inline-flex}.reinspect-filter-chip code{font-family:var(--reinspect-font-mono);font-size:11px}.reinspect-filter-chip-remove{color:var(--reinspect-menu-text-soft);cursor:pointer;background:0 0;border:none;padding:0;font-size:14px;line-height:1}.reinspect-filter-clear-button{border:1px solid var(--reinspect-menu-border);background:var(--reinspect-menu-bg);color:var(--reinspect-menu-text);cursor:pointer;border-radius:8px;padding:2px 7px;font-size:11px}.reinspect-filter-clear-button:disabled{opacity:.45;cursor:default}.reinspect-switch-button{border:1px solid var(--reinspect-menu-border-strong);background:var(--reinspect-menu-surface-stronger);cursor:pointer;border-radius:999px;width:34px;height:20px;padding:0;transition:background-color .12s,border-color .12s;display:inline-block;position:relative}.reinspect-switch-button:after{content:\"\";background:var(--reinspect-menu-bg);border-radius:999px;width:16px;height:16px;transition:transform .12s;position:absolute;top:2px;left:2px;box-shadow:0 1px 2px oklch(25.5% .02 248/.2)}.reinspect-switch-button[data-state=on]{background:var(--reinspect-brand-500);border-color:var(--reinspect-brand-600)}.reinspect-switch-button[data-state=on]:after{transform:translate(14px)}.reinspect-switch-button:focus-visible{outline:2px solid var(--reinspect-focus-ring);outline-offset:1px}.reinspect-component-settings-list{gap:6px;display:grid}.reinspect-component-setting-row{border:1px solid var(--reinspect-menu-border-subtle);background:var(--reinspect-menu-surface);color:var(--reinspect-menu-text);border-radius:8px;grid-template-columns:1fr auto;align-items:center;gap:8px;padding:6px 8px;font-size:12px;display:grid}.reinspect-component-setting-row input[type=checkbox]{width:15px;height:15px}", A = "reinspect-runtime-styles";
|
|
7
|
+
function j() {
|
|
8
8
|
return typeof document > "u" ? null : document;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function M(e) {
|
|
11
11
|
if (!e) return;
|
|
12
|
-
let t =
|
|
13
|
-
if (!t || t.getElementById(
|
|
12
|
+
let t = j();
|
|
13
|
+
if (!t || t.getElementById(A)) return;
|
|
14
14
|
let n = t.createElement("style");
|
|
15
|
-
n.id =
|
|
15
|
+
n.id = A, n.textContent = e, (t.head ?? t.documentElement).appendChild(n);
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
|
-
//#region src/reinspect/
|
|
19
|
-
|
|
18
|
+
//#region src/reinspect/core/state.ts
|
|
19
|
+
function N(e) {
|
|
20
|
+
let t = {};
|
|
21
|
+
for (let n of e) t[n] = !0;
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
function P(e) {
|
|
25
|
+
return {
|
|
26
|
+
isActive: e.startActive,
|
|
27
|
+
inspectMode: e.inspectMode,
|
|
28
|
+
pendingInspectMode: e.inspectMode,
|
|
29
|
+
inspectWhitelist: e.inspectWhitelist,
|
|
30
|
+
inspectBlacklist: e.inspectBlacklist,
|
|
31
|
+
renderCounterMode: e.renderCounters,
|
|
32
|
+
propsSerializationMode: e.propsSerializationMode,
|
|
33
|
+
menuTheme: e.menuTheme,
|
|
34
|
+
menuOpenGesture: e.menuOpenGesture,
|
|
35
|
+
renderCountComponents: N(e.countRendersForComponents),
|
|
36
|
+
overrides: {}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function F(e, t) {
|
|
40
|
+
if (e === t) return !0;
|
|
41
|
+
if (e.length !== t.length) return !1;
|
|
42
|
+
for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
|
|
43
|
+
return !0;
|
|
44
|
+
}
|
|
45
|
+
function I(e, t) {
|
|
46
|
+
return e.regex === t.regex && e.wholeWord === t.wholeWord && e.matchCase === t.matchCase && F(e.patterns, t.patterns);
|
|
47
|
+
}
|
|
48
|
+
function L(e, t) {
|
|
49
|
+
return e.mode === t.mode && e.modifiers.ctrl === t.modifiers.ctrl && e.modifiers.alt === t.modifiers.alt && e.modifiers.shift === t.modifiers.shift && e.modifiers.meta === t.modifiers.meta;
|
|
50
|
+
}
|
|
51
|
+
function R(e, t) {
|
|
52
|
+
switch (t.type) {
|
|
53
|
+
case "hydrate-config": {
|
|
54
|
+
let n = N(t.config.countRendersForComponents), r = {
|
|
55
|
+
...e,
|
|
56
|
+
isActive: t.config.enabled ? e.isActive : !1,
|
|
57
|
+
inspectMode: t.config.inspectMode,
|
|
58
|
+
pendingInspectMode: t.config.inspectMode,
|
|
59
|
+
inspectWhitelist: t.config.inspectWhitelist,
|
|
60
|
+
inspectBlacklist: t.config.inspectBlacklist,
|
|
61
|
+
renderCounterMode: t.config.renderCounters,
|
|
62
|
+
propsSerializationMode: t.config.propsSerializationMode,
|
|
63
|
+
menuTheme: t.config.menuTheme,
|
|
64
|
+
menuOpenGesture: t.config.menuOpenGesture,
|
|
65
|
+
renderCountComponents: n
|
|
66
|
+
};
|
|
67
|
+
return r.isActive === e.isActive && r.inspectMode === e.inspectMode && r.pendingInspectMode === e.pendingInspectMode && I(r.inspectWhitelist, e.inspectWhitelist) && I(r.inspectBlacklist, e.inspectBlacklist) && r.renderCounterMode === e.renderCounterMode && r.propsSerializationMode === e.propsSerializationMode && r.menuTheme === e.menuTheme && L(r.menuOpenGesture, e.menuOpenGesture) && F(Object.keys(r.renderCountComponents), Object.keys(e.renderCountComponents)) ? e : r;
|
|
68
|
+
}
|
|
69
|
+
case "set-is-active": return e.isActive === t.value ? e : {
|
|
70
|
+
...e,
|
|
71
|
+
isActive: t.value
|
|
72
|
+
};
|
|
73
|
+
case "set-pending-inspect-mode": return e.pendingInspectMode === t.value && e.inspectMode === t.value ? e : {
|
|
74
|
+
...e,
|
|
75
|
+
inspectMode: t.value,
|
|
76
|
+
pendingInspectMode: t.value
|
|
77
|
+
};
|
|
78
|
+
case "set-inspect-whitelist": return I(e.inspectWhitelist, t.value) ? e : {
|
|
79
|
+
...e,
|
|
80
|
+
inspectWhitelist: t.value
|
|
81
|
+
};
|
|
82
|
+
case "set-inspect-blacklist": return I(e.inspectBlacklist, t.value) ? e : {
|
|
83
|
+
...e,
|
|
84
|
+
inspectBlacklist: t.value
|
|
85
|
+
};
|
|
86
|
+
case "set-render-counter-mode": return e.renderCounterMode === t.value ? e : {
|
|
87
|
+
...e,
|
|
88
|
+
renderCounterMode: t.value
|
|
89
|
+
};
|
|
90
|
+
case "set-props-serialization-mode": return e.propsSerializationMode === t.value ? e : {
|
|
91
|
+
...e,
|
|
92
|
+
propsSerializationMode: t.value
|
|
93
|
+
};
|
|
94
|
+
case "set-menu-theme": return e.menuTheme === t.value ? e : {
|
|
95
|
+
...e,
|
|
96
|
+
menuTheme: t.value
|
|
97
|
+
};
|
|
98
|
+
case "set-menu-open-gesture": return L(e.menuOpenGesture, t.value) ? e : {
|
|
99
|
+
...e,
|
|
100
|
+
menuOpenGesture: t.value
|
|
101
|
+
};
|
|
102
|
+
case "set-render-counting-for-component": {
|
|
103
|
+
if (t.enabled) return e.renderCountComponents[t.componentName] ? e : {
|
|
104
|
+
...e,
|
|
105
|
+
renderCountComponents: {
|
|
106
|
+
...e.renderCountComponents,
|
|
107
|
+
[t.componentName]: !0
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
if (!e.renderCountComponents[t.componentName]) return e;
|
|
111
|
+
let n = { ...e.renderCountComponents };
|
|
112
|
+
return delete n[t.componentName], {
|
|
113
|
+
...e,
|
|
114
|
+
renderCountComponents: n
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
case "update-override": {
|
|
118
|
+
let n = { ...e.overrides[t.componentId] ?? {} };
|
|
119
|
+
if (t.value === void 0 || t.value === null || t.value === "" ? delete n[t.prop] : n[t.prop] = t.value, Object.keys(n).length === 0) {
|
|
120
|
+
if (!e.overrides[t.componentId]) return e;
|
|
121
|
+
let n = { ...e.overrides };
|
|
122
|
+
return delete n[t.componentId], {
|
|
123
|
+
...e,
|
|
124
|
+
overrides: n
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
...e,
|
|
129
|
+
overrides: {
|
|
130
|
+
...e.overrides,
|
|
131
|
+
[t.componentId]: n
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
default: return e;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
20
138
|
//#endregion
|
|
21
139
|
//#region src/reinspect/useReinspect.ts
|
|
22
|
-
function
|
|
23
|
-
let e =
|
|
140
|
+
function z() {
|
|
141
|
+
let e = x(v);
|
|
24
142
|
if (!e) throw Error("useReinspect must be used within ReinspectProvider");
|
|
25
143
|
return e;
|
|
26
144
|
}
|
|
27
145
|
//#endregion
|
|
28
|
-
//#region src/reinspect/
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
], b = new Set([
|
|
50
|
-
"backgroundColor",
|
|
51
|
-
"color",
|
|
52
|
-
"borderColor"
|
|
53
|
-
]), ee = new Set([
|
|
54
|
-
"fontSize",
|
|
55
|
-
"padding",
|
|
56
|
-
"margin",
|
|
57
|
-
"borderRadius",
|
|
58
|
-
"borderWidth",
|
|
59
|
-
"width",
|
|
60
|
-
"height",
|
|
61
|
-
"gap"
|
|
62
|
-
]), x = 2147483e3, S = "reinspect.inspectMode", C = [
|
|
63
|
-
"wrapped",
|
|
64
|
-
"first-party",
|
|
65
|
-
"all"
|
|
66
|
-
], w = [
|
|
67
|
-
"attempts",
|
|
68
|
-
"commits",
|
|
69
|
-
"both"
|
|
70
|
-
];
|
|
71
|
-
function T() {
|
|
72
|
-
return !1;
|
|
73
|
-
}
|
|
74
|
-
function E(e) {
|
|
75
|
-
return typeof e == "string" && C.includes(e);
|
|
76
|
-
}
|
|
77
|
-
function D(e) {
|
|
78
|
-
return typeof e == "string" && w.includes(e);
|
|
146
|
+
//#region src/reinspect/react/provider.tsx
|
|
147
|
+
var B = /* @__PURE__ */ new Map();
|
|
148
|
+
function V(e) {
|
|
149
|
+
let t = B.get(e);
|
|
150
|
+
if (t !== void 0) return t;
|
|
151
|
+
let n = 0;
|
|
152
|
+
for (let t = 0; t < e.length; t += 1) n = Math.imul(31, n) + e.charCodeAt(t), n |= 0;
|
|
153
|
+
let r = n >>> 0;
|
|
154
|
+
return B.set(e, r), r;
|
|
155
|
+
}
|
|
156
|
+
function H(e) {
|
|
157
|
+
let t = V(e);
|
|
158
|
+
return `hsl(${t % 360} ${60 + (t >>> 8) % 14}% ${52 + (t >>> 16) % 8}%)`;
|
|
159
|
+
}
|
|
160
|
+
function U({ label: e, description: t }) {
|
|
161
|
+
return /* @__PURE__ */ D("span", {
|
|
162
|
+
className: "reinspect-inline-hint",
|
|
163
|
+
title: t,
|
|
164
|
+
"aria-label": t,
|
|
165
|
+
children: e
|
|
166
|
+
});
|
|
79
167
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
82
|
-
let e = window.sessionStorage.getItem(S);
|
|
83
|
-
return E(e) ? e : void 0;
|
|
84
|
-
} catch {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
168
|
+
function W(e) {
|
|
169
|
+
return e.split(/[\r\n,]+/g).map((e) => e.trim()).filter((e) => e.length > 0);
|
|
87
170
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
171
|
+
function G(e, t) {
|
|
172
|
+
let n = [...e], r = new Set(e);
|
|
173
|
+
for (let e of t) r.has(e) || (r.add(e), n.push(e));
|
|
174
|
+
return n;
|
|
90
175
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
} catch {}
|
|
176
|
+
function K(e) {
|
|
177
|
+
let t = [];
|
|
178
|
+
return e.ctrl && t.push("Ctrl"), e.alt && t.push("Alt"), e.shift && t.push("Shift"), e.meta && t.push("Meta"), t.join(" + ");
|
|
95
179
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
window.location.reload();
|
|
99
|
-
} catch {}
|
|
180
|
+
function q(e) {
|
|
181
|
+
return e.ctrl || e.alt || e.shift || e.meta;
|
|
100
182
|
}
|
|
101
|
-
function
|
|
102
|
-
let t = e.enabled ?? T(), n = e.editableProps && e.editableProps.length > 0 ? e.editableProps : v, r = e.palette && e.palette.length > 0 ? e.palette : y;
|
|
183
|
+
function J(e) {
|
|
103
184
|
return {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
editableProps: n,
|
|
109
|
-
palette: r,
|
|
110
|
-
zIndexBase: e.zIndexBase ?? x,
|
|
111
|
-
shouldCountRenders: e.shouldCountRenders ?? !1,
|
|
112
|
-
countRendersForComponents: e.countRendersForComponents ?? [],
|
|
113
|
-
renderCaptureMode: D(e.renderCaptureMode) ? e.renderCaptureMode : "attempts"
|
|
185
|
+
ctrl: e.ctrlKey,
|
|
186
|
+
alt: e.altKey,
|
|
187
|
+
shift: e.shiftKey,
|
|
188
|
+
meta: e.metaKey
|
|
114
189
|
};
|
|
115
190
|
}
|
|
116
|
-
function
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (/^#[0-9a-fA-F]{6}$/.test(e)) return e;
|
|
136
|
-
if (/^#[0-9a-fA-F]{3}$/.test(e)) {
|
|
137
|
-
let [, t, n, r] = e;
|
|
138
|
-
return `#${t}${t}${n}${n}${r}${r}`;
|
|
139
|
-
}
|
|
140
|
-
return "#1f2937";
|
|
141
|
-
}
|
|
142
|
-
function ae(e) {
|
|
143
|
-
let t = Number(e);
|
|
144
|
-
if (Number.isFinite(t)) return t;
|
|
145
|
-
}
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region src/reinspect/context.tsx
|
|
148
|
-
var N = "Capture rerenders and show totals next to component badges.", oe = "Tracks every rerender after initial mount for wrapped components. Use this toggle to capture for all components, or enable a specific component from its right-click inspector menu.", se = "Choose whether to count render attempts, committed renders, or both.", ce = "Render attempts track render-phase executions (includes Strict Mode extra passes). Committed renders track completed DOM commits. Both shows both counters together.", le = "Controls which components are automatically discoverable by Reinspect.", P = "Only wrapped components uses explicit withReinspect wrappers only. All 1st-party components auto-discovers components under your source tree. All components also attempts dependency components (with safety skips).";
|
|
149
|
-
function F(e) {
|
|
150
|
-
let t = {};
|
|
151
|
-
for (let n of e) t[n] = !0;
|
|
152
|
-
return t;
|
|
153
|
-
}
|
|
154
|
-
function I({ children: e, config: n }) {
|
|
155
|
-
let r = a(() => A(n), [n]), [i, o] = s(r.startActive), [c] = s(r.inspectMode), [d, f] = s(r.inspectMode), [p, m] = s(r.shouldCountRenders), [h, _] = s(r.renderCaptureMode), [v, y] = s(() => F(r.countRendersForComponents)), [b, ee] = s({}), x = t((e, t, n) => {
|
|
156
|
-
ee((r) => {
|
|
157
|
-
let i = { ...r[e] ?? {} };
|
|
158
|
-
if (n == null || n === "" ? delete i[t] : i[t] = n, Object.keys(i).length === 0) {
|
|
159
|
-
let t = { ...r };
|
|
160
|
-
return delete t[e], t;
|
|
161
|
-
}
|
|
191
|
+
function Y({ title: e, info: t, filter: n, setFilter: r, invalidPatterns: i, patternsInputTestId: a, regexTestId: o, wholeWordTestId: s, matchCaseTestId: c, invalidMessageTestId: l }) {
|
|
192
|
+
let [u, d] = E(""), f = T([]), p = b(() => {
|
|
193
|
+
W(u).length !== 0 && (f.current = [], d(""));
|
|
194
|
+
}, [u]), m = b((e) => {
|
|
195
|
+
r((t) => ({
|
|
196
|
+
...t,
|
|
197
|
+
patterns: t.patterns.filter((t) => t !== e)
|
|
198
|
+
}));
|
|
199
|
+
}, [r]), h = b(() => {
|
|
200
|
+
r((e) => ({
|
|
201
|
+
...e,
|
|
202
|
+
patterns: []
|
|
203
|
+
})), f.current = [], d("");
|
|
204
|
+
}, [r]), g = (e) => {
|
|
205
|
+
e.key === "Enter" && (e.preventDefault(), p());
|
|
206
|
+
}, _ = (e) => {
|
|
207
|
+
let t = W(e);
|
|
208
|
+
d(e), r((e) => {
|
|
209
|
+
let n = e.patterns.filter((e) => !f.current.includes(e));
|
|
162
210
|
return {
|
|
163
|
-
...
|
|
164
|
-
|
|
211
|
+
...e,
|
|
212
|
+
patterns: G(n, t)
|
|
165
213
|
};
|
|
214
|
+
}), f.current = t;
|
|
215
|
+
};
|
|
216
|
+
return /* @__PURE__ */ O("section", {
|
|
217
|
+
className: "reinspect-filter-section",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ O("div", {
|
|
220
|
+
className: "reinspect-filter-row-header",
|
|
221
|
+
children: [/* @__PURE__ */ O("p", {
|
|
222
|
+
className: "reinspect-filter-title",
|
|
223
|
+
children: [
|
|
224
|
+
e,
|
|
225
|
+
" ",
|
|
226
|
+
/* @__PURE__ */ D(U, {
|
|
227
|
+
label: "?",
|
|
228
|
+
description: t
|
|
229
|
+
})
|
|
230
|
+
]
|
|
231
|
+
}), /* @__PURE__ */ D("button", {
|
|
232
|
+
type: "button",
|
|
233
|
+
className: "reinspect-filter-clear-button",
|
|
234
|
+
onClick: h,
|
|
235
|
+
disabled: n.patterns.length === 0,
|
|
236
|
+
"data-testid": `${a}-clear`,
|
|
237
|
+
children: "Clear"
|
|
238
|
+
})]
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ O("div", {
|
|
241
|
+
className: "reinspect-filter-toolbar",
|
|
242
|
+
children: [
|
|
243
|
+
/* @__PURE__ */ D("span", {
|
|
244
|
+
className: "reinspect-filter-search-icon",
|
|
245
|
+
"aria-hidden": "true",
|
|
246
|
+
children: /* @__PURE__ */ D("svg", {
|
|
247
|
+
viewBox: "0 0 24 24",
|
|
248
|
+
focusable: "false",
|
|
249
|
+
children: /* @__PURE__ */ D("path", {
|
|
250
|
+
d: "M10.5 3a7.5 7.5 0 015.92 12.1l4.24 4.23a1 1 0 01-1.42 1.42l-4.23-4.24A7.5 7.5 0 1110.5 3zm0 2a5.5 5.5 0 100 11 5.5 5.5 0 000-11z",
|
|
251
|
+
fill: "currentColor"
|
|
252
|
+
})
|
|
253
|
+
})
|
|
254
|
+
}),
|
|
255
|
+
/* @__PURE__ */ D("input", {
|
|
256
|
+
"data-testid": a,
|
|
257
|
+
className: "reinspect-filter-search-input",
|
|
258
|
+
type: "search",
|
|
259
|
+
"aria-label": `${e} patterns`,
|
|
260
|
+
value: u,
|
|
261
|
+
placeholder: `Add ${e.toLowerCase()} pattern`,
|
|
262
|
+
onChange: (e) => _(e.currentTarget.value),
|
|
263
|
+
onKeyDown: g
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ D("button", {
|
|
266
|
+
type: "button",
|
|
267
|
+
className: "reinspect-filter-modifier",
|
|
268
|
+
"data-state": n.regex ? "active" : "idle",
|
|
269
|
+
"data-testid": o,
|
|
270
|
+
title: "Regex",
|
|
271
|
+
"aria-label": `${e} regex modifier`,
|
|
272
|
+
onClick: () => r((e) => ({
|
|
273
|
+
...e,
|
|
274
|
+
regex: !e.regex
|
|
275
|
+
})),
|
|
276
|
+
children: ".*"
|
|
277
|
+
}),
|
|
278
|
+
/* @__PURE__ */ D("button", {
|
|
279
|
+
type: "button",
|
|
280
|
+
className: "reinspect-filter-modifier",
|
|
281
|
+
"data-state": n.wholeWord ? "active" : "idle",
|
|
282
|
+
"data-testid": s,
|
|
283
|
+
title: "Whole word",
|
|
284
|
+
"aria-label": `${e} whole-word modifier`,
|
|
285
|
+
onClick: () => r((e) => ({
|
|
286
|
+
...e,
|
|
287
|
+
wholeWord: !e.wholeWord
|
|
288
|
+
})),
|
|
289
|
+
children: "W"
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ D("button", {
|
|
292
|
+
type: "button",
|
|
293
|
+
className: "reinspect-filter-modifier",
|
|
294
|
+
"data-state": n.matchCase ? "active" : "idle",
|
|
295
|
+
"data-testid": c,
|
|
296
|
+
title: "Match case",
|
|
297
|
+
"aria-label": `${e} case-sensitive modifier`,
|
|
298
|
+
onClick: () => r((e) => ({
|
|
299
|
+
...e,
|
|
300
|
+
matchCase: !e.matchCase
|
|
301
|
+
})),
|
|
302
|
+
children: "Aa"
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ D("button", {
|
|
305
|
+
type: "button",
|
|
306
|
+
className: "reinspect-filter-add-button",
|
|
307
|
+
onClick: p,
|
|
308
|
+
disabled: W(u).length === 0,
|
|
309
|
+
"data-testid": `${a}-add`,
|
|
310
|
+
children: "Add"
|
|
311
|
+
})
|
|
312
|
+
]
|
|
313
|
+
}),
|
|
314
|
+
n.patterns.length > 0 ? /* @__PURE__ */ D("div", {
|
|
315
|
+
className: "reinspect-filter-chip-list",
|
|
316
|
+
children: n.patterns.map((e) => /* @__PURE__ */ O("span", {
|
|
317
|
+
className: "reinspect-filter-chip",
|
|
318
|
+
children: [/* @__PURE__ */ D("code", { children: e }), /* @__PURE__ */ D("button", {
|
|
319
|
+
type: "button",
|
|
320
|
+
className: "reinspect-filter-chip-remove",
|
|
321
|
+
"aria-label": `Remove ${e}`,
|
|
322
|
+
onClick: () => m(e),
|
|
323
|
+
children: "×"
|
|
324
|
+
})]
|
|
325
|
+
}, e))
|
|
326
|
+
}) : /* @__PURE__ */ D("p", {
|
|
327
|
+
className: "reinspect-setting-empty-state",
|
|
328
|
+
children: "No patterns configured."
|
|
329
|
+
}),
|
|
330
|
+
i.length > 0 ? /* @__PURE__ */ O("p", {
|
|
331
|
+
className: "reinspect-error",
|
|
332
|
+
"data-testid": l,
|
|
333
|
+
children: ["Invalid regex patterns ignored: ", i.join(", ")]
|
|
334
|
+
}) : null
|
|
335
|
+
]
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
function X({ children: n, config: r }) {
|
|
339
|
+
let l = C(() => _(r), [r]), d = T({}), [p, m] = w(R, l, P);
|
|
340
|
+
S(() => {
|
|
341
|
+
m({
|
|
342
|
+
type: "hydrate-config",
|
|
343
|
+
config: l
|
|
166
344
|
});
|
|
167
|
-
}, [])
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
345
|
+
}, [l]);
|
|
346
|
+
let h = b((e) => {
|
|
347
|
+
m({
|
|
348
|
+
type: "set-is-active",
|
|
349
|
+
value: typeof e == "function" ? e(p.isActive) : e
|
|
350
|
+
});
|
|
351
|
+
}, [p.isActive]), g = b((e) => {
|
|
352
|
+
let t = typeof e == "function" ? e(p.pendingInspectMode) : e;
|
|
353
|
+
m({
|
|
354
|
+
type: "set-pending-inspect-mode",
|
|
355
|
+
value: t
|
|
356
|
+
}), f(t);
|
|
357
|
+
}, [p.pendingInspectMode]), y = b((e) => {
|
|
358
|
+
let t = i(typeof e == "function" ? e(p.inspectWhitelist) : e);
|
|
359
|
+
m({
|
|
360
|
+
type: "set-inspect-whitelist",
|
|
361
|
+
value: t
|
|
362
|
+
}), u(t);
|
|
363
|
+
}, [p.inspectWhitelist]), x = b((e) => {
|
|
364
|
+
let t = i(typeof e == "function" ? e(p.inspectBlacklist) : e);
|
|
365
|
+
m({
|
|
366
|
+
type: "set-inspect-blacklist",
|
|
367
|
+
value: t
|
|
368
|
+
}), a(t);
|
|
369
|
+
}, [p.inspectBlacklist]), E = b((e) => {
|
|
370
|
+
m({
|
|
371
|
+
type: "set-render-counter-mode",
|
|
372
|
+
value: typeof e == "function" ? e(p.renderCounterMode) : e
|
|
176
373
|
});
|
|
177
|
-
}, []),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
374
|
+
}, [p.renderCounterMode]), k = b((t) => {
|
|
375
|
+
let n = typeof t == "function" ? t(p.propsSerializationMode) : t;
|
|
376
|
+
m({
|
|
377
|
+
type: "set-props-serialization-mode",
|
|
378
|
+
value: n
|
|
379
|
+
}), e(n);
|
|
380
|
+
}, [p.propsSerializationMode]), A = b((e) => {
|
|
381
|
+
let t = typeof e == "function" ? e(p.menuTheme) : e;
|
|
382
|
+
m({
|
|
383
|
+
type: "set-menu-theme",
|
|
384
|
+
value: t
|
|
385
|
+
}), o(t);
|
|
386
|
+
}, [p.menuTheme]), j = b((e) => {
|
|
387
|
+
let t = typeof e == "function" ? e(p.menuOpenGesture) : e;
|
|
388
|
+
m({
|
|
389
|
+
type: "set-menu-open-gesture",
|
|
390
|
+
value: t
|
|
391
|
+
}), s(t);
|
|
392
|
+
}, [p.menuOpenGesture]), M = b((e, t, n) => {
|
|
393
|
+
m({
|
|
394
|
+
type: "update-override",
|
|
395
|
+
componentId: e,
|
|
396
|
+
prop: t,
|
|
397
|
+
value: n
|
|
398
|
+
});
|
|
399
|
+
}, []), N = b((e, t) => {
|
|
400
|
+
m({
|
|
401
|
+
type: "set-render-counting-for-component",
|
|
402
|
+
componentName: e,
|
|
403
|
+
enabled: t
|
|
404
|
+
});
|
|
405
|
+
}, []), F = b((e) => p.renderCounterMode !== "off" || !!p.renderCountComponents[e], [p.renderCounterMode, p.renderCountComponents]), I = p.pendingInspectMode !== p.inspectMode, L = b(() => {}, []), z = C(() => c(p.inspectWhitelist), [p.inspectWhitelist]), B = C(() => c(p.inspectBlacklist), [p.inspectBlacklist]), V = z.invalidPatterns, U = B.invalidPatterns, W = b((e) => t(e, z, B), [z, B]), G = b((e) => {
|
|
406
|
+
let t = d.current[e];
|
|
407
|
+
if (t) return t;
|
|
408
|
+
let n = H(e);
|
|
409
|
+
return d.current[e] = n, n;
|
|
410
|
+
}, []), K = C(() => ({
|
|
411
|
+
config: l,
|
|
412
|
+
isActive: l.enabled && p.isActive,
|
|
413
|
+
setIsActive: h,
|
|
414
|
+
inspectMode: p.inspectMode,
|
|
415
|
+
pendingInspectMode: p.pendingInspectMode,
|
|
416
|
+
setPendingInspectMode: g,
|
|
417
|
+
hasPendingInspectModeChange: I,
|
|
418
|
+
applyInspectMode: L,
|
|
419
|
+
inspectWhitelist: p.inspectWhitelist,
|
|
420
|
+
setInspectWhitelist: y,
|
|
421
|
+
inspectWhitelistInvalidPatterns: V,
|
|
422
|
+
inspectBlacklist: p.inspectBlacklist,
|
|
423
|
+
setInspectBlacklist: x,
|
|
424
|
+
inspectBlacklistInvalidPatterns: U,
|
|
425
|
+
isComponentInspectableByFilters: W,
|
|
426
|
+
renderCounterMode: p.renderCounterMode,
|
|
427
|
+
setRenderCounterMode: E,
|
|
428
|
+
propsSerializationMode: p.propsSerializationMode,
|
|
429
|
+
setPropsSerializationMode: k,
|
|
430
|
+
menuTheme: p.menuTheme,
|
|
431
|
+
setMenuTheme: A,
|
|
432
|
+
menuOpenGesture: p.menuOpenGesture,
|
|
433
|
+
setMenuOpenGesture: j,
|
|
434
|
+
renderCountComponents: p.renderCountComponents,
|
|
435
|
+
setRenderCountingForComponent: N,
|
|
436
|
+
isRenderCountingEnabledFor: F,
|
|
437
|
+
overrides: p.overrides,
|
|
438
|
+
updateOverride: M,
|
|
439
|
+
getColor: G
|
|
198
440
|
}), [
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
c,
|
|
202
|
-
d,
|
|
203
|
-
f,
|
|
204
|
-
w,
|
|
205
|
-
T,
|
|
206
|
-
p,
|
|
441
|
+
l,
|
|
442
|
+
p.isActive,
|
|
207
443
|
h,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
444
|
+
p.inspectMode,
|
|
445
|
+
p.pendingInspectMode,
|
|
446
|
+
g,
|
|
447
|
+
I,
|
|
448
|
+
L,
|
|
449
|
+
p.inspectWhitelist,
|
|
450
|
+
y,
|
|
451
|
+
V,
|
|
452
|
+
p.inspectBlacklist,
|
|
212
453
|
x,
|
|
213
|
-
|
|
454
|
+
U,
|
|
455
|
+
W,
|
|
456
|
+
p.renderCounterMode,
|
|
457
|
+
E,
|
|
458
|
+
p.propsSerializationMode,
|
|
459
|
+
k,
|
|
460
|
+
p.menuTheme,
|
|
461
|
+
A,
|
|
462
|
+
p.menuOpenGesture,
|
|
463
|
+
j,
|
|
464
|
+
p.renderCountComponents,
|
|
465
|
+
N,
|
|
466
|
+
F,
|
|
467
|
+
p.overrides,
|
|
468
|
+
M,
|
|
469
|
+
G
|
|
214
470
|
]);
|
|
215
|
-
return /* @__PURE__ */
|
|
216
|
-
value:
|
|
217
|
-
children: [
|
|
471
|
+
return /* @__PURE__ */ O(v.Provider, {
|
|
472
|
+
value: K,
|
|
473
|
+
children: [n, l.enabled && l.showFloatingToggle ? /* @__PURE__ */ D(Z, {}) : null]
|
|
218
474
|
});
|
|
219
475
|
}
|
|
220
|
-
function
|
|
221
|
-
let { config: e, isActive: t, setIsActive:
|
|
222
|
-
return
|
|
223
|
-
if (!
|
|
476
|
+
function Z() {
|
|
477
|
+
let { config: e, isActive: t, setIsActive: i, pendingInspectMode: a, setPendingInspectMode: o, inspectWhitelist: s, setInspectWhitelist: c, inspectWhitelistInvalidPatterns: u, inspectBlacklist: f, setInspectBlacklist: h, inspectBlacklistInvalidPatterns: _, renderCounterMode: v, setRenderCounterMode: b, propsSerializationMode: x, setPropsSerializationMode: C, menuTheme: w, setMenuTheme: k, menuOpenGesture: A, setMenuOpenGesture: j } = z(), [M, N] = E(!1), [P, F] = E("filter"), [I, L] = E(!1), R = T(null), B = T(null), V = T(null), H = T(!1);
|
|
478
|
+
return S(() => {
|
|
479
|
+
if (!M) return;
|
|
224
480
|
let e = (e) => {
|
|
225
481
|
let t = e.target;
|
|
226
|
-
|
|
482
|
+
t instanceof Node && (B.current?.contains(t) || N(!1));
|
|
227
483
|
}, t = (e) => {
|
|
228
|
-
e.key === "Escape" &&
|
|
484
|
+
e.key === "Escape" && N(!1);
|
|
229
485
|
};
|
|
230
486
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
231
487
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
232
488
|
};
|
|
233
|
-
}, [
|
|
489
|
+
}, [M]), S(() => {
|
|
490
|
+
if (!M || !V.current) return;
|
|
491
|
+
let e = V.current;
|
|
492
|
+
y(e);
|
|
493
|
+
let t = (t) => {
|
|
494
|
+
n(t, e);
|
|
495
|
+
};
|
|
496
|
+
return document.addEventListener("keydown", t), () => {
|
|
497
|
+
document.removeEventListener("keydown", t);
|
|
498
|
+
};
|
|
499
|
+
}, [M]), S(() => {
|
|
500
|
+
H.current && !M && R.current?.focus(), H.current = M;
|
|
501
|
+
}, [M]), S(() => {
|
|
502
|
+
if (!I) return;
|
|
503
|
+
let e = (e) => {
|
|
504
|
+
let t = J(e);
|
|
505
|
+
q(t) && (e.preventDefault(), e.stopPropagation(), j((e) => ({
|
|
506
|
+
...e,
|
|
507
|
+
mode: "modifier-right-click",
|
|
508
|
+
modifiers: t
|
|
509
|
+
})), L(!1));
|
|
510
|
+
};
|
|
511
|
+
return document.addEventListener("keydown", e, !0), () => {
|
|
512
|
+
document.removeEventListener("keydown", e, !0);
|
|
513
|
+
};
|
|
514
|
+
}, [I, j]), e.enabled ? /* @__PURE__ */ O("div", {
|
|
234
515
|
className: "reinspect-floating-root",
|
|
235
|
-
ref:
|
|
236
|
-
|
|
516
|
+
ref: B,
|
|
517
|
+
"data-reinspect-theme": w,
|
|
518
|
+
children: [/* @__PURE__ */ D("button", {
|
|
237
519
|
type: "button",
|
|
520
|
+
ref: R,
|
|
238
521
|
className: "reinspect-floating-toggle",
|
|
522
|
+
"data-reinspect-theme": w,
|
|
239
523
|
"data-testid": "reinspect-floating-toggle",
|
|
240
|
-
onClick: () =>
|
|
241
|
-
"aria-expanded":
|
|
524
|
+
onClick: () => N((e) => !e),
|
|
525
|
+
"aria-expanded": M,
|
|
242
526
|
"aria-controls": "reinspect-settings-menu",
|
|
243
527
|
children: "Reinspect settings"
|
|
244
|
-
}),
|
|
528
|
+
}), M ? /* @__PURE__ */ O("div", {
|
|
245
529
|
id: "reinspect-settings-menu",
|
|
530
|
+
ref: V,
|
|
246
531
|
className: "reinspect-settings-menu",
|
|
532
|
+
"data-reinspect-theme": w,
|
|
247
533
|
role: "dialog",
|
|
534
|
+
"aria-modal": "true",
|
|
248
535
|
"aria-label": "Reinspect settings",
|
|
536
|
+
tabIndex: -1,
|
|
249
537
|
"data-testid": "reinspect-settings-menu",
|
|
250
538
|
children: [
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
className: "reinspect-settings-
|
|
253
|
-
children: "
|
|
539
|
+
/* @__PURE__ */ O("div", {
|
|
540
|
+
className: "reinspect-settings-header-row",
|
|
541
|
+
children: [/* @__PURE__ */ D("p", {
|
|
542
|
+
className: "reinspect-settings-title",
|
|
543
|
+
children: "Reinspect settings"
|
|
544
|
+
}), /* @__PURE__ */ O("div", {
|
|
545
|
+
className: "reinspect-settings-inline-switch",
|
|
546
|
+
children: [/* @__PURE__ */ D("span", {
|
|
547
|
+
className: "reinspect-settings-toggle-label",
|
|
548
|
+
children: t ? "Enabled" : "Disabled"
|
|
549
|
+
}), /* @__PURE__ */ D("button", {
|
|
550
|
+
type: "button",
|
|
551
|
+
role: "switch",
|
|
552
|
+
"aria-checked": t,
|
|
553
|
+
"aria-label": "Toggle inspector enabled",
|
|
554
|
+
"data-testid": "reinspect-setting-inspector-active",
|
|
555
|
+
className: "reinspect-switch-button",
|
|
556
|
+
"data-state": t ? "on" : "off",
|
|
557
|
+
title: t ? "Disable inspector" : "Enable inspector",
|
|
558
|
+
onClick: () => i(!t)
|
|
559
|
+
})]
|
|
560
|
+
})]
|
|
254
561
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
className: "reinspect-settings-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
562
|
+
/* @__PURE__ */ O("div", {
|
|
563
|
+
className: "reinspect-settings-tabs",
|
|
564
|
+
role: "tablist",
|
|
565
|
+
"aria-label": "Reinspect settings categories",
|
|
566
|
+
children: [/* @__PURE__ */ D("button", {
|
|
567
|
+
type: "button",
|
|
568
|
+
role: "tab",
|
|
569
|
+
id: "reinspect-settings-tab-filter",
|
|
570
|
+
"data-testid": "reinspect-settings-tab-filter",
|
|
571
|
+
"data-state": P === "filter" ? "active" : "idle",
|
|
572
|
+
"aria-selected": P === "filter",
|
|
573
|
+
"aria-controls": "reinspect-settings-panel-filter",
|
|
574
|
+
onClick: () => F("filter"),
|
|
575
|
+
children: "Filter"
|
|
576
|
+
}), /* @__PURE__ */ D("button", {
|
|
577
|
+
type: "button",
|
|
578
|
+
role: "tab",
|
|
579
|
+
id: "reinspect-settings-tab-settings",
|
|
580
|
+
"data-testid": "reinspect-settings-tab-settings",
|
|
581
|
+
"data-state": P === "settings" ? "active" : "idle",
|
|
582
|
+
"aria-selected": P === "settings",
|
|
583
|
+
"aria-controls": "reinspect-settings-panel-settings",
|
|
584
|
+
onClick: () => F("settings"),
|
|
585
|
+
children: "Settings"
|
|
265
586
|
})]
|
|
266
587
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
className: "reinspect-
|
|
588
|
+
/* @__PURE__ */ D("div", { className: "reinspect-settings-divider" }),
|
|
589
|
+
P === "filter" ? /* @__PURE__ */ O("div", {
|
|
590
|
+
className: "reinspect-settings-tab-panel",
|
|
591
|
+
role: "tabpanel",
|
|
592
|
+
id: "reinspect-settings-panel-filter",
|
|
593
|
+
"aria-labelledby": "reinspect-settings-tab-filter",
|
|
270
594
|
children: [
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
type: "button",
|
|
283
|
-
className: "reinspect-tooltip-trigger",
|
|
284
|
-
"aria-label": "Explain INSPECT_MODE",
|
|
285
|
-
children: "?"
|
|
286
|
-
}), /* @__PURE__ */ l("span", {
|
|
287
|
-
className: "reinspect-tooltip-content",
|
|
288
|
-
role: "tooltip",
|
|
289
|
-
children: P
|
|
290
|
-
})]
|
|
291
|
-
})]
|
|
292
|
-
}),
|
|
293
|
-
/* @__PURE__ */ u("label", {
|
|
294
|
-
className: "reinspect-settings-select-row",
|
|
295
|
-
children: [/* @__PURE__ */ l("span", {
|
|
296
|
-
className: "reinspect-settings-toggle-label",
|
|
297
|
-
children: "Inspect Mode"
|
|
298
|
-
}), /* @__PURE__ */ u("select", {
|
|
299
|
-
"data-testid": "reinspect-setting-inspect-mode",
|
|
300
|
-
value: a,
|
|
301
|
-
onChange: (e) => {
|
|
302
|
-
let t = e.currentTarget.value;
|
|
303
|
-
E(t) && c(t);
|
|
304
|
-
},
|
|
305
|
-
children: [
|
|
306
|
-
/* @__PURE__ */ l("option", {
|
|
307
|
-
value: "wrapped",
|
|
308
|
-
children: "Only wrapped components"
|
|
309
|
-
}),
|
|
310
|
-
/* @__PURE__ */ l("option", {
|
|
311
|
-
value: "first-party",
|
|
312
|
-
children: "All 1st-party components"
|
|
313
|
-
}),
|
|
314
|
-
/* @__PURE__ */ l("option", {
|
|
315
|
-
value: "all",
|
|
316
|
-
children: "All components"
|
|
317
|
-
})
|
|
318
|
-
]
|
|
319
|
-
})]
|
|
595
|
+
/* @__PURE__ */ D(Y, {
|
|
596
|
+
title: "Include",
|
|
597
|
+
info: "Only matching component names remain inspectable.",
|
|
598
|
+
filter: s,
|
|
599
|
+
setFilter: c,
|
|
600
|
+
invalidPatterns: u,
|
|
601
|
+
patternsInputTestId: "reinspect-setting-inspect-whitelist-patterns",
|
|
602
|
+
regexTestId: "reinspect-setting-inspect-whitelist-regex",
|
|
603
|
+
wholeWordTestId: "reinspect-setting-inspect-whitelist-whole-word",
|
|
604
|
+
matchCaseTestId: "reinspect-setting-inspect-whitelist-match-case",
|
|
605
|
+
invalidMessageTestId: "reinspect-setting-inspect-whitelist-invalid"
|
|
320
606
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
607
|
+
/* @__PURE__ */ D(Y, {
|
|
608
|
+
title: "Exclude",
|
|
609
|
+
info: "Matching component names are hidden from inspection.",
|
|
610
|
+
filter: f,
|
|
611
|
+
setFilter: h,
|
|
612
|
+
invalidPatterns: _,
|
|
613
|
+
patternsInputTestId: "reinspect-setting-inspect-blacklist-patterns",
|
|
614
|
+
regexTestId: "reinspect-setting-inspect-blacklist-regex",
|
|
615
|
+
wholeWordTestId: "reinspect-setting-inspect-blacklist-whole-word",
|
|
616
|
+
matchCaseTestId: "reinspect-setting-inspect-blacklist-match-case",
|
|
617
|
+
invalidMessageTestId: "reinspect-setting-inspect-blacklist-invalid"
|
|
328
618
|
}),
|
|
329
|
-
|
|
619
|
+
/* @__PURE__ */ D("p", {
|
|
330
620
|
className: "reinspect-setting-note",
|
|
331
|
-
|
|
332
|
-
children: "Inspect mode changes are applied after reload."
|
|
333
|
-
}) : /* @__PURE__ */ u("p", {
|
|
334
|
-
className: "reinspect-setting-note",
|
|
335
|
-
children: ["Current mode: ", i]
|
|
336
|
-
})
|
|
337
|
-
]
|
|
338
|
-
}),
|
|
339
|
-
/* @__PURE__ */ l("div", { className: "reinspect-settings-divider" }),
|
|
340
|
-
/* @__PURE__ */ u("section", {
|
|
341
|
-
className: "reinspect-setting-block",
|
|
342
|
-
children: [
|
|
343
|
-
/* @__PURE__ */ u("header", {
|
|
344
|
-
className: "reinspect-setting-header",
|
|
345
|
-
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
346
|
-
className: "reinspect-setting-name",
|
|
347
|
-
children: "SHOULD_COUNT_RENDERS"
|
|
348
|
-
}), /* @__PURE__ */ l("p", {
|
|
349
|
-
className: "reinspect-setting-short-description",
|
|
350
|
-
children: N
|
|
351
|
-
})] }), /* @__PURE__ */ u("span", {
|
|
352
|
-
className: "reinspect-tooltip-host",
|
|
353
|
-
children: [/* @__PURE__ */ l("button", {
|
|
354
|
-
type: "button",
|
|
355
|
-
className: "reinspect-tooltip-trigger",
|
|
356
|
-
"aria-label": "Explain SHOULD_COUNT_RENDERS",
|
|
357
|
-
children: "?"
|
|
358
|
-
}), /* @__PURE__ */ l("span", {
|
|
359
|
-
className: "reinspect-tooltip-content",
|
|
360
|
-
role: "tooltip",
|
|
361
|
-
children: oe
|
|
362
|
-
})]
|
|
363
|
-
})]
|
|
621
|
+
children: "Exclude patterns override include patterns."
|
|
364
622
|
}),
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
-
className: "reinspect-
|
|
367
|
-
children:
|
|
368
|
-
className: "reinspect-settings-
|
|
369
|
-
children:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
623
|
+
/* @__PURE__ */ D("section", {
|
|
624
|
+
className: "reinspect-setting-block",
|
|
625
|
+
children: /* @__PURE__ */ O("label", {
|
|
626
|
+
className: "reinspect-settings-select-row",
|
|
627
|
+
children: [/* @__PURE__ */ O("span", {
|
|
628
|
+
className: "reinspect-settings-toggle-label",
|
|
629
|
+
children: [
|
|
630
|
+
"Component scope",
|
|
631
|
+
" ",
|
|
632
|
+
/* @__PURE__ */ D(U, {
|
|
633
|
+
label: "?",
|
|
634
|
+
description: "Choose which component groups can be inspected."
|
|
635
|
+
})
|
|
636
|
+
]
|
|
637
|
+
}), /* @__PURE__ */ O("select", {
|
|
638
|
+
"data-testid": "reinspect-setting-inspect-mode",
|
|
639
|
+
value: a,
|
|
640
|
+
onChange: (e) => {
|
|
641
|
+
let t = e.currentTarget.value;
|
|
642
|
+
d(t) && o(t);
|
|
643
|
+
},
|
|
644
|
+
children: [
|
|
645
|
+
/* @__PURE__ */ D("option", {
|
|
646
|
+
value: "wrapped",
|
|
647
|
+
children: "Only wrapped components"
|
|
648
|
+
}),
|
|
649
|
+
/* @__PURE__ */ D("option", {
|
|
650
|
+
value: "first-party",
|
|
651
|
+
children: "All 1st-party components"
|
|
652
|
+
}),
|
|
653
|
+
/* @__PURE__ */ D("option", {
|
|
654
|
+
value: "all",
|
|
655
|
+
children: "All components"
|
|
656
|
+
})
|
|
657
|
+
]
|
|
396
658
|
})]
|
|
397
|
-
})
|
|
398
|
-
}),
|
|
399
|
-
/* @__PURE__ */ u("label", {
|
|
400
|
-
className: "reinspect-settings-select-row",
|
|
401
|
-
children: [/* @__PURE__ */ l("span", {
|
|
402
|
-
className: "reinspect-settings-toggle-label",
|
|
403
|
-
children: "Capture mode"
|
|
404
|
-
}), /* @__PURE__ */ u("select", {
|
|
405
|
-
"data-testid": "reinspect-setting-render-capture-mode",
|
|
406
|
-
value: h,
|
|
407
|
-
onChange: (e) => {
|
|
408
|
-
let t = e.currentTarget.value;
|
|
409
|
-
D(t) && g(t);
|
|
410
|
-
},
|
|
411
|
-
children: [
|
|
412
|
-
/* @__PURE__ */ l("option", {
|
|
413
|
-
value: "attempts",
|
|
414
|
-
children: "Render attempts"
|
|
415
|
-
}),
|
|
416
|
-
/* @__PURE__ */ l("option", {
|
|
417
|
-
value: "commits",
|
|
418
|
-
children: "Committed renders"
|
|
419
|
-
}),
|
|
420
|
-
/* @__PURE__ */ l("option", {
|
|
421
|
-
value: "both",
|
|
422
|
-
children: "Both"
|
|
423
|
-
})
|
|
424
|
-
]
|
|
425
|
-
})]
|
|
659
|
+
})
|
|
426
660
|
})
|
|
427
661
|
]
|
|
428
|
-
})
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
summary: "null",
|
|
505
|
-
copyText: "null"
|
|
506
|
-
};
|
|
507
|
-
let t = typeof e;
|
|
508
|
-
if (t === "undefined") return {
|
|
509
|
-
kind: "undefined",
|
|
510
|
-
summary: "undefined",
|
|
511
|
-
copyText: "undefined"
|
|
512
|
-
};
|
|
513
|
-
if (t === "boolean") return {
|
|
514
|
-
kind: "boolean",
|
|
515
|
-
summary: String(e),
|
|
516
|
-
copyText: String(e)
|
|
517
|
-
};
|
|
518
|
-
if (t === "number") return {
|
|
519
|
-
kind: "number",
|
|
520
|
-
summary: String(e),
|
|
521
|
-
copyText: String(e)
|
|
522
|
-
};
|
|
523
|
-
if (t === "string") return {
|
|
524
|
-
kind: "string",
|
|
525
|
-
summary: JSON.stringify(e),
|
|
526
|
-
copyText: String(e)
|
|
527
|
-
};
|
|
528
|
-
if (t === "bigint") return {
|
|
529
|
-
kind: "bigint",
|
|
530
|
-
summary: `${String(e)}n`,
|
|
531
|
-
copyText: `${String(e)}n`
|
|
532
|
-
};
|
|
533
|
-
if (t === "symbol") {
|
|
534
|
-
let t = String(e);
|
|
535
|
-
return {
|
|
536
|
-
kind: "symbol",
|
|
537
|
-
summary: t,
|
|
538
|
-
copyText: t
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
if (t === "function") {
|
|
542
|
-
let t = e, n = W(t), r = t.name || "anonymous";
|
|
543
|
-
return {
|
|
544
|
-
kind: "function",
|
|
545
|
-
summary: `Function ${r}(${t.length})`,
|
|
546
|
-
copyText: n,
|
|
547
|
-
functionMeta: {
|
|
548
|
-
name: r,
|
|
549
|
-
arity: t.length,
|
|
550
|
-
preview: pe(n),
|
|
551
|
-
source: n
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
if (e instanceof Date) {
|
|
556
|
-
let t = Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString();
|
|
557
|
-
return {
|
|
558
|
-
kind: "date",
|
|
559
|
-
summary: `Date ${t}`,
|
|
560
|
-
copyText: t
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
if (e instanceof RegExp) {
|
|
564
|
-
let t = e.toString();
|
|
565
|
-
return {
|
|
566
|
-
kind: "regexp",
|
|
567
|
-
summary: t,
|
|
568
|
-
copyText: t
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
return Array.isArray(e) ? {
|
|
572
|
-
kind: "array",
|
|
573
|
-
summary: `Array(${e.length})`
|
|
574
|
-
} : U(e) ? {
|
|
575
|
-
kind: "object",
|
|
576
|
-
summary: `Object(${Object.keys(e).length})`
|
|
577
|
-
} : {
|
|
578
|
-
kind: "unknown",
|
|
579
|
-
summary: String(e)
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
function q(e) {
|
|
583
|
-
if (!de(e)) {
|
|
584
|
-
if (Array.isArray(e)) {
|
|
585
|
-
let t = [];
|
|
586
|
-
for (let n of e) {
|
|
587
|
-
let e = q(n);
|
|
588
|
-
if (e === void 0) return;
|
|
589
|
-
t.push(e);
|
|
590
|
-
}
|
|
591
|
-
return t;
|
|
592
|
-
}
|
|
593
|
-
if (U(e)) {
|
|
594
|
-
let t = {};
|
|
595
|
-
for (let [n, r] of Object.entries(e)) {
|
|
596
|
-
let e = q(r);
|
|
597
|
-
e !== void 0 && (t[n] = e);
|
|
598
|
-
}
|
|
599
|
-
return t;
|
|
600
|
-
}
|
|
601
|
-
return e;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
function me(e) {
|
|
605
|
-
return Object.keys(e).map((t) => ({
|
|
606
|
-
key: t,
|
|
607
|
-
value: K(e[t])
|
|
608
|
-
}));
|
|
609
|
-
}
|
|
610
|
-
function he(e) {
|
|
611
|
-
return fe(G(e, /* @__PURE__ */ new WeakSet(), 0)) ?? "{}";
|
|
612
|
-
}
|
|
613
|
-
function ge(e) {
|
|
614
|
-
return fe(G(e, /* @__PURE__ */ new WeakSet(), 0));
|
|
615
|
-
}
|
|
616
|
-
function _e(e) {
|
|
617
|
-
if (e === null) return !0;
|
|
618
|
-
let t = typeof e;
|
|
619
|
-
return t === "string" || t === "number" || t === "boolean" || Array.isArray(e) ? !0 : ue(e);
|
|
620
|
-
}
|
|
621
|
-
function ve(e) {
|
|
622
|
-
let t = e.trim();
|
|
623
|
-
if (t.length === 0) return {
|
|
624
|
-
parsed: null,
|
|
625
|
-
error: "Value JSON cannot be empty."
|
|
626
|
-
};
|
|
627
|
-
try {
|
|
628
|
-
let e = q(JSON.parse(t));
|
|
629
|
-
return e === void 0 || !_e(e) ? {
|
|
630
|
-
parsed: null,
|
|
631
|
-
error: "Only objects, arrays, and primitive JSON values are editable."
|
|
632
|
-
} : {
|
|
633
|
-
parsed: e,
|
|
634
|
-
error: null
|
|
635
|
-
};
|
|
636
|
-
} catch {
|
|
637
|
-
return {
|
|
638
|
-
parsed: null,
|
|
639
|
-
error: "Invalid JSON. Fix syntax and try Apply again."
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
function ye(e) {
|
|
644
|
-
let t = e.trim();
|
|
645
|
-
if (t.length === 0) return {
|
|
646
|
-
parsed: {},
|
|
647
|
-
error: null
|
|
648
|
-
};
|
|
649
|
-
try {
|
|
650
|
-
let e = JSON.parse(t);
|
|
651
|
-
if (typeof e != "object" || !e || Array.isArray(e)) return {
|
|
652
|
-
parsed: null,
|
|
653
|
-
error: "Props JSON must be an object (example: {\"title\":\"Demo\"})."
|
|
654
|
-
};
|
|
655
|
-
let n = {};
|
|
656
|
-
for (let [t, r] of Object.entries(e)) {
|
|
657
|
-
let e = q(r);
|
|
658
|
-
e !== void 0 && (n[t] = e);
|
|
659
|
-
}
|
|
660
|
-
return {
|
|
661
|
-
parsed: n,
|
|
662
|
-
error: null
|
|
663
|
-
};
|
|
664
|
-
} catch {
|
|
665
|
-
return {
|
|
666
|
-
parsed: null,
|
|
667
|
-
error: "Invalid JSON. Fix syntax and try Apply again."
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
//#endregion
|
|
672
|
-
//#region src/reinspect/wrapMarker.ts
|
|
673
|
-
var be = Symbol.for("reinspect.wrapped");
|
|
674
|
-
function xe(e) {
|
|
675
|
-
return e[be];
|
|
676
|
-
}
|
|
677
|
-
//#endregion
|
|
678
|
-
//#region src/reinspect/withReinspect.tsx
|
|
679
|
-
var Se = {
|
|
680
|
-
enabled: !1,
|
|
681
|
-
startActive: !1,
|
|
682
|
-
showFloatingToggle: !1,
|
|
683
|
-
inspectMode: "wrapped",
|
|
684
|
-
editableProps: [],
|
|
685
|
-
palette: [],
|
|
686
|
-
zIndexBase: 0,
|
|
687
|
-
shouldCountRenders: !1,
|
|
688
|
-
countRendersForComponents: [],
|
|
689
|
-
renderCaptureMode: "attempts"
|
|
690
|
-
}, Ce = /* @__PURE__ */ new Map();
|
|
691
|
-
function J(e) {
|
|
692
|
-
let t = Ce.get(e);
|
|
693
|
-
if (t) return t;
|
|
694
|
-
let n = {
|
|
695
|
-
attempts: 0,
|
|
696
|
-
commits: 0,
|
|
697
|
-
hasCommitted: !1,
|
|
698
|
-
wasCountingEnabled: !1,
|
|
699
|
-
shouldCountCommit: !1
|
|
700
|
-
};
|
|
701
|
-
return Ce.set(e, n), n;
|
|
702
|
-
}
|
|
703
|
-
function we(e, t) {
|
|
704
|
-
let n = J(e);
|
|
705
|
-
if (!t) return n.wasCountingEnabled = !1, n.shouldCountCommit = !1, {
|
|
706
|
-
attempts: n.attempts,
|
|
707
|
-
commits: n.commits
|
|
708
|
-
};
|
|
709
|
-
let r = n.hasCommitted && n.wasCountingEnabled;
|
|
710
|
-
return r && (n.attempts += 1), n.wasCountingEnabled = !0, n.shouldCountCommit = r, {
|
|
711
|
-
attempts: n.attempts,
|
|
712
|
-
commits: n.commits + +!!r
|
|
713
|
-
};
|
|
714
|
-
}
|
|
715
|
-
function Te(e) {
|
|
716
|
-
let t = J(e);
|
|
717
|
-
t.hasCommitted && t.shouldCountCommit && (t.commits += 1), t.hasCommitted = !0, t.shouldCountCommit = !1;
|
|
718
|
-
}
|
|
719
|
-
function Ee(e, t) {
|
|
720
|
-
return t === "commits" ? `${e.commits} commits` : t === "both" ? `${e.attempts} attempts | ${e.commits} commits` : `${e.attempts} attempts`;
|
|
721
|
-
}
|
|
722
|
-
function De(e) {
|
|
723
|
-
let t = e.replace(/([A-Z])/g, " $1").trim();
|
|
724
|
-
return t.length > 0 ? t[0].toUpperCase() + t.slice(1) : e;
|
|
725
|
-
}
|
|
726
|
-
function Oe(e) {
|
|
727
|
-
return e.trim().toLowerCase().replace(/[\s_-]+/g, "");
|
|
728
|
-
}
|
|
729
|
-
function Y(e) {
|
|
730
|
-
return e != null && e !== "";
|
|
731
|
-
}
|
|
732
|
-
function ke(e) {
|
|
733
|
-
return e.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
734
|
-
}
|
|
735
|
-
async function Ae(e) {
|
|
736
|
-
if (typeof navigator > "u" || !navigator.clipboard?.writeText) return !1;
|
|
737
|
-
try {
|
|
738
|
-
return await navigator.clipboard.writeText(e), !0;
|
|
739
|
-
} catch {
|
|
740
|
-
return !1;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
function je({ value: e, onCopy: t }) {
|
|
744
|
-
if (e.kind === "function" && e.functionMeta) {
|
|
745
|
-
let n = e.functionMeta;
|
|
746
|
-
return /* @__PURE__ */ u("div", {
|
|
747
|
-
className: "reinspect-prop-function",
|
|
748
|
-
children: [
|
|
749
|
-
/* @__PURE__ */ l("code", { children: e.summary }),
|
|
750
|
-
/* @__PURE__ */ l("pre", { children: n.preview }),
|
|
751
|
-
/* @__PURE__ */ l("button", {
|
|
752
|
-
type: "button",
|
|
753
|
-
onClick: () => t(n.source, "Function source"),
|
|
754
|
-
disabled: !n.source,
|
|
755
|
-
children: "Copy function source"
|
|
756
|
-
})
|
|
757
|
-
]
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
return /* @__PURE__ */ u("div", {
|
|
761
|
-
className: "reinspect-prop-scalar",
|
|
762
|
-
children: [/* @__PURE__ */ l("code", { children: e.summary }), e.copyText ? /* @__PURE__ */ l("button", {
|
|
763
|
-
type: "button",
|
|
764
|
-
onClick: () => t(e.copyText ?? "", "Value"),
|
|
765
|
-
children: "Copy"
|
|
766
|
-
}) : null]
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
function Me(e, t) {
|
|
770
|
-
return t?.name?.trim() || e.displayName?.trim() || e.name?.trim() || t?.fallbackName?.trim() || "Component";
|
|
771
|
-
}
|
|
772
|
-
function Ne(e, t, n) {
|
|
773
|
-
return e === "manual" || n === "all" || n === "first-party" && t === "first-party";
|
|
774
|
-
}
|
|
775
|
-
function X(e, t) {
|
|
776
|
-
let a = t?.source ?? "manual", f = t?.scope ?? "first-party", p = xe(e);
|
|
777
|
-
if (p && a === "auto") return e;
|
|
778
|
-
let m = p && a === "manual" ? p.original : e, h = Me(m, t);
|
|
779
|
-
function _(e) {
|
|
780
|
-
let t = i(), p = o(null), _ = o(null), [v, y] = s(null), [x, S] = s("css"), [C, w] = s("detected"), [T, E] = s(""), [D, O] = s({}), [te, k] = s("{}"), [ne, A] = s(null), [j, M] = s(null), [N, oe] = s({}), [se, ce] = s({}), [le, P] = s({}), [F, I] = s(null), [L, R] = s(""), [z, B] = s(null), V = n(g), H = !!V, U = V?.config ?? Se, ue = V?.getBorderColor ?? (() => "#f97316"), de = V?.isActive ?? !1, fe = V?.inspectMode ?? "wrapped", W = V?.shouldCountRenders ?? !1, pe = V?.renderCaptureMode ?? Se.renderCaptureMode, G = V?.overrides ?? {}, K = V?.updateOverride ?? (() => void 0), q = V?.renderCountComponents ?? {}, be = V?.setRenderCountingForComponent ?? (() => void 0), xe = V?.isRenderCountingEnabledFor ?? (() => !1), J = `${h}-${t}`, Me = ue(h), X = Ne(a, f, fe), Z = U.enabled && de && X, Pe = X && xe(h), Fe = !!q[h], Ie = we(J, Pe), Le = G[J], Re = Z ? re(Le, U.editableProps) : {}, Q = {
|
|
781
|
-
...e,
|
|
782
|
-
...D
|
|
783
|
-
}, ze = Q, $ = Z && v !== null, Be = Oe(T), Ve = Be.length === 0 ? U.editableProps : U.editableProps.filter((e) => Oe(e).includes(Be)), He = $ && x === "props" && C === "detected" ? me(ze) : [];
|
|
784
|
-
r(() => (Te(J), () => {
|
|
785
|
-
Ce.delete(J);
|
|
786
|
-
}), [J]), r(() => {
|
|
787
|
-
if (!$) return;
|
|
788
|
-
let e = (e) => {
|
|
789
|
-
let t = e.target;
|
|
790
|
-
p.current?.contains(t) || _.current?.contains(t) || (y(null), I(null), R(""), B(null));
|
|
791
|
-
}, t = (e) => {
|
|
792
|
-
if (e.key === "Escape") {
|
|
793
|
-
if (F) {
|
|
794
|
-
I(null), R(""), B(null);
|
|
795
|
-
return;
|
|
796
|
-
}
|
|
797
|
-
y(null);
|
|
798
|
-
}
|
|
799
|
-
};
|
|
800
|
-
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
801
|
-
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
802
|
-
};
|
|
803
|
-
}, [F, $]), r(() => {
|
|
804
|
-
if (!j) return;
|
|
805
|
-
let e = globalThis.setTimeout(() => {
|
|
806
|
-
M(null);
|
|
807
|
-
}, 1400);
|
|
808
|
-
return () => {
|
|
809
|
-
globalThis.clearTimeout(e);
|
|
810
|
-
};
|
|
811
|
-
}, [j]);
|
|
812
|
-
let Ue = {
|
|
813
|
-
"--reinspect-color": Me,
|
|
814
|
-
"--reinspect-z-base": U.zIndexBase
|
|
815
|
-
}, We = (e) => {
|
|
816
|
-
Z && (e.preventDefault(), S("css"), w("detected"), E(""), A(null), M(null), oe({}), ce({}), P({}), I(null), R(""), B(null), k("{}"), y({
|
|
817
|
-
x: e.clientX,
|
|
818
|
-
y: e.clientY
|
|
819
|
-
}));
|
|
820
|
-
}, Ge = () => {
|
|
821
|
-
let { parsed: e, error: t } = ye(te);
|
|
822
|
-
if (t || !e) {
|
|
823
|
-
A(t);
|
|
824
|
-
return;
|
|
825
|
-
}
|
|
826
|
-
O(e), A(null);
|
|
827
|
-
}, Ke = () => {
|
|
828
|
-
O({}), C === "raw" && k(he(e)), A(null);
|
|
829
|
-
}, qe = (e, t) => {
|
|
830
|
-
Ae(e).then((e) => {
|
|
831
|
-
M(e ? `${t} copied.` : "Clipboard access is unavailable.");
|
|
832
|
-
});
|
|
833
|
-
}, Je = (e, t) => {
|
|
834
|
-
if (le[e]) {
|
|
835
|
-
P((t) => ({
|
|
836
|
-
...t,
|
|
837
|
-
[e]: !1
|
|
838
|
-
}));
|
|
839
|
-
return;
|
|
840
|
-
}
|
|
841
|
-
if (!(e in N) && !(e in se)) {
|
|
842
|
-
let n = ge(t);
|
|
843
|
-
n === null ? ce((t) => ({
|
|
844
|
-
...t,
|
|
845
|
-
[e]: "JSON preview is unavailable for this value."
|
|
846
|
-
})) : oe((t) => ({
|
|
847
|
-
...t,
|
|
848
|
-
[e]: n
|
|
849
|
-
}));
|
|
850
|
-
}
|
|
851
|
-
P((t) => ({
|
|
852
|
-
...t,
|
|
853
|
-
[e]: !0
|
|
854
|
-
}));
|
|
855
|
-
}, Ye = (e, t) => {
|
|
856
|
-
if (!_e(t)) return;
|
|
857
|
-
let n = ge(t);
|
|
858
|
-
if (n === null) {
|
|
859
|
-
M("Unable to open editor for this value.");
|
|
860
|
-
return;
|
|
861
|
-
}
|
|
862
|
-
I(e), R(n), B(null);
|
|
863
|
-
}, Xe = () => {
|
|
864
|
-
if (!F) return;
|
|
865
|
-
let { parsed: e, error: t } = ve(L);
|
|
866
|
-
if (t || e === null) {
|
|
867
|
-
B(t);
|
|
868
|
-
return;
|
|
869
|
-
}
|
|
870
|
-
O((t) => ({
|
|
871
|
-
...t,
|
|
872
|
-
[F]: e
|
|
873
|
-
})), I(null), R(""), B(null);
|
|
874
|
-
}, Ze = $ ? /* @__PURE__ */ u("div", {
|
|
875
|
-
ref: p,
|
|
876
|
-
className: "reinspect-menu",
|
|
877
|
-
role: "dialog",
|
|
878
|
-
"aria-label": `${h} inspector controls`,
|
|
879
|
-
style: {
|
|
880
|
-
top: `${v.y}px`,
|
|
881
|
-
left: `${v.x}px`
|
|
882
|
-
},
|
|
883
|
-
children: [
|
|
884
|
-
/* @__PURE__ */ u("p", {
|
|
885
|
-
className: "reinspect-menu-title",
|
|
886
|
-
children: [h, " inspector"]
|
|
887
|
-
}),
|
|
888
|
-
/* @__PURE__ */ u("label", {
|
|
889
|
-
className: "reinspect-menu-component-setting",
|
|
890
|
-
children: [/* @__PURE__ */ l("span", { children: "Capture renders for this component" }), /* @__PURE__ */ l("input", {
|
|
891
|
-
type: "checkbox",
|
|
892
|
-
checked: W ? !0 : Fe,
|
|
893
|
-
onChange: (e) => be(h, e.currentTarget.checked),
|
|
894
|
-
disabled: W,
|
|
895
|
-
"aria-label": `Capture renders for ${h}`,
|
|
896
|
-
"data-testid": `reinspect-component-render-toggle-${h}`
|
|
897
|
-
})]
|
|
898
|
-
}),
|
|
899
|
-
W ? /* @__PURE__ */ l("p", {
|
|
900
|
-
className: "reinspect-setting-note",
|
|
901
|
-
children: "Global capture is enabled from Reinspect settings."
|
|
902
|
-
}) : null,
|
|
903
|
-
/* @__PURE__ */ u("div", {
|
|
904
|
-
className: "reinspect-submenu",
|
|
905
|
-
children: [/* @__PURE__ */ l("button", {
|
|
906
|
-
type: "button",
|
|
907
|
-
"data-state": x === "css" ? "active" : "idle",
|
|
908
|
-
onClick: () => S("css"),
|
|
909
|
-
children: "CSS"
|
|
910
|
-
}), /* @__PURE__ */ l("button", {
|
|
911
|
-
type: "button",
|
|
912
|
-
"data-state": x === "props" ? "active" : "idle",
|
|
913
|
-
onClick: () => S("props"),
|
|
914
|
-
children: "Props"
|
|
915
|
-
})]
|
|
916
|
-
}),
|
|
917
|
-
x === "css" ? /* @__PURE__ */ u(c, { children: [
|
|
918
|
-
/* @__PURE__ */ u("div", {
|
|
919
|
-
className: "reinspect-menu-filter",
|
|
920
|
-
children: [/* @__PURE__ */ l("span", {
|
|
921
|
-
className: "reinspect-menu-filter-icon",
|
|
922
|
-
"aria-hidden": "true",
|
|
923
|
-
children: /* @__PURE__ */ l("svg", {
|
|
924
|
-
viewBox: "0 0 24 24",
|
|
925
|
-
focusable: "false",
|
|
926
|
-
children: /* @__PURE__ */ l("path", {
|
|
927
|
-
d: "M10.5 3a7.5 7.5 0 015.92 12.1l4.24 4.23a1 1 0 01-1.42 1.42l-4.23-4.24A7.5 7.5 0 1110.5 3zm0 2a5.5 5.5 0 100 11 5.5 5.5 0 000-11z",
|
|
928
|
-
fill: "currentColor"
|
|
929
|
-
})
|
|
930
|
-
})
|
|
931
|
-
}), /* @__PURE__ */ l("input", {
|
|
932
|
-
id: `${J}-css-filter`,
|
|
933
|
-
"data-testid": "reinspect-css-filter-input",
|
|
934
|
-
type: "search",
|
|
935
|
-
value: T,
|
|
936
|
-
placeholder: "Filter",
|
|
937
|
-
"aria-label": "Filter CSS properties",
|
|
938
|
-
onChange: (e) => E(e.currentTarget.value)
|
|
939
|
-
})]
|
|
940
|
-
}),
|
|
941
|
-
/* @__PURE__ */ l("div", {
|
|
942
|
-
className: "reinspect-menu-grid",
|
|
943
|
-
children: Ve.map((e) => {
|
|
944
|
-
let t = Le?.[e], n = `${J}-${e}`;
|
|
945
|
-
if (b.has(e)) {
|
|
946
|
-
let r = typeof t == "string" ? ie(t) : "#1f2937";
|
|
947
|
-
return /* @__PURE__ */ u("div", {
|
|
948
|
-
className: "reinspect-field",
|
|
949
|
-
children: [/* @__PURE__ */ l("label", {
|
|
950
|
-
htmlFor: n,
|
|
951
|
-
children: De(e)
|
|
952
|
-
}), /* @__PURE__ */ u("div", {
|
|
953
|
-
className: "reinspect-inline-controls",
|
|
954
|
-
children: [/* @__PURE__ */ l("input", {
|
|
955
|
-
id: n,
|
|
956
|
-
type: "color",
|
|
957
|
-
value: r,
|
|
958
|
-
onChange: (t) => K(J, e, t.currentTarget.value)
|
|
959
|
-
}), /* @__PURE__ */ l("button", {
|
|
960
|
-
type: "button",
|
|
961
|
-
onClick: () => K(J, e, void 0),
|
|
962
|
-
disabled: !Y(t),
|
|
963
|
-
children: "reset"
|
|
964
|
-
})]
|
|
662
|
+
}) : /* @__PURE__ */ D("div", {
|
|
663
|
+
className: "reinspect-settings-tab-panel",
|
|
664
|
+
role: "tabpanel",
|
|
665
|
+
id: "reinspect-settings-panel-settings",
|
|
666
|
+
"aria-labelledby": "reinspect-settings-tab-settings",
|
|
667
|
+
children: /* @__PURE__ */ O("section", {
|
|
668
|
+
className: "reinspect-setting-block",
|
|
669
|
+
children: [
|
|
670
|
+
/* @__PURE__ */ O("label", {
|
|
671
|
+
className: "reinspect-settings-select-row",
|
|
672
|
+
children: [/* @__PURE__ */ O("span", {
|
|
673
|
+
className: "reinspect-settings-toggle-label",
|
|
674
|
+
children: [
|
|
675
|
+
"Render counter mode",
|
|
676
|
+
" ",
|
|
677
|
+
/* @__PURE__ */ D(U, {
|
|
678
|
+
label: "?",
|
|
679
|
+
description: "Pick whether render attempts, commits, both, or no counters are shown."
|
|
680
|
+
})
|
|
681
|
+
]
|
|
682
|
+
}), /* @__PURE__ */ O("select", {
|
|
683
|
+
"data-testid": "reinspect-setting-render-counters",
|
|
684
|
+
value: v,
|
|
685
|
+
onChange: (e) => {
|
|
686
|
+
let t = e.currentTarget.value;
|
|
687
|
+
g(t) && b(t);
|
|
688
|
+
},
|
|
689
|
+
children: [
|
|
690
|
+
/* @__PURE__ */ D("option", {
|
|
691
|
+
value: "off",
|
|
692
|
+
children: "Off"
|
|
693
|
+
}),
|
|
694
|
+
/* @__PURE__ */ D("option", {
|
|
695
|
+
value: "attempts",
|
|
696
|
+
children: "Render attempts"
|
|
697
|
+
}),
|
|
698
|
+
/* @__PURE__ */ D("option", {
|
|
699
|
+
value: "commits",
|
|
700
|
+
children: "Committed renders"
|
|
701
|
+
}),
|
|
702
|
+
/* @__PURE__ */ D("option", {
|
|
703
|
+
value: "both",
|
|
704
|
+
children: "Both"
|
|
705
|
+
})
|
|
706
|
+
]
|
|
707
|
+
})]
|
|
708
|
+
}),
|
|
709
|
+
/* @__PURE__ */ D("p", {
|
|
710
|
+
className: "reinspect-setting-note",
|
|
711
|
+
children: "Per-component capture can be toggled from each component menu."
|
|
712
|
+
}),
|
|
713
|
+
/* @__PURE__ */ O("label", {
|
|
714
|
+
className: "reinspect-settings-select-row",
|
|
715
|
+
children: [/* @__PURE__ */ O("span", {
|
|
716
|
+
className: "reinspect-settings-toggle-label",
|
|
717
|
+
children: [
|
|
718
|
+
"Menu theme",
|
|
719
|
+
" ",
|
|
720
|
+
/* @__PURE__ */ D(U, {
|
|
721
|
+
label: "?",
|
|
722
|
+
description: "Choose the Reinspect menu appearance."
|
|
723
|
+
})
|
|
724
|
+
]
|
|
725
|
+
}), /* @__PURE__ */ O("select", {
|
|
726
|
+
"data-testid": "reinspect-setting-menu-theme",
|
|
727
|
+
value: w,
|
|
728
|
+
onChange: (e) => {
|
|
729
|
+
let t = e.currentTarget.value;
|
|
730
|
+
r(t) && k(t);
|
|
731
|
+
},
|
|
732
|
+
children: [/* @__PURE__ */ D("option", {
|
|
733
|
+
value: "light",
|
|
734
|
+
children: "Light"
|
|
735
|
+
}), /* @__PURE__ */ D("option", {
|
|
736
|
+
value: "dark",
|
|
737
|
+
children: "Dark"
|
|
965
738
|
})]
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
className: "reinspect-
|
|
972
|
-
children: [
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
739
|
+
})]
|
|
740
|
+
}),
|
|
741
|
+
/* @__PURE__ */ O("label", {
|
|
742
|
+
className: "reinspect-settings-select-row",
|
|
743
|
+
children: [/* @__PURE__ */ O("span", {
|
|
744
|
+
className: "reinspect-settings-toggle-label",
|
|
745
|
+
children: [
|
|
746
|
+
"Menu open trigger",
|
|
747
|
+
" ",
|
|
748
|
+
/* @__PURE__ */ D(U, {
|
|
749
|
+
label: "?",
|
|
750
|
+
description: "Choose how to open the inspector menu on components."
|
|
751
|
+
})
|
|
752
|
+
]
|
|
753
|
+
}), /* @__PURE__ */ O("select", {
|
|
754
|
+
"data-testid": "reinspect-setting-menu-open-trigger",
|
|
755
|
+
value: A.mode,
|
|
756
|
+
onChange: (e) => {
|
|
757
|
+
let t = e.currentTarget.value;
|
|
758
|
+
m(t) && j((e) => ({
|
|
759
|
+
...e,
|
|
760
|
+
mode: t
|
|
761
|
+
}));
|
|
762
|
+
},
|
|
763
|
+
children: [/* @__PURE__ */ D("option", {
|
|
764
|
+
value: "right-click",
|
|
765
|
+
children: "Right click"
|
|
766
|
+
}), /* @__PURE__ */ D("option", {
|
|
767
|
+
value: "modifier-right-click",
|
|
768
|
+
children: "Right click + modifier macro"
|
|
769
|
+
})]
|
|
770
|
+
})]
|
|
771
|
+
}),
|
|
772
|
+
A.mode === "modifier-right-click" ? /* @__PURE__ */ O("section", {
|
|
773
|
+
className: "reinspect-setting-block reinspect-macro-setting",
|
|
774
|
+
children: [
|
|
775
|
+
/* @__PURE__ */ O("p", {
|
|
776
|
+
className: "reinspect-setting-note",
|
|
777
|
+
"data-testid": "reinspect-setting-menu-open-modifier-label",
|
|
977
778
|
children: [
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
min: "0",
|
|
982
|
-
max: "1",
|
|
983
|
-
step: "0.05",
|
|
984
|
-
value: r,
|
|
985
|
-
onChange: (t) => {
|
|
986
|
-
let n = ae(t.currentTarget.value);
|
|
987
|
-
n !== void 0 && K(J, e, n);
|
|
988
|
-
}
|
|
989
|
-
}),
|
|
990
|
-
/* @__PURE__ */ l("output", { children: r.toFixed(2) }),
|
|
991
|
-
/* @__PURE__ */ l("button", {
|
|
992
|
-
type: "button",
|
|
993
|
-
onClick: () => K(J, e, void 0),
|
|
994
|
-
disabled: !Y(t),
|
|
995
|
-
children: "reset"
|
|
996
|
-
})
|
|
779
|
+
"Current macro:",
|
|
780
|
+
" ",
|
|
781
|
+
/* @__PURE__ */ D("code", { children: K(A.modifiers) })
|
|
997
782
|
]
|
|
998
|
-
})
|
|
999
|
-
|
|
1000
|
-
}
|
|
1001
|
-
if (ee.has(e)) {
|
|
1002
|
-
let r = typeof t == "number" ? t : "";
|
|
1003
|
-
return /* @__PURE__ */ u("div", {
|
|
1004
|
-
className: "reinspect-field",
|
|
1005
|
-
children: [/* @__PURE__ */ u("label", {
|
|
1006
|
-
htmlFor: n,
|
|
1007
|
-
children: [De(e), " (px)"]
|
|
1008
|
-
}), /* @__PURE__ */ u("div", {
|
|
783
|
+
}),
|
|
784
|
+
/* @__PURE__ */ O("div", {
|
|
1009
785
|
className: "reinspect-inline-controls",
|
|
1010
|
-
children: [/* @__PURE__ */
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
}
|
|
1020
|
-
let n = ae(t.currentTarget.value);
|
|
1021
|
-
n !== void 0 && K(J, e, n);
|
|
1022
|
-
}
|
|
1023
|
-
}), /* @__PURE__ */ l("button", {
|
|
786
|
+
children: [/* @__PURE__ */ D("button", {
|
|
787
|
+
type: "button",
|
|
788
|
+
"data-testid": "reinspect-setting-menu-open-modifier-record",
|
|
789
|
+
onClick: () => {
|
|
790
|
+
L((e) => !e);
|
|
791
|
+
},
|
|
792
|
+
"data-state": I ? "active" : "idle",
|
|
793
|
+
children: I ? "Press modifier keys..." : "Record macro"
|
|
794
|
+
}), /* @__PURE__ */ D("button", {
|
|
1024
795
|
type: "button",
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
796
|
+
"data-testid": "reinspect-setting-menu-open-modifier-reset",
|
|
797
|
+
onClick: () => j((e) => ({
|
|
798
|
+
...e,
|
|
799
|
+
modifiers: { ...p }
|
|
800
|
+
})),
|
|
801
|
+
children: "Reset to Shift"
|
|
1028
802
|
})]
|
|
1029
|
-
})
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
803
|
+
}),
|
|
804
|
+
/* @__PURE__ */ D("p", {
|
|
805
|
+
className: "reinspect-setting-helper-text",
|
|
806
|
+
children: "Hold one or more modifier keys (Ctrl, Alt, Shift, Meta), then press any key to save the macro."
|
|
807
|
+
})
|
|
808
|
+
]
|
|
809
|
+
}) : null,
|
|
810
|
+
/* @__PURE__ */ O("label", {
|
|
811
|
+
className: "reinspect-settings-select-row",
|
|
812
|
+
children: [/* @__PURE__ */ O("span", {
|
|
813
|
+
className: "reinspect-settings-toggle-label",
|
|
814
|
+
children: [
|
|
815
|
+
"Props JSON detail",
|
|
816
|
+
" ",
|
|
817
|
+
/* @__PURE__ */ D(U, {
|
|
818
|
+
label: "?",
|
|
819
|
+
description: "Choose how much data appears in JSON previews and the Raw props editor."
|
|
820
|
+
})
|
|
821
|
+
]
|
|
822
|
+
}), /* @__PURE__ */ O("select", {
|
|
823
|
+
"data-testid": "reinspect-setting-props-serialization-mode",
|
|
824
|
+
value: x,
|
|
825
|
+
onChange: (e) => {
|
|
826
|
+
let t = e.currentTarget.value;
|
|
827
|
+
l(t) && C(t);
|
|
828
|
+
},
|
|
829
|
+
children: [/* @__PURE__ */ D("option", {
|
|
830
|
+
value: "distilled",
|
|
831
|
+
children: "Distilled (recommended)"
|
|
832
|
+
}), /* @__PURE__ */ D("option", {
|
|
833
|
+
value: "complete",
|
|
834
|
+
children: "Complete (includes internals)"
|
|
1049
835
|
})]
|
|
1050
836
|
})]
|
|
1051
|
-
}, e);
|
|
1052
|
-
})
|
|
1053
|
-
}),
|
|
1054
|
-
Ve.length === 0 ? /* @__PURE__ */ u("p", {
|
|
1055
|
-
className: "reinspect-menu-empty-state",
|
|
1056
|
-
children: [
|
|
1057
|
-
"No CSS properties match \"",
|
|
1058
|
-
T.trim(),
|
|
1059
|
-
"\"."
|
|
1060
|
-
]
|
|
1061
|
-
}) : null
|
|
1062
|
-
] }) : /* @__PURE__ */ u("div", {
|
|
1063
|
-
className: "reinspect-props-panel",
|
|
1064
|
-
children: [
|
|
1065
|
-
/* @__PURE__ */ u("div", {
|
|
1066
|
-
className: "reinspect-props-submenu",
|
|
1067
|
-
children: [/* @__PURE__ */ l("button", {
|
|
1068
|
-
type: "button",
|
|
1069
|
-
"data-state": C === "detected" ? "active" : "idle",
|
|
1070
|
-
onClick: () => w("detected"),
|
|
1071
|
-
children: "Detected"
|
|
1072
|
-
}), /* @__PURE__ */ l("button", {
|
|
1073
|
-
type: "button",
|
|
1074
|
-
"data-state": C === "raw" ? "active" : "idle",
|
|
1075
|
-
onClick: () => {
|
|
1076
|
-
w("raw"), A(null), k(he(ze));
|
|
1077
|
-
},
|
|
1078
|
-
children: "Raw"
|
|
1079
|
-
})]
|
|
1080
|
-
}),
|
|
1081
|
-
C === "detected" ? He.length > 0 ? /* @__PURE__ */ u("div", {
|
|
1082
|
-
className: "reinspect-props-table",
|
|
1083
|
-
children: [/* @__PURE__ */ u("div", {
|
|
1084
|
-
className: "reinspect-props-header",
|
|
1085
|
-
children: [/* @__PURE__ */ l("span", { children: "Key" }), /* @__PURE__ */ l("span", { children: "Value" })]
|
|
1086
|
-
}), He.map((e) => {
|
|
1087
|
-
let t = ke(e.key), n = ze[e.key], r = e.value.kind === "object" || e.value.kind === "array", i = !!le[e.key], a = N[e.key], o = se[e.key], s = _e(n);
|
|
1088
|
-
return /* @__PURE__ */ u("div", {
|
|
1089
|
-
className: "reinspect-props-row",
|
|
1090
|
-
"data-testid": `reinspect-prop-row-${t}`,
|
|
1091
|
-
children: [/* @__PURE__ */ l("code", {
|
|
1092
|
-
className: "reinspect-prop-key",
|
|
1093
|
-
children: e.key
|
|
1094
|
-
}), /* @__PURE__ */ u("div", {
|
|
1095
|
-
className: "reinspect-prop-cell",
|
|
1096
|
-
"data-testid": `reinspect-prop-value-${t}`,
|
|
1097
|
-
children: [
|
|
1098
|
-
je({
|
|
1099
|
-
value: e.value,
|
|
1100
|
-
onCopy: qe
|
|
1101
|
-
}),
|
|
1102
|
-
r || s ? /* @__PURE__ */ u("div", {
|
|
1103
|
-
className: "reinspect-prop-actions",
|
|
1104
|
-
children: [r ? /* @__PURE__ */ l("button", {
|
|
1105
|
-
type: "button",
|
|
1106
|
-
"data-testid": `reinspect-prop-show-json-${t}`,
|
|
1107
|
-
onClick: () => Je(e.key, n),
|
|
1108
|
-
children: i ? "Hide JSON" : "Show JSON"
|
|
1109
|
-
}) : null, s ? /* @__PURE__ */ l("button", {
|
|
1110
|
-
type: "button",
|
|
1111
|
-
"data-testid": `reinspect-prop-edit-${t}`,
|
|
1112
|
-
onClick: () => Ye(e.key, n),
|
|
1113
|
-
children: "Edit"
|
|
1114
|
-
}) : null]
|
|
1115
|
-
}) : null,
|
|
1116
|
-
i ? /* @__PURE__ */ l("div", {
|
|
1117
|
-
className: "reinspect-prop-json-preview",
|
|
1118
|
-
"data-testid": `reinspect-prop-json-preview-${t}`,
|
|
1119
|
-
children: o ? /* @__PURE__ */ l("p", {
|
|
1120
|
-
className: "reinspect-error",
|
|
1121
|
-
children: o
|
|
1122
|
-
}) : /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("pre", { children: a }), a ? /* @__PURE__ */ l("button", {
|
|
1123
|
-
type: "button",
|
|
1124
|
-
"data-testid": `reinspect-prop-copy-json-${t}`,
|
|
1125
|
-
onClick: () => qe(a, "JSON value"),
|
|
1126
|
-
children: "Copy JSON"
|
|
1127
|
-
}) : null] })
|
|
1128
|
-
}) : null
|
|
1129
|
-
]
|
|
1130
|
-
})]
|
|
1131
|
-
}, e.key);
|
|
1132
|
-
})]
|
|
1133
|
-
}) : /* @__PURE__ */ l("p", {
|
|
1134
|
-
className: "reinspect-menu-empty-state",
|
|
1135
|
-
children: "No props detected."
|
|
1136
|
-
}) : /* @__PURE__ */ u(c, { children: [
|
|
1137
|
-
/* @__PURE__ */ l("label", {
|
|
1138
|
-
htmlFor: `${J}-props-json`,
|
|
1139
|
-
children: "Props JSON"
|
|
1140
837
|
}),
|
|
1141
|
-
/* @__PURE__ */
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
onChange: (e) => {
|
|
1145
|
-
k(e.currentTarget.value), A(null);
|
|
1146
|
-
},
|
|
1147
|
-
rows: 9
|
|
1148
|
-
}),
|
|
1149
|
-
ne ? /* @__PURE__ */ l("p", {
|
|
1150
|
-
className: "reinspect-error",
|
|
1151
|
-
children: ne
|
|
1152
|
-
}) : null,
|
|
1153
|
-
/* @__PURE__ */ u("div", {
|
|
1154
|
-
className: "reinspect-inline-controls",
|
|
1155
|
-
children: [/* @__PURE__ */ l("button", {
|
|
1156
|
-
type: "button",
|
|
1157
|
-
onClick: Ge,
|
|
1158
|
-
children: "apply"
|
|
1159
|
-
}), /* @__PURE__ */ l("button", {
|
|
1160
|
-
type: "button",
|
|
1161
|
-
onClick: Ke,
|
|
1162
|
-
children: "reset"
|
|
1163
|
-
})]
|
|
838
|
+
/* @__PURE__ */ D("p", {
|
|
839
|
+
className: "reinspect-setting-helper-text",
|
|
840
|
+
children: x === "distilled" ? "Shows app-level props first and hides React internals like _owner." : "Shows the full object graph, including React internals and metadata."
|
|
1164
841
|
})
|
|
1165
|
-
]
|
|
1166
|
-
j ? /* @__PURE__ */ l("p", {
|
|
1167
|
-
className: "reinspect-setting-note",
|
|
1168
|
-
"data-testid": "reinspect-props-copy-status",
|
|
1169
|
-
children: j
|
|
1170
|
-
}) : null
|
|
1171
|
-
]
|
|
1172
|
-
})
|
|
1173
|
-
]
|
|
1174
|
-
}) : null, Qe = F ? d(/* @__PURE__ */ l("div", {
|
|
1175
|
-
className: "reinspect-modal-backdrop",
|
|
1176
|
-
role: "dialog",
|
|
1177
|
-
"aria-modal": "true",
|
|
1178
|
-
"aria-label": `Edit ${F} prop`,
|
|
1179
|
-
"data-testid": "reinspect-prop-edit-modal",
|
|
1180
|
-
children: /* @__PURE__ */ u("div", {
|
|
1181
|
-
className: "reinspect-modal",
|
|
1182
|
-
ref: _,
|
|
1183
|
-
children: [
|
|
1184
|
-
/* @__PURE__ */ u("p", {
|
|
1185
|
-
className: "reinspect-menu-title",
|
|
1186
|
-
children: ["Edit prop: ", F]
|
|
1187
|
-
}),
|
|
1188
|
-
/* @__PURE__ */ l("label", {
|
|
1189
|
-
htmlFor: `${J}-prop-edit-json`,
|
|
1190
|
-
children: "JSON value"
|
|
1191
|
-
}),
|
|
1192
|
-
/* @__PURE__ */ l("textarea", {
|
|
1193
|
-
id: `${J}-prop-edit-json`,
|
|
1194
|
-
"data-testid": "reinspect-prop-edit-textarea",
|
|
1195
|
-
value: L,
|
|
1196
|
-
onChange: (e) => {
|
|
1197
|
-
R(e.currentTarget.value), B(null);
|
|
1198
|
-
},
|
|
1199
|
-
rows: 10
|
|
1200
|
-
}),
|
|
1201
|
-
z ? /* @__PURE__ */ l("p", {
|
|
1202
|
-
className: "reinspect-error",
|
|
1203
|
-
"data-testid": "reinspect-prop-edit-error",
|
|
1204
|
-
children: z
|
|
1205
|
-
}) : null,
|
|
1206
|
-
/* @__PURE__ */ u("div", {
|
|
1207
|
-
className: "reinspect-inline-controls",
|
|
1208
|
-
children: [/* @__PURE__ */ l("button", {
|
|
1209
|
-
type: "button",
|
|
1210
|
-
onClick: Xe,
|
|
1211
|
-
children: "apply"
|
|
1212
|
-
}), /* @__PURE__ */ l("button", {
|
|
1213
|
-
type: "button",
|
|
1214
|
-
onClick: () => {
|
|
1215
|
-
I(null), R(""), B(null);
|
|
1216
|
-
},
|
|
1217
|
-
children: "cancel"
|
|
1218
|
-
})]
|
|
842
|
+
]
|
|
1219
843
|
})
|
|
1220
|
-
]
|
|
1221
|
-
})
|
|
1222
|
-
}), document.body) : null;
|
|
1223
|
-
if (!H) {
|
|
1224
|
-
if (a === "manual") throw Error("useReinspect must be used within ReinspectProvider");
|
|
1225
|
-
return /* @__PURE__ */ l(m, { ...Q });
|
|
1226
|
-
}
|
|
1227
|
-
return a === "auto" && !X ? /* @__PURE__ */ l(m, { ...Q }) : /* @__PURE__ */ u("div", {
|
|
1228
|
-
className: "reinspect-shell",
|
|
1229
|
-
"data-reinspect-component": h,
|
|
1230
|
-
"data-reinspect-active": Z,
|
|
1231
|
-
"data-testid": `reinspect-shell-${h}`,
|
|
1232
|
-
style: Ue,
|
|
1233
|
-
onContextMenu: We,
|
|
1234
|
-
children: [
|
|
1235
|
-
Z ? /* @__PURE__ */ u("span", {
|
|
1236
|
-
className: "reinspect-name-badge",
|
|
1237
|
-
children: [h, Pe ? ` | ${Ee(Ie, pe)}` : ""]
|
|
1238
|
-
}) : null,
|
|
1239
|
-
Ze ? d(Ze, document.body) : null,
|
|
1240
|
-
Qe,
|
|
1241
|
-
/* @__PURE__ */ l("div", {
|
|
1242
|
-
className: "reinspect-content",
|
|
1243
|
-
"data-reinspect-content": "true",
|
|
1244
|
-
style: Re,
|
|
1245
|
-
children: /* @__PURE__ */ l(m, { ...Q })
|
|
1246
844
|
})
|
|
1247
845
|
]
|
|
1248
|
-
})
|
|
1249
|
-
}
|
|
1250
|
-
return _.displayName = `withReinspect(${h})`, _[be] = {
|
|
1251
|
-
source: a,
|
|
1252
|
-
scope: f,
|
|
1253
|
-
original: m
|
|
1254
|
-
}, _;
|
|
1255
|
-
}
|
|
1256
|
-
//#endregion
|
|
1257
|
-
//#region src/reinspect/autoWrap.ts
|
|
1258
|
-
function Z(e, t) {
|
|
1259
|
-
return xe(e)?.source === "manual" ? e : X(e, {
|
|
1260
|
-
source: "auto",
|
|
1261
|
-
scope: t.scope,
|
|
1262
|
-
name: t.componentName,
|
|
1263
|
-
fallbackName: t.fallbackName
|
|
1264
|
-
});
|
|
846
|
+
}) : null]
|
|
847
|
+
}) : null;
|
|
1265
848
|
}
|
|
1266
849
|
//#endregion
|
|
1267
|
-
//#region src/reinspect/
|
|
1268
|
-
function
|
|
1269
|
-
let n = {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
return n;
|
|
850
|
+
//#region src/reinspect/withReinspect.tsx
|
|
851
|
+
function Q(e, t) {
|
|
852
|
+
let n = {
|
|
853
|
+
source: "manual",
|
|
854
|
+
scope: "first-party"
|
|
855
|
+
};
|
|
856
|
+
return t?.name && (n.componentName = t.name), h(e, n);
|
|
1275
857
|
}
|
|
1276
858
|
//#endregion
|
|
1277
859
|
//#region src/reinspect/index.ts
|
|
1278
|
-
|
|
860
|
+
M(k);
|
|
1279
861
|
//#endregion
|
|
1280
|
-
export {
|
|
862
|
+
export { X as ReinspectProvider, z as useReinspect, Q as withReinspect };
|