@dwntgrnd/devlens 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.
- package/LICENSE +21 -0
- package/README.md +318 -0
- package/dist/DevLensDrawer-VWGWB7ZJ.mjs +4569 -0
- package/dist/chunk-LWQVUC3L.mjs +94 -0
- package/dist/index.css +1148 -0
- package/dist/index.d.mts +75 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.js +5009 -0
- package/dist/index.mjs +25 -0
- package/package.json +59 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* DevLens configuration types.
|
|
6
|
+
* All config is optional — the package ships with sensible defaults.
|
|
7
|
+
*/
|
|
8
|
+
type TokenType = 'hsl-color' | 'length' | 'shadow' | 'font-size' | 'other';
|
|
9
|
+
interface TokenOverride {
|
|
10
|
+
label?: string;
|
|
11
|
+
group?: string;
|
|
12
|
+
type?: TokenType;
|
|
13
|
+
hint?: string;
|
|
14
|
+
usedBy?: string[];
|
|
15
|
+
hidden?: boolean;
|
|
16
|
+
managedByScale?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface ScaleBaselineMapping {
|
|
19
|
+
/** CSS selector — 'h1', 'h2', 'p', etc. */
|
|
20
|
+
selector: string;
|
|
21
|
+
/** CSS variable for font-size — '--font-size-page-title' */
|
|
22
|
+
fontSizeVar: string;
|
|
23
|
+
/** CSS variable for line-height — '--line-height-page-title' */
|
|
24
|
+
lineHeightVar: string;
|
|
25
|
+
/** Font weight (omit to inherit) */
|
|
26
|
+
fontWeight?: number;
|
|
27
|
+
/** Human-readable label for the scale step */
|
|
28
|
+
scaleLabel: string;
|
|
29
|
+
}
|
|
30
|
+
interface ScaleBaselineConfig {
|
|
31
|
+
mapping: ScaleBaselineMapping[];
|
|
32
|
+
}
|
|
33
|
+
interface MigrationEntry {
|
|
34
|
+
/** Suggested replacement class */
|
|
35
|
+
replacement: string;
|
|
36
|
+
/** Why this migration is recommended */
|
|
37
|
+
reason?: string;
|
|
38
|
+
/** Confidence level for this suggestion */
|
|
39
|
+
confidence?: 'high' | 'medium';
|
|
40
|
+
}
|
|
41
|
+
interface DevLensConfig {
|
|
42
|
+
/** Project-specific token overrides (labels, groups, hints, visibility) */
|
|
43
|
+
tokenOverrides?: Record<string, TokenOverride>;
|
|
44
|
+
/** Additional token groups beyond the built-in defaults */
|
|
45
|
+
tokenGroups?: string[];
|
|
46
|
+
/** Scale baseline mappings (HTML element → expected token) */
|
|
47
|
+
scaleBaseline?: ScaleBaselineConfig;
|
|
48
|
+
/** Token migration suggestions (hardcoded class → token class) */
|
|
49
|
+
migrationMap?: Record<string, MigrationEntry>;
|
|
50
|
+
/** Project-specific text size classes for typography detection */
|
|
51
|
+
projectTextSizeClasses?: string[];
|
|
52
|
+
/** Namespace for localStorage keys and BroadcastChannel (default: 'devlens') */
|
|
53
|
+
namespace?: string;
|
|
54
|
+
/** Route path for detached window (default: '/dev/devlens-detached') */
|
|
55
|
+
detachedRoute?: string;
|
|
56
|
+
/** Font family for preview text (default: 'inherit') */
|
|
57
|
+
previewFontFamily?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface DevLensProps extends DevLensConfig {
|
|
61
|
+
/** Force enable outside dev mode (default: false) */
|
|
62
|
+
forceEnable?: boolean;
|
|
63
|
+
}
|
|
64
|
+
declare function DevLens({ forceEnable, ...config }: DevLensProps): react_jsx_runtime.JSX.Element | null;
|
|
65
|
+
|
|
66
|
+
interface DevLensContextValue extends Required<DevLensConfig> {
|
|
67
|
+
}
|
|
68
|
+
interface DevLensProviderProps extends DevLensConfig {
|
|
69
|
+
children: React.ReactNode;
|
|
70
|
+
}
|
|
71
|
+
declare function DevLensProvider({ children, ...config }: DevLensProviderProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
|
|
73
|
+
declare function useDevLensConfig(): DevLensContextValue;
|
|
74
|
+
|
|
75
|
+
export { DevLens, type DevLensConfig, type DevLensProps, DevLensProvider, type MigrationEntry, type ScaleBaselineConfig, type ScaleBaselineMapping, type TokenOverride, type TokenType, useDevLensConfig };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* DevLens configuration types.
|
|
6
|
+
* All config is optional — the package ships with sensible defaults.
|
|
7
|
+
*/
|
|
8
|
+
type TokenType = 'hsl-color' | 'length' | 'shadow' | 'font-size' | 'other';
|
|
9
|
+
interface TokenOverride {
|
|
10
|
+
label?: string;
|
|
11
|
+
group?: string;
|
|
12
|
+
type?: TokenType;
|
|
13
|
+
hint?: string;
|
|
14
|
+
usedBy?: string[];
|
|
15
|
+
hidden?: boolean;
|
|
16
|
+
managedByScale?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface ScaleBaselineMapping {
|
|
19
|
+
/** CSS selector — 'h1', 'h2', 'p', etc. */
|
|
20
|
+
selector: string;
|
|
21
|
+
/** CSS variable for font-size — '--font-size-page-title' */
|
|
22
|
+
fontSizeVar: string;
|
|
23
|
+
/** CSS variable for line-height — '--line-height-page-title' */
|
|
24
|
+
lineHeightVar: string;
|
|
25
|
+
/** Font weight (omit to inherit) */
|
|
26
|
+
fontWeight?: number;
|
|
27
|
+
/** Human-readable label for the scale step */
|
|
28
|
+
scaleLabel: string;
|
|
29
|
+
}
|
|
30
|
+
interface ScaleBaselineConfig {
|
|
31
|
+
mapping: ScaleBaselineMapping[];
|
|
32
|
+
}
|
|
33
|
+
interface MigrationEntry {
|
|
34
|
+
/** Suggested replacement class */
|
|
35
|
+
replacement: string;
|
|
36
|
+
/** Why this migration is recommended */
|
|
37
|
+
reason?: string;
|
|
38
|
+
/** Confidence level for this suggestion */
|
|
39
|
+
confidence?: 'high' | 'medium';
|
|
40
|
+
}
|
|
41
|
+
interface DevLensConfig {
|
|
42
|
+
/** Project-specific token overrides (labels, groups, hints, visibility) */
|
|
43
|
+
tokenOverrides?: Record<string, TokenOverride>;
|
|
44
|
+
/** Additional token groups beyond the built-in defaults */
|
|
45
|
+
tokenGroups?: string[];
|
|
46
|
+
/** Scale baseline mappings (HTML element → expected token) */
|
|
47
|
+
scaleBaseline?: ScaleBaselineConfig;
|
|
48
|
+
/** Token migration suggestions (hardcoded class → token class) */
|
|
49
|
+
migrationMap?: Record<string, MigrationEntry>;
|
|
50
|
+
/** Project-specific text size classes for typography detection */
|
|
51
|
+
projectTextSizeClasses?: string[];
|
|
52
|
+
/** Namespace for localStorage keys and BroadcastChannel (default: 'devlens') */
|
|
53
|
+
namespace?: string;
|
|
54
|
+
/** Route path for detached window (default: '/dev/devlens-detached') */
|
|
55
|
+
detachedRoute?: string;
|
|
56
|
+
/** Font family for preview text (default: 'inherit') */
|
|
57
|
+
previewFontFamily?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface DevLensProps extends DevLensConfig {
|
|
61
|
+
/** Force enable outside dev mode (default: false) */
|
|
62
|
+
forceEnable?: boolean;
|
|
63
|
+
}
|
|
64
|
+
declare function DevLens({ forceEnable, ...config }: DevLensProps): react_jsx_runtime.JSX.Element | null;
|
|
65
|
+
|
|
66
|
+
interface DevLensContextValue extends Required<DevLensConfig> {
|
|
67
|
+
}
|
|
68
|
+
interface DevLensProviderProps extends DevLensConfig {
|
|
69
|
+
children: React.ReactNode;
|
|
70
|
+
}
|
|
71
|
+
declare function DevLensProvider({ children, ...config }: DevLensProviderProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
|
|
73
|
+
declare function useDevLensConfig(): DevLensContextValue;
|
|
74
|
+
|
|
75
|
+
export { DevLens, type DevLensConfig, type DevLensProps, DevLensProvider, type MigrationEntry, type ScaleBaselineConfig, type ScaleBaselineMapping, type TokenOverride, type TokenType, useDevLensConfig };
|