uidex 0.2.0 → 0.2.4

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.
@@ -5,27 +5,39 @@ interface UidexDefaults {
5
5
  color?: string;
6
6
  borderStyle?: BorderStyle;
7
7
  borderWidth?: number;
8
- showLabel?: boolean;
9
- labelPosition?: LabelPosition;
10
8
  }
11
9
  interface UidexConfig {
12
10
  defaults?: UidexDefaults;
13
11
  colors?: Record<string, string>;
14
12
  }
13
+ type UidexKind = 'block' | 'component' | 'primitive';
15
14
  interface UidexLocation {
16
15
  filePath: string;
17
16
  line: number;
17
+ kind: UidexKind;
18
18
  doc?: string;
19
+ scopes?: string[];
19
20
  }
20
21
  type UidexMap = Record<string, UidexLocation[]>;
22
+ interface PrimitiveEntry {
23
+ name: string;
24
+ filePath: string;
25
+ scope: string;
26
+ composes: string[];
27
+ usedBy: string[];
28
+ kind: 'primitive';
29
+ }
21
30
  interface UidexPage {
22
31
  dir: string;
23
32
  content: string;
33
+ description?: string;
24
34
  componentIds: string[];
35
+ rootId?: string;
25
36
  }
26
37
  interface UidexFeature {
27
38
  dir: string;
28
39
  content: string;
40
+ description?: string;
29
41
  componentIds: string[];
30
42
  }
31
43
  interface KeyboardShortcut {
@@ -56,6 +68,7 @@ type FeedbackResult = {
56
68
  ok: false;
57
69
  error: string;
58
70
  };
71
+ type UidexTheme = 'dark' | 'light' | 'auto';
59
72
  type FeedbackType = 'bug' | 'feature' | 'improvement' | 'question';
60
73
  type FeedbackSeverity = 'low' | 'medium' | 'high' | 'critical';
61
74
  interface ConsoleLogEntry {
@@ -86,6 +99,7 @@ interface FeedbackReport {
86
99
  route: string | null;
87
100
  timestamp: string;
88
101
  pageTitle: string;
102
+ pageDescription?: string;
89
103
  locale: string;
90
104
  sessionId: string;
91
105
  viewport: {
@@ -105,12 +119,24 @@ interface FeedbackReport {
105
119
  metadata?: Record<string, string>;
106
120
  consoleLogs?: ConsoleLogEntry[];
107
121
  networkErrors?: NetworkErrorEntry[];
122
+ gitBranch?: string;
123
+ gitCommit?: string;
124
+ contextId?: string;
125
+ }
126
+ interface GitContext {
127
+ branch: string;
128
+ commit?: string;
108
129
  }
109
130
 
110
131
  interface UidexDevtoolsProps {
111
132
  components?: UidexMap;
133
+ pages?: UidexPage[];
134
+ features?: UidexFeature[];
135
+ uiComponents?: PrimitiveEntry[];
112
136
  config?: UidexConfig;
113
137
  buttonPosition?: ButtonPosition;
138
+ /** Theme for the devtools widget. Default: 'auto'. */
139
+ theme?: UidexTheme;
114
140
  disabled?: boolean;
115
141
  onSelect?: (id: string) => void;
116
142
  /** Keyboard shortcut to toggle inspect mode. Default: Shift+Cmd+U. Set to false to disable. */
@@ -120,19 +146,27 @@ interface UidexDevtoolsProps {
120
146
  /** Called after feedback submission with the report and result. */
121
147
  onSubmit?: (report: FeedbackReport, result: FeedbackResult) => void;
122
148
  }
123
- declare function UidexDevtools({ components, config, buttonPosition, disabled, onSelect, inspectShortcut, ingest, onSubmit, }: UidexDevtoolsProps): null;
149
+ declare function UidexDevtools({ components, pages, features, uiComponents, config, buttonPosition, theme, disabled, onSelect, inspectShortcut, ingest, onSubmit, }: UidexDevtoolsProps): null;
150
+
151
+ type DataProps = 'components' | 'pages' | 'features' | 'uiComponents';
152
+ declare function createUidexDevtools(data: {
153
+ components: UidexMap;
154
+ pages?: UidexPage[];
155
+ features?: UidexFeature[];
156
+ uiComponents?: PrimitiveEntry[];
157
+ }): {
158
+ (props: Omit<UidexDevtoolsProps, DataProps>): null;
159
+ displayName: string;
160
+ };
124
161
 
125
162
  interface UidexOverlayProps {
126
163
  target: HTMLElement | null;
127
164
  color?: string;
128
165
  borderStyle?: BorderStyle;
129
166
  borderWidth?: number;
130
- label?: string;
131
- showLabel?: boolean;
132
- labelPosition?: LabelPosition;
133
167
  colors?: Record<string, string>;
134
168
  }
135
- declare function UidexOverlay({ target, color, borderStyle, borderWidth, label, showLabel, labelPosition, colors, }: UidexOverlayProps): null;
169
+ declare function UidexOverlay({ target, color, borderStyle, borderWidth, colors, }: UidexOverlayProps): null;
136
170
 
137
171
  declare function registerComponents(components: UidexMap): void;
138
172
  declare function getComponents(): UidexMap | null;
@@ -140,10 +174,11 @@ declare function registerPages(pages: UidexPage[]): void;
140
174
  declare function getPages(): UidexPage[] | null;
141
175
  declare function registerFeatures(features: UidexFeature[]): void;
142
176
  declare function getFeatures(): UidexFeature[] | null;
177
+ declare function registerGitContext(ctx: GitContext): void;
143
178
 
144
179
  declare function classNames(...classes: (string | undefined | null | false)[]): string;
145
180
  declare function getContrastColor(hexColor: string): string;
146
181
  declare function hexToRgba(hex: string, alpha: number): string;
147
182
  declare function resolveColor(color: string | undefined, colorMap?: Record<string, string>): string | undefined;
148
183
 
149
- export { type BorderStyle, type ButtonPosition, type FeedbackReport, type FeedbackResult, type FeedbackSeverity, type FeedbackType, type IngestConfig, type KeyboardShortcut, type LabelPosition, type UidexConfig, type UidexDefaults, UidexDevtools, type UidexDevtoolsProps, type UidexFeature, type UidexLocation, type UidexMap, UidexOverlay, type UidexOverlayProps, type UidexPage, classNames, getComponents, getContrastColor, getFeatures, getPages, hexToRgba, registerComponents, registerFeatures, registerPages, resolveColor };
184
+ export { type BorderStyle, type ButtonPosition, type FeedbackReport, type FeedbackResult, type FeedbackSeverity, type FeedbackType, type IngestConfig, type KeyboardShortcut, type LabelPosition, type PrimitiveEntry, type UidexConfig, type UidexDefaults, UidexDevtools, type UidexDevtoolsProps, type UidexFeature, type UidexLocation, type UidexMap, UidexOverlay, type UidexOverlayProps, type UidexPage, classNames, createUidexDevtools, getComponents, getContrastColor, getFeatures, getPages, hexToRgba, registerComponents, registerFeatures, registerGitContext, registerPages, resolveColor };
@@ -5,27 +5,39 @@ interface UidexDefaults {
5
5
  color?: string;
6
6
  borderStyle?: BorderStyle;
7
7
  borderWidth?: number;
8
- showLabel?: boolean;
9
- labelPosition?: LabelPosition;
10
8
  }
11
9
  interface UidexConfig {
12
10
  defaults?: UidexDefaults;
13
11
  colors?: Record<string, string>;
14
12
  }
13
+ type UidexKind = 'block' | 'component' | 'primitive';
15
14
  interface UidexLocation {
16
15
  filePath: string;
17
16
  line: number;
17
+ kind: UidexKind;
18
18
  doc?: string;
19
+ scopes?: string[];
19
20
  }
20
21
  type UidexMap = Record<string, UidexLocation[]>;
22
+ interface PrimitiveEntry {
23
+ name: string;
24
+ filePath: string;
25
+ scope: string;
26
+ composes: string[];
27
+ usedBy: string[];
28
+ kind: 'primitive';
29
+ }
21
30
  interface UidexPage {
22
31
  dir: string;
23
32
  content: string;
33
+ description?: string;
24
34
  componentIds: string[];
35
+ rootId?: string;
25
36
  }
26
37
  interface UidexFeature {
27
38
  dir: string;
28
39
  content: string;
40
+ description?: string;
29
41
  componentIds: string[];
30
42
  }
31
43
  interface KeyboardShortcut {
@@ -56,6 +68,7 @@ type FeedbackResult = {
56
68
  ok: false;
57
69
  error: string;
58
70
  };
71
+ type UidexTheme = 'dark' | 'light' | 'auto';
59
72
  type FeedbackType = 'bug' | 'feature' | 'improvement' | 'question';
60
73
  type FeedbackSeverity = 'low' | 'medium' | 'high' | 'critical';
61
74
  interface ConsoleLogEntry {
@@ -86,6 +99,7 @@ interface FeedbackReport {
86
99
  route: string | null;
87
100
  timestamp: string;
88
101
  pageTitle: string;
102
+ pageDescription?: string;
89
103
  locale: string;
90
104
  sessionId: string;
91
105
  viewport: {
@@ -105,12 +119,24 @@ interface FeedbackReport {
105
119
  metadata?: Record<string, string>;
106
120
  consoleLogs?: ConsoleLogEntry[];
107
121
  networkErrors?: NetworkErrorEntry[];
122
+ gitBranch?: string;
123
+ gitCommit?: string;
124
+ contextId?: string;
125
+ }
126
+ interface GitContext {
127
+ branch: string;
128
+ commit?: string;
108
129
  }
109
130
 
110
131
  interface UidexDevtoolsProps {
111
132
  components?: UidexMap;
133
+ pages?: UidexPage[];
134
+ features?: UidexFeature[];
135
+ uiComponents?: PrimitiveEntry[];
112
136
  config?: UidexConfig;
113
137
  buttonPosition?: ButtonPosition;
138
+ /** Theme for the devtools widget. Default: 'auto'. */
139
+ theme?: UidexTheme;
114
140
  disabled?: boolean;
115
141
  onSelect?: (id: string) => void;
116
142
  /** Keyboard shortcut to toggle inspect mode. Default: Shift+Cmd+U. Set to false to disable. */
@@ -120,19 +146,27 @@ interface UidexDevtoolsProps {
120
146
  /** Called after feedback submission with the report and result. */
121
147
  onSubmit?: (report: FeedbackReport, result: FeedbackResult) => void;
122
148
  }
123
- declare function UidexDevtools({ components, config, buttonPosition, disabled, onSelect, inspectShortcut, ingest, onSubmit, }: UidexDevtoolsProps): null;
149
+ declare function UidexDevtools({ components, pages, features, uiComponents, config, buttonPosition, theme, disabled, onSelect, inspectShortcut, ingest, onSubmit, }: UidexDevtoolsProps): null;
150
+
151
+ type DataProps = 'components' | 'pages' | 'features' | 'uiComponents';
152
+ declare function createUidexDevtools(data: {
153
+ components: UidexMap;
154
+ pages?: UidexPage[];
155
+ features?: UidexFeature[];
156
+ uiComponents?: PrimitiveEntry[];
157
+ }): {
158
+ (props: Omit<UidexDevtoolsProps, DataProps>): null;
159
+ displayName: string;
160
+ };
124
161
 
125
162
  interface UidexOverlayProps {
126
163
  target: HTMLElement | null;
127
164
  color?: string;
128
165
  borderStyle?: BorderStyle;
129
166
  borderWidth?: number;
130
- label?: string;
131
- showLabel?: boolean;
132
- labelPosition?: LabelPosition;
133
167
  colors?: Record<string, string>;
134
168
  }
135
- declare function UidexOverlay({ target, color, borderStyle, borderWidth, label, showLabel, labelPosition, colors, }: UidexOverlayProps): null;
169
+ declare function UidexOverlay({ target, color, borderStyle, borderWidth, colors, }: UidexOverlayProps): null;
136
170
 
137
171
  declare function registerComponents(components: UidexMap): void;
138
172
  declare function getComponents(): UidexMap | null;
@@ -140,10 +174,11 @@ declare function registerPages(pages: UidexPage[]): void;
140
174
  declare function getPages(): UidexPage[] | null;
141
175
  declare function registerFeatures(features: UidexFeature[]): void;
142
176
  declare function getFeatures(): UidexFeature[] | null;
177
+ declare function registerGitContext(ctx: GitContext): void;
143
178
 
144
179
  declare function classNames(...classes: (string | undefined | null | false)[]): string;
145
180
  declare function getContrastColor(hexColor: string): string;
146
181
  declare function hexToRgba(hex: string, alpha: number): string;
147
182
  declare function resolveColor(color: string | undefined, colorMap?: Record<string, string>): string | undefined;
148
183
 
149
- export { type BorderStyle, type ButtonPosition, type FeedbackReport, type FeedbackResult, type FeedbackSeverity, type FeedbackType, type IngestConfig, type KeyboardShortcut, type LabelPosition, type UidexConfig, type UidexDefaults, UidexDevtools, type UidexDevtoolsProps, type UidexFeature, type UidexLocation, type UidexMap, UidexOverlay, type UidexOverlayProps, type UidexPage, classNames, getComponents, getContrastColor, getFeatures, getPages, hexToRgba, registerComponents, registerFeatures, registerPages, resolveColor };
184
+ export { type BorderStyle, type ButtonPosition, type FeedbackReport, type FeedbackResult, type FeedbackSeverity, type FeedbackType, type IngestConfig, type KeyboardShortcut, type LabelPosition, type PrimitiveEntry, type UidexConfig, type UidexDefaults, UidexDevtools, type UidexDevtoolsProps, type UidexFeature, type UidexLocation, type UidexMap, UidexOverlay, type UidexOverlayProps, type UidexPage, classNames, createUidexDevtools, getComponents, getContrastColor, getFeatures, getPages, hexToRgba, registerComponents, registerFeatures, registerGitContext, registerPages, resolveColor };