react-reinspect 0.1.0

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.
@@ -0,0 +1,31 @@
1
+ export declare const REINSPECT_PLACEHOLDER_KEY = "__reinspect_placeholder__";
2
+ export type InspectedValueKind = 'null' | 'undefined' | 'boolean' | 'number' | 'string' | 'bigint' | 'symbol' | 'function' | 'date' | 'regexp' | 'array' | 'object' | 'unknown';
3
+ export interface InspectedFunctionMeta {
4
+ name: string;
5
+ arity: number;
6
+ preview: string;
7
+ source: string;
8
+ }
9
+ export interface InspectedValueDescriptor {
10
+ kind: InspectedValueKind;
11
+ summary: string;
12
+ copyText?: string;
13
+ functionMeta?: InspectedFunctionMeta;
14
+ }
15
+ export interface DetectedPropsRow {
16
+ key: string;
17
+ value: InspectedValueDescriptor;
18
+ }
19
+ export declare function buildDetectedPropsRows(props: Record<string, unknown>): DetectedPropsRow[];
20
+ export declare function serializePropsForRawEditor(props: Record<string, unknown>): string;
21
+ export declare function serializeValueForJson(value: unknown): string | null;
22
+ export declare function isEditablePropValue(value: unknown): boolean;
23
+ export declare function parseEditablePropValueInput(input: string): {
24
+ parsed: unknown | null;
25
+ error: string | null;
26
+ };
27
+ export declare function parsePropsOverridesInput(input: string): {
28
+ parsed: Record<string, unknown> | null;
29
+ error: string | null;
30
+ };
31
+ //# sourceMappingURL=propsInspector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propsInspector.d.ts","sourceRoot":"","sources":["../../src/reinspect/propsInspector.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AAmBpE,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,WAAW,GACX,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,MAAM,GACN,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,CAAA;AAEb,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,kBAAkB,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,qBAAqB,CAAA;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,wBAAwB,CAAA;CAChC;AAmUD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,gBAAgB,EAAE,CAKpB;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,CAGR;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAEnE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAmB3D;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG;IAC1D,MAAM,EAAE,OAAO,GAAG,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CA8BA;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG;IACvD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CA4CA"}
@@ -0,0 +1,3 @@
1
+ import type { ReinspectContextValue } from './types';
2
+ export declare const ReinspectContext: import("react").Context<ReinspectContextValue | null>;
3
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/reinspect/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,eAAO,MAAM,gBAAgB,uDAAoD,CAAA"}
@@ -0,0 +1,2 @@
1
+ .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}
2
+ /*$vite$:1*/
@@ -0,0 +1,57 @@
1
+ import type { CSSProperties, Dispatch, ReactNode, SetStateAction } from 'react';
2
+ export type InspectMode = 'wrapped' | 'first-party' | 'all';
3
+ export type AutoDiscoverScope = 'first-party' | 'third-party';
4
+ export type RenderCaptureMode = 'attempts' | 'commits' | 'both';
5
+ export type EditableStyleProp = 'backgroundColor' | 'color' | 'fontSize' | 'padding' | 'margin' | 'borderRadius' | 'borderWidth' | 'borderColor' | 'opacity' | 'width' | 'height' | 'gap';
6
+ export type StyleOverrideValue = string | number;
7
+ export type ComponentStyleOverrides = Partial<Record<EditableStyleProp, StyleOverrideValue>>;
8
+ export interface ReinspectConfig {
9
+ enabled?: boolean;
10
+ startActive?: boolean;
11
+ showFloatingToggle?: boolean;
12
+ inspectMode?: InspectMode;
13
+ editableProps?: EditableStyleProp[];
14
+ palette?: string[];
15
+ zIndexBase?: number;
16
+ shouldCountRenders?: boolean;
17
+ countRendersForComponents?: string[];
18
+ renderCaptureMode?: RenderCaptureMode;
19
+ }
20
+ export interface ResolvedReinspectConfig {
21
+ enabled: boolean;
22
+ startActive: boolean;
23
+ showFloatingToggle: boolean;
24
+ inspectMode: InspectMode;
25
+ editableProps: EditableStyleProp[];
26
+ palette: string[];
27
+ zIndexBase: number;
28
+ shouldCountRenders: boolean;
29
+ countRendersForComponents: string[];
30
+ renderCaptureMode: RenderCaptureMode;
31
+ }
32
+ export interface ReinspectContextValue {
33
+ config: ResolvedReinspectConfig;
34
+ isActive: boolean;
35
+ setIsActive: Dispatch<SetStateAction<boolean>>;
36
+ inspectMode: InspectMode;
37
+ pendingInspectMode: InspectMode;
38
+ setPendingInspectMode: Dispatch<SetStateAction<InspectMode>>;
39
+ hasPendingInspectModeChange: boolean;
40
+ applyInspectMode: () => void;
41
+ shouldCountRenders: boolean;
42
+ setShouldCountRenders: Dispatch<SetStateAction<boolean>>;
43
+ renderCaptureMode: RenderCaptureMode;
44
+ setRenderCaptureMode: Dispatch<SetStateAction<RenderCaptureMode>>;
45
+ renderCountComponents: Record<string, boolean>;
46
+ setRenderCountingForComponent: (componentName: string, enabled: boolean) => void;
47
+ isRenderCountingEnabledFor: (componentName: string) => boolean;
48
+ overrides: Record<string, ComponentStyleOverrides>;
49
+ updateOverride: (componentId: string, prop: EditableStyleProp, value: StyleOverrideValue | undefined) => void;
50
+ getBorderColor: (componentName: string) => string;
51
+ }
52
+ export interface ReinspectProviderProps {
53
+ children: ReactNode;
54
+ config?: ReinspectConfig;
55
+ }
56
+ export type InlineStyleOverrides = CSSProperties;
57
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/reinspect/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE/E,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,KAAK,CAAA;AAC3D,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,aAAa,CAAA;AAC7D,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;AAE/D,MAAM,MAAM,iBAAiB,GACzB,iBAAiB,GACjB,OAAO,GACP,UAAU,GACV,SAAS,GACT,QAAQ,GACR,cAAc,GACd,aAAa,GACb,aAAa,GACb,SAAS,GACT,OAAO,GACP,QAAQ,GACR,KAAK,CAAA;AAET,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAA;AAEhD,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAC3C,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAC9C,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAA;IACnC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAA;IACpC,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,WAAW,EAAE,WAAW,CAAA;IACxB,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,yBAAyB,EAAE,MAAM,EAAE,CAAA;IACnC,iBAAiB,EAAE,iBAAiB,CAAA;CACrC;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,uBAAuB,CAAA;IAC/B,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,WAAW,EAAE,WAAW,CAAA;IACxB,kBAAkB,EAAE,WAAW,CAAA;IAC/B,qBAAqB,EAAE,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAA;IAC5D,2BAA2B,EAAE,OAAO,CAAA;IACpC,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,kBAAkB,EAAE,OAAO,CAAA;IAC3B,qBAAqB,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IACxD,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,oBAAoB,EAAE,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAA;IACjE,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9C,6BAA6B,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAChF,0BAA0B,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAA;IAC9D,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;IAClD,cAAc,EAAE,CACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,kBAAkB,GAAG,SAAS,KAClC,IAAI,CAAA;IACT,cAAc,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAA;CAClD;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,eAAe,CAAA;CACzB;AAED,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { ReinspectContextValue } from './types';
2
+ export declare function useReinspect(): ReinspectContextValue;
3
+ //# sourceMappingURL=useReinspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useReinspect.d.ts","sourceRoot":"","sources":["../../src/reinspect/useReinspect.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,wBAAgB,YAAY,IAAI,qBAAqB,CAOpD"}
@@ -0,0 +1,13 @@
1
+ import type { ComponentStyleOverrides, EditableStyleProp, InspectMode, RenderCaptureMode, ReinspectConfig, ResolvedReinspectConfig } from './types';
2
+ export declare const REINSPECT_INSPECT_MODE_STORAGE_KEY = "reinspect.inspectMode";
3
+ export declare function isInspectMode(value: unknown): value is InspectMode;
4
+ export declare function isRenderCaptureMode(value: unknown): value is RenderCaptureMode;
5
+ export declare function resolveInspectMode(configInspectMode: InspectMode | undefined): InspectMode;
6
+ export declare function persistInspectMode(mode: InspectMode): void;
7
+ export declare function reloadWindow(): void;
8
+ export declare function resolveReinspectConfig(config?: ReinspectConfig): ResolvedReinspectConfig;
9
+ export declare function pickColorByComponentName(componentName: string, palette: string[]): string;
10
+ export declare function buildInlineStyleOverrides(overrides: ComponentStyleOverrides | undefined, editableProps: EditableStyleProp[]): Record<string, string | number>;
11
+ export declare function normalizeHexColor(value: string | undefined): string;
12
+ export declare function parseNumberInput(input: string): number | undefined;
13
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/reinspect/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAIhB,eAAO,MAAM,kCAAkC,0BAA0B,CAAA;AAazE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAKlE;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,iBAAiB,CAK5B;AAkBD,wBAAgB,kBAAkB,CAChC,iBAAiB,EAAE,WAAW,GAAG,SAAS,GACzC,WAAW,CAWb;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAU1D;AAED,wBAAgB,YAAY,IAAI,IAAI,CAUnC;AAED,wBAAgB,sBAAsB,CACpC,MAAM,GAAE,eAAoB,GAC3B,uBAAuB,CAyBzB;AAWD,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EAAE,GAChB,MAAM,CAMR;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,uBAAuB,GAAG,SAAS,EAC9C,aAAa,EAAE,iBAAiB,EAAE,GACjC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAejC;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAenE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOlE"}
@@ -0,0 +1,11 @@
1
+ import { type ComponentType } from 'react';
2
+ import type { AutoDiscoverScope } from './types';
3
+ import { type ReinspectWrapSource } from './wrapMarker';
4
+ export interface WithReinspectOptions {
5
+ name?: string;
6
+ fallbackName?: string;
7
+ source?: ReinspectWrapSource;
8
+ scope?: AutoDiscoverScope;
9
+ }
10
+ export declare function withReinspect<P extends object>(Component: ComponentType<P>, options?: WithReinspectOptions): ComponentType<P>;
11
+ //# sourceMappingURL=withReinspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withReinspect.d.ts","sourceRoot":"","sources":["../../src/reinspect/withReinspect.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EASnB,MAAM,OAAO,CAAA;AAsBd,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,SAAS,CAAA;AAChB,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B,KAAK,CAAC,EAAE,iBAAiB,CAAA;CAC1B;AAkOD,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAC5C,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,OAAO,CAAC,EAAE,oBAAoB,GAC7B,aAAa,CAAC,CAAC,CAAC,CAgxBlB"}
@@ -0,0 +1,9 @@
1
+ import type { ComponentType } from 'react';
2
+ import { type WithReinspectOptions } from './withReinspect';
3
+ type ComponentMap = Record<string, ComponentType<any>>;
4
+ type WrapInspectableMapOptions<T extends ComponentMap> = Partial<Record<keyof T, WithReinspectOptions>> | ((key: keyof T, component: T[keyof T]) => WithReinspectOptions | undefined);
5
+ export declare function wrapInspectableMap<T extends ComponentMap>(componentMap: T, options?: WrapInspectableMapOptions<T>): {
6
+ [K in keyof T]: T[K];
7
+ };
8
+ export {};
9
+ //# sourceMappingURL=wrapInspectableMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapInspectableMap.d.ts","sourceRoot":"","sources":["../../src/reinspect/wrapInspectableMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAI1E,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAA;AAEtD,KAAK,yBAAyB,CAAC,CAAC,SAAS,YAAY,IACjD,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC,CAAC,GAC9C,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,oBAAoB,GAAG,SAAS,CAAC,CAAA;AAE/E,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,YAAY,EACvD,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACrC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAY1B"}
@@ -0,0 +1,11 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { AutoDiscoverScope } from './types';
3
+ export type ReinspectWrapSource = 'manual' | 'auto';
4
+ export interface ReinspectWrappedMetadata {
5
+ source: ReinspectWrapSource;
6
+ scope: AutoDiscoverScope;
7
+ original: ComponentType<any>;
8
+ }
9
+ export declare const REINSPECT_WRAPPED_SYMBOL: unique symbol;
10
+ export declare function getReinspectWrappedMetadata(component: ComponentType<any>): ReinspectWrappedMetadata | undefined;
11
+ //# sourceMappingURL=wrapMarker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapMarker.d.ts","sourceRoot":"","sources":["../../src/reinspect/wrapMarker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEnD,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,mBAAmB,CAAA;IAC3B,KAAK,EAAE,iBAAiB,CAAA;IAExB,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,CAAA;CAC7B;AAED,eAAO,MAAM,wBAAwB,eAAkC,CAAA;AAEvE,wBAAgB,2BAA2B,CAEzC,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,GAC5B,wBAAwB,GAAG,SAAS,CAQtC"}
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "react-reinspect",
3
+ "version": "0.1.0",
4
+ "description": "Visual runtime inspector for React components with render counters and style overrides.",
5
+ "keywords": [
6
+ "react",
7
+ "debug",
8
+ "devtools",
9
+ "inspector"
10
+ ],
11
+ "license": "MIT",
12
+ "type": "module",
13
+ "main": "./dist/lib/index.cjs",
14
+ "module": "./dist/lib/index.js",
15
+ "types": "./dist/lib/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/lib/index.d.ts",
19
+ "import": "./dist/lib/index.js",
20
+ "require": "./dist/lib/index.cjs"
21
+ },
22
+ "./style.css": "./dist/lib/style.css"
23
+ },
24
+ "files": [
25
+ "dist/lib",
26
+ "README.md"
27
+ ],
28
+ "sideEffects": [
29
+ "**/*.css"
30
+ ],
31
+ "scripts": {
32
+ "dev": "vite",
33
+ "build": "tsc -b && vite build",
34
+ "build:lib": "vite build -c vite.lib.config.ts && tsc -p tsconfig.lib.json",
35
+ "lint": "eslint .",
36
+ "preview": "vite preview",
37
+ "pack:check": "npm pack --dry-run --cache ./.cache/npm",
38
+ "publish:npm": "npm publish --access public --cache ./.cache/npm",
39
+ "prepublishOnly": "pnpm build:lib",
40
+ "test": "vitest run",
41
+ "test:watch": "vitest"
42
+ },
43
+ "peerDependencies": {
44
+ "react": ">=18",
45
+ "react-dom": ">=18"
46
+ },
47
+ "devDependencies": {
48
+ "@babel/generator": "^7.29.1",
49
+ "@babel/parser": "^7.29.2",
50
+ "@babel/traverse": "^7.29.0",
51
+ "@babel/types": "^7.29.0",
52
+ "@eslint/js": "^9.39.4",
53
+ "@testing-library/jest-dom": "^6.9.1",
54
+ "@testing-library/react": "^16.3.2",
55
+ "@testing-library/user-event": "^14.6.1",
56
+ "@types/babel__generator": "^7.27.0",
57
+ "@types/node": "^24.12.2",
58
+ "@types/react": "^19.2.14",
59
+ "@types/react-dom": "^19.2.3",
60
+ "@vitejs/plugin-react": "^6.0.1",
61
+ "eslint": "^9.39.4",
62
+ "eslint-plugin-react-hooks": "^7.0.1",
63
+ "eslint-plugin-react-refresh": "^0.5.2",
64
+ "globals": "^17.4.0",
65
+ "jsdom": "^29.0.2",
66
+ "magic-string": "^0.30.21",
67
+ "typescript": "~6.0.2",
68
+ "typescript-eslint": "^8.58.0",
69
+ "vite": "^8.0.4",
70
+ "vitest": "^4.1.4",
71
+ "react": "^19.2.4",
72
+ "react-dom": "^19.2.4"
73
+ }
74
+ }