gap-inspector 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 +86 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +878 -0
- package/dist/measurement.d.ts +79 -0
- package/dist/measurement.js +1209 -0
- package/dist/styles.d.ts +1 -0
- package/dist/styles.js +620 -0
- package/package.json +55 -0
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const gapInspectorStyles = "\n.gi-root,\n.gi-svg {\n --gi-chrome: #131313;\n --gi-surface: #1a1a1a;\n --gi-well: #0d0d0d;\n --gi-text: #f7f7f7;\n --gi-text-secondary: #c2c6cc;\n --gi-text-muted: #8a9099;\n --gi-hairline: rgba(255, 255, 255, 0.09);\n --gi-hairline-soft: rgba(255, 255, 255, 0.05);\n --gi-accent: #12a0f0;\n --gi-danger: #f04438;\n --gi-amber: #f5a623;\n --gi-margin: #f5a623;\n --gi-padding: #4ade80;\n --gi-border-kind: #f87171;\n --gi-scrollbar: #2dd4bf;\n --gi-gap-kind: #a78bfa;\n --gi-layout: #9ba1a8;\n --gi-content: #12a0f0;\n --gi-unknown: #ec4899;\n --gi-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.06),\n 0 1px 2px rgba(0, 0, 0, 0.6),\n 0 32px 70px -16px rgba(0, 0, 0, 0.75);\n --gi-font: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Inter\", sans-serif;\n --gi-mono: ui-monospace, \"SF Mono\", \"JetBrains Mono\", Menlo, Consolas, monospace;\n}\n\n.gi-root {\n color: var(--gi-text);\n font-family: var(--gi-font);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-synthesis: none;\n position: fixed;\n inset: 0;\n z-index: 2147483647;\n pointer-events: none;\n}\n\n.gi-button {\n align-items: center;\n background: var(--gi-chrome);\n border: 1px solid var(--gi-hairline);\n border-radius: 10px;\n bottom: 18px;\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.06),\n 0 1px 2px rgba(0, 0, 0, 0.6),\n 0 12px 32px -8px rgba(0, 0, 0, 0.6);\n color: var(--gi-text);\n cursor: pointer;\n display: inline-flex;\n font: inherit;\n font-size: 12.5px;\n font-weight: 500;\n gap: 8px;\n height: 34px;\n padding: 0 14px;\n pointer-events: auto;\n position: fixed;\n right: 18px;\n touch-action: none;\n transition: border-color 120ms ease, background-color 120ms ease;\n}\n\n.gi-button:hover {\n background: #181818;\n border-color: rgba(255, 255, 255, 0.16);\n}\n\n.gi-button-mark {\n background: var(--gi-accent);\n border-radius: 999px;\n box-shadow: 0 0 8px rgba(18, 160, 240, 0.8);\n display: inline-block;\n height: 6px;\n width: 6px;\n}\n\n.gi-panel {\n background: var(--gi-chrome);\n border-radius: 14px;\n bottom: 18px;\n box-shadow: var(--gi-shadow);\n display: flex;\n flex-direction: column;\n max-height: min(560px, calc(100vh - 36px));\n overflow: clip;\n padding: 4px;\n pointer-events: auto;\n position: fixed;\n right: 18px;\n width: min(400px, calc(100vw - 36px));\n}\n\n.gi-body {\n background: var(--gi-surface);\n border: 1px solid var(--gi-hairline);\n border-radius: 10px;\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: clip;\n}\n\n.gi-header {\n align-items: center;\n border-bottom: 1px solid var(--gi-hairline-soft);\n cursor: grab;\n display: flex;\n flex-shrink: 0;\n justify-content: space-between;\n padding: 11px 11px 11px 14px;\n touch-action: none;\n user-select: none;\n}\n\n.gi-header:active {\n cursor: grabbing;\n}\n\n.gi-header .gi-close {\n cursor: pointer;\n}\n\n.gi-title {\n font-size: 13px;\n font-weight: 600;\n letter-spacing: -0.01em;\n line-height: 16px;\n}\n\n.gi-close {\n align-items: center;\n appearance: none;\n background: transparent;\n border: 1px solid transparent;\n border-radius: 7px;\n color: var(--gi-text-muted);\n cursor: pointer;\n display: inline-flex;\n height: 24px;\n justify-content: center;\n padding: 0;\n transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;\n width: 24px;\n}\n\n.gi-close:hover {\n background: rgba(255, 255, 255, 0.06);\n border-color: var(--gi-hairline);\n color: var(--gi-text-secondary);\n}\n\n.gi-content {\n display: flex;\n flex-direction: column;\n gap: 12px;\n min-height: 0;\n overflow-y: auto;\n padding: 14px;\n}\n\n.gi-content::-webkit-scrollbar {\n width: 8px;\n}\n\n.gi-content::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.12);\n background-clip: padding-box;\n border: 2px solid transparent;\n border-radius: 999px;\n}\n\n.gi-empty {\n color: var(--gi-text-muted);\n display: flex;\n flex-direction: column;\n font-size: 12.5px;\n gap: 12px;\n line-height: 1.55;\n}\n\n.gi-empty p {\n margin: 0;\n}\n\n.gi-hint {\n align-items: center;\n color: var(--gi-text-muted);\n display: flex;\n font-size: 12px;\n gap: 8px;\n}\n\n.gi-kbd {\n align-items: center;\n background: var(--gi-well);\n border: 1px solid var(--gi-hairline);\n border-radius: 5px;\n color: var(--gi-text-secondary);\n display: inline-flex;\n flex-shrink: 0;\n font-size: 11px;\n height: 18px;\n justify-content: center;\n line-height: 1;\n min-width: 18px;\n padding: 0 4px;\n}\n\n.gi-footer {\n align-items: center;\n display: flex;\n flex-shrink: 0;\n gap: 8px;\n justify-content: flex-end;\n padding: 8px 6px 4px;\n}\n\n.gi-ghost,\n.gi-primary {\n appearance: none;\n border: 0;\n border-radius: 8px;\n cursor: pointer;\n font: inherit;\n font-size: 12.5px;\n line-height: 16px;\n padding: 7px 12px;\n transition: background-color 120ms ease, filter 120ms ease;\n}\n\n.gi-ghost {\n background: transparent;\n color: var(--gi-text-secondary);\n font-weight: 500;\n}\n\n.gi-ghost:hover {\n background: rgba(255, 255, 255, 0.06);\n}\n\n.gi-primary {\n background: var(--gi-accent);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.24),\n 0 1px 2px rgba(0, 0, 0, 0.45);\n color: #ffffff;\n font-weight: 600;\n}\n\n.gi-primary:hover {\n filter: brightness(1.08);\n}\n\n.gi-primary[data-state=\"failed\"] {\n background: var(--gi-danger);\n}\n\n.gi-report-title {\n align-items: baseline;\n display: flex;\n gap: 7px;\n}\n\n.gi-metric {\n color: var(--gi-kind-color, var(--gi-text));\n font-family: var(--gi-mono);\n font-size: 18px;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\n letter-spacing: -0.02em;\n line-height: 22px;\n}\n\n.gi-metric-axis {\n color: var(--gi-text-muted);\n font-size: 12px;\n font-weight: 500;\n}\n\n.gi-bar {\n display: flex;\n gap: 2px;\n height: 14px;\n}\n\n.gi-bar-segment {\n background: var(--gi-kind-color, var(--gi-layout));\n background-clip: padding-box;\n border-block: 4px solid transparent;\n border-radius: 6px;\n box-sizing: border-box;\n flex-basis: 0;\n min-width: 3px;\n}\n\n.gi-bar-segment:hover {\n filter: brightness(1.25);\n}\n\n.gi-bar-unattributed {\n background: repeating-linear-gradient(\n 135deg,\n rgba(255, 255, 255, 0.28) 0 2px,\n rgba(255, 255, 255, 0.08) 2px 5px\n );\n}\n\n.gi-equation {\n background: var(--gi-well);\n border: 1px solid var(--gi-hairline);\n border-radius: 9px;\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);\n color: var(--gi-text);\n font-family: var(--gi-mono);\n font-size: 11.5px;\n font-variant-numeric: tabular-nums;\n line-height: 1.6;\n overflow-wrap: anywhere;\n padding: 9px 11px;\n}\n\n.gi-caps {\n color: var(--gi-text-muted);\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n}\n\n.gi-contribs {\n display: flex;\n flex-direction: column;\n}\n\n.gi-contribs .gi-caps {\n margin-bottom: 2px;\n}\n\n.gi-contrib {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 9px 1px;\n}\n\n.gi-contrib + .gi-contrib {\n border-top: 1px solid var(--gi-hairline-soft);\n}\n\n.gi-contrib:hover {\n background: rgba(255, 255, 255, 0.03);\n}\n\n.gi-contrib-row {\n align-items: center;\n display: flex;\n gap: 8px;\n}\n\n.gi-kind-label {\n background: color-mix(in srgb, var(--gi-kind-color) 15%, transparent);\n border-radius: 5px;\n color: var(--gi-kind-color);\n flex-shrink: 0;\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.04em;\n line-height: 1;\n padding: 4px 6px;\n text-transform: uppercase;\n}\n\n.gi-contrib-prop {\n color: var(--gi-text);\n flex: 1;\n font-size: 12px;\n font-weight: 500;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.gi-contrib-css {\n color: var(--gi-text-muted);\n font-family: var(--gi-mono);\n font-size: 11px;\n font-weight: 400;\n}\n\n.gi-contrib-value {\n color: var(--gi-text);\n flex-shrink: 0;\n font-family: var(--gi-mono);\n font-size: 12px;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\n margin-left: auto;\n}\n\n.gi-contrib-note {\n color: var(--gi-text-muted);\n font-size: 11.5px;\n line-height: 1.5;\n}\n\n.gi-warning {\n background: color-mix(in srgb, var(--gi-amber) 9%, transparent);\n border: 1px solid color-mix(in srgb, var(--gi-amber) 28%, transparent);\n border-radius: 9px;\n color: #f2c069;\n font-size: 11.5px;\n line-height: 1.55;\n padding: 8px 11px;\n}\n\n.gi-hovercard {\n background: var(--gi-surface);\n border: 1px solid var(--gi-hairline);\n border-radius: 10px;\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.06),\n 0 8px 24px rgba(0, 0, 0, 0.55);\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 10px 11px;\n pointer-events: none;\n position: fixed;\n z-index: 10;\n}\n\n.gi-hovercard-row {\n align-items: center;\n display: flex;\n gap: 8px;\n}\n\n.gi-hovercard-prop {\n color: var(--gi-text);\n flex: 1;\n font-size: 12px;\n font-weight: 500;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.gi-hovercard-value {\n color: var(--gi-text);\n flex-shrink: 0;\n font-family: var(--gi-mono);\n font-size: 12px;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\n}\n\n.gi-hovercard-selector {\n color: #dfe2e6;\n font-family: var(--gi-mono);\n font-size: 10.5px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n.gi-hovercard-meta {\n color: var(--gi-text-muted);\n font-family: var(--gi-mono);\n font-size: 10.5px;\n}\n\n.gi-hovercard-note {\n color: var(--gi-text-muted);\n font-size: 11px;\n line-height: 1.5;\n}\n\n.gi-canvas {\n cursor: crosshair;\n inset: 0;\n pointer-events: auto;\n position: fixed;\n touch-action: none;\n}\n\n.gi-canvas[data-passthrough=\"true\"] {\n pointer-events: none;\n}\n\n.gi-svg {\n left: 0;\n overflow: visible;\n pointer-events: none;\n position: absolute;\n top: 0;\n z-index: 2147483646;\n}\n\n.gi-line {\n stroke: var(--gi-accent);\n stroke-dasharray: 5 5;\n stroke-linecap: round;\n stroke-width: 1.5;\n}\n\n.gi-gap-band {\n fill: rgba(18, 160, 240, 0.16);\n stroke: rgba(18, 160, 240, 0.8);\n stroke-width: 1;\n}\n\n.gi-preview-gap {\n fill: rgba(18, 160, 240, 0.1);\n stroke-dasharray: 4 4;\n}\n\n.gi-element-box {\n fill: rgba(18, 160, 240, 0.06);\n stroke: rgba(18, 160, 240, 0.85);\n stroke-width: 1;\n}\n\n.gi-preview-box {\n fill: rgba(18, 160, 240, 0.03);\n stroke-dasharray: 7 4;\n}\n\n.gi-contributor-box {\n fill: color-mix(in srgb, var(--gi-kind-color) 38%, transparent);\n stroke: color-mix(in srgb, var(--gi-kind-color) 85%, transparent);\n stroke-width: 1;\n}\n\n.gi-preview-contributor {\n opacity: 0.62;\n}\n\n.gi-series-box {\n fill: color-mix(in srgb, var(--gi-kind-color) 5%, transparent);\n opacity: 0.34;\n stroke: var(--gi-kind-color);\n stroke-dasharray: 2 6;\n stroke-width: 1;\n}\n\n.gi-preview-series {\n opacity: 0.2;\n}\n\n.gi-edge-marker {\n fill: var(--gi-accent);\n stroke: none;\n}\n\n.gi-preview-edge {\n fill: rgba(18, 160, 240, 0.85);\n}\n\n.gi-from-edge {\n opacity: 0.92;\n}\n\n.gi-to-edge {\n opacity: 0.92;\n}\n\n.gi-kind-margin {\n --gi-kind-color: var(--gi-margin);\n}\n\n.gi-kind-padding {\n --gi-kind-color: var(--gi-padding);\n}\n\n.gi-kind-border {\n --gi-kind-color: var(--gi-border-kind);\n}\n\n.gi-kind-scrollbar {\n --gi-kind-color: var(--gi-scrollbar);\n}\n\n.gi-kind-gap {\n --gi-kind-color: var(--gi-gap-kind);\n}\n\n.gi-kind-layout {\n --gi-kind-color: var(--gi-layout);\n}\n\n.gi-kind-content {\n --gi-kind-color: var(--gi-content);\n}\n\n.gi-kind-unknown {\n --gi-kind-color: var(--gi-unknown);\n}\n\n.gi-hover-box {\n fill: color-mix(in srgb, var(--gi-kind-color) 35%, transparent);\n stroke: var(--gi-kind-color);\n stroke-width: 1.5;\n}\n\n.gi-point-region {\n fill: color-mix(in srgb, var(--gi-kind-color) 20%, transparent);\n stroke: var(--gi-kind-color);\n stroke-dasharray: 5 3;\n stroke-width: 1.5;\n}\n\n.gi-point-dot {\n fill: var(--gi-kind-color);\n stroke: #131313;\n stroke-width: 2;\n}\n";
|
package/dist/styles.js
ADDED
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
export const gapInspectorStyles = `
|
|
2
|
+
.gi-root,
|
|
3
|
+
.gi-svg {
|
|
4
|
+
--gi-chrome: #131313;
|
|
5
|
+
--gi-surface: #1a1a1a;
|
|
6
|
+
--gi-well: #0d0d0d;
|
|
7
|
+
--gi-text: #f7f7f7;
|
|
8
|
+
--gi-text-secondary: #c2c6cc;
|
|
9
|
+
--gi-text-muted: #8a9099;
|
|
10
|
+
--gi-hairline: rgba(255, 255, 255, 0.09);
|
|
11
|
+
--gi-hairline-soft: rgba(255, 255, 255, 0.05);
|
|
12
|
+
--gi-accent: #12a0f0;
|
|
13
|
+
--gi-danger: #f04438;
|
|
14
|
+
--gi-amber: #f5a623;
|
|
15
|
+
--gi-margin: #f5a623;
|
|
16
|
+
--gi-padding: #4ade80;
|
|
17
|
+
--gi-border-kind: #f87171;
|
|
18
|
+
--gi-scrollbar: #2dd4bf;
|
|
19
|
+
--gi-gap-kind: #a78bfa;
|
|
20
|
+
--gi-layout: #9ba1a8;
|
|
21
|
+
--gi-content: #12a0f0;
|
|
22
|
+
--gi-unknown: #ec4899;
|
|
23
|
+
--gi-shadow:
|
|
24
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
|
25
|
+
0 1px 2px rgba(0, 0, 0, 0.6),
|
|
26
|
+
0 32px 70px -16px rgba(0, 0, 0, 0.75);
|
|
27
|
+
--gi-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
|
|
28
|
+
--gi-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.gi-root {
|
|
32
|
+
color: var(--gi-text);
|
|
33
|
+
font-family: var(--gi-font);
|
|
34
|
+
-webkit-font-smoothing: antialiased;
|
|
35
|
+
-moz-osx-font-smoothing: grayscale;
|
|
36
|
+
font-synthesis: none;
|
|
37
|
+
position: fixed;
|
|
38
|
+
inset: 0;
|
|
39
|
+
z-index: 2147483647;
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.gi-button {
|
|
44
|
+
align-items: center;
|
|
45
|
+
background: var(--gi-chrome);
|
|
46
|
+
border: 1px solid var(--gi-hairline);
|
|
47
|
+
border-radius: 10px;
|
|
48
|
+
bottom: 18px;
|
|
49
|
+
box-shadow:
|
|
50
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
|
51
|
+
0 1px 2px rgba(0, 0, 0, 0.6),
|
|
52
|
+
0 12px 32px -8px rgba(0, 0, 0, 0.6);
|
|
53
|
+
color: var(--gi-text);
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
font: inherit;
|
|
57
|
+
font-size: 12.5px;
|
|
58
|
+
font-weight: 500;
|
|
59
|
+
gap: 8px;
|
|
60
|
+
height: 34px;
|
|
61
|
+
padding: 0 14px;
|
|
62
|
+
pointer-events: auto;
|
|
63
|
+
position: fixed;
|
|
64
|
+
right: 18px;
|
|
65
|
+
touch-action: none;
|
|
66
|
+
transition: border-color 120ms ease, background-color 120ms ease;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.gi-button:hover {
|
|
70
|
+
background: #181818;
|
|
71
|
+
border-color: rgba(255, 255, 255, 0.16);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.gi-button-mark {
|
|
75
|
+
background: var(--gi-accent);
|
|
76
|
+
border-radius: 999px;
|
|
77
|
+
box-shadow: 0 0 8px rgba(18, 160, 240, 0.8);
|
|
78
|
+
display: inline-block;
|
|
79
|
+
height: 6px;
|
|
80
|
+
width: 6px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.gi-panel {
|
|
84
|
+
background: var(--gi-chrome);
|
|
85
|
+
border-radius: 14px;
|
|
86
|
+
bottom: 18px;
|
|
87
|
+
box-shadow: var(--gi-shadow);
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
max-height: min(560px, calc(100vh - 36px));
|
|
91
|
+
overflow: clip;
|
|
92
|
+
padding: 4px;
|
|
93
|
+
pointer-events: auto;
|
|
94
|
+
position: fixed;
|
|
95
|
+
right: 18px;
|
|
96
|
+
width: min(400px, calc(100vw - 36px));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.gi-body {
|
|
100
|
+
background: var(--gi-surface);
|
|
101
|
+
border: 1px solid var(--gi-hairline);
|
|
102
|
+
border-radius: 10px;
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
min-height: 0;
|
|
106
|
+
overflow: clip;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.gi-header {
|
|
110
|
+
align-items: center;
|
|
111
|
+
border-bottom: 1px solid var(--gi-hairline-soft);
|
|
112
|
+
cursor: grab;
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
padding: 11px 11px 11px 14px;
|
|
117
|
+
touch-action: none;
|
|
118
|
+
user-select: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.gi-header:active {
|
|
122
|
+
cursor: grabbing;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.gi-header .gi-close {
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.gi-title {
|
|
130
|
+
font-size: 13px;
|
|
131
|
+
font-weight: 600;
|
|
132
|
+
letter-spacing: -0.01em;
|
|
133
|
+
line-height: 16px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.gi-close {
|
|
137
|
+
align-items: center;
|
|
138
|
+
appearance: none;
|
|
139
|
+
background: transparent;
|
|
140
|
+
border: 1px solid transparent;
|
|
141
|
+
border-radius: 7px;
|
|
142
|
+
color: var(--gi-text-muted);
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
display: inline-flex;
|
|
145
|
+
height: 24px;
|
|
146
|
+
justify-content: center;
|
|
147
|
+
padding: 0;
|
|
148
|
+
transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
|
|
149
|
+
width: 24px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.gi-close:hover {
|
|
153
|
+
background: rgba(255, 255, 255, 0.06);
|
|
154
|
+
border-color: var(--gi-hairline);
|
|
155
|
+
color: var(--gi-text-secondary);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.gi-content {
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-direction: column;
|
|
161
|
+
gap: 12px;
|
|
162
|
+
min-height: 0;
|
|
163
|
+
overflow-y: auto;
|
|
164
|
+
padding: 14px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.gi-content::-webkit-scrollbar {
|
|
168
|
+
width: 8px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.gi-content::-webkit-scrollbar-thumb {
|
|
172
|
+
background: rgba(255, 255, 255, 0.12);
|
|
173
|
+
background-clip: padding-box;
|
|
174
|
+
border: 2px solid transparent;
|
|
175
|
+
border-radius: 999px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.gi-empty {
|
|
179
|
+
color: var(--gi-text-muted);
|
|
180
|
+
display: flex;
|
|
181
|
+
flex-direction: column;
|
|
182
|
+
font-size: 12.5px;
|
|
183
|
+
gap: 12px;
|
|
184
|
+
line-height: 1.55;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.gi-empty p {
|
|
188
|
+
margin: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.gi-hint {
|
|
192
|
+
align-items: center;
|
|
193
|
+
color: var(--gi-text-muted);
|
|
194
|
+
display: flex;
|
|
195
|
+
font-size: 12px;
|
|
196
|
+
gap: 8px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.gi-kbd {
|
|
200
|
+
align-items: center;
|
|
201
|
+
background: var(--gi-well);
|
|
202
|
+
border: 1px solid var(--gi-hairline);
|
|
203
|
+
border-radius: 5px;
|
|
204
|
+
color: var(--gi-text-secondary);
|
|
205
|
+
display: inline-flex;
|
|
206
|
+
flex-shrink: 0;
|
|
207
|
+
font-size: 11px;
|
|
208
|
+
height: 18px;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
line-height: 1;
|
|
211
|
+
min-width: 18px;
|
|
212
|
+
padding: 0 4px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.gi-footer {
|
|
216
|
+
align-items: center;
|
|
217
|
+
display: flex;
|
|
218
|
+
flex-shrink: 0;
|
|
219
|
+
gap: 8px;
|
|
220
|
+
justify-content: flex-end;
|
|
221
|
+
padding: 8px 6px 4px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.gi-ghost,
|
|
225
|
+
.gi-primary {
|
|
226
|
+
appearance: none;
|
|
227
|
+
border: 0;
|
|
228
|
+
border-radius: 8px;
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
font: inherit;
|
|
231
|
+
font-size: 12.5px;
|
|
232
|
+
line-height: 16px;
|
|
233
|
+
padding: 7px 12px;
|
|
234
|
+
transition: background-color 120ms ease, filter 120ms ease;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.gi-ghost {
|
|
238
|
+
background: transparent;
|
|
239
|
+
color: var(--gi-text-secondary);
|
|
240
|
+
font-weight: 500;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.gi-ghost:hover {
|
|
244
|
+
background: rgba(255, 255, 255, 0.06);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.gi-primary {
|
|
248
|
+
background: var(--gi-accent);
|
|
249
|
+
box-shadow:
|
|
250
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.24),
|
|
251
|
+
0 1px 2px rgba(0, 0, 0, 0.45);
|
|
252
|
+
color: #ffffff;
|
|
253
|
+
font-weight: 600;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.gi-primary:hover {
|
|
257
|
+
filter: brightness(1.08);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.gi-primary[data-state="failed"] {
|
|
261
|
+
background: var(--gi-danger);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.gi-report-title {
|
|
265
|
+
align-items: baseline;
|
|
266
|
+
display: flex;
|
|
267
|
+
gap: 7px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.gi-metric {
|
|
271
|
+
color: var(--gi-kind-color, var(--gi-text));
|
|
272
|
+
font-family: var(--gi-mono);
|
|
273
|
+
font-size: 18px;
|
|
274
|
+
font-variant-numeric: tabular-nums;
|
|
275
|
+
font-weight: 600;
|
|
276
|
+
letter-spacing: -0.02em;
|
|
277
|
+
line-height: 22px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.gi-metric-axis {
|
|
281
|
+
color: var(--gi-text-muted);
|
|
282
|
+
font-size: 12px;
|
|
283
|
+
font-weight: 500;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.gi-bar {
|
|
287
|
+
display: flex;
|
|
288
|
+
gap: 2px;
|
|
289
|
+
height: 14px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.gi-bar-segment {
|
|
293
|
+
background: var(--gi-kind-color, var(--gi-layout));
|
|
294
|
+
background-clip: padding-box;
|
|
295
|
+
border-block: 4px solid transparent;
|
|
296
|
+
border-radius: 6px;
|
|
297
|
+
box-sizing: border-box;
|
|
298
|
+
flex-basis: 0;
|
|
299
|
+
min-width: 3px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.gi-bar-segment:hover {
|
|
303
|
+
filter: brightness(1.25);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.gi-bar-unattributed {
|
|
307
|
+
background: repeating-linear-gradient(
|
|
308
|
+
135deg,
|
|
309
|
+
rgba(255, 255, 255, 0.28) 0 2px,
|
|
310
|
+
rgba(255, 255, 255, 0.08) 2px 5px
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.gi-equation {
|
|
315
|
+
background: var(--gi-well);
|
|
316
|
+
border: 1px solid var(--gi-hairline);
|
|
317
|
+
border-radius: 9px;
|
|
318
|
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
|
|
319
|
+
color: var(--gi-text);
|
|
320
|
+
font-family: var(--gi-mono);
|
|
321
|
+
font-size: 11.5px;
|
|
322
|
+
font-variant-numeric: tabular-nums;
|
|
323
|
+
line-height: 1.6;
|
|
324
|
+
overflow-wrap: anywhere;
|
|
325
|
+
padding: 9px 11px;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.gi-caps {
|
|
329
|
+
color: var(--gi-text-muted);
|
|
330
|
+
font-size: 10px;
|
|
331
|
+
font-weight: 600;
|
|
332
|
+
letter-spacing: 0.08em;
|
|
333
|
+
text-transform: uppercase;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.gi-contribs {
|
|
337
|
+
display: flex;
|
|
338
|
+
flex-direction: column;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.gi-contribs .gi-caps {
|
|
342
|
+
margin-bottom: 2px;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.gi-contrib {
|
|
346
|
+
display: flex;
|
|
347
|
+
flex-direction: column;
|
|
348
|
+
gap: 4px;
|
|
349
|
+
padding: 9px 1px;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.gi-contrib + .gi-contrib {
|
|
353
|
+
border-top: 1px solid var(--gi-hairline-soft);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.gi-contrib:hover {
|
|
357
|
+
background: rgba(255, 255, 255, 0.03);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.gi-contrib-row {
|
|
361
|
+
align-items: center;
|
|
362
|
+
display: flex;
|
|
363
|
+
gap: 8px;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.gi-kind-label {
|
|
367
|
+
background: color-mix(in srgb, var(--gi-kind-color) 15%, transparent);
|
|
368
|
+
border-radius: 5px;
|
|
369
|
+
color: var(--gi-kind-color);
|
|
370
|
+
flex-shrink: 0;
|
|
371
|
+
font-size: 10px;
|
|
372
|
+
font-weight: 600;
|
|
373
|
+
letter-spacing: 0.04em;
|
|
374
|
+
line-height: 1;
|
|
375
|
+
padding: 4px 6px;
|
|
376
|
+
text-transform: uppercase;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.gi-contrib-prop {
|
|
380
|
+
color: var(--gi-text);
|
|
381
|
+
flex: 1;
|
|
382
|
+
font-size: 12px;
|
|
383
|
+
font-weight: 500;
|
|
384
|
+
min-width: 0;
|
|
385
|
+
overflow-wrap: anywhere;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.gi-contrib-css {
|
|
389
|
+
color: var(--gi-text-muted);
|
|
390
|
+
font-family: var(--gi-mono);
|
|
391
|
+
font-size: 11px;
|
|
392
|
+
font-weight: 400;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.gi-contrib-value {
|
|
396
|
+
color: var(--gi-text);
|
|
397
|
+
flex-shrink: 0;
|
|
398
|
+
font-family: var(--gi-mono);
|
|
399
|
+
font-size: 12px;
|
|
400
|
+
font-variant-numeric: tabular-nums;
|
|
401
|
+
font-weight: 600;
|
|
402
|
+
margin-left: auto;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.gi-contrib-note {
|
|
406
|
+
color: var(--gi-text-muted);
|
|
407
|
+
font-size: 11.5px;
|
|
408
|
+
line-height: 1.5;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.gi-warning {
|
|
412
|
+
background: color-mix(in srgb, var(--gi-amber) 9%, transparent);
|
|
413
|
+
border: 1px solid color-mix(in srgb, var(--gi-amber) 28%, transparent);
|
|
414
|
+
border-radius: 9px;
|
|
415
|
+
color: #f2c069;
|
|
416
|
+
font-size: 11.5px;
|
|
417
|
+
line-height: 1.55;
|
|
418
|
+
padding: 8px 11px;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.gi-hovercard {
|
|
422
|
+
background: var(--gi-surface);
|
|
423
|
+
border: 1px solid var(--gi-hairline);
|
|
424
|
+
border-radius: 10px;
|
|
425
|
+
box-shadow:
|
|
426
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
|
427
|
+
0 8px 24px rgba(0, 0, 0, 0.55);
|
|
428
|
+
display: flex;
|
|
429
|
+
flex-direction: column;
|
|
430
|
+
gap: 6px;
|
|
431
|
+
padding: 10px 11px;
|
|
432
|
+
pointer-events: none;
|
|
433
|
+
position: fixed;
|
|
434
|
+
z-index: 10;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.gi-hovercard-row {
|
|
438
|
+
align-items: center;
|
|
439
|
+
display: flex;
|
|
440
|
+
gap: 8px;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.gi-hovercard-prop {
|
|
444
|
+
color: var(--gi-text);
|
|
445
|
+
flex: 1;
|
|
446
|
+
font-size: 12px;
|
|
447
|
+
font-weight: 500;
|
|
448
|
+
min-width: 0;
|
|
449
|
+
overflow-wrap: anywhere;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.gi-hovercard-value {
|
|
453
|
+
color: var(--gi-text);
|
|
454
|
+
flex-shrink: 0;
|
|
455
|
+
font-family: var(--gi-mono);
|
|
456
|
+
font-size: 12px;
|
|
457
|
+
font-variant-numeric: tabular-nums;
|
|
458
|
+
font-weight: 600;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.gi-hovercard-selector {
|
|
462
|
+
color: #dfe2e6;
|
|
463
|
+
font-family: var(--gi-mono);
|
|
464
|
+
font-size: 10.5px;
|
|
465
|
+
line-height: 1.5;
|
|
466
|
+
overflow-wrap: anywhere;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.gi-hovercard-meta {
|
|
470
|
+
color: var(--gi-text-muted);
|
|
471
|
+
font-family: var(--gi-mono);
|
|
472
|
+
font-size: 10.5px;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.gi-hovercard-note {
|
|
476
|
+
color: var(--gi-text-muted);
|
|
477
|
+
font-size: 11px;
|
|
478
|
+
line-height: 1.5;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.gi-canvas {
|
|
482
|
+
cursor: crosshair;
|
|
483
|
+
inset: 0;
|
|
484
|
+
pointer-events: auto;
|
|
485
|
+
position: fixed;
|
|
486
|
+
touch-action: none;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.gi-canvas[data-passthrough="true"] {
|
|
490
|
+
pointer-events: none;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.gi-svg {
|
|
494
|
+
left: 0;
|
|
495
|
+
overflow: visible;
|
|
496
|
+
pointer-events: none;
|
|
497
|
+
position: absolute;
|
|
498
|
+
top: 0;
|
|
499
|
+
z-index: 2147483646;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.gi-line {
|
|
503
|
+
stroke: var(--gi-accent);
|
|
504
|
+
stroke-dasharray: 5 5;
|
|
505
|
+
stroke-linecap: round;
|
|
506
|
+
stroke-width: 1.5;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.gi-gap-band {
|
|
510
|
+
fill: rgba(18, 160, 240, 0.16);
|
|
511
|
+
stroke: rgba(18, 160, 240, 0.8);
|
|
512
|
+
stroke-width: 1;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.gi-preview-gap {
|
|
516
|
+
fill: rgba(18, 160, 240, 0.1);
|
|
517
|
+
stroke-dasharray: 4 4;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.gi-element-box {
|
|
521
|
+
fill: rgba(18, 160, 240, 0.06);
|
|
522
|
+
stroke: rgba(18, 160, 240, 0.85);
|
|
523
|
+
stroke-width: 1;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.gi-preview-box {
|
|
527
|
+
fill: rgba(18, 160, 240, 0.03);
|
|
528
|
+
stroke-dasharray: 7 4;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.gi-contributor-box {
|
|
532
|
+
fill: color-mix(in srgb, var(--gi-kind-color) 38%, transparent);
|
|
533
|
+
stroke: color-mix(in srgb, var(--gi-kind-color) 85%, transparent);
|
|
534
|
+
stroke-width: 1;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.gi-preview-contributor {
|
|
538
|
+
opacity: 0.62;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.gi-series-box {
|
|
542
|
+
fill: color-mix(in srgb, var(--gi-kind-color) 5%, transparent);
|
|
543
|
+
opacity: 0.34;
|
|
544
|
+
stroke: var(--gi-kind-color);
|
|
545
|
+
stroke-dasharray: 2 6;
|
|
546
|
+
stroke-width: 1;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.gi-preview-series {
|
|
550
|
+
opacity: 0.2;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.gi-edge-marker {
|
|
554
|
+
fill: var(--gi-accent);
|
|
555
|
+
stroke: none;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.gi-preview-edge {
|
|
559
|
+
fill: rgba(18, 160, 240, 0.85);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.gi-from-edge {
|
|
563
|
+
opacity: 0.92;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.gi-to-edge {
|
|
567
|
+
opacity: 0.92;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
.gi-kind-margin {
|
|
571
|
+
--gi-kind-color: var(--gi-margin);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.gi-kind-padding {
|
|
575
|
+
--gi-kind-color: var(--gi-padding);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
.gi-kind-border {
|
|
579
|
+
--gi-kind-color: var(--gi-border-kind);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.gi-kind-scrollbar {
|
|
583
|
+
--gi-kind-color: var(--gi-scrollbar);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.gi-kind-gap {
|
|
587
|
+
--gi-kind-color: var(--gi-gap-kind);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.gi-kind-layout {
|
|
591
|
+
--gi-kind-color: var(--gi-layout);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.gi-kind-content {
|
|
595
|
+
--gi-kind-color: var(--gi-content);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.gi-kind-unknown {
|
|
599
|
+
--gi-kind-color: var(--gi-unknown);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.gi-hover-box {
|
|
603
|
+
fill: color-mix(in srgb, var(--gi-kind-color) 35%, transparent);
|
|
604
|
+
stroke: var(--gi-kind-color);
|
|
605
|
+
stroke-width: 1.5;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.gi-point-region {
|
|
609
|
+
fill: color-mix(in srgb, var(--gi-kind-color) 20%, transparent);
|
|
610
|
+
stroke: var(--gi-kind-color);
|
|
611
|
+
stroke-dasharray: 5 3;
|
|
612
|
+
stroke-width: 1.5;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.gi-point-dot {
|
|
616
|
+
fill: var(--gi-kind-color);
|
|
617
|
+
stroke: #131313;
|
|
618
|
+
stroke-width: 2;
|
|
619
|
+
}
|
|
620
|
+
`;
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gap-inspector",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A React dev overlay that measures visual gaps and explains the CSS/layout contributions behind them.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Bence Redmond <bence@carboncopy.inc>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/bencered/gap-inspector.git",
|
|
10
|
+
"directory": "packages/gap-inspector"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/bencered/gap-inspector#readme",
|
|
13
|
+
"bugs": "https://github.com/bencered/gap-inspector/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"react",
|
|
16
|
+
"devtools",
|
|
17
|
+
"css",
|
|
18
|
+
"layout",
|
|
19
|
+
"spacing",
|
|
20
|
+
"gap",
|
|
21
|
+
"measurement",
|
|
22
|
+
"overlay",
|
|
23
|
+
"debugging"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc -p tsconfig.json",
|
|
41
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
42
|
+
"prepublishOnly": "pnpm build"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": ">=18",
|
|
46
|
+
"react-dom": ">=18"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/react": "^18.3.12",
|
|
50
|
+
"@types/react-dom": "^18.3.5",
|
|
51
|
+
"react": "^19.2.7",
|
|
52
|
+
"react-dom": "^19.2.7",
|
|
53
|
+
"typescript": "^5.7.2"
|
|
54
|
+
}
|
|
55
|
+
}
|