@promakeai/inspector-types 1.0.0 → 1.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promakeai/inspector-types",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Shared TypeScript types for @promakeai/inspector",
5
5
  "author": "Promake",
6
6
  "type": "module",
@@ -15,8 +15,7 @@
15
15
  "./package.json": "./package.json"
16
16
  },
17
17
  "files": [
18
- "dist",
19
- "src"
18
+ "dist"
20
19
  ],
21
20
  "scripts": {
22
21
  "build": "tsc --build",
@@ -29,11 +28,6 @@
29
28
  "types",
30
29
  "typescript"
31
30
  ],
32
- "repository": {
33
- "type": "git",
34
- "url": "https://github.com/promakeai/inspector.git",
35
- "directory": "packages/types"
36
- },
37
31
  "publishConfig": {
38
32
  "access": "public"
39
33
  }
package/src/index.js DELETED
@@ -1,7 +0,0 @@
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 {};
package/src/index.ts DELETED
@@ -1,452 +0,0 @@
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
- }