@lijinmei-810/dev-inspector 0.1.1 → 0.2.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/dist/index.d.cts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
 
4
- declare function InspectorPanel({ targetEl, tokenMap, onTokenMapUpdate, onClose, }: {
4
+ declare function InspectorPanel({ targetEl, tokenMap, onTokenMapUpdate, onTargetChange, onClose, }: {
5
5
  targetEl: Element;
6
6
  tokenMap: Record<string, string>;
7
7
  onTokenMapUpdate: (updates: Record<string, string>) => void;
8
+ onTargetChange: (el: Element) => void;
8
9
  onClose: () => void;
9
10
  }): react_jsx_runtime.JSX.Element;
10
11
  declare function DevInspector(): react_jsx_runtime.JSX.Element;
@@ -18,6 +19,28 @@ type PaletteGroup = {
18
19
  group: string;
19
20
  colors: PaletteColor[];
20
21
  };
22
+ type DevInspectorComponentPreviewCategory = 'action' | 'display' | 'feedback' | 'container' | 'form' | 'icon' | 'custom';
23
+ type DevInspectorComponentPreviewVariant = {
24
+ id: string;
25
+ label: string;
26
+ group?: string;
27
+ propsLabel?: string;
28
+ selector?: string;
29
+ usage?: string;
30
+ capabilities?: string[];
31
+ tokenRefs?: string[];
32
+ status?: string;
33
+ render: () => ReactNode;
34
+ };
35
+ type DevInspectorComponentPreview = {
36
+ type: string;
37
+ label: string;
38
+ category?: DevInspectorComponentPreviewCategory;
39
+ summary?: string;
40
+ selector?: string;
41
+ status?: string;
42
+ variants: DevInspectorComponentPreviewVariant[];
43
+ };
21
44
  type ShadowToken = {
22
45
  cssVar: string;
23
46
  value: string;
@@ -104,6 +127,7 @@ type DevInspectorConfig = {
104
127
  rootId: string;
105
128
  endpoints: DevInspectorEndpoints;
106
129
  tokens: DevInspectorTokenConfig;
130
+ componentPreviews: DevInspectorComponentPreview[];
107
131
  };
108
132
  type DevInspectorConfigOverrides = Omit<Partial<DevInspectorConfig>, 'endpoints' | 'tokens'> & {
109
133
  endpoints?: Partial<DevInspectorEndpoints>;
@@ -123,4 +147,4 @@ declare function useDevInspectorConfig(): DevInspectorConfig;
123
147
 
124
148
  declare function mountDevInspector(config?: DevInspectorConfigOverrides): HTMLElement;
125
149
 
126
- export { type BorderStyleOption, type ContainerStyleOption, DevInspector, type DevInspectorConfig, type DevInspectorConfigOverrides, type DevInspectorEndpoints, DevInspectorProvider, type DevInspectorTokenConfig, type FontSizeOption, InspectorPanel, type TypographyStyleOption, type TypographyToken, defaultDevInspectorConfig, mergeDevInspectorConfig, mountDevInspector, useDevInspectorConfig };
150
+ export { type BorderStyleOption, type ContainerStyleOption, DevInspector, type DevInspectorComponentPreview, type DevInspectorComponentPreviewCategory, type DevInspectorComponentPreviewVariant, type DevInspectorConfig, type DevInspectorConfigOverrides, type DevInspectorEndpoints, DevInspectorProvider, type DevInspectorTokenConfig, type FontSizeOption, InspectorPanel, type TypographyStyleOption, type TypographyToken, defaultDevInspectorConfig, mergeDevInspectorConfig, mountDevInspector, useDevInspectorConfig };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
 
4
- declare function InspectorPanel({ targetEl, tokenMap, onTokenMapUpdate, onClose, }: {
4
+ declare function InspectorPanel({ targetEl, tokenMap, onTokenMapUpdate, onTargetChange, onClose, }: {
5
5
  targetEl: Element;
6
6
  tokenMap: Record<string, string>;
7
7
  onTokenMapUpdate: (updates: Record<string, string>) => void;
8
+ onTargetChange: (el: Element) => void;
8
9
  onClose: () => void;
9
10
  }): react_jsx_runtime.JSX.Element;
10
11
  declare function DevInspector(): react_jsx_runtime.JSX.Element;
@@ -18,6 +19,28 @@ type PaletteGroup = {
18
19
  group: string;
19
20
  colors: PaletteColor[];
20
21
  };
22
+ type DevInspectorComponentPreviewCategory = 'action' | 'display' | 'feedback' | 'container' | 'form' | 'icon' | 'custom';
23
+ type DevInspectorComponentPreviewVariant = {
24
+ id: string;
25
+ label: string;
26
+ group?: string;
27
+ propsLabel?: string;
28
+ selector?: string;
29
+ usage?: string;
30
+ capabilities?: string[];
31
+ tokenRefs?: string[];
32
+ status?: string;
33
+ render: () => ReactNode;
34
+ };
35
+ type DevInspectorComponentPreview = {
36
+ type: string;
37
+ label: string;
38
+ category?: DevInspectorComponentPreviewCategory;
39
+ summary?: string;
40
+ selector?: string;
41
+ status?: string;
42
+ variants: DevInspectorComponentPreviewVariant[];
43
+ };
21
44
  type ShadowToken = {
22
45
  cssVar: string;
23
46
  value: string;
@@ -104,6 +127,7 @@ type DevInspectorConfig = {
104
127
  rootId: string;
105
128
  endpoints: DevInspectorEndpoints;
106
129
  tokens: DevInspectorTokenConfig;
130
+ componentPreviews: DevInspectorComponentPreview[];
107
131
  };
108
132
  type DevInspectorConfigOverrides = Omit<Partial<DevInspectorConfig>, 'endpoints' | 'tokens'> & {
109
133
  endpoints?: Partial<DevInspectorEndpoints>;
@@ -123,4 +147,4 @@ declare function useDevInspectorConfig(): DevInspectorConfig;
123
147
 
124
148
  declare function mountDevInspector(config?: DevInspectorConfigOverrides): HTMLElement;
125
149
 
126
- export { type BorderStyleOption, type ContainerStyleOption, DevInspector, type DevInspectorConfig, type DevInspectorConfigOverrides, type DevInspectorEndpoints, DevInspectorProvider, type DevInspectorTokenConfig, type FontSizeOption, InspectorPanel, type TypographyStyleOption, type TypographyToken, defaultDevInspectorConfig, mergeDevInspectorConfig, mountDevInspector, useDevInspectorConfig };
150
+ export { type BorderStyleOption, type ContainerStyleOption, DevInspector, type DevInspectorComponentPreview, type DevInspectorComponentPreviewCategory, type DevInspectorComponentPreviewVariant, type DevInspectorConfig, type DevInspectorConfigOverrides, type DevInspectorEndpoints, DevInspectorProvider, type DevInspectorTokenConfig, type FontSizeOption, InspectorPanel, type TypographyStyleOption, type TypographyToken, defaultDevInspectorConfig, mergeDevInspectorConfig, mountDevInspector, useDevInspectorConfig };