@promakeai/inspector-types 1.0.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.ts +348 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/package.json +40 -0
- package/src/index.js +7 -0
- package/src/index.ts +452 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for @promakeai/inspector
|
|
3
|
+
*
|
|
4
|
+
* Bu dosya inspector için kullanılan tüm type'ları içerir.
|
|
5
|
+
* Hook ve plugin arasında paylaşılan type'lar burada tanımlanır.
|
|
6
|
+
*/
|
|
7
|
+
export interface ComponentInfo {
|
|
8
|
+
id?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
fileName?: string;
|
|
12
|
+
lineNumber?: number;
|
|
13
|
+
columnNumber?: number;
|
|
14
|
+
component?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ElementPosition {
|
|
17
|
+
top: number;
|
|
18
|
+
left: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ElementReference {
|
|
23
|
+
id: string;
|
|
24
|
+
tagName: string;
|
|
25
|
+
className: string;
|
|
26
|
+
selector?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SelectedElementData {
|
|
29
|
+
id: string;
|
|
30
|
+
tagName: string;
|
|
31
|
+
className: string;
|
|
32
|
+
component: ComponentInfo | null;
|
|
33
|
+
position: ElementPosition;
|
|
34
|
+
isTextNode?: boolean;
|
|
35
|
+
textContent?: string;
|
|
36
|
+
isImageNode?: boolean;
|
|
37
|
+
imageUrl?: string;
|
|
38
|
+
selector?: string;
|
|
39
|
+
currentRoute?: string;
|
|
40
|
+
parents?: ElementReference[];
|
|
41
|
+
children?: ElementReference[];
|
|
42
|
+
}
|
|
43
|
+
export interface UrlChangeData {
|
|
44
|
+
url: string;
|
|
45
|
+
pathname: string;
|
|
46
|
+
search: string;
|
|
47
|
+
hash: string;
|
|
48
|
+
}
|
|
49
|
+
export interface PromptSubmittedData {
|
|
50
|
+
prompt: string;
|
|
51
|
+
element: SelectedElementData;
|
|
52
|
+
}
|
|
53
|
+
export interface TextUpdatedData {
|
|
54
|
+
text: string;
|
|
55
|
+
originalText: string;
|
|
56
|
+
element: SelectedElementData;
|
|
57
|
+
}
|
|
58
|
+
export interface ImageUpdatedData {
|
|
59
|
+
imageData: string;
|
|
60
|
+
imageFile: {
|
|
61
|
+
name: string;
|
|
62
|
+
size: number;
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
originalImageUrl: string;
|
|
66
|
+
element: SelectedElementData;
|
|
67
|
+
}
|
|
68
|
+
export interface StyleChanges {
|
|
69
|
+
backgroundColor?: string;
|
|
70
|
+
height?: string;
|
|
71
|
+
width?: string;
|
|
72
|
+
display?: string;
|
|
73
|
+
opacity?: string;
|
|
74
|
+
flex?: string;
|
|
75
|
+
flexDirection?: string;
|
|
76
|
+
justifyContent?: string;
|
|
77
|
+
alignItems?: string;
|
|
78
|
+
objectFit?: string;
|
|
79
|
+
color?: string;
|
|
80
|
+
fontSize?: string;
|
|
81
|
+
fontWeight?: string;
|
|
82
|
+
fontFamily?: string;
|
|
83
|
+
textAlign?: string;
|
|
84
|
+
textDecoration?: string;
|
|
85
|
+
borderRadius?: string;
|
|
86
|
+
borderWidth?: string;
|
|
87
|
+
borderColor?: string;
|
|
88
|
+
borderStyle?: string;
|
|
89
|
+
paddingVertical?: string;
|
|
90
|
+
paddingHorizontal?: string;
|
|
91
|
+
marginVertical?: string;
|
|
92
|
+
marginHorizontal?: string;
|
|
93
|
+
paddingTop?: string;
|
|
94
|
+
paddingRight?: string;
|
|
95
|
+
paddingBottom?: string;
|
|
96
|
+
paddingLeft?: string;
|
|
97
|
+
marginTop?: string;
|
|
98
|
+
marginRight?: string;
|
|
99
|
+
marginBottom?: string;
|
|
100
|
+
marginLeft?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface StyleUpdatedData {
|
|
103
|
+
element: SelectedElementData;
|
|
104
|
+
styles: StyleChanges;
|
|
105
|
+
inlineStyles: Record<string, string>;
|
|
106
|
+
tailwindClasses: string[];
|
|
107
|
+
appliedStyles: {
|
|
108
|
+
layout?: {
|
|
109
|
+
backgroundColor?: string;
|
|
110
|
+
height?: string;
|
|
111
|
+
width?: string;
|
|
112
|
+
};
|
|
113
|
+
text?: {
|
|
114
|
+
color?: string;
|
|
115
|
+
fontSize?: string;
|
|
116
|
+
fontWeight?: string;
|
|
117
|
+
fontFamily?: string;
|
|
118
|
+
textAlign?: string;
|
|
119
|
+
};
|
|
120
|
+
border?: {
|
|
121
|
+
borderRadius?: string;
|
|
122
|
+
borderWidth?: string;
|
|
123
|
+
borderColor?: string;
|
|
124
|
+
borderStyle?: string;
|
|
125
|
+
};
|
|
126
|
+
spacing?: {
|
|
127
|
+
paddingVertical?: string;
|
|
128
|
+
paddingHorizontal?: string;
|
|
129
|
+
marginVertical?: string;
|
|
130
|
+
marginHorizontal?: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export interface ErrorData {
|
|
135
|
+
type: "javascript" | "promise" | "console" | "vite";
|
|
136
|
+
message: string;
|
|
137
|
+
stack?: string;
|
|
138
|
+
fileName?: string;
|
|
139
|
+
lineNumber?: number;
|
|
140
|
+
columnNumber?: number;
|
|
141
|
+
timestamp: number;
|
|
142
|
+
frame?: string;
|
|
143
|
+
plugin?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface HighlightOptions {
|
|
146
|
+
duration?: number;
|
|
147
|
+
scrollIntoView?: boolean;
|
|
148
|
+
color?: string;
|
|
149
|
+
animation?: "pulse" | "fade" | "none";
|
|
150
|
+
targetRoute?: string;
|
|
151
|
+
}
|
|
152
|
+
export interface ElementInfoData {
|
|
153
|
+
found: boolean;
|
|
154
|
+
element?: SelectedElementData;
|
|
155
|
+
error?: string;
|
|
156
|
+
}
|
|
157
|
+
export interface InspectorLabels {
|
|
158
|
+
editText?: string;
|
|
159
|
+
textContentLabel?: string;
|
|
160
|
+
textPlaceholder?: string;
|
|
161
|
+
linkUrlLabel?: string;
|
|
162
|
+
updateText?: string;
|
|
163
|
+
editImage?: string;
|
|
164
|
+
imageUploadTitle?: string;
|
|
165
|
+
imageUploadHint?: string;
|
|
166
|
+
updateImage?: string;
|
|
167
|
+
promptPlaceholder?: string;
|
|
168
|
+
styleEditorTitle?: string;
|
|
169
|
+
layoutSectionTitle?: string;
|
|
170
|
+
displaySectionTitle?: string;
|
|
171
|
+
imageSectionTitle?: string;
|
|
172
|
+
textSectionTitle?: string;
|
|
173
|
+
borderSectionTitle?: string;
|
|
174
|
+
spacingSectionTitle?: string;
|
|
175
|
+
backgroundColorLabel?: string;
|
|
176
|
+
heightLabel?: string;
|
|
177
|
+
widthLabel?: string;
|
|
178
|
+
displayLabel?: string;
|
|
179
|
+
opacityLabel?: string;
|
|
180
|
+
flexLabel?: string;
|
|
181
|
+
flexDirectionLabel?: string;
|
|
182
|
+
justifyContentLabel?: string;
|
|
183
|
+
alignItemsLabel?: string;
|
|
184
|
+
objectFitLabel?: string;
|
|
185
|
+
colorLabel?: string;
|
|
186
|
+
fontSizeLabel?: string;
|
|
187
|
+
fontWeightLabel?: string;
|
|
188
|
+
fontFamilyLabel?: string;
|
|
189
|
+
textAlignLabel?: string;
|
|
190
|
+
textDecorationLabel?: string;
|
|
191
|
+
borderRadiusLabel?: string;
|
|
192
|
+
borderWidthLabel?: string;
|
|
193
|
+
borderColorLabel?: string;
|
|
194
|
+
borderStyleLabel?: string;
|
|
195
|
+
paddingLabel?: string;
|
|
196
|
+
paddingVerticalLabel?: string;
|
|
197
|
+
paddingHorizontalLabel?: string;
|
|
198
|
+
marginLabel?: string;
|
|
199
|
+
marginVerticalLabel?: string;
|
|
200
|
+
marginHorizontalLabel?: string;
|
|
201
|
+
elementContainer?: string;
|
|
202
|
+
elementText?: string;
|
|
203
|
+
elementImage?: string;
|
|
204
|
+
elementButton?: string;
|
|
205
|
+
elementLink?: string;
|
|
206
|
+
elementInput?: string;
|
|
207
|
+
elementTextArea?: string;
|
|
208
|
+
elementHeading?: string;
|
|
209
|
+
elementParagraph?: string;
|
|
210
|
+
elementSection?: string;
|
|
211
|
+
elementDefault?: string;
|
|
212
|
+
displayBlock?: string;
|
|
213
|
+
displayInline?: string;
|
|
214
|
+
displayInlineBlock?: string;
|
|
215
|
+
displayFlex?: string;
|
|
216
|
+
displayGrid?: string;
|
|
217
|
+
displayNone?: string;
|
|
218
|
+
flexDirectionRow?: string;
|
|
219
|
+
flexDirectionRowReverse?: string;
|
|
220
|
+
flexDirectionColumn?: string;
|
|
221
|
+
flexDirectionColumnReverse?: string;
|
|
222
|
+
justifyContentFlexStart?: string;
|
|
223
|
+
justifyContentCenter?: string;
|
|
224
|
+
justifyContentFlexEnd?: string;
|
|
225
|
+
justifyContentSpaceBetween?: string;
|
|
226
|
+
justifyContentSpaceAround?: string;
|
|
227
|
+
justifyContentSpaceEvenly?: string;
|
|
228
|
+
alignItemsFlexStart?: string;
|
|
229
|
+
alignItemsCenter?: string;
|
|
230
|
+
alignItemsFlexEnd?: string;
|
|
231
|
+
alignItemsStretch?: string;
|
|
232
|
+
alignItemsBaseline?: string;
|
|
233
|
+
fontSizeXS?: string;
|
|
234
|
+
fontSizeSM?: string;
|
|
235
|
+
fontSizeBase?: string;
|
|
236
|
+
fontSizeLG?: string;
|
|
237
|
+
fontSizeXL?: string;
|
|
238
|
+
fontSize2XL?: string;
|
|
239
|
+
fontSize3XL?: string;
|
|
240
|
+
fontSize4XL?: string;
|
|
241
|
+
fontSize5XL?: string;
|
|
242
|
+
fontWeightThin?: string;
|
|
243
|
+
fontWeightExtralight?: string;
|
|
244
|
+
fontWeightNormal?: string;
|
|
245
|
+
fontWeightMedium?: string;
|
|
246
|
+
fontWeightSemibold?: string;
|
|
247
|
+
fontWeightBold?: string;
|
|
248
|
+
fontWeightExtrabold?: string;
|
|
249
|
+
fontWeightBlack?: string;
|
|
250
|
+
textDecorationNone?: string;
|
|
251
|
+
textDecorationUnderline?: string;
|
|
252
|
+
textDecorationLineThrough?: string;
|
|
253
|
+
textDecorationOverline?: string;
|
|
254
|
+
borderStyleSolid?: string;
|
|
255
|
+
borderStyleDashed?: string;
|
|
256
|
+
borderStyleDotted?: string;
|
|
257
|
+
borderStyleDouble?: string;
|
|
258
|
+
borderStyleGroove?: string;
|
|
259
|
+
borderStyleRidge?: string;
|
|
260
|
+
borderStyleInset?: string;
|
|
261
|
+
borderStyleOutset?: string;
|
|
262
|
+
borderStyleNone?: string;
|
|
263
|
+
objectFitContain?: string;
|
|
264
|
+
objectFitCover?: string;
|
|
265
|
+
objectFitFill?: string;
|
|
266
|
+
objectFitNone?: string;
|
|
267
|
+
objectFitScaleDown?: string;
|
|
268
|
+
saveButton?: string;
|
|
269
|
+
resetButton?: string;
|
|
270
|
+
cancelButton?: string;
|
|
271
|
+
unsavedChangesText?: string;
|
|
272
|
+
savingText?: string;
|
|
273
|
+
hintText?: string;
|
|
274
|
+
unsavedDialogTitle?: string;
|
|
275
|
+
unsavedDialogMessage?: string;
|
|
276
|
+
saveChangesButton?: string;
|
|
277
|
+
discardChangesButton?: string;
|
|
278
|
+
continueEditingButton?: string;
|
|
279
|
+
textTabLabel?: string;
|
|
280
|
+
imageTabLabel?: string;
|
|
281
|
+
styleTabLabel?: string;
|
|
282
|
+
badgeText?: string;
|
|
283
|
+
badgeUrl?: string;
|
|
284
|
+
}
|
|
285
|
+
export interface InspectorTheme {
|
|
286
|
+
backgroundColor?: string;
|
|
287
|
+
textColor?: string;
|
|
288
|
+
secondaryTextColor?: string;
|
|
289
|
+
buttonColor?: string;
|
|
290
|
+
buttonTextColor?: string;
|
|
291
|
+
buttonHoverColor?: string;
|
|
292
|
+
secondaryButtonColor?: string;
|
|
293
|
+
secondaryButtonTextColor?: string;
|
|
294
|
+
secondaryButtonHoverColor?: string;
|
|
295
|
+
dangerButtonColor?: string;
|
|
296
|
+
dangerButtonTextColor?: string;
|
|
297
|
+
inputBackgroundColor?: string;
|
|
298
|
+
inputTextColor?: string;
|
|
299
|
+
inputBorderColor?: string;
|
|
300
|
+
inputFocusBorderColor?: string;
|
|
301
|
+
inputPlaceholderColor?: string;
|
|
302
|
+
borderColor?: string;
|
|
303
|
+
warningColor?: string;
|
|
304
|
+
successColor?: string;
|
|
305
|
+
errorColor?: string;
|
|
306
|
+
tabContainerBg?: string;
|
|
307
|
+
tabActiveBg?: string;
|
|
308
|
+
tabInactiveBg?: string;
|
|
309
|
+
tabActiveColor?: string;
|
|
310
|
+
tabInactiveColor?: string;
|
|
311
|
+
badgeGradientStart?: string;
|
|
312
|
+
badgeGradientEnd?: string;
|
|
313
|
+
badgeTextColor?: string;
|
|
314
|
+
overlayColor?: string;
|
|
315
|
+
overlayOpacity?: number;
|
|
316
|
+
dialogBackdropColor?: string;
|
|
317
|
+
dialogBackgroundColor?: string;
|
|
318
|
+
dialogTextColor?: string;
|
|
319
|
+
dialogSecondaryTextColor?: string;
|
|
320
|
+
}
|
|
321
|
+
export interface ContentInputRequestData {
|
|
322
|
+
show: boolean;
|
|
323
|
+
}
|
|
324
|
+
export interface InspectorCallbacks {
|
|
325
|
+
onElementSelected?: (data: SelectedElementData) => void;
|
|
326
|
+
onUrlChange?: (data: UrlChangeData) => void;
|
|
327
|
+
onPromptSubmitted?: (data: PromptSubmittedData) => void;
|
|
328
|
+
onTextUpdated?: (data: TextUpdatedData) => void;
|
|
329
|
+
onImageUpdated?: (data: ImageUpdatedData) => void;
|
|
330
|
+
onStyleUpdated?: (data: StyleUpdatedData) => void;
|
|
331
|
+
onInspectorClosed?: () => void;
|
|
332
|
+
onError?: (data: ErrorData) => void;
|
|
333
|
+
onElementInfoReceived?: (data: ElementInfoData) => void;
|
|
334
|
+
}
|
|
335
|
+
export interface UseInspectorReturn {
|
|
336
|
+
isInspecting: boolean;
|
|
337
|
+
toggleInspector: (active?: boolean) => void;
|
|
338
|
+
startInspecting: () => void;
|
|
339
|
+
stopInspecting: () => void;
|
|
340
|
+
showContentInput: (show: boolean, updateImmediately?: boolean) => void;
|
|
341
|
+
showImageInput: (show: boolean, updateImmediately?: boolean) => void;
|
|
342
|
+
showStyleEditor: (show: boolean) => void;
|
|
343
|
+
setBadgeVisible: (visible: boolean) => void;
|
|
344
|
+
highlightElement: (id: string, options?: HighlightOptions) => void;
|
|
345
|
+
getElementByInspectorId: (id: string) => void;
|
|
346
|
+
setShowChildBorders: (show: boolean) => void;
|
|
347
|
+
}
|
|
348
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,E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C;IACrE,eAAe,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACnE,uBAAuB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,mBAAmB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C"}
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@promakeai/inspector-types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shared TypeScript types for @promakeai/inspector",
|
|
5
|
+
"author": "Promake",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"src"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc --build",
|
|
23
|
+
"dev": "tsc --watch",
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"prepublishOnly": "bun run build"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"inspector",
|
|
29
|
+
"types",
|
|
30
|
+
"typescript"
|
|
31
|
+
],
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/promakeai/inspector.git",
|
|
35
|
+
"directory": "packages/types"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/src/index.js
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for @promakeai/inspector
|
|
3
|
+
*
|
|
4
|
+
* Bu dosya inspector için kullanılan tüm type'ları içerir.
|
|
5
|
+
* Hook ve plugin arasında paylaşılan type'lar burada tanımlanır.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Component info from React Fiber or vite-plugin-component-debugger
|
|
9
|
+
export interface ComponentInfo {
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
path?: string;
|
|
13
|
+
fileName?: string;
|
|
14
|
+
lineNumber?: number;
|
|
15
|
+
columnNumber?: number;
|
|
16
|
+
component?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Element position on screen
|
|
20
|
+
export interface ElementPosition {
|
|
21
|
+
top: number;
|
|
22
|
+
left: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Element reference for parent/child tracking
|
|
28
|
+
export interface ElementReference {
|
|
29
|
+
id: string;
|
|
30
|
+
tagName: string;
|
|
31
|
+
className: string;
|
|
32
|
+
selector?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Selected element data
|
|
36
|
+
export interface SelectedElementData {
|
|
37
|
+
id: string;
|
|
38
|
+
tagName: string;
|
|
39
|
+
className: string;
|
|
40
|
+
component: ComponentInfo | null;
|
|
41
|
+
position: ElementPosition;
|
|
42
|
+
isTextNode?: boolean; // Whether the element is a text node
|
|
43
|
+
textContent?: string; // Text content of the element (if text node)
|
|
44
|
+
isImageNode?: boolean; // Whether the element is an image node
|
|
45
|
+
imageUrl?: string; // Image URL (if image node)
|
|
46
|
+
selector?: string; // CSS selector for element identification
|
|
47
|
+
currentRoute?: string; // Current route when element was selected
|
|
48
|
+
parents?: ElementReference[]; // 3 generations: [parent, grandparent, great-grandparent]
|
|
49
|
+
children?: ElementReference[]; // 3 generations: [child1, child2, child3, ...]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// URL change data
|
|
53
|
+
export interface UrlChangeData {
|
|
54
|
+
url: string;
|
|
55
|
+
pathname: string;
|
|
56
|
+
search: string;
|
|
57
|
+
hash: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Prompt submitted data
|
|
61
|
+
export interface PromptSubmittedData {
|
|
62
|
+
prompt: string;
|
|
63
|
+
element: SelectedElementData;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Text updated data
|
|
67
|
+
export interface TextUpdatedData {
|
|
68
|
+
text: string;
|
|
69
|
+
originalText: string;
|
|
70
|
+
element: SelectedElementData;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Image updated data
|
|
74
|
+
export interface ImageUpdatedData {
|
|
75
|
+
imageData: string; // Base64 encoded image data
|
|
76
|
+
imageFile: {
|
|
77
|
+
name: string;
|
|
78
|
+
size: number;
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
originalImageUrl: string;
|
|
82
|
+
element: SelectedElementData;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Style changes data
|
|
86
|
+
export interface StyleChanges {
|
|
87
|
+
// Layout
|
|
88
|
+
backgroundColor?: string;
|
|
89
|
+
height?: string;
|
|
90
|
+
width?: string;
|
|
91
|
+
display?: string;
|
|
92
|
+
opacity?: string;
|
|
93
|
+
flex?: string;
|
|
94
|
+
flexDirection?: string;
|
|
95
|
+
justifyContent?: string;
|
|
96
|
+
alignItems?: string;
|
|
97
|
+
|
|
98
|
+
// Image
|
|
99
|
+
objectFit?: string;
|
|
100
|
+
|
|
101
|
+
// Text
|
|
102
|
+
color?: string;
|
|
103
|
+
fontSize?: string;
|
|
104
|
+
fontWeight?: string;
|
|
105
|
+
fontFamily?: string;
|
|
106
|
+
textAlign?: string;
|
|
107
|
+
textDecoration?: string;
|
|
108
|
+
|
|
109
|
+
// Border
|
|
110
|
+
borderRadius?: string;
|
|
111
|
+
borderWidth?: string;
|
|
112
|
+
borderColor?: string;
|
|
113
|
+
borderStyle?: string;
|
|
114
|
+
|
|
115
|
+
// Spacing - Vertical/Horizontal (combined)
|
|
116
|
+
paddingVertical?: string;
|
|
117
|
+
paddingHorizontal?: string;
|
|
118
|
+
marginVertical?: string;
|
|
119
|
+
marginHorizontal?: string;
|
|
120
|
+
|
|
121
|
+
// Spacing - Individual sides (for all-sides mode)
|
|
122
|
+
paddingTop?: string;
|
|
123
|
+
paddingRight?: string;
|
|
124
|
+
paddingBottom?: string;
|
|
125
|
+
paddingLeft?: string;
|
|
126
|
+
marginTop?: string;
|
|
127
|
+
marginRight?: string;
|
|
128
|
+
marginBottom?: string;
|
|
129
|
+
marginLeft?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Style updated data
|
|
133
|
+
export interface StyleUpdatedData {
|
|
134
|
+
element: SelectedElementData;
|
|
135
|
+
styles: StyleChanges; // Raw style values
|
|
136
|
+
inlineStyles: Record<string, string>; // React inline style object
|
|
137
|
+
tailwindClasses: string[]; // Tailwind class names for the changes
|
|
138
|
+
appliedStyles: {
|
|
139
|
+
// Detailed breakdown of what was changed
|
|
140
|
+
layout?: {
|
|
141
|
+
backgroundColor?: string;
|
|
142
|
+
height?: string;
|
|
143
|
+
width?: string;
|
|
144
|
+
};
|
|
145
|
+
text?: {
|
|
146
|
+
color?: string;
|
|
147
|
+
fontSize?: string;
|
|
148
|
+
fontWeight?: string;
|
|
149
|
+
fontFamily?: string;
|
|
150
|
+
textAlign?: string;
|
|
151
|
+
};
|
|
152
|
+
border?: {
|
|
153
|
+
borderRadius?: string;
|
|
154
|
+
borderWidth?: string;
|
|
155
|
+
borderColor?: string;
|
|
156
|
+
borderStyle?: string;
|
|
157
|
+
};
|
|
158
|
+
spacing?: {
|
|
159
|
+
paddingVertical?: string;
|
|
160
|
+
paddingHorizontal?: string;
|
|
161
|
+
marginVertical?: string;
|
|
162
|
+
marginHorizontal?: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Error data
|
|
168
|
+
export interface ErrorData {
|
|
169
|
+
type: "javascript" | "promise" | "console" | "vite";
|
|
170
|
+
message: string;
|
|
171
|
+
stack?: string;
|
|
172
|
+
fileName?: string;
|
|
173
|
+
lineNumber?: number;
|
|
174
|
+
columnNumber?: number;
|
|
175
|
+
timestamp: number;
|
|
176
|
+
// Vite error için ek alanlar
|
|
177
|
+
frame?: string; // Kod frame'i
|
|
178
|
+
plugin?: string; // Hangi plugin error verdi
|
|
179
|
+
}
|
|
180
|
+
// Highlight options for visual feedback
|
|
181
|
+
export interface HighlightOptions {
|
|
182
|
+
duration?: number; // Highlight duration in ms (default: 3000)
|
|
183
|
+
scrollIntoView?: boolean; // Scroll to element (default: true)
|
|
184
|
+
color?: string; // Highlight color (default: '#4417db')
|
|
185
|
+
animation?: "pulse" | "fade" | "none"; // Animation type (default: 'pulse')
|
|
186
|
+
targetRoute?: string; // Target route to navigate before highlighting
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Element info response data
|
|
190
|
+
export interface ElementInfoData {
|
|
191
|
+
found: boolean;
|
|
192
|
+
element?: SelectedElementData;
|
|
193
|
+
error?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Customizable labels
|
|
197
|
+
export interface InspectorLabels {
|
|
198
|
+
// Text Editor
|
|
199
|
+
editText?: string;
|
|
200
|
+
textContentLabel?: string;
|
|
201
|
+
textPlaceholder?: string;
|
|
202
|
+
linkUrlLabel?: string;
|
|
203
|
+
updateText?: string;
|
|
204
|
+
|
|
205
|
+
// Image Editor
|
|
206
|
+
editImage?: string;
|
|
207
|
+
imageUploadTitle?: string; // Upload box title (e.g., "Select Image")
|
|
208
|
+
imageUploadHint?: string; // Upload box hint (e.g., "Click or drag")
|
|
209
|
+
updateImage?: string;
|
|
210
|
+
|
|
211
|
+
// Prompt Input
|
|
212
|
+
promptPlaceholder?: string;
|
|
213
|
+
|
|
214
|
+
// Style Editor
|
|
215
|
+
styleEditorTitle?: string;
|
|
216
|
+
layoutSectionTitle?: string;
|
|
217
|
+
displaySectionTitle?: string;
|
|
218
|
+
imageSectionTitle?: string;
|
|
219
|
+
textSectionTitle?: string;
|
|
220
|
+
borderSectionTitle?: string;
|
|
221
|
+
spacingSectionTitle?: string;
|
|
222
|
+
|
|
223
|
+
// Style Properties
|
|
224
|
+
backgroundColorLabel?: string;
|
|
225
|
+
heightLabel?: string;
|
|
226
|
+
widthLabel?: string;
|
|
227
|
+
displayLabel?: string;
|
|
228
|
+
opacityLabel?: string;
|
|
229
|
+
flexLabel?: string;
|
|
230
|
+
flexDirectionLabel?: string;
|
|
231
|
+
justifyContentLabel?: string;
|
|
232
|
+
alignItemsLabel?: string;
|
|
233
|
+
objectFitLabel?: string;
|
|
234
|
+
colorLabel?: string;
|
|
235
|
+
fontSizeLabel?: string;
|
|
236
|
+
fontWeightLabel?: string;
|
|
237
|
+
fontFamilyLabel?: string;
|
|
238
|
+
textAlignLabel?: string;
|
|
239
|
+
textDecorationLabel?: string;
|
|
240
|
+
borderRadiusLabel?: string;
|
|
241
|
+
borderWidthLabel?: string;
|
|
242
|
+
borderColorLabel?: string;
|
|
243
|
+
borderStyleLabel?: string;
|
|
244
|
+
paddingLabel?: string;
|
|
245
|
+
paddingVerticalLabel?: string;
|
|
246
|
+
paddingHorizontalLabel?: string;
|
|
247
|
+
marginLabel?: string;
|
|
248
|
+
marginVerticalLabel?: string;
|
|
249
|
+
marginHorizontalLabel?: string;
|
|
250
|
+
|
|
251
|
+
// Element name labels
|
|
252
|
+
elementContainer?: string; // Default: "Container"
|
|
253
|
+
elementText?: string; // Default: "Text"
|
|
254
|
+
elementImage?: string; // Default: "Image"
|
|
255
|
+
elementButton?: string; // Default: "Button"
|
|
256
|
+
elementLink?: string; // Default: "Link"
|
|
257
|
+
elementInput?: string; // Default: "Input"
|
|
258
|
+
elementTextArea?: string; // Default: "TextArea"
|
|
259
|
+
elementHeading?: string; // Default: "Heading"
|
|
260
|
+
elementParagraph?: string; // Default: "Paragraph"
|
|
261
|
+
elementSection?: string; // Default: "Section"
|
|
262
|
+
elementDefault?: string; // Default: "Element"
|
|
263
|
+
|
|
264
|
+
// Display Dropdown Options
|
|
265
|
+
displayBlock?: string;
|
|
266
|
+
displayInline?: string;
|
|
267
|
+
displayInlineBlock?: string;
|
|
268
|
+
displayFlex?: string;
|
|
269
|
+
displayGrid?: string;
|
|
270
|
+
displayNone?: string;
|
|
271
|
+
|
|
272
|
+
// Flex Direction Dropdown Options
|
|
273
|
+
flexDirectionRow?: string;
|
|
274
|
+
flexDirectionRowReverse?: string;
|
|
275
|
+
flexDirectionColumn?: string;
|
|
276
|
+
flexDirectionColumnReverse?: string;
|
|
277
|
+
|
|
278
|
+
// Justify Content Dropdown Options
|
|
279
|
+
justifyContentFlexStart?: string;
|
|
280
|
+
justifyContentCenter?: string;
|
|
281
|
+
justifyContentFlexEnd?: string;
|
|
282
|
+
justifyContentSpaceBetween?: string;
|
|
283
|
+
justifyContentSpaceAround?: string;
|
|
284
|
+
justifyContentSpaceEvenly?: string;
|
|
285
|
+
|
|
286
|
+
// Align Items Dropdown Options
|
|
287
|
+
alignItemsFlexStart?: string;
|
|
288
|
+
alignItemsCenter?: string;
|
|
289
|
+
alignItemsFlexEnd?: string;
|
|
290
|
+
alignItemsStretch?: string;
|
|
291
|
+
alignItemsBaseline?: string;
|
|
292
|
+
|
|
293
|
+
// Font Size Dropdown Options
|
|
294
|
+
fontSizeXS?: string;
|
|
295
|
+
fontSizeSM?: string;
|
|
296
|
+
fontSizeBase?: string;
|
|
297
|
+
fontSizeLG?: string;
|
|
298
|
+
fontSizeXL?: string;
|
|
299
|
+
fontSize2XL?: string;
|
|
300
|
+
fontSize3XL?: string;
|
|
301
|
+
fontSize4XL?: string;
|
|
302
|
+
fontSize5XL?: string;
|
|
303
|
+
|
|
304
|
+
// Font Weight Dropdown Options
|
|
305
|
+
fontWeightThin?: string;
|
|
306
|
+
fontWeightExtralight?: string;
|
|
307
|
+
fontWeightNormal?: string;
|
|
308
|
+
fontWeightMedium?: string;
|
|
309
|
+
fontWeightSemibold?: string;
|
|
310
|
+
fontWeightBold?: string;
|
|
311
|
+
fontWeightExtrabold?: string;
|
|
312
|
+
fontWeightBlack?: string;
|
|
313
|
+
|
|
314
|
+
// Text Decoration Dropdown Options
|
|
315
|
+
textDecorationNone?: string;
|
|
316
|
+
textDecorationUnderline?: string;
|
|
317
|
+
textDecorationLineThrough?: string;
|
|
318
|
+
textDecorationOverline?: string;
|
|
319
|
+
|
|
320
|
+
// Border Style Dropdown Options
|
|
321
|
+
borderStyleSolid?: string;
|
|
322
|
+
borderStyleDashed?: string;
|
|
323
|
+
borderStyleDotted?: string;
|
|
324
|
+
borderStyleDouble?: string;
|
|
325
|
+
borderStyleGroove?: string;
|
|
326
|
+
borderStyleRidge?: string;
|
|
327
|
+
borderStyleInset?: string;
|
|
328
|
+
borderStyleOutset?: string;
|
|
329
|
+
borderStyleNone?: string;
|
|
330
|
+
|
|
331
|
+
// Object Fit Dropdown Options
|
|
332
|
+
objectFitContain?: string;
|
|
333
|
+
objectFitCover?: string;
|
|
334
|
+
objectFitFill?: string;
|
|
335
|
+
objectFitNone?: string;
|
|
336
|
+
objectFitScaleDown?: string;
|
|
337
|
+
|
|
338
|
+
// Action Buttons
|
|
339
|
+
saveButton?: string;
|
|
340
|
+
resetButton?: string;
|
|
341
|
+
cancelButton?: string;
|
|
342
|
+
|
|
343
|
+
// Status Messages
|
|
344
|
+
unsavedChangesText?: string;
|
|
345
|
+
savingText?: string;
|
|
346
|
+
hintText?: string;
|
|
347
|
+
|
|
348
|
+
// Unsaved Changes Dialog
|
|
349
|
+
unsavedDialogTitle?: string;
|
|
350
|
+
unsavedDialogMessage?: string;
|
|
351
|
+
saveChangesButton?: string;
|
|
352
|
+
discardChangesButton?: string;
|
|
353
|
+
continueEditingButton?: string;
|
|
354
|
+
|
|
355
|
+
// Tab Names
|
|
356
|
+
textTabLabel?: string; // Default: "Content"
|
|
357
|
+
imageTabLabel?: string; // Default: "Image"
|
|
358
|
+
styleTabLabel?: string; // Default: "Design"
|
|
359
|
+
|
|
360
|
+
// Badge
|
|
361
|
+
badgeText?: string; // Badge text (default: "Built with Promake")
|
|
362
|
+
badgeUrl?: string; // Badge link URL (default: "https://promake.ai")
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Customizable theme colors
|
|
366
|
+
// All properties are optional, defaults are used if not provided
|
|
367
|
+
export interface InspectorTheme {
|
|
368
|
+
// Control Box
|
|
369
|
+
backgroundColor?: string; // Control box background color (default: #ffffff)
|
|
370
|
+
textColor?: string; // Label and text color (default: #111827)
|
|
371
|
+
secondaryTextColor?: string; // Secondary text color (default: #6b7280)
|
|
372
|
+
|
|
373
|
+
// Buttons
|
|
374
|
+
buttonColor?: string; // Primary button background color (default: #4417db)
|
|
375
|
+
buttonTextColor?: string; // Primary button text color (default: #ffffff)
|
|
376
|
+
buttonHoverColor?: string; // Primary button hover color (default: #3a13c0)
|
|
377
|
+
secondaryButtonColor?: string; // Secondary button background color (default: #f3f4f6)
|
|
378
|
+
secondaryButtonTextColor?: string; // Secondary button text color (default: #6b7280)
|
|
379
|
+
secondaryButtonHoverColor?: string; // Secondary button hover color (default: #e5e7eb)
|
|
380
|
+
dangerButtonColor?: string; // Danger button background color (default: #ef4444)
|
|
381
|
+
dangerButtonTextColor?: string; // Danger button text color (default: #ffffff)
|
|
382
|
+
|
|
383
|
+
// Inputs
|
|
384
|
+
inputBackgroundColor?: string; // Input/textarea background color (default: #f9fafb)
|
|
385
|
+
inputTextColor?: string; // Input/textarea text color (default: #111827)
|
|
386
|
+
inputBorderColor?: string; // Input/textarea border color (default: #d1d5db)
|
|
387
|
+
inputFocusBorderColor?: string; // Input/textarea focus border color (default: #4417db)
|
|
388
|
+
inputPlaceholderColor?: string; // Input/textarea placeholder color (default: #9ca3af)
|
|
389
|
+
|
|
390
|
+
// Borders & Dividers
|
|
391
|
+
borderColor?: string; // General border/divider color (default: #e5e7eb)
|
|
392
|
+
|
|
393
|
+
// Status Colors
|
|
394
|
+
warningColor?: string; // Warning text color (default: #f59e0b)
|
|
395
|
+
successColor?: string; // Success text color (default: #10b981)
|
|
396
|
+
errorColor?: string; // Error text color (default: #ef4444)
|
|
397
|
+
|
|
398
|
+
// Tabs
|
|
399
|
+
tabContainerBg?: string; // Tab container background color (default: #f9fafb)
|
|
400
|
+
tabActiveBg?: string; // Active tab background color (default: #4417db)
|
|
401
|
+
tabInactiveBg?: string; // Inactive tab background color (default: transparent)
|
|
402
|
+
tabActiveColor?: string; // Active tab text color (default: #ffffff)
|
|
403
|
+
tabInactiveColor?: string; // Inactive tab text color (default: #6b7280)
|
|
404
|
+
|
|
405
|
+
// Badge
|
|
406
|
+
badgeGradientStart?: string; // Badge gradient start color (default: #411E93)
|
|
407
|
+
badgeGradientEnd?: string; // Badge gradient end color (default: #E87C85)
|
|
408
|
+
badgeTextColor?: string; // Badge text color (default: #ffffff)
|
|
409
|
+
|
|
410
|
+
// Overlay
|
|
411
|
+
overlayColor?: string; // Element selection overlay color (default: #4417db with opacity)
|
|
412
|
+
overlayOpacity?: number; // Element selection overlay opacity (default: 0.2)
|
|
413
|
+
|
|
414
|
+
// Dialog
|
|
415
|
+
dialogBackdropColor?: string; // Dialog backdrop color (default: rgba(0, 0, 0, 0.6))
|
|
416
|
+
dialogBackgroundColor?: string; // Dialog background color (default: #ffffff)
|
|
417
|
+
dialogTextColor?: string; // Dialog text color (default: #111827)
|
|
418
|
+
dialogSecondaryTextColor?: string; // Dialog secondary text color (default: #6b7280)
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Content input request data
|
|
422
|
+
export interface ContentInputRequestData {
|
|
423
|
+
show: boolean; // Whether to show or hide content input
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// Hook callbacks
|
|
427
|
+
export interface InspectorCallbacks {
|
|
428
|
+
onElementSelected?: (data: SelectedElementData) => void;
|
|
429
|
+
onUrlChange?: (data: UrlChangeData) => void;
|
|
430
|
+
onPromptSubmitted?: (data: PromptSubmittedData) => void;
|
|
431
|
+
onTextUpdated?: (data: TextUpdatedData) => void;
|
|
432
|
+
onImageUpdated?: (data: ImageUpdatedData) => void;
|
|
433
|
+
onStyleUpdated?: (data: StyleUpdatedData) => void; // Callback for style changes
|
|
434
|
+
onInspectorClosed?: () => void;
|
|
435
|
+
onError?: (data: ErrorData) => void;
|
|
436
|
+
onElementInfoReceived?: (data: ElementInfoData) => void; // Callback for element info responses
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// Hook return type
|
|
440
|
+
export interface UseInspectorReturn {
|
|
441
|
+
isInspecting: boolean;
|
|
442
|
+
toggleInspector: (active?: boolean) => void;
|
|
443
|
+
startInspecting: () => void;
|
|
444
|
+
stopInspecting: () => void;
|
|
445
|
+
showContentInput: (show: boolean, updateImmediately?: boolean) => void; // Show/hide text content input
|
|
446
|
+
showImageInput: (show: boolean, updateImmediately?: boolean) => void; // Show/hide image input
|
|
447
|
+
showStyleEditor: (show: boolean) => void; // Show/hide style editor
|
|
448
|
+
setBadgeVisible: (visible: boolean) => void; // Show/hide "Built by Promake" badge
|
|
449
|
+
highlightElement: (id: string, options?: HighlightOptions) => void; // Highlight an element in the iframe
|
|
450
|
+
getElementByInspectorId: (id: string) => void; // Request element info by inspector ID
|
|
451
|
+
setShowChildBorders: (show: boolean) => void; // Toggle child borders visibility
|
|
452
|
+
}
|