@lark-apaas/miaoda-inspector 0.1.0-alpha.1 → 0.1.0-alpha.2

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.
Files changed (88) hide show
  1. package/dist/es/Inspector/{Inspector.js → Inspector.mjs} +50 -55
  2. package/dist/es/Inspector/{Overlay.js → Overlay.mjs} +157 -125
  3. package/dist/es/Inspector/hooks/use-effect-event.mjs +17 -0
  4. package/dist/es/Inspector/hooks/use-layout-effect.mjs +9 -0
  5. package/dist/es/Inspector/hooks/{use-mouse.js → use-mouse.mjs} +8 -4
  6. package/dist/es/Inspector/index.mjs +5 -0
  7. package/dist/es/Inspector/utils/fiber.mjs +70 -0
  8. package/dist/es/Inspector/utils/highlight.mjs +78 -0
  9. package/dist/es/Inspector/utils/inspect.mjs +131 -0
  10. package/dist/es/Inspector/utils/{overlay.js → overlay.mjs} +7 -2
  11. package/dist/es/MiaodaInspector/MiaodaInspector.mjs +427 -0
  12. package/dist/es/MiaodaInspector/index.mjs +5 -0
  13. package/dist/es/chunk-I4E63NIC.mjs +24 -0
  14. package/dist/es/config/{ui-config.js → ui-config.mjs} +66 -286
  15. package/dist/es/global.d.mjs +0 -0
  16. package/dist/es/index.mjs +7 -0
  17. package/dist/es/types/iframe-events.mjs +0 -0
  18. package/dist/es/types/index.mjs +27 -0
  19. package/dist/es/utils/{config-mapper.js → config-mapper.mjs} +14 -56
  20. package/dist/es/utils/{css.js → css.mjs} +5 -1
  21. package/dist/es/utils/index.mjs +37 -0
  22. package/dist/es/utils/origin.mjs +26 -0
  23. package/dist/es/utils/style-calculator.mjs +177 -0
  24. package/dist/lib/Inspector/Inspector.js +99 -104
  25. package/dist/lib/Inspector/Overlay.js +172 -143
  26. package/dist/lib/Inspector/hooks/index.js +19 -19
  27. package/dist/lib/Inspector/hooks/use-effect-event.js +26 -15
  28. package/dist/lib/Inspector/hooks/use-layout-effect.js +25 -10
  29. package/dist/lib/Inspector/hooks/use-mouse.js +27 -14
  30. package/dist/lib/Inspector/index.js +21 -8
  31. package/dist/lib/Inspector/utils/fiber.js +49 -55
  32. package/dist/lib/Inspector/utils/highlight.js +44 -31
  33. package/dist/lib/Inspector/utils/index.js +19 -19
  34. package/dist/lib/Inspector/utils/inspect.js +62 -72
  35. package/dist/lib/Inspector/utils/overlay.js +20 -15
  36. package/dist/lib/MiaodaInspector/MiaodaInspector.js +265 -266
  37. package/dist/lib/MiaodaInspector/index.js +21 -8
  38. package/dist/lib/config/ui-config.js +81 -292
  39. package/dist/lib/global.d.js +1 -0
  40. package/dist/lib/index.js +22 -17
  41. package/dist/lib/types/iframe-events.js +15 -3
  42. package/dist/lib/types/index.js +30 -43
  43. package/dist/lib/utils/config-mapper.js +41 -69
  44. package/dist/lib/utils/css.js +33 -15
  45. package/dist/lib/utils/index.js +36 -57
  46. package/dist/lib/utils/origin.js +23 -22
  47. package/dist/lib/utils/style-calculator.js +113 -110
  48. package/dist/types/Inspector/Inspector.d.ts +95 -92
  49. package/dist/types/Inspector/Overlay.d.ts +61 -58
  50. package/dist/types/Inspector/hooks/index.d.ts +4 -3
  51. package/dist/types/Inspector/hooks/use-effect-event.d.ts +3 -1
  52. package/dist/types/Inspector/hooks/use-layout-effect.d.ts +5 -2
  53. package/dist/types/Inspector/hooks/use-mouse.d.ts +9 -8
  54. package/dist/types/Inspector/index.d.ts +4 -1
  55. package/dist/types/Inspector/utils/fiber.d.ts +12 -10
  56. package/dist/types/Inspector/utils/highlight.d.ts +7 -5
  57. package/dist/types/Inspector/utils/index.d.ts +4 -3
  58. package/dist/types/Inspector/utils/inspect.d.ts +45 -42
  59. package/dist/types/Inspector/utils/overlay.d.ts +24 -22
  60. package/dist/types/MiaodaInspector/MiaodaInspector.d.ts +42 -41
  61. package/dist/types/MiaodaInspector/index.d.ts +3 -1
  62. package/dist/types/config/ui-config.d.ts +42 -41
  63. package/dist/types/global.d.d.ts +17 -0
  64. package/dist/types/index.d.ts +5 -4
  65. package/dist/types/types/iframe-events.d.ts +133 -130
  66. package/dist/types/types/index.d.ts +2 -1
  67. package/dist/types/utils/config-mapper.d.ts +14 -11
  68. package/dist/types/utils/css.d.ts +5 -2
  69. package/dist/types/utils/index.d.ts +7 -3
  70. package/dist/types/utils/origin.d.ts +12 -8
  71. package/dist/types/utils/style-calculator.d.ts +20 -17
  72. package/package.json +13 -13
  73. package/dist/es/Inspector/hooks/use-effect-event.js +0 -15
  74. package/dist/es/Inspector/hooks/use-layout-effect.js +0 -3
  75. package/dist/es/Inspector/index.js +0 -1
  76. package/dist/es/Inspector/utils/fiber.js +0 -61
  77. package/dist/es/Inspector/utils/highlight.js +0 -74
  78. package/dist/es/Inspector/utils/inspect.js +0 -119
  79. package/dist/es/MiaodaInspector/MiaodaInspector.js +0 -397
  80. package/dist/es/MiaodaInspector/index.js +0 -1
  81. package/dist/es/index.js +0 -2
  82. package/dist/es/types/iframe-events.js +0 -1
  83. package/dist/es/types/index.js +0 -1
  84. package/dist/es/utils/index.js +0 -3
  85. package/dist/es/utils/origin.js +0 -19
  86. package/dist/es/utils/style-calculator.js +0 -158
  87. /package/dist/es/Inspector/hooks/{index.js → index.mjs} +0 -0
  88. /package/dist/es/Inspector/utils/{index.js → index.mjs} +0 -0
@@ -1,47 +1,48 @@
1
1
  import React from 'react';
2
- import { type InspectorUIConfig } from '../config/ui-config';
3
- import './MiaodaInspector.css';
2
+ import { InspectorUIConfig } from '../config/ui-config.js';
3
+
4
4
  interface IThemeMeta {
5
- themeColors: {
6
- title: string;
7
- options: {
8
- value: string;
9
- color: string;
10
- }[];
11
- };
12
- themeRadius: {
13
- title: string;
14
- options: {
15
- value: {
16
- pixel: string;
17
- rem: string;
18
- };
19
- iconUrl: string;
20
- size: string;
21
- }[];
22
- };
23
- themeSpaces: {
24
- title: string;
25
- options: {
26
- value: {
27
- pixel: string;
28
- rem: string;
29
- };
30
- iconUrl: string;
31
- size: string;
32
- }[];
33
- };
5
+ themeColors: {
6
+ title: string;
7
+ options: {
8
+ value: string;
9
+ color: string;
10
+ }[];
11
+ };
12
+ themeRadius: {
13
+ title: string;
14
+ options: {
15
+ value: {
16
+ pixel: string;
17
+ rem: string;
18
+ };
19
+ iconUrl: string;
20
+ size: string;
21
+ }[];
22
+ };
23
+ themeSpaces: {
24
+ title: string;
25
+ options: {
26
+ value: {
27
+ pixel: string;
28
+ rem: string;
29
+ };
30
+ iconUrl: string;
31
+ size: string;
32
+ }[];
33
+ };
34
34
  }
35
35
  interface MiaodaInspectorProps {
36
- cwd: string;
37
- theme: {
38
- themeColorTokenMap: {
39
- light: Record<string, string>;
40
- dark: Record<string, string>;
36
+ cwd: string;
37
+ theme: {
38
+ themeColorTokenMap: {
39
+ light: Record<string, string>;
40
+ dark: Record<string, string>;
41
+ };
42
+ themeMetaOptions: Omit<IThemeMeta, 'colorPrimary' | 'borderRadius' | 'spacing'>;
43
+ themeToken: InspectorUIConfig;
41
44
  };
42
- themeMetaOptions: Omit<IThemeMeta, 'colorPrimary' | 'borderRadius' | 'spacing'>;
43
- themeToken: InspectorUIConfig;
44
- };
45
45
  }
46
- export declare function MiaodaInspector(props: MiaodaInspectorProps): React.JSX.Element;
47
- export {};
46
+ declare function MiaodaInspector(props: MiaodaInspectorProps): React.JSX.Element;
47
+
48
+ export { MiaodaInspector };
@@ -1 +1,3 @@
1
- export { MiaodaInspector } from './MiaodaInspector';
1
+ export { MiaodaInspector } from './MiaodaInspector.js';
2
+ import 'react';
3
+ import '../config/ui-config.js';
@@ -1,49 +1,50 @@
1
- export interface SelectOption {
2
- label: string;
3
- value: string;
4
- rawValue: string;
1
+ interface SelectOption {
2
+ label: string;
3
+ value: string;
4
+ rawValue: string;
5
5
  }
6
- export interface SelectUIConfig {
7
- type: 'select';
8
- options: SelectOption[];
6
+ interface SelectUIConfig {
7
+ type: 'select';
8
+ options: SelectOption[];
9
9
  }
10
- export interface SpacingUIConfig {
11
- type: 'spacing';
12
- options: SelectOption[];
10
+ interface SpacingUIConfig {
11
+ type: 'spacing';
12
+ options: SelectOption[];
13
13
  }
14
14
  interface Color {
15
- label: string;
16
- value: string;
17
- type?: 'tailwind' | 'style';
18
- rawValue?: string;
15
+ label: string;
16
+ value: string;
17
+ type?: 'tailwind' | 'style';
18
+ rawValue?: string;
19
19
  }
20
- export interface ColorPickerUIConfig {
21
- type: 'color-picker';
22
- recommendColors: {
23
- title: string;
24
- options: Color[];
25
- }[];
20
+ interface ColorPickerUIConfig {
21
+ type: 'color-picker';
22
+ recommendColors: {
23
+ title: string;
24
+ options: Color[];
25
+ }[];
26
26
  }
27
- export interface IconPickerUIConfig {
28
- type: 'icon-picker';
27
+ interface IconPickerUIConfig {
28
+ type: 'icon-picker';
29
29
  }
30
- export type UIComponentConfig = SelectUIConfig | ColorPickerUIConfig | IconPickerUIConfig | SpacingUIConfig;
31
- export interface InspectorUIConfig {
32
- version: string;
33
- common: {
34
- fontSize: UIComponentConfig;
35
- fontWeight: UIComponentConfig;
36
- borderRadius: UIComponentConfig;
37
- borderWidth: UIComponentConfig;
38
- textAlign: UIComponentConfig;
39
- padding: UIComponentConfig;
40
- margin: UIComponentConfig;
41
- color: UIComponentConfig;
42
- borderColor: UIComponentConfig;
43
- backgroundColor: UIComponentConfig;
44
- };
45
- components?: Record<string, Record<string, UIComponentConfig>>;
46
- tokens: Record<string, string>;
30
+ type UIComponentConfig = SelectUIConfig | ColorPickerUIConfig | IconPickerUIConfig | SpacingUIConfig;
31
+ interface InspectorUIConfig {
32
+ version: string;
33
+ common: {
34
+ fontSize: UIComponentConfig;
35
+ fontWeight: UIComponentConfig;
36
+ borderRadius: UIComponentConfig;
37
+ borderWidth: UIComponentConfig;
38
+ textAlign: UIComponentConfig;
39
+ padding: UIComponentConfig;
40
+ margin: UIComponentConfig;
41
+ color: UIComponentConfig;
42
+ borderColor: UIComponentConfig;
43
+ backgroundColor: UIComponentConfig;
44
+ };
45
+ components?: Record<string, Record<string, UIComponentConfig>>;
46
+ tokens: Record<string, string>;
47
47
  }
48
- export declare const defaultUIConfig: InspectorUIConfig;
49
- export {};
48
+ declare const defaultUIConfig: InspectorUIConfig;
49
+
50
+ export { type ColorPickerUIConfig, type IconPickerUIConfig, type InspectorUIConfig, type SelectOption, type SelectUIConfig, type SpacingUIConfig, type UIComponentConfig, defaultUIConfig };
@@ -0,0 +1,17 @@
1
+ declare module 'global' {
2
+ global {
3
+ interface Window {
4
+ /**
5
+ * @import { DevToolsHook } from 'https://github.com/facebook/react/blob/v16.13.1/packages/react-devtools-shared/src/backend/types.js'
6
+ * @type DevToolsHook
7
+ */
8
+ __REACT_DEVTOOLS_GLOBAL_HOOK__: any;
9
+
10
+ __REACT_DEVTOOLS_TARGET_WINDOW__: Window;
11
+
12
+ MIAODA_APP_ID?: string;
13
+ MIAODA_BUILTIN_TTT?: string;
14
+ token?: string;
15
+ }
16
+ }
17
+ }
@@ -1,4 +1,5 @@
1
- export { MiaodaInspector } from './MiaodaInspector';
2
- export type { InitConfigMessage, ClearSelectedMessage, EditTextMessage, EditStyleMessage, EditClassNameMessage, PageMountedMessage, TextUpdateMessage, SelectInspectorElementMessage, InspectorInfo, IncomingMessage } from './types';
3
- export { isOutgoingMessage } from './utils';
4
- export type { InspectorUIConfig } from './config/ui-config';
1
+ export { MiaodaInspector } from './MiaodaInspector/MiaodaInspector.js';
2
+ export { ClearSelectedMessage, EditClassNameMessage, EditStyleMessage, EditTextMessage, IncomingMessage, InitConfigMessage, InspectorInfo, PageMountedMessage, SelectInspectorElementMessage, TextUpdateMessage } from './types/iframe-events.js';
3
+ export { isOutgoingMessage } from './utils/origin.js';
4
+ export { InspectorUIConfig } from './config/ui-config.js';
5
+ import 'react';
@@ -1,155 +1,158 @@
1
- import { type InspectorUIConfig } from '../config/ui-config';
1
+ import { InspectorUIConfig } from '../config/ui-config.js';
2
+
2
3
  /**
3
4
  * Iframe message event types for inspector communication
4
5
  */
5
- export interface IframeMessage<T = unknown> {
6
- type: string;
7
- data: T;
6
+ interface IframeMessage<T = unknown> {
7
+ type: string;
8
+ data: T;
8
9
  }
9
- export interface EditClassNameMessage extends IframeMessage<{
10
- elementId: string;
11
- className: string;
10
+ interface EditClassNameMessage extends IframeMessage<{
11
+ elementId: string;
12
+ className: string;
12
13
  }> {
13
- type: 'EditClassName';
14
+ type: 'EditClassName';
14
15
  }
15
- export type IncomingMessage = InitConfigMessage | ClearSelectedMessage | EditTextMessage | EditStyleMessage | EditClassNameMessage;
16
- export interface InitConfigMessage extends IframeMessage<{
17
- inspectorActive?: boolean;
18
- userToken?: string;
19
- appId?: string;
20
- inspectorVersion?: string;
16
+ type IncomingMessage = InitConfigMessage | ClearSelectedMessage | EditTextMessage | EditStyleMessage | EditClassNameMessage;
17
+ interface InitConfigMessage extends IframeMessage<{
18
+ inspectorActive?: boolean;
19
+ userToken?: string;
20
+ appId?: string;
21
+ inspectorVersion?: string;
21
22
  }> {
22
- type: 'InitConfig';
23
+ type: 'InitConfig';
23
24
  }
24
- export interface ClearSelectedMessage extends IframeMessage<{
25
- keepModifications?: boolean;
25
+ interface ClearSelectedMessage extends IframeMessage<{
26
+ keepModifications?: boolean;
26
27
  }> {
27
- type: 'ClearSelected';
28
+ type: 'ClearSelected';
28
29
  }
29
- export interface EditTextMessage extends IframeMessage<{
30
- elementId: string;
31
- textContent: string;
30
+ interface EditTextMessage extends IframeMessage<{
31
+ elementId: string;
32
+ textContent: string;
32
33
  }> {
33
- type: 'EditText';
34
+ type: 'EditText';
34
35
  }
35
- export interface EditStyleMessage extends IframeMessage<{
36
- elementId: string;
37
- styles: Record<string, string>;
36
+ interface EditStyleMessage extends IframeMessage<{
37
+ elementId: string;
38
+ styles: Record<string, string>;
38
39
  }> {
39
- type: 'EditStyle';
40
+ type: 'EditStyle';
40
41
  }
41
- export interface PageMountedMessage extends IframeMessage<{
42
- version?: string;
42
+ interface PageMountedMessage extends IframeMessage<{
43
+ version?: string;
43
44
  }> {
44
- type: 'PageMounted';
45
+ type: 'PageMounted';
45
46
  }
46
- export interface TextUpdateMessage extends IframeMessage<{
47
- elementId: string;
48
- textContent: string | null;
47
+ interface TextUpdateMessage extends IframeMessage<{
48
+ elementId: string;
49
+ textContent: string | null;
49
50
  }> {
50
- type: 'TextUpdate';
51
+ type: 'TextUpdate';
51
52
  }
52
- export interface PageScrollMessage extends IframeMessage<Record<string, never>> {
53
- type: 'PageScroll';
53
+ interface PageScrollMessage extends IframeMessage<Record<string, never>> {
54
+ type: 'PageScroll';
54
55
  }
55
- export interface ElementResizeMessage extends IframeMessage<{
56
- elementId: string;
57
- width: number;
58
- height: number;
59
- top: number;
60
- left: number;
61
- right: number;
62
- bottom: number;
56
+ interface ElementResizeMessage extends IframeMessage<{
57
+ elementId: string;
58
+ width: number;
59
+ height: number;
60
+ top: number;
61
+ left: number;
62
+ right: number;
63
+ bottom: number;
63
64
  }> {
64
- type: 'ElementResize';
65
+ type: 'ElementResize';
65
66
  }
66
- export interface InspectorInfo {
67
- columnNumber: string;
68
- lineNumber: string;
69
- relativePath: string;
70
- tagName: string;
71
- componentName: string;
72
- className: string;
73
- x?: number;
74
- y?: number;
75
- top?: number;
76
- bottom?: number;
77
- right?: number;
78
- left?: number;
79
- width?: number;
80
- height?: number;
81
- textContent?: string;
82
- elementId: string;
83
- fontSize?: {
84
- value: string;
85
- inherited: boolean;
86
- tailwindClassName: string;
87
- };
88
- fontWeight?: {
89
- value: string;
90
- inherited: boolean;
91
- tailwindClassName: string;
92
- };
93
- borderRadius?: {
94
- value: string;
95
- inherited: boolean;
96
- tailwindClassName: string;
97
- };
98
- borderWidth?: {
99
- value: string;
100
- inherited: boolean;
101
- tailwindClassName: string;
102
- };
103
- textAlign?: {
104
- value: string;
105
- inherited: boolean;
106
- tailwindClassName: string;
107
- };
108
- padding?: {
109
- value: string;
110
- inherited: boolean;
111
- tailwindClassName: string;
112
- };
113
- margin?: {
114
- value: string;
115
- inherited: boolean;
116
- tailwindClassName: string;
117
- };
118
- color?: {
119
- value: string;
120
- inherited: boolean;
121
- tailwindClassName: string;
122
- };
123
- backgroundColor?: {
124
- value: string;
125
- inherited: boolean;
126
- tailwindClassName: string;
127
- };
128
- borderColor?: {
129
- value: string;
130
- inherited: boolean;
131
- tailwindClassName: string;
132
- };
133
- /**
134
- * metadata information from babel plugin
135
- */
136
- metadata?: {
137
- elementStart: number;
138
- elementEnd: number;
139
- tagStart: number;
140
- tagEnd: number;
141
- classNameLiteral: boolean;
142
- };
67
+ interface InspectorInfo {
68
+ columnNumber: string;
69
+ lineNumber: string;
70
+ relativePath: string;
71
+ tagName: string;
72
+ componentName: string;
73
+ className: string;
74
+ x?: number;
75
+ y?: number;
76
+ top?: number;
77
+ bottom?: number;
78
+ right?: number;
79
+ left?: number;
80
+ width?: number;
81
+ height?: number;
82
+ textContent?: string;
83
+ elementId: string;
84
+ fontSize?: {
85
+ value: string;
86
+ inherited: boolean;
87
+ tailwindClassName: string;
88
+ };
89
+ fontWeight?: {
90
+ value: string;
91
+ inherited: boolean;
92
+ tailwindClassName: string;
93
+ };
94
+ borderRadius?: {
95
+ value: string;
96
+ inherited: boolean;
97
+ tailwindClassName: string;
98
+ };
99
+ borderWidth?: {
100
+ value: string;
101
+ inherited: boolean;
102
+ tailwindClassName: string;
103
+ };
104
+ textAlign?: {
105
+ value: string;
106
+ inherited: boolean;
107
+ tailwindClassName: string;
108
+ };
109
+ padding?: {
110
+ value: string;
111
+ inherited: boolean;
112
+ tailwindClassName: string;
113
+ };
114
+ margin?: {
115
+ value: string;
116
+ inherited: boolean;
117
+ tailwindClassName: string;
118
+ };
119
+ color?: {
120
+ value: string;
121
+ inherited: boolean;
122
+ tailwindClassName: string;
123
+ };
124
+ backgroundColor?: {
125
+ value: string;
126
+ inherited: boolean;
127
+ tailwindClassName: string;
128
+ };
129
+ borderColor?: {
130
+ value: string;
131
+ inherited: boolean;
132
+ tailwindClassName: string;
133
+ };
134
+ /**
135
+ * metadata information from babel plugin
136
+ */
137
+ metadata?: {
138
+ elementStart: number;
139
+ elementEnd: number;
140
+ tagStart: number;
141
+ tagEnd: number;
142
+ classNameLiteral: boolean;
143
+ };
143
144
  }
144
- export interface SelectInspectorElementMessage extends IframeMessage<InspectorInfo> {
145
- type: 'SelectInspectorElement';
145
+ interface SelectInspectorElementMessage extends IframeMessage<InspectorInfo> {
146
+ type: 'SelectInspectorElement';
146
147
  }
147
- export interface InspectorUIConfigMessage extends IframeMessage<InspectorUIConfig> {
148
- type: 'InspectorUIConfig';
148
+ interface InspectorUIConfigMessage extends IframeMessage<InspectorUIConfig> {
149
+ type: 'InspectorUIConfig';
149
150
  }
150
- export type OutgoingMessage = PageMountedMessage | TextUpdateMessage | PageScrollMessage | ElementResizeMessage | SelectInspectorElementMessage | InspectorUIConfigMessage;
151
+ type OutgoingMessage = PageMountedMessage | TextUpdateMessage | PageScrollMessage | ElementResizeMessage | SelectInspectorElementMessage | InspectorUIConfigMessage;
151
152
  declare global {
152
- interface WindowEventMap {
153
- message: MessageEvent<IframeMessage>;
154
- }
155
- }
153
+ interface WindowEventMap {
154
+ message: MessageEvent<IframeMessage>;
155
+ }
156
+ }
157
+
158
+ export type { ClearSelectedMessage, EditClassNameMessage, EditStyleMessage, EditTextMessage, ElementResizeMessage, IframeMessage, IncomingMessage, InitConfigMessage, InspectorInfo, InspectorUIConfigMessage, OutgoingMessage, PageMountedMessage, PageScrollMessage, SelectInspectorElementMessage, TextUpdateMessage };
@@ -1 +1,2 @@
1
- export { InitConfigMessage, ClearSelectedMessage, EditTextMessage, EditStyleMessage, EditClassNameMessage, OutgoingMessage, PageMountedMessage, TextUpdateMessage, SelectInspectorElementMessage, IncomingMessage, InspectorInfo } from './iframe-events';
1
+ export { ClearSelectedMessage, EditClassNameMessage, EditStyleMessage, EditTextMessage, IncomingMessage, InitConfigMessage, InspectorInfo, OutgoingMessage, PageMountedMessage, SelectInspectorElementMessage, TextUpdateMessage } from './iframe-events.js';
2
+ import '../config/ui-config.js';
@@ -1,12 +1,15 @@
1
- import type { InspectorUIConfig } from '../config/ui-config';
2
- export interface StyleCalculationConfig {
3
- cssProperty: string;
4
- tailwindPrefix: string;
5
- map: Record<string | number, string>;
6
- defaultValue?: string;
7
- transformValue?: (value: string) => string | number;
8
- tolerance?: number;
9
- skipTailwind?: boolean;
1
+ import { InspectorUIConfig } from '../config/ui-config.js';
2
+
3
+ interface StyleCalculationConfig {
4
+ cssProperty: string;
5
+ tailwindPrefix: string;
6
+ map: Record<string | number, string>;
7
+ defaultValue?: string;
8
+ transformValue?: (value: string) => string | number;
9
+ tolerance?: number;
10
+ skipTailwind?: boolean;
10
11
  }
11
- export declare function getStyleCalculationConfig(config: InspectorUIConfig, propertyName: keyof InspectorUIConfig['common']): StyleCalculationConfig;
12
- export declare function getAllStyleConfigs(config: InspectorUIConfig): Record<string, StyleCalculationConfig>;
12
+ declare function getStyleCalculationConfig(config: InspectorUIConfig, propertyName: keyof InspectorUIConfig['common']): StyleCalculationConfig;
13
+ declare function getAllStyleConfigs(config: InspectorUIConfig): Record<string, StyleCalculationConfig>;
14
+
15
+ export { type StyleCalculationConfig, getAllStyleConfigs, getStyleCalculationConfig };
@@ -1,2 +1,5 @@
1
- import { type ClassValue } from 'clsx';
2
- export declare function cx(...args: ClassValue[]): string;
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function cx(...args: ClassValue[]): string;
4
+
5
+ export { cx };
@@ -1,3 +1,7 @@
1
- export { getPreviewParentOrigin, postMessage, isIncomingMessage, isOutgoingMessage } from './origin';
2
- export { cx } from './css';
3
- export { calculateFontSizeInfo, calculateFontWeightInfo, calculateBorderRadiusInfo, calculateBorderWidthInfo, calculateTextAlignInfo, calculatePaddingInfo, calculateMarginInfo, calculateColorInfo, calculateBackgroundColorInfo, calculateBorderColorInfo } from './style-calculator';
1
+ export { getPreviewParentOrigin, isIncomingMessage, isOutgoingMessage, postMessage } from './origin.js';
2
+ export { cx } from './css.js';
3
+ export { calculateBackgroundColorInfo, calculateBorderColorInfo, calculateBorderRadiusInfo, calculateBorderWidthInfo, calculateColorInfo, calculateFontSizeInfo, calculateFontWeightInfo, calculateMarginInfo, calculatePaddingInfo, calculateTextAlignInfo } from './style-calculator.js';
4
+ import '../types/iframe-events.js';
5
+ import '../config/ui-config.js';
6
+ import 'clsx';
7
+ import './config-mapper.js';
@@ -1,9 +1,13 @@
1
- import { type OutgoingMessage, type IncomingMessage } from '../types';
2
- export declare function getPreviewParentOrigin(): string;
3
- export declare function postMessage<T extends OutgoingMessage>(message: T, targetOrigin?: string): void;
4
- export declare function isOutgoingMessage<T extends OutgoingMessage['type']>(msg: OutgoingMessage, type: T): msg is Extract<OutgoingMessage, {
5
- type: T;
1
+ import { OutgoingMessage, IncomingMessage } from '../types/iframe-events.js';
2
+ import '../config/ui-config.js';
3
+
4
+ declare function getPreviewParentOrigin(): string;
5
+ declare function postMessage<T extends OutgoingMessage>(message: T, targetOrigin?: string): void;
6
+ declare function isOutgoingMessage<T extends OutgoingMessage['type']>(msg: OutgoingMessage, type: T): msg is Extract<OutgoingMessage, {
7
+ type: T;
6
8
  }>;
7
- export declare function isIncomingMessage<T extends IncomingMessage['type']>(msg: IncomingMessage, type: T): msg is Extract<IncomingMessage, {
8
- type: T;
9
- }>;
9
+ declare function isIncomingMessage<T extends IncomingMessage['type']>(msg: IncomingMessage, type: T): msg is Extract<IncomingMessage, {
10
+ type: T;
11
+ }>;
12
+
13
+ export { getPreviewParentOrigin, isIncomingMessage, isOutgoingMessage, postMessage };
@@ -1,19 +1,22 @@
1
- import type { StyleCalculationConfig } from './config-mapper';
1
+ import { StyleCalculationConfig } from './config-mapper.js';
2
+ import '../config/ui-config.js';
3
+
2
4
  interface StyleCalculationResult {
3
- value: string;
4
- inherited: boolean;
5
- tailwindClassName: string;
5
+ value: string;
6
+ inherited: boolean;
7
+ tailwindClassName: string;
6
8
  }
7
- export declare function rgbaToHex(rgba: string): string;
8
- export declare function calculateStyle(styleName: string, element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>): StyleCalculationResult | null;
9
- export declare const calculateFontSizeInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
10
- export declare const calculateFontWeightInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
11
- export declare const calculateBorderRadiusInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
12
- export declare const calculateBorderWidthInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
13
- export declare const calculateTextAlignInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
14
- export declare const calculatePaddingInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
15
- export declare const calculateMarginInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
16
- export declare const calculateColorInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
17
- export declare const calculateBackgroundColorInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
18
- export declare const calculateBorderColorInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
19
- export {};
9
+ declare function rgbaToHex(rgba: string): string;
10
+ declare function calculateStyle(styleName: string, element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>): StyleCalculationResult | null;
11
+ declare const calculateFontSizeInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
12
+ declare const calculateFontWeightInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
13
+ declare const calculateBorderRadiusInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
14
+ declare const calculateBorderWidthInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
15
+ declare const calculateTextAlignInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
16
+ declare const calculatePaddingInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
17
+ declare const calculateMarginInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
18
+ declare const calculateColorInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
19
+ declare const calculateBackgroundColorInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
20
+ declare const calculateBorderColorInfo: (element: HTMLElement, componentName: string, canUseNewInspector: boolean, styleConfigs: Record<string, StyleCalculationConfig>) => StyleCalculationResult | null;
21
+
22
+ export { calculateBackgroundColorInfo, calculateBorderColorInfo, calculateBorderRadiusInfo, calculateBorderWidthInfo, calculateColorInfo, calculateFontSizeInfo, calculateFontWeightInfo, calculateMarginInfo, calculatePaddingInfo, calculateStyle, calculateTextAlignInfo, rgbaToHex };